使用字典配置替换枚举.
This commit is contained in:
@@ -25,11 +25,15 @@
|
||||
import DictKeyTable from './components/dict-key-table.vue';
|
||||
import DictKeyFormModal from './components/dict-key-form-modal.vue';
|
||||
import DictKeyViewModal from './components/dict-key-view-modal.vue';
|
||||
import { useDictStore } from '@/store';
|
||||
import { dictKeys } from './types/const';
|
||||
|
||||
const table = ref();
|
||||
const modal = ref();
|
||||
const view = ref();
|
||||
|
||||
useDictStore().loadKeys(dictKeys);
|
||||
|
||||
// 添加回调
|
||||
const modalAddCallback = () => {
|
||||
table.value.addedCallback();
|
||||
|
||||
@@ -1,27 +1,38 @@
|
||||
import { ValueTypeEnum } from './enum.types';
|
||||
// 配置值类型定义
|
||||
export const ValueType = {
|
||||
STRING: 'STRING',
|
||||
INTEGER: 'INTEGER',
|
||||
DECIMAL: 'DECIMAL',
|
||||
BOOLEAN: 'BOOLEAN',
|
||||
COLOR: 'COLOR',
|
||||
};
|
||||
|
||||
/**
|
||||
* 快捷定义字段
|
||||
*/
|
||||
export const definedExtraKeys = [{
|
||||
name: 'disabled',
|
||||
type: ValueTypeEnum.BOOLEAN.value
|
||||
}, {
|
||||
name: 'status',
|
||||
type: ValueTypeEnum.STRING.value
|
||||
}, {
|
||||
name: 'type',
|
||||
type: ValueTypeEnum.STRING.value
|
||||
}, {
|
||||
name: 'color',
|
||||
type: ValueTypeEnum.COLOR.value
|
||||
}];
|
||||
// 快捷定义字段
|
||||
export const definedExtraKeys = [
|
||||
{
|
||||
name: 'disabled',
|
||||
type: ValueType.BOOLEAN
|
||||
}, {
|
||||
name: 'status',
|
||||
type: ValueType.STRING
|
||||
}, {
|
||||
name: 'type',
|
||||
type: ValueType.STRING
|
||||
}, {
|
||||
name: 'color',
|
||||
type: ValueType.COLOR
|
||||
}
|
||||
];
|
||||
|
||||
/**
|
||||
* 内置字段
|
||||
*/
|
||||
// 内置字段
|
||||
export const innerKeys = ['value', 'label'];
|
||||
|
||||
// 菜单配置值类型 字典项
|
||||
export const dictValueTypeKey = 'dictValueType';
|
||||
|
||||
// 加载的字典值
|
||||
export const dictKeys = [dictValueTypeKey];
|
||||
|
||||
/**
|
||||
* 额外参数类型
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user