talk_appAmin/utils/dict.js

13 lines
355 B
JavaScript

import { ref } from 'vue'
import store from '@/store'
import { getDicts } from "@/api/system/dict/data"
const sex_dict = ref([])
export const getDictLabelByValue = (dictInfo, state) => {
return getDicts(dictInfo).then(e => {
const dict = e.data.find((dict) => dict.dictValue === state);
return dict ? dict : '未知状态';
});
};