v3.30.0 【增加】字典项增加回显样式;【优化】文件S3协议对最新minio的支持;【优化】代码生成;【优化】前端vite编译配置

This commit is contained in:
zhuoda
2026-03-02 11:50:53 +08:00
parent cb0852406a
commit 442cf7adb3
4 changed files with 36 additions and 12 deletions

View File

@@ -37,8 +37,8 @@ export const DICT_DATA_STYLE_ENUM = {
desc: '信息', desc: '信息',
color: 'colorInfo', color: 'colorInfo',
}, },
WARN: { WARNING: {
value: 'warn', value: 'warning',
desc: '警告', desc: '警告',
color: 'colorWarning', color: 'colorWarning',
}, },

View File

@@ -66,6 +66,10 @@
bordered bordered
> >
<template #bodyCell="{ record, column }"> <template #bodyCell="{ record, column }">
<template v-if="column.dataIndex === 'dataLabel'">
<span v-if="record.color" :style="{ color: token[record.color] }">{{ record.dataLabel }}</span>
<span v-else> {{ record.dataLabel }} </span>
</template>
<template v-if="column.dataIndex === 'disabledFlag'"> <template v-if="column.dataIndex === 'disabledFlag'">
<a-switch <a-switch
@change="(checked) => handleChangeDisabled(checked, record)" @change="(checked) => handleChangeDisabled(checked, record)"
@@ -89,11 +93,14 @@
import DictDataFormModal from './dict-data-form-modal.vue'; import DictDataFormModal from './dict-data-form-modal.vue';
import { dictApi } from '/@/api/support/dict-api'; import { dictApi } from '/@/api/support/dict-api';
import { SmartLoading } from '/@/components/framework/smart-loading'; import { SmartLoading } from '/@/components/framework/smart-loading';
import { Modal } from 'ant-design-vue'; import { message, Modal, theme } from 'ant-design-vue';
import { message } from 'ant-design-vue';
import { smartSentry } from '/@/lib/smart-sentry'; import { smartSentry } from '/@/lib/smart-sentry';
import BooleanSelect from '/@/components/framework/boolean-select/index.vue'; import BooleanSelect from '/@/components/framework/boolean-select/index.vue';
import _ from 'lodash'; import _ from 'lodash';
import { DICT_DATA_STYLE_ENUM } from '/@/constants/support/dict-const';
const { useToken } = theme;
const { token } = useToken();
// 是否展示抽屉 // 是否展示抽屉
const visible = ref(false); const visible = ref(false);
@@ -168,7 +175,7 @@
let keywordsFilterFlag = true; let keywordsFilterFlag = true;
if (keywords.value) { if (keywords.value) {
keywordsFilterFlag = keywordsFilterFlag =
(item.dataValue &&_.includes(item.dataValue.toLowerCase(), keywords.value.toLowerCase())) || (item.dataValue && _.includes(item.dataValue.toLowerCase(), keywords.value.toLowerCase())) ||
(item.dataLabel && _.includes(item.dataLabel.toLowerCase(), keywords.value.toLowerCase())) || (item.dataLabel && _.includes(item.dataLabel.toLowerCase(), keywords.value.toLowerCase())) ||
(item.remark && _.includes(item.remark.toLowerCase(), keywords.value.toLowerCase())); (item.remark && _.includes(item.remark.toLowerCase(), keywords.value.toLowerCase()));
} }
@@ -187,7 +194,12 @@
try { try {
tableLoading.value = true; tableLoading.value = true;
let responseData = await dictApi.queryDictData(dictId.value); let responseData = await dictApi.queryDictData(dictId.value);
responseData.data.map((e) => (e.enabled = !e.disabledFlag)); responseData.data.map((e) => {
e.enabled = !e.disabledFlag;
if (e.dataStyle) {
e.color = DICT_DATA_STYLE_ENUM[e.dataStyle.toUpperCase()].color;
}
});
dictDataList.value = responseData.data; dictDataList.value = responseData.data;
search(); search();
} catch (e) { } catch (e) {

View File

@@ -37,8 +37,8 @@ export const DICT_DATA_STYLE_ENUM = {
desc: '信息', desc: '信息',
color: 'colorInfo', color: 'colorInfo',
}, },
WARN: { WARNING: {
value: 'warn', value: 'warning',
desc: '警告', desc: '警告',
color: 'colorWarning', color: 'colorWarning',
}, },

View File

@@ -66,6 +66,10 @@
bordered bordered
> >
<template #bodyCell="{ record, column }"> <template #bodyCell="{ record, column }">
<template v-if="column.dataIndex === 'dataLabel'">
<span v-if="record.color" :style="{ color: token[record.color] }">{{ record.dataLabel }}</span>
<span v-else> {{ record.dataLabel }} </span>
</template>
<template v-if="column.dataIndex === 'disabledFlag'"> <template v-if="column.dataIndex === 'disabledFlag'">
<a-switch <a-switch
@change="(checked) => handleChangeDisabled(checked, record)" @change="(checked) => handleChangeDisabled(checked, record)"
@@ -89,11 +93,14 @@
import DictDataFormModal from './dict-data-form-modal.vue'; import DictDataFormModal from './dict-data-form-modal.vue';
import { dictApi } from '/@/api/support/dict-api'; import { dictApi } from '/@/api/support/dict-api';
import { SmartLoading } from '/@/components/framework/smart-loading'; import { SmartLoading } from '/@/components/framework/smart-loading';
import { Modal } from 'ant-design-vue'; import { message, Modal, theme } from 'ant-design-vue';
import { message } from 'ant-design-vue';
import { smartSentry } from '/@/lib/smart-sentry'; import { smartSentry } from '/@/lib/smart-sentry';
import BooleanSelect from '/@/components/framework/boolean-select/index.vue'; import BooleanSelect from '/@/components/framework/boolean-select/index.vue';
import _ from 'lodash'; import _ from 'lodash';
import { DICT_DATA_STYLE_ENUM } from '/@/constants/support/dict-const';
const { useToken } = theme;
const { token } = useToken();
// 是否展示抽屉 // 是否展示抽屉
const visible = ref(false); const visible = ref(false);
@@ -168,7 +175,7 @@
let keywordsFilterFlag = true; let keywordsFilterFlag = true;
if (keywords.value) { if (keywords.value) {
keywordsFilterFlag = keywordsFilterFlag =
(item.dataValue &&_.includes(item.dataValue.toLowerCase(), keywords.value.toLowerCase())) || (item.dataValue && _.includes(item.dataValue.toLowerCase(), keywords.value.toLowerCase())) ||
(item.dataLabel && _.includes(item.dataLabel.toLowerCase(), keywords.value.toLowerCase())) || (item.dataLabel && _.includes(item.dataLabel.toLowerCase(), keywords.value.toLowerCase())) ||
(item.remark && _.includes(item.remark.toLowerCase(), keywords.value.toLowerCase())); (item.remark && _.includes(item.remark.toLowerCase(), keywords.value.toLowerCase()));
} }
@@ -187,7 +194,12 @@
try { try {
tableLoading.value = true; tableLoading.value = true;
let responseData = await dictApi.queryDictData(dictId.value); let responseData = await dictApi.queryDictData(dictId.value);
responseData.data.map((e) => (e.enabled = !e.disabledFlag)); responseData.data.map((e) => {
e.enabled = !e.disabledFlag;
if (e.dataStyle) {
e.color = DICT_DATA_STYLE_ENUM[e.dataStyle.toUpperCase()].color;
}
});
dictDataList.value = responseData.data; dictDataList.value = responseData.data;
search(); search();
} catch (e) { } catch (e) {