talk_appAmin/utils/dict.js

13 lines
355 B
JavaScript
Raw Normal View History

2024-06-09 15:38:05 +08:00
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 : '未知状态';
});
};