"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.BaseData = void 0;

var _utils = require("@vtx/utils");

var _ahooks = require("ahooks");

var BaseData = {
  useBaseInfo: function useBaseInfo(id) {
    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 baseInfo = baseInfoRes === null || baseInfoRes === void 0 ? void 0 : baseInfoRes.data; // 基础信息

    var info = [{
      label: '名称',
      key: 'name',
      value: baseInfo === null || baseInfo === void 0 ? void 0 : baseInfo.name
    }, {
      label: '编码',
      key: 'code',
      value: baseInfo === null || baseInfo === void 0 ? void 0 : baseInfo.code
    }, {
      label: '管理单位',
      key: 'manageUnitName',
      value: baseInfo === null || baseInfo === void 0 ? void 0 : baseInfo.manageUnitName
    }, {
      label: '行政区划',
      key: 'divisionName',
      value: baseInfo === null || baseInfo === void 0 ? void 0 : baseInfo.divisionName
    }, {
      label: '收运单位',
      key: 'collectUnitName',
      value: baseInfo === null || baseInfo === void 0 ? void 0 : baseInfo.collectUnitName
    }, {
      label: '地址',
      key: 'address',
      value: baseInfo === null || baseInfo === void 0 ? void 0 : baseInfo.address
    }]; // 图片

    var photos = JSON.parse((baseInfo === null || baseInfo === void 0 ? void 0 : baseInfo.photoIds) || '[]');
    return {
      info: info,
      photos: photos
    };
  }
};
exports.BaseData = BaseData;
//# sourceMappingURL=api.js.map
