/*
 * @Author: zhanghaifeng
 * @Date: 2024-11-04 16:39:08
 * @LastEditors: zhanghaifeng
 * @LastEditTime: 2024-11-07 11:18:09
 * @Description:
 * @FilePath: /hospital-project/src/api/select.ts
 */
import { http } from "@/utils/http";
import { ref } from "vue";
export const select = ref<any>([]);
export const selectFrom = ref<any>([]);
export const selectRank = ref<any>([]);
// 字典
type QuotaPageList = {
  code: number;
  msg: string;
  data: Array<any>;
};
export const selectDictList = params => {
  return http.request<QuotaPageList>("get", "/commonDict/selectDictList", {
    params
  });
};
export const getSelectDictListtApi = async () => {
  const { code, data } = await selectDictList({ dictType: "1" });
  if (code == 200) {
    data.forEach(item => {
      if (item.dictTypeName == "指标分类") {
        select.value.push(item);
      }
    });
    return data;
  }
};
export const getFromSelectDictListtApi = async () => {
  const { code, data } = await selectDictList({ dictType: "2" });
  if (code == 200) {
    selectFrom.value = data;
    return data;
  }
};
// 职称
export const getFromSelectDictRankApi = async () => {
  const { code, data } = await selectDictList({ dictType: "4" });
  if (code == 200) {
    data.forEach(item => {
      if (item.dictTypeName == "医师分类") {
        selectRank.value.push(item);
      }
    });
    return data;
  }
};
// 指标来源
