|
|
@ -2,7 +2,7 @@ |
|
|
|
import { defineComponent, PropType, ref } from 'vue' |
|
|
|
import { isHexColor } from '@/utils/color' |
|
|
|
import { ElTag } from 'element-plus' |
|
|
|
import { DictDataType, getStrDictOptions } from '@/utils/dict' |
|
|
|
import { DictDataType, getDictOptions } from '@/utils/dict' |
|
|
|
|
|
|
|
export default defineComponent({ |
|
|
|
name: 'DictTag', |
|
|
@ -22,12 +22,12 @@ export default defineComponent({ |
|
|
|
const getDictObj = (dictType: string, value: string) => { |
|
|
|
// 判断 是否多个回显标签 |
|
|
|
if (value.indexOf(',') == -1) { |
|
|
|
const dictOptions = getStrDictOptions(dictType) |
|
|
|
const dictOptions = getDictOptions(dictType) |
|
|
|
dictData.value = dictOptions.find(dictOptionsItem => (dictOptionsItem.value == value)) |
|
|
|
} else { |
|
|
|
dictDataList = [] |
|
|
|
value.split(',').forEach(item => { |
|
|
|
const dictOptions = getStrDictOptions(dictType) |
|
|
|
const dictOptions = getDictOptions(dictType) |
|
|
|
dictDataList.push(dictOptions.find(dictOptionsItem => (dictOptionsItem.value == item))) |
|
|
|
}) |
|
|
|
} |
|
|
|