import { post, uploads } from "@/utils/request";

export const submitLogin = (params) => post("/admin/check", params); // 登录
export const getVersion = (params) =>
  post("/AppVersionmanager/getVersion", params); // 版本更新
export const setChangePassword = (params) =>
  post("/AppUser/editUserPwd", params); // 修改密码
export const getRegulatoryDivisionList = (params) =>
  post("/AppCorpinfo/listRegulatory", params); // 监管划分列表
export const getInformationReviewList = (params) =>
  post("/AppCorpinfo/listReview", params); // 信息审核列表
export const getCertifiedPersonnelList = (params) =>
  post("/AppCorpCertifiedPersonnel/corpList", params); // 持证人员列表
export const getCertifiedPersonnelRecordList = (params) =>
  post("/AppCorpCertifiedPersonnel/list", params); // 持证人员列表
export const getTroubleshootingSituation = (params) =>
  post("/AppCorpinfo/main/statistics", params); // 企业排查情况
export const getSafeOperationSituationList = (params) =>
  post("/AppSafeOperationManagement/list", params); // 安全作业情况
export const getMessageData = (params) =>
  post("/AppMessage/listByUserIdAll", params); // 专项检查提醒
export const fnGetMessageRead = (params) => post("/AppMessage/edit", params); // 专项检查提醒
export const fnGetMessageReadAll = (params) =>
  post("/AppMessage/editStatus", params); // 专项检查提醒

/* 监管帮扶 */
export const getSupervisionInspectionEnterpriseList = (params) =>
  post("/AppSuperviseinspect/corpList", params); // 监管帮扶管理企业列表
export const getSupervisionInspectionRecordList = (params) =>
  post("/AppSuperviseinspect/list", params); // 监管帮扶管理检查记录列表
export const setSupervisionInspectionRecordDelete = (params) =>
  post("/AppSuperviseinspect/delete", params); // 监管帮扶管理检查记录删除
export const getSupervisionInspectionRecordView = (params) =>
  post("/AppSuperviseinspect/goEdit", params); // 监管帮扶管理检查记录查看
export const getSupervisionInspectionRecordHiddenView = (params) =>
  post("/AppSuperviseinspecthidden/goEdit", params); // 监管帮扶管理检查记录隐患查看

export const setSupervisionInspectionAdd = (params) =>
  post("/AppSuperviseinspect/add", params); // 监管帮扶管理检查记录保存
export const setSupervisionInspectionUpdate = (params) =>
  post("/AppSuperviseinspect/update", params); // 监管帮扶管理检查记录更新
export const setSupervisionInspectionImgAdd = (params) =>
  uploads("/AppSuperviseinspect/addInspectImg", params); // 监管帮扶管理检查记录保存
export const setSupervisionInspectionAIImgAdd = (params) =>
    uploads("/AppSuperviseinspecthidden/identifyImg", params); // 监管帮扶管理检查AI信息保存
export const setSupervisionInspectionImgDel = (params) =>
  post("/AppSuperviseinspect/delInspectImg", params); // 监管帮扶管理检查记录保存
export const getSupervisionInspectionEnterpriseHiddenList = (params) =>
  post("/AppSuperviseinspecthidden/list", params); // 监管帮扶管理企业隐患列表
export const setSupervisionInspectionEnterpriseHiddenDelete = (params) =>
  post("/AppSuperviseinspecthidden/delete", params); // 监管帮扶管理企业隐患删除
export const setSupervisionInspectionEnterpriseHiddenReview = (params) =>
  post("/AppSuperviseinspecthidden/review", params); // 监管帮扶管理企业隐患复查

/* 防灾减灾 */
export const getDisasterPreventionTaskList = (params) =>
  post("/AppDisasterPreventionTask/list", params);
export const getDisasterPreventionTaskView = (params) =>
  post("/AppDisasterPreventionTask/goEdit", params);
export const setDisasterPreventionInspectionAdd = (params) =>
  post("/AppDisasterPreventionInspect/add", params);
export const setDisasterPreventionInspectionImgAdd = (params) =>
  uploads("/AppDisasterPreventionInspect/addInspectImg", params); // 专项检查管理检查记录保存
export const getDisasterPreventionInspectionEnterpriseList = (params) =>
  post("/AppDisasterPreventionInspect/disasterList", params); // 专项检查管理企业列表
export const setDisasterPreventionInspectionRecordDelete = (params) =>
  post("/AppDisasterPreventionInspect/delete", params); // 专项检查管理检查记录删除
export const getDisasterPreventionInspectionRecordView = (params) =>
  post("/AppDisasterPreventionInspect/goEdit", params); // 专项检查管理检查记录查看
/* 专项检查 */
export const getSpecialRectificationUserList = (params) =>
  post("/AppSpecialRectificationInspect/listAll", params); // 专项检查行动任务列表
export const getSpecialRectificationTaskList = (params) =>
  post("/AppSpecialRectificationTask/list", params); // 专项检查行动任务列表
export const getSpecialRectificationTaskView = (params) =>
  post("/AppSpecialRectificationTask/goEdit", params); // 专项检查行动任务列表
export const getSpecialRectificationInspectionEnterpriseList = (params) =>
  post("/AppSpecialRectificationInspect/corpList", params); // 专项检查管理企业列表
export const getSpecialRectificationInspectionEnterpriseHiddenList = (params) =>
  post("/AppSpecialRectificationInspectHidden/list", params); // 专项检查管理企业隐患列表
export const setSpecialRectificationInspectionHiddenImgAdd = (params) =>
  uploads("/AppSpecialRectificationFiles/saveImgsForPath", params); // 专项检查管理检查记录隐患图片保存

export const setSpecialRectificationInspectionHiddenAIImgAdd = (params) =>
    uploads("/AppSpecialRectificationFiles/identifyImg", params); // 专项检查管理检查记录AI隐患识别图片保存
export const setSupervisionInspectionHiddenImgAdd = (params) =>
  uploads("/AppSuperviseinspectfiles/saveImgsForPath", params); // 监管帮扶管理检查记录隐患图片保存
export const setSpecialRectificationInspectionAdd = (params) =>
  post("/AppSpecialRectificationInspect/add", params); // 专项检查管理检查记录保存
export const setSpecialRectificationInspectionUserAdd = (params) =>
  post("/AppSpecialRectificationInspect/addUser", params); // 专项检查管理检查记录保存
export const setSpecialRectificationInspectionUpdate = (params) =>
  post("/AppSpecialRectificationInspect/update", params); // 专项检查管理检查记录保存
export const setSpecialRectificationInspectionImgAdd = (params) =>
  uploads("/AppSpecialRectificationInspect/addInspectImg", params); // 专项检查管理检查记录保存
export const setSpecialRectificationInspectionImgDel = (params) =>
  post("/AppSpecialRectificationInspect/delInspectImg", params); // 专项检查管理检查记录保存
export const getSpecialRectificationInspectionRecordList = (params) =>
  post("/AppSpecialRectificationInspect/list", params); // 专项检查管理检查记录列表
export const setSpecialRectificationInspectionRecordDelete = (params) =>
  post("/AppSpecialRectificationInspect/delete", params); // 专项检查管理检查记录删除
export const getSpecialRectificationInspectionRecordView = (params) =>
  post("/AppSpecialRectificationInspect/goEdit", params); // 专项检查管理检查记录查看
export const getSpecialRectificationInspectionRecordHiddenView = (params) =>
  post("/AppSpecialRectificationInspectHidden/goEdit", params); // 专项检查管理检查记录隐患查看
export const getAssignSpecific = (params) =>
  post("/AppSpecialRectificationInspect/getUserType", params); // 专项检查管理检查记录隐患查看
export const setSpecialRectificationInspectionEnterpriseHiddenReview = (
  params,
) => post("/AppSpecialRectificationInspectHidden/review", params); // 专项检查管理企业隐患复查
export const setSpecialRectificationInspectionImgReview = (params) =>
  uploads("/AppSpecialRectificationInspect/addReviewImg", params); // 专项检查管理检查记录保存
export const setSpecialInspectionImgReview = (params) =>
  uploads("/AppSuperviseinspecthidden/addReviewImg", params); // 专项检查管理检查记录保存
export const setSpecialRectificationInspectionEnterpriseHiddenDelete = (
  params,
) => post("/AppSpecialRectificationInspectHidden/delete", params); // 监管帮扶管理企业隐患删除

export const getAppCorpinfoStatisticsList = (params) =>
  post("/AppCorpinfo/risk/statistics", params); // 风险辨识管控企业列表
export const getAppCorpinfoHiddenList = (params) =>
  post("/AppCorpinfo/hidden/list", params); // 隐患排查治理企业列表
export const getAppMonthlyReportMainDataList = (params) =>
  post("/AppMonthlyReport/mainData", params); // 安全教育培训企业列表
export const getAppCorpinfoInvestmentCorpPlanUselistPageList = (params) =>
  post("/AppCorpinfo/investmentCorpPlanUselistPage", params); // 安全生产费用企业列表
export const getAppSafeOperationManagementInfoList = (params) =>
  post("/AppSafeOperationManagement/getCorpInfoList", params); // 危险作业企业列表
export const getAppSafeOperationManagementList = (params) =>
  post("/AppSafeOperationManagement/list", params); // 危险作业列表
export const getAppSafeOperationManagementSafeOperationDisplayData = (params) =>
  post("/AppSafeOperationManagement/safeOperationDisplayData", params); // 危险作业详情
export const getInspectType = () =>
  post("/dictionaries/getLevels", {
    DICTIONARIES_ID: "68feed9f1167455e99389b71c8bad070",
    loading: false,
  }); // 检查类型字典
export const getHiddenLevel = () =>
  post("/dictionaries/getLevels", {
    DICTIONARIES_ID: "5e7cf8620ba54ad89719d0be62133c7a",
    loading: false,
  }); // 隐患级别字典
export const getDepartment = (DEPARTMENT_ID) =>
  post("/AppDepartment/listTree", {
    TYPE_ARR: "2",
    LOGIN_DEPARTMENT_ID: DEPARTMENT_ID || "",
    loading: false,
  }); // 部门
export const getRegDepartment = (SPECIAL_RECTIFICATION_ACTIVITY_TASK_ID) =>
  post("/AppDepartment/listTree", {
    TYPE_ARR: "2,3",
    SPECIAL_RECTIFICATION_ACTIVITY_TASK_ID,
    loading: false,
  }); // 部门
export const getWorkDepartment = (
  SPECIAL_RECTIFICATION_ACTIVITY_TASK_ID,
  DEPARTMENT_ID,
) =>
  post("/AppDepartment/listWorkerTree", {
    TYPE_ARR: "2,3",
    SPECIAL_RECTIFICATION_ACTIVITY_TASK_ID,
    DEPARTMENT_ID,
    loading: false,
  }); // 部门
export const getUser = (params) =>
  post("/AppUser/listAll", {
    ...params,
    NOMAIN: "1",
    loading: false,
  }); // 人员
export const getTerritory = async (params) =>
  await post("/AppDepartment/listAll", {
    loading: false,
    ...params,
  }); // 属地
export const getInspectionStandards = async (params) =>
  await post("/AppSuperviseInspectStandard/listTree", {
    loading: false,
    ...params,
  }); // 检查标准
