export const getSelectDataFromObj = (obj: Object) => {
  const result = [];
  if (obj) {
    const map = new Map(Object.entries(obj));
    for (const key of map.keys()) {
      let oneSelect = Object.fromEntries([
        ["label", map.get(key)],
        ["value", key],
      ]);
      result.push(oneSelect);
    }
  }
  return result;
}


// 公共处理
export const getMapValueByKey = (key: string, map: Map<string, string>) => {
  if (key && map) {
    let value = map.get(key);
    if (value) {
      return value;
    }
  }
  return key
}
