import request from '@/utils/request'

// 首页-总览
export function totalView() {
  return request({
    url: `/postCheck/homePage/totalView`,
    method: 'get'
  })
}
// 首页-检查出的问题
export function checkedProblem() {
  return request({
    url: `/postCheck/homePage/checkedProblem`,
    method: 'get'
  })
}
// 人员数量
export function userTotal() {
  return request({
    url: `/postCheck/homePage/userTotal`,
    method: 'get'
  })
}
// 岗检问题整改率
export function problemRectification() {
  return request({
    url: `/postCheck/homePage/problemRectification`,
    method: 'get'
  })
}
// 岗检部门整改率
export function deptProblemRectification() {
  return request({
    url: `/postCheck/homePage/deptProblemRectification`,
    method: 'get'
  })
}
// 岗检已查
export function postChecked() {
  return request({
    url: `/postCheck/homePage/postChecked`,
    method: 'get'
  })
}
export function planCompletionRate() {
  return request({
    url: `/postCheck/homePage/planCompletionRate`,
    method: 'get'
  })
}


// 岗检未查
export function postUnChecked() {
  return request({
    url: `/postCheck/homePage/postUnChecked`,
    method: 'get'
  })
}

// 评比排名
export function assessmentRating() {
  return request({
    url: `/postCheck/homePage/assessmentRating`,
    method: 'get'
  })
}
// 职能管理部门
export function assessmentRatingZN(query) {
  return request({
    url: `/postCheck/homePage/assessmentRatingZN/${query}`,
    method: 'get'
  })
}
// 生产运行部门
export function assessmentRatingSC(query) {
  return request({
    url: `/postCheck/homePage/assessmentRatingSC/${query}`,
    method: 'get'
  })
}

// 岗位责任制清单审核权限用户列表
export function approveTypeUserList() {
  return request({
    url: `/postCheck/postCheckList/approveTypeUserList`,
    method: 'get'
  })
}

// 岗位责任制清单审核
export function approveReview(params) {
  return request({
    url: `/postCheck/postCheckList/approve`,
    method: 'put',
    params
  })
}

// 岗位责任制编制列表
export function postCheckListList(params) {
  return request({
    url: `/postCheck/postCheckList/list`,
    method: 'get',
    params: params
  })
}

// 查询岗位列表
export function assessmentRatingList(params) {
  return request({
    url: `/postCheck/assessmentRating/list`,
    method: 'get',
    params: params
  })
}

// 部门的下拉菜单
export function deptTree() {
  return request({
    url: `/system/user/deptTree`,
    method: 'get'
  })
}

// 新增岗位责任制清单
export function postCheckListAdd(data) {
  return request({
    url: `/postCheck/postCheckList`,
    method: 'post',
    data
  })
}

// 导出岗位责任制清单列表
export function exportFun(data) {
  return request({
    url: `/postCheck/postCheckList/export`,
    method: 'post',
    responseType: "blob",
    data
  })
}
// 修改岗位责任制清单
export function postCheckListUpdate(data) {
  return request({
    url: `/postCheck/postCheckList`,
    method: 'put',
    data
  })
}
// 岗位责任制清单查看
export function postCheckListLook(params) {
  return request({
    url: `/postCheck/postCheckList/${params}`,
    method: 'get'
  })
}
// 岗位责任制清单删除
export function postCheckListDel(params) {
  return request({
    url: `/postCheck/postCheckList/${params}`,
    method: 'delete'
  })
}


// 岗位的树形
export function optionselect(params) {
  return request({
    url: `/system/post/postCheck/optionselect/${params}`,
    method: 'get',
  })
}

// 查询用户列表（分页）支持部门ID、岗位名称筛选
export function postUserList(params) {
  return request({
    url: `/system/user/postUserList`,
    method: 'get',
    params: params
  })
}

// 查询岗检亮点列表
export function postHighlightsList(params) {
  return request({
    url: `/postCheck/postHighlights/list`,
    method: 'get',
    params: params
  })
}

// 查询岗检亮点列表 -新建
export function postHighlightsAdd(data) {
  return request({
    url: `/postCheck/postHighlights`,
    method: 'post',
    data
  })
}

// 查询考核规则列表
export function postAssessmentRulesList(params) {
  return request({
    url: `/postCheck/postAssessmentRules/list`,
    method: 'get',
    params: params
  })
}

export function assessmentRatingChart(params) {
  return request({
    url: `/postCheck/assessmentRating/${params.type}/${params.year}`,
    method: 'get'
  })
}

// 查询考核规则列表 - 新建
export function postAssessmentRulesAdd(data) {
  return request({
    url: `/postCheck/postAssessmentRules`,
    method: 'post',
    data
  })
}

// 查询考核规则列表 - 修改
export function postAssessmentRulesUpdate(data) {
  return request({
    url: `/postCheck/postAssessmentRules`,
    method: 'put',
    data
  })
}

// 查询打分表明细(职能互评生产日常)列表
export function postAssessmentRatingOtherInfoList(params) {
  return request({
    url: `/postCheck/postAssessmentRatingOtherInfo/list`,
    method: 'get',
    params: params
  })
}

// 查询打分表(职能互评生产日常)列表
export function postAssessmentRatingOtherList(params) {
  return request({
    url: `/postCheck/postAssessmentRatingOther/list`,
    method: 'get',
    params: params
  })
}

// 新增打分表(职能互评生产日常)
export function batchAddRatingOther(data) {
  return request({
    url: `/postCheck/postAssessmentRatingOther/batchAddRatingOther`,
    method: 'post',
    data
  })
}
// 获取打分表(职能互评生产日常)详细信息
export function postAssessmentRatingOtherDetail(params) {
  return request({
    url: `/postCheck/postAssessmentRatingOther/${params}`,
    method: 'get',
  })
}

// 岗检问题库：查询岗检问题表列表
export function postCheckedProblemList(params) {
  return request({
    url: `/postCheck/postCheckedProblem/list`,
    method: 'get',
    params
  })
}

// 查询打分表(职能互评生产日常)列表
export function postCheckedProblemDetail(params) {
  return request({
    url: `/postCheck/postCheckedProblem/${params}`,
    method: 'get'
  })
}

// 职能互评表打分提交
export function functionalDepartmentSub(data) {
  return request({
    url: `/postCheck/postAssessmentRatingOther/functionalDepartmentSub`,
    method: 'post',
    data
  })
}

// 生产互评表打分提交
export function productionDepartmentSub(data) {
  return request({
    url: `/postCheck/postAssessmentRatingOther/productionDepartmentSub`,
    method: 'post',
    data
  })
}


// --- 统计
// 职能管理部门问题数量统计
export function functionDeptProblemContrast1(params) {
  return request({
    url: `/postCheck/functionProblemStatistics/functionDeptProblemContrast/${params.year}`,
    method: 'get'
  })
}
// 职能管理部门问题数量统计
export function functionDeptProblemContrast2(params) {
  return request({
    url: `/postCheck/productionProblemStatistics/functionDeptProblemContrast/${params.year}`,
    method: 'get'
  })
}
// 职能管理部门问题数量统计
export function functionDeptProblemContrast3(params) {
  return request({
    url: `/postCheck/rectificationFunctionProblemStatistics/functionDeptProblemContrast/${params.year}`,
    method: 'get'
  })
}
// 职能管理部门问题数量统计
export function functionDeptProblemContrast4(params) {
  return request({
    url: `/postCheck/rectificationProductionProblemStatistics/functionDeptProblemContrast/${params.year}`,
    method: 'get'
  })
}
// 岗检覆盖率
export function coverageRateView1(params) {
  return request({
    url: `/postCheck/functionProblemStatistics/coverageRateView/${params.year}/${params.selType}`,
    method: 'get'
  })
}
// 岗检覆盖率
export function coverageRateView2(params) {
  return request({
    url: `/postCheck/productionProblemStatistics/coverageRateView/${params.year}/${params.selType}`,
    method: 'get'
  })
}
// 岗检覆盖率
export function coverageRateView3(params) {
  return request({
    url: `/postCheck/rectificationFunctionProblemStatistics/coverageRateView/${params.year}/${params.selType}`,
    method: 'get'
  })
}
// 岗检覆盖率
export function coverageRateView4(params) {
  return request({
    url: `/postCheck/rectificationProductionProblemStatistics/coverageRateView/${params.year}/${params.selType}`,
    method: 'get'
  })
}
// 岗检问题职责类别占比
export function dutyTypeProblemStatisticsView1(params) {
  return request({
    url: `/postCheck/functionProblemStatistics/dutyTypeProblemStatisticsView/${params.year}/${params.deptId}`,
    method: 'get'
  })
}
// 岗检问题职责类别占比
export function dutyTypeProblemStatisticsView2(params) {
  return request({
    url: `/postCheck/productionProblemStatistics/dutyTypeProblemStatisticsView/${params.year}/${params.deptId}`,
    method: 'get'
  })
}
// 岗检问题职责类别占比
export function dutyTypeProblemStatisticsView3(params) {
  return request({
    url: `/postCheck/rectificationFunctionProblemStatistics/dutyTypeProblemStatisticsView/${params.year}/${params.deptId}`,
    method: 'get'
  })
}
// 岗检问题职责类别占比
export function dutyTypeProblemStatisticsView4(params) {
  return request({
    url: `/postCheck/rectificationProductionProblemStatistics/dutyTypeProblemStatisticsView/${params.year}/${params.deptId}`,
    method: 'get'
  })
}
// 岗检问题级别占比
export function problemLevelView1(params) {
  return request({
    url: `/postCheck/functionProblemStatistics/problemLevelView/${params.year}/${params.deptId}`,
    method: 'get'
  })
}
// 岗检问题级别占比
export function problemLevelView2(params) {
  return request({
    url: `/postCheck/productionProblemStatistics/problemLevelView/${params.year}/${params.deptId}`,
    method: 'get'
  })
}
// 岗检问题级别占比
export function problemLevelView3(params) {
  return request({
    url: `/postCheck/rectificationFunctionProblemStatistics/problemLevelView/${params.year}/${params.deptId}`,
    method: 'get'
  })
}
// 岗检问题级别占比
export function problemLevelView4(params) {
  return request({
    url: `/postCheck/rectificationProductionProblemStatistics/problemLevelView/${params.year}/${params.deptId}`,
    method: 'get'
  })
}
// 岗检问题属性及类别占比
export function problemAttributeCategoryView1(params) {
  return request({
    url: `/postCheck/functionProblemStatistics/problemAttributeCategoryView/${params.year}/${params.deptId}`,
    method: 'get'
  })
}
// 岗检问题属性及类别占比
export function problemAttributeCategoryView2(params) {
  return request({
    url: `/postCheck/productionProblemStatistics/problemAttributeCategoryView/${params.year}/${params.deptId}`,
    method: 'get'
  })
}
// 岗检问题属性及类别占比
export function problemAttributeCategoryView3(params) {
  return request({
    url: `/postCheck/rectificationFunctionProblemStatistics/problemAttributeCategoryView/${params.year}/${params.deptId}`,
    method: 'get'
  })
}
// 岗检问题属性及类别占比
export function problemAttributeCategoryView4(params) {
  return request({
    url: `/postCheck/rectificationProductionProblemStatistics/problemAttributeCategoryView/${params.year}/${params.deptId}`,
    method: 'get'
  })
}
// 岗检问题属性及类别占比
export function historyProblemNumberView1(params) {
  return request({
    url: `/postCheck/functionProblemStatistics/historyProblemNumberView/${params.year}/${params.deptId}`,
    method: 'get'
  })
}
export function historyProblemNumberView2(params) {
  return request({
    url: `/postCheck/productionProblemStatistics/historyProblemNumberView/${params.year}/${params.deptId}`,
    method: 'get'
  })
}
// 岗检问题属性及类别占比
export function historyProblemNumberView3(params) {
  return request({
    url: `/postCheck/rectificationFunctionProblemStatistics/historyProblemNumberView/${params.year}/${params.deptId}`,
    method: 'get'
  })
}
export function historyProblemNumberView4(params) {
  return request({
    url: `/postCheck/rectificationProductionProblemStatistics/historyProblemNumberView/${params.year}/${params.deptId}`,
    method: 'get'
  })
}

// 岗检问题属性整改占比(职能部门)
export function problemAttributeViewSC(params) {
  return request({
    url: `/postCheck/rectificationFunctionProblemStatistics/problemAttributeView/${params.year}/${params.deptId}`,
    method: 'get'
  })
}
// 岗检问题属性整改占比(生产部门)
export function problemAttributeViewZN(params) {
  return request({
    url: `/postCheck/rectificationProductionProblemStatistics/problemAttributeView/${params.year}/${params.deptId}`,
    method: 'get'
  })
}
// 岗检问题类别整改占比(职能部门)
export function problemCategoryViewSC(params) {
  return request({
    url: `/postCheck/rectificationFunctionProblemStatistics/problemCategoryView/${params.year}/${params.deptId}`,
    method: 'get'
  })
}
// 岗检问题类别整改占比(生产部门)
export function problemCategoryViewZN(params) {
  return request({
    url: `/postCheck/rectificationProductionProblemStatistics/problemCategoryView/${params.year}/${params.deptId}`,
    method: 'get'
  })
}

// 近三年 (职能部门)
export function lastThreeYearsRatelViewSC(params) {
  return request({
    url: `/postCheck/rectificationFunctionProblemStatistics/lastThreeYearsRatelView/${params.year}`,
    method: 'get'
  })
}
// 近三年 (生产部门)
export function lastThreeYearsRatelViewZN(params) {
  return request({
    url: `/postCheck/rectificationProductionProblemStatistics/lastThreeYearsRatelView/${params.year}`,
    method: 'get'
  })
}


// 部门详情
export function deptDetaailView1(params) {
  return request({
    url: `/postCheck/functionProblemStatistics/deptDetaailView`,
    method: 'get',
    params
  })
}
// 部门详情
export function deptDetaailView2(params) {
  return request({
    url: `/postCheck/productionProblemStatistics/deptDetaailView`,
    method: 'get',
    params
  })
}
// 部门详情
export function deptDetaailView3(params) {
  return request({
    url: `/postCheck/rectificationFunctionProblemStatistics/deptRatelView/${params.year}`,
    method: 'get'
  })
}
// 部门详情
export function deptDetaailView4(params) {
  return request({
    url: `/postCheck/rectificationProductionProblemStatistics/deptRatelView/${params.year}`,
    method: 'get'
  })
}

// 岗检历史-列表
export function historyList(params) {
  return request({
    url: `/postCheck/history/list`,
    method: 'get',
    params
  })
}

// 岗检历史-查看第一列表
export function historyCheckStatistics() {
  return request({
    url: `/postCheck/history/checkStatistics`,
    method: 'get',
  })
}

// 3、查看-第二个表格：岗检问题
export function historyDeptDetaailView(params) {
  return request({
    url: `/postCheck/history/deptDetaailView`,
    method: 'get',
    params
  })
}
// 下载模版
export function getBase64(query) {
  return request({
    url: "/common/getBase64",
    method: "get",
    params: query,
  });
}

// 批量导入
export function batchlmport(data) {
  return request({
    url: `/postCheck/postCheckList/batchImport`,
    method: 'post',
    data
  })
}
export function systemBatchImport(data) {
  return request({
    url: `/system/post/batchImport`,
    method: 'post',
    data
  })
}

// 发送邮件
export function sendMailFile(query) {
  return request({
    url: "/postCheck/postSendMail/sendMailFile",
    method: "get",
    params: query,
    timeout:10000000
  });
}

// 获取权限
export function approveTypeUserList1() {
  return request({
    url: "/postCheck/postAssessmentRatingOther/approveTypeUserList",
    method: "get"
  });
}

