import {
  getLevelsByParentId,
  getLevels,
  getLevelsAndChildrenNumber,
  getRegulatoryType,
  getDepartmentTree,
  getLevelsCorp,
} from "@/request/data_dictionary.js";
import { ref } from "vue";

// 监管类型
export const layoutFnGetRegulatoryType = async (params) => {
  const resData = await getRegulatoryType(params);
  return ref(JSON.parse(resData.varOList.zTreeNodes));
};
// 企业状态
export const layoutFnGetEnterpriseStatus = async () => {
  const resData = await getLevels({
    DICTIONARIES_ID: "4d4862f9863b4b0da67f754c49e67ea3",
  });
  return ref(resData.list);
};
// 隶属关系
export const layoutFnGetSubordination = async () => {
  const resData = await getLevels({
    DICTIONARIES_ID: "1a13f574d4c44cd2ac2034f8e3259f9b",
  });
  return ref(resData.list);
};
// 企业规模
export const layoutFnGetEnterpriseScale = async () => {
  const resData = await getLevels({
    DICTIONARIES_ID: "37b045e160c04ddba851073b4e510cc9",
  });
  return ref(resData.list);
};
// 培训行业类型
export const layoutFnGetTrainingIndustryType = async () => {
  const resData = await getLevelsByParentId({
    parentId: "052369aa22d242118236cde52d0c67ea",
  });
  return ref(JSON.parse(resData.zTreeNodes));
};
// 培训岗位类型
export const layoutFnGetTrainingPostType = async () => {
  const resData = await getLevelsByParentId({
    parentId: "f6a7c4f5602f46e291d06b1390a3f820",
  });
  return ref(JSON.parse(resData.zTreeNodes));
};
// 培训板块类型
export const layoutFnGetTrainingPlateType = async () => {
  const resData = await getLevelsByParentId({
    parentId: "d538d11e4eec409ab428f5d2f3c67c24",
  });
  return ref(JSON.parse(resData.zTreeNodes));
};
// 管控措施分类1
export const layoutFnGetControlMeasures1 = async () => {
  const resData = await getLevelsByParentId({
    parentId: "c61ff12d2e6e4040ad0dfd58d75275ae",
  });
  return ref(JSON.parse(resData.zTreeNodes));
};
// 管控措施分类2
export const layoutFnGetControlMeasures2 = async () => {
  const resData = await getLevelsByParentId({
    parentId: "1ca0ce441f8342cca57fd09079ad59b0",
  });
  return ref(JSON.parse(resData.zTreeNodes));
};
// 受限空间类型
export const layoutFnGetTypeOfConfinedSpace = async () => {
  const resData = await getLevels({
    DICTIONARIES_ID: "dad23a464729485ba364994942db83cc",
  });
  return ref(resData.list);
};
// 风险等级
export const layoutFnGetRiskLevel = async () => {
  const resData = await getLevels({
    DICTIONARIES_ID: "a178357ce6ce4d6a9ac95def6aca3a14",
  });
  return ref(resData.list);
};
// 部门级别
export const layoutFnGetDepartmentLevel = async () => {
  const resData = await getLevels({
    DICTIONARIES_ID: "4a661fa8aedc4d158c9cddaa9d2ec47e",
  });
  return ref(resData.list);
};
// 民族
export const layoutFnGetNation = async () => {
  const resData = await getLevels({
    DICTIONARIES_ID: "0a0e406f27f74ee698fe9979d25f62dd",
  });
  return ref(resData.list);
};
// 性别
export const layoutFnGetSex = async () => {
  const resData = await getLevels({
    DICTIONARIES_ID: "21501808bbc344d593fbf9ccfe6c4531",
  });
  return ref(resData.list);
};
// 政治面貌
export const layoutFnGetPoliticalLandscape = async () => {
  const resData = await getLevels({
    DICTIONARIES_ID: "6351efdd12dc4730952e5d195718e252",
  });
  return ref(resData.list);
};
// 文化程度
export const layoutFnGetDegreeOfEducation = async () => {
  const resData = await getLevels({
    DICTIONARIES_ID: "d7d80f08d73a4accbccf4fd3d8d1d867",
  });
  return ref(resData.list);
};
// 人员类型
export const layoutFnGetPersonnelType = async () => {
  const resData = await getLevels({
    DICTIONARIES_ID: "0b62f92b0b624aab8e89a77304a64d5e",
  });
  return ref(resData.list);
};
// 清单类型
export const layoutFnGetInventoryType = async () => {
  const resData = await getLevels({
    DICTIONARIES_ID: "4a3d0d99b0ea4e268c11dd0b18866917",
  });
  return ref(resData.list);
};
// 排查类型
export const layoutFnGetTroubleshootingType = async () => {
  const resData = await getLevels({
    DICTIONARIES_ID: "dc92de8a375c4b638b1b9f8d374e6426",
  });
  return ref(resData.list);
};
// 清单级别
export const layoutFnGetInventoryLevel = async () => {
  const resData = await getLevels({
    DICTIONARIES_ID: "4a661fa8aedc4d158c9cddaa9d2ec47e",
  });
  return ref(resData.list);
};
// 职务
export const layoutFnGetDuties = async () => {
  const resData = await getLevelsCorp({
    DICTIONARIES_ID: "09e36ac01e9540f8bc84eab1c1a78754",
  });
  return ref(resData.list);
};
// 职称
export const layoutFnGetProfessionalTitle = async () => {
  const resData = await getLevelsCorp({
    DICTIONARIES_ID: "945a6b10e59946078b500f0fbafa8679",
  });
  return ref(resData.list);
};
// 工种
export const layoutFnGetJobType = async () => {
  const resData = await getLevelsCorp({
    DICTIONARIES_ID: "55484e491a5e442d839c4595380713ec",
  });
  return ref(resData.list);
};
// 在职情况
export const layoutFnGetEmploymentSituation = async () => {
  const resData = await getLevels({
    DICTIONARIES_ID: "548764b5d4bf4bd7a18ef88274ef49e4",
  });
  return ref(resData.list);
};
// 事故类型
export const layoutFnGetAccidentType = async () => {
  const resData = await getLevels({
    DICTIONARIES_ID: "cee1190ea96a4ca9b7bca81e11f0d0f8",
  });
  return ref(resData.list);
};
// 风险分级
export const layoutFnGetRiskClassification = async () => {
  const resData = await getLevels({
    DICTIONARIES_ID: "5a81e63ec0e94d919b3138bc01dbef6b",
  });
  return ref(resData.list);
};
// 部门树
export const layoutFnGetDepartmentTree = async (params) => {
  const resData = await getDepartmentTree(params);
  return ref(JSON.parse(resData.zTreeNodes));
};
// 无法确定DICTIONARIES_ID的数据字典
export const layoutFnGetLevels = async (DICTIONARIES_ID) => {
  const resData = await getLevels({ DICTIONARIES_ID });
  return ref(resData.list);
};
// 无法确定DICTIONARIES_ID的数据字典包括子级数量
export const layoutFnGetLevelsAndChildrenNumber = async (DICTIONARIES_ID) => {
  const resData = await getLevelsAndChildrenNumber({ DICTIONARIES_ID });
  return ref(resData.list);
};
