| 1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-5d8edf5e"],{"0d33":function(t,e,s){"use strict";s("88cb")},"215e":function(t,e,s){"use strict";s.r(e);var a=function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"app-container"},[s("el-form",{ref:"queryForm",attrs:{model:t.queryParams,size:"small",inline:!0}},[s("el-form-item",{attrs:{label:this.$t("startTime"),"min-width":t.getStringWidth(t.$t("startTime")),prop:"startTime"}},[s("el-date-picker",{attrs:{clearable:"",type:"datetime","value-format":"yyyy-MM-dd HH:mm:ss"},model:{value:t.queryParams.startTime,callback:function(e){t.$set(t.queryParams,"startTime",e)},expression:"queryParams.startTime"}})],1),s("el-form-item",{attrs:{label:this.$t("endTime"),"min-width":t.getStringWidth(t.$t("endTime")),prop:"endTime"}},[s("el-date-picker",{attrs:{clearable:"",type:"datetime","value-format":"yyyy-MM-dd HH:mm:ss"},model:{value:t.queryParams.endTime,callback:function(e){t.$set(t.queryParams,"endTime",e)},expression:"queryParams.endTime"}})],1),s("el-form-item",[s("el-button",{attrs:{type:"primary","min-width":t.getStringWidth(t.$t("cx")),icon:"el-icon-search",size:"mini"},on:{click:t.handleQuery}},[t._v(t._s(t.$t("cx")))])],1)],1),s("el-tabs",{on:{"tab-click":t.handleClick},model:{value:t.activeName,callback:function(e){t.activeName=e},expression:"activeName"}},[s("el-tab-pane",{staticStyle:{height:"700px","overflow-y":"auto"},attrs:{label:t.$t("wsdcgq"),name:"0"}},[s("el-row",{staticClass:"elRow"},t._l(t.sensorStatusList,(function(e,a){return s("el-col",{attrs:{span:12}},[s("el-card",{staticStyle:{height:"400px","border-radius":"15px"}},[s("div",{staticStyle:{display:"flex"},attrs:{slot:"header"},slot:"header"},[s("span",{staticStyle:{"font-size":"20px","font-weight":"bold"}},[t._v(t._s(e.sensorName))])]),s("div",{staticStyle:{width:"100%"}},["0"===t.activeName?s("div",{staticStyle:{height:"310px",width:"100%","min-width":"600px"},attrs:{id:"sbCgqRefGl"+e.sensorId}}):t._e()])])],1)})),1)],1),s("el-tab-pane",{staticStyle:{height:"700px","overflow-y":"auto"},attrs:{label:t.$t("ywcgq"),name:"1"}},[s("el-row",{staticClass:"elRow"},t._l(t.sensorStatusList,(function(e,a){return s("el-col",{attrs:{span:12}},[s("el-card",{staticStyle:{height:"400px","border-radius":"15px"}},[s("div",{staticStyle:{display:"flex"},attrs:{slot:"header"},slot:"header"},[s("span",{staticStyle:{"font-size":"20px","font-weight":"bold"}},[t._v(t._s(e.sensorName))])]),s("div",{staticStyle:{width:"100%"}},["1"===t.activeName?s("div",{staticStyle:{height:"310px",width:"100%","min-width":"600px"},attrs:{id:"sbCgqRefGl"+e.sensorId}}):t._e()])])],1)})),1)],1),s("el-tab-pane",{staticStyle:{height:"700px","overflow-y":"auto"},attrs:{label:t.$t("sqcgq"),name:"2",lazy:""}},[s("el-row",{staticClass:"elRow"},t._l(t.sensorStatusList,(function(e,a){return s("el-col",{attrs:{span:12}},[s("el-card",{staticStyle:{height:"400px","border-radius":"15px"}},[s("div",{staticStyle:{display:"flex"},attrs:{slot:"header"},slot:"header"},[s("span",{staticStyle:{"font-size":"20px","font-weight":"bold"}},[t._v(t._s(e.sensorName))])]),s("div",{staticStyle:{width:"100%"}},["2"===t.activeName?s("div",{staticStyle:{height:"310px",width:"100%","min-width":"600px"},attrs:{id:"sbCgqRefGl"+e.sensorId}}):t._e()])])],1)})),1)],1),s("el-tab-pane",{staticStyle:{height:"700px","overflow-y":"auto"},attrs:{label:t.$t("mjcgq"),name:"3",lazy:""}},[s("el-row",{staticClass:"elRow"},t._l(t.sensorStatusList,(function(e,a){return s("el-col",{attrs:{span:12}},[s("el-card",{staticStyle:{height:"400px","border-radius":"15px"}},[s("div",{staticStyle:{display:"flex"},attrs:{slot:"header"},slot:"header"},[s("span",{staticStyle:{"font-size":"20px","font-weight":"bold"}},[t._v(t._s(e.sensorName))])]),s("div",{staticStyle:{width:"100%"}},["3"===t.activeName?s("div",{staticStyle:{height:"310px",width:"100%","min-width":"600px"},attrs:{id:"sbCgqRefGl"+e.sensorId}}):t._e()])])],1)})),1)],1),s("el-tab-pane",{staticStyle:{height:"700px","overflow-y":"auto"},attrs:{label:t.$t("qtcgq"),name:"4",lazy:""}},[s("el-row",{staticClass:"elRow"},t._l(t.sensorStatusList,(function(e,a){return s("el-col",{attrs:{span:12}},[s("el-card",{staticStyle:{height:"400px","border-radius":"15px"}},[s("div",{staticStyle:{display:"flex"},attrs:{slot:"header"},slot:"header"},[s("span",{staticStyle:{"font-size":"20px","font-weight":"bold"}},[t._v(t._s(e.sensorName))])]),s("div",{staticStyle:{width:"100%"}},["4"===t.activeName?s("div",{staticStyle:{height:"310px",width:"100%","min-width":"600px"},attrs:{id:"sbCgqRefGl"+e.sensorId}},[t._v("2")]):t._e()])])],1)})),1)],1),s("el-tab-pane",{staticStyle:{height:"700px","overflow-y":"auto"},attrs:{label:t.$t("qyqlcgq"),name:"5",lazy:""}},[s("el-row",{staticClass:"elRow"},t._l(t.sensorStatusList,(function(e,a){return s("el-col",{attrs:{span:12}},[s("el-card",{staticStyle:{height:"400px","border-radius":"15px"}},[s("div",{staticStyle:{display:"flex"},attrs:{slot:"header"},slot:"header"},[s("span",{staticStyle:{"font-size":"20px","font-weight":"bold"}},[t._v(t._s(e.sensorName))])]),s("div",{staticStyle:{width:"100%"}},["5"===t.activeName?s("div",{staticStyle:{height:"310px",width:"100%","min-width":"600px"},attrs:{id:"sbCgqRefGl"+e.sensorId}},[t._v("3")]):t._e()])])],1)})),1)],1),s("el-tab-pane",{staticStyle:{height:"700px","overflow-y":"auto"},attrs:{label:t.$t("xlcgq"),name:"7",lazy:""}},[s("el-row",{staticClass:"elRow"},t._l(t.sensorStatusList,(function(e,a){return s("el-col",{attrs:{span:12}},[s("el-card",{staticStyle:{height:"400px","border-radius":"15px"}},[s("div",{staticStyle:{display:"flex"},attrs:{slot:"header"},slot:"header"},[s("span",{staticStyle:{"font-size":"20px","font-weight":"bold"}},[t._v(t._s(e.sensorName))])]),s("div",{staticStyle:{width:"100%"}},["7"===t.activeName?s("div",{staticStyle:{height:"310px",width:"100%","min-width":"600px"},attrs:{id:"sbCgqRefGl"+e.sensorId}},[t._v("3")]):t._e()])])],1)})),1)],1),s("el-tab-pane",{staticStyle:{height:"700px","overflow-y":"auto"},attrs:{label:t.$t("dwdcgq"),name:"8",lazy:""}},[s("el-row",{staticClass:"elRow"},t._l(t.sensorStatusList,(function(e,a){return s("el-col",{attrs:{span:12}},[s("el-card",{staticStyle:{height:"400px","border-radius":"15px"}},[s("div",{staticStyle:{display:"flex"},attrs:{slot:"header"},slot:"header"},[s("span",{staticStyle:{"font-size":"20px","font-weight":"bold"}},[t._v(t._s(e.sensorName))])]),s("div",{staticStyle:{width:"100%"}},["8"===t.activeName?s("div",{staticStyle:{height:"310px",width:"100%","min-width":"600px"},attrs:{id:"sbCgqRefGl"+e.sensorId}}):t._e()])])],1)})),1)],1),s("el-tab-pane",{staticStyle:{height:"700px","overflow-y":"auto"},attrs:{label:t.$t("stwdcgq"),name:"9",lazy:""}},[s("el-row",{staticClass:"elRow"},t._l(t.sensorStatusList,(function(e,a){return s("el-col",{attrs:{span:12}},[s("el-card",{staticStyle:{height:"400px","border-radius":"15px"}},[s("div",{staticStyle:{display:"flex"},attrs:{slot:"header"},slot:"header"},[s("span",{staticStyle:{"font-size":"20px","font-weight":"bold"}},[t._v(t._s(e.sensorName))])]),s("div",{staticStyle:{width:"100%"}},["9"===t.activeName?s("div",{staticStyle:{height:"310px",width:"100%","min-width":"600px"},attrs:{id:"sbCgqRefGl"+e.sensorId}}):t._e()])])],1)})),1)],1)],1)],1)},n=[],i=(s("4de4"),s("14d9"),s("b0c0"),s("b680"),s("d3b7"),s("159b"),s("7ba4")),r=s("313e"),o={name:"Server",data:function(){return{server:[],totalStatus:{},channelList:[],title:"",total:0,sensorStatusTitle:"",open:!1,form:{},sensorStatusForm:{},channelLoadTypes:["空调","服务器","交换机","路由器","计算机","显示器","灯","其他"],activeName:"0",sensorStatusOpen:!1,sensorStatusList:[],sensorStatusALLList:[],queryParams:{startTime:"",endTime:"",sensorType:"",token:"",type:""},tabParams:{sensorName:""},usertoken:"",sensorStatusTabs:[{id:"0",name:"wsdcgq"},{id:"1",name:"ywcgq"},{id:"2",name:"sqcgq"},{id:"3",name:"mjcgq"},{id:"4",name:"qtcgq"},{id:"5",name:"qyqlcgq"},{id:"7",name:"xlcgq"},{id:"8",name:"dwdcgq"},{id:"9",name:"stwdcgq"}],waterImmersionStates:[{id:"1",name:"qr"},{id:"0",name:"wqr"}],accessControlStatuss:[{id:"0",name:"sb"},{id:"1",name:"sf"}],alarmStatuss:[{id:"1",name:"bj"},{id:"0",name:"wbj"}],connectionStatuss:[{id:"0",name:"zx"},{id:"1",name:"lix"}],leakageStatuss:[{id:"2",name:"xl"},{id:"1",name:"wxl"},{id:"0",name:"ztwz"}],chart:""}},mounted:function(){var t=this;setTimeout((function(){t.querySensorStatusMonitoring()}),500)},created:function(){this.usertoken=this.$store.state.user.usertoken;var t=new Date;this.queryParams.endTime=this.getNowDateTime(t),t.setHours(t.getHours()-6),this.queryParams.startTime=this.getNowDateTime(t)},methods:{getStringWidth:function(t){var e="14px Arial",s=document.createElement("canvas"),a=s.getContext("2d");a.font=e;var n=a.measureText(t);return n.width+40},handleClick:function(t,e){var s=this;this.activeName=t.name,setTimeout((function(){s.querySensorStatusMonitoring()}),100)},querySensorStatusMonitoring:function(){var t=this;this.queryParams.token=this.usertoken,this.queryParams.type="listHisQuery",this.queryParams.sensorType=this.activeName,Object(i["j"])(this.queryParams).then((function(e){if(t.sensorStatusList=e.data,null!=e.data&&null!=e||t.$modal.msgSuccess(t.$t("zwsj")),"0"==t.activeName||"4"==t.activeName||"5"==t.activeName||"8"==t.activeName||"9"==t.activeName||"10"==t.activeName)for(var s=0;s<t.sensorStatusList.length;s++){for(var a=t.sensorStatusList[s],n=a.typeData,i=[],r=[],o=0;o<n.length;o++){var l=n[o],c={},u={},d={};u.name=l.typeName,u.icon="circle",r.push(u),c.name=l.typeName,c.smooth=!0,c.showSymbol=!1,c.type="line",c.data=l.ydata,"0"==l.type?(c.color="#0E35FF",d.color="#D3E1FB",d.opacity=1,d.origin="start",c.areaStyle=d):"1"==l.type&&(c.color="#09BC3C",d.color="#B6D8D7",d.opacity=1,d.origin="start",c.areaStyle=d),i.push(c)}var h=a.xAxis,m="";t.echartCgq(r,h,i,m,a.sensorId)}else if("1"==t.activeName||"2"==t.activeName||"3"==t.activeName||"7"==t.activeName)for(s=0;s<t.sensorStatusList.length;s++){a=t.sensorStatusList[s];var y=a.typeData,S=[],g=[];for(o=0;o<y.length;o++){var f=y[o],p={},v={},b={};if(v.name=f.typeName,v.icon="circle",g.push(v),p.name=f.typeName,p.smooth=!0,p.showSymbol=!1,p.type="line","7"==t.activeName){for(var w=[],x=0;x<f.ydata.length;x++)w.push(1+f.ydata[x]);p.data=w}else p.data=f.ydata;"0"==f.type?(p.color="#0E35FF",b.color="#D3E1FB",b.opacity=1,b.origin="start",p.areaStyle=b):"1"==f.type&&(p.color="#09BC3C",b.color="#B6D8D7",b.opacity=1,b.origin="start",p.areaStyle=b),S.push(p)}var q=[],$="";"1"==t.activeName?(q.push(t.$t("wbj")),q.push(t.$t("bj")),$="alarmStatus"):"2"==t.activeName?(q=[],q.push(t.$t("wqr")),q.push(t.$t("qr")),$="waterImmersionState"):"3"==t.activeName?(q=[],q.push(t.$t("sb")),q.push(t.$t("sf")),$="accessControlStatus"):"7"==t.activeName&&(q=[],q.push(t.$t("ztwz")),q.push(t.$t("wxl")),q.push(t.$t("xl")),$="leakageStatus");h=a.xAxis,m="";t.echartCgq2(g,h,S,m,a.sensorId,q,$)}t.sensorStatusALLList=e.data,t.total=t.sensorStatusList.length})).catch((function(){}))},getEchartDity:function(t,e){var s="",a="",n=[];"accessControlStatus"==e?(n=this.accessControlStatuss,a=t+""):"alarmStatus"==e?(n=this.alarmStatuss,a=t+""):"leakageStatus"==e?(n=this.leakageStatuss,a=t+""):"connectionStatus"==e?(n=this.connectionStatuss,a=t+""):("waterImmersionState"==e||"waterImmersionState"==e)&&(n=this.waterImmersionStates,a=t+"");for(var i=0;i<n.length;i++){var r=n[i];if(a==r.id)return s=r.name,this.$t(r.name)}return s},echartCgq2:function(t,e,s,a,n,i,o){var l=this;this.$nextTick((function(){var c={tooltip:{trigger:"axis",formatter:function(t){var e=t[0].name+"<br/>";return t.forEach((function(t){e+=t.seriesName+": "+l.getEchartDity(t.value,o)+"<br/>"})),e}},legend:{data:t},xAxis:{name:"T",type:"category",boundaryGap:!1,data:e,axisLabel:{formatter:function(t){return t.length>11?t.substring(0,11)+"\n"+t.substring(11):t}}},yAxis:{name:a,type:"category",data:i,splitLine:{lineStyle:{type:"dashed",color:"#ddd",width:1,dashPattern:[4,4]}},axisLabel:{fontSize:10,formatter:"{value}"}},series:s},u=r["getInstanceByDom"](document.getElementById("sbCgqRefGl"+n));null==u&&(u=r["init"](document.getElementById("sbCgqRefGl"+n))),u.clear(),u.setOption(c)}))},echartCgq:function(t,e,s,a,n){this.$nextTick((function(){var i={tooltip:{trigger:"axis",formatter:function(t){var e=t[0].name+"<br/>";return t.forEach((function(t){e+=t.seriesName+": "+t.value.toFixed(3)+"<br/>"})),e}},legend:{data:t},xAxis:{name:"T",type:"category",boundaryGap:!1,data:e,axisLabel:{formatter:function(t){return t.length>11?t.substring(0,11)+"\n"+t.substring(11):t}}},yAxis:{name:a,type:"value",splitLine:{lineStyle:{type:"dashed",color:"#ddd",width:1,dashPattern:[4,4]}},axisLabel:{formatter:"{value}"}},series:s},o=r["getInstanceByDom"](document.getElementById("sbCgqRefGl"+n));null==o&&(o=r["init"](document.getElementById("sbCgqRefGl"+n))),o.clear(),o.setOption(i)}))},getDity:function(t,e){var s="",a="",n=[];"accessControlStatus"==e?(n=this.accessControlStatuss,a=t.accessControlStatus):"alarmStatus"==e?(n=this.alarmStatuss,a=t.alarmStatus):"leakageStatus"==e?(n=this.leakageStatuss,a=t.leakageStatus):"connectionStatus"==e?(n=this.connectionStatuss,a=t.connectionStatus):("waterImmersionState"==e||"waterImmersionState"==e)&&(n=this.waterImmersionStates,a=t.waterImmersionState);for(var i=0;i<n.length;i++){var r=n[i];if(a==r.id)return s=r.name,this.$t(r.name)}return s},getNowDateTime:function(t){var e=t.getFullYear(),s=t.getMonth()+1<10?"0"+(t.getMonth()+1):t.getMonth()+1,a=t.getDate()<10?"0"+t.getDate():t.getDate(),n=t.getHours()<10?"0"+t.getHours():t.getHours(),i=t.getMinutes()<10?"0"+t.getMinutes():t.getMinutes(),r=t.getSeconds()<10?"0"+t.getSeconds():t.getSeconds();return e+"-"+s+"-"+a+" "+n+":"+i+":"+r},handleQuery:function(){this.querySensorStatusMonitoring()},resetQuery:function(){this.queryParams.endTime="",this.queryParams.startTime="",this.queryParams.sensorName="",this.handleQuery()},filterList:function(t,e){return t.filter((function(t){return t.sensorType===e}))},sensorStatusDelete:function(t){var e=this,s={};s.token=this.usertoken,s.sensorId=t.sensorId,s.type="delete",this.$modal.confirm(this.$t("qdyscm")).then((function(){Object(i["j"])(s)})).then((function(){e.$modal.msgSuccess(e.$t("zxcg")),e.querySensorStatusMonitoring()})).catch((function(){}))},issueInstructionsReset:function(t){var e=this,s={};s.token=this.usertoken,s.sensorId=t.sensorId,s.type="reset",this.$modal.confirm(this.$t("qryfwm")).then((function(){Object(i["j"])(s)})).then((function(){e.$modal.msgSuccess(e.$t("zxcg")),e.querySensorStatusMonitoring()})).catch((function(){}))},issueInstructionsRelease:function(t){var e=this,s={};s.token=this.usertoken,s.sensorId=t.sensorId,s.type="release",this.$modal.confirm(this.$t("qrysfm")).then((function(){Object(i["j"])(s)})).then((function(){e.querySensorStatusMonitoring(),e.$modal.msgSuccess(e.$t("zxcg"))})).catch((function(){}))},sensorStatusUpdate:function(t){this.sensorStatusForm=t,this.sensorStatusOpen=!0,this.sensorStatusTitle=this.$t("pz")},sensorStatusHandleCommand:function(t,e){var s=this,a={};switch(a.token=this.usertoken,a.sensorId=e.sensorId,t){case"sensorStatusopen":a.type="open",this.$modal.confirm(this.$t("qrykqm")).then((function(){Object(i["j"])(a)})).then((function(){s.$modal.msgSuccess(s.$t("zxcg")),s.querySensorStatusMonitoring()})).catch((function(){}));break;case"sensorStatusclose":a.type="close",this.$modal.confirm(this.$t("qrygbm")).then((function(){Object(i["j"])(a)})).then((function(){s.$modal.msgSuccess(s.$t("zxcg")),s.querySensorStatusMonitoring()})).catch((function(){}));break;default:break}},sensorStatusSubmitForm:function(){var t=this;this.$refs["sensorStatusForm"].validate((function(e){if(e){var s={};s.token=t.usertoken,s.sensorType=t.sensorStatusForm.sensorType,s.sensorId=t.sensorStatusForm.sensorId,s.sensorName=t.sensorStatusForm.sensorName,s.comSlogan=t.sensorStatusForm.comSlogan,s.sensorAddr=t.sensorStatusForm.sensorAddr,s.sensorBaud=t.sensorStatusForm.sensorBaud,s.connectionStatus=t.sensorStatusForm.connectionStatus,void 0!=t.sensorStatusForm.sensorId&&""!=t.sensorStatusForm.sensorId?(t.loading=!0,s.type="update",Object(i["j"])(s).then((function(e){t.$modal.msgSuccess(t.$t("xgcg")),t.sensorStatusOpen=!1,t.querySensorStatusMonitoring(),t.loading=!1}))):(t.loading=!0,s.type="add",Object(i["j"])(s).then((function(e){t.$modal.msgSuccess(t.$t("xzcg")),t.sensorStatusOpen=!1,t.querySensorStatusMonitoring(),t.loading=!1})))}}))},sensorStatusCancel:function(){this.sensorStatusOpen=!1},getList:function(){var t=this;getServer().then((function(e){t.server=e.data}))},cancel:function(){this.open=!1},queryChannelStatus:function(){var t=this,e={};e.token=this.usertoken,e.type="listQuery",this.loading=!0,channelStatusMonitoring(e).then((function(e){t.channelList=e.data})).catch((function(){})),this.loading=!1},handleCommand:function(t,e){var s=this,a={};switch(a.token=this.usertoken,a.productChId=e.productChId,t){case"channelopen":a.type="open",this.$modal.confirm(this.$t("qrykqm")).then((function(){channelStatusMonitoring(a)})).then((function(){s.$modal.msgSuccess(s.$t("zxcg"))})).catch((function(){}));break;case"channelclose":a.type="close",this.$modal.confirm(this.$t("qrygbm")).then((function(){channelStatusMonitoring(a)})).then((function(){s.$modal.msgSuccess(s.$t("zxcg"))})).catch((function(){}));break;default:break}},queryTotalStatus:function(){var t=this,e={};e.token=this.usertoken,e.type="listQuery",overallStatusMonitoring(e).then((function(e){t.totalStatus=e.data[0]}))},totalopen:function(){var t=this,e={};e.token=this.usertoken,e.type="open",this.$modal.confirm(this.$t("qrykqm")).then((function(){overallStatusMonitoring(e)})).then((function(){t.$modal.msgSuccess(t.$t("zxcg")),t.queryTotalStatus(),t.queryChannelStatus(),t.querySensorStatusMonitoring()})).catch((function(){}))},runJob:function(){alert("222")},totalclose:function(){var t=this,e={};e.token=this.usertoken,e.type="close",this.$modal.confirm(this.$t("qrykqm")).then((function(){overallStatusMonitoring(e)})).then((function(){t.$modal.msgSuccess(t.$t("zxcg")),t.queryTotalStatus(),t.queryChannelStatus(),t.querySensorStatusMonitoring()})).catch((function(){}))},openLoading:function(){this.$modal.loading(this.$t("zzjzqsh"))}}},l=o,c=(s("9107"),s("0d33"),s("2877")),u=Object(c["a"])(l,a,n,!1,null,"50430da1",null);e["default"]=u.exports},"88cb":function(t,e,s){},9107:function(t,e,s){"use strict";s("ea87")},ea87:function(t,e,s){}}]);
|