"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = _default;
var _react = _interopRequireDefault(require("react"));
var _service = _interopRequireDefault(require("../_mapUtil/service"));
var _Table = _interopRequireDefault(require("../_component/Table"));
var _CustomModal = _interopRequireDefault(require("../_component/CustomModal"));
var _Export = _interopRequireDefault(require("../_component/Export"));
var _config = _interopRequireDefault(require("../_mapUtil/config"));
var _index = _interopRequireDefault(require("@vtx/ol-map/lib/use-props/index"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
/*
 * @description: 覆土分析-管线
 */

function _default(props) {
  var _useProps = (0, _index["default"])(),
    map = _useProps.map,
    highLayer = _useProps.highLayer,
    setVisible = _useProps.setVisible,
    visible = _useProps.visible,
    tableData = _useProps.tableData,
    loading = _useProps.loading;
  var _columns = [{
    title: '编码',
    dataIndex: 'code',
    ellipsis: true,
    width: 120,
    render: function render(text) {
      return /*#__PURE__*/_react["default"].createElement("a", {
        onClick: function onClick() {
          var _highLayer$current, _highLayer$current2;
          (highLayer === null || highLayer === void 0 ? void 0 : highLayer.current) && (highLayer === null || highLayer === void 0 || (_highLayer$current = highLayer.current) === null || _highLayer$current === void 0 ? void 0 : _highLayer$current.setCenter(text));
          var selectFeature = highLayer === null || highLayer === void 0 || (_highLayer$current2 = highLayer.current) === null || _highLayer$current2 === void 0 ? void 0 : _highLayer$current2.selectFeature;
          if (selectFeature) map === null || map === void 0 || map.showTemplate(selectFeature);
        }
      }, text);
    }
  }, {
    title: '管线类型',
    dataIndex: 'label',
    ellipsis: true,
    width: 100
  }, {
    title: '起点埋深(m)',
    dataIndex: 'start_deep',
    ellipsis: true,
    width: 100
  }, {
    title: '终点埋深(m)',
    dataIndex: 'end_deep',
    ellipsis: true,
    width: 100
  }, {
    title: '埋设方式',
    dataIndex: 'layWayName',
    ellipsis: true,
    width: 100
  }];
  return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_CustomModal["default"], {
    title: "\u8986\u571F\u5206\u6790",
    map: map,
    onCancel: function onCancel() {
      setVisible(false);
    },
    visible: visible
  }, /*#__PURE__*/_react["default"].createElement(_Export["default"], {
    url: "".concat(_config["default"].publicUrlJCSS, "/api/line/exportExcel"),
    method: "POST",
    params: {
      codes: _service["default"].getField(tableData, 'code'),
      exportType: 2
    }
  }), /*#__PURE__*/_react["default"].createElement(_Table["default"], {
    loading: loading,
    rowKey: "code",
    columns: _columns,
    dataSource: tableData,
    scroll: {
      y: map.getViewport().clientHeight - 200,
      x: 200
    }
  })));
}
//# sourceMappingURL=Result.js.map
