(function webpackUniversalModuleDefinition(root, factory) {
	if(typeof exports === 'object' && typeof module === 'object')
		module.exports = factory(require("vue"), require("@kq_npm/client_common_vue/_utils/gis-utils"), require("@kq_npm/client_common_vue/_utils/webmapservice"), require("@kq_npm/client_common_vue/_utils/util"), require("@kq_npm/client_common_vue/init.js"), require("@kq_npm/client_common_vue/_utils/const-image"));
	else if(typeof define === 'function' && define.amd)
		define(["vue", "@kq_npm/client_common_vue/_utils/gis-utils", "@kq_npm/client_common_vue/_utils/webmapservice", "@kq_npm/client_common_vue/_utils/util", "@kq_npm/client_common_vue/init.js", "@kq_npm/client_common_vue/_utils/const-image"], factory);
	else {
		var a = typeof exports === 'object' ? factory(require("vue"), require("@kq_npm/client_common_vue/_utils/gis-utils"), require("@kq_npm/client_common_vue/_utils/webmapservice"), require("@kq_npm/client_common_vue/_utils/util"), require("@kq_npm/client_common_vue/init.js"), require("@kq_npm/client_common_vue/_utils/const-image")) : factory(root["Vue"], root["@kq_npm/client_common_vue/_utils/gis-utils"], root["@kq_npm/client_common_vue/_utils/webmapservice"], root["@kq_npm/client_common_vue/_utils/util"], root["@kq_npm/client_common_vue/init.js"], root["@kq_npm/client_common_vue/_utils/const-image"]);
		for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
	}
})(this, function(__WEBPACK_EXTERNAL_MODULE__1895__, __WEBPACK_EXTERNAL_MODULE__7135__, __WEBPACK_EXTERNAL_MODULE__3217__, __WEBPACK_EXTERNAL_MODULE__3458__, __WEBPACK_EXTERNAL_MODULE__7997__, __WEBPACK_EXTERNAL_MODULE__6277__) {
return /******/ (function() { // webpackBootstrap
/******/ 	"use strict";
/******/ 	var __webpack_modules__ = ({

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

/* harmony import */ var element_plus_dist_index_full_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9389);
/* harmony import */ var element_plus_dist_index_full_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(element_plus_dist_index_full_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _init__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7997);
/* harmony import */ var _init__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_init__WEBPACK_IMPORTED_MODULE_1__);
/*
 * Copyright (C) 2019 KQ GEO Technologies Co., Ltd.
 * All rights reserved.
 */


element_plus_dist_index_full_js__WEBPACK_IMPORTED_MODULE_0__.ElMessage.install = (Vue, opts) => {
  _init__WEBPACK_IMPORTED_MODULE_1___default()(Vue, opts);
  Vue.component("KqMessage", element_plus_dist_index_full_js__WEBPACK_IMPORTED_MODULE_0__.ElMessage);
};
/* harmony default export */ __webpack_exports__["Z"] = (element_plus_dist_index_full_js__WEBPACK_IMPORTED_MODULE_0__.ElMessage);

/***/ }),

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

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

/***/ }),

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

module.exports = require("@kq_npm/client_icons_vue");

/***/ }),

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

module.exports = require("core-js/modules/es.array.push.js");

/***/ }),

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

module.exports = require("core-js/modules/esnext.iterator.constructor.js");

/***/ }),

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

module.exports = require("core-js/modules/esnext.iterator.for-each.js");

/***/ }),

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

module.exports = require("core-js/modules/web.url-search-params.delete.js");

/***/ }),

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

module.exports = require("core-js/modules/web.url-search-params.has.js");

/***/ }),

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

module.exports = require("core-js/modules/web.url-search-params.size.js");

/***/ }),

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

module.exports = require("element-plus/dist/index.full.js");

/***/ }),

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

module.exports = require("vue-i18n/dist/vue-i18n.cjs.js");

/***/ }),

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

module.exports = __WEBPACK_EXTERNAL_MODULE__6277__;

/***/ }),

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

module.exports = __WEBPACK_EXTERNAL_MODULE__7135__;

/***/ }),

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

module.exports = __WEBPACK_EXTERNAL_MODULE__3458__;

/***/ }),

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

module.exports = __WEBPACK_EXTERNAL_MODULE__3217__;

/***/ }),

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

module.exports = __WEBPACK_EXTERNAL_MODULE__7997__;

/***/ }),

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

module.exports = __WEBPACK_EXTERNAL_MODULE__1895__;

/***/ }),

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


// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  "Z": function() { return /* binding */ _defineProperty; }
});

;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/typeof.js
function _typeof(o) {
  "@babel/helpers - typeof";

  return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
    return typeof o;
  } : function (o) {
    return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
  }, _typeof(o);
}

;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/toPrimitive.js

function toPrimitive(t, r) {
  if ("object" != _typeof(t) || !t) return t;
  var e = t[Symbol.toPrimitive];
  if (void 0 !== e) {
    var i = e.call(t, r || "default");
    if ("object" != _typeof(i)) return i;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return ("string" === r ? String : Number)(t);
}

;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/toPropertyKey.js


function toPropertyKey(t) {
  var i = toPrimitive(t, "string");
  return "symbol" == _typeof(i) ? i : i + "";
}

;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js

function _defineProperty(e, r, t) {
  return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
    value: t,
    enumerable: !0,
    configurable: !0,
    writable: !0
  }) : e[r] = t, e;
}


/***/ })

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

// EXTERNAL MODULE: external "core-js/modules/es.array.push.js"
var es_array_push_js_ = __webpack_require__(2118);
// EXTERNAL MODULE: external "core-js/modules/esnext.iterator.constructor.js"
var esnext_iterator_constructor_js_ = __webpack_require__(8470);
// EXTERNAL MODULE: external "core-js/modules/esnext.iterator.for-each.js"
var esnext_iterator_for_each_js_ = __webpack_require__(1058);
// EXTERNAL MODULE: external {"root":"Vue","commonjs":"vue","commonjs2":"vue","amd":"vue"}
var external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_ = __webpack_require__(1895);
// EXTERNAL MODULE: external "@element-plus/icons-vue"
var icons_vue_ = __webpack_require__(8422);
// EXTERNAL MODULE: external "@kq_npm/client_icons_vue"
var client_icons_vue_ = __webpack_require__(348);
// EXTERNAL MODULE: external "@kq_npm/client_common_vue/_utils/gis-utils"
var gis_utils_ = __webpack_require__(7135);
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js + 3 modules
var defineProperty = __webpack_require__(5301);
// EXTERNAL MODULE: external "core-js/modules/web.url-search-params.delete.js"
var web_url_search_params_delete_js_ = __webpack_require__(4360);
// EXTERNAL MODULE: external "core-js/modules/web.url-search-params.has.js"
var web_url_search_params_has_js_ = __webpack_require__(8824);
// EXTERNAL MODULE: external "core-js/modules/web.url-search-params.size.js"
var web_url_search_params_size_js_ = __webpack_require__(2936);
// EXTERNAL MODULE: external "@kq_npm/client_common_vue/_utils/webmapservice"
var webmapservice_ = __webpack_require__(3217);
var webmapservice_default = /*#__PURE__*/__webpack_require__.n(webmapservice_);
// EXTERNAL MODULE: external "@kq_npm/client_common_vue/_utils/util"
var util_ = __webpack_require__(3458);
// EXTERNAL MODULE: ./src/common/_ui/message/index.js
var message = __webpack_require__(1349);
// EXTERNAL MODULE: external "@kq_npm/client_common_vue/_utils/const-image"
var const_image_ = __webpack_require__(6277);
;// CONCATENATED MODULE: external "papaparse"
var external_papaparse_namespaceObject = require("papaparse");
var external_papaparse_default = /*#__PURE__*/__webpack_require__.n(external_papaparse_namespaceObject);
;// CONCATENATED MODULE: ./src/webgl/adddata/AddDataViewModel.js







/*
 * Copyright (C) 2019 KQ GEO Technologies Co., Ltd.
 * All rights reserved.
 */






//添加数据逻辑类
class AddDataViewModel {
  constructor(scenceView, options) {
    (0,defineProperty/* default */.Z)(this, "_viewer", null);
    (0,defineProperty/* default */.Z)(this, "_layerManager", null);
    (0,defineProperty/* default */.Z)(this, "_language", null);
    (0,defineProperty/* default */.Z)(this, "_geojsonStyle", {
      label: {
        express: "name",
        // font: "25px 微软雅黑",
        font: "28px sans-serif",
        fontSize: 28,
        fillColor: Cesium.Color.WHITE,
        scale: 0.6,
        outlineColor: Cesium.Color.BLACK,
        outlineWidth: 5,
        style: Cesium.LabelStyle.FILL_AND_OUTLINE,
        eyeOffset: Cesium.Cartesian3.ZERO,
        pixelOffset: new Cesium.Cartesian2(0, -8),
        disableDepthTestDistance: 10000000
        // disableDepthTestDistance: Number.POSITIVE_INFINITY
      },
      billboard: {
        image: const_image_.BILLBOARD_IMAGE_URL,
        width: 12,
        height: 12,
        disableDepthTestDistance: 10000000
        // disableDepthTestDistance: Number.POSITIVE_INFINITY
      },
      polyline: {
        width: 2.0,
        material: Cesium.Color.RED,
        clampToGround: true
      },
      polygon: {
        material: Cesium.Color.BLUE.withAlpha(0.3),
        outline: true,
        outlineWidth: 1,
        outlineColor: Cesium.Color.YELLOW,
        perPositionHeight: false
      }
    });
    this._viewer = scenceView._viewer;
    this._layerManager = scenceView._layerManager;
    this._language = scenceView._language;
    this._geometryServerUrl = options.geometryServerUrl;
    this._geometryServerToken = options.geometryServerToken;
    if (options.geojsonStyle) this._geojsonStyle = Object.assign({}, this._geojsonStyle, options.geojsonStyle);
  }

  //解析文件
  parseFile(file, cb) {
    var that = this;
    return new Promise((resolve, reject) => {
      var ext = file.name.replace(/.+\./, "").toLowerCase(); //文件扩展名
      var name = file.name.replace(/(.*\/)*([^.]+).*/gi, "$2"); //文件名
      if (ext === "zip") {
        (0,util_.uploadSHP)(file, function (res) {
          if (res) {
            var ds = new Cesium.Kq3dGeoJsonDataSource(name);
            ds.load(res, that._geojsonStyle).then(ds => {
              ds.entities.values.forEach(entity => {
                if (entity.polygon) {
                  entity.polyline = {
                    positions: entity.polygon.hierarchy._value.positions,
                    width: that._geojsonStyle.polygon.outlineWidth,
                    material: that._geojsonStyle.polygon.outlineColor
                  };
                }
              });
              that._viewer.dataSources.add(ds);
              // ds.autoAvoid(that._viewer);
              that.flyToLayer(ds);
              resolve("success");
              var layer = {
                guid: ds.guid,
                name: name,
                visible: true,
                serverType: "datasource",
                lsType: "ls",
                url: res,
                addType: "geojson",
                shapeType: that._layerManager.getShapeType(ds)
              };
              that._layerManager.addTempLayerNode(layer);
              cb && cb(layer);
            });
          } else {
            reject(file.name + " file parser error.");
            cb && cb("error");
          }
        });
      } else if (ext === "txt") {
        let dataUrl = that._geometryServerUrl + (that._geometryServerToken ? "?ua_token=" + that._geometryServerToken : "");
        (0,util_.readTxT)(file, dataUrl, "4326", this._language, res => {
          if (res) {
            var ds = new Cesium.Kq3dGeoJsonDataSource(name);
            ds.load(res, that._geojsonStyle).then(ds => {
              ds.entities.values.forEach(entity => {
                if (entity.polygon) {
                  entity.polyline = {
                    positions: entity.polygon.hierarchy._value.positions,
                    width: that._geojsonStyle.polygon.outlineWidth,
                    material: that._geojsonStyle.polygon.outlineColor
                  };
                }
              });
              that._viewer.dataSources.add(ds);
              // ds.autoAvoid(that._viewer);
              that.flyToLayer(ds);
              resolve("success");
              var layer = {
                guid: ds.guid,
                name: name,
                visible: true,
                serverType: "datasource",
                lsType: "ls",
                url: res,
                addType: "geojson",
                shapeType: that._layerManager.getShapeType(ds)
              };
              that._layerManager.addTempLayerNode(layer);
              cb && cb(layer);
            });
          } else {
            reject(file.name + " file parser error.");
            cb && cb("error");
          }
        });
      } else if (ext === "csv") {
        (0,util_.readFile)(file, res => {
          var features = external_papaparse_default().parse(res, {
            skipEmptyLines: true,
            header: true
          }).data;
          let _featureCollection = {
            type: "FeatureCollection",
            features: []
          };
          for (var i = 0; i < features.length; i++) {
            let item = features[i];
            let lat = null;
            let lng = null;
            let properties = {};
            for (var j in item) {
              if (j.toUpperCase().indexOf("LAT") != -1) {
                lat = item[j];
              } else if (j.toUpperCase().indexOf("LNG") != -1 || j.toUpperCase().indexOf("LON") != -1) {
                lng = item[j];
              } else if (j.toUpperCase() === "X") {
                lat = item[j];
              } else if (j.toUpperCase() === "Y") {
                lng = item[j];
              } else {
                properties[j] = item[j];
              }
            }
            // 点数据
            if (lat && lng) {
              let _point = {
                type: "Feature",
                geometry: {
                  type: "Point",
                  coordinates: [Number(lng), Number(lat)]
                },
                properties: properties
              };
              _featureCollection.features.push(_point);
            } else {}
          }
          if (_featureCollection.features.length > 0) {
            var ds = new Cesium.Kq3dGeoJsonDataSource(name);
            ds.load(_featureCollection, that._geojsonStyle).then(ds => {
              ds.entities.values.forEach(entity => {
                if (entity.polygon) {
                  entity.polyline = {
                    positions: entity.polygon.hierarchy._value.positions,
                    width: that._geojsonStyle.polygon.outlineWidth,
                    material: that._geojsonStyle.polygon.outlineColor
                  };
                }
              });
              that._viewer.dataSources.add(ds);
              that.flyToLayer(ds);
              resolve("success");
              var layer = {
                guid: ds.guid,
                name: name,
                visible: true,
                serverType: "datasource",
                lsType: "ls",
                url: _featureCollection,
                addType: "geojson",
                shapeType: that._layerManager.getShapeType(ds)
              };
              that._layerManager.addTempLayerNode(layer);
              cb && cb(layer);
            });
          } else {
            reject(file.name + " file parser error.");
            cb && cb("error");
          }
        });
      } else if (ext === "xls" || ext === "xlsx") {
        (0,util_.readExcel)(file, this._language, res => {
          if (res) {
            var ds = new Cesium.Kq3dGeoJsonDataSource(name);
            ds.load(res, that._geojsonStyle).then(ds => {
              ds.entities.values.forEach(entity => {
                if (entity.polygon) {
                  entity.polyline = {
                    positions: entity.polygon.hierarchy._value.positions,
                    width: that._geojsonStyle.polygon.outlineWidth,
                    material: that._geojsonStyle.polygon.outlineColor
                  };
                }
              });
              that._viewer.dataSources.add(ds);
              that.flyToLayer(ds);
              resolve("success");
              var layer = {
                guid: ds.guid,
                name: name,
                visible: true,
                serverType: "datasource",
                lsType: "ls",
                url: res,
                addType: "geojson",
                shapeType: that._layerManager.getShapeType(ds)
              };
              that._layerManager.addTempLayerNode(layer);
              cb && cb(layer);
            });
          } else {
            reject(file.name + " file parser error.");
            cb && cb("error");
          }
        });
      } else if (ext === "dwg" || ext === "dfx") {
        (0,util_.uploadCad)(this._geometryServerUrl, file, this._geometryServerToken, this._language, "4326", function (res) {
          // console.log(res);
          if (res) {
            if (res.features && res.features.type === "processFailed") {
              reject(file.uid);
            }
            if (res.srs) {
              delete res.srs;
            }
            var ds = new Cesium.Kq3dGeoJsonDataSource(name);
            ds.load(res, that._geojsonStyle).then(ds => {
              ds.entities.values.forEach(entity => {
                if (entity.polygon) {
                  entity.polyline = {
                    positions: entity.polygon.hierarchy._value.positions,
                    width: that._geojsonStyle.polygon.outlineWidth,
                    material: that._geojsonStyle.polygon.outlineColor
                  };
                }
              });
              that._viewer.dataSources.add(ds);
              that.flyToLayer(ds);
              resolve("success");
              var layer = {
                guid: ds.guid,
                name: name,
                visible: true,
                serverType: "datasource",
                lsType: "ls",
                url: res,
                addType: "geojson",
                shapeType: that._layerManager.getShapeType(ds)
              };
              that._layerManager.addTempLayerNode(layer);
              cb && cb(layer);
            });
          } else {
            reject(file.uid);
          }
        });
      } else {
        var reader = new FileReader();
        reader.readAsText(file); //文本
        //readAsDataURL(file);  //base64 图片
        //readAsArrayBuffer(file); //原始二进制数据
        //readAsBinaryString(file);//二进制字符串
        //reader.readAsBinaryString(file);
        reader.onload = function (event) {
          var ret = event.target.result;
          switch (ext) {
            case "json":
            case "geojson":
            case "topojson":
              ret = ret.replace(/(^\s*)|(\s*$)/, "");
              ret = ret.substring(ret.indexOf("{"));
              try {
                var data = JSON.parse(ret);
                if (typeof data == "object" && data) {
                  ret = data;
                }
              } catch (e) {}
              var style = {
                ...that._geojsonStyle
              };
              var ds = new Cesium.Kq3dGeoJsonDataSource(name);
              var addType = "geojson";
              // 判断是否是arcgis格式的json数据
              if (ret.geometryType) {
                ds = new Cesium.Kq3dEsriGeoJsonDataSource(name);
                style.label.express = "NAME";
                addType = "arcjson";
              }
              ds.load(ret, style).then(ds => {
                ds.entities.values.forEach(entity => {
                  if (entity.polygon) {
                    entity.polyline = {
                      positions: entity.polygon.hierarchy._value.positions,
                      width: style.polygon.outlineWidth,
                      material: style.polygon.outlineColor
                    };
                  }
                });
                that._viewer.dataSources.add(ds);
                // ds.autoAvoid(that._viewer);
                that.flyToLayer(ds);
                resolve("success");
                var layer = {
                  guid: ds.guid,
                  name: name,
                  visible: true,
                  serverType: "datasource",
                  lsType: "ls",
                  url: ret,
                  addType: addType,
                  shapeType: that._layerManager.getShapeType(ds)
                };
                that._layerManager.addTempLayerNode(layer);
                cb && cb(layer);
              });
              break;
            case "kml":
              ret = ret.replace(/(^\s*)|(\s*$)/, "");
              var options = {
                name: name,
                camera: that._viewer.scene.camera,
                canvas: that._viewer.scene.canvas
              };
              var ds = new Cesium.KmlDataSource(options);
              var data = new Blob([ret], {
                type: "text/xml"
              });
              ds.load(data).then(ds => {
                that._viewer.dataSources.add(ds);
                that.flyToLayer(ds);
                resolve("success");
                var layer = {
                  guid: ds.guid,
                  name: name,
                  visible: true,
                  serverType: "datasource",
                  lsType: "ls",
                  url: data,
                  addType: "kml"
                };
                that._layerManager.addTempLayerNode(layer);
                cb && cb(layer);
              });
              break;
            case "kmz":
              var options = {
                name: name,
                camera: that._viewer.scene.camera,
                canvas: that._viewer.scene.canvas
              };
              var ds = new Cesium.KmlDataSource(options);
              ds.load(file).then(ds => {
                that._viewer.dataSources.add(ds);
                that.flyToLayer(ds);
                resolve("success");
                var layer = {
                  guid: ds.guid,
                  name: name,
                  visible: true,
                  serverType: "datasource",
                  lsType: "ls",
                  url: file,
                  addType: "kml"
                };
                that._layerManager.addTempLayerNode(layer);
                cb && cb(layer);
              });
              break;
            case "czml":
              ret = ret.replace(/(^\s*)|(\s*$)/, "");
              try {
                var data = JSON.parse(ret);
                if (typeof data == "object" && data) {
                  ret = data;
                }
              } catch (e) {}
              if (that._viewer.timeline.container.style.display != 'block') {
                that._viewer.bottomContainer.style.bottom = '15px';
                that._viewer.timeline.container.style.display = 'block';
                that._viewer.animation.container.style.display = 'block';
                that._viewer.animation.resize();
                that._viewer.clock.shouldAnimate = true;
              }
              that._viewer.dataSources.add(Cesium.CzmlDataSource.load(ret, {
                name: name
              })).then(ds => {
                that.flyToLayer(ds);
                resolve("success");
                var layer = {
                  guid: ds.guid,
                  name: name,
                  visible: true,
                  serverType: "datasource",
                  lsType: "ls",
                  url: ret,
                  addType: "czml"
                };
                that._layerManager.addTempLayerNode(layer);
                cb && cb(layer);
              });
              break;
            default:
              break;
          }
        };
        reader.onerror = function () {
          console.log(file.name + " read error.");
          reject(file.name + " read error.");
        };
      }
    });
  }

  //解析数据源
  parseDataSource(options, cb, loadCustom) {
    options = options || {};
    if (options.url && options.url !== "") {
      let url = options.url;
      if (options.type === "stkterrain") {
        if (url.indexOf("?") > 0) {
          url = url.replace("?", "layer.json?");
        } else {
          url += "layer.json";
        }
      }
      try {
        new URL(url);
      } catch (error) {
        (0,message/* default */.Z)({
          message: this._language.errorUrlAddress,
          type: "warning"
        });
        return;
      }
      if (options.type === "kml") {
        this.parseService(options, cb, loadCustom);
        return;
      }
      fetch(url).then(data => {
        return data;
      }).then(data => {
        if (data.status !== 200) {
          (0,message/* default */.Z)({
            message: this._language.serviceNotAvailable,
            type: "warning"
          });
        } else {
          try {
            this.parseService(options, cb, loadCustom);
          } catch {}
        }
      }).catch(() => {
        (0,message/* default */.Z)({
          message: this._language.serviceNotAvailable,
          type: "warning"
        });
      });
    } else {
      (0,message/* default */.Z)({
        message: this._language.inputUrlAddress,
        type: "warning"
      });
    }
  }

  //解析服务
  parseService(options, cb, loadCustom) {
    let that = this;
    let url = options.url;
    let type = options.type || "";
    type = type.toLowerCase();
    let name = options.name;
    if (!name || name === "") {
      let ext;
      if (url.lastIndexOf(".") > url.lastIndexOf("/")) {
        ext = url.substring(url.lastIndexOf(".") + 1);
        ext = ext.toLowerCase();
      }
      if (["kml", "kmz", "czml", "geojson", "json", "topojson"].indexOf(ext) > -1) {
        name = url.substring(url.lastIndexOf("/") + 1);
      } else {
        if (type !== "wms" && type !== "wmts" && type !== "kqgisaggregationserver") {
          name = url.substring(0, url.lastIndexOf("/"));
          name = name.substring(name.lastIndexOf("/") + 1);
        }
      }
    }
    let node, layer;
    switch (type) {
      case "kq3dimageryfile":
        //影像瓦片文件
        layer = this._viewer.imageryLayers.addImageryProvider(new Cesium.Kq3dFileImageryProvider({
          name: name,
          url: url
        }));
        this.flyToLayer(layer);
        node = {
          guid: layer.guid,
          name: name,
          visible: true,
          serverType: "imagerylayer",
          lsType: "ls",
          url: url,
          addType: type
        };
        this._layerManager.addTempLayerNode(node);
        cb && cb(node);
        break;
      case "obterrain":
        //ob地形瓦片文件
        layer = new Cesium.Kq3dFileTerrainProvider({
          name: name,
          url: url
        });
        this._layerManager.setTerrain(layer);
        this.flyToLayer(layer);
        if (!layer.guid) layer.guid = Cesium.createGuid();
        node = {
          guid: layer.guid,
          name: name,
          visible: true,
          serverType: "terrainprovider",
          lsType: "ls",
          url: url,
          addType: type
        };
        this._layerManager.addTempLayerNode(node);
        this._layerManager._terrainProviders.push(layer);
        cb && cb(node);
        break;
      case "stkterrain":
        //stk地形瓦片文件
        layer = new Cesium.CesiumTerrainProvider({
          name: name,
          url: url,
          requestVertexNormals: true,
          requestWaterMask: false
        });
        if (!layer.guid) layer.guid = Cesium.createGuid();
        this._layerManager.setTerrain(layer);
        this.flyToLayer(layer);
        node = {
          guid: layer.guid,
          name: name,
          visible: true,
          serverType: "terrainprovider",
          lsType: "ls",
          url: url,
          addType: type
        };
        this._layerManager.addTempLayerNode(node);
        this._layerManager._terrainProviders.push(layer);
        cb && cb(node);
        break;
      case "3dtiles":
        var tileset = this._viewer.scene.primitives.add(new Cesium.Cesium3DTileset({
          name: name,
          url: url
        }));
        this.flyToLayer(tileset);
        node = {
          guid: tileset.guid,
          name: name,
          visible: true,
          serverType: "3dtiles",
          lsType: "ls",
          url: url,
          addType: type
        };
        this._layerManager.addTempLayerNode(node);
        cb && cb(node);
        break;
      case "kqgis3dserver":
        // KQGIS 三维服务
        var geojsonStyle0 = {
          ...this._geojsonStyle
        };
        this._viewer.addKq3dServerLayerGroupExt(url, {
          geojsonStyle: geojsonStyle0
        }).then(group => {
          var layers = group._addedLayers || group._layers;
          if (layers && layers.length > 0) {
            node = {
              guid: group.guid,
              name: name,
              children: [],
              lsType: "ls"
            };
            var serverType = "";
            var addType = "";
            let promiseList = [];
            for (var i = 0; i < layers.length; i++) {
              if (layers[i] instanceof Cesium.Cesium3DTileset) {
                serverType = "3dtiles";
                addType = "3dtiles";
                url = layers[i]._originUrl;
              } else if (layers[i] instanceof Cesium.ImageryLayer) {
                serverType = "imagerylayer";
                addType = "kq3dimageryfile";
                url = layers[i]._imageryProvider._originUrl;
              } else if (layers[i] instanceof Cesium.Kq3dFileTerrainProvider) {
                serverType = "terrainprovider";
                addType = "obterrain";
                url = layers[i]._originUrl + layers[i]._urlPramas;
                this._layerManager._terrainProviders.push(layers[i]);
              } else if (layers[i] instanceof Cesium.CesiumTerrainProvider) {
                serverType = "terrainprovider";
                addType = "stkterrain";
                url = layers[i]._originUrl;
                this._layerManager._terrainProviders.push(layers[i]);
              } else if (layers[i] instanceof Cesium.Kq3dGeoJsonDataSource) {
                serverType = "datasource";
                addType = "geojson";
                url = layers[i]._url;
                let promise = new Promise(resolve => {
                  layers[i].loadingEvent.addEventListener(function (ds) {
                    // 绘制面边框
                    ds.entities.values.forEach(entity => {
                      if (entity.polygon) {
                        entity.polyline = {
                          positions: entity.polygon.hierarchy._value.positions,
                          width: geojsonStyle0.polygon.outlineWidth,
                          material: geojsonStyle0.polygon.outlineColor
                        };
                      }
                    });
                    let shapeType = "";
                    // 判断geojson点线面类型
                    if (ds.entities.values.length > 0) {
                      let entity = ds.entities.values[0];
                      if (entity.polygon) {
                        shapeType = "polygon";
                      } else if (entity.polyline) {
                        shapeType = "polyline";
                      } else if (entity.billboard || entity.point) {
                        shapeType = "point";
                      }
                    }
                    let dsChild = {
                      guid: ds.guid,
                      name: ds._name,
                      visible: true,
                      serverType: serverType,
                      url: url,
                      addType: "geojson",
                      shapeType: shapeType
                    };
                    node.children.push(dsChild);
                    resolve(true);
                  });
                });
                promiseList.push(promise);
              } else if (layers[i] instanceof Cesium.Kq3dS3MTilesLayer) {
                serverType = "3dtiles";
                addType = "s3m";
                url = layers[i]._url;
              }
              if (serverType !== "datasource") {
                if (!layers[i].guid) layers[i].guid = Cesium.createGuid();
                node.children.push({
                  guid: layers[i].guid,
                  name: layers[i].name || layers[i]._name,
                  visible: true,
                  serverType: serverType,
                  url: url,
                  addType: addType
                });
              }
            }
            Promise.all(promiseList).then(() => {
              this.flyToLayer(layers[0]);
              this._layerManager.addTempLayerNode(node);
              cb && cb(node);
            });
          }
        });
        break;
      case "kqgisimageserver":
        // KQGIS 影像服务
        node = {
          guid: Cesium.createGuid(),
          name: name,
          children: [],
          lsType: "ls"
        };
        const service = new window.KqGIS.Map.GetMapImageInfoService(url);
        service.init(result => {
          if (result.resultcode === "success") {
            let list = service.collectionInfoList;
            if (list && list.length > 0) {
              list.forEach(item => {
                layer = that._viewer.imageryLayers.addImageryProvider(new Cesium.Kq3dKQGISServerImageryProviderExt({
                  name: item.collectionName,
                  url: url,
                  layerName: item.collectionName
                }));
                node.children.push({
                  guid: layer.guid,
                  name: item.collectionName,
                  visible: true,
                  serverType: "imagerylayer",
                  lsType: "ls",
                  url: url,
                  addType: type,
                  layerName: item.collectionName,
                  type: "Image" // 图层树显示图标使用
                });
              });
              this.flyToLayer(layer);
              this._layerManager.addTempLayerNode(node);
              cb && cb(node);
            }
          } else {
            console.log("解析服务原始信息失败.");
          }
        });
        break;
      case "kqgisdataserver":
        // KQGIS 数据服务
        // addDataServer(url, name);
        break;
      case "kqgismapserver":
        // KQGIS 地图服务
        if (loadCustom) {
          loadCustom({
            name,
            url
          });
          return;
        }
        node = {
          guid: Cesium.createGuid(),
          name: name,
          children: [],
          lsType: "ls"
        };
        //使用二维方式解析服务
        let serverName = url.split("services/")[1].split("/")[0];
        let serverUrl = url.split("services/")[0] + "services/";
        let token;
        if (url.indexOf("ua_token") != -1) {
          token = url.split("ua_token=")[1].split("&")[0];
        }
        let webMapService = new (webmapservice_default())(serverName, {
          token: token,
          serviceUrl: serverUrl
        });
        webMapService.getMapInfo().then(mapInfo => {
          if (mapInfo.resultcode === "error") {
            (0,message/* default */.Z)({
              message: mapInfo.message,
              type: "warning"
            });
            return;
          }
          mapInfo = mapInfo.result;
          let mapServerInfo = (0,util_.formatKQMapInfo)(mapInfo, serverUrl, serverName, token, null, true);
          let showLayers = [];
          showLayers = showLayers.concat(mapServerInfo.layers_show);
          showLayers.reverse();
          //获取图层筛选类型时用
          showLayers.forEach(layer => {
            layer.sourceType = "kqserver";
          });
          this._layerManager._layerListData = this._layerManager._layerListData.concat(showLayers);
          showLayers.forEach(layer => {
            var imageryProvider = new Cesium.Kq3dKQGISMapServerImageryProviderExt({
              url: url,
              layers: layer.id + ""
            });
            var imageryLayer = new Cesium.ImageryLayer(imageryProvider, {
              show: layer.visible
            });
            imageryLayer._guid = layer.guid;
            this._viewer.imageryLayers.add(imageryLayer);
          }, this);
          if (mapInfo.rect84) {
            if (mapInfo.rect84 instanceof Array) {
              this._viewer.camera.flyTo({
                destination: Cesium.Rectangle.fromDegrees(mapInfo.rect84[0], mapInfo.rect84[1], mapInfo.rect84[2], mapInfo.rect84[3])
              });
            } else {
              this._viewer.camera.flyTo({
                destination: Cesium.Rectangle.fromDegrees(mapInfo.rect84.minx, mapInfo.rect84.miny, mapInfo.rect84.maxx, mapInfo.rect84.maxy)
              });
            }
          }
          setChildrenAddType(mapServerInfo.layerTreeData, type);
          mapServerInfo.layerTreeData.forEach(layerData => {
            layerData.url = url;
            node.children.push(layerData);
          });
          this._layerManager.addTempLayerNode(node, 1);
          cb && cb(node);
        });
        break;
      case "arcgismapserver":
        // ARCGIS 地图服务
        layer = this._viewer.imageryLayers.addImageryProvider(new Cesium.Kq3dArcGISMapServerImageryProvider({
          name: name,
          url: url,
          usePreCachedTilesIfAvailable: false //使用export请求可支持自定义比例尺
        }));
        this.flyToLayer(layer);
        node = {
          guid: layer.guid,
          name: name,
          visible: true,
          serverType: "imagerylayer",
          lsType: "ls",
          url: url,
          addType: type
        };
        this._layerManager.addTempLayerNode(node);
        cb && cb(node);
        break;
      case "mvt":
        // 矢量瓦片
        layer = this._viewer.imageryLayers.addImageryProvider(new Cesium.Kq3dMvtImageryProviderExt({
          name: name,
          style: url
        }));
        this.flyToLayer(layer);
        node = {
          guid: layer.guid,
          name: name,
          visible: true,
          serverType: "imagerylayer",
          lsType: "ls",
          url: url,
          addType: type,
          renderType: "vectortile" // 图层树显示图标使用
        };
        this._layerManager.addTempLayerNode(node);
        cb && cb(node);
        break;
      case "kqgisdataflowserver":
        // KQGIS 数据流服务
        let guid = Cesium.createGuid();
        layer = new Cesium.Kq3dDataFlowLayer(this._viewer, {
          url: url,
          style: {
            image: const_image_.CAR_URL,
            width: 30,
            height: 30
          }
        });
        layer.guid = guid;
        layer.init();
        layer.flyToBounds();
        node = {
          guid: guid,
          name: name,
          visible: true,
          serverType: "dataflowlayer",
          lsType: "ls",
          url: url,
          addType: type
        };
        this._layerManager.addTempLayerNode(node);
        this._layerManager._dataFlowLayerList.push(layer);
        cb && cb(node);
        break;
      case "wms":
        this._viewer.addWMSLayerGroup(url).then(group => {
          node = {
            guid: group.guid,
            name: name || "wms",
            children: [],
            lsType: "ls",
            serverType: "ogcwms" //图层树显示图标使用
          };
          var layers = group._addedLayers || group._layers;
          if (layers) {
            for (var i = layers.length - 1; i >= 0; i--) {
              if (i === 0) {
                this.flyToLayer(layers[i]);
              }
              node.children.push({
                guid: layers[i].guid,
                name: layers[i].name,
                visible: true,
                serverType: "imagerylayer",
                url: url,
                addType: type,
                id: layers[i]._imageryProvider.layers
              });
            }
          }
          this._layerManager.addTempLayerNode(node);
          cb && cb(node);
        });
        break;
      case "wmts":
      case "kqgistileserver": // KQGIS 瓦片服务
      case "kqgisaggregationserver":
        // KQGIS 聚合服务
        if (type === "kqgistileserver") {
          if (url.indexOf("?") > 0) {
            url = url.replace("?", "/wmts?");
          } else {
            url += "/wmts";
          }
        }
        let defaultName = "wmts";
        this._viewer.addWMTSLayerGroup(url).then(group => {
          // if(type === "kqgistileserver") defaultName = name;
          if (type === "kqgisaggregationserver") defaultName = "aggregation";
          node = {
            guid: group.guid,
            name: name || defaultName,
            children: [],
            lsType: "ls"
          };
          if (type === "wmts") {
            //图层树显示图标使用
            node.serverType = "ogcwmts";
          }
          var layers = group._addedLayers || group._layers;
          if (layers) {
            for (var i = layers.length - 1; i >= 0; i--) {
              if (i === 0) {
                this.flyToLayer(layers[i]);
              }
              node.children.push({
                guid: layers[i].guid,
                name: layers[i].name,
                visible: true,
                serverType: "imagerylayer",
                url: url,
                addType: type,
                id: layers[i]._imageryProvider._layer
              });
            }
          }
          this._layerManager.addTempLayerNode(node);
          cb && cb(node);
        });
        break;
      case "wfs":
        var wfsProvider = new Cesium.Kq3dWebFeatureServiceProvider({
          url: url,
          typeName: name
        });
        wfsProvider.load().then(function (data) {
          var ds = new Cesium.Kq3dGeoJsonDataSource(name);
          ds.load(data, that._geojsonStyle).then(ds => {
            that._viewer.dataSources.add(ds);
            // ds.autoAvoid(that._viewer);
            that.flyToLayer(ds);
            node = {
              guid: ds.guid,
              name: name,
              visible: true,
              serverType: "datasource",
              lsType: "ls",
              url: url,
              addType: type
            };
            that._layerManager.addTempLayerNode(node);
            cb && cb(node);
          });
        });
        break;
      case "geojson":
        var ds = new Cesium.Kq3dGeoJsonDataSource(name);
        ds.load(url, this._geojsonStyle).then(ds => {
          ds.entities.values.forEach(entity => {
            if (entity.polygon) {
              entity.polyline = {
                positions: entity.polygon.hierarchy._value.positions,
                width: this._geojsonStyle.polygon.outlineWidth,
                material: this._geojsonStyle.polygon.outlineColor
              };
            }
          }, this);
          this._viewer.dataSources.add(ds);
          // ds.autoAvoid(this._viewer);
          that.flyToLayer(ds);
          node = {
            guid: ds.guid,
            name: name,
            visible: true,
            serverType: "datasource",
            lsType: "ls",
            url: url,
            addType: type,
            shapeType: this._layerManager.getShapeType(ds)
          };
          this._layerManager.addTempLayerNode(node);
          cb && cb(node);
        });
        break;
      case "arcjson":
        var ds = new Cesium.Kq3dEsriGeoJsonDataSource(name);
        var geojsonStyle = {
          ...this._geojsonStyle
        };
        geojsonStyle.label.express = "NAME";
        ds.load(url, geojsonStyle).then(ds => {
          ds.entities.values.forEach(entity => {
            if (entity.polygon) {
              entity.polyline = {
                positions: entity.polygon.hierarchy._value.positions,
                width: geojsonStyle.polygon.outlineWidth,
                material: geojsonStyle.polygon.outlineColor
              };
            }
          }, this);
          this._viewer.dataSources.add(ds);
          that.flyToLayer(ds);
          node = {
            guid: ds.guid,
            name: name,
            visible: true,
            serverType: "datasource",
            lsType: "ls",
            url: url,
            addType: type,
            shapeType: this._layerManager.getShapeType(ds)
          };
          this._layerManager.addTempLayerNode(node);
          cb && cb(node);
        });
        break;
      case "kml":
        var ds = new Cesium.KmlDataSource({
          name: name,
          camera: this._viewer.camera,
          canvas: this._viewer.scene.canvas
        });
        ds.load(url).then(ds => {
          this._viewer.dataSources.add(ds);
          that.flyToLayer(ds);
          node = {
            guid: ds.guid,
            name: name,
            visible: true,
            serverType: "datasource",
            lsType: "ls",
            url: url,
            addType: type
          };
          this._layerManager.addTempLayerNode(node);
          cb && cb(node);
        });
        break;
      case "czml":
        var ds = new Cesium.CzmlDataSource(name);
        ds.load(url).then(ds => {
          this._viewer.dataSources.add(ds);
          that.flyToLayer(ds);
          node = {
            guid: ds.guid,
            name: name,
            visible: true,
            serverType: "datasource",
            lsType: "ls",
            url: url,
            addType: type
          };
          this._layerManager.addTempLayerNode(node);
          cb && cb(node);
        });
        break;
      case "s3m":
        layer = this._viewer.scene.primitives.add(new Cesium.Kq3dS3MTilesLayer({
          context: this._viewer.scene._context,
          url: url,
          maxVisibleDistance: 1000000,
          minVisibleDistance: 0
        }));
        this.flyToLayer(layer);
        if (!layer.guid) layer.guid = Cesium.createGuid();
        node = {
          guid: layer.guid,
          name: name,
          visible: true,
          serverType: "3dtiles",
          lsType: "ls",
          url: url,
          addType: type
        };
        this._layerManager.addTempLayerNode(node);
        cb && cb(node);
        break;
      default:
        break;
    }
  }

  // 添加数据服务
  addDataServer(url, name) {
    window.KqGIS.datasourceService(url).getDatasources(async e => {
      if (e.result.resultcode === "success") {
        let datasourceList = e.result.result.datasources;
        if (datasourceList) {
          for (let i = 0; i < datasourceList.length; i++) {
            await _getDatasetList(url, datasourceList[i].datasourceName);
          }
        }
      } else {
        console.error(e);
      }
    }, err => {
      console.error(err);
    });
  }
  _getDatasetList(url, dataSourceName) {
    let params = new window.KqGIS.Data.GetDatasetsInfoParams({
      datasourceName: dataSourceName
    });
    return new Promise((resolve, reject) => {
      window.KqGIS.datasetService(url).getDatasets(params, e => {
        if (e.result.resultcode === "success") {
          resolve(e.result.result.datasets);
        } else {
          console.error(e);
          reject([]);
        }
      }, err => {
        console.error(err);
        reject([]);
      });
    });
  }
  _getFeatureList(url, datasourceName, datasetName) {
    let params = new window.KqGIS.Data.GetFeaturesParamsBase({
      datasourceName: datasourceName,
      datasetName: datasetName,
      hasGeometry: true,
      returnContent: true,
      outSRS: "EPSG:4326"
    });
    return new Promise((resolve, reject) => {
      window.KqGIS.dataFeatureService(url).getFeatureList(params, e => {
        if (e.result.resultcode === "success") {
          e.result.result["datasetName"] = datasetName;
          resolve(e.result.result);
        } else {
          console.error(e);
          reject(null);
        }
      }, err => {
        console.error(err);
        resolve(null);
      });
    });
  }
  flyToLayer(layer) {
    let viewer = this._viewer;
    if (layer instanceof Cesium.ImageryLayer) {
      layer.getViewableRectangle().then(function (rectangle) {
        viewer.camera.flyTo({
          destination: rectangle
        });
      });
    } else if (layer instanceof Cesium.Cesium3DTileset) {
      // viewer.zoomTo(layer);
      layer.readyPromise.then(function () {
        viewer.camera.flyToBoundingSphere(layer.boundingSphere);
      });
    } else if (layer instanceof Cesium.Kq3dS3MTilesLayer) {
      layer.readyPromise.then(function (tileset) {
        viewer.camera.flyTo({
          destination: tileset.rectangle
        });
      });
    } else if (layer instanceof Cesium.GeoJsonDataSource || layer instanceof Cesium.Kq3dGeoJsonDataSource || layer instanceof Cesium.Kq3dEsriGeoJsonDataSource) {
      let offset = new Cesium.HeadingPitchRange(0, Cesium.Math.toRadians(-90), 0);
      viewer.flyTo(layer, {
        offset
      });
    } else if (layer instanceof Cesium.KmlDataSource || layer instanceof Cesium.CzmlDataSource) {
      viewer.flyTo(layer);
    } else if (layer instanceof Cesium.Kq3dKQGISServerTerrainProvider || layer instanceof Cesium.Kq3dFileTerrainProvider || layer instanceof Cesium.CesiumTerrainProvider) {
      layer.getViewableRectangle().then(function (rectangle) {
        if (layer.ExtentSource) {
          var rectangle = Cesium.Rectangle.fromDegrees(layer.ExtentSource.left, layer.ExtentSource.bottom, layer.ExtentSource.right, layer.ExtentSource.top);
          viewer.scene.camera.flyTo({
            destination: rectangle
          });
        } else if (rectangle) {
          viewer.camera.flyTo({
            destination: rectangle
          });
        }
      });
    }
  }
}

// 设置子节点addType属性
function setChildrenAddType(nodeList, addType) {
  for (let i = 0; i < nodeList.length; i++) {
    const node = nodeList[i];
    if (node.children) {
      setChildrenAddType(node.children, addType);
    } else {
      node.addType = addType;
    }
  }
}
// EXTERNAL MODULE: external "vue-i18n/dist/vue-i18n.cjs.js"
var vue_i18n_cjs_js_ = __webpack_require__(7080);
;// CONCATENATED MODULE: ./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/dist/index.js??ruleSet[0]!./src/webgl/adddata/AddData.vue?vue&type=script&setup=true&lang=js




const _hoisted_1 = {
  class: "kq3d-add-data-box"
};
const _hoisted_2 = {
  class: "kq3d-add-data-desc"
};
const _hoisted_3 = {
  class: "kq3d-add-data-upload_text"
};
const _hoisted_4 = {
  class: "kq3d-add-data-filelist"
};
const _hoisted_5 = {
  class: "kq3d-add-data-file"
};
const _hoisted_6 = ["title"];
const _hoisted_7 = {
  class: "kq3d-add-data-footer"
};
const _hoisted_8 = {
  class: "btns_box"
};
const _hoisted_9 = {
  class: "kq3d-add-data-tip"
};
const _hoisted_10 = {
  class: "kq3d-add-data-tip"
};
const _hoisted_11 = {
  class: "kq3d-add-data-footer"
};
const _hoisted_12 = {
  class: "btns_box"
};







const __default__ = {
  name: "Kq3dAddData"
};
/* harmony default export */ var AddDatavue_type_script_setup_true_lang_js = (/*#__PURE__*/Object.assign(__default__, {
  props: {
    // 是否显示阴影
    showShadow: {
      type: Boolean,
      default: true
    },
    /**
     * 例："center","topLeft","topRight","bottomLeft","bottomRight", "topCenter", "bottomCenter" {top:'16px',left:'16px'}, {top:16,left:16}
     */
    position: [String, Object],
    // 几何服务地址前缀，例：http://support.kqgeo.com:29800/geometry-proxy/kqgis/rest/services/geometry
    geometryServerUrl: {
      type: String,
      required: true
    },
    // 几何服务token，例：eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJob3N0IiwiY3JlYXRlZCI6MTY1NTk2MzU1NzUyMywiZXhwIjoxNzY3MTEwNDAwfQ.BiNOr6vL6liHzlMK89XSvqmFY9fuWiYqDEwYmWxk-6vFKBgLeMC8FloBXyKcxOCl9Rd28y_pX4PhVRYP5cZTwA
    geometryServerToken: {
      type: String,
      required: true
    },
    // 当前展示的tab标签页
    activeName: {
      type: String,
      default: "upload"
    },
    // 加载回调函数
    loadCallback: {
      type: Function,
      default: null
    },
    // 自定义加载函数, 只对KQGIS REST服务生效, earthstudio使用
    loadCustom: {
      type: Function,
      default: null
    },
    // 是否生成HeaderTemp
    showHeaderTemp: {
      type: Boolean,
      default: false
    },
    // 是否折叠HeaderTemp，showHeaderTemp为true时生效
    isCollapseHeaderTemp: {
      type: Boolean,
      default: false
    },
    // HeaderTemp标题
    headerTempTitle: {
      type: String
    },
    // HeaderTemp图标
    headerTempIcon: {
      type: [Object, String],
      default: client_icons_vue_.IconAddData
    },
    // HeaderTemp Title&Icon的位置
    isRight: {
      type: Boolean,
      default: true
    },
    // geojson数据加载样式
    geojsonStyle: {
      type: Object
    },
    // 隐藏服务类型集合
    hideServiceTypes: {
      type: String
    }
  },
  setup(__props, {
    expose: __expose
  }) {
    const props = __props;
    let accept = ".zip,.geojson,.topojson,.json,.kml,.kmz,.czml,.csv,.xls,.xlsx,.txt,.dwg,.dfx";
    const {
      proxy
    } = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.getCurrentInstance)();
    let language = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.ref)(proxy.$i18n.global.messages[proxy.$i18n.global.locale]["webgl"]);
    let selectTypeIndex = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.ref)(0);

    //URL服务支持的数据源类型
    let dataSourceTypeList = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.ref)([]);
    //选择的数据源类型
    let dataSourceType = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.ref)({});
    let dataSource = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.reactive)({
      url: "",
      name: ""
    });
    let upload_ref = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.ref)(null);
    let upload_btn_ref = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.ref)(null);
    let fileList = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.ref)([]);
    let loadingFile = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.ref)(false);

    // 获取组件传参

    let operatorArray = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.computed)(() => {
      let array = [];
      let list = [...fileList.value];
      let len = list.length;
      for (let i = 0, j = 0; i < len; i += 3, j++) {
        array[j] = list.splice(0, 3);
      }
      return array;
    });
    let disabled = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.computed)(() => {
      let flag = true;
      if (fileList.value.length > 0) {
        flag = false;
      }
      return flag;
    });

    // 组件容器Ref
    let boxRef = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.ref)(null);

    // 生成组件默认header
    let headerTemp = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.ref)();
    let headerTempRef = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.ref)();
    let viewModel = null;

    // 国际化
    let {
      locale,
      messages
    } = (0,vue_i18n_cjs_js_.useI18n)();
    let addDataTitle = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.ref)(null);
    (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.watch)(() => locale.value, (newVal, oldVal) => {
      language.value = messages.value[newVal]["webgl"];
      addDataTitle.value = language.value.addData;
      dataSourceTypeList.value = setDataSourceType();
      dataSourceType.value = dataSourceTypeList.value[selectTypeIndex.value];
    });
    function setDataSourceType() {
      let types = [
      // {
      //     type: 'kq3dimageryfile',
      //     name: language.value.ImagertyTileFile,
      //     namePlaceholder: language.value.optional,
      //     urlPlaceholder: language.value.format +':http://<host>:<port>/xxx/<servername>/info.xml',
      //     description: language.value.imagertyTileFiledescription
      // }, {
      //     type: 'obterrain',
      //     name: language.value.ObTerrainTileFile,
      //     namePlaceholder: language.value.optional,
      //     urlPlaceholder: language.value.format +':http://<host>:<port>/xxx/<servername>/info.xml',
      //     description: language.value.imagertyObTerrainTileFiledescription
      // },
      {
        type: "kqgis3dserver",
        name: language.value.KQGIS3DServer,
        namePlaceholder: language.value.optional,
        urlPlaceholder: language.value.format + ":http://<host>:<port>/kqgis/rest/services/<servername>/realspace",
        description: language.value.imagerty3DServerdescription
      }, {
        type: "kqgismapserver",
        name: language.value.KQGISMapServer,
        namePlaceholder: language.value.optional,
        urlPlaceholder: language.value.format + ":http://<host>:<port>/kqgis/rest/services/<servername>/map",
        description: language.value.imagertyMapServerdescription
      },
      // {
      //   type: "kqgisdataserver",
      //   name: language.value.KQGISDataServer,
      //   namePlaceholder: language.value.optional,
      //   urlPlaceholder: language.value.format + ":http://<host>:<port>/kqgis/rest/services/<servername>/data",
      //   description: language.value.imagertyDataServerdescription
      // },
      {
        type: "kqgisimageserver",
        name: language.value.KQGISImageServer,
        namePlaceholder: language.value.optional,
        urlPlaceholder: language.value.format + ":http://<host>:<port>/kqgis/rest/services/<servername>/image",
        description: language.value.imagertyImageServerdescription
      }, {
        type: "kqgisdataflowserver",
        name: language.value.KQGISDataflowServer,
        namePlaceholder: language.value.optional,
        urlPlaceholder: language.value.format + ":http://<host>:<port>/streaming/rest/services/<servername>/dataflow",
        description: language.value.imagertyDataflowServerdescription
      }, {
        type: "kqgistileserver",
        name: language.value.KQGISTileServer,
        namePlaceholder: language.value.optional,
        urlPlaceholder: language.value.format + ":http://<host>:<port>/kqgis/rest/services/<servername>/tile",
        description: language.value.imagertyTileServerdescription
      }, {
        type: "kqgisaggregationserver",
        name: language.value.KQGISAggregationServer,
        namePlaceholder: language.value.optional,
        urlPlaceholder: language.value.format + ":http://<host>:<port>/kqgis/rest/services/<servername>/map/wmts",
        description: language.value.imagertyAggregationServerdescription
      }, {
        type: "s3m",
        name: language.value.S3M,
        namePlaceholder: language.value.optional,
        urlPlaceholder: language.value.format + ":http://<host>:<port>/xxx/realspace/datas/xxx/config",
        description: language.value.imagertyS3Mdescription
      }, {
        type: "arcgismapserver",
        name: language.value.ArcGISMapServer,
        namePlaceholder: language.value.optional,
        urlPlaceholder: language.value.format + ":http://<host>:<port>/ArcGIS/rest/services/<servername>/MapServer",
        description: language.value.imagertyArcGISMapServerdescription
      }, {
        type: "wms",
        name: language.value.OGCWMS,
        namePlaceholder: language.value.optional,
        urlPlaceholder: language.value.format + ":http://<host>:<port>/kqgis/rest/services/<servername>/map/wms",
        description: language.value.imagertyOGCWMSdescription
      }, {
        type: "wmts",
        name: language.value.OGCWMTS,
        namePlaceholder: language.value.optional,
        urlPlaceholder: language.value.format + ":http://<host>:<port>/kqgis/rest/services/<servername>/map/wmts",
        description: language.value.imagertyOGCWMTSdescription
      }, {
        type: "3dtiles",
        name: language.value.Cesium3DTilesFile,
        namePlaceholder: language.value.optional,
        urlPlaceholder: language.value.format + ":http://<host>:<port>/tileset.json",
        description: language.value.imagerty3DTilesFiledescription
      }, {
        type: "stkterrain",
        name: language.value.StkTerrainTileFile,
        namePlaceholder: language.value.optional,
        urlPlaceholder: language.value.format + ":http://<host>:<port>/xxx/<foldername>/",
        description: language.value.imagertyStkTerrainTileFiledescription
      }, {
        type: "geojson",
        name: language.value.GeoJson,
        namePlaceholder: language.value.optional,
        urlPlaceholder: language.value.format + ":http://<host>:<port>/xxx.geojson",
        description: language.value.imagertyGeoJsondescription
      }, {
        type: "arcjson",
        name: language.value.ArcJson,
        namePlaceholder: language.value.optional,
        urlPlaceholder: language.value.format + ":http://<host>:<port>/xxx.json",
        description: language.value.imagertyArcJsondescription
      }, {
        type: "mvt",
        name: language.value.MVT,
        namePlaceholder: language.value.optional,
        urlPlaceholder: language.value.format + ":http://<host>:<port>/mvt/style.json",
        description: language.value.imagertyMVTdescription
      }
      /*, {
        type: 'wfs',
        name: language.value.OGCWFS,
        namePlaceholder: language.value.wfsLayer,
        urlPlaceholder: language.value.format +':http://<host>:<port>/ArcGIS/rest/services/<servername>/wfs',
        description: language.value.imagertyOGCWFSdescription
      }, {
          type: 'kml',
          name: language.value.KML,
          namePlaceholder: language.value.optional,
          urlPlaceholder: language.value.format +': http://<host>:<port>/xxx/<servername>/xxx.kml',
          description: language.value.imagertyKMLdescription
      }, {
          type: 'czml',
          name: language.value.CZML,
          namePlaceholder: language.value.optional,
          urlPlaceholder: language.value.format +': http://<host>:<port>/xxx/<servername>/xxx.czml',
          description: language.value.imagertyCZMLdescription
      }*/];
      if (props.hideServiceTypes) {
        let indexList = props.hideServiceTypes.split(",");
        for (let i = types.length - 1; i >= 0; i--) {
          if (indexList.includes(i.toString())) {
            types.splice(i, 1);
          }
        }
      }
      return types;
    }
    (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.onMounted)(() => {
      (0,util_.updatePosition)(boxRef.value, props);
      (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.watch)(() => props.position, (newVal, oldVal) => {
        (0,util_.updatePosition)(boxRef.value, props);
      });
      watchCreateHeaderTemp();
      (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.watch)(() => props.showHeaderTemp, (newVal, oldVal) => {
        (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.nextTick)(() => {
          watchCreateHeaderTemp();
        });
      });
      gis_utils_.utils.getWebMap(null, scenceView => {
        if (scenceView) {
          let options = {
            geometryServerUrl: props.geometryServerUrl,
            geometryServerToken: props.geometryServerToken,
            geojsonStyle: props.geojsonStyle
          };
          viewModel = new AddDataViewModel(scenceView, options);
        }
      });
    });

    /**
     * @description 监听header生成
     */
    const watchCreateHeaderTemp = () => {
      if (props.showHeaderTemp) {
        // 生成headerTemp
        headerTemp.value = (0,util_.createHeaderTemp)(boxRef.value, (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.toRefs)(props), headerTempRef, addDataTitle);
      }
    };

    // 切换tab页
    function handleChange(pane) {}

    // 切换类型
    function changeType(index) {
      dataSourceType.value = dataSourceTypeList.value[index];
      dataSource.url = "";
      dataSource.name = "";
    }

    //选择文件
    function changeFile(file) {
      fileList.value.push(file);
    }

    // 删除文件
    function removeFile(file) {
      fileList.value.forEach((item, index) => {
        if (item.uid === file.uid) {
          fileList.value.splice(index, 1);
        }
      });
    }

    //清空所有文件
    function removeFiles() {
      upload_ref.value.$refs.child.clearFiles();
      upload_btn_ref.value.$refs.child.clearFiles();
      fileList.value = [];
    }

    //加载文件
    function loadFiles() {
      loadingFile.value = true;
      let promiseList = [];
      fileList.value.forEach(file => {
        promiseList.push(viewModel.parseFile(file.raw, props.loadCallback));
      });
      Promise.all(promiseList).then(() => {
        removeFiles();
        loadingFile.value = false;
      });
    }

    //加载URL
    function loadURL() {
      viewModel.parseDataSource({
        type: dataSourceType.value.type,
        url: dataSource.url,
        name: dataSource.name
      }, props.loadCallback, props.loadCustom);
    }

    // 重置
    function reset() {
      dataSource.url = "";
      dataSource.name = "";
    }

    // 销毁
    (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.onBeforeUnmount)(() => {});
    __expose({});
    return (_ctx, _cache) => {
      const _component_kq_row = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.resolveComponent)("kq-row");
      const _component_kq_upload = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.resolveComponent)("kq-upload");
      const _component_kq_icon = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.resolveComponent)("kq-icon");
      const _component_kq_col = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.resolveComponent)("kq-col");
      const _component_kq_button = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.resolveComponent)("kq-button");
      const _component_kq_tab_pane = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.resolveComponent)("kq-tab-pane");
      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_input = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.resolveComponent)("kq-input");
      const _component_kq_form = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.resolveComponent)("kq-form");
      const _component_kq_tabs = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.resolveComponent)("kq-tabs");
      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)(["kq3d-add-data", {
          'kq-box-shadow': __props.showShadow
        }]),
        ref_key: "boxRef",
        ref: boxRef
      }, [__props.showHeaderTemp ? ((0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.openBlock)(), (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createBlock)((0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.resolveDynamicComponent)((0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(headerTemp)), {
        key: 0,
        ref_key: "headerTempRef",
        ref: headerTempRef
      }, null, 512 /* NEED_PATCH */)) : (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createCommentVNode)("v-if", true), (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createVNode)(_component_kq_tabs, {
        modelValue: props.activeName,
        "onUpdate:modelValue": _cache[8] || (_cache[8] = $event => props.activeName = $event),
        onTabChange: handleChange
      }, {
        default: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.withCtx)(() => [(0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.renderSlot)(_ctx.$slots, "tabs"), (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_tab_pane, {
          label: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(language).localData,
          name: "upload"
        }, {
          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_2, [(0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createVNode)(_component_kq_row, {
            class: "kq3d-add-data-title"
          }, {
            default: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.withCtx)(() => [(0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createTextVNode)((0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.toDisplayString)((0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(language).fileFormatDescription), 1 /* TEXT */)]),
            _: 1 /* STABLE */
          }), (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createVNode)(_component_kq_row, {
            class: "kq3d-add-data-tip"
          }, {
            default: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.withCtx)(() => [(0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createTextVNode)((0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.toDisplayString)((0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(language).fileFormatDescriptionTips), 1 /* TEXT */)]),
            _: 1 /* STABLE */
          })]), (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createCommentVNode)(" <div>\r\n          <kq-row>{{ language.coordinateSystemDescription }}</kq-row>\r\n          <kq-row class=\"kq3d-add-data-tip\">{{ language.coordinateSystemDescriptionTips }}</kq-row>\r\n        </div> "), (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.withDirectives)((0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createVNode)(_component_kq_upload, {
            drag: "",
            action: "",
            "show-file-list": false,
            "auto-upload": false,
            "file-list": (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(fileList),
            "onUpdate:fileList": _cache[0] || (_cache[0] = $event => (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.isRef)(fileList) ? fileList.value = $event : fileList = $event),
            accept: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(accept),
            "on-change": changeFile,
            ref_key: "upload_ref",
            ref: upload_ref
          }, {
            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_3, (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.toDisplayString)((0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(language).dragFileToArea), 1 /* TEXT */)]),
            _: 1 /* STABLE */
          }, 8 /* PROPS */, ["file-list", "accept"]), [[external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.vShow, (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(fileList).length === 0]]), (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.withDirectives)((0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createElementVNode)("div", _hoisted_4, [((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)(operatorArray), (rowItem, i) => {
            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_row, {
              key: i,
              gutter: 20
            }, {
              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)(rowItem, (file, j) => {
                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_col, {
                  span: 8,
                  key: j
                }, {
                  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_5, [(0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createVNode)(_component_kq_icon, {
                    class: "kq3d-add-data-doc"
                  }, {
                    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_.Document))]),
                    _: 1 /* STABLE */
                  }), (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createElementVNode)("p", {
                    title: file.name
                  }, (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.toDisplayString)(file.name), 9 /* TEXT, PROPS */, _hoisted_6), (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createVNode)(_component_kq_icon, {
                    class: "kq3d-add-data-close",
                    onClick: $event => removeFile(file)
                  }, {
                    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_.CircleClose))]),
                    _: 2 /* DYNAMIC */
                  }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["onClick"])])]),
                  _: 2 /* DYNAMIC */
                }, 1024 /* DYNAMIC_SLOTS */);
              }), 128 /* KEYED_FRAGMENT */))]),
              _: 2 /* DYNAMIC */
            }, 1024 /* DYNAMIC_SLOTS */);
          }), 128 /* KEYED_FRAGMENT */))], 512 /* NEED_PATCH */), [[external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.vShow, (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(fileList).length > 0]]), (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createElementVNode)("div", _hoisted_7, [(0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.renderSlot)(_ctx.$slots, "loadingFilesSwitch"), (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createElementVNode)("div", _hoisted_8, [(0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createVNode)(_component_kq_upload, {
            action: "",
            "show-file-list": false,
            "auto-upload": false,
            accept: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(accept),
            ref_key: "upload_btn_ref",
            ref: upload_btn_ref,
            class: "kq3d-add-data-footer-upload",
            "on-change": changeFile
          }, {
            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, {
              title: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(language).selectFiles,
              type: "primary"
            }, {
              default: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.withCtx)(() => [(0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createTextVNode)((0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.toDisplayString)((0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(language).selectFiles), 1 /* TEXT */)]),
              _: 1 /* STABLE */
            }, 8 /* PROPS */, ["title"])]),
            _: 1 /* STABLE */
          }, 8 /* PROPS */, ["accept"]), (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createVNode)(_component_kq_button, {
            onClick: _cache[1] || (_cache[1] = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.withModifiers)($event => removeFiles(), ["stop"])),
            title: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(language).clearFiles,
            type: "primary"
          }, {
            default: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.withCtx)(() => [(0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createTextVNode)((0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.toDisplayString)((0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(language).clearFiles), 1 /* TEXT */)]),
            _: 1 /* STABLE */
          }, 8 /* PROPS */, ["title"]), (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createVNode)(_component_kq_button, {
            onClick: _cache[2] || (_cache[2] = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.withModifiers)($event => loadFiles(), ["stop"])),
            title: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(language).loadFiles,
            type: "primary",
            disabled: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(disabled),
            loading: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(loadingFile)
          }, {
            default: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.withCtx)(() => [(0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createTextVNode)((0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.toDisplayString)((0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(language).loadFiles), 1 /* TEXT */)]),
            _: 1 /* STABLE */
          }, 8 /* PROPS */, ["title", "disabled", "loading"])])])]),
          _: 3 /* FORWARDED */
        }, 8 /* PROPS */, ["label"]), (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createVNode)(_component_kq_tab_pane, {
          label: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(language).urlData,
          name: "url"
        }, {
          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, {
            "label-width": "70px",
            "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_row, 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: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(language).type
              }, {
                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)(selectTypeIndex),
                  "onUpdate:modelValue": _cache[3] || (_cache[3] = $event => (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.isRef)(selectTypeIndex) ? selectTypeIndex.value = $event : selectTypeIndex = $event),
                  onChange: changeType
                }, {
                  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)(dataSourceTypeList), (item, index) => {
                    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, {
                      key: item.name,
                      label: item.name,
                      value: index
                    }, null, 8 /* PROPS */, ["label", "value"]);
                  }), 128 /* KEYED_FRAGMENT */))]),
                  _: 1 /* STABLE */
                }, 8 /* PROPS */, ["modelValue"]), (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createElementVNode)("span", _hoisted_9, (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.toDisplayString)((0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(dataSourceType).description), 1 /* TEXT */)]),
                _: 1 /* STABLE */
              }, 8 /* PROPS */, ["label"])]),
              _: 1 /* STABLE */
            }), (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createVNode)(_component_kq_row, 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: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(language).url
              }, {
                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_input, {
                  modelValue: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(dataSource).url,
                  "onUpdate:modelValue": _cache[4] || (_cache[4] = $event => (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(dataSource).url = $event),
                  placeholder: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(dataSourceType).urlPlaceholder
                }, null, 8 /* PROPS */, ["modelValue", "placeholder"]), (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createElementVNode)("span", _hoisted_10, (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.toDisplayString)((0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(dataSourceType).urlPlaceholder), 1 /* TEXT */)]),
                _: 1 /* STABLE */
              }, 8 /* PROPS */, ["label"])]),
              _: 1 /* STABLE */
            }), (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createVNode)(_component_kq_row, 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: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(language).nodeName
              }, {
                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_input, {
                  modelValue: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(dataSource).name,
                  "onUpdate:modelValue": _cache[5] || (_cache[5] = $event => (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(dataSource).name = $event),
                  placeholder: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(dataSourceType).namePlaceholder
                }, null, 8 /* PROPS */, ["modelValue", "placeholder"])]),
                _: 1 /* STABLE */
              }, 8 /* PROPS */, ["label"])]),
              _: 1 /* STABLE */
            })]),
            _: 1 /* STABLE */
          }), (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createElementVNode)("div", _hoisted_11, [(0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.renderSlot)(_ctx.$slots, "loadingURLSwitch"), (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createElementVNode)("div", _hoisted_12, [(0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createVNode)(_component_kq_button, {
            onClick: _cache[6] || (_cache[6] = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.withModifiers)($event => loadURL(), ["stop"])),
            title: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(language).loadFiles,
            type: "primary"
          }, {
            default: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.withCtx)(() => [(0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createTextVNode)((0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.toDisplayString)((0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(language).loadFiles), 1 /* TEXT */)]),
            _: 1 /* STABLE */
          }, 8 /* PROPS */, ["title"]), (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createVNode)(_component_kq_button, {
            onClick: _cache[7] || (_cache[7] = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.withModifiers)($event => reset(), ["stop"])),
            title: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(language).reset
          }, {
            default: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.withCtx)(() => [(0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createTextVNode)((0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.toDisplayString)((0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(language).reset), 1 /* TEXT */)]),
            _: 1 /* STABLE */
          }, 8 /* PROPS */, ["title"])])])]),
          _: 3 /* FORWARDED */
        }, 8 /* PROPS */, ["label"])])]),
        _: 3 /* FORWARDED */
      }, 8 /* PROPS */, ["modelValue"])], 2 /* CLASS */);
    };
  }
}));
;// CONCATENATED MODULE: ./src/webgl/adddata/AddData.vue?vue&type=script&setup=true&lang=js
 
;// CONCATENATED MODULE: ./src/webgl/adddata/AddData.vue



const __exports__ = AddDatavue_type_script_setup_true_lang_js;

/* harmony default export */ var AddData = (__exports__);
// EXTERNAL MODULE: external "@kq_npm/client_common_vue/init.js"
var init_js_ = __webpack_require__(7997);
var init_js_default = /*#__PURE__*/__webpack_require__.n(init_js_);
;// CONCATENATED MODULE: ./src/webgl/adddata/index.js
/*
 * Copyright (C) 2019 KQ GEO Technologies Co., Ltd.
 * All rights reserved.
 */



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

}();
/******/ 	return __webpack_exports__;
/******/ })()
;
});