import store from '@/store'

// 枚举类型
export function ClientData() {
    return store.getters.clientdata
}
// 获取类型名
export function GetClientDataItem(type, item) {
    const types = store.getters.clientdata
    let name = types[type]
    if (name === undefined) {
      return '未知'
    }
    name = (types[type])[item]
    if (name === undefined) {
        return '未知'
      }
    return name
}
// 获取类型列表
export function GetClientDataList(type) {
    const types = store.getters.clientdata
    const name = types[type]
    if (name === undefined) {
        return []
      }
    const list = []
    for (var item in name) {
        list.push({
            code: Number(item),
            val: name[item]
        })
    }
    return list
}
