"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = Result;
var _react = _interopRequireDefault(require("react"));
var _Table = _interopRequireDefault(require("../_component/Table"));
var _CustomModal = _interopRequireDefault(require("../_component/CustomModal"));
var _TipText = _interopRequireDefault(require("../_component/TipText"));
var _useProps2 = _interopRequireDefault(require("@vtx/ol-map/lib/use-props"));
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
/*
 * @description: 碰撞分析
 */

function Result() {
  var _useProps = (0, _useProps2["default"])(),
    map = _useProps.map,
    highLayer = _useProps.highLayer,
    setVisible = _useProps.setVisible,
    visible = _useProps.visible,
    loading = _useProps.loading,
    tableData = _useProps.tableData;
  /**
   * @description: feature居中，气泡框打开
   * @param {*} code
   * @return {*}
   */
  var _onClick = function onClick(code) {
    var _highLayer$current, _highLayer$current2;
    highLayer === null || highLayer === void 0 || (_highLayer$current = highLayer.current) === null || _highLayer$current === void 0 || _highLayer$current.setCenter(code);
    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);
  };
  return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_CustomModal["default"], {
    title: "\u78B0\u649E\u5206\u6790",
    map: map,
    onCancel: function onCancel() {
      setVisible(false);
    },
    visible: visible
  }, /*#__PURE__*/_react["default"].createElement(_Table["default"], {
    loading: loading,
    rowKey: "code",
    columns: [{
      title: '管线编码',
      dataIndex: 'code',
      width: 100,
      render: function render(text) {
        return /*#__PURE__*/_react["default"].createElement("a", {
          onClick: function onClick() {
            return _onClick(text);
          }
        }, text);
      }
    }, {
      title: '管线类型',
      // dataIndex: 'pressureTypeName',
      dataIndex: 'type',
      width: 80
    }, {
      title: /*#__PURE__*/_react["default"].createElement(_TipText["default"], {
        text: "\u6C34\u5E73\u51C0\u8DDD(m)",
        tip: "\u4E24\u6761(\u78B0\u649E)\u7A7A\u95F4\u76F8\u4EA4\u7684\u7BA1\u7EBF\u7684\u516C\u5782\u7EBF\u6BB5\u7684\u6C34\u5E73\u8DDD\u79BB"
      }),
      dataIndex: 'horizontalDistance',
      width: 120
    }, {
      title: /*#__PURE__*/_react["default"].createElement(_TipText["default"], {
        text: "\u5782\u76F4\u51C0\u8DDD(m)",
        tip: "\u4E24\u6761(\u78B0\u649E)\u7A7A\u95F4\u76F8\u4EA4\u7684\u7BA1\u7EBF\u7684\u516C\u5782\u7EBF\u6BB5\u7684\u5782\u76F4\u8DDD\u79BB"
      }),
      dataIndex: 'verticalDistance',
      width: 120
    }],
    dataSource: tableData,
    scroll: {
      y: map.getViewport().clientHeight - 160,
      x: 200
    }
  })));
}
//# sourceMappingURL=Result.js.map
