diff --git a/src/utils/dict.ts b/src/utils/dict.ts index 15e57ff2..4f5d63fb 100644 --- a/src/utils/dict.ts +++ b/src/utils/dict.ts @@ -69,7 +69,16 @@ export const getDictObj = (dictType: string, value: any) => { } }) } - +export const getDictLabel = (dictType: string, value: any) => { + const dictOptions: DictDataType[] = getDictOptions(dictType) + const dictLabel = ref('') + dictOptions.forEach((dict: DictDataType) => { + if (dict.value === value) { + dictLabel.value = dict.label + } + }) + return dictLabel.value +} export enum DICT_TYPE { USER_TYPE = 'user_type', COMMON_STATUS = 'common_status',