"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = void 0;
var _react = _interopRequireDefault(require("react"));
var _useProps2 = _interopRequireDefault(require("@vtx/ol-map/lib/use-props"));
var _Table = _interopRequireDefault(require("../_component/Table"));
var _CustomModal = _interopRequireDefault(require("../_component/CustomModal"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
/**
 * 结果
 * @description: 用于展示分析结果列表、结果图层等
 */

var Result = function Result() {
  var _useProps = (0, _useProps2["default"])(),
    map = _useProps.map,
    visible = _useProps.visible,
    setVisible = _useProps.setVisible,
    loading = _useProps.loading,
    tableData = _useProps.tableData,
    analysisLayer = _useProps.analysisLayer;
  return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_CustomModal["default"], {
    title: "\u5C5E\u6027\u67E5\u8BE2",
    map: map,
    onCancel: function onCancel() {
      try {
        map.hideTemplate();
      } catch (err) {}
      setVisible(false);
    },
    visible: visible
  }, /*#__PURE__*/_react["default"].createElement(_Table["default"], {
    columns: [{
      title: '编码',
      dataIndex: ['values_', 'code'],
      width: 100,
      render: function render(text) {
        return /*#__PURE__*/_react["default"].createElement("a", {
          onClick: function onClick() {
            analysisLayer.setCenterByCode(text);
            analysisLayer.selectFeature && map.showTemplate(analysisLayer.selectFeature);
          }
        }, text);
      }
    }],
    loading: loading,
    dataSource: tableData
  })));
};
var _default = exports["default"] = Result;
//# sourceMappingURL=Result.js.map
