diff --git a/apps/web-antd/src/components/dict-tag/dict-tag.vue b/apps/web-antd/src/components/dict-tag/dict-tag.vue index 7d9a5f1f3..8aba7d261 100644 --- a/apps/web-antd/src/components/dict-tag/dict-tag.vue +++ b/apps/web-antd/src/components/dict-tag/dict-tag.vue @@ -66,6 +66,7 @@ const dictTag = computed(() => { return { label: dict.label || '', colorType, + cssClass: dict.cssClass, }; }); diff --git a/apps/web-antd/src/components/form-create/components/dict-select.vue b/apps/web-antd/src/components/form-create/components/dict-select.vue index c137a5678..80c26cbad 100644 --- a/apps/web-antd/src/components/form-create/components/dict-select.vue +++ b/apps/web-antd/src/components/form-create/components/dict-select.vue @@ -13,7 +13,7 @@ import { SelectOption, } from 'ant-design-vue'; -import { getDictObj, getIntDictOptions, getStrDictOptions } from '#/utils'; +import { getDictOptions } from '#/utils'; defineOptions({ name: 'DictSelect' }); @@ -25,17 +25,16 @@ const props = withDefaults(defineProps(), { const attrs = useAttrs(); // 获得字典配置 -// TODO @dhb:可以使用 getDictOptions 替代么? -const getDictOptions = computed(() => { +const getDictOption = computed(() => { switch (props.valueType) { case 'bool': { - return getDictObj(props.dictType, 'bool'); + return getDictOptions(props.dictType, 'boolean'); } case 'int': { - return getIntDictOptions(props.dictType); + return getDictOptions(props.dictType, 'number'); } case 'str': { - return getStrDictOptions(props.dictType); + return getDictOptions(props.dictType, 'string'); } default: { return []; @@ -47,7 +46,7 @@ const getDictOptions = computed(() => {