"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.BaseService = void 0;
var _utils = require("@vtx/utils");
var _ahooks = require("ahooks");
var BaseService = {
  useBaseInfo: function useBaseInfo(id, startDate, endDate) {
    var _a;
    var _useRequest = (0, _ahooks.useRequest)(function () {
        return _utils.request.get('/cloud/jcss-reborn/facility/get', {
          data: {
            id: id,
            coordType: 'bd09'
          }
        });
      }, {
        refreshDeps: [id]
      }),
      baseInfoRes = _useRequest.data;
    var info = baseInfoRes === null || baseInfoRes === void 0 ? void 0 : baseInfoRes.data;
    var baseInfo = [{
      label: '行政区划',
      key: 'divisionName',
      value: info === null || info === void 0 ? void 0 : info.divisionName
    }, {
      label: '管理单位',
      key: 'manageUnitName',
      value: info === null || info === void 0 ? void 0 : info.manageUnitName
    }, {
      label: '设施类型',
      key: 'facilityClassName',
      value: info === null || info === void 0 ? void 0 : info.facilityClassName
    }, {
      label: '设施状态',
      key: 'facilityStatusName',
      value: info === null || info === void 0 ? void 0 : info.facilityStatusName,
      color: '#52C41A'
    }, {
      label: '启用日期',
      key: 'createTime',
      value: info === null || info === void 0 ? void 0 : info.createTime
    }, {
      label: '设计能力',
      key: 'disposalDayCount',
      value: "".concat((_a = info === null || info === void 0 ? void 0 : info.dataJson) === null || _a === void 0 ? void 0 : _a.disposalDayCount, "\u5428/\u65E5")
    }, {
      label: '详细地址',
      key: 'address',
      value: info === null || info === void 0 ? void 0 : info.address
    }];
    var photos = (info === null || info === void 0 ? void 0 : info.photoIds) ? JSON.parse(info.photoIds) : [];
    // 实时运行情况
    var _useRequest2 = (0, _ahooks.useRequest)(function () {
        return _utils.request.post('/cloud/sjzt-reborn/api/v101/dataSet/execute', {
          data: JSON.stringify({
            code: 'ZHGC_DIFF_DATATYPE_SUM_MONITOR_VALUE_BY_TYPE',
            parameters: {
              gcId: id,
              startDate: startDate,
              endDate: endDate
            }
          })
        });
      }, {
        refreshDeps: [id, startDate, endDate]
      }),
      situationRes = _useRequest2.data;
    return {
      baseInfo: baseInfo,
      photos: photos,
      situationRes: (situationRes === null || situationRes === void 0 ? void 0 : situationRes.data) || []
    };
  }
};
exports.BaseService = BaseService;
//# sourceMappingURL=api.js.map
