"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) {
    var _useRequest = (0, _ahooks.useRequest)(function () {
        return _utils.request.get('/cloud/gps-reborn/sdk/car/getCarInfoByProductType', {
          data: {
            carId: id
          }
        });
      }, {
        refreshDeps: [id]
      }),
      baseInfoRes = _useRequest.data;
    var info = baseInfoRes === null || baseInfoRes === void 0 ? void 0 : baseInfoRes.data;
    var baseInfo = [{
      label: '所属单位',
      key: 'deptName',
      value: info === null || info === void 0 ? void 0 : info.deptName
    }, {
      label: '使用单位',
      key: 'useUnitName',
      value: info === null || info === void 0 ? void 0 : info.useUnitName
    }, {
      label: '所属标段',
      key: 'bidSectionName',
      value: info === null || info === void 0 ? void 0 : info.bidSectionName
    }, {
      label: '行政区划',
      key: 'divisionName',
      value: info === null || info === void 0 ? void 0 : info.divisionName
    }, {
      label: '责任人',
      key: 'manageStaffName',
      value: info === null || info === void 0 ? void 0 : info.manageStaffName
    }, {
      label: '联系人',
      key: 'contact',
      value: info === null || info === void 0 ? void 0 : info.contact
    }, {
      label: '联系电话',
      key: 'contactWay',
      value: info === null || info === void 0 ? void 0 : info.contactWay
    }];
    // 报警类型汇总
    var _useRequest2 = (0, _ahooks.useRequest)(function () {
        return _utils.request.get('/cloud/gps-reborn/alarm/level/queryAllAlarmTypes');
      }, {
        refreshDeps: []
      }),
      alarmTypesRes = _useRequest2.data;
    return {
      baseInfo: baseInfo,
      info: info,
      alarmTypes: (alarmTypesRes === null || alarmTypesRes === void 0 ? void 0 : alarmTypesRes.data) || []
    };
  }
};
exports.BaseService = BaseService;
//# sourceMappingURL=api.js.map
