import { toRaw } from 'vue';
import { DictionaryStore } from '/@/stores/dictionary';

/** 
  * @method 获取指定name字典 
  */
export const dictionary = (name: string) => {
  const dict = DictionaryStore()
  const dictionary = toRaw(dict.data)
  if (!dictionary || Object.keys(dictionary).length === 0) {
    DictionaryStore().getSystemDictionarys()
  }
  return dictionary[name]
}