mirror of
https://gitee.com/lab1024/smart-admin.git
synced 2026-03-03 05:54:25 +08:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
442cf7adb3 | ||
|
|
cb0852406a | ||
|
|
37bcfc22c4 | ||
|
|
099b9d7fbb |
@@ -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',
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -42,7 +42,7 @@
|
|||||||
import { JAVA_FILE_LIST, LANGUAGE_LIST, JS_FILE_LIST, TS_FILE_LIST } from '../../code-generator-util';
|
import { JAVA_FILE_LIST, LANGUAGE_LIST, JS_FILE_LIST, TS_FILE_LIST } from '../../code-generator-util';
|
||||||
import { smartSentry } from '/@/lib/smart-sentry';
|
import { smartSentry } from '/@/lib/smart-sentry';
|
||||||
import { lineNumbersBlock } from '/@/lib/highlight-line-number';
|
import { lineNumbersBlock } from '/@/lib/highlight-line-number';
|
||||||
import hljs from 'highlight';
|
import hljs from 'highlight.js';
|
||||||
import 'highlight.js/styles/github-dark.css';
|
import 'highlight.js/styles/github-dark.css';
|
||||||
import javascript from 'highlight.js/lib/languages/javascript';
|
import javascript from 'highlight.js/lib/languages/javascript';
|
||||||
import typescript from 'highlight.js/lib/languages/typescript';
|
import typescript from 'highlight.js/lib/languages/typescript';
|
||||||
|
|||||||
@@ -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) {
|
||||||
|
|||||||
@@ -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',
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -42,7 +42,7 @@
|
|||||||
import { JAVA_FILE_LIST, LANGUAGE_LIST, JS_FILE_LIST, TS_FILE_LIST } from '../../code-generator-util';
|
import { JAVA_FILE_LIST, LANGUAGE_LIST, JS_FILE_LIST, TS_FILE_LIST } from '../../code-generator-util';
|
||||||
import { smartSentry } from '/@/lib/smart-sentry';
|
import { smartSentry } from '/@/lib/smart-sentry';
|
||||||
import { lineNumbersBlock } from '/@/lib/highlight-line-number';
|
import { lineNumbersBlock } from '/@/lib/highlight-line-number';
|
||||||
import hljs from 'highlight';
|
import hljs from 'highlight.js';
|
||||||
import 'highlight.js/styles/github-dark.css';
|
import 'highlight.js/styles/github-dark.css';
|
||||||
import javascript from 'highlight.js/lib/languages/javascript';
|
import javascript from 'highlight.js/lib/languages/javascript';
|
||||||
import typescript from 'highlight.js/lib/languages/typescript';
|
import typescript from 'highlight.js/lib/languages/typescript';
|
||||||
|
|||||||
@@ -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) {
|
||||||
|
|||||||
@@ -216,7 +216,7 @@ CREATE TABLE `t_dict_data` (
|
|||||||
`dict_id` bigint NOT NULL COMMENT '字典id',
|
`dict_id` bigint NOT NULL COMMENT '字典id',
|
||||||
`data_value` varchar(500) NOT NULL COMMENT '字典项值',
|
`data_value` varchar(500) NOT NULL COMMENT '字典项值',
|
||||||
`data_label` varchar(500) NOT NULL COMMENT '字典项显示名称',
|
`data_label` varchar(500) NOT NULL COMMENT '字典项显示名称',
|
||||||
`data_style` varchar(500) NULL COMMENT '字典项样式'
|
`data_style` varchar(500) NULL COMMENT '字典项样式',
|
||||||
`remark` varchar(1000) DEFAULT NULL COMMENT '备注',
|
`remark` varchar(1000) DEFAULT NULL COMMENT '备注',
|
||||||
`sort_order` int NOT NULL COMMENT '排序(越大越靠前)',
|
`sort_order` int NOT NULL COMMENT '排序(越大越靠前)',
|
||||||
`disabled_flag` tinyint NOT NULL DEFAULT '0' COMMENT '禁用状态',
|
`disabled_flag` tinyint NOT NULL DEFAULT '0' COMMENT '禁用状态',
|
||||||
|
|||||||
Reference in New Issue
Block a user