Compare commits

...

10 Commits

16 changed files with 10399 additions and 40 deletions

View File

@ -35,6 +35,11 @@
if (newValue === ThemeEnum.DARK) {
appTheme.value.algorithm = theme.darkAlgorithm;
}
// update-begin--author:liaozhiyang---date:20240322---forQQYUN-8570
if (import.meta.env.PROD) {
changeTheme(appStore.getProjectConfig.themeColor);
}
// update-end--author:liaozhiyang---date:20240322---forQQYUN-8570
appTheme.value = {
...appTheme.value,
};

View File

@ -59,9 +59,9 @@
instance && emit('register', drawerInstance, instance.uid);
const getMergeProps = computed((): DrawerProps => {
// update-begin--author:liaozhiyang---date:20240306---forQQYUN-8389vue3.4footer
return { ...deepMerge(toRaw(props), unref(propsRef)) };
// update-end--author:liaozhiyang---date:20240306---forQQYUN-8389vue3.4footer
// update-begin--author:liaozhiyang---date:20240320---forQQYUN-8389vue3.4footertoRow,propscomputed
return { ...deepMerge(props, unref(propsRef)) };
// update-end--author:liaozhiyang---date:20240320---forQQYUN-8389vue3.4footertoRow,propscomputed
});
const getProps = computed((): DrawerProps => {

View File

@ -105,6 +105,22 @@
return disabled;
});
// update-begin--author:liaozhiyang---date:20240308---forQQYUN-8377formSchema props
const getDynamicPropsValue = computed(() => {
const { dynamicPropsVal, dynamicPropskey } = props.schema;
if (dynamicPropskey == null) {
return null;
} else {
const { [dynamicPropskey]: itemValue } = unref(getComponentsProps);
let value = itemValue;
if (isFunction(dynamicPropsVal)) {
value = dynamicPropsVal(unref(getValues));
return value;
}
}
});
// update-end--author:liaozhiyang---date:20240308---forQQYUN-8377formSchema props
function getShow(): { isShow: boolean; isIfShow: boolean } {
const { show, ifShow } = props.schema;
const { showAdvancedButton } = props.formProps;
@ -276,6 +292,12 @@
...unref(getComponentsProps),
disabled: unref(getDisable),
};
// update-begin--author:liaozhiyang---date:20240308---forQQYUN-8377formSchema props
const dynamicPropskey = props.schema.dynamicPropskey;
if (dynamicPropskey) {
propsData[dynamicPropskey] = unref(getDynamicPropsValue);
}
// update-end--author:liaozhiyang---date:20240308---forQQYUN-8377formSchema props
const isCreatePlaceholder = !propsData.disabled && autoSetPlaceHolder;
// RangePicker place
@ -315,21 +337,19 @@
//update-begin-author:taoyan date:2022-9-7 for: VUEN-2061online4 ..
//label
const { label, helpMessage, helpComponentProps, subLabel, labelLength } = props.schema;
let showLabel:string = (label+'')
if(labelLength && showLabel.length>4){
let showLabel: string = label + '';
if (labelLength && showLabel.length > 4) {
showLabel = showLabel.substr(0, labelLength);
}
const titleObj = {title: label}
const titleObj = { title: label };
const renderLabel = subLabel ? (
<span>
{label} <span class="text-secondary">{subLabel}</span>
</span>
) : labelLength ? (
<label {...titleObj}>{showLabel}</label>
) : (
labelLength ? (
<label {...titleObj}>{showLabel}</label>
) : (
label
)
label
);
//update-end-author:taoyan date:2022-9-7 for: VUEN-2061online4 ..
const getHelpMessage = isFunction(helpMessage) ? helpMessage(unref(getValues)) : helpMessage;
@ -391,14 +411,14 @@
}
const { baseColProps = {} } = props.formProps;
// update-begin--author:liaozhiyang---date:20230803---forissues-641span
// update-begin--author:liaozhiyang---date:20230803---forissues-641span
const { getIsMobile } = useAppInject();
let realColProps;
realColProps = { ...baseColProps, ...colProps };
if (colProps['span'] && !unref(getIsMobile)) {
['xs', 'sm', 'md', 'lg', 'xl', 'xxl'].forEach((name) => delete realColProps[name]);
}
// update-end--author:liaozhiyang---date:20230803---forissues-641span
// update-end--author:liaozhiyang---date:20230803---forissues-641span
const { isIfShow, isShow } = getShow();
const values = unref(getValues);

View File

@ -192,6 +192,11 @@ export interface FormSchema {
dynamicDisabled?: boolean | ((renderCallbackParams: RenderCallbackParams) => boolean);
dynamicRules?: (renderCallbackParams: RenderCallbackParams) => Rule[];
// update-begin--author:liaozhiyang---date:20240308---for【QQYUN-8377】formSchema props支持动态修改
// 设置组件props的key
dynamicPropskey?: string;
dynamicPropsVal?: ((renderCallbackParams: RenderCallbackParams) => any);
// update-end--author:liaozhiyang---date:20240308---for【QQYUN-8377】formSchema props支持动态修改
// 这个属性自定义的 用于自定义的业务 比如在表单打开的时候修改表单的禁用状态但是又不能重写componentProps因为他的内容太多了所以使用dynamicDisabled和buss实现
buss?: any;

View File

@ -130,10 +130,11 @@
if (!props.visible) return;
const wrapperRefDom = unref(wrapperRef);
if (!wrapperRefDom) return;
const bodyDom = wrapperRefDom.$el.parentElement;
// update-begin--author:liaozhiyang---date:20240320---forQQYUN-8573BasicModal
const bodyDom = wrapperRefDom.$el.parentElement?.parentElement?.parentElement;
// update-end--author:liaozhiyang---date:20240320---forBasicModal
if (!bodyDom) return;
bodyDom.style.padding = '0';
// bodyDom.style.padding = '0';
await nextTick();
try {

View File

@ -118,7 +118,12 @@
const initOptions = computed(() => {
const { height, options, toolbar, plugins, menubar } = props;
const publicPath = import.meta.env.VITE_PUBLIC_PATH || '/';
let publicPath = import.meta.env.VITE_PUBLIC_PATH || '/';
// update-begin--author:liaozhiyang---date:20240320---forQQYUN-8571/
if (!publicPath.endsWith('/')) {
publicPath += '/';
}
// update-end--author:liaozhiyang---date:20240320---forQQYUN-8571/
return {
selector: `#${unref(tinymceId)}`,
height,

View File

@ -1,10 +1,19 @@
import { getThemeColors, generateColors } from '../../../build/config/themeConfig';
import { replaceStyleVariables } from '@rys-fe/vite-plugin-theme/es/client';
import {
replaceStyleVariables,
loadDarkThemeCss,
replaceCssColors,
darkCssIsReady,
linkID,
styleTagId,
appendCssToDom,
getStyleDom,
} from '@rys-fe/vite-plugin-theme/es/client';
import { mixLighten, mixDarken, tinycolor } from '@rys-fe/vite-plugin-theme/es/colorUtils';
import { useAppStore } from '/@/store/modules/app';
import { defHttp } from '/@/utils/http/axios';
let cssText = '';
export async function changeTheme(color: string) {
// update-begin--author:liaozhiyang---date:20231218---for【QQYUN-6366】升级到antd4.x
const appStore = useAppStore();
@ -16,17 +25,32 @@ export async function changeTheme(color: string) {
tinycolor,
color,
});
let res = await replaceStyleVariables({
colorVariables: [...getThemeColors(color), ...colors],
});
fixDark();
return res;
// update-begin--author:liaozhiyang---date:20240322---for【QQYUN-8570】生产环境暗黑模式下主题色不生效
if (import.meta.env.PROD && appStore.getDarkMode === 'dark') {
if (!darkCssIsReady && !cssText) {
await loadDarkThemeCss();
}
const el: HTMLLinkElement = document.getElementById(linkID) as HTMLLinkElement;
if (el?.href) {
// cssText = await fetchCss(el.href) as string;
!cssText && (cssText = await defHttp.get({ url: el.href }, { isTransformResponse: false }));
const colorVariables = [...getThemeColors(color), ...colors];
const processCss = await replaceCssColors(cssText, colorVariables);
appendCssToDom(getStyleDom(styleTagId) as HTMLStyleElement, processCss);
}
} else {
await replaceStyleVariables({
colorVariables: [...getThemeColors(color), ...colors],
});
fixDark();
}
// update-end--author:liaozhiyang---date:20240322---for【QQYUN-8570】生产环境暗黑模式下主题色不生效
}
// 【LOWCOD-2262】修复黑暗模式下切换皮肤无效的问题
async function fixDark() {
let el = document.getElementById('__VITE_PLUGIN_THEME__');
// update-begin--author:liaozhiyang---date:20240322---for【QQYUN-8570】生产环境暗黑模式下主题色不生效
const el = document.getElementById(styleTagId);
// update-end--author:liaozhiyang---date:20240322---for【QQYUN-8570】生产环境暗黑模式下主题色不生效
if (el) {
el.innerHTML = el.innerHTML.replace(/\\["']dark\\["']/g, `'dark'`);
}

View File

@ -174,7 +174,11 @@ export function createPermissionGuard(router: Router) {
// }
// }
//update-end---author:scott ---date::2024-02-21 for【QQYUN-8326】刷新首页不需要重新获获取用户信息---
// update-begin--author:liaozhiyang---date:20240321---for【QQYUN-8572】表格行选择卡顿问题customRender中字典引起的
if (userStore.getLastUpdateTime === 0) {
userStore.setAllDictItemsByLocal();
}
// update-end--author:liaozhiyang---date:20240321---for【QQYUN-8572】表格行选择卡顿问题customRender中字典引起的
if (permissionStore.getIsDynamicAddedRoute) {
next();
return;

View File

@ -19,11 +19,14 @@ import { useGlobSetting } from '/@/hooks/setting';
import { JDragConfigEnum } from '/@/enums/jeecgEnum';
import { useSso } from '/@/hooks/web/useSso';
import { isOAuth2AppEnv } from "/@/views/sys/login/useLogin";
interface dictType {
[key: string]: any;
}
interface UserState {
userInfo: Nullable<UserInfo>;
token?: string;
roleList: RoleEnum[];
dictItems?: [];
dictItems?: dictType | null;
sessionTimeout?: boolean;
lastUpdateTime: number;
tenantid?: string | number;
@ -41,7 +44,7 @@ export const useUserStore = defineStore({
// 角色列表
roleList: [],
// 字典
dictItems: [],
dictItems: null,
// session过期时间
sessionTimeout: false,
// Last fetch time
@ -109,6 +112,16 @@ export const useUserStore = defineStore({
this.dictItems = dictItems;
setAuthCache(DB_DICT_DATA_KEY, dictItems);
},
setAllDictItemsByLocal() {
// update-begin--author:liaozhiyang---date:20240321---for【QQYUN-8572】表格行选择卡顿问题customRender中字典引起的
if (!this.dictItems) {
const allDictItems = getAuthCache(DB_DICT_DATA_KEY);
if (allDictItems) {
this.dictItems = allDictItems;
}
}
// update-end--author:liaozhiyang---date:20240321---for【QQYUN-8572】表格行选择卡顿问题customRender中字典引起的
},
setTenant(id) {
this.tenantid = id;
setAuthCache(TENANT_ID, id);
@ -121,7 +134,7 @@ export const useUserStore = defineStore({
},
resetState() {
this.userInfo = null;
this.dictItems = [];
this.dictItems = null;
this.token = '';
this.roleList = [];
this.sessionTimeout = false;

View File

@ -2,8 +2,8 @@
<BasicForm
ref="formElRef"
:class="'jee-select-demo-form'"
:labelCol="{ span: 5 }"
:wrapperCol="{ span: 15 }"
:labelCol="{ span: 6 }"
:wrapperCol="{ span: 14 }"
:showResetButton="false"
:showSubmitButton="false"
:schemas="schemas"

View File

@ -710,4 +710,60 @@ export const schemas: FormSchema[] = [
span: 12,
},
},
{
field: 'sex',
component: 'JDictSelectTag',
label: '性别(控制下方课程options)',
helpMessage: ['component模式','性别不同,下方课程展示选项不同'],
componentProps: {
dictCode: 'sex',
type: 'radioButton',
onChange: (value) => {
console.log(value);
},
},
colProps: {
span: 12,
},
},
{
field: 'sex',
component: 'JEllipsis',
label: '选中值',
colProps: { span: 12 },
},
{
field: 'course',
component: 'Select',
label: '课程',
dynamicPropskey: 'options',
dynamicPropsVal: ({ model }) => {
let options;
if (model.sex == 1) {
return [
{ value: '0', label: 'java - 男' },
{ value: '1', label: 'vue - 男' },
];
} else if (model.sex == 2) {
return [
{ value: '2', label: '瑜伽 - 女' },
{ value: '3', label: '美甲 - 女' },
];
} else {
return [];
}
},
componentProps: {
disabled: false,
},
colProps: {
span: 12,
},
},
{
field: 'course',
component: 'JEllipsis',
label: '选中值',
colProps: { span: 12 },
},
];

View File

@ -18,11 +18,7 @@
// labelWidth: 150,
schemas: formSchema,
showActionButtonGroup: false,
// update-begin--author:liaozhiyang---date:20231017---forissues/790
labelWidth: 100,
labelCol: null,
wrapperCol: null,
// update-end--author:liaozhiyang---date:20231017---forissues/790
});
//
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {

View File

@ -10,6 +10,7 @@
import { BasicDrawer, useDrawerInner } from '/@/components/Drawer';
import { list, saveOrUpdateMenu } from './menu.api';
import { useDrawerAdaptiveWidth } from '/@/hooks/jeecg/useAdaptiveWidth';
import { useI18n } from "/@/hooks/web/useI18n";
// Emits
const emit = defineEmits(['success', 'register']);
const { adaptiveWidth } = useDrawerAdaptiveWidth();
@ -41,7 +42,9 @@
updateSchema([
{
field: 'parentId',
componentProps: { treeData },
// update-begin--author:liaozhiyang---date:20240306---forQQYUN-8379
componentProps: { treeData: translateMenu(treeData, 'name') },
// update-end--author:liaozhiyang---date:20240306---forQQYUN-8379
},
{
field: 'name',
@ -113,4 +116,26 @@
}
//update-end---author:wangshuai ---date:20230204 for[QQYUN-4058]------------
}
/**
* 2024-03-06
* liaozhiyang
* 翻译菜单名称
*/
function translateMenu(data, key) {
if (data?.length) {
const { t } = useI18n();
data.forEach((item) => {
if (item[key]) {
if (item[key].includes("t('") && t) {
item[key] = new Function('t', `return ${item[key]}`)(t);
}
}
if (item.children?.length) {
translateMenu(item.children, key);
}
});
}
return data;
}
</script>

View File

@ -39,11 +39,13 @@
import { columns,searchFormSchema } from './menu.data';
import { list, deleteMenu, batchDeleteMenu } from './menu.api';
import { useDefIndexStore } from "@/store/modules/defIndex";
import { useI18n } from "/@/hooks/web/useI18n";
const checkedKeys = ref<Array<string | number>>([]);
const showFooter = ref(true);
const [registerDrawer, { openDrawer }] = useDrawer();
const [registerDrawer1, { openDrawer: openDataRule }] = useDrawer();
const { t } = useI18n();
//
columns[0].customRender = function ({text, record}) {
@ -51,6 +53,11 @@
if (isDefIndex) {
text += '(默认首页)'
}
// update-begin--author:liaozhiyang---date:20240306---forQQYUN-8379
if (text.includes("t('") && t) {
return new Function('t', `return ${text}`)(t);
}
// update-end--author:liaozhiyang---date:20240306---forQQYUN-8379
return text
}

View File

@ -137,7 +137,15 @@
//update-end-author:taoyan date:2022-5-24 for: VUEN-1117issue0523
});
//
const getTitle = computed(() => (!unref(isUpdate) ? '新增用户' : '编辑用户'));
const getTitle = computed(() => {
// update-begin--author:liaozhiyang---date:20240306---forQQYUN-8389title
if (!unref(isUpdate)) {
return '新增用户';
} else {
return unref(showFooter) ? '编辑用户' : '用户详情';
}
// update-end--author:liaozhiyang---date:20240306---forQQYUN-8389title
});
const { adaptiveWidth } = useDrawerAdaptiveWidth();
//

10190
yarn.lock Normal file

File diff suppressed because it is too large Load Diff