Compare commits
10 Commits
e4424ba3b1
...
c48041a2b5
Author | SHA1 | Date |
---|---|---|
|
c48041a2b5 | |
|
8d984846af | |
|
cc67661f11 | |
|
33cb844792 | |
|
68a26826c7 | |
|
6de260014d | |
|
4573a82018 | |
|
7ff461a677 | |
|
41490b3dc8 | |
|
0db23723fb |
|
@ -35,6 +35,11 @@
|
||||||
if (newValue === ThemeEnum.DARK) {
|
if (newValue === ThemeEnum.DARK) {
|
||||||
appTheme.value.algorithm = theme.darkAlgorithm;
|
appTheme.value.algorithm = theme.darkAlgorithm;
|
||||||
}
|
}
|
||||||
|
// update-begin--author:liaozhiyang---date:20240322---for:【QQYUN-8570】生产环境暗黑模式下主题色不生效
|
||||||
|
if (import.meta.env.PROD) {
|
||||||
|
changeTheme(appStore.getProjectConfig.themeColor);
|
||||||
|
}
|
||||||
|
// update-end--author:liaozhiyang---date:20240322---for:【QQYUN-8570】生产环境暗黑模式下主题色不生效
|
||||||
appTheme.value = {
|
appTheme.value = {
|
||||||
...appTheme.value,
|
...appTheme.value,
|
||||||
};
|
};
|
||||||
|
|
|
@ -59,9 +59,9 @@
|
||||||
instance && emit('register', drawerInstance, instance.uid);
|
instance && emit('register', drawerInstance, instance.uid);
|
||||||
|
|
||||||
const getMergeProps = computed((): DrawerProps => {
|
const getMergeProps = computed((): DrawerProps => {
|
||||||
// update-begin--author:liaozhiyang---date:20240306---for:【QQYUN-8389】vue3.4以上版本导致角色抽屉隐藏footer逻辑错误
|
// update-begin--author:liaozhiyang---date:20240320---for:【QQYUN-8389】vue3.4以上版本导致角色抽屉隐藏footer逻辑错误(去掉toRow,否者props变化不会触发computed)
|
||||||
return { ...deepMerge(toRaw(props), unref(propsRef)) };
|
return { ...deepMerge(props, unref(propsRef)) };
|
||||||
// update-end--author:liaozhiyang---date:20240306---for:【QQYUN-8389】vue3.4以上版本导致角色抽屉隐藏footer逻辑错误
|
// update-end--author:liaozhiyang---date:20240320---for:【QQYUN-8389】vue3.4以上版本导致角色抽屉隐藏footer逻辑错误(去掉toRow,否者props变化不会触发computed)
|
||||||
});
|
});
|
||||||
|
|
||||||
const getProps = computed((): DrawerProps => {
|
const getProps = computed((): DrawerProps => {
|
||||||
|
|
|
@ -105,6 +105,22 @@
|
||||||
return disabled;
|
return disabled;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// update-begin--author:liaozhiyang---date:20240308---for:【QQYUN-8377】formSchema 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---for:【QQYUN-8377】formSchema props支持动态修改
|
||||||
|
|
||||||
function getShow(): { isShow: boolean; isIfShow: boolean } {
|
function getShow(): { isShow: boolean; isIfShow: boolean } {
|
||||||
const { show, ifShow } = props.schema;
|
const { show, ifShow } = props.schema;
|
||||||
const { showAdvancedButton } = props.formProps;
|
const { showAdvancedButton } = props.formProps;
|
||||||
|
@ -276,6 +292,12 @@
|
||||||
...unref(getComponentsProps),
|
...unref(getComponentsProps),
|
||||||
disabled: unref(getDisable),
|
disabled: unref(getDisable),
|
||||||
};
|
};
|
||||||
|
// update-begin--author:liaozhiyang---date:20240308---for:【QQYUN-8377】formSchema props支持动态修改
|
||||||
|
const dynamicPropskey = props.schema.dynamicPropskey;
|
||||||
|
if (dynamicPropskey) {
|
||||||
|
propsData[dynamicPropskey] = unref(getDynamicPropsValue);
|
||||||
|
}
|
||||||
|
// update-end--author:liaozhiyang---date:20240308---for:【QQYUN-8377】formSchema props支持动态修改
|
||||||
|
|
||||||
const isCreatePlaceholder = !propsData.disabled && autoSetPlaceHolder;
|
const isCreatePlaceholder = !propsData.disabled && autoSetPlaceHolder;
|
||||||
// RangePicker place是一个数组
|
// RangePicker place是一个数组
|
||||||
|
@ -315,21 +337,19 @@
|
||||||
//update-begin-author:taoyan date:2022-9-7 for: VUEN-2061【样式】online表单超出4个 .. 省略显示
|
//update-begin-author:taoyan date:2022-9-7 for: VUEN-2061【样式】online表单超出4个 .. 省略显示
|
||||||
//label宽度支持自定义
|
//label宽度支持自定义
|
||||||
const { label, helpMessage, helpComponentProps, subLabel, labelLength } = props.schema;
|
const { label, helpMessage, helpComponentProps, subLabel, labelLength } = props.schema;
|
||||||
let showLabel:string = (label+'')
|
let showLabel: string = label + '';
|
||||||
if(labelLength && showLabel.length>4){
|
if (labelLength && showLabel.length > 4) {
|
||||||
showLabel = showLabel.substr(0, labelLength);
|
showLabel = showLabel.substr(0, labelLength);
|
||||||
}
|
}
|
||||||
const titleObj = {title: label}
|
const titleObj = { title: label };
|
||||||
const renderLabel = subLabel ? (
|
const renderLabel = subLabel ? (
|
||||||
<span>
|
<span>
|
||||||
{label} <span class="text-secondary">{subLabel}</span>
|
{label} <span class="text-secondary">{subLabel}</span>
|
||||||
</span>
|
</span>
|
||||||
) : (
|
) : labelLength ? (
|
||||||
labelLength ? (
|
|
||||||
<label {...titleObj}>{showLabel}</label>
|
<label {...titleObj}>{showLabel}</label>
|
||||||
) : (
|
) : (
|
||||||
label
|
label
|
||||||
)
|
|
||||||
);
|
);
|
||||||
//update-end-author:taoyan date:2022-9-7 for: VUEN-2061【样式】online表单超出4个 .. 省略显示
|
//update-end-author:taoyan date:2022-9-7 for: VUEN-2061【样式】online表单超出4个 .. 省略显示
|
||||||
const getHelpMessage = isFunction(helpMessage) ? helpMessage(unref(getValues)) : helpMessage;
|
const getHelpMessage = isFunction(helpMessage) ? helpMessage(unref(getValues)) : helpMessage;
|
||||||
|
|
|
@ -192,6 +192,11 @@ export interface FormSchema {
|
||||||
dynamicDisabled?: boolean | ((renderCallbackParams: RenderCallbackParams) => boolean);
|
dynamicDisabled?: boolean | ((renderCallbackParams: RenderCallbackParams) => boolean);
|
||||||
|
|
||||||
dynamicRules?: (renderCallbackParams: RenderCallbackParams) => Rule[];
|
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实现
|
// 这个属性自定义的 用于自定义的业务 比如在表单打开的时候修改表单的禁用状态,但是又不能重写componentProps,因为他的内容太多了,所以使用dynamicDisabled和buss实现
|
||||||
buss?: any;
|
buss?: any;
|
||||||
|
|
|
@ -130,10 +130,11 @@
|
||||||
if (!props.visible) return;
|
if (!props.visible) return;
|
||||||
const wrapperRefDom = unref(wrapperRef);
|
const wrapperRefDom = unref(wrapperRef);
|
||||||
if (!wrapperRefDom) return;
|
if (!wrapperRefDom) return;
|
||||||
|
// update-begin--author:liaozhiyang---date:20240320---for:【QQYUN-8573】BasicModal组件在非全屏的情况下最大高度获取异常,不论内容高度是否超出屏幕高度,都等于内容高度
|
||||||
const bodyDom = wrapperRefDom.$el.parentElement;
|
const bodyDom = wrapperRefDom.$el.parentElement?.parentElement?.parentElement;
|
||||||
|
// update-end--author:liaozhiyang---date:20240320---for:BasicModal组件在非全屏的情况下最大高度获取异常,不论内容高度是否超出屏幕高度,都等于内容高度
|
||||||
if (!bodyDom) return;
|
if (!bodyDom) return;
|
||||||
bodyDom.style.padding = '0';
|
// bodyDom.style.padding = '0';
|
||||||
await nextTick();
|
await nextTick();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -118,7 +118,12 @@
|
||||||
|
|
||||||
const initOptions = computed(() => {
|
const initOptions = computed(() => {
|
||||||
const { height, options, toolbar, plugins, menubar } = props;
|
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---for:【QQYUN-8571】发布路径不以/结尾资源会加载失败
|
||||||
|
if (!publicPath.endsWith('/')) {
|
||||||
|
publicPath += '/';
|
||||||
|
}
|
||||||
|
// update-end--author:liaozhiyang---date:20240320---for:【QQYUN-8571】发布路径不以/结尾资源会加载失败
|
||||||
return {
|
return {
|
||||||
selector: `#${unref(tinymceId)}`,
|
selector: `#${unref(tinymceId)}`,
|
||||||
height,
|
height,
|
||||||
|
|
|
@ -1,10 +1,19 @@
|
||||||
import { getThemeColors, generateColors } from '../../../build/config/themeConfig';
|
import { getThemeColors, generateColors } from '../../../build/config/themeConfig';
|
||||||
|
import {
|
||||||
import { replaceStyleVariables } from '@rys-fe/vite-plugin-theme/es/client';
|
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 { mixLighten, mixDarken, tinycolor } from '@rys-fe/vite-plugin-theme/es/colorUtils';
|
||||||
import { useAppStore } from '/@/store/modules/app';
|
import { useAppStore } from '/@/store/modules/app';
|
||||||
|
import { defHttp } from '/@/utils/http/axios';
|
||||||
|
|
||||||
|
let cssText = '';
|
||||||
export async function changeTheme(color: string) {
|
export async function changeTheme(color: string) {
|
||||||
// update-begin--author:liaozhiyang---date:20231218---for:【QQYUN-6366】升级到antd4.x
|
// update-begin--author:liaozhiyang---date:20231218---for:【QQYUN-6366】升级到antd4.x
|
||||||
const appStore = useAppStore();
|
const appStore = useAppStore();
|
||||||
|
@ -16,17 +25,32 @@ export async function changeTheme(color: string) {
|
||||||
tinycolor,
|
tinycolor,
|
||||||
color,
|
color,
|
||||||
});
|
});
|
||||||
|
// update-begin--author:liaozhiyang---date:20240322---for:【QQYUN-8570】生产环境暗黑模式下主题色不生效
|
||||||
let res = await replaceStyleVariables({
|
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],
|
colorVariables: [...getThemeColors(color), ...colors],
|
||||||
});
|
});
|
||||||
fixDark();
|
fixDark();
|
||||||
return res;
|
}
|
||||||
|
// update-end--author:liaozhiyang---date:20240322---for:【QQYUN-8570】生产环境暗黑模式下主题色不生效
|
||||||
}
|
}
|
||||||
|
|
||||||
// 【LOWCOD-2262】修复黑暗模式下切换皮肤无效的问题
|
// 【LOWCOD-2262】修复黑暗模式下切换皮肤无效的问题
|
||||||
async function fixDark() {
|
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) {
|
if (el) {
|
||||||
el.innerHTML = el.innerHTML.replace(/\\["']dark\\["']/g, `'dark'`);
|
el.innerHTML = el.innerHTML.replace(/\\["']dark\\["']/g, `'dark'`);
|
||||||
}
|
}
|
||||||
|
|
|
@ -174,7 +174,11 @@ export function createPermissionGuard(router: Router) {
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
//update-end---author:scott ---date::2024-02-21 for:【QQYUN-8326】刷新首页,不需要重新获获取用户信息---
|
//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) {
|
if (permissionStore.getIsDynamicAddedRoute) {
|
||||||
next();
|
next();
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -19,11 +19,14 @@ import { useGlobSetting } from '/@/hooks/setting';
|
||||||
import { JDragConfigEnum } from '/@/enums/jeecgEnum';
|
import { JDragConfigEnum } from '/@/enums/jeecgEnum';
|
||||||
import { useSso } from '/@/hooks/web/useSso';
|
import { useSso } from '/@/hooks/web/useSso';
|
||||||
import { isOAuth2AppEnv } from "/@/views/sys/login/useLogin";
|
import { isOAuth2AppEnv } from "/@/views/sys/login/useLogin";
|
||||||
|
interface dictType {
|
||||||
|
[key: string]: any;
|
||||||
|
}
|
||||||
interface UserState {
|
interface UserState {
|
||||||
userInfo: Nullable<UserInfo>;
|
userInfo: Nullable<UserInfo>;
|
||||||
token?: string;
|
token?: string;
|
||||||
roleList: RoleEnum[];
|
roleList: RoleEnum[];
|
||||||
dictItems?: [];
|
dictItems?: dictType | null;
|
||||||
sessionTimeout?: boolean;
|
sessionTimeout?: boolean;
|
||||||
lastUpdateTime: number;
|
lastUpdateTime: number;
|
||||||
tenantid?: string | number;
|
tenantid?: string | number;
|
||||||
|
@ -41,7 +44,7 @@ export const useUserStore = defineStore({
|
||||||
// 角色列表
|
// 角色列表
|
||||||
roleList: [],
|
roleList: [],
|
||||||
// 字典
|
// 字典
|
||||||
dictItems: [],
|
dictItems: null,
|
||||||
// session过期时间
|
// session过期时间
|
||||||
sessionTimeout: false,
|
sessionTimeout: false,
|
||||||
// Last fetch time
|
// Last fetch time
|
||||||
|
@ -109,6 +112,16 @@ export const useUserStore = defineStore({
|
||||||
this.dictItems = dictItems;
|
this.dictItems = dictItems;
|
||||||
setAuthCache(DB_DICT_DATA_KEY, 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) {
|
setTenant(id) {
|
||||||
this.tenantid = id;
|
this.tenantid = id;
|
||||||
setAuthCache(TENANT_ID, id);
|
setAuthCache(TENANT_ID, id);
|
||||||
|
@ -121,7 +134,7 @@ export const useUserStore = defineStore({
|
||||||
},
|
},
|
||||||
resetState() {
|
resetState() {
|
||||||
this.userInfo = null;
|
this.userInfo = null;
|
||||||
this.dictItems = [];
|
this.dictItems = null;
|
||||||
this.token = '';
|
this.token = '';
|
||||||
this.roleList = [];
|
this.roleList = [];
|
||||||
this.sessionTimeout = false;
|
this.sessionTimeout = false;
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
<BasicForm
|
<BasicForm
|
||||||
ref="formElRef"
|
ref="formElRef"
|
||||||
:class="'jee-select-demo-form'"
|
:class="'jee-select-demo-form'"
|
||||||
:labelCol="{ span: 5 }"
|
:labelCol="{ span: 6 }"
|
||||||
:wrapperCol="{ span: 15 }"
|
:wrapperCol="{ span: 14 }"
|
||||||
:showResetButton="false"
|
:showResetButton="false"
|
||||||
:showSubmitButton="false"
|
:showSubmitButton="false"
|
||||||
:schemas="schemas"
|
:schemas="schemas"
|
||||||
|
|
|
@ -710,4 +710,60 @@ export const schemas: FormSchema[] = [
|
||||||
span: 12,
|
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 },
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
|
@ -18,11 +18,7 @@
|
||||||
// labelWidth: 150,
|
// labelWidth: 150,
|
||||||
schemas: formSchema,
|
schemas: formSchema,
|
||||||
showActionButtonGroup: false,
|
showActionButtonGroup: false,
|
||||||
// update-begin--author:liaozhiyang---date:20231017---for:【issues/790】弹窗内文本框不居中问题
|
|
||||||
labelWidth: 100,
|
labelWidth: 100,
|
||||||
labelCol: null,
|
|
||||||
wrapperCol: null,
|
|
||||||
// update-end--author:liaozhiyang---date:20231017---for:【issues/790】弹窗内文本框不居中问题
|
|
||||||
});
|
});
|
||||||
//表单赋值
|
//表单赋值
|
||||||
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
|
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
import { BasicDrawer, useDrawerInner } from '/@/components/Drawer';
|
import { BasicDrawer, useDrawerInner } from '/@/components/Drawer';
|
||||||
import { list, saveOrUpdateMenu } from './menu.api';
|
import { list, saveOrUpdateMenu } from './menu.api';
|
||||||
import { useDrawerAdaptiveWidth } from '/@/hooks/jeecg/useAdaptiveWidth';
|
import { useDrawerAdaptiveWidth } from '/@/hooks/jeecg/useAdaptiveWidth';
|
||||||
|
import { useI18n } from "/@/hooks/web/useI18n";
|
||||||
// 声明Emits
|
// 声明Emits
|
||||||
const emit = defineEmits(['success', 'register']);
|
const emit = defineEmits(['success', 'register']);
|
||||||
const { adaptiveWidth } = useDrawerAdaptiveWidth();
|
const { adaptiveWidth } = useDrawerAdaptiveWidth();
|
||||||
|
@ -41,7 +42,9 @@
|
||||||
updateSchema([
|
updateSchema([
|
||||||
{
|
{
|
||||||
field: 'parentId',
|
field: 'parentId',
|
||||||
componentProps: { treeData },
|
// update-begin--author:liaozhiyang---date:20240306---for:【QQYUN-8379】菜单管理页菜单国际化
|
||||||
|
componentProps: { treeData: translateMenu(treeData, 'name') },
|
||||||
|
// update-end--author:liaozhiyang---date:20240306---for:【QQYUN-8379】菜单管理页菜单国际化
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'name',
|
field: 'name',
|
||||||
|
@ -113,4 +116,26 @@
|
||||||
}
|
}
|
||||||
//update-end---author:wangshuai ---date:20230204 for:[QQYUN-4058]菜单添加智能化处理------------
|
//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>
|
</script>
|
||||||
|
|
|
@ -39,11 +39,13 @@
|
||||||
import { columns,searchFormSchema } from './menu.data';
|
import { columns,searchFormSchema } from './menu.data';
|
||||||
import { list, deleteMenu, batchDeleteMenu } from './menu.api';
|
import { list, deleteMenu, batchDeleteMenu } from './menu.api';
|
||||||
import { useDefIndexStore } from "@/store/modules/defIndex";
|
import { useDefIndexStore } from "@/store/modules/defIndex";
|
||||||
|
import { useI18n } from "/@/hooks/web/useI18n";
|
||||||
|
|
||||||
const checkedKeys = ref<Array<string | number>>([]);
|
const checkedKeys = ref<Array<string | number>>([]);
|
||||||
const showFooter = ref(true);
|
const showFooter = ref(true);
|
||||||
const [registerDrawer, { openDrawer }] = useDrawer();
|
const [registerDrawer, { openDrawer }] = useDrawer();
|
||||||
const [registerDrawer1, { openDrawer: openDataRule }] = useDrawer();
|
const [registerDrawer1, { openDrawer: openDataRule }] = useDrawer();
|
||||||
|
const { t } = useI18n();
|
||||||
|
|
||||||
// 自定义菜单名称列渲染
|
// 自定义菜单名称列渲染
|
||||||
columns[0].customRender = function ({text, record}) {
|
columns[0].customRender = function ({text, record}) {
|
||||||
|
@ -51,6 +53,11 @@
|
||||||
if (isDefIndex) {
|
if (isDefIndex) {
|
||||||
text += '(默认首页)'
|
text += '(默认首页)'
|
||||||
}
|
}
|
||||||
|
// update-begin--author:liaozhiyang---date:20240306---for:【QQYUN-8379】菜单管理页菜单国际化
|
||||||
|
if (text.includes("t('") && t) {
|
||||||
|
return new Function('t', `return ${text}`)(t);
|
||||||
|
}
|
||||||
|
// update-end--author:liaozhiyang---date:20240306---for:【QQYUN-8379】菜单管理页菜单国际化
|
||||||
return text
|
return text
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -137,7 +137,15 @@
|
||||||
//update-end-author:taoyan date:2022-5-24 for: VUEN-1117【issue】0523周开源问题
|
//update-end-author:taoyan date:2022-5-24 for: VUEN-1117【issue】0523周开源问题
|
||||||
});
|
});
|
||||||
//获取标题
|
//获取标题
|
||||||
const getTitle = computed(() => (!unref(isUpdate) ? '新增用户' : '编辑用户'));
|
const getTitle = computed(() => {
|
||||||
|
// update-begin--author:liaozhiyang---date:20240306---for:【QQYUN-8389】系统用户详情抽屉title更改
|
||||||
|
if (!unref(isUpdate)) {
|
||||||
|
return '新增用户';
|
||||||
|
} else {
|
||||||
|
return unref(showFooter) ? '编辑用户' : '用户详情';
|
||||||
|
}
|
||||||
|
// update-end--author:liaozhiyang---date:20240306---for:【QQYUN-8389】系统用户详情抽屉title更改
|
||||||
|
});
|
||||||
const { adaptiveWidth } = useDrawerAdaptiveWidth();
|
const { adaptiveWidth } = useDrawerAdaptiveWidth();
|
||||||
|
|
||||||
//提交事件
|
//提交事件
|
||||||
|
|
Loading…
Reference in New Issue