/******/ (function() { // webpackBootstrap
/******/ 	"use strict";
/******/ 	var __webpack_modules__ = ({

/***/ 403:
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Z": function() { return /* binding */ Mitt; }
/* harmony export */ });
/* harmony import */ var _Users_zpc_Documents_KQGEOSpace_KQGISClientForVue_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(8270);
/* harmony import */ var _common_utils_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2107);
/* harmony import */ var _common_utils_util__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_common_utils_util__WEBPACK_IMPORTED_MODULE_0__);


/**
 * 向外暴露的默认函数
 * @param 入参为 EventHandlerMap
 * @returns 返回一个对象，对象包含属性 all，方法 on，off，emit
 */

class Mitt {
  /*
      此处实参可传一个EventHandlerMap对象，实现多个 mitt 的合并。例如：
      const m1 = mitt();
      m1.on('hi', () => { console.log('Hi, I am belongs to m1.'); });
      const m2 = mitt(m1.all);
      m2.emit('hi') // Hi, I am belongs to m1.
      m2.on('hello', () => { console.log('Hello, I am belongs to m2.'); });
      m1.emit('hello'); // Hello, I am belongs to m2.
      m1.all === m2.all // true
    */
  constructor(all) {
    (0,_Users_zpc_Documents_KQGEOSpace_KQGISClientForVue_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z)(this, "all", null);

    this.all = all || new Map();
  }
  /**
   * 注册一个命名的事件处理
   * @param type 事件名，官方表示事件名如是 *，用来标记为通用事件，调用任何事件，都会触发命名为 * 的事件
   * @param handler 事件处理函数
   */


  on(type, handler) {
    // 根据type去查找事件
    const handlers = this.all.get(type);

    if (handlers) {
      for (let i = 0; i < handlers.length; i++) {
        // 防止重复监听 事件执行的方法相同时 不添加
        if (handlers[i] === handler) {
          return;
        }
      }

      handlers.push(handler);
    } else {
      this.all.set(type, [handler]);
    }
  }
  /**
   * 只执行一次 就会被移除
   * @param type
   * @param fn
   */


  once(type, fn) {
    const handler = (0,_common_utils_util__WEBPACK_IMPORTED_MODULE_0__.bind)(function () {
      this.off(type, fn);
      this.off(type, handler);
    }, this); // 添加执行事件和移除执行事件的监听

    this.on(type, fn);
    this.on(type, handler);
  }
  /**
   * 移除指定的事件处理
   * @param type 事件名，和第二个参数一起用来移除指定的事件，
   * @param handler 事件处理函数
   */


  off(type, handler) {
    if (!type) {
      this.all.clear();
      return;
    } // 根据type去查找事件


    const handlers = this.all.get(type); // 如果找到则进行删除操作

    if (handlers) {
      // 这里用了个骚操作，其实就是找到了，则删除(多个相同的只会删除找到的第一个)，没找到则不会对原数组有任何影响
      handlers.splice(handlers.indexOf(handler) >>> 0, 1);
    }
  }
  /**
   * 触发所有 type 事件，如果有type为 * 的事件，则最后会执行。
   * @param type 事件名
   * @param evt 传递给处理函数的参数
   */


  fire(type, evt) {
    // 找到type的事件循环执行
    (this.all.get(type) || []).slice().map(handler => {
      handler(evt);
    }); // 然后找到所有为*的事件，循环执行

    (this.all.get("*") || []).slice().map(handler => {
      handler(type, evt);
    });
  }

}

/***/ }),

/***/ 6869:
/***/ (function(module) {

module.exports = require("xe-utils");

/***/ }),

/***/ 7025:
/***/ (function(module) {

module.exports = require("@zpc_npm/vue-iclient-leaflet");

/***/ }),

/***/ 257:
/***/ (function(module) {

module.exports = require("@zpc_npm/vue-iclient-leaflet/_utils/gis-utils");

/***/ }),

/***/ 2107:
/***/ (function(module) {

module.exports = require("@zpc_npm/vue-iclient-leaflet/_utils/util");

/***/ }),

/***/ 1396:
/***/ (function(module) {

module.exports = require("@zpc_npm/vue-iclient-leaflet/init.js");

/***/ }),

/***/ 637:
/***/ (function(module) {

module.exports = require("vue");

/***/ }),

/***/ 8270:
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Z": function() { return /* binding */ _defineProperty; }
/* harmony export */ });
function _defineProperty(obj, key, value) {
  if (key in obj) {
    Object.defineProperty(obj, key, {
      value: value,
      enumerable: true,
      configurable: true,
      writable: true
    });
  } else {
    obj[key] = value;
  }

  return obj;
}

/***/ })

/******/ 	});
/************************************************************************/
/******/ 	// The module cache
/******/ 	var __webpack_module_cache__ = {};
/******/ 	
/******/ 	// The require function
/******/ 	function __webpack_require__(moduleId) {
/******/ 		// Check if module is in cache
/******/ 		var cachedModule = __webpack_module_cache__[moduleId];
/******/ 		if (cachedModule !== undefined) {
/******/ 			return cachedModule.exports;
/******/ 		}
/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = __webpack_module_cache__[moduleId] = {
/******/ 			// no module.id needed
/******/ 			// no module.loaded needed
/******/ 			exports: {}
/******/ 		};
/******/ 	
/******/ 		// Execute the module function
/******/ 		__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/ 	
/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}
/******/ 	
/************************************************************************/
/******/ 	/* webpack/runtime/compat get default export */
/******/ 	!function() {
/******/ 		// getDefaultExport function for compatibility with non-harmony modules
/******/ 		__webpack_require__.n = function(module) {
/******/ 			var getter = module && module.__esModule ?
/******/ 				function() { return module['default']; } :
/******/ 				function() { return module; };
/******/ 			__webpack_require__.d(getter, { a: getter });
/******/ 			return getter;
/******/ 		};
/******/ 	}();
/******/ 	
/******/ 	/* webpack/runtime/define property getters */
/******/ 	!function() {
/******/ 		// define getter functions for harmony exports
/******/ 		__webpack_require__.d = function(exports, definition) {
/******/ 			for(var key in definition) {
/******/ 				if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ 					Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ 				}
/******/ 			}
/******/ 		};
/******/ 	}();
/******/ 	
/******/ 	/* webpack/runtime/hasOwnProperty shorthand */
/******/ 	!function() {
/******/ 		__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
/******/ 	}();
/******/ 	
/******/ 	/* webpack/runtime/make namespace object */
/******/ 	!function() {
/******/ 		// define __esModule on exports
/******/ 		__webpack_require__.r = function(exports) {
/******/ 			if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ 				Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ 			}
/******/ 			Object.defineProperty(exports, '__esModule', { value: true });
/******/ 		};
/******/ 	}();
/******/ 	
/************************************************************************/
var __webpack_exports__ = {};
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
!function() {
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  "OverlayAnalysisViewModel": function() { return /* reexport */ OverlayAnalysisViewModel; },
  "default": function() { return /* reexport */ OverlayAnalysis; }
});

// EXTERNAL MODULE: external {"root":"Vue","commonjs":"vue","commonjs2":"vue","amd":"vue"}
var external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_ = __webpack_require__(637);
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
var defineProperty = __webpack_require__(8270);
// EXTERNAL MODULE: external "@zpc_npm/vue-iclient-leaflet/_utils/util"
var util_ = __webpack_require__(2107);
// EXTERNAL MODULE: ./src/common/_utils/mitt.js
var mitt = __webpack_require__(403);
// EXTERNAL MODULE: external "@zpc_npm/vue-iclient-leaflet/_utils/gis-utils"
var gis_utils_ = __webpack_require__(257);
// EXTERNAL MODULE: external "@zpc_npm/vue-iclient-leaflet"
var vue_iclient_leaflet_ = __webpack_require__(7025);
// EXTERNAL MODULE: external "xe-utils"
var external_xe_utils_ = __webpack_require__(6869);
var external_xe_utils_default = /*#__PURE__*/__webpack_require__.n(external_xe_utils_);
;// CONCATENATED MODULE: ./src/common/overlayanalysis/OverlayAnalysisViewModel.js






class OverlayAnalysisViewModel extends mitt/* default */.Z {
  constructor(options) {
    super();

    (0,defineProperty/* default */.Z)(this, "_props", null);

    (0,defineProperty/* default */.Z)(this, "webMap", null);

    (0,defineProperty/* default */.Z)(this, "selectedLayer", null);

    (0,defineProperty/* default */.Z)(this, "queryLayers", null);

    this._props = JSON.parse(JSON.stringify(options.props));
    this.selectedLayer = options.selectedLayer; // 事件绑定this

    this._loadedAsync = this._loadedAsync.bind(this);
    this._loadedSync = this._loadedSync.bind(this);
    this._updateLayerData = this._updateLayerData.bind(this);
    this.setLayerData = this.setLayerData.bind(this);

    this._registerEvents();
  }
  /**
   * 注册事件
   */


  _registerEvents() {
    // 监听地图初始化完成事件
    // 异步
    gis_utils_.mapViewUtils.bindViewEvents("mounted", this._loadedAsync, this._props.mapTarget);
    gis_utils_.mapViewUtils.bindViewEvents("resetLayerDatas", this._updateLayerData, this._props.mapTarget); // 同步

    gis_utils_.utils.getWebMap(this._props.mapTarget, this._loadedSync);
  }

  _loadedAsync(e) {
    // 如果图层变化事件是自己触发的 则不继续执行 避免死循环
    if (e.eventTarget && e.eventTarget === this) {
      return;
    }

    this.webMap = e.target;
    this.setLayerData();
  }

  _loadedSync(e) {
    this.webMap = e;
    this.setLayerData();
  } // 更新图层树


  _updateLayerData() {
    let maplayers = gis_utils_.mapLayerUtils.getLayerCheckedList(this._props.mapTarget);
    maplayers = this._filterLayers(maplayers);
    const {
      isCheckedShow
    } = this._props;

    if (!isCheckedShow && this.selectedLayer) {
      let maplayers = gis_utils_.mapLayerUtils.getLayerCheckedList(this._props.mapTarget);
      maplayers.map(t => {
        gis_utils_.mapLayerUtils.setLayerOpacityStateById(this._props.mapTarget, t.guid, 0);
      });
      gis_utils_.mapLayerUtils.setLayerOpacityStateById(this._props.mapTarget, this.selectedLayer.guid, 1);
    }

    this.fire("updateData", {
      maplayers
    });
  }
  /**
   * @param {Array} queryLayers - 外部传入的图层数据，与图层树选中数据取交集
   */


  init(queryLayers) {
    let maplayers = gis_utils_.mapLayerUtils.getLayerCheckedList(this._props.mapTarget);
    this.queryLayers = queryLayers;

    if (queryLayers && queryLayers.length) {
      maplayers = this._filterLayers(maplayers);
    }

    if (maplayers && maplayers.length > 0) {
      this.fire("setData", {
        maplayers
      });
    }
  }
  /**
   * 过滤图层，初始化或图层树改变时触发
   * @param {Array} maplayers - 需过滤的图层数据
   */


  _filterLayers(maplayers) {
    let queryLayers = this.queryLayers;
    let layers = [];

    if (queryLayers && queryLayers.length) {
      for (let s = 0; s < queryLayers.length; s++) {
        for (let i = 0; i < maplayers.length; i++) {
          if (!queryLayers[s].rasterLayer && maplayers[i].guid === queryLayers[s].guid && parseInt(maplayers[i].id) === parseInt(queryLayers[s].id)) {
            layers.push(maplayers[i]);
            continue;
          }
        }
      }

      maplayers = layers;
    }

    return maplayers;
  } // 获取图层树数据


  setLayerData() {
    let maplayers = gis_utils_.mapLayerUtils.getLayerCheckedList(this._props.mapTarget); // 过滤rasterLayer为false的图层数据，即数据为栅格数据;

    maplayers = external_xe_utils_default().filter(maplayers, item => !item.rasterLayer);

    if (maplayers && maplayers.length > 0) {
      this.fire("setLayerData", {
        maplayers
      });
      return maplayers;
    }
  } // 选择图层


  selectLayer(currentNode, props) {
    const {
      isCheckedShow
    } = props;
    let selectedLayer = this.selectedLayer;
    if (selectedLayer.layerId && selectedLayer.layerId === currentNode.id) return false; // 选择图层时缩放至图层
    // if (currentNode.rect84) {
    //   let bounds84 = [
    //     [currentNode.rect84[1], currentNode.rect84[0]],
    //     [currentNode.rect84[3], currentNode.rect84[2]]
    //   ];
    //   this.webMap.map.fitBounds(bounds84);
    // }
    // 显示选择的图层

    if (currentNode.children) {
      selectedLayer.title = "请选择图层";
    } else {
      selectedLayer.title = currentNode.name;
      selectedLayer.layerId = currentNode.id;
      selectedLayer.url = currentNode.url;
      selectedLayer.token = currentNode.accessToken;
      selectedLayer.guid = currentNode.guid;
    }

    if (currentNode.fields) {
      let fieldslist = [];
      let aliaslist = [];
      let chart_field = [];
      let summary_field = [];
      currentNode.fields.map(function (node) {
        fieldslist.push(node.name);
        aliaslist.push(node.aliasName);

        if (node.chart_field) {
          chart_field.push(node.chart_field);
        }

        if (node.summary_field) {
          summary_field.push(node.summary_field);
        }
      });
      selectedLayer.fields = fieldslist;
      selectedLayer.fields_alias = aliaslist; // 中文别名

      selectedLayer.chart_field = fieldslist;

      if (chart_field.length > 0) {
        selectedLayer.chart_field = chart_field;
      }

      selectedLayer.summary_field = fieldslist;

      if (summary_field.length > 0) {
        selectedLayer.summary_field = summary_field;
      }

      this.selectedLayer = selectedLayer; // 选择图层后是否显示其他图层，默认隐藏

      if (!isCheckedShow) {
        let maplayers = gis_utils_.mapLayerUtils.getLayerCheckedList(this._props.mapTarget);
        maplayers.map(t => {
          gis_utils_.mapLayerUtils.setLayerOpacityStateById(this._props.mapTarget, t.guid, 0);
        });
        gis_utils_.mapLayerUtils.setLayerOpacityStateById(this._props.mapTarget, currentNode.guid, 1);
      }
    }

    this.fire("getselectedLayer", {
      selectedLayer
    });
  }
  /**
   * 叠置分析
   * @param {object} geometry - 绘制的图形
   */


  overlay(geometry) {
    let selectedLayer = this.selectedLayer;
    let geoSRS = new window.KqGIS.ServiceSRS({
      type: window.KqGIS.ProjectSystemType.EPSG,
      value: "4326"
    });
    let filter = new window.KqGIS.FilterParam({
      geometry: L.Util.toKqGISGeometry(geometry),
      geoSRS: geoSRS,
      SpatialRel: window.KqGIS.SpatialRel.INTERSECT
    });
    let params = new window.KqGIS.SpatialAnalysis.OverlayParams({
      srcDataset: {
        layerid: selectedLayer.layerId
      },
      operDataset: filter,
      operateType: window.KqGIS.OverlayType.INTERSECT,
      outPutType: 3,
      outFields: window.KqGIS.AttributeInheritanceType.FromSource,
      ua_token: selectedLayer.token
    });
    let serverUrl = (0,util_.getKQURLFromURL)(selectedLayer.url) + "/spatialanalysis/overlay";
    let service = new window.KqGIS.SpatialAnalysis.OverlayService(serverUrl, {
      eventListeners: {
        processCompleted: response => {
          if (response.result.resultcode === "success") {
            let result = {};
            result.fields = selectedLayer.fields;
            result.chart_field = selectedLayer.fields;
            result.summary_field = selectedLayer.fields;
            result.fields_alias = selectedLayer.fields_alias;
            result.features = response.result.result.features;
            this.fire("getResult", result);
          } else {
            (0,vue_iclient_leaflet_.KqMessage)({
              type: "warning",
              message: JSON.stringify(response.result)
            });
          }
        },
        processFailed: err => {
          (0,vue_iclient_leaflet_.KqMessage)({
            type: "warning",
            message: JSON.stringify(err)
          });
        }
      }
    });
    service.processAsync(params);
  }

  destroy() {
    const {
      isCheckedShow
    } = this._props;

    if (!isCheckedShow) {
      let maplayers = gis_utils_.mapLayerUtils.getLayerCheckedList(this._props.mapTarget);
      maplayers.map(t => {
        gis_utils_.mapLayerUtils.setLayerOpacityStateById(this._props.mapTarget, t.guid, 1);
      });
    }

    this.selectedLayer = null;
    this.off();
    gis_utils_.mapViewUtils.offViewEvents("resetLayerDatas", this._loadedAsync, this._props.mapTarget);
  }

}
;// CONCATENATED MODULE: ./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/dist/index.js??ruleSet[0]!./src/common/overlayanalysis/OverlayAnalysis.vue?vue&type=script&setup=true&lang=js

const _hoisted_1 = {
  class: "btn-box"
};

const _hoisted_2 = /*#__PURE__*/(0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createTextVNode)("分析");

const _hoisted_3 = /*#__PURE__*/(0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createTextVNode)("重置");







const __default__ = {
  name: "KqOverlayAnalysis"
};
/* harmony default export */ var OverlayAnalysisvue_type_script_setup_true_lang_js = (/*#__PURE__*/Object.assign(__default__, {
  props: {
    mapTarget: {
      type: String,
      default: "kqmap"
    },
    mapType: {
      type: String,
      default: "leaflet"
    },
    // 选择图层后是否显示其他图层，默认显示
    isCheckedShow: {
      type: Boolean,
      default: true
    },
    // 是否显示阴影
    showShadow: {
      type: Boolean,
      default: false
    },

    /**
     * 例："center", {top:'16px',left:'16px'}, {top:16,left:16}
     */
    position: [String, Object],
    // 面积容差（单位：平方米），叠置面积小于minArea的结果将被过滤掉
    minArea: {
      type: String,
      default: null
    },
    // 长度容差（单位：米），叠置长度小于minArea的结果将被过滤掉。
    minLength: {
      type: String,
      default: null
    },
    // 要求返回结果的最大记录数。
    returnCount: Number,
    // sketch组件参数
    skecthProps: {
      type: Object,
      default: function () {
        return {
          drawTypes: ["polygon", "rectangle", "circle"],
          showSettingPanel: true,
          collapseSettingPanel: true,
          showBuffer: false,
          drawGroupName: "draw",
          drawStyle: {},
          isShowShadow: false,
          geometryServerUrl: "",
          //几何服务token
          geometryServerToken: ""
        };
      }
    }
  },

  setup(__props, {
    expose
  }) {
    const props = __props; // 组件容器ref

    let box_ref = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.ref)(null); // 默认展开第一个

    let activeName = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.ref)("1"); // option绑定选中节点

    let selectedNode = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.ref)(""); // 分析查询加载按钮loading

    let btnLoad = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.ref)(false); // 绘图组件 ref

    let sketch_ref = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.ref)(null); // select组件 ref

    let ref_Select = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.ref)(null); // table组件 ref

    let feature_table = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.ref)(null); // 选中图层数据

    let selectedLayer = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.reactive)({
      title: "",
      // 图层选框中绑定的值
      layerId: "",
      guid: null,
      name: "",
      geometry: null,
      fields: [],
      fields_alias: [],
      chart_field: [],
      summary_field: [],
      where: [],
      url: "",
      token: ""
    }); // 图层树数据

    let layers = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.reactive)({
      data: []
    });
    let fields = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.reactive)([]);
    let fields_alias = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.reactive)([]);
    let chart_field = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.reactive)([]);
    let summary_field = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.reactive)([]);
    let features = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.ref)(null);
    let viewModel = null;
    (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.onMounted)(() => {
      (0,util_.updatePosition)(box_ref.value, props);

      try {
        if (!props.drawStyle) {
          sketch_ref.value.setDefaultStyle();
        }
      } catch (e) {}

      viewModel = new OverlayAnalysisViewModel({
        selectedLayer,
        props
      }); // 获取图层树数据

      const setLayerData = viewModel.setLayerData();

      if (setLayerData && setLayerData.length) {
        layers.data = setLayerData;
      } else {
        viewModel.on("setLayerData", _data => {
          layers.data = _data.maplayers;
        });
      } // 更新图层数据


      viewModel.on("updateData", _data => {
        layers.data = _data.maplayers;

        if (selectedLayer.layerId) {
          var result = external_xe_utils_default().find(layers.data, item => item.id === selectedLayer.layerId);

          if (!result) {
            resetLayer();
          }
        }
      });
    });
    (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.onBeforeUnmount)(() => {
      clear();
      viewModel = null;
    }); // 选择图层

    const onChangeSelect = guid => {
      viewModel.on("getselectedLayer", _data => {
        selectedLayer = _data.selectedLayer;
      });

      let _selectedLayer = external_xe_utils_default().find(layers.data, item => item.guid === guid);

      viewModel.selectLayer(_selectedLayer, props);
    }; // 叠置分析请求


    const analysis = () => {
      btnLoad.value = true;
      var geometry = sketch_ref.value.getDrawGeoJSON();

      if (!selectedLayer.layerId) {
        btnLoad.value = false;
        (0,vue_iclient_leaflet_.KqMessage)({
          type: "warning",
          message: "请选择图层！"
        });
        return false;
      }

      if (!geometry) {
        btnLoad.value = false;
        (0,vue_iclient_leaflet_.KqMessage)({
          type: "warning",
          message: "请绘制查询范围！"
        });
        return false;
      }

      viewModel.overlay(geometry);
      viewModel.on("getResult", result => {
        btnLoad.value = false;
        activeName.value = "2";
        fields.value = result.fields;
        fields_alias.value = result.fields_alias;
        chart_field.value = result.fields;
        summary_field.value = result.fields;
        features.value = result.features;
        sketch_ref.value.cleanAll();
        (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.nextTick)(() => {
          if (feature_table.value) {
            feature_table.value.initResult();
          }
        });
      });
    }; // 重置图层，重置选中图层


    const resetLayer = () => {
      selectedLayer.layerId = null;
      selectedLayer.guid = null;
      selectedLayer.title = "";
      selectedLayer.fields = [];
      selectedLayer.name = "";
      btnLoad.value = false;
      activeName.value = "1";
      sketch_ref.value.cleanAll();
      feature_table.value.clearResult();
      var node = document.querySelector(".is-current");
      if (node) (0,util_.removeClass)(node, "is-current");
    }; // 重置


    const clear = () => {
      resetLayer();
      viewModel.destroy();
    };
    /**
     * 初始化组件
     * @param {Array} queryLayers - 外部传入的数据,权重最高
     */


    const init = queryLayers => {
      viewModel.on("setData", _data => {
        layers.data = _data.maplayers;
      });
      viewModel.init(queryLayers);
    };

    expose({
      init,
      clear
    });
    return (_ctx, _cache) => {
      const _component_kq_option = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.resolveComponent)("kq-option");

      const _component_kq_select = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.resolveComponent)("kq-select");

      const _component_kq_form_item = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.resolveComponent)("kq-form-item");

      const _component_kq_form = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.resolveComponent)("kq-form");

      const _component_kq_button = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.resolveComponent)("kq-button");

      const _component_kq_collapse_item = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.resolveComponent)("kq-collapse-item");

      const _component_kq_collapse = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.resolveComponent)("kq-collapse");

      return (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.openBlock)(), (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createElementBlock)("section", {
        class: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.normalizeClass)(["kq-overlay-analysis", __props.showShadow ? 'shadow' : null]),
        ref_key: "box_ref",
        ref: box_ref
      }, [(0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createVNode)(_component_kq_collapse, {
        modelValue: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(activeName),
        "onUpdate:modelValue": _cache[1] || (_cache[1] = $event => (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.isRef)(activeName) ? activeName.value = $event : activeName = $event),
        accordion: ""
      }, {
        default: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.withCtx)(() => [(0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createVNode)(_component_kq_collapse_item, {
          title: "查询条件",
          class: "kq-collapse-item",
          name: "1"
        }, {
          default: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.withCtx)(() => [(0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createVNode)(_component_kq_form, null, {
            default: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.withCtx)(() => [(0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createVNode)(_component_kq_form_item, {
              label: "图层"
            }, {
              default: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.withCtx)(() => [(0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createVNode)(_component_kq_select, {
                ref_key: "ref_Select",
                ref: ref_Select,
                modelValue: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(selectedLayer).guid,
                "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(selectedLayer).guid = $event),
                placeholder: "请选择图层",
                style: {
                  "width": "100%"
                },
                onChange: onChangeSelect
              }, {
                default: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.withCtx)(() => [((0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.openBlock)(true), (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createElementBlock)(external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.Fragment, null, (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.renderList)((0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(layers).data, item => {
                  return (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.openBlock)(), (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createBlock)(_component_kq_option, {
                    label: item.name,
                    value: item.guid,
                    key: item.guid
                  }, null, 8
                  /* PROPS */
                  , ["label", "value"]);
                }), 128
                /* KEYED_FRAGMENT */
                ))]),
                _: 1
                /* STABLE */

              }, 8
              /* PROPS */
              , ["modelValue"])]),
              _: 1
              /* STABLE */

            })]),
            _: 1
            /* STABLE */

          }), (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createVNode)((0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(vue_iclient_leaflet_.KqSketch), (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.mergeProps)(__props.skecthProps, {
            ref_key: "sketch_ref",
            ref: sketch_ref
          }), null, 16
          /* FULL_PROPS */
          ), (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createElementVNode)("div", _hoisted_1, [(0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createVNode)(_component_kq_button, {
            type: "primary",
            onClick: analysis,
            loading: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(btnLoad)
          }, {
            default: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.withCtx)(() => [_hoisted_2]),
            _: 1
            /* STABLE */

          }, 8
          /* PROPS */
          , ["loading"]), (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createVNode)(_component_kq_button, {
            onClick: resetLayer
          }, {
            default: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.withCtx)(() => [_hoisted_3]),
            _: 1
            /* STABLE */

          })])]),
          _: 1
          /* STABLE */

        }), (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createVNode)(_component_kq_collapse_item, {
          title: "查询结果",
          class: "kq-collapse-item",
          name: "2"
        }, {
          default: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.withCtx)(() => [(0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createVNode)((0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(vue_iclient_leaflet_.KqFeatureTable), {
            ref_key: "feature_table",
            ref: feature_table,
            fields: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(fields).value,
            fields_alias: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(fields_alias).value,
            chart_field: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(chart_field).value,
            summary_field: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(summary_field).value,
            features: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(features),
            mapTarget: __props.mapTarget,
            style: {
              "padding": "0px"
            }
          }, null, 8
          /* PROPS */
          , ["fields", "fields_alias", "chart_field", "summary_field", "features", "mapTarget"])]),
          _: 1
          /* STABLE */

        })]),
        _: 1
        /* STABLE */

      }, 8
      /* PROPS */
      , ["modelValue"])], 2
      /* CLASS */
      );
    };
  }

}));
;// CONCATENATED MODULE: ./src/common/overlayanalysis/OverlayAnalysis.vue?vue&type=script&setup=true&lang=js
 
;// CONCATENATED MODULE: ./src/common/overlayanalysis/OverlayAnalysis.vue



const __exports__ = OverlayAnalysisvue_type_script_setup_true_lang_js;

/* harmony default export */ var OverlayAnalysis = (__exports__);
// EXTERNAL MODULE: external "@zpc_npm/vue-iclient-leaflet/init.js"
var init_js_ = __webpack_require__(1396);
var init_js_default = /*#__PURE__*/__webpack_require__.n(init_js_);
;// CONCATENATED MODULE: ./src/common/overlayanalysis/index.js




OverlayAnalysis.install = (Vue, opts) => {
  init_js_default()(Vue, opts);
  Vue.component(OverlayAnalysis.name, OverlayAnalysis);
};


}();
module.exports = __webpack_exports__;
/******/ })()
;