/******/ (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);
    });
  }

}

/***/ }),

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

module.exports = require("@element-plus/icons-vue");

/***/ }),

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

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

/***/ }),

/***/ 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__, {
  "FeatureSelectViewModel": function() { return /* reexport */ FeatureSelectViewModel; },
  "default": function() { return /* reexport */ FeatureSelect; }
});

// 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: external "xe-utils"
var external_xe_utils_ = __webpack_require__(6869);
var external_xe_utils_default = /*#__PURE__*/__webpack_require__.n(external_xe_utils_);
// EXTERNAL MODULE: external "@zpc_npm/vue-iclient-leaflet/_utils/util"
var util_ = __webpack_require__(2107);
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
var defineProperty = __webpack_require__(8270);
// 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);
;// CONCATENATED MODULE: ./src/common/featureselect/FeatureSelectViewModel.js






class FeatureSelectViewModel extends mitt/* default */.Z {
  // 外部导入的图层数据
  // 请求服务获取的地图图层数据
  // 选中的图层
  // 查询获取的features
  // 临时存储生成的layer
  constructor(options) {
    super();

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

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

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

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

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

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

    (0,defineProperty/* default */.Z)(this, "layerCaches", new Map());

    this._props = JSON.parse(JSON.stringify(options.props));
    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);
    this.fire("updateData", {
      maplayers
    });
  } // 设置图层树数据


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

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

    if (maplayers && maplayers.length > 0) {
      this.fire("setLayerData", {
        maplayers
      });
      return maplayers;
    }
  }
  /**
   * 选图后查询
   */


  startQuery() {
    if (!this.selectedLayer) {
      (0,vue_iclient_leaflet_.KqMessage)({
        message: "没有要查询的图层！",
        type: "error",
        duration: 2000
      });
      return false;
    }

    gis_utils_.mapDrawUtils.startDrawRectPoint(this._props.mapTarget, e => {
      let latlng = {
        lat: e.coordinates[1],
        lng: e.coordinates[0]
      };
      let coor1 = [latlng.lng - 0.0000001, latlng.lat - 0.0000001];
      let coor2 = [latlng.lng + 0.0000001, latlng.lat + 0.0000001];
      let coors = [[coor1, [coor1[0], coor2[1]], coor2, [coor2[0], coor1[1]], coor1]];
      let geometry = {
        type: "Polygon",
        coordinates: coors
      };
      this.query(geometry);
    }, true, true, this._props.cursor, this._props.drawStyle);
  }
  /**
   * 识别查询
   * @param {geojson} geometry
   */


  query(geometry) {
    this.fire("onPolling");
    let selectedLayer = this.selectedLayer;
    let ua_token = selectedLayer.accessToken;
    let dataUrl = (0,util_.getKQURLFromURL)(selectedLayer.url) + "/data";
    let geoSRS = new window.KqGIS.ServiceSRS({
      type: window.KqGIS.ProjectSystemType.EPSG,
      value: "4326"
    });
    let filter = new window.KqGIS.FilterParam({
      geometry: geometry,
      geoSRS: geoSRS,
      SpatialRel: window.KqGIS.SpatialRel.INTERSECT
    });
    let params = new window.KqGIS.Data.IdentifyParams({
      layerId: [selectedLayer.id],
      filter: [filter],
      returnContent: true,
      hasGeometry: true,
      ua_token: ua_token
    });
    /**
     * 成功回调
     */

    let onSuccess = response => {
      let res = response.result.result; // this.features = res[0].features;

      this.locateFactor(res[0].features);
      this.fire("onResult");
    };
    /**
     * 失败回调
     */


    let onFailed = error => {
      this.fire("onResult");
      (0,vue_iclient_leaflet_.KqMessage)({
        message: "查询失败！",
        type: "error",
        duration: 2000
      });
    };

    let service = new window.KqGIS.Data.IdentifyService(dataUrl, {
      eventListeners: {
        processCompleted: onSuccess,
        processFailed: onFailed
      }
    });
    service.processAsync(params);
  }
  /**
   * 生成定位因子
   * @param {geoJSON} g - 生成的geojson
   */


  locateFactor(g) {
    if (!g) {
      (0,vue_iclient_leaflet_.KqMessage)({
        message: "选图区域没有选中图层的图形!",
        type: "error",
        duration: 2000
      });
      return false;
    }

    let drawLocationStyle = null;
    let fillLocationStyle = null;

    if (this._props.drawStyle != null && this._props.drawStyle != undefined && this._props.drawStyle != "") {
      drawLocationStyle = this._props.drawStyle;
    }

    if (this._props.fillStyle != null && this._props.fillStyle != undefined && this._props.fillStyle != "") {
      fillLocationStyle = this._props.fillStyle;
    }

    if (!this._props.multiple) {
      // 单选
      this.features = g;
      gis_utils_.mapDrawUtils.removeGeometryByIdCustom(this._props.mapTarget, "queryinfo");
      gis_utils_.mapDrawUtils.drawAndFlytoGeometry(this._props.mapTarget, g, "queryinfo", null, drawLocationStyle, fillLocationStyle);
    } else {
      // 多选
      if (this.layerCaches.has(JSON.stringify(g))) {
        gis_utils_.mapDrawUtils.removeGeometryByIdCustom(this._props.mapTarget, JSON.stringify(g));
        this.layerCaches.delete(JSON.stringify(g));
      } else {
        this.layerCaches.set(JSON.stringify(g), g);
        gis_utils_.mapDrawUtils.drawAndFlytoGeometry(this._props.mapTarget, g, JSON.stringify(g), null, drawLocationStyle, fillLocationStyle);
      }

      this.features = [];
      this.layerCaches.forEach((val, key) => {
        this.features.push(val[0]);
      });
    }
  }
  /**
   * 设置选中的图层
   * @param {Object} selectedLayer - 被选中的图层数据
   */


  setSelectedLayer(selectedLayer) {
    this.reset(); // 清除生成的因子

    this.selectedLayer = selectedLayer; // 重置选中图层
  }

  exportSHP(ServerUrl) {
    if (this.features && this.features.length) {
      (0,util_.exportSHP)(ServerUrl, this.features);
    } else {
      (0,vue_iclient_leaflet_.KqMessage)({
        message: "选图区域没有选中图层的图形!",
        type: "error",
        duration: 2000
      });
    }
  }

  exportTXT() {
    if (this.features && this.features.length) {
      let txtBodys = (0,util_.createTxtBody)(this.features);
      let drawTTitle = "[属性描述] \r\n格式版本号=1.0 \r\n数据生产单位=国土资源部 \r\n数据产生日期=[datatime] \r\n坐标系=墨卡托 \r\n投影类型=高斯克吕格 \r\n计量单位=米 \r\n[地块坐标] \r\n";
      let date = new Date();
      let time = date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + date.getDate();
      drawTTitle = drawTTitle.replace("[datatime]", time); // 设置生成日期

      let evalue = drawTTitle + txtBodys;
      (0,util_.exportTXT)(evalue, "", "地块坐标信息.txt");
    } else {
      (0,vue_iclient_leaflet_.KqMessage)({
        message: "选图区域没有选中图层的图形!",
        type: "error",
        duration: 2000
      });
    }
  }
  /**
   * 重置
   */


  reset() {
    this.layerCaches.forEach((val, key) => {
      gis_utils_.mapDrawUtils.removeGeometryByIdCustom(this._props.mapTarget, key);
    });
    gis_utils_.mapDrawUtils.removeGeometryByIdCustom(this._props.mapTarget, "queryinfo");
    gis_utils_.mapDrawUtils.stopDrawState(this._props.mapTarget);
    this.selectedLayer = null;
  }
  /**
   * @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;
  }

  destroy() {
    this.off();
  }

}
// EXTERNAL MODULE: external "@zpc_npm/vue-iclient-icons"
var vue_iclient_icons_ = __webpack_require__(6867);
// EXTERNAL MODULE: external "@element-plus/icons-vue"
var icons_vue_ = __webpack_require__(8422);
;// CONCATENATED MODULE: ./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/dist/index.js??ruleSet[0]!./src/common/featureselect/FeatureSelect.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_.createElementVNode)("span", {
  class: "title"
}, "导出", -1
/* HOISTED */
);

const _hoisted_3 = /*#__PURE__*/(0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createTextVNode)("导出SHP");

const _hoisted_4 = /*#__PURE__*/(0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createTextVNode)("导出txt");







const __default__ = {
  name: "KqFeatureSelect"
};
/* harmony default export */ var FeatureSelectvue_type_script_setup_true_lang_js = (/*#__PURE__*/Object.assign(__default__, {
  props: {
    // 每个地图相关组件的必须参数 非必传 指定组件绑定的map对象的div的id
    mapTarget: String,
    // 是否显示阴影
    showShadow: {
      type: Boolean,
      default: false
    },

    /**
     * 例："center","topLeft","topRight","bottomLeft","bottomRight", "topCenter", "bottomCenter" {top:'16px',left:'16px'}, {top:16,left:16}
     */
    position: [String, Object],
    // 是否为多选，默认单选
    multiple: {
      type: Boolean,
      default: false
    },
    cursor: {
      type: String,
      default: "url(images/cur/cursor-select.cur),move"
    },
    drawStyle: {
      type: Object,
      default: () => {
        return {
          fillColor: "#3388ff",
          weight: 2,
          fillOpacity: 0.3,
          dashArray: "0"
        };
      }
    },
    fillStyle: {
      type: Object,
      default: () => {
        return {
          lineColor: "red",
          lineWidth: "1px",
          lineType: "grid",
          lineSpacing: 12
        };
      }
    }
  },

  setup(__props, {
    expose
  }) {
    const props = __props;
    let layers = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.reactive)({
      data: []
    }); // 默认值

    let defaultSelected = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.ref)(""); // 选中的图层

    let selectedLayer = null; // 容器

    let box_ref = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.ref)(null);
    let loading = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.ref)(false);
    let viewModel = null;
    (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.onMounted)(() => {
      (0,util_.updatePosition)(box_ref.value, props);
      viewModel = new FeatureSelectViewModel({
        props
      });
      const setLayerData = viewModel.setLayerData();

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


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

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

          if (!result) {
            onReset();
          }
        }
      });
    });
    (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.onBeforeUnmount)(() => {
      clear();
      viewModel = null;
    });

    const setLayer = maplayers => {
      layers.data = maplayers;

      if (maplayers.length === 0) {
        defaultSelected.value = "";
        return;
      }
    };

    const onChangeSelect = guid => {
      defaultSelected.value = guid;
      selectedLayer = external_xe_utils_default().find(layers.data, item => item.guid === guid); // 设置选中的图层

      viewModel.setSelectedLayer(selectedLayer);
    };

    const onSelectExport = val => {
      if (val === "shp") {
        exportSHP();
      }

      if (val === "txt") {
        exportTXT();
      }
    }; // 导出shp


    const exportSHP = () => {
      viewModel.exportSHP();
    }; // 导出txt


    const exportTXT = () => {
      viewModel.exportTXT();
    }; // 选择Feature


    const onSelect = () => {
      viewModel.on("onPolling", () => {
        loading.value = true;
      });
      viewModel.on("onResult", () => {
        loading.value = false;
      });
      viewModel.startQuery();
    };
    /**
     * 重置选中的Feature
     */


    const onReset = () => {
      loading.value = false;
      selectedLayer = null;
      defaultSelected.value = "";
      viewModel.reset();
    };
    /**
     * 销毁组件
     */


    const clear = () => {
      onReset();
      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_icon = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.resolveComponent)("kq-icon");

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

      const _component_kq_dropdown_item = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.resolveComponent)("kq-dropdown-item");

      const _component_kq_dropdown_menu = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.resolveComponent)("kq-dropdown-menu");

      const _component_kq_dropdown = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.resolveComponent)("kq-dropdown");

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

      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-feature-select", __props.showShadow ? 'shadow' : null]),
        ref_key: "box_ref",
        ref: box_ref
      }, [(0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createVNode)(_component_kq_form, {
        "label-width": "84px",
        "label-position": "left"
      }, {
        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: "请选择图层",
          style: {
            "margin-bottom": "8px"
          }
        }, {
          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, {
            modelValue: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(defaultSelected),
            "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.isRef)(defaultSelected) ? defaultSelected.value = $event : defaultSelected = $event),
            onChange: onChangeSelect,
            placeholder: "请选择...",
            style: {
              "width": "243px"
            }
          }, {
            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 */

        }), (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createVNode)(_component_kq_form_item, {
          label: "请选择图斑",
          style: {
            "margin-bottom": "16px"
          }
        }, {
          default: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.withCtx)(() => [(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, {
            onClick: onSelect,
            loading: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(loading)
          }, {
            default: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.withCtx)(() => [(0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.withDirectives)((0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createVNode)(_component_kq_icon, {
              size: 22
            }, {
              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_icons_.IconSelect))]),
              _: 1
              /* STABLE */

            }, 512
            /* NEED_PATCH */
            ), [[external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.vShow, !(0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(loading)]])]),
            _: 1
            /* STABLE */

          }, 8
          /* PROPS */
          , ["loading"]), (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createVNode)(_component_kq_button, {
            onClick: onReset
          }, {
            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_icon, {
              size: 22
            }, {
              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_icons_.IconCancelSelect))]),
              _: 1
              /* STABLE */

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

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

        }), (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createVNode)(_component_kq_form_item, {
          class: "menu-btn"
        }, {
          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_dropdown, {
            onCommand: onSelectExport
          }, {
            dropdown: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.withCtx)(() => [(0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createVNode)(_component_kq_dropdown_menu, 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_dropdown_item, {
                command: "shp"
              }, {
                default: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.withCtx)(() => [_hoisted_3]),
                _: 1
                /* STABLE */

              }), (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createVNode)(_component_kq_dropdown_item, {
                command: "txt"
              }, {
                default: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.withCtx)(() => [_hoisted_4]),
                _: 1
                /* STABLE */

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

            })]),
            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_button, {
              class: "export-btn"
            }, {
              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_icon, {
                size: 16,
                class: "icon-export"
              }, {
                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_icons_.IconExport))]),
                _: 1
                /* STABLE */

              }), _hoisted_2, (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createVNode)(_component_kq_icon, {
                class: "el-icon--right"
              }, {
                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)(icons_vue_.ArrowDown))]),
                _: 1
                /* STABLE */

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

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

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

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

      })], 2
      /* CLASS */
      );
    };
  }

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



const __exports__ = FeatureSelectvue_type_script_setup_true_lang_js;

/* harmony default export */ var FeatureSelect = (__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/featureselect/index.js




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


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