v3.20.0 【新增】优化登录使用spring cache;【新增】优化部门cache;【新增】代码生成枚举;【优化】三级等保Label显示宽度

This commit is contained in:
zhuoda
2025-05-03 21:31:28 +08:00
parent f198a949c9
commit 3fb4dfad09
92 changed files with 872 additions and 1023 deletions

View File

@@ -1,6 +1,4 @@
import { defineStore } from 'pinia';
import { dictApi } from '/@/api/support/dict-api';
import { smartSentry } from '/@/lib/smart-sentry';
import { DICT_SPLIT } from '/@/constants/support/dict-const.js';
import _ from 'lodash';
@@ -23,14 +21,21 @@ export const useDictStore = defineStore({
// 获取字典的值名称
getDataLabels(dictCode, dataValue) {
if (!dataValue) {
if (_.isNil(dataValue) || _.isNaN(dataValue)) {
return '';
}
let dict = this.getDictData(dictCode);
if (dict.length === 0) {
return '';
}
// 是数字的话,需要特殊处理
if(_.isNumber(dataValue)){
let target = _.find(dict, { dataValue: dataValue });
return target ? target.dataLabel : '';
}
let valueArray = dataValue.split(DICT_SPLIT);
let result = [];
for (let item of valueArray) {
@@ -42,7 +47,7 @@ export const useDictStore = defineStore({
return result.join(DICT_SPLIT);
},
// 初始化字典
initData(dictDataList){
initData(dictDataList) {
this.dictMap.clear();
for (let data of dictDataList) {
let dataArray = this.dictMap.get(data.dictCode);