"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.BaseService = void 0;
var _utils = require("@vtx/utils");
var _ahooks = require("ahooks");
var BaseService = exports.BaseService = {
  useAppraisal: function useAppraisal(id, startTime, endTime) {
    var _a, _b;
    // 考核信息汇总
    var _useRequest = (0, _ahooks.useRequest)(function () {
        return _utils.request.get('/cloud/zykh-reborn/kanban/checkInfoBySourceId', {
          data: {
            jcssId: id,
            startTime: startTime,
            endTime: endTime
          }
        });
      }, {
        refreshDeps: [id, startTime, endTime]
      }),
      checkInfoRes = _useRequest.data;
    var checkInfo = (checkInfoRes === null || checkInfoRes === void 0 ? void 0 : checkInfoRes.data) ? checkInfoRes.data : {};
    //  整改信息汇总
    var _useRequest2 = (0, _ahooks.useRequest)(function () {
        return _utils.request.get('/cloud/zykh-reborn/kanban/orderInfoBySourceId', {
          data: {
            jcssId: id,
            startTime: startTime,
            endTime: endTime
          }
        });
      }, {
        refreshDeps: [id, startTime, endTime]
      }),
      orderInfoRes = _useRequest2.data;
    var orderInfo = ((_a = orderInfoRes === null || orderInfoRes === void 0 ? void 0 : orderInfoRes.data) === null || _a === void 0 ? void 0 : _a.length) > 0 ? orderInfoRes === null || orderInfoRes === void 0 ? void 0 : orderInfoRes.data[0] : {};
    // 扣分因子分析
    var _useRequest3 = (0, _ahooks.useRequest)(function () {
        return _utils.request.get('/cloud/zykh-reborn/kanban/checkRuleBySourceId', {
          data: {
            jcssId: id,
            startTime: startTime,
            endTime: endTime
          }
        });
      }, {
        refreshDeps: [id, startTime, endTime]
      }),
      deductPointRes = _useRequest3.data;
    var deductPoint = (deductPointRes === null || deductPointRes === void 0 ? void 0 : deductPointRes.data) || {};
    // 问题类型分析
    var _useRequest4 = (0, _ahooks.useRequest)(function () {
        return _utils.request.get('/cloud/zykh-reborn/kanban/orderCategoryBySourceId', {
          data: {
            jcssId: id,
            startTime: startTime,
            endTime: endTime
          }
        });
      }, {
        refreshDeps: [id, startTime, endTime]
      }),
      orderCategoryRes = _useRequest4.data;
    var orderCategory = ((_b = orderCategoryRes === null || orderCategoryRes === void 0 ? void 0 : orderCategoryRes.data) === null || _b === void 0 ? void 0 : _b.length) > 0 ? orderCategoryRes === null || orderCategoryRes === void 0 ? void 0 : orderCategoryRes.data.map(function (ele) {
      return {
        name: ele.categoryName,
        value: ele.taskNum
      };
    }) : [];
    return {
      checkInfo: checkInfo,
      orderInfo: orderInfo,
      deductPoint: deductPoint,
      orderCategory: orderCategory
    };
  },
  useKhRecord: function useKhRecord(id, startTime, endTime, page, sort) {
    // 考核列表
    var _useRequest5 = (0, _ahooks.useRequest)(function () {
        return _utils.request.get('/cloud/zykh-reborn/check/record/page', {
          data: {
            jcssId: id,
            startTime: startTime,
            endTime: endTime,
            page: page,
            size: 10,
            sort: sort
          }
        });
      }, {
        refreshDeps: [id, startTime, endTime, page, sort]
      }),
      khRes = _useRequest5.data;
    var khData = khRes === null || khRes === void 0 ? void 0 : khRes.data;
    return {
      khData: khData
    };
  },
  useKhList: function useKhList(id, startTime, endTime) {
    // 考核列表
    var _useRequest6 = (0, _ahooks.useRequest)(function () {
        return _utils.request.get('/cloud/zykh-reborn/check/record/list', {
          data: {
            jcssId: id,
            startTime: startTime,
            endTime: endTime
          }
        });
      }, {
        refreshDeps: [id, startTime, endTime]
      }),
      khRes = _useRequest6.data;
    var khList = khRes === null || khRes === void 0 ? void 0 : khRes.data;
    return {
      khList: khList
    };
  },
  useZgRecord: function useZgRecord(id, startTime, endTime, page, sort) {
    // 整改列表
    var _useRequest7 = (0, _ahooks.useRequest)(function () {
        return _utils.request.get('/cloud/zykh-reborn/orderTask/page', {
          data: {
            jcssId: id,
            startReportDateTime: startTime,
            endReportDateTime: endTime,
            page: page,
            size: 10,
            sort: sort
          }
        });
      }, {
        refreshDeps: [id, startTime, endTime, page, sort]
      }),
      zgRes = _useRequest7.data;
    var zgData = zgRes === null || zgRes === void 0 ? void 0 : zgRes.data;
    return {
      zgData: zgData
    };
  },
  useZgList: function useZgList(id, startTime, endTime) {
    // 整改列表
    var _useRequest8 = (0, _ahooks.useRequest)(function () {
        return _utils.request.get('/cloud/zykh-reborn/orderTask/list', {
          data: {
            jcssId: id,
            startReportDateTime: startTime,
            endReportDateTime: endTime
          }
        });
      }, {
        refreshDeps: [id, startTime, endTime]
      }),
      zgRes = _useRequest8.data;
    var zgList = zgRes === null || zgRes === void 0 ? void 0 : zgRes.data;
    return {
      zgList: zgList
    };
  }
};
//# sourceMappingURL=api.js.map
