行选择卡顿问题在3.6.3版本依然存在 #1120

pull/1164/head
JEECG 2024-03-25 16:00:52 +08:00
parent 8d984846af
commit c48041a2b5
2 changed files with 21 additions and 4 deletions

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;