"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.StaticService = exports.BaseService = void 0;
var _utils = require("@vtx/utils");
var _ahooks = require("ahooks");
var BaseService = {
  useBaseInfo: function useBaseInfo(id) {
    var _useRequest = (0, _ahooks.useRequest)(function () {
        return _utils.request.get("/cloud/zyqs-reborn/api/v1.5/road/".concat(id));
      }, {
        refreshDeps: [id]
      }),
      baseInfoRes = _useRequest.data;
    var info = baseInfoRes === null || baseInfoRes === void 0 ? void 0 : baseInfoRes.data;
    var baseInfo = [{
      label: '管理单位',
      key: 'manageUnitName',
      value: info === null || info === void 0 ? void 0 : info.manageUnitName
    }, {
      label: '路段长度',
      key: 'roadSpace',
      value: info === null || info === void 0 ? void 0 : info.roadSpace
    }, {
      label: '行政区划',
      key: 'divisionName',
      value: info === null || info === void 0 ? void 0 : info.divisionName
    }, {
      label: '路段宽度',
      key: 'roadWidth',
      value: info === null || info === void 0 ? void 0 : info.roadWidth
    }, {
      label: '路段类型',
      key: 'roadTypeName',
      value: info === null || info === void 0 ? void 0 : info.roadTypeName
    }, {
      label: '所属标段',
      key: 'bidSectionName',
      value: info === null || info === void 0 ? void 0 : info.bidSectionName
    }, {
      label: '作业单位',
      key: 'companyName',
      value: info === null || info === void 0 ? void 0 : info.companyName
    }];
    // 今日作业
    var _useRequest2 = (0, _ahooks.useRequest)(function () {
        return _utils.request.get('/cloud/ljsy-reborn/api/kanban/collectRateByProduct', {
          data: {
            collectPointId: id,
            coordinateType: 'bd09'
          }
        });
      }, {
        refreshDeps: [id]
      }),
      todayWorkRes = _useRequest2.data;
    // 车辆作业信息
    var _useRequest3 = (0, _ahooks.useRequest)(function () {
        return _utils.request.get('/cloud/ljsy-reborn/api/kanban/getCarCollectInfoByPointId', {
          data: {
            collectPointId: id,
            coordinateType: 'bd09'
          }
        });
      }, {
        refreshDeps: [id]
      }),
      carWorkRes = _useRequest3.data;
    return {
      baseInfo: baseInfo,
      rules: (info === null || info === void 0 ? void 0 : info.rules) || [],
      todayWorkRes: (todayWorkRes === null || todayWorkRes === void 0 ? void 0 : todayWorkRes.data) || [],
      dataSource: (carWorkRes === null || carWorkRes === void 0 ? void 0 : carWorkRes.data) || []
    };
  }
};
exports.BaseService = BaseService;
var StaticService = {
  useSummaryInfo: function useSummaryInfo(id, startDate, endDate) {
    var _useRequest4 = (0, _ahooks.useRequest)(function () {
        return _utils.request.get("/cloud/zyqs-reborn/api/kanban/summaryStatistics", {
          data: {
            roadId: id,
            startDate: startDate,
            endDate: endDate
          }
        });
      }, {
        refreshDeps: [id, startDate, endDate]
      }),
      summaryInfoRes = _useRequest4.data;
    var summaryInfo = summaryInfoRes === null || summaryInfoRes === void 0 ? void 0 : summaryInfoRes.data;
    //完成率统计
    var _useRequest5 = (0, _ahooks.useRequest)(function () {
        return _utils.request.get("/cloud/zyqs-reborn/api/kanban/completionRateStatistics", {
          data: {
            roadId: id,
            startDate: startDate,
            endDate: endDate
          }
        });
      }, {
        refreshDeps: [id, startDate, endDate]
      }),
      completionRateRes = _useRequest5.data;
    var completionRate = completionRateRes === null || completionRateRes === void 0 ? void 0 : completionRateRes.data;
    // 作业里程分析
    var _useRequest6 = (0, _ahooks.useRequest)(function () {
        return _utils.request.get("/cloud/zyqs-reborn/api/kanban/workMileageAnalysis", {
          data: {
            roadId: id,
            startDate: startDate,
            endDate: endDate
          }
        });
      }, {
        refreshDeps: [id, startDate, endDate]
      }),
      mileAnalysisRes = _useRequest6.data;
    var mileAnalysis = (mileAnalysisRes === null || mileAnalysisRes === void 0 ? void 0 : mileAnalysisRes.data) || [];
    return {
      summaryInfo: summaryInfo,
      completionRate: completionRate,
      mileAnalysis: mileAnalysis
    };
  }
};
exports.StaticService = StaticService;
//# sourceMappingURL=api.js.map
