mirror of
https://github.com/hpd840321/starRiverProperty.git
synced 2026-06-10 00:40:30 +08:00
0c56a3e599
Made-with: Cursor Former-commit-id: 571c9a99ee26d90505e550c287eb8ad8d743ff8d
1 line
17 KiB
JavaScript
1 line
17 KiB
JavaScript
(window["webpackJsonp_cwos-general-device"]=window["webpackJsonp_cwos-general-device"]||[]).push([["chunk-eddab52e"],{"2a12":function(e,a,t){"use strict";t.r(a);var i=function(){var e=this,a=e.$createElement,t=e._self._c||a;return t("qz-wrap",{staticClass:"add-device",scopedSlots:e._u([{key:"footer",fn:function(){return[t("div",{staticClass:"footer"},[t("el-button",{attrs:{size:"medium"},on:{click:function(a){return e.$router.go(-1)}}},[e._v("取消")]),t("el-button",{attrs:{type:"primary",size:"medium",loading:e.submitLoading},on:{click:e.handleSubmitClick}},[e._v("确定")])],1)]},proxy:!0}])},[t("qz-form-wrap",{staticStyle:{width:"100%"}},[t("el-form",{ref:"addDeviceForm"},[t("device-basic-info",{ref:"deviceBasicInfoRef"}),t("el-form-item",{attrs:{label:"设备区域","label-width":"140px",required:""}},[t("device-area",{model:{value:e.addFormData.areaId,callback:function(a){e.$set(e.addFormData,"areaId",a)},expression:"addFormData.areaId"}})],1),t("el-form-item",{attrs:{label:"设备安装位置","label-width":"140px"}},[t("device-location",{ref:"deviceLocationRef"})],1)],1)],1)],1)},r=[],n=(t("a4d3"),t("4de4"),t("4160"),t("e439"),t("dbb4"),t("b64b"),t("d3b7"),t("ac1f"),t("25f0"),t("3ca3"),t("5319"),t("159b"),t("ddb0"),t("ade3")),c=t("d4ec"),s=t("bee2"),o=t("99de"),d=t("7e84"),l=t("262e"),p=t("9ab4"),m=t("60a3"),u=t("313f"),f=t("c051"),h=t("c70e");function v(e,a){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);a&&(i=i.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),t.push.apply(t,i)}return t}function A(e){for(var a=1;a<arguments.length;a++){var t=null!=arguments[a]?arguments[a]:{};a%2?v(Object(t),!0).forEach((function(a){Object(n["a"])(e,a,t[a])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):v(Object(t)).forEach((function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(t,a))}))}return e}var g=function(e){function a(){var e;return Object(c["a"])(this,a),e=Object(o["a"])(this,Object(d["a"])(a).apply(this,arguments)),e.addFormData={deviceName:"",deviceTypeId:"",typeIdTree:[],deviceCode:"",districtId:"",districtIds:[],identifyType:1,parentCode:"",cameraUserName:"",cameraPassword:"",cameraIp:"",cameraControlPort:"",cameraMainRtspUrl:"",areaName:"",mapInfo:[{}],areaId:"",beginChannel:"",channelCount:""},e.submitLoading=!1,e}return Object(l["a"])(a,e),Object(s["a"])(a,[{key:"created",value:function(){}},{key:"mounted",value:function(){}},{key:"handleSubmitClick",value:function(){var e=this;if(this.addFormData.areaId){var a=this.$refs.deviceBasicInfoRef._validateForm(),t=this.$refs.deviceLocationRef._validateForm();Promise.all([a,t]).then((function(){e.addFormData=Object.assign(e.addFormData,e.$refs.deviceBasicInfoRef.deviceBasicInfo,e.$refs.deviceLocationRef.deviceLocationInfo),e.submitAddDeviceForm()})).catch((function(a){e.$message.error(a.toString().replace("Error: ",""))}))}else this.$message.error("请选择设备区域")}},{key:"submitAddDeviceForm",value:function(){var e=this;this.submitLoading=!0;var a=Object.assign({},this.addFormData);this.service.addDeviceInfo(A({},a)).then((function(a){a.success?(e.$message.success("新增成功!"),e.$router.push({path:"/device/management"})):e.$message.error(a.message)})).finally((function(){e.submitLoading=!1}))}}]),a}(m["d"]);g=p["a"]([Object(m["a"])({components:{DeviceArea:u["a"],DeviceLocation:f["a"],DeviceBasicInfo:h["a"]}})],g);var I=g,b=I,y=(t("aadc"),t("2877")),k=Object(y["a"])(b,i,r,!1,null,"3dd53106",null);a["default"]=k.exports},4462:function(e,a){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAA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PAGz5fR0ebwKeBVw6IDXQg4NdLzcq4BjCx0C/AZ6D7lAyHqVvwAAAABJRU5ErkJggg=="},"5bf2":function(e,a,t){},"5f53":function(e,a){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAAABGdBTUEAALGPC/xhBQAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAAJKADAAQAAAABAAAAJAAAAAAJxsHGAAADV0lEQVRYCe1XS0hUURj+zmiOqYi0yIo2JQajQrZoH1FEuI3ATI0emwwqgoih6PZgjDYlVJsiEhIxItpIUJt2tcsgZxZmbSxzEyJpjuac/v8O49x7z2PujLrzwL3nnP/xfd899/z3Aaw3+woIu1vjdUZrsCgOIiPbyNsEKeup54PbFISYoj6JiBjGBvkOTvMf1xPyFF6QM7oFC7gOiZMkoiIUvhALEHiKCtwgYb/C5IQTFP9yERncIsDqMKCamFlEcA2Jlnsan89kF+TIcqRTjyAzZ3xZpU5E5DGisbNwxD8TRLnJ4drTqSckptsaU4yTLyyd4tt9wpQWMTkQT55eVTE5Ir5AxjY0/S2LJ7dSFY0DcqMhb4Vm8ZeqsAGJpskgkH6FMvLS2olhCXShLkdQDqgog80Zq8V8+ieZS62oIKJpPovK6DY4jTPeAHVTpxf3hxWzvbYcdw/XY9/OrPb332Zx+c0UJmaMReTlrkaW67XXqAoCDngDTGMW8/l8AzZV5SHaW+twaFcNdveNhxXFXD5Bmj0k95pEeO28Ml4xOR/b2BeuqVyqIInNYcByt0kXa/P54jVcqiAhQwnyAZc60XCpgmB+rHt5eQObms3nz1G5NIIw4U/Sz7iafs+p1cQ29oVsCpdO0IcwYFzaXE2DI9OYnFl0Dx4XUWFMo3Dla3ZZhXhFT9JTy1PLgEUdG/phiSjkYi5/U1coGntLz296j61xYw7mCjRVEH+riMjNQNzqT5lD812kCmLq1tgAveY+rr6KHCJhuxy5eb7XCzoqliikkw5zbecxih0xZieyHEquXhCH3Wn+St8s55SMlRoEelxsA45ZECckmp+RqF5DbvFmxupt6bclqt9DwWgpBeKpAfqcbQ+6ipqLyCASsQ76b5O2PPsKcSYDRGNd1A/ZgKw+zs1iWMW4dFYgr/OFLMOnZD/9JHZ4zQXHQgxgT1O3aRMH8wuvUC6DqyLa1EVL1pczFe4plnMMFaXLL7yHdFlXRrn67tMrpkznJtH82LhA1fRA7zdbSxPEePFkG2305/SvX+eDF5imJ/1x+sUZ9tlDTkoXxARXxxqwtPCS9lWryyfECMoqjuB2Y8nvwpUJYhXO90rMzz10BVVW9cDZMe+O109rtAL/AUvA7qP2DtrOAAAAAElFTkSuQmCC"},aadc:function(e,a,t){"use strict";var i=t("bffe"),r=t.n(i);r.a},bffe:function(e,a,t){},c051:function(e,a,t){"use strict";var i=function(){var e=this,a=e.$createElement,t=e._self._c||a;return t("div",{staticClass:"device-location-wrapper"},[t("el-button",{attrs:{icon:"el-icon-plus",size:"medium",disabled:e.isPreview},on:{click:e.addDeviceLocation}},[e._v("添加设备安装位置")]),e.deviceLocationList.length?t("div",{staticClass:"device-map-wrapper"},e._l(e.deviceLocationList,(function(a,i){return t("qz-form-wrap",{key:i,staticStyle:{width:"490px","margin-right":"24px",height:"100%"}},[t("single-location",{attrs:{data:a,isPreview:e.isPreview,mapIndex:i},on:{change:function(a){return e.singleLocationChange(a,i)},delete:function(a){return e.deleteSingleLocation(i)}}})],1)})),1):e._e()],1)},r=[],n=(t("99af"),t("4160"),t("c975"),t("a434"),t("d3b7"),t("ac1f"),t("5319"),t("1276"),t("159b"),t("d4ec")),c=t("bee2"),s=t("99de"),o=t("7e84"),d=t("262e"),l=t("9ab4"),p=t("60a3"),m=t("ca17"),u=t.n(m),f=function(){var e=this,a=e.$createElement,t=e._self._c||a;return t("div",{staticClass:"device-map-container"},[t("el-form",{ref:"areaLocationForm",staticClass:"map",attrs:{model:e.formData,disabled:e.isPreview}},[t("el-form-item",{attrs:{required:""}},[t("el-select",{staticClass:"width-320",attrs:{disabled:e.disableMapTypeChange,placeholder:"请选择地图"},on:{change:e.mapTypeChange},model:{value:e.currentMapType,callback:function(a){e.currentMapType=a},expression:"currentMapType"}},e._l(e.mapOptions,(function(e){return t("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1),"gis"===e.currentMapType?[t("el-form-item",{attrs:{prop:"districtIds"}},[t("mk-provincial-area",{staticClass:"width-320",attrs:{filterable:""},on:{change:e.provincialAreaChange},model:{value:e.formData.districtIds,callback:function(a){e.$set(e.formData,"districtIds",a)},expression:"formData.districtIds"}})],1),e.formData.districtId?t("el-form-item",[e.formData.districtId?t("div",{staticStyle:{width:"400px"}},[e._v(" "+e._s(e.fullLocation)+" ")]):e._e(),e.isPreview?e._e():t("el-input",{staticClass:"width-320",attrs:{maxlength:"128","suffix-icon":"el-icon-search",placeholder:"请输入详细地址进行定位"},on:{input:e.detailAddressInput},model:{value:e.deviceLocation,callback:function(a){e.deviceLocation="string"===typeof a?a.trim():a},expression:"deviceLocation"}})],1):e._e(),e.formData.districtId?t("el-form-item",[t("div",{staticClass:"map-container"},[t("qz-map",{ref:"fcMap",staticClass:"gisMapzj",attrs:{map:"gis",service:e.Server,mapKey:e.mapKey,mapInitinalOptions:e.mapInitinalOptions,locations:e.locations},on:{mapClick:e.mapClick}})],1)]):e._e()]:e._e(),"area"===e.currentMapType?[t("el-form-item",{attrs:{prop:"mapId"}},[t("el-select",{staticClass:"width-320",attrs:{placeholder:"请选择平面地图"},on:{change:e.areaMapIdChange},model:{value:e.formData.mapId,callback:function(a){e.$set(e.formData,"mapId",a)},expression:"formData.mapId"}},e._l(e.areaMapOptions,(function(e){return t("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1),t("div",{directives:[{name:"show",rawName:"v-show",value:0===this.areaMapOptions.length,expression:"this.areaMapOptions.length === 0"}]},[t("el-button",{attrs:{type:"text"},on:{click:e.addMapBtnClick}},[e._v("新增平面地图")])],1)],1),e.formData.mapId?t("el-form-item",[t("div",{staticClass:"map-container"},[t("qz-map",{staticStyle:{border:"1px solid #dcdfe6"},attrs:{data:e.picMapData,map:"pic",mode:"write",service:e.Server,servicePath:e.MAP.servicePath,mapInitinalOptions:e.MAP.mapInitinalOptions,fullscreenText:"全屏",exitFullscreenText:"退出全屏",showPlayer:!1,screenWidth:"320px",screenHeight:"300px",showAll:!1,markerImg:e.markerImg,addDefaultSelected:!0,mapImg:e.mapImg},on:{markerClick:e.markerClick}})],1)]):e._e()]:e._e()],2),t("div",{staticClass:"close-btn"},[t("img",{attrs:{src:e.closeImgUrl},on:{click:e.deleteItem}})])],1)},h=[],v=t("f5ea"),A=t("103b"),g=function(e){function a(){var e;return Object(n["a"])(this,a),e=Object(s["a"])(this,Object(o["a"])(a).apply(this,arguments)),e.Server=A["a"],e.formData={mapId:"",districtId:"",districtIds:[],mapX:"",mapY:""},e.mapOptions=[{value:"gis",label:"GIS地图"},{value:"area",label:"平面地图"}],e.currentMapType="",e.disableMapTypeChange=!1,e.deviceLocation="",e.lonLat="",e.provincialArea="",e.areaMapOptions=[],e.locations=[],e.mapKey="8b30b8569cad2576f4204131d4e1c8d6",e.mapInitinalOptions={zoom:17},e.MAP={data:[],mapInitinalOptions:{center:[0,0],zoom:3,lang:"",mapStyle:""}},e.picMapData=[],e.markerImg=t("5f53"),e.mapImg="",e.closeImgUrl=t("4462"),e}return Object(d["a"])(a,e),Object(c["a"])(a,[{key:"districtIds_listener",value:function(e){e&&e.length>0?this.formData.districtId=e[e.length-1]:this.formData.districtId=""}},{key:"mapX_listener",value:function(e){this.submitFormData()}},{key:"created",value:function(){this.getMapTypeTree()}},{key:"mounted",value:function(){this.data&&this.data.mapId&&this.initFormData()}},{key:"deleteItem",value:function(){this.isPreview||this.$emit("delete")}},{key:"mapTypeChange",value:function(e){this.formData={mapId:"",districtId:"",districtIds:[],mapX:"",mapY:""},"gis"===e&&(this.formData.mapId="gis")}},{key:"provincialAreaChange",value:function(e){var a=e[2],t=a.lng,i=a.lat;0!==e.length&&t&&i&&(this.provincialArea=e[0].districtName+e[1].districtName+e[2].districtName,this.setMapMarker(t,i))}},{key:"detailAddressInput",value:function(e){var a=this;e=this.provincialArea+e,this.$refs.fcMap.getLocationByAddress(e).then((function(t){var i=t[0],r=i.lon,n=i.lat;e&&r&&n&&(a.provincialArea=t[0].address,a.setMapMarker(r,n))})).catch((function(e){a.$message.error(e)}))}},{key:"areaMapIdChange",value:function(e){this.areaMapOptions.length&&this.setPicMapImg()}},{key:"addMapBtnClick",value:function(){var e=window.__POWERED_BY_QIANKUN__;e?window.history.pushState({},"","/sub-sysetting-front#/regionMap/list"):(window.history.pushState({},"","/sysetting-front#/regionMap/list"),location.reload())}},{key:"mapClick",value:function(e){this.isPreview||(this.provincialArea=e.formattedAddress,this.setMapMarker(e.lnglatXY[0],e.lnglatXY[1]))}},{key:"markerClick",value:function(e){this.isPreview||(this.formData.mapX=e.x,this.formData.mapY=e.y,this.lonLat="".concat(e.x,",").concat(e.y))}},{key:"getMapTypeTree",value:function(){var e=this;this.service.getMapTypeTree({}).then((function(a){a.success?((a.data||[]).forEach((function(a){e.areaMapOptions.push({label:a.mapName,value:a.id,ext2:a.ext2,mapImg:a.mapImg})})),e.formData.mapId&&e.setPicMapImg()):e.$message.error(a.message)}))}},{key:"initFormData",value:function(){var e=this.data;if(this.formData=Object.assign({},e),e.mapId)if("gis"===e.mapId){if(this.currentMapType="gis",e.mapX){var a=e.mapX,t=void 0===a?"":a,i=e.mapY,r=void 0===i?"":i;this.setMapMarker(t,r),this.lonLat="".concat(t,",").concat(r),this.mapInitinalOptions.center=[t,r],this.provincialArea=e.provincialArea||""}}else this.currentMapType="area",this.picMapData[0]={x:e.mapX,y:e.mapY,marker_width:30,marker_height:30,id:"marker-".concat(this.mapIndex)},this.areaMapOptions.length&&this.setPicMapImg()}},{key:"setMapMarker",value:function(e,a){var t=this;this.lonLat="".concat(e,",").concat(a).replace(/^,$/,"");var i={objectType:"location",objectId:"loca-".concat(this.mapIndex),lon:e,lat:a,msg:{a:1},anchor:"bottom"};this.locations.push(i),this.formData.mapX=e,this.formData.mapY=a,this.$nextTick((function(){t.$refs.fcMap&&t.$refs.fcMap.setFitView()}))}},{key:"setPicMapImg",value:function(){var e=this;this.areaMapOptions.length&&this.areaMapOptions.forEach((function(a){a.value===e.formData.mapId&&(e.mapImg=a.mapImg)}))}},{key:"submitFormData",value:function(){this.$emit("change",this.formData)}},{key:"fullLocation",get:function(){return"".concat(this.provincialArea,"-").concat(this.lonLat).replace(/^-/,"")}}]),a}(p["d"]);l["a"]([Object(p["c"])({})],g.prototype,"data",void 0),l["a"]([Object(p["c"])({default:-1})],g.prototype,"mapIndex",void 0),l["a"]([Object(p["c"])({default:!1})],g.prototype,"isPreview",void 0),l["a"]([Object(p["e"])("formData.districtIds",{immediate:!0,deep:!0})],g.prototype,"districtIds_listener",null),l["a"]([Object(p["e"])("formData.mapX",{immediate:!0,deep:!0})],g.prototype,"mapX_listener",null),g=l["a"]([Object(p["a"])({components:{QzMap:v["a"],Treeselect:u.a}})],g);var I=g,b=I,y=(t("e79a"),t("2877")),k=Object(y["a"])(b,f,h,!1,null,"15710e42",null),w=k.exports,D=(t("5f53"),function(e){function a(){var e;return Object(n["a"])(this,a),e=Object(s["a"])(this,Object(o["a"])(a).apply(this,arguments)),e.deviceLocationList=[],e.deviceLocationInfo=[],e}return Object(d["a"])(a,e),Object(c["a"])(a,[{key:"created",value:function(){}},{key:"mounted",value:function(){this.data?this.initFormData():this.queryDefaultMap()}},{key:"addDeviceLocation",value:function(){2!==this.deviceLocationList.length?this.deviceLocationList.push({}):this.$message.error("最多只能添加2个地图")}},{key:"singleLocationChange",value:function(e,a){this.deviceLocationList.splice(a,1,e)}},{key:"deleteSingleLocation",value:function(e){var a=this,t=this.deviceLocationList.concat();t.splice(e,1),this.deviceLocationList=[],this.$nextTick((function(){a.deviceLocationList=t.concat()}))}},{key:"queryDefaultMap",value:function(){var e=this;this.service.queryMap().then((function(a){var t=a.data[0].modeType;"area"===t?e.service.getMapTypeTree({}).then((function(a){a.success?(a.data||[]).forEach((function(a){if("default"===a.ext2){var t={mapId:a.id,mapImg:a.mapImg};e.deviceLocationList.push(t)}})):e.$message.error(a.message)})):e.deviceLocationList.push({mapId:"gis"})})).catch((function(a){e.$message.error(a)}))}},{key:"initFormData",value:function(){var e=this;this.data.mapInfo&&this.data.mapInfo.forEach((function(a){var t={mapId:a.mapId,mapX:a.mapX,mapY:a.mapY};if("gis"===a.mapId)if(t.districtId=a.districtId,e.data.districtPath&&e.data.districtPath.indexOf("|")>0){var i=e.data.districtPath.split("|");i.shift(),t.districtIds=i,t.provincialArea=e.data.districtMergeName&&e.data.districtMergeName.replace(/,/g,"")}else t.districtIds=[];e.deviceLocationList.push(t)}))}},{key:"_validateForm",value:function(){var e=this;return new Promise((function(a,t){var i=0,r=0;e.deviceLocationList.forEach((function(e){e.mapId||t(new Error("请检查设备安装位置是否填写完整")),"gis"===e.mapId?(i++,i>=2&&t(new Error("最多只能添加1个GIS地图")),e.districtId||t(new Error("请检查设备安装位置是否填写完整"))):(r++,r>=2&&t(new Error("最多只能添加1个平面地图")),e.mapX||t(new Error("请在平面地图选择标点位置")))})),e.formatFormData(),a()}))}},{key:"formatFormData",value:function(){var e={mapInfo:[]};this.deviceLocationList.forEach((function(a){"gis"===a.mapId&&(e.districtId=a.districtId,e.districtIds=a.districtIds),e.mapInfo.push({mapId:a.mapId,mapX:a.mapX,mapY:a.mapY})})),this.deviceLocationInfo=Object.assign({},e)}}]),a}(p["d"]));l["a"]([Object(p["c"])({})],D.prototype,"data",void 0),l["a"]([Object(p["c"])({})],D.prototype,"isPreview",void 0),D=l["a"]([Object(p["a"])({components:{Treeselect:u.a,SingleLocation:w}})],D);var O=D,C=O,L=(t("c687"),Object(y["a"])(C,i,r,!1,null,"20e793ce",null));a["a"]=L.exports},c687:function(e,a,t){"use strict";var i=t("f34e"),r=t.n(i);r.a},e79a:function(e,a,t){"use strict";var i=t("5bf2"),r=t.n(i);r.a},f34e:function(e,a,t){}}]); |