((typeof self !== 'undefined' ? self : this)["webpackJsonprisk_area_management"] = (typeof self !== 'undefined' ? self : this)["webpackJsonprisk_area_management"] || []).push([[7],{

/***/ 0:
/***/ (function(module, exports) {

/* (ignored) */

/***/ }),

/***/ 1:
/***/ (function(module, exports) {

/* (ignored) */

/***/ }),

/***/ "10fa":
/***/ (function(module, exports) {

function webpackEmptyContext(req) {
	var e = new Error("Cannot find module '" + req + "'");
	e.code = 'MODULE_NOT_FOUND';
	throw e;
}
webpackEmptyContext.keys = function() { return []; };
webpackEmptyContext.resolve = webpackEmptyContext;
module.exports = webpackEmptyContext;
webpackEmptyContext.id = "10fa";

/***/ }),

/***/ 2:
/***/ (function(module, exports) {

/* (ignored) */

/***/ }),

/***/ 3:
/***/ (function(module, exports) {

/* (ignored) */

/***/ }),

/***/ 4:
/***/ (function(module, exports) {

/* (ignored) */

/***/ }),

/***/ "4036":
/***/ (function(module, exports, __webpack_require__) {

exports = module.exports = __webpack_require__("2350")(false);
// imports


// module
exports.push([module.i, "[data-v-3dbc1eaa] .el-card__body{height:100%}.tag-risk-primary[data-v-3dbc1eaa]{color:#0082f7!important;background-color:#d0ebff!important;border-color:#d0ebff!important}", ""]);

// exports


/***/ }),

/***/ "45e3":
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var _node_modules_windicss_webpack_plugin_dist_loaders_windicss_style_pitcher_cjs_node_modules_vue_style_loader_index_js_ref_8_oneOf_1_0_node_modules_css_loader_index_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_2_node_modules_windicss_webpack_plugin_dist_loaders_windicss_template_cjs_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_3_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_DrawArea_vue_vue_type_style_index_0_id_3dbc1eaa_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("ec36");
/* harmony import */ var _node_modules_windicss_webpack_plugin_dist_loaders_windicss_style_pitcher_cjs_node_modules_vue_style_loader_index_js_ref_8_oneOf_1_0_node_modules_css_loader_index_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_2_node_modules_windicss_webpack_plugin_dist_loaders_windicss_template_cjs_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_3_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_DrawArea_vue_vue_type_style_index_0_id_3dbc1eaa_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_windicss_webpack_plugin_dist_loaders_windicss_style_pitcher_cjs_node_modules_vue_style_loader_index_js_ref_8_oneOf_1_0_node_modules_css_loader_index_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_2_node_modules_windicss_webpack_plugin_dist_loaders_windicss_template_cjs_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_3_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_DrawArea_vue_vue_type_style_index_0_id_3dbc1eaa_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__);
/* unused harmony reexport * */


/***/ }),

/***/ 5:
/***/ (function(module, exports) {

/* (ignored) */

/***/ }),

/***/ "badc":
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"1d052202-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./node_modules/windicss-webpack-plugin/dist/loaders/windicss-template.cjs!./src/modules/risk-area-management/views/DrawArea.vue?vue&type=template&id=3dbc1eaa&scoped=true
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"flex h-full"},[_c('el-card',{class:_vm.isOpen ? 'w-600px' : 'hidden'},[_c('div',{staticClass:"flex relative items-center justify-between"},[_c('div',{staticClass:"text-20px"},[_vm._v("绘制三维区域")]),_c('div',{staticClass:"absolute -left-20px -right-20px h-2px top-56px bg-gray-200"}),_c('el-select',{attrs:{"value-key":"id","disabled":!_vm.loadedScene,"placeholder":"场景选择","size":"small"},on:{"change":_vm.changeScene},model:{value:(_vm.currentSelectScene),callback:function ($$v) {_vm.currentSelectScene=$$v},expression:"currentSelectScene"}},_vm._l((_vm.sceneList),function(item){return _c('el-option',{key:item.id,attrs:{"label":item.name,"value":item.id}})}),1)],1),_c('div',{staticClass:"mt-20px",class:_vm.showAreaInformation ? 'h-[calc(50%-28px)]' : 'h-[calc(100%-56px)]'},[_c('div',{staticClass:"h-full"},[_c('div',{staticClass:"flex items-center justify-between py-20px"},[_c('div',{staticClass:"flex text-18px flex items-center"},[_c('div',{staticClass:"border-l-3 border-color-primary flex-1 pl-10px text-[#303133] text-18px"},[_vm._v("\n              风险区域列表\n            ")])]),_c('div',[_c('el-input',{staticClass:"flex-1 mr-10px w-200px",attrs:{"size":"small","clearable":"","placeholder":"请输入区域名称"},model:{value:(_vm.areaName),callback:function ($$v) {_vm.areaName=(typeof $$v === 'string'? $$v.trim(): $$v)},expression:"areaName"}}),_c('el-button',{staticClass:"ml-10px",attrs:{"size":"small","type":"primary"},on:{"click":_vm.searchData}},[_vm._v("搜索")])],1)]),_c('div',{staticClass:"h-[calc(100%-125px)]"},[_c('el-table',{directives:[{name:"loading",rawName:"v-loading",value:(_vm.areaListLoading),expression:"areaListLoading"}],ref:"multipleTable",staticClass:"w-full",attrs:{"data":_vm.tableData,"highlight-current-row":"","border":"","height":"100%","row-key":"id","current-row-key":_vm.currentRowKey},on:{"row-click":_vm.rowTbaleClick}},[_c('el-table-column',{attrs:{"align":"center","prop":"name","label":"区域名称","show-overflow-tooltip":""}}),_c('el-table-column',{attrs:{"label":"风险等级","prop":"riskLevelName","show-overflow-tooltip":""},scopedSlots:_vm._u([{key:"default",fn:function(scope){return [_c('el-tag',{staticClass:"w-60px text-center",class:{
                    'tag-risk-primary': _vm._.eq(_vm.tagType[scope.row.riskLevelName], 'primary'),
                    'tag-risk-general': _vm._.eq(_vm.tagType[scope.row.riskLevelName], 'risk'),
                  },attrs:{"size":"mini","type":_vm.tagType[scope.row.riskLevelName] || 'empty'}},[_vm._v(_vm._s(scope.row.riskLevelName))])]}}])}),_c('el-table-column',{attrs:{"label":"是否绘制","prop":"groupName","show-overflow-tooltip":""},scopedSlots:_vm._u([{key:"default",fn:function(scope){return [_vm._v(_vm._s(scope.row.isDrawed ? '√' : 'x'))]}}])})],1)],1),_c('div',{staticClass:"mt-20px flex justify-end"},[_c('el-pagination',{attrs:{"small":"","background":"","current-page":_vm.page.pageNo,"page-size":_vm.page.pageSize,"page-sizes":_vm.pageSizeAll,"layout":"total, sizes, prev, pager, next, jumper","total":_vm.page.total},on:{"size-change":_vm.searchData,"current-change":_vm.getAreaList,"update:currentPage":function($event){return _vm.$set(_vm.page, "pageNo", $event)},"update:current-page":function($event){return _vm.$set(_vm.page, "pageNo", $event)},"update:pageSize":function($event){return _vm.$set(_vm.page, "pageSize", $event)},"update:page-size":function($event){return _vm.$set(_vm.page, "pageSize", $event)}}})],1)])]),(_vm.showAreaInformation)?_c('div',{directives:[{name:"loading",rawName:"v-loading",value:(_vm.detailLoading),expression:"detailLoading"}],staticClass:"mt-20px h-[calc(50%-28px)]"},[_c('div',{staticClass:"flex text-18px flex items-center pb-10px border-b-gray-200 border-b-2px"},[_c('div',{staticClass:"border-l-3 border-color-primary flex-1 pl-10px text-[#303133] text-18px"},[_vm._v("\n          绘制三维风险区域\n        ")])]),_c('div',{staticClass:"mt-20px h-[calc(100%-52px)] overflow-auto"},[_c('el-form',{ref:"areaFormRef",staticClass:"pr-10px",attrs:{"label-width":"160px","size":"small","model":_vm.areaForm,"rules":_vm.areaRules}},[_c('el-row',{attrs:{"gutter":20}},[_c('el-col',{staticClass:"h-36px my-10px",attrs:{"span":22,"offset":0}},[_c('el-form-item',{staticClass:"h-full",attrs:{"label":"区域名称","prop":"name"}},[_c('el-input',{attrs:{"size":"small","placeholder":"请输入","clearable":"","disabled":_vm.isCheck},model:{value:(_vm.areaForm.name),callback:function ($$v) {_vm.$set(_vm.areaForm, "name", $$v)},expression:"areaForm.name"}})],1)],1)],1),_c('el-row',{attrs:{"gutter":20}},[_c('el-col',{staticClass:"h-36px my-10px",attrs:{"span":22,"offset":0}},[_c('el-form-item',{staticClass:"h-full",attrs:{"label":"区域高度","prop":"height"}},[_c('el-input',{attrs:{"size":"small","placeholder":"请输入","clearable":"","disabled":_vm.isCheck},on:{"change":_vm.changeAreaHeight},nativeOn:{"keyup":function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"enter",13,$event.key,"Enter")){ return null; }return _vm.changeAreaHeight($event)}},model:{value:(_vm.areaForm.height),callback:function ($$v) {_vm.$set(_vm.areaForm, "height", $$v)},expression:"areaForm.height"}},[_c('span',{attrs:{"slot":"append"},slot:"append"},[_vm._v("m")])])],1)],1)],1),_c('el-row',{attrs:{"gutter":20}},[_c('el-col',{staticClass:"h-36px my-10px",attrs:{"span":22,"offset":0}},[_c('el-form-item',{staticClass:"h-full",attrs:{"label":"展示名称","prop":"isDisplayName"}},[_c('el-switch',{attrs:{"active-color":"#13ce66","inactive-color":"#ff4949","disabled":_vm.isCheck},model:{value:(_vm.areaForm.isDisplayName),callback:function ($$v) {_vm.$set(_vm.areaForm, "isDisplayName", $$v)},expression:"areaForm.isDisplayName"}})],1)],1)],1),_c('el-row',{attrs:{"gutter":20}},[_c('el-col',{staticClass:"h-36px my-10px",attrs:{"span":22,"offset":0}},[_c('el-form-item',{staticClass:"h-full",attrs:{"label":"视角设置","prop":"playerVisualAngleJson"}},[_c('el-button',{attrs:{"type":"primary","size":"small","disabled":_vm.isCheck},on:{"click":_vm.saveLocation}},[_vm._v("保 存")])],1)],1)],1),_c('el-row',{attrs:{"gutter":20}},[_c('el-col',{staticClass:"h-36px my-10px",attrs:{"span":22,"offset":0}},[_c('el-form-item',{attrs:{"label":"绘制区域"}},[_c('el-button',{attrs:{"type":"primary","size":"small","disabled":_vm.isCheck},on:{"click":_vm.activateTool}},[_vm._v(_vm._s(_vm.isActivateTool ? '取消三维绘制' : '三维绘制'))])],1)],1)],1),_c('el-row',{staticClass:"bt-10px",attrs:{"gutter":20}},[_c('el-col',{attrs:{"span":24,"offset":0}},[_c('el-form-item',{attrs:{"label":"区域坐标","prop":"points"}},_vm._l((_vm.areaForm.points),function(item,index){return _c('el-row',{key:index + 's',staticClass:"mt-5px",attrs:{"gutter":5,"type":"flex","align":"middle"}},[_c('el-col',{attrs:{"span":6}},[_c('el-input',{attrs:{"clearable":"","placeholder":"","disabled":_vm.isCheck},on:{"input":_vm.inputUpdate},model:{value:(item.x),callback:function ($$v) {_vm.$set(item, "x", $$v)},expression:"item.x"}})],1),_c('el-col',{attrs:{"span":6}},[_c('el-input',{attrs:{"clearable":"","placeholder":"","disabled":_vm.isCheck},on:{"input":_vm.inputUpdate},model:{value:(item.y),callback:function ($$v) {_vm.$set(item, "y", $$v)},expression:"item.y"}})],1),_c('el-col',{attrs:{"span":6}},[_c('el-input',{attrs:{"clearable":"","placeholder":"","disabled":_vm.isCheck},on:{"input":_vm.inputUpdate},model:{value:(item.z),callback:function ($$v) {_vm.$set(item, "z", $$v)},expression:"item.z"}})],1),_c('el-col',{attrs:{"span":6}},[_c('el-row',{attrs:{"gutter":5}},[_c('el-col',{attrs:{"span":12}},[(_vm.areaForm.points.length > 1)?_c('el-tooltip',{attrs:{"placement":"top","content":"删除","visible-arrow":false,"open-delay":1000}},[_c('el-button',{staticClass:"mr-5px !text-18px w-36px h-36px p-0",attrs:{"type":"danger","size":"small","icon":"el-icon-remove-outline","disabled":_vm.isCheck},on:{"click":function($event){return _vm.removePositionVertex(index)}}})],1):_vm._e()],1),_c('el-col',{attrs:{"span":12}},[(index === _vm.areaForm.points.length - 1)?_c('el-tooltip',{attrs:{"placement":"top","content":"新增","open-delay":1000,"visible-arrow":false}},[_c('el-button',{staticClass:"!text-18px w-36px h-36px p-0",attrs:{"size":"small","icon":"el-icon-circle-plus-outline","disabled":_vm.isCheck},on:{"click":function($event){return _vm.addPositionVertex(index)}}})],1):_vm._e()],1)],1)],1)],1)}),1)],1)],1)],1),_c('div',{staticClass:"text-center"},[_c('el-button',{attrs:{"type":"primary","size":"small","disabled":_vm.isCheck},on:{"click":_vm.submitArea}},[_vm._v("保存")]),_c('el-button',{attrs:{"size":"small","disabled":_vm.isCheck},on:{"click":_vm.deletePos}},[_vm._v("删除位置")]),_c('el-button',{attrs:{"size":"small"},on:{"click":function($event){return _vm.$router.push((_vm.basePath + "/risk-area-management/three-dimensional"))}}},[_vm._v("返回")])],1)],1)]):_vm._e()]),_c('div',{staticClass:"w-10px relative z-99999",class:_vm.isOpen ? 'left-10px' : 'left-0'},[_c('i',{staticClass:"absolute w-26px h-26px bg-color-primary text-white top-40px -left-10px flex items-center justify-center cursor-pointer rounded-4px",class:_vm.isOpen ? 'el-icon-d-arrow-left' : 'el-icon-d-arrow-right',on:{"click":function($event){_vm.isOpen = !_vm.isOpen}}})]),_c('el-card',{staticClass:"flex-1",class:_vm.isOpen ? '' : '-ml-10px'},[(_vm.sceneDataLoad)?_c('SceneView',{attrs:{"sceneOptions":_vm.sceneOptions},on:{"sendPlayer":_vm.sendPlayer,"loadSceneEnd":_vm.loadSceneEnd}}):_vm._e()],1)],1)}
var staticRenderFns = []


// CONCATENATED MODULE: ./src/modules/risk-area-management/views/DrawArea.vue?vue&type=template&id=3dbc1eaa&scoped=true

// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js + 3 modules
var objectSpread2 = __webpack_require__("5530");

// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js + 5 modules
var slicedToArray = __webpack_require__("3835");

// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js
var regeneratorRuntime = __webpack_require__("c7eb");

// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js
var asyncToGenerator = __webpack_require__("1da1");

// EXTERNAL MODULE: ./node_modules/core-js/modules/es.error.cause.js
var es_error_cause = __webpack_require__("d9e2");

// EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.iterator.js
var es_array_iterator = __webpack_require__("e260");

// EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.push.js
var es_array_push = __webpack_require__("14d9");

// EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.splice.js
var es_array_splice = __webpack_require__("a434");

// EXTERNAL MODULE: ./node_modules/core-js/modules/es.function.name.js
var es_function_name = __webpack_require__("b0c0");

// EXTERNAL MODULE: ./node_modules/core-js/modules/es.json.stringify.js
var es_json_stringify = __webpack_require__("e9c4");

// EXTERNAL MODULE: ./node_modules/core-js/modules/es.number.constructor.js
var es_number_constructor = __webpack_require__("a9e3");

// EXTERNAL MODULE: ./node_modules/core-js/modules/es.number.to-fixed.js
var es_number_to_fixed = __webpack_require__("b680");

// EXTERNAL MODULE: ./node_modules/core-js/modules/es.object.keys.js
var es_object_keys = __webpack_require__("b64b");

// EXTERNAL MODULE: ./node_modules/core-js/modules/es.object.to-string.js
var es_object_to_string = __webpack_require__("d3b7");

// EXTERNAL MODULE: ./node_modules/core-js/modules/es.promise.js
var es_promise = __webpack_require__("e6cf");

// EXTERNAL MODULE: ./node_modules/core-js/modules/es.regexp.exec.js
var es_regexp_exec = __webpack_require__("ac1f");

// EXTERNAL MODULE: ./node_modules/core-js/modules/es.regexp.test.js
var es_regexp_test = __webpack_require__("00b4");

// EXTERNAL MODULE: ./node_modules/core-js/modules/es.regexp.to-string.js
var es_regexp_to_string = __webpack_require__("25f0");

// EXTERNAL MODULE: ./node_modules/core-js/modules/es.string.iterator.js
var es_string_iterator = __webpack_require__("3ca3");

// EXTERNAL MODULE: ./node_modules/core-js/modules/web.dom-collections.iterator.js
var web_dom_collections_iterator = __webpack_require__("ddb0");

// EXTERNAL MODULE: ./node_modules/core-js/modules/web.url.js
var web_url = __webpack_require__("2b3d");

// EXTERNAL MODULE: ./node_modules/core-js/modules/web.url.to-json.js
var web_url_to_json = __webpack_require__("bf19");

// EXTERNAL MODULE: ./node_modules/core-js/modules/web.url-search-params.js
var web_url_search_params = __webpack_require__("9861");

// EXTERNAL MODULE: ./node_modules/core-js/modules/web.url-search-params.delete.js
var web_url_search_params_delete = __webpack_require__("88a7");

// EXTERNAL MODULE: ./node_modules/core-js/modules/web.url-search-params.has.js
var web_url_search_params_has = __webpack_require__("271a");

// EXTERNAL MODULE: ./node_modules/core-js/modules/web.url-search-params.size.js
var web_url_search_params_size = __webpack_require__("5494");

// EXTERNAL MODULE: external "_"
var external_ = __webpack_require__("60bb");

// EXTERNAL MODULE: ./node_modules/wiz-cloud-render/dist/index.umd.js
var index_umd = __webpack_require__("e70f");

// EXTERNAL MODULE: ./node_modules/@wiz-api/scene-management/lib/scene-management.umd.js
var scene_management_umd = __webpack_require__("ffda");

// EXTERNAL MODULE: ./node_modules/@wiz-api/abp-application/lib/abp-application.umd.js
var abp_application_umd = __webpack_require__("39d3");

// EXTERNAL MODULE: ./node_modules/@wiz-api/data-category-management/lib/data-category-management.umd.js
var data_category_management_umd = __webpack_require__("2adf");

// EXTERNAL MODULE: ./node_modules/@wiz-api/area-management/lib/area-management.umd.js
var area_management_umd = __webpack_require__("aa07");

// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/@vue/cli-plugin-babel/node_modules/babel-loader/lib??ref--12-1!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./node_modules/windicss-webpack-plugin/dist/loaders/windicss-template.cjs!./src/modules/risk-area-management/views/DrawArea.vue?vue&type=script&lang=js


























//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//







var areaApi = new area_management_umd["AreaApi"]();
var modelSceneApi = new scene_management_umd["ModelSceneApi"]();
var abpApi = new abp_application_umd["AbpApplicationConfigurationApi"]();
var dataCategoryApi = new data_category_management_umd["DataCategoryApi"]();

// 配置
var currentEnv = Wiz.GetModuleConfig('risk-area-management').currentEnv;
var SceneView = function SceneView() {
  return Promise.all(/* import() */[__webpack_require__.e(3), __webpack_require__.e(8)]).then(__webpack_require__.bind(null, "6999"));
};
/* harmony default export */ var DrawAreavue_type_script_lang_js = ({
  name: 'drawArea',
  components: {
    SceneView: SceneView
  },
  data: function data() {
    var _this = this;
    var checkNumber = function checkNumber(rule, value, calback) {
      var numberReg = /^(-)?(\d+)(\.\d+)?$/;
      var checkValue = Object(external_["every"])(value, function (item) {
        return numberReg.test(item.x) && numberReg.test(item.y) && numberReg.test(item.z) && !Object(external_["isEmpty"])("".concat(item.x)) && !Object(external_["isEmpty"])("".concat(item.y)) && !Object(external_["isEmpty"])("".concat(item.z));
      });
      if (!checkValue) {
        calback(new Error('请输入正确的区域坐标'));
        return;
      }
      if (_this.areaForm.points.length < 3) {
        calback(new Error('区域坐标至少3个'));
        return;
      }
      calback();
    };
    var checkName = function checkName(rule, value, calback) {
      if (!value) {
        calback(new Error('请填写区域名称'));
        return;
      }
      if (value.length > 50) {
        calback(new Error('名称最多50个字符'));
        return;
      }
      calback();
    };
    return {
      areaListLoading: false,
      loadedScene: false,
      isOpen: true,
      // 是否显示左边内容
      player: null,
      tableData: [],
      page: {
        pageNo: 1,
        pageSize: 15,
        total: 0
      },
      pageSizeAll: [15, 30, 45, 60, 75, 90],
      // 列表当前高亮行
      currentRowKey: '',
      areaRules: {
        name: {
          required: true,
          validator: checkName,
          trigger: 'blur'
        },
        height: {
          type: 'number',
          message: '请输入合法数字',
          trigger: 'blur',
          transform: function transform(value) {
            if (Object(external_["isNil"])(value)) {
              return 0;
            }
            return Number(value);
          }
        },
        points: {
          required: true,
          validator: checkNumber,
          trigger: 'blur'
        }
      },
      areaForm: {
        name: '',
        coordinate: '',
        id: '',
        height: 2,
        isDisplayName: false,
        playerVisualAngleJson: '',
        points: [{
          seqNo: 0,
          x: 0,
          y: 0,
          z: 0
        }]
      },
      areaName: '',
      areaDetailId: '',
      areaModelObject: null,
      // 风险区域对象指针
      timerOut: null,
      // 防抖
      isActivateTool: false,
      // 是否激活状态
      clickTableTimerOut: null,
      createPillarPos: [],
      // 通过鼠标创建区域时存放数据
      detailLoading: false,
      styleOptions: {
        type: 'riskArea',
        style: 'deafult'
      },
      sceneOptions: {
        isEnableGis: false,
        latitude: 0,
        longitude: 0,
        name: '',
        id: '',
        folderId: '',
        jsonData: ''
      },
      sceneDataLoad: false,
      sceneList: [],
      currentSelectScene: '',
      riskLevelColor: {},
      currentAreaColor: '',
      // 当前区域的字段
      currentAreaParams: null,
      // 是否是第一次加载场景
      isFirstLoad: true,
      showAreaInformation: false,
      // 是否展示编辑框
      isDrawFinished: true // 区域是否绘制完成
    };
  },
  computed: {
    isCheck: function isCheck() {
      return this.$route.query.operateType === 'check';
    },
    // 风险等级-标签类型
    tagType: function tagType() {
      return Object(external_["fromPairs"])(currentEnv.tagType);
    },
    // 兼容除saas其他项目使用该模块
    basePath: function basePath() {
      return Object(external_["get"])(Wiz, 'globalSettings.globalConfig.routerBase') ? "/".concat(Wiz.globalSettings.globalConfig.routerBase) : '';
    }
  },
  watch: {
    isActivateTool: function isActivateTool(value) {
      var _this2 = this;
      return Object(asyncToGenerator["a" /* default */])( /*#__PURE__*/Object(regeneratorRuntime["a" /* default */])().mark(function _callee() {
        return Object(regeneratorRuntime["a" /* default */])().wrap(function _callee$(_context) {
          while (1) switch (_context.prev = _context.next) {
            case 0:
              if (!_this2.areaModelObject) {
                _context.next = 3;
                break;
              }
              _context.next = 3;
              return index_umd["instance"].ElectoronicRail.changeActiveStatus(value, _this2.areaModelObject.data.id);
            case 3:
            case "end":
              return _context.stop();
          }
        }, _callee);
      }))();
    }
  },
  created: function created() {
    var _this3 = this;
    return Object(asyncToGenerator["a" /* default */])( /*#__PURE__*/Object(regeneratorRuntime["a" /* default */])().mark(function _callee2() {
      var _find, _this3$sceneList$;
      return Object(regeneratorRuntime["a" /* default */])().wrap(function _callee2$(_context2) {
        while (1) switch (_context2.prev = _context2.next) {
          case 0:
            _this3.showAreaInformation = true;
            _this3.detailLoading = true;
            _context2.next = 4;
            return _this3.getSceneList();
          case 4:
            _this3.areaDetailId = _this3.$route.query.id;
            if (_this3.$route.query.sceneId) {
              _this3.currentSelectScene = (_find = Object(external_["find"])(_this3.sceneList, function (item) {
                return item.id === _this3.$route.query.sceneId;
              })) === null || _find === void 0 ? void 0 : _find.id;
            } else {
              _this3.currentSelectScene = (_this3$sceneList$ = _this3.sceneList[0]) === null || _this3$sceneList$ === void 0 ? void 0 : _this3$sceneList$.id;
            }
            if (!Object(external_["isEmpty"])(_this3.currentSelectScene)) {
              _context2.next = 11;
              break;
            }
            _this3.$message.warning({
              showClose: true,
              message: '区域绑定的场景不存在'
            });
            _this3.loadedScene = true;
            _context2.next = 13;
            break;
          case 11:
            _context2.next = 13;
            return _this3.getSceneDetail(_this3.currentSelectScene);
          case 13:
            _this3.sceneDataLoad = true;
            _context2.next = 16;
            return _this3.getDicDataByCodes();
          case 16:
            _context2.next = 18;
            return _this3.getAreaList();
          case 18:
            _context2.next = 20;
            return _this3.getAreaDetail();
          case 20:
          case "end":
            return _context2.stop();
        }
      }, _callee2);
    }))();
  },
  beforeDestroy: function beforeDestroy() {
    this.sceneDataLoad = false;
  },
  methods: {
    // 获取场景列表
    getSceneList: function getSceneList() {
      var _this4 = this;
      return Object(asyncToGenerator["a" /* default */])( /*#__PURE__*/Object(regeneratorRuntime["a" /* default */])().mark(function _callee3() {
        var _yield$modelSceneApi$, _yield$modelSceneApi$2, err, res;
        return Object(regeneratorRuntime["a" /* default */])().wrap(function _callee3$(_context3) {
          while (1) switch (_context3.prev = _context3.next) {
            case 0:
              _context3.next = 2;
              return modelSceneApi.getList({
                skipCount: 0,
                maxResultCount: 1000
              });
            case 2:
              _yield$modelSceneApi$ = _context3.sent;
              _yield$modelSceneApi$2 = Object(slicedToArray["a" /* default */])(_yield$modelSceneApi$, 2);
              err = _yield$modelSceneApi$2[0];
              res = _yield$modelSceneApi$2[1];
              if (!err && !Object(external_["isNil"])(res)) {
                _this4.sceneList = res.items;
              }
            case 7:
            case "end":
              return _context3.stop();
          }
        }, _callee3);
      }))();
    },
    // 获取场景详情
    getSceneDetail: function getSceneDetail(id) {
      var _this5 = this;
      return Object(asyncToGenerator["a" /* default */])( /*#__PURE__*/Object(regeneratorRuntime["a" /* default */])().mark(function _callee4() {
        var _yield$modelSceneApi$3, _yield$modelSceneApi$4, err, res, options, _yield$modelSceneApi$5, _yield$modelSceneApi$6, jsonErr, jsonRes;
        return Object(regeneratorRuntime["a" /* default */])().wrap(function _callee4$(_context4) {
          while (1) switch (_context4.prev = _context4.next) {
            case 0:
              _context4.next = 2;
              return modelSceneApi.get(id);
            case 2:
              _yield$modelSceneApi$3 = _context4.sent;
              _yield$modelSceneApi$4 = Object(slicedToArray["a" /* default */])(_yield$modelSceneApi$3, 2);
              err = _yield$modelSceneApi$4[0];
              res = _yield$modelSceneApi$4[1];
              options = null;
              if (!err && !Object(external_["isNil"])(res)) {
                options = Object(external_["pick"])(res, ['isEnableGis', 'latitude', 'longitude', 'name', 'id', 'folderId']);
              }
              _context4.next = 10;
              return modelSceneApi.getModelSecenRelatedJson({
                id: id
              });
            case 10:
              _yield$modelSceneApi$5 = _context4.sent;
              _yield$modelSceneApi$6 = Object(slicedToArray["a" /* default */])(_yield$modelSceneApi$5, 2);
              jsonErr = _yield$modelSceneApi$6[0];
              jsonRes = _yield$modelSceneApi$6[1];
              if (!jsonErr) {
                options.jsonData = jsonRes;
              }
              if (Object(external_["isEmpty"])(jsonRes)) {
                _this5.$message({
                  showClose: true,
                  message: '当前场景没有模型，不可绘制风险区域',
                  type: 'warning'
                });
                _this5.loadedScene = true;
              }
              _this5.sceneOptions = Object(external_["cloneDeep"])(options);
            case 17:
            case "end":
              return _context4.stop();
          }
        }, _callee4);
      }))();
    },
    // 风险等级列表
    getDicDataByCodes: function getDicDataByCodes() {
      var _this6 = this;
      return Object(asyncToGenerator["a" /* default */])( /*#__PURE__*/Object(regeneratorRuntime["a" /* default */])().mark(function _callee5() {
        var ids, _yield$abpApi$get, _yield$abpApi$get2, configError, abpConfigList, _yield$dataCategoryAp, _yield$dataCategoryAp2, statusError, statusRes;
        return Object(regeneratorRuntime["a" /* default */])().wrap(function _callee5$(_context5) {
          while (1) switch (_context5.prev = _context5.next) {
            case 0:
              ids = [];
              _context5.next = 3;
              return abpApi.get();
            case 3:
              _yield$abpApi$get = _context5.sent;
              _yield$abpApi$get2 = Object(slicedToArray["a" /* default */])(_yield$abpApi$get, 2);
              configError = _yield$abpApi$get2[0];
              abpConfigList = _yield$abpApi$get2[1];
              if (configError) {
                _context5.next = 15;
                break;
              }
              _context5.next = 10;
              return dataCategoryApi.getByCode({
                code: abpConfigList.setting.values['AreaManagement.DataCategory.RiskLevel']
              });
            case 10:
              _yield$dataCategoryAp = _context5.sent;
              _yield$dataCategoryAp2 = Object(slicedToArray["a" /* default */])(_yield$dataCategoryAp, 2);
              statusError = _yield$dataCategoryAp2[0];
              statusRes = _yield$dataCategoryAp2[1];
              if (!statusError) {
                Object(external_["forEach"])(statusRes === null || statusRes === void 0 ? void 0 : statusRes.dataItems, function (item) {
                  _this6.riskLevelColor[item.id] = item.code;
                });
              }
            case 15:
            case "end":
              return _context5.stop();
          }
        }, _callee5);
      }))();
    },
    // 保存当前相机视角
    saveLocation: function saveLocation() {
      var _this7 = this;
      return Object(asyncToGenerator["a" /* default */])( /*#__PURE__*/Object(regeneratorRuntime["a" /* default */])().mark(function _callee6() {
        var cameraInfo;
        return Object(regeneratorRuntime["a" /* default */])().wrap(function _callee6$(_context6) {
          while (1) switch (_context6.prev = _context6.next) {
            case 0:
              _context6.next = 2;
              return index_umd["instance"].Camera.getCurrentCamera();
            case 2:
              cameraInfo = _context6.sent;
              if (cameraInfo) {
                _this7.areaForm.playerVisualAngleJson = JSON.stringify(cameraInfo.data);
                _this7.$message({
                  showClose: true,
                  message: '保存视角成功',
                  type: 'success'
                });
              }
            case 4:
            case "end":
              return _context6.stop();
          }
        }, _callee6);
      }))();
    },
    // 监听场景加载完成
    loadSceneEnd: function loadSceneEnd() {
      var _this8 = this;
      return Object(asyncToGenerator["a" /* default */])( /*#__PURE__*/Object(regeneratorRuntime["a" /* default */])().mark(function _callee7() {
        return Object(regeneratorRuntime["a" /* default */])().wrap(function _callee7$(_context7) {
          while (1) switch (_context7.prev = _context7.next) {
            case 0:
              _this8.loadedScene = true;
              _this8.isActivateTool = false;
              // 如果是编辑查看进入页面后首次自动执行的切换场景
              if (!(_this8.isFirstLoad && _this8.$route.query.operateType !== 'paint')) {
                _context7.next = 8;
                break;
              }
              _context7.next = 5;
              return _this8.drawArea();
            case 5:
              _context7.next = 7;
              return _this8.moveToArea();
            case 7:
              _this8.isFirstLoad = false;
            case 8:
            case "end":
              return _context7.stop();
          }
        }, _callee7);
      }))();
    },
    // 监听绘制过程中的坐标
    getPoints: function getPoints(result) {
      var _this9 = this;
      return Object(asyncToGenerator["a" /* default */])( /*#__PURE__*/Object(regeneratorRuntime["a" /* default */])().mark(function _callee8() {
        var pos, seqNo, _this9$areaModelObjec, _this9$areaModelObjec2, height, scaling;
        return Object(regeneratorRuntime["a" /* default */])().wrap(function _callee8$(_context8) {
          while (1) switch (_context8.prev = _context8.next) {
            case 0:
              if (result && result.pos && result.type === 'createByMouse') {
                _this9.isDrawFinished = result.currentState === 1;
                if (result.currentState === 1 && _this9.createPillarPos.length < 3 || result.currentState === 0) {
                  pos = result.pos;
                  seqNo = _this9.createPillarPos.length; // 处理数据，保留6位小数，并兼容有科学计数法e的情况
                  _this9.createPillarPos.push({
                    seqNo: seqNo,
                    x: pos[0].toFixed(6),
                    y: pos[1].toFixed(6),
                    z: pos[2].toFixed(6)
                  });
                  _this9.areaForm.points = Object(external_["cloneDeep"])(_this9.createPillarPos);
                }
              }
              if (!(result && result.pos && result.type === 'updateElectoronicRail')) {
                _context8.next = 10;
                break;
              }
              _this9.areaForm.points = Object(external_["map"])(result.pos, function (item, index) {
                return {
                  seqNo: index,
                  x: item[0].toFixed(6),
                  y: item[1].toFixed(6),
                  z: item[2].toFixed(6)
                };
              });
              _context8.next = 5;
              return _this9.player.Native.ElectoronicRail.height((_this9$areaModelObjec = _this9.areaModelObject) === null || _this9$areaModelObjec === void 0 ? void 0 : _this9$areaModelObjec.data.fenceObject);
            case 5:
              height = _context8.sent;
              _context8.next = 8;
              return _this9.player.Native.ElectoronicRail.scaling((_this9$areaModelObjec2 = _this9.areaModelObject) === null || _this9$areaModelObjec2 === void 0 ? void 0 : _this9$areaModelObjec2.data.fenceObject);
            case 8:
              scaling = _context8.sent;
              if (height && Array.isArray(scaling)) {
                // 高度保留2位非0小数
                _this9.areaForm.height = Math.abs(parseFloat(height * scaling[2].toFixed(2)));
              }
            case 10:
              _this9.$nextTick(function () {
                _this9.$refs.areaFormRef.validateField('points');
              });
            case 11:
            case "end":
              return _context8.stop();
          }
        }, _callee8);
      }))();
    },
    // 切换场景
    changeScene: function changeScene(id) {
      var _this10 = this;
      return Object(asyncToGenerator["a" /* default */])( /*#__PURE__*/Object(regeneratorRuntime["a" /* default */])().mark(function _callee9() {
        return Object(regeneratorRuntime["a" /* default */])().wrap(function _callee9$(_context9) {
          while (1) switch (_context9.prev = _context9.next) {
            case 0:
              _this10.loadedScene = false;
              _context9.next = 3;
              return _this10.getSceneDetail(id);
            case 3:
              if (_this10.isCheck) {
                _this10.showAreaInformation = false;
              } else {
                _this10.$refs.areaFormRef.clearValidate();
                _this10.areaForm = Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])({}, _this10.$options.data().areaForm), {}, {
                  name: _this10.currentAreaParams.name
                });
              }
              if (!_this10.areaModelObject) {
                _context9.next = 8;
                break;
              }
              _context9.next = 7;
              return _this10.clearArea();
            case 7:
              _this10.areaModelObject = null;
            case 8:
              _this10.getAreaList();
            case 9:
            case "end":
              return _context9.stop();
          }
        }, _callee9);
      }))();
    },
    // 搜索
    searchData: function searchData() {
      this.page.pageNo = 1;
      this.getAreaList();
    },
    // 表格row点击事件
    rowTbaleClick: function rowTbaleClick(val) {
      var _this11 = this;
      return Object(asyncToGenerator["a" /* default */])( /*#__PURE__*/Object(regeneratorRuntime["a" /* default */])().mark(function _callee10() {
        return Object(regeneratorRuntime["a" /* default */])().wrap(function _callee10$(_context10) {
          while (1) switch (_context10.prev = _context10.next) {
            case 0:
              if (_this11.loadedScene) {
                _context10.next = 2;
                break;
              }
              return _context10.abrupt("return", _this11.$message.warning({
                showClose: true,
                message: '请等场景加载完成后操作'
              }));
            case 2:
              _this11.$nextTick(function () {
                _this11.$refs.areaFormRef && _this11.$refs.areaFormRef.clearValidate();
              });
              _this11.showAreaInformation = true;
              _this11.isActivateTool = false;
              _this11.areaDetailId = val.id;
              _this11.currentRowKey = val.id;
              _this11.areaForm = Object(external_["cloneDeep"])(val);
              _context10.next = 10;
              return _this11.getAreaDetail();
            case 10:
              _context10.next = 12;
              return _this11.drawArea();
            case 12:
              _context10.next = 14;
              return _this11.moveToArea();
            case 14:
            case "end":
              return _context10.stop();
          }
        }, _callee10);
      }))();
    },
    // 点击定位到区域位置
    moveToArea: function moveToArea(row) {
      var _this12 = this;
      return Object(asyncToGenerator["a" /* default */])( /*#__PURE__*/Object(regeneratorRuntime["a" /* default */])().mark(function _callee12() {
        return Object(regeneratorRuntime["a" /* default */])().wrap(function _callee12$(_context12) {
          while (1) switch (_context12.prev = _context12.next) {
            case 0:
              if (_this12.clickTableTimerOut) clearTimeout(_this12.clickTableTimerOut);
              _this12.clickTableTimerOut = setTimeout( /*#__PURE__*/Object(asyncToGenerator["a" /* default */])( /*#__PURE__*/Object(regeneratorRuntime["a" /* default */])().mark(function _callee11() {
                var aabb;
                return Object(regeneratorRuntime["a" /* default */])().wrap(function _callee11$(_context11) {
                  while (1) switch (_context11.prev = _context11.next) {
                    case 0:
                      if (!(_this12.areaForm && _this12.areaForm.playerVisualAngleJson)) {
                        _context11.next = 5;
                        break;
                      }
                      _context11.next = 3;
                      return index_umd["instance"].Camera.moveCamera('CameraParam', JSON.parse(_this12.areaForm.playerVisualAngleJson));
                    case 3:
                      _context11.next = 12;
                      break;
                    case 5:
                      if (!_this12.areaForm) {
                        _context11.next = 12;
                        break;
                      }
                      if (!_this12.areaModelObject) {
                        _context11.next = 12;
                        break;
                      }
                      _context11.next = 9;
                      return _this12.player.Native.ElectoronicRail.getAabb(_this12.areaModelObject.data.fenceObject);
                    case 9:
                      aabb = _context11.sent;
                      _context11.next = 12;
                      return _this12.player.Native.Camera.moveToAabb({
                        min: aabb[0],
                        max: aabb[1]
                      }, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], 0, 1.1, 1);
                    case 12:
                    case "end":
                      return _context11.stop();
                  }
                }, _callee11);
              })), 500);
            case 2:
            case "end":
              return _context12.stop();
          }
        }, _callee12);
      }))();
    },
    sendPlayer: function sendPlayer(player) {
      var _this13 = this;
      return Object(asyncToGenerator["a" /* default */])( /*#__PURE__*/Object(regeneratorRuntime["a" /* default */])().mark(function _callee13() {
        return Object(regeneratorRuntime["a" /* default */])().wrap(function _callee13$(_context13) {
          while (1) switch (_context13.prev = _context13.next) {
            case 0:
              _this13.player = player; // 存储实例化完成的player
              index_umd["instance"].Dispatch.on('ElectoronicRail', _this13.getPoints);
            case 2:
            case "end":
              return _context13.stop();
          }
        }, _callee13);
      }))();
    },
    // 提交表单
    submitArea: function submitArea() {
      var _this14 = this;
      this.$refs.areaFormRef.validate( /*#__PURE__*/function () {
        var _ref2 = Object(asyncToGenerator["a" /* default */])( /*#__PURE__*/Object(regeneratorRuntime["a" /* default */])().mark(function _callee14(value) {
          var params, _yield$areaApi$update, _yield$areaApi$update2, err, res;
          return Object(regeneratorRuntime["a" /* default */])().wrap(function _callee14$(_context14) {
            while (1) switch (_context14.prev = _context14.next) {
              case 0:
                if (!value) {
                  _context14.next = 13;
                  break;
                }
                params = {
                  id: _this14.areaDetailId,
                  modelId: _this14.currentSelectScene,
                  name: _this14.areaForm.name,
                  height: _this14.areaForm.height === '' ? null : _this14.areaForm.height,
                  isDisplayName: _this14.areaForm.isDisplayName,
                  playerVisualAngleJson: _this14.areaForm.playerVisualAngleJson,
                  coordinate: JSON.stringify(_this14.areaForm.points)
                };
                _context14.next = 4;
                return areaApi.update(params.id, {
                  body: Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])({}, _this14.currentAreaParams), params)
                });
              case 4:
                _yield$areaApi$update = _context14.sent;
                _yield$areaApi$update2 = Object(slicedToArray["a" /* default */])(_yield$areaApi$update, 2);
                err = _yield$areaApi$update2[0];
                res = _yield$areaApi$update2[1];
                if (err) {
                  _context14.next = 13;
                  break;
                }
                _this14.$message({
                  showClose: true,
                  message: '保存成功',
                  type: 'success'
                });
                _context14.next = 12;
                return _this14.getAreaList();
              case 12:
                _this14.isActivateTool = false;
              case 13:
              case "end":
                return _context14.stop();
            }
          }, _callee14);
        }));
        return function (_x) {
          return _ref2.apply(this, arguments);
        };
      }());
    },
    // 删除位置
    deletePos: function deletePos() {
      var _this15 = this;
      return Object(asyncToGenerator["a" /* default */])( /*#__PURE__*/Object(regeneratorRuntime["a" /* default */])().mark(function _callee15() {
        return Object(regeneratorRuntime["a" /* default */])().wrap(function _callee15$(_context15) {
          while (1) switch (_context15.prev = _context15.next) {
            case 0:
              _this15.areaForm.points = [{
                seqNo: 0,
                x: 0,
                y: 0,
                z: 0
              }];
              if (!_this15.areaModelObject) {
                _context15.next = 6;
                break;
              }
              _context15.next = 4;
              return _this15.clearArea();
            case 4:
              _this15.areaModelObject = null;
              _this15.createPillarPos = [];
            case 6:
              _this15.isActivateTool = false;
            case 7:
            case "end":
              return _context15.stop();
          }
        }, _callee15);
      }))();
    },
    // 是否激活工具
    activateTool: function activateTool() {
      var _this16 = this;
      return Object(asyncToGenerator["a" /* default */])( /*#__PURE__*/Object(regeneratorRuntime["a" /* default */])().mark(function _callee16() {
        return Object(regeneratorRuntime["a" /* default */])().wrap(function _callee16$(_context16) {
          while (1) switch (_context16.prev = _context16.next) {
            case 0:
              if (!Object(external_["isEmpty"])(_this16.sceneOptions.jsonData)) {
                _context16.next = 2;
                break;
              }
              return _context16.abrupt("return", _this16.$message({
                showClose: true,
                message: '当前场景没有模型，不可绘制风险区域',
                type: 'warning'
              }));
            case 2:
              _this16.createPillarPos = [];
              _this16.isActivateTool = !_this16.isActivateTool;
              // 如果没有区域对象并且处于绘制状态则开启鼠标绘制模式
              if (!(!_this16.areaModelObject && _this16.isActivateTool)) {
                _context16.next = 7;
                break;
              }
              _context16.next = 7;
              return _this16.createArea(true);
            case 7:
            case "end":
              return _context16.stop();
          }
        }, _callee16);
      }))();
    },
    handleSizeChange: function handleSizeChange(val) {
      this.page.pageSize = val;
      this.getAreaList();
    },
    handleCurrentChange: function handleCurrentChange(val) {
      this.page.pageNo = val;
      this.getAreaList();
    },
    // 强制刷新输入框
    inputUpdate: function inputUpdate() {
      this.changePillarPosition();
    },
    // 新增区域坐标
    addPositionVertex: function addPositionVertex(index) {
      var _this17 = this;
      return Object(asyncToGenerator["a" /* default */])( /*#__PURE__*/Object(regeneratorRuntime["a" /* default */])().mark(function _callee17() {
        return Object(regeneratorRuntime["a" /* default */])().wrap(function _callee17$(_context17) {
          while (1) switch (_context17.prev = _context17.next) {
            case 0:
              _this17.areaForm.points.push({
                seqNo: index + 1,
                x: '0',
                y: '0',
                z: '0'
              });
              _this17.$nextTick(function () {
                _this17.$refs.areaFormRef.validateField('points');
              });
            case 2:
            case "end":
              return _context17.stop();
          }
        }, _callee17);
      }))();
    },
    // 修改区域坐标
    changePillarPosition: function changePillarPosition() {
      var _this18 = this;
      return Object(asyncToGenerator["a" /* default */])( /*#__PURE__*/Object(regeneratorRuntime["a" /* default */])().mark(function _callee19() {
        return Object(regeneratorRuntime["a" /* default */])().wrap(function _callee19$(_context19) {
          while (1) switch (_context19.prev = _context19.next) {
            case 0:
              if (_this18.timerOut) clearTimeout(_this18.timerOut);
              _this18.timerOut = setTimeout( /*#__PURE__*/Object(asyncToGenerator["a" /* default */])( /*#__PURE__*/Object(regeneratorRuntime["a" /* default */])().mark(function _callee18() {
                return Object(regeneratorRuntime["a" /* default */])().wrap(function _callee18$(_context18) {
                  while (1) switch (_context18.prev = _context18.next) {
                    case 0:
                      _context18.next = 2;
                      return _this18.drawArea();
                    case 2:
                      clearTimeout(_this18.timerOut);
                      _this18.timerOut = null;
                    case 4:
                    case "end":
                      return _context18.stop();
                  }
                }, _callee18);
              })), 500);
            case 2:
            case "end":
              return _context19.stop();
          }
        }, _callee19);
      }))();
    },
    // 移除区域坐标
    removePositionVertex: function removePositionVertex(index) {
      var _this19 = this;
      return Object(asyncToGenerator["a" /* default */])( /*#__PURE__*/Object(regeneratorRuntime["a" /* default */])().mark(function _callee20() {
        return Object(regeneratorRuntime["a" /* default */])().wrap(function _callee20$(_context20) {
          while (1) switch (_context20.prev = _context20.next) {
            case 0:
              _this19.areaForm.points.splice(index, 1);
              _this19.createPillarPos = [];
              _this19.isActivateTool = false;
              if (!(_this19.areaForm.points.length === 1)) {
                _context20.next = 9;
                break;
              }
              _context20.next = 6;
              return _this19.clearArea();
            case 6:
              _this19.areaModelObject = null;
              _context20.next = 11;
              break;
            case 9:
              _context20.next = 11;
              return _this19.drawArea();
            case 11:
              _this19.$nextTick(function () {
                _this19.$refs.areaFormRef.validateField('points');
              });
            case 12:
            case "end":
              return _context20.stop();
          }
        }, _callee20);
      }))();
    },
    // 改变区域高度
    changeAreaHeight: function changeAreaHeight() {
      if (this.areaModelObject) {
        this.updateArea();
      }
    },
    // 获取uuid
    getUUID: function getUUID() {
      return Object(asyncToGenerator["a" /* default */])( /*#__PURE__*/Object(regeneratorRuntime["a" /* default */])().mark(function _callee21() {
        var tempUrl, uuid;
        return Object(regeneratorRuntime["a" /* default */])().wrap(function _callee21$(_context21) {
          while (1) switch (_context21.prev = _context21.next) {
            case 0:
              tempUrl = URL.createObjectURL(new Blob());
              uuid = tempUrl.toString();
              URL.revokeObjectURL(tempUrl);
              return _context21.abrupt("return", uuid.substring(uuid.lastIndexOf('/') + 1));
            case 4:
            case "end":
              return _context21.stop();
          }
        }, _callee21);
      }))();
    },
    // 创建区域
    createArea: function createArea(isByMouse) {
      var _this20 = this;
      return Object(asyncToGenerator["a" /* default */])( /*#__PURE__*/Object(regeneratorRuntime["a" /* default */])().mark(function _callee22() {
        var pos, baseOptions;
        return Object(regeneratorRuntime["a" /* default */])().wrap(function _callee22$(_context22) {
          while (1) switch (_context22.prev = _context22.next) {
            case 0:
              pos = Object(external_["map"])(_this20.areaForm.points, function (item) {
                return [item.x, item.y, item.z];
              });
              baseOptions = {
                name: 'newArea',
                pos: pos,
                height: _this20.areaForm.height,
                id: _this20.getUUID(),
                editMode: _this20.isActivateTool
              };
              _this20.styleOptions.style = _this20.currentAreaColor;
              if (!isByMouse) {
                _context22.next = 9;
                break;
              }
              _context22.next = 6;
              return index_umd["instance"].ElectoronicRail.activeCreateByMouse(baseOptions, _this20.styleOptions);
            case 6:
              _this20.areaModelObject = _context22.sent;
              _context22.next = 12;
              break;
            case 9:
              _context22.next = 11;
              return index_umd["instance"].ElectoronicRail.createByPosition(baseOptions, _this20.styleOptions);
            case 11:
              _this20.areaModelObject = _context22.sent;
            case 12:
            case "end":
              return _context22.stop();
          }
        }, _callee22);
      }))();
    },
    // 更新区域
    updateArea: function updateArea() {
      var _this21 = this;
      return Object(asyncToGenerator["a" /* default */])( /*#__PURE__*/Object(regeneratorRuntime["a" /* default */])().mark(function _callee23() {
        var pos, baseOptions;
        return Object(regeneratorRuntime["a" /* default */])().wrap(function _callee23$(_context23) {
          while (1) switch (_context23.prev = _context23.next) {
            case 0:
              _context23.next = 2;
              return _this21.clearArea();
            case 2:
              _this21.areaModelObject = null;
              pos = Object(external_["map"])(_this21.areaForm.points, function (item) {
                return [item.x, item.y, item.z];
              });
              baseOptions = {
                name: 'newArea',
                pos: pos,
                height: _this21.areaForm.height,
                id: _this21.getUUID(),
                editMode: _this21.isActivateTool
              };
              _this21.styleOptions.style = _this21.currentAreaColor;
              _context23.next = 8;
              return index_umd["instance"].ElectoronicRail.createByPosition(baseOptions, _this21.styleOptions);
            case 8:
              _this21.areaModelObject = _context23.sent;
            case 9:
            case "end":
              return _context23.stop();
          }
        }, _callee23);
      }))();
    },
    // 绘制风险区域
    drawArea: function drawArea() {
      var _this22 = this;
      return Object(asyncToGenerator["a" /* default */])( /*#__PURE__*/Object(regeneratorRuntime["a" /* default */])().mark(function _callee24() {
        return Object(regeneratorRuntime["a" /* default */])().wrap(function _callee24$(_context24) {
          while (1) switch (_context24.prev = _context24.next) {
            case 0:
              if (!_this22.areaModelObject) {
                _context24.next = 5;
                break;
              }
              _context24.next = 3;
              return _this22.updateArea();
            case 3:
              _context24.next = 7;
              break;
            case 5:
              _context24.next = 7;
              return _this22.createArea();
            case 7:
            case "end":
              return _context24.stop();
          }
        }, _callee24);
      }))();
    },
    // 清除风险区域
    clearArea: function clearArea() {
      var _this23 = this;
      return Object(asyncToGenerator["a" /* default */])( /*#__PURE__*/Object(regeneratorRuntime["a" /* default */])().mark(function _callee25() {
        return Object(regeneratorRuntime["a" /* default */])().wrap(function _callee25$(_context25) {
          while (1) switch (_context25.prev = _context25.next) {
            case 0:
              if (!_this23.isDrawFinished) {
                _context25.next = 5;
                break;
              }
              _context25.next = 3;
              return index_umd["instance"].ElectoronicRail.destroy([_this23.areaModelObject.data.id]);
            case 3:
              _context25.next = 7;
              break;
            case 5:
              _context25.next = 7;
              return index_umd["instance"].ElectoronicRail.reset();
            case 7:
            case "end":
              return _context25.stop();
          }
        }, _callee25);
      }))();
    },
    // 获取风险区域列表
    getAreaList: function getAreaList() {
      var _this24 = this;
      return Object(asyncToGenerator["a" /* default */])( /*#__PURE__*/Object(regeneratorRuntime["a" /* default */])().mark(function _callee26() {
        var params, _yield$areaApi$getLis, _yield$areaApi$getLis2, err, res;
        return Object(regeneratorRuntime["a" /* default */])().wrap(function _callee26$(_context26) {
          while (1) switch (_context26.prev = _context26.next) {
            case 0:
              _this24.areaListLoading = true;
              params = {
                modelId: _this24.currentSelectScene,
                name: _this24.areaName,
                skipCount: (_this24.page.pageNo - 1) * _this24.page.pageSize,
                maxResultCount: _this24.page.pageSize
              };
              _context26.next = 4;
              return areaApi.getList(params);
            case 4:
              _yield$areaApi$getLis = _context26.sent;
              _yield$areaApi$getLis2 = Object(slicedToArray["a" /* default */])(_yield$areaApi$getLis, 2);
              err = _yield$areaApi$getLis2[0];
              res = _yield$areaApi$getLis2[1];
              if (!err && res) {
                _this24.tableData = Object(external_["map"])(res.items, function (item) {
                  return Object(external_["assign"])(item, {
                    groupName: Object(external_["join"])(Object(external_["map"])(item.areaGroupList, 'name'), ',')
                  });
                });
                _this24.page.total = res.totalCount;
                _this24.$nextTick(function () {
                  _this24.$refs.areaFormRef && _this24.$refs.multipleTable.doLayout();
                });
              }
              _this24.areaListLoading = false;
            case 10:
            case "end":
              return _context26.stop();
          }
        }, _callee26);
      }))();
    },
    // 获取风险区域详情
    getAreaDetail: function getAreaDetail() {
      var _this25 = this;
      return Object(asyncToGenerator["a" /* default */])( /*#__PURE__*/Object(regeneratorRuntime["a" /* default */])().mark(function _callee27() {
        var _yield$areaApi$get, _yield$areaApi$get2, err, res;
        return Object(regeneratorRuntime["a" /* default */])().wrap(function _callee27$(_context27) {
          while (1) switch (_context27.prev = _context27.next) {
            case 0:
              _this25.detailLoading = true;
              _context27.next = 3;
              return areaApi.get(_this25.areaDetailId);
            case 3:
              _yield$areaApi$get = _context27.sent;
              _yield$areaApi$get2 = Object(slicedToArray["a" /* default */])(_yield$areaApi$get, 2);
              err = _yield$areaApi$get2[0];
              res = _yield$areaApi$get2[1];
              if (!err && res) {
                _this25.currentAreaParams = Object(external_["cloneDeep"])(res);
                if (res.isDrawed) {
                  // 如果绘制过了就画区域
                  res.points = JSON.parse(res.coordinate);
                } else {
                  res.points = _this25.$options.data().areaForm.points;
                  res.height = _this25.$options.data().areaForm.height;
                }
                if (res.height === null) {
                  res.height = undefined;
                }
                _this25.areaForm = Object(external_["cloneDeep"])(res);
                _this25.currentAreaColor = _this25.riskLevelColor[res.riskLevelId];
                // 初始化表格高亮
                if (!_this25.currentRowKey) {
                  _this25.currentRowKey = _this25.areaDetailId;
                }
              }
              _this25.detailLoading = false;
            case 9:
            case "end":
              return _context27.stop();
          }
        }, _callee27);
      }))();
    }
  }
});
// CONCATENATED MODULE: ./src/modules/risk-area-management/views/DrawArea.vue?vue&type=script&lang=js
 /* harmony default export */ var views_DrawAreavue_type_script_lang_js = (DrawAreavue_type_script_lang_js); 
// EXTERNAL MODULE: ./src/modules/risk-area-management/views/DrawArea.vue?vue&type=style&index=0&id=3dbc1eaa&prod&lang=scss&scoped=true
var DrawAreavue_type_style_index_0_id_3dbc1eaa_prod_lang_scss_scoped_true = __webpack_require__("45e3");

// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
var componentNormalizer = __webpack_require__("2877");

// CONCATENATED MODULE: ./src/modules/risk-area-management/views/DrawArea.vue






/* normalize component */

var component = Object(componentNormalizer["a" /* default */])(
  views_DrawAreavue_type_script_lang_js,
  render,
  staticRenderFns,
  false,
  null,
  "3dbc1eaa",
  null
  
)

/* harmony default export */ var DrawArea = __webpack_exports__["default"] = (component.exports);

/***/ }),

/***/ "ec36":
/***/ (function(module, exports, __webpack_require__) {

// style-loader: Adds some css to the DOM by adding a <style> tag

// load the styles
var content = __webpack_require__("4036");
if(content.__esModule) content = content.default;
if(typeof content === 'string') content = [[module.i, content, '']];
if(content.locals) module.exports = content.locals;
// add the styles to the DOM
var add = __webpack_require__("499e").default
var update = add("5ad8705a", content, true, {"sourceMap":false,"shadowMode":false});

/***/ })

}]);
//# sourceMappingURL=risk-area-management.umd.7.js.map