mirror of
https://github.com/hpd840321/starRiverProperty.git
synced 2026-06-10 17:00:30 +08:00
0c56a3e599
Made-with: Cursor Former-commit-id: 571c9a99ee26d90505e550c287eb8ad8d743ff8d
1 line
33 KiB
JavaScript
1 line
33 KiB
JavaScript
(window["webpackJsonp_heat-analysis-portal"]=window["webpackJsonp_heat-analysis-portal"]||[]).push([["chunk-95ed7628"],{1:function(e,t){},2:function(e,t){},"21fb":function(e,t,r){e.exports={elInputWidth:"200px",elInputNumberWidth:"200px",elTextareaWidth:"300px",elSelectWidth:"200px",appHeaderBg:"#014051",appIconBg:"#31b89a",appIconColor:"#fff",appIconSize:"30px",appNameColor:"#fff",appNameSize:"30px"}},3:function(e,t){},"313b":function(e,t,r){"use strict";r("d3b7"),r("96cf");var a=r("1da1"),i=r("d4ec"),n=r("bee2"),s=r("99de"),o=r("7e84"),c=r("262e"),l=r("9ab4"),u=r("60a3"),p=r("9dba"),d=r("6fc5"),h=function(e){function t(){var e;return Object(i["a"])(this,t),e=Object(s["a"])(this,Object(o["a"])(t).apply(this,arguments)),e.orgTreeData=[],e.orgId="",e}return Object(c["a"])(t,e),Object(n["a"])(t,[{key:"fetchOrganizationTree",value:function(){var e=Object(a["a"])(regeneratorRuntime.mark((function e(){var t,r,a,i,n;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(e.prev=0,t=[],!this.userInfo.orgId){e.next=7;break}return e.next=5,this.service.organizationDetail(this.userInfo.orgId);case 5:r=e.sent,r&&r.data&&t.push(r.data);case 7:return a={parentId:this.userInfo.orgId,businessId:this.userInfo.businessId},e.next=10,this.service.organizationTree(a);case 10:return i=e.sent,n=i.data,n&&n.length>0&&(t&&t.length>0?(t[0].children=[],t[0].children=n):t=n),t&&t.length>0&&(this.orgId=t[0].id),this.orgTreeData=t,e.abrupt("return",Promise.resolve());case 18:return e.prev=18,e.t0=e["catch"](0),e.abrupt("return",Promise.resolve());case 21:case"end":return e.stop()}}),e,this,[[0,18]])})));function t(){return e.apply(this,arguments)}return t}()},{key:"userInfo",get:function(){return Object(d["e"])(p["a"],this.$store).userInfo}}]),t}(u["e"]);h=l["a"]([Object(u["a"])({name:"OrgTreeMixins",components:{}})],h),t["a"]=h},8930:function(e,t,r){"use strict";r.r(t);var a=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"app-main setting-wrp flex"},[r("div",{staticClass:"lf-wrapper"},[r("el-input",{attrs:{placeholder:"搜索","prefix-icon":"el-icon-search",maxlength:32},model:{value:e.keyword,callback:function(t){e.keyword=t},expression:"keyword"}}),r("el-tree",{ref:"orgTreeRef",staticClass:"tree",attrs:{data:e.orgTreeData,props:e.treeProps,"node-key":"id","default-expand-all":!0,"expand-on-click-node":!1,"highlight-current":!0,"filter-node-method":e.filterNode},on:{"node-click":e.handleNodeClick},scopedSlots:e._u([{key:"default",fn:function(t){var a=t.node;return[a.label&&a.label.length>12?r("el-tooltip",{staticClass:"item",attrs:{effect:"dark","open-delay":500,content:a.label,placement:"right"}},[r("span",{staticClass:"el-tree-node__label"},[e._v(e._s(a.label))])]):r("span",{staticClass:"el-tree-node__label"},[e._v(e._s(a.label))])]}}])})],1),r("div",{staticClass:"rt-wrapper"},[r("h3",{staticClass:"title"},[e._v(e._s(e.orgDetail.name))]),r("el-divider"),r("div",{staticClass:"base-info sub-head"},[e._m(0),r("div",{staticClass:"panel-main"},[r("el-row",{attrs:{gutter:32}},[r("el-col",{attrs:{span:8}},[r("label",{staticClass:"label"},[e._v("机构名称:")]),e._v(" "+e._s(e.orgDetail.name||"-")+" ")]),r("el-col",{attrs:{span:8}},[r("label",{staticClass:"label"},[e._v("机构类型:")]),e._v(" "+e._s(e.orgDetail.type||"-")+" ")])],1)],1)]),[r("relative-device",{attrs:{orgId:e.orgId},on:{refreshROIList:e.onRefreshROIList}}),r("map-setting",{ref:"mapSettingRef",attrs:{orgId:e.orgId}})]],2)])},i=[function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"sub-head"},[r("span",{staticClass:"sub-title"},[e._v("基本信息")])])}],n=(r("4de4"),r("c740"),r("c975"),r("b0c0"),r("96cf"),r("1da1")),s=r("d4ec"),o=r("bee2"),c=r("99de"),l=r("7e84"),u=r("262e"),p=r("9ab4"),d=r("60a3"),h=r("313b"),v=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"panel"},[e._m(0),r("el-button",{staticStyle:{margin:"4px 0 16px"},attrs:{type:"primary"},on:{click:e.onAddDevice}},[e._v("添加设备")]),r("el-table",{attrs:{data:e.deviceList,height:"300px"}},[r("el-table-column",{attrs:{label:"编号",prop:"deviceCode"}}),r("el-table-column",{attrs:{label:"名称",prop:"deviceName"}}),r("el-table-column",{attrs:{label:"类型",prop:"deviceTypeCode"}}),r("el-table-column",{attrs:{label:"区位",prop:"areaName"}}),r("el-table-column",{attrs:{label:"状态"},scopedSlots:e._u([{key:"default",fn:function(t){return[r("span",[e._v(" "+e._s(2===t.row.onlineStatus?"在线":3===t.row.onlineStatus?"离线":""))])]}}])}),r("el-table-column",{attrs:{label:"最近在线时间"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(" "+e._s(e._f("dateFormatter")(t.row.lastHeartbeatTime))+" ")]}}])}),r("el-table-column",{attrs:{label:"操作",width:"180px",fixed:"right"},scopedSlots:e._u([{key:"default",fn:function(t){return[r("el-button",{attrs:{type:"text"},on:{click:function(r){return e.onRemoveDevice(t.row)}}},[e._v("移除设备")]),r("el-button",{attrs:{type:"text"},on:{click:function(r){return e.onOpenROI(t.row)}}},[e._v("视觉围栏设置")])]}}])})],1),r("pager",{attrs:{pager:e.pager,align:"right"},on:{pagerChange:e.onPagerChange}}),r("device-dialog",{ref:"deviceDialog",on:{onRresh:e.fetchRelativeDeviceList}}),r("el-dialog",{attrs:{title:"设置ROI",visible:e.showROI,"before-close":e.onBeforeCloseDialog,width:"900px"},on:{"update:visible":function(t){e.showROI=t}}},[e.showROI?r("RoiLayout",{ref:"roiLayout",attrs:{deviceCode:e.roiConfig.deviceCode,width:e.roiConfig.width,deviceName:e.roiConfig.deviceName,customizeAreaName:!0,id:"deviceROICanvas"},on:{remove:e.onROIRemove,confirm:e.onROIConfirm},model:{value:e.roiData,callback:function(t){e.roiData=t},expression:"roiData"}}):e._e()],1)],1)},f=[function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"sub-head"},[r("span",{staticClass:"sub-title"},[e._v("关联设备")])])}],g=(r("a4d3"),r("7db0"),r("4160"),r("caad"),r("d81d"),r("e439"),r("dbb4"),r("b64b"),r("2532"),r("159b"),r("ade3")),m=r("2de2"),b=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("el-dialog",{attrs:{title:"添加设备",visible:e.show,width:"800px"},on:{"update:visible":function(t){e.show=t}}},[r("el-form",{attrs:{inline:!0}},[r("el-form-item",[r("el-input",{attrs:{placeholder:"请输入设备名称",maxlength:32},model:{value:e.deviceForm.deviceName,callback:function(t){e.$set(e.deviceForm,"deviceName",t)},expression:"deviceForm.deviceName"}})],1),r("el-form-item",[r("el-input",{attrs:{placeholder:"请输入设备编号",maxlength:32},model:{value:e.deviceForm.deviceCode,callback:function(t){e.$set(e.deviceForm,"deviceCode",t)},expression:"deviceForm.deviceCode"}})],1),r("el-form-item",[r("el-cascader",{attrs:{placeholder:"请选择设备类型",maxlength:32,options:e.deviceTypeOptions,props:{value:"id",label:"name"},filterable:"",clearable:""},model:{value:e.deviceForm.deviceTypeId,callback:function(t){e.$set(e.deviceForm,"deviceTypeId",t)},expression:"deviceForm.deviceTypeId"}})],1),r("el-form-item",[r("el-button",{attrs:{type:"primary"},on:{click:e.onSearchDevice}},[e._v("查询")])],1)],1),r("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],attrs:{data:e.deviceList,height:"400px"},on:{"selection-change":e.onSelectionChange}},[r("el-table-column",{attrs:{type:"selection",width:"55"}}),r("el-table-column",{attrs:{label:"编号",prop:"deviceCode"}}),r("el-table-column",{attrs:{label:"名称",prop:"deviceName"}}),r("el-table-column",{attrs:{label:"类型",prop:"deviceTypeName"}}),r("el-table-column",{attrs:{label:"区位",prop:"areaAddr"}}),r("el-table-column",{attrs:{label:"状态"},scopedSlots:e._u([{key:"default",fn:function(t){return[r("span",[e._v(e._s(2===t.row.onlineStatus?"在线":3===t.row.onlineStatus?"离线":""))])]}}])})],1),r("pager",{attrs:{pager:e.pager,align:"center"},on:{pagerChange:e.onPagerChange}}),r("div",{attrs:{slot:"footer"},slot:"footer"},[r("el-button",{on:{click:function(t){e.show=!1}}},[e._v("取消")]),r("el-button",{attrs:{type:"primary"},on:{click:e.onConfirm}},[e._v("确定")])],1)],1)},O=[],I=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("el-pagination",{staticClass:"pager",attrs:{"hide-on-single-page":"","current-page":e.pageObj.currentPage,"page-sizes":[10,20,50,100],"page-size":e.pageObj.rowsOfPage,layout:"total, sizes, prev, pager, next, jumper",total:e.pageObj.total},on:{"size-change":e.onSizeChange,"current-change":e.onCurrPageChange}})},y=[],x=function(e){function t(){var e;return Object(s["a"])(this,t),e=Object(c["a"])(this,Object(l["a"])(t).apply(this,arguments)),e.pageObj={rowsOfPage:10,currentPage:1,total:0},e}return Object(u["a"])(t,e),Object(o["a"])(t,[{key:"pagerChange",value:function(e){var t=this;this.$nextTick((function(){t.pageObj=e}))}},{key:"onSizeChange",value:function(e){this.pager.rowsOfPage=e,this.$emit("pagerChange",this.pager)}},{key:"onCurrPageChange",value:function(e){this.pager.currentPage=e,this.$emit("pagerChange",this.pager)}}]),t}(d["e"]);p["a"]([Object(d["c"])({type:Object,default:{currentPage:1,rowsOfPage:10,total:0}})],x.prototype,"pager",void 0),p["a"]([Object(d["f"])("pager",{immediate:!0,deep:!0})],x.prototype,"pagerChange",null),x=p["a"]([Object(d["a"])({name:"Pager",components:{}})],x);var w=x,R=w,k=(r("8cd4"),r("2877")),C=Object(k["a"])(R,I,y,!1,null,null,null),j=C.exports;function D(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}function _(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?D(Object(r),!0).forEach((function(t){Object(g["a"])(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):D(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var P=function(e){function t(){var e;return Object(s["a"])(this,t),e=Object(c["a"])(this,Object(l["a"])(t).apply(this,arguments)),e.deviceList=[],e.deviceForm={deviceName:"",deviceCode:"",deviceTypeId:[],status:0},e.deviceTypeOptions=[],e.show=!1,e.selectDeviceIds=[],e.orgId="",e.pager={currentPage:1,rowsOfPage:10,total:0},e.loading=!1,e}return Object(u["a"])(t,e),Object(o["a"])(t,[{key:"created",value:function(){this.fetchDeviceTypes()}},{key:"showDialog",value:function(e){var t=this;this.deviceForm={deviceName:"",deviceCode:"",deviceTypeId:[],status:0},this.orgId=e,this.fetchNotRelativeDeviceList(),setTimeout((function(){t.show=!0}),500)}},{key:"fetchNotRelativeDeviceList",value:function(){var e=Object(n["a"])(regeneratorRuntime.mark((function e(){var t,r,a;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,this.loading=!0,t=this.deviceForm.deviceTypeId,t&&(this.deviceForm.deviceTypeId=t[t.length-1]),e.next=6,this.service.notRelatedDevices(_({serviceCode:m["a"]},this.deviceForm,{},this.pager));case 6:r=e.sent,a=r.data,this.deviceList=a.datas,this.pager.total=a.totalRows,this.loading=!1,e.next=16;break;case 13:e.prev=13,e.t0=e["catch"](0),this.loading=!1;case 16:case"end":return e.stop()}}),e,this,[[0,13]])})));function t(){return e.apply(this,arguments)}return t}()},{key:"onPagerChange",value:function(e){this.pager=e,this.fetchNotRelativeDeviceList()}},{key:"fetchDeviceTypes",value:function(){var e=Object(n["a"])(regeneratorRuntime.mark((function e(){var t,r;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.service.deviceTypes();case 3:t=e.sent,r=t.data,this.deviceTypeOptions=r,e.next=10;break;case 8:e.prev=8,e.t0=e["catch"](0);case 10:case"end":return e.stop()}}),e,this,[[0,8]])})));function t(){return e.apply(this,arguments)}return t}()},{key:"onSearchDevice",value:function(){this.pager.rowsOfPage=10,this.pager.currentPage=1,this.fetchNotRelativeDeviceList()}},{key:"onSelectionChange",value:function(e){e&&e.length>0?this.selectDeviceIds=e.map((function(e){return e.id})):this.selectDeviceIds=[]}},{key:"onConfirm",value:function(){var e=Object(n["a"])(regeneratorRuntime.mark((function e(){var t,r=this;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(0!==this.selectDeviceIds.length){e.next=3;break}return this.$message.error("请选择设备"),e.abrupt("return");case 3:return t=this.selectDeviceIds.map((function(e){return{deviceId:e,orgId:r.orgId,serviceCode:m["a"]}})),e.prev=4,e.next=7,this.service.batchAddDevice({params:t});case 7:this.$message.success("添加成功"),this.show=!1,this.$emit("onRresh"),e.next=14;break;case 12:e.prev=12,e.t0=e["catch"](4);case 14:case"end":return e.stop()}}),e,this,[[4,12]])})));function t(){return e.apply(this,arguments)}return t}()}]),t}(d["e"]);P=p["a"]([Object(d["a"])({name:"DeviceDialog",components:{Pager:j}})],P);var S=P,N=S,$=Object(k["a"])(N,b,O,!1,null,null,null),F=$.exports,T=r("1508");function L(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}function B(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?L(Object(r),!0).forEach((function(t){Object(g["a"])(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):L(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var A=function(e){function t(){var e;return Object(s["a"])(this,t),e=Object(c["a"])(this,Object(l["a"])(t).apply(this,arguments)),e.deviceList=[],e.roiConfig={deviceId:"",width:800,deviceName:"",deviceCode:""},e.showROI=!1,e.roiData=[],e.tempRoiData=[],e.pager={currentPage:1,rowsOfPage:10,total:0},e.tempOrgId="",e.deletedROIIds=[],e}return Object(u["a"])(t,e),Object(o["a"])(t,[{key:"orgIdChange",value:function(e){this.tempOrgId=e,e&&this.fetchRelativeDeviceList()}},{key:"fetchRelativeDeviceList",value:function(){var e=Object(n["a"])(regeneratorRuntime.mark((function e(){var t,r;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.service.relatedDevices(B({orgId:this.tempOrgId,serviceCode:m["a"]},this.pager));case 3:t=e.sent,r=t.data,this.deviceList=r.datas,this.pager.total=r.totalRows,e.next=11;break;case 9:e.prev=9,e.t0=e["catch"](0);case 11:case"end":return e.stop()}}),e,this,[[0,9]])})));function t(){return e.apply(this,arguments)}return t}()},{key:"onPagerChange",value:function(e){this.pager=e,this.fetchRelativeDeviceList()}},{key:"onRemoveDevice",value:function(e){var t=this;this.$confirm("确定删除设备?").then(Object(n["a"])(regeneratorRuntime.mark((function r(){var a;return regeneratorRuntime.wrap((function(r){while(1)switch(r.prev=r.next){case 0:return r.prev=0,a={deviceId:e.id,deviceCode:e.deviceCode,orgId:t.tempOrgId},r.next=4,t.service.deleteROI(a);case 4:t.fetchRelativeDeviceList(),t.$emit("refreshROIList"),t.$message.success("删除成功"),r.next=11;break;case 9:r.prev=9,r.t0=r["catch"](0);case 11:case"end":return r.stop()}}),r,null,[[0,9]])}))))}},{key:"onAddDevice",value:function(){this.$refs.deviceDialog.showDialog(this.tempOrgId)}},{key:"onBeforeCloseDialog",value:function(){this.roiConfig.deviceId="",this.roiConfig.deviceCode="",this.showROI=!1}},{key:"onOpenROI",value:function(){var e=Object(n["a"])(regeneratorRuntime.mark((function e(t){var r,a;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,this.roiConfig.deviceId=t.id,this.roiConfig.deviceCode=t.deviceCode,this.roiConfig.deviceName=t.deviceName,e.next=6,this.service.queryROI({deviceId:t.deviceCode});case 6:r=e.sent,a=r.data,[],a&&a.length>0?this.roiData=a.map((function(e){return{custom:{id:e.id},roiId:e.roiId,name:e.roiName,points:JSON.parse(e.roiPointInfoWeb)}})):this.roiData=[],this.tempRoiData=this.roiData,this.showROI=!0,this.$refs.roiLayout&&this.$refs.roiLayout.refresh(),e.next=17;break;case 15:e.prev=15,e.t0=e["catch"](0);case 17:case"end":return e.stop()}}),e,this,[[0,15]])})));function t(t){return e.apply(this,arguments)}return t}()},{key:"onROIRemove",value:function(){var e=Object(n["a"])(regeneratorRuntime.mark((function e(t){var r;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(e.prev=0,r=this.tempRoiData.find((function(e){return e.name===t.name})),r&&(t=r),t.custom.id){e.next=6;break}return this.$emit("refreshROIList"),e.abrupt("return");case 6:return e.next=8,this.service.deleteROI({roiIds:[t.custom.id],orgId:this.tempOrgId});case 8:this.deletedROIIds.push(t.custom.id),this.$emit("refreshROIList"),this.$message.success("删除成功"),e.next=15;break;case 13:e.prev=13,e.t0=e["catch"](0);case 15:case"end":return e.stop()}}),e,this,[[0,13]])})));function t(t){return e.apply(this,arguments)}return t}()},{key:"onROIConfirm",value:function(){var e=Object(n["a"])(regeneratorRuntime.mark((function e(t){var r,a,i=this;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,r=this.$refs.roiLayout.getImage(),a=[],t.length>0&&(a=t.map((function(e){return i.transROIParam(e,r.width,r.height)}))),a=a.filter((function(e){return!i.deletedROIIds.includes(e.roiId)})),e.next=7,this.service.batchAddROI({roiData:a});case 7:this.$message.success("保存成功"),this.showROI=!1,this.$emit("refreshROIList"),e.next=14;break;case 12:e.prev=12,e.t0=e["catch"](0);case 14:case"end":return e.stop()}}),e,this,[[0,12]])})));function t(t){return e.apply(this,arguments)}return t}()},{key:"transROIParam",value:function(e,t,r){return{orgId:this.tempOrgId,deviceId:this.roiConfig.deviceCode,roiId:e.custom.id||null,roiWidth:t,roiHeight:r,roiName:e.name,roiPointInfoWeb:JSON.stringify(e.points),roiHeightWeb:r,roiWidthWeb:t,count:e.points.length}}}]),t}(d["e"]);p["a"]([Object(d["c"])({default:"",type:String})],A.prototype,"orgId",void 0),p["a"]([Object(d["f"])("orgId",{immediate:!0})],A.prototype,"orgIdChange",null),A=p["a"]([Object(d["a"])({name:"",components:{Pager:j,DeviceDialog:F,RoiLayout:T["a"]}})],A);var W=A,z=W,U=Object(k["a"])(z,v,f,!1,null,null,null),E=U.exports,V=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticClass:"panel map-setting"},[r("div",{staticClass:"sub-head flex-middle"},[r("span",{staticClass:"sub-title"},[e._v("地图管理")]),r("el-upload",{ref:"updateUpload",staticClass:"upload-btn",attrs:{action:"image/*",accept:"","before-upload":e.onBeforeUpload,"http-request":e.onUploadImage,"show-file-list":!1,limit:1}},[r("el-button",{attrs:{type:"primary"}},[e._v(e._s(e.orgBg.src?"更新地图":"上传地图"))])],1)],1),r("div",{ref:"mapRef"},[r("empty-map",{directives:[{name:"show",rawName:"v-show",value:!e.orgBg.src,expression:"!orgBg.src"}],on:{onUploadImage:e.onUploadImage}}),r("RoiLayout",{directives:[{name:"show",rawName:"v-show",value:e.orgBg.src,expression:"orgBg.src"}],ref:"areaROIRef",attrs:{width:e.roiConfig.width,deviceName:e.roiConfig.deviceName,image:e.orgBg.src,deviceCode:e.roiConfig.deviceCode,customizeAreaName:!0,limit:100,roiName:"业务区域",id:"areaROICanvas"},on:{select:e.onROISelect,remove:e.onROIRemove,confirm:e.onROIConfirm},model:{value:e.areaData,callback:function(t){e.areaData=t},expression:"areaData"}},[r("div",{staticClass:"flex-1",attrs:{slot:"button"},slot:"button"},[r("span",{staticStyle:{"padding-right":"16px"}},[e._v("区域地图")])]),r("div",{attrs:{slot:"bottom"},slot:"bottom"},[r("span",[e._v("视觉围栏")]),r("el-select",{staticStyle:{margin:"0 12px"},attrs:{placeholder:"选择视觉围栏区域",filterable:"",clearable:""},model:{value:e.areaForm.roiId,callback:function(t){e.$set(e.areaForm,"roiId",t)},expression:"areaForm.roiId"}},e._l(e.roiList,(function(e){return r("el-option",{key:e.roiId,attrs:{label:e.roiName,value:e.roiId}})})),1)],1)])],1),r("el-dialog",{attrs:{title:"业务区域设置教学视频",visible:e.showVideoDialog,width:"840px"},on:{"update:visible":function(t){e.showVideoDialog=t}}},[r("CWVideoPlayer")],1)],1)},J=[],H=(r("99af"),r("d3b7"),function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"flex map-wrapper"},[r("div",{staticClass:"map-lf"},[e._m(0),r("el-divider"),r("div",{staticClass:"map-box flex-middle"},[r("div",{staticClass:"empty"},[r("div",{staticClass:"empty-text"},[e._v("您还没有上传区域地图哦~")]),r("el-upload",{ref:"addUpload",staticClass:"upload-btn",attrs:{action:"image/*",accept:"","http-request":e.onUpload,"show-file-list":!1,limit:1}},[r("el-button",{attrs:{type:"primary"}},[e._v("点击上传")]),r("div",{staticClass:"el-upload__tip",attrs:{slot:"tip"},slot:"tip"},[e._v("图片大小不要超过500kb")])],1)],1)])],1),r("div",{staticClass:"map-rt"},[r("div",{staticClass:"map-head"},[e._v("已配置业务区域列表")]),r("el-divider"),e._m(1)],1)])}),M=[function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"map-head flex-between-middle"},[r("span",[e._v("区域地图")])])},function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"flex-middle tip-wrp"},[r("span",{staticClass:"tip"},[e._v("请先在左侧上传地图,"),r("br"),e._v("然后设置业务区域哦~")])])}],q=function(e){function t(){return Object(s["a"])(this,t),Object(c["a"])(this,Object(l["a"])(t).apply(this,arguments))}return Object(u["a"])(t,e),Object(o["a"])(t,[{key:"onUpload",value:function(e){this.$emit("onUploadImage",e)}}]),t}(d["e"]);q=p["a"]([Object(d["a"])({name:"EmptyMap",components:{}})],q);var K=q,G=K,Q=Object(k["a"])(G,H,M,!1,null,null,null),X=Q.exports,Y=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",[r("video",{attrs:{src:e.videoSrc,controls:"controls",width:"800px",height:"450px"}})])},Z=[],ee=function(e){function t(){var e;return Object(s["a"])(this,t),e=Object(c["a"])(this,Object(l["a"])(t).apply(this,arguments)),e.videoSrc="",e}return Object(u["a"])(t,e),Object(o["a"])(t,[{key:"created",value:function(){this.fetchVideoUrl()}},{key:"fetchVideoUrl",value:function(){var e=Object(n["a"])(regeneratorRuntime.mark((function e(){var t,r;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.service.videoUrl();case 3:t=e.sent,r=t.data,this.videoSrc=r,e.next=10;break;case 8:e.prev=8,e.t0=e["catch"](0);case 10:case"end":return e.stop()}}),e,this,[[0,8]])})));function t(){return e.apply(this,arguments)}return t}()}]),t}(d["e"]);ee=p["a"]([Object(d["a"])({name:"CWVideoPlayer",components:{}})],ee);var te=ee,re=te,ae=Object(k["a"])(re,Y,Z,!1,null,null,null),ie=ae.exports,ne=500,se=function(e){function t(){var e;return Object(s["a"])(this,t),e=Object(c["a"])(this,Object(l["a"])(t).apply(this,arguments)),e.urlPrefix="",e.orgBg={id:"",src:""},e.roiConfig={deviceCode:"",width:1100,deviceName:""},e.areaData=[],e.showROI=!1,e.roiList=[],e.areaForm={id:"",name:"",roiId:"",points:[]},e.showVideoDialog=!1,e.tempOrgId="",e.loading=!1,e}return Object(u["a"])(t,e),Object(o["a"])(t,[{key:"orgIdChange",value:function(e){this.tempOrgId=e,e&&(this.areaForm={id:"",name:"",roiId:"",points:[]},this.fetchBgAndArea(),this.fetchROIs())}},{key:"onOpenVideoDialog",value:function(){this.showVideoDialog=!0}},{key:"fetchBgAndArea",value:function(){var e=Object(n["a"])(regeneratorRuntime.mark((function e(){var t,r,a,i,n,s,o;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,this.loading=!0,e.next=4,this.service.orgBgSrc(this.tempOrgId);case 4:if(t=e.sent,r=t.data,!(r&&r.length>0)){e.next=17;break}if(this.urlPrefix){e.next=12;break}return e.next=10,this.service.imgUrlPrefix();case 10:a=e.sent,this.urlPrefix=a.data;case 12:i=window.location.protocol,n=window.location.host,this.orgBg={id:r[0].id,src:"".concat(i,"//").concat(n).concat(this.urlPrefix).concat(r[0].orgImage)},e.next=18;break;case 17:this.orgBg={id:"",src:""};case 18:return s=[],e.next=21,this.service.businessAreas(this.tempOrgId);case 21:o=e.sent,o.data&&o.data.length>0&&(s=o.data.map((function(e){return{custom:{roiId:e.roiId,id:e.id},name:e.name,points:e.coordinate?JSON.parse(e.coordinate).points:[]}}))),this.areaData=s,this.roiConfig.deviceCode="http:"+(new Date).getTime(),this.loading=!1,e.next=31;break;case 28:e.prev=28,e.t0=e["catch"](0),this.loading=!1;case 31:case"end":return e.stop()}}),e,this,[[0,28]])})));function t(){return e.apply(this,arguments)}return t}()},{key:"fetchROIs",value:function(){var e=Object(n["a"])(regeneratorRuntime.mark((function e(){var t,r;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(e.prev=0,this.tempOrgId){e.next=3;break}return e.abrupt("return");case 3:return e.next=5,this.service.queryROI({orgId:this.tempOrgId});case 5:return t=e.sent,r=t.data,this.roiList=r,e.abrupt("return",Promise.resolve());case 11:return e.prev=11,e.t0=e["catch"](0),e.abrupt("return",Promise.resolve());case 14:case"end":return e.stop()}}),e,this,[[0,11]])})));function t(){return e.apply(this,arguments)}return t}()},{key:"onBeforeUpload",value:function(){var e=Object(n["a"])(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.$confirm("当前地图上存在业务区域,更新地图将清除当前已设置区域,是否确定清空?");case 3:return e.abrupt("return",Promise.resolve());case 6:return e.prev=6,e.t0=e["catch"](0),e.abrupt("return",Promise.reject());case 9:case"end":return e.stop()}}),e,this,[[0,6]])})));function t(){return e.apply(this,arguments)}return t}()},{key:"onUploadImage",value:function(){var e=Object(n["a"])(regeneratorRuntime.mark((function e(t){var r,a,i;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(e.prev=0,!(t.file.size/1024>ne)){e.next=5;break}return this.$message.warning("图片大小不能超过500kb!"),this.clearFiles(),e.abrupt("return");case 5:return r=new FormData,r.append("orgId",this.tempOrgId),r.append("orgImage",t.file),e.next=10,this.service.uploadBg(r);case 10:return a=e.sent,i=a.data,this.orgBg.id=i.id,this.orgBg.src=this.urlPrefix+i.orgImage,e.next=16,this.fetchAreaData();case 16:this.onResetAreaForm(),this.onRefreshROIComponent(),this.$message.success("上传成功"),this.clearFiles(),e.next=25;break;case 22:e.prev=22,e.t0=e["catch"](0),this.clearFiles();case 25:case"end":return e.stop()}}),e,this,[[0,22]])})));function t(t){return e.apply(this,arguments)}return t}()},{key:"fetchAreaData",value:function(){var e=Object(n["a"])(regeneratorRuntime.mark((function e(){var t,r;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,t=[],e.next=4,this.service.businessAreas(this.tempOrgId);case 4:return r=e.sent,r.data&&r.data.length>0&&(t=r.data.map((function(e){return{custom:{roiId:e.roiId,id:e.id},name:e.name,points:e.coordinate?JSON.parse(e.coordinate).points:[]}}))),this.areaData=t,e.abrupt("return",Promise.resolve());case 10:return e.prev=10,e.t0=e["catch"](0),e.abrupt("return",Promise.resolve());case 13:case"end":return e.stop()}}),e,this,[[0,10]])})));function t(){return e.apply(this,arguments)}return t}()},{key:"clearFiles",value:function(){this.$refs.addUpload&&this.$refs.addUpload.clearFiles(),this.$refs.updateUpload&&this.$refs.updateUpload.clearFiles()}},{key:"onResetAreaForm",value:function(){this.areaForm={id:"",name:"",roiId:"",points:[]}}},{key:"onROISelect",value:function(e){var t=this.roiList.findIndex((function(t){return t.roiId===e.custom.roiId}))>-1?e.custom.roiId:"";this.areaForm={id:e.custom.id,roiId:t,name:e.name,points:e.points}}},{key:"onROIRemove",value:function(){var e=Object(n["a"])(regeneratorRuntime.mark((function e(t){var r;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(e.prev=0,!this.areaForm.id){e.next=7;break}return r={ids:[this.areaForm.id],orgId:this.tempOrgId},e.next=5,this.service.deleteArea(r);case 5:this.onResetAreaForm(),this.$message.success("删除成功");case 7:e.next=11;break;case 9:e.prev=9,e.t0=e["catch"](0);case 11:case"end":return e.stop()}}),e,this,[[0,9]])})));function t(t){return e.apply(this,arguments)}return t}()},{key:"onROIConfirm",value:function(){var e=Object(n["a"])(regeneratorRuntime.mark((function e(t){var r,a;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(console.log("area ",t),e.prev=1,this.areaForm&&0!==this.areaForm.points.length){e.next=5;break}return this.$message.warning("请选择业务区域"),e.abrupt("return");case 5:if(this.areaForm.name){e.next=8;break}return this.$message.warning("请输入业务区域名称"),e.abrupt("return");case 8:if(this.areaForm.roiId){e.next=11;break}return this.$message.warning("请选择视觉围栏区域"),e.abrupt("return");case 11:if(r=this.areaROIRef.getImage(),a={name:this.areaForm.name,orgId:this.tempOrgId,coordinate:JSON.stringify({count:this.areaForm.points.length,points:this.areaForm.points,width:r.width,height:r.height}),orgImgId:this.orgBg.id,roiId:this.areaForm.roiId,id:this.areaForm.id},!this.areaForm.id){e.next=22;break}return e.next=16,this.service.updateArea(a);case 16:return e.next=18,this.fetchAreaData();case 18:this.onRefreshROIComponent(),this.$message.success("保存成功"),e.next=28;break;case 22:return e.next=24,this.service.addArea(a);case 24:return e.next=26,this.fetchAreaData();case 26:this.onRefreshROIComponent(),this.$message.success("保存成功");case 28:e.next=32;break;case 30:e.prev=30,e.t0=e["catch"](1);case 32:case"end":return e.stop()}}),e,this,[[1,30]])})));function t(t){return e.apply(this,arguments)}return t}()},{key:"onRefreshROIComponent",value:function(){this.roiConfig.deviceCode="http:"+(new Date).getTime()}}]),t}(d["e"]);p["a"]([Object(d["d"])()],se.prototype,"areaROIRef",void 0),p["a"]([Object(d["d"])()],se.prototype,"mapRef",void 0),p["a"]([Object(d["c"])({default:"",type:String})],se.prototype,"orgId",void 0),p["a"]([Object(d["f"])("orgId",{immediate:!0})],se.prototype,"orgIdChange",null),se=p["a"]([Object(d["a"])({name:"MapSetting",components:{CWVideoPlayer:ie,EmptyMap:X,RoiLayout:T["a"]}})],se);var oe=se,ce=oe,le=(r("8fe3"),Object(k["a"])(ce,V,J,!1,null,null,null)),ue=le.exports,pe=function(e){function t(){var e;return Object(s["a"])(this,t),e=Object(c["a"])(this,Object(l["a"])(t).apply(this,arguments)),e.treeProps={value:"id",label:"name",children:"children"},e.keyword="",e.orgId="",e.orgDetail={name:"",type:""},e}return Object(u["a"])(t,e),Object(o["a"])(t,[{key:"filterTextChange",value:function(e){this.orgTreeRef.filter(e)}},{key:"created",value:function(){this.orgId=this.userInfo.orgId,this.fetchOrgDetail()}},{key:"mounted",value:function(){var e=Object(n["a"])(regeneratorRuntime.mark((function e(){var t=this;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,this.fetchOrganizationTree();case 2:this.$nextTick((function(){t.initTreeChecked()}));case 3:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}()},{key:"initTreeChecked",value:function(){this.orgTreeRef&&this.orgId&&this.orgTreeRef.setCurrentKey(this.orgId)}},{key:"filterNode",value:function(e,t){return!e||-1!==t.name.indexOf(e)}},{key:"handleNodeClick",value:function(e){this.orgId=e[this.treeProps.value],this.fetchOrgDetail()}},{key:"fetchOrgDetail",value:function(){var e=Object(n["a"])(regeneratorRuntime.mark((function e(){var t,r;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(e.prev=0,this.orgId){e.next=3;break}return e.abrupt("return");case 3:return e.next=5,this.service.organizationDetail(this.orgId);case 5:t=e.sent,r=t.data,this.orgDetail=r,e.next=12;break;case 10:e.prev=10,e.t0=e["catch"](0);case 12:case"end":return e.stop()}}),e,this,[[0,10]])})));function t(){return e.apply(this,arguments)}return t}()},{key:"onRefreshROIList",value:function(){var e=Object(n["a"])(regeneratorRuntime.mark((function e(){var t=this;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,this.mapSettingRef.fetchROIs();case 2:return e.next=4,this.mapSettingRef.fetchBgAndArea();case 4:this.mapSettingRef.areaForm.roiId&&(this.mapSettingRef.areaForm.roiId=this.mapSettingRef.roiList.findIndex((function(e){return e.roiId===t.mapSettingRef.areaForm.roiId}))>-1?this.mapSettingRef.areaForm.roiId:"");case 5:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}()}]),t}(Object(d["b"])(h["a"]));p["a"]([Object(d["d"])()],pe.prototype,"orgTreeRef",void 0),p["a"]([Object(d["d"])()],pe.prototype,"mapSettingRef",void 0),p["a"]([Object(d["f"])("keyword")],pe.prototype,"filterTextChange",null),pe=p["a"]([Object(d["a"])({name:"SettingIndex",components:{MapSetting:ue,RelativeDevice:E}})],pe);var de=pe,he=de,ve=(r("b229"),Object(k["a"])(he,a,i,!1,null,null,null));t["default"]=ve.exports},"8cd4":function(e,t,r){"use strict";var a=r("21fb"),i=r.n(a);i.a},"8fe3":function(e,t,r){"use strict";var a=r("aa1d"),i=r.n(a);i.a},"970d":function(e,t,r){e.exports={elInputWidth:"200px",elInputNumberWidth:"200px",elTextareaWidth:"300px",elSelectWidth:"200px",appHeaderBg:"#014051",appIconBg:"#31b89a",appIconColor:"#fff",appIconSize:"30px",appNameColor:"#fff",appNameSize:"30px"}},aa1d:function(e,t,r){e.exports={elInputWidth:"200px",elInputNumberWidth:"200px",elTextareaWidth:"300px",elSelectWidth:"200px",appHeaderBg:"#014051",appIconBg:"#31b89a",appIconColor:"#fff",appIconSize:"30px",appNameColor:"#fff",appNameSize:"30px"}},b229:function(e,t,r){"use strict";var a=r("970d"),i=r.n(a);i.a}}]); |