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