Compare commits

..

10 Commits

16 changed files with 10399 additions and 40 deletions

View File

@ -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---forQQYUN-8570
if (import.meta.env.PROD) {
changeTheme(appStore.getProjectConfig.themeColor);
}
// update-end--author:liaozhiyang---date:20240322---forQQYUN-8570
appTheme.value = { appTheme.value = {
...appTheme.value, ...appTheme.value,
}; };

View File

@ -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---forQQYUN-8389vue3.4footer // update-begin--author:liaozhiyang---date:20240320---forQQYUN-8389vue3.4footertoRow,propscomputed
return { ...deepMerge(toRaw(props), unref(propsRef)) }; return { ...deepMerge(props, unref(propsRef)) };
// update-end--author:liaozhiyang---date:20240306---forQQYUN-8389vue3.4footer // update-end--author:liaozhiyang---date:20240320---forQQYUN-8389vue3.4footertoRow,propscomputed
}); });
const getProps = computed((): DrawerProps => { const getProps = computed((): DrawerProps => {

View File

@ -105,6 +105,22 @@
return disabled; 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 } { 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---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; const isCreatePlaceholder = !propsData.disabled && autoSetPlaceHolder;
// RangePicker place // RangePicker place
@ -315,21 +337,19 @@
//update-begin-author:taoyan date:2022-9-7 for: VUEN-2061online4 .. //update-begin-author:taoyan date:2022-9-7 for: VUEN-2061online4 ..
//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-2061online4 .. //update-end-author:taoyan date:2022-9-7 for: VUEN-2061online4 ..
const getHelpMessage = isFunction(helpMessage) ? helpMessage(unref(getValues)) : helpMessage; const getHelpMessage = isFunction(helpMessage) ? helpMessage(unref(getValues)) : helpMessage;

View File

@ -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;

View File

@ -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---forQQYUN-8573BasicModal
const bodyDom = wrapperRefDom.$el.parentElement; const bodyDom = wrapperRefDom.$el.parentElement?.parentElement?.parentElement;
// update-end--author:liaozhiyang---date:20240320---forBasicModal
if (!bodyDom) return; if (!bodyDom) return;
bodyDom.style.padding = '0'; // bodyDom.style.padding = '0';
await nextTick(); await nextTick();
try { try {

View File

@ -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---forQQYUN-8571/
if (!publicPath.endsWith('/')) {
publicPath += '/';
}
// update-end--author:liaozhiyang---date:20240320---forQQYUN-8571/
return { return {
selector: `#${unref(tinymceId)}`, selector: `#${unref(tinymceId)}`,
height, height,

View File

@ -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'`);
} }

View File

@ -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;

View File

@ -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;

View File

@ -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"

View File

@ -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 },
},
]; ];

View File

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

View File

@ -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---forQQYUN-8379
componentProps: { treeData: translateMenu(treeData, 'name') },
// update-end--author:liaozhiyang---date:20240306---forQQYUN-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>

View File

@ -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---forQQYUN-8379
if (text.includes("t('") && t) {
return new Function('t', `return ${text}`)(t);
}
// update-end--author:liaozhiyang---date:20240306---forQQYUN-8379
return text return text
} }

View File

@ -137,7 +137,15 @@
//update-end-author:taoyan date:2022-5-24 for: VUEN-1117issue0523 //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(); const { adaptiveWidth } = useDrawerAdaptiveWidth();
// //

10190
yarn.lock Normal file

File diff suppressed because it is too large Load Diff