| 1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-e3beca8c"],{"0903":function(t,e,s){},5124:function(t,e,s){"use strict";s("0903")},"9dc3":function(t,e,s){"use strict";s.r(e);var n=function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"app-container"},[s("el-tabs",{attrs:{value:"0"},on:{"tab-click":t.handleClick}},t._l(t.sensorStatusTabs,(function(e){return s("el-tab-pane",{key:e.id,attrs:{label:t.$t(e.name),name:e.id}},[s("el-card",{staticStyle:{height:"600px","border-radius":"15px"}},[s("el-table",{staticStyle:{overflow:"auto"},attrs:{height:"550",data:t.sensorStatusList,"header-cell-style":{background:"#FFFFFF",color:"#000000"}}},[t._e(),t._e(),t._e(),t._e(),s("el-table-column",{attrs:{label:t.$t("cgqmc"),prop:"sensorName","min-width":t.getStringWidth(t.$t("cgqmc")),"show-overflow-tooltip":!0}}),s("el-table-column",{attrs:{label:t.$t("lx"),prop:"sensorType","min-width":t.getStringWidth(t.$t("lx")),"show-overflow-tooltip":!0},scopedSlots:t._u([{key:"default",fn:function(e){return[s("span",[t._v(t._s(t.getDity(e.row,"sensorType")))])]}}],null,!0)}),s("el-table-column",{attrs:{label:t.$t("cgqsjtd"),"min-width":t.getStringWidth(t.$t("cgqsjtd")),prop:"cgqtd"}}),"0"===e.id||"1"===e.id||"5"===e.id||"6"===e.id?s("el-table-column",{attrs:{label:"Modbus "+t.$t("dz"),prop:"sensorAddr","min-width":t.getStringWidth("Modbus "+t.$t("dz")),align:"center"}}):t._e(),"0"===e.id||"1"===e.id||"5"===e.id||"6"===e.id?s("el-table-column",{attrs:{label:t.$t("btl"),align:"center",prop:"sensorBaud","min-width":t.getStringWidth(t.$t("btl"))}}):t._e(),s("el-table-column",{attrs:{label:t.$t("ljzt"),align:"center",prop:"connectionStatus","min-width":t.getStringWidth(t.$t("ljzt"))},scopedSlots:t._u([{key:"default",fn:function(e){return["1"==e.row.connectionStatus?s("span",{staticStyle:{color:"red"}},[t._v(t._s(t.getDity(e.row,"connectionStatus")))]):s("span",{staticStyle:{color:"green"}},[t._v(t._s(t.getDity(e.row,"connectionStatus")))])]}}],null,!0)}),"0"===e.id?s("el-table-column",{attrs:{label:t.$t("wdz")+"(℃)",align:"center",prop:"temperatureValue","min-width":t.getStringWidth(t.$t("wdz"))}}):t._e(),"0"===e.id?s("el-table-column",{attrs:{label:t.$t("sdz")+"(%)",align:"center",prop:"humidityValue","min-width":t.getStringWidth(t.$t("sdz"))}}):t._e(),"1"===e.id?s("el-table-column",{attrs:{label:t.$t("bjzt"),align:"center",prop:"alarmStatus","min-width":t.getStringWidth(t.$t("bjzt"))},scopedSlots:t._u([{key:"default",fn:function(e){return[s("span",[t._v(t._s(t.getDity(e.row,"alarmStatus")))])]}}],null,!0)}):t._e(),"2"===e.id?s("el-table-column",{attrs:{label:t.$t("sqrzt"),align:"center",prop:"waterImmersionState","min-width":t.getStringWidth(t.$t("sqrzt"))},scopedSlots:t._u([{key:"default",fn:function(e){return[s("span",[t._v(t._s(t.getDity(e.row,"waterImmersionState")))])]}}],null,!0)}):t._e(),"3"===e.id?s("el-table-column",{attrs:{label:t.$t("mjsfzt"),align:"center",prop:"accessControlStatus","min-width":t.getStringWidth(t.$t("mjsfzt"))},scopedSlots:t._u([{key:"default",fn:function(e){return[s("span",[t._v(t._s(t.getDity(e.row,"accessControlStatus")))])]}}],null,!0)}):t._e(),"4"===e.id?s("el-table-column",{attrs:{label:t.$t("qtld"),align:"center",prop:"gasConcentration","min-width":t.getStringWidth(t.$t("qtld"))}}):t._e(),"5"===e.id?s("el-table-column",{attrs:{label:t.$t("qlz")+"(m/s)",align:"center",prop:"airflowValue","min-width":t.getStringWidth(t.$t("qlz"))}}):t._e(),"5"===e.id?s("el-table-column",{attrs:{label:t.$t("qyz")+"(MPa)",align:"center",prop:"airPressureValue","min-width":t.getStringWidth(t.$t("qyz"))}}):t._e(),s("el-table-column",{attrs:{label:t.$t("cz"),align:"center","min-width":"110","class-name":"small-padding fixed-width"},scopedSlots:t._u([{key:"default",fn:function(n){return[s("el-button",{attrs:{size:"mini",type:"text"},on:{click:function(e){return t.sensorStatusUpdate(n.row)}}},[t._v(t._s(t.$t("pz")))]),"1"===e.id&&"0"==n.row.alarmStatus&&"1"==n.row.connectionStatus?s("el-button",{attrs:{size:"mini",type:"text"},on:{click:function(e){return t.issueInstructionsReset(n.row)}}},[t._v(t._s(t.$t("fw")))]):t._e(),"3"===e.id?s("el-button",{attrs:{size:"mini",type:"text"},on:{click:function(e){return t.issueInstructionsRelease(n.row)}}},[t._v(t._s(t.$t("sf")))]):t._e(),"6"===e.id?s("el-dropdown",{staticStyle:{"margin-left":"10px"},attrs:{size:"mini"},on:{command:function(e){return t.sensorStatusHandleCommand(e,n.row)}}},[s("el-button",{staticStyle:{"margin-left":"10px"},attrs:{icon:"el-icon-d-arrow-right",size:"mini",type:"text"}},[t._v(t._s(t.$t("gd")))]),s("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},["0"==n.row.connectionStatus?s("el-dropdown-item",{staticStyle:{"margin-left":"10px"},attrs:{command:"sensorStatusclose"}},[t._v(t._s(t.$t("gb")))]):t._e(),"1"==n.row.connectionStatus?s("el-dropdown-item",{staticStyle:{"margin-left":"10px"},attrs:{command:"sensorStatusopen"}},[t._v(t._s(t.$t("kq")))]):t._e()],1)],1):t._e(),s("el-button",{attrs:{size:"mini",type:"text"},on:{click:function(e){return t.sensorStatusDelete(n.row)}}},[t._v(t._s(t.$t("sc")))])]}}],null,!0)})],1)],1),s("pagination",{directives:[{name:"show",rawName:"v-show",value:t.total>0,expression:"total>0"}],attrs:{total:t.total,page:t.queryParams.pageNum,limit:t.queryParams.pageSize},on:{"update:page":function(e){return t.$set(t.queryParams,"pageNum",e)},"update:limit":function(e){return t.$set(t.queryParams,"pageSize",e)},pagination:t.querySensorStatusMonitoring}})],1)})),1),s("el-dialog",{attrs:{title:t.title,"close-on-click-modal":!1,"close-on-press-escape":!1,visible:t.open,width:"500px","append-to-body":""},on:{"update:visible":function(e){t.open=e}}},[s("el-form",{ref:"form",attrs:{model:t.form,"label-width":"auto"}},[s("el-form-item",{attrs:{label:this.$t("tdh"),prop:"productChId"}},[s("el-input",{attrs:{readonly:!0,disabled:!0},model:{value:t.form.productChId,callback:function(e){t.$set(t.form,"productChId",e)},expression:"form.productChId"}})],1),s("el-form-item",{attrs:{label:this.$t("tdmc"),prop:"productChName"}},[s("el-input",{model:{value:t.form.productChName,callback:function(e){t.$set(t.form,"productChName",e)},expression:"form.productChName"}})],1),s("el-form-item",{attrs:{label:this.$t("tdfzlx")}},[s("el-select",{staticStyle:{width:"100%"},attrs:{"allow-create":"",clearable:"",filterable:""},model:{value:t.form.ChannelLoadType,callback:function(e){t.$set(t.form,"ChannelLoadType",e)},expression:"form.ChannelLoadType"}},t._l(t.channelLoadTypes,(function(t){return s("el-option",{key:t,attrs:{label:t,value:t}})})),1)],1)],1),s("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[s("el-button",{attrs:{type:"primary"},on:{click:t.submitForm}},[t._v(t._s(t.$t("qd")))]),s("el-button",{on:{click:t.cancel}},[t._v(t._s(t.$t("qx")))])],1)],1),s("el-dialog",{attrs:{title:t.sensorStatusTitle,visible:t.sensorStatusOpen,width:"550px","close-on-click-modal":!1,"close-on-press-escape":!1,"append-to-body":""},on:{"update:visible":function(e){t.sensorStatusOpen=e}}},[s("el-form",{ref:"sensorStatusForm",attrs:{model:t.sensorStatusForm,"label-width":"auto"}},[s("el-row",{attrs:{span:22}},[s("el-col",{attrs:{span:22}},[t._e()],1),s("el-col",{attrs:{span:16}},[s("el-form-item",{attrs:{label:this.$t("cgq")+this.$t("mc"),prop:"sensorName"}},[s("el-input",{staticStyle:{width:"250px"},model:{value:t.sensorStatusForm.sensorName,callback:function(e){t.$set(t.sensorStatusForm,"sensorName",e)},expression:"sensorStatusForm.sensorName"}})],1)],1),this.sensorStatusTitle==this.$t("xz")?s("el-col",{attrs:{span:16}},[s("el-form-item",{attrs:{label:this.$t("cgq")+this.$t("lx"),prop:"sensorType"}},[s("el-select",{staticStyle:{width:"250px"},attrs:{"allow-create":"",filterable:""},model:{value:t.sensorStatusForm.sensorType,callback:function(e){t.$set(t.sensorStatusForm,"sensorType",e)},expression:"sensorStatusForm.sensorType"}},t._l(t.sensorStatusTabs,(function(e){return s("el-option",{key:e.id,attrs:{label:t.$t(e.name),value:e.id}})})),1)],1)],1):t._e(),s("el-col",{attrs:{span:16}},[s("el-form-item",{attrs:{label:this.$t("cgqsjtd"),prop:"cgqtd"}},[s("el-select",{staticStyle:{width:"250px"},attrs:{"allow-create":"",filterable:""},on:{change:t.tplSelectChange},model:{value:t.sensorStatusForm.cgqtd,callback:function(e){t.$set(t.sensorStatusForm,"cgqtd",e)},expression:"sensorStatusForm.cgqtd"}},t._l(t.cgqtds,(function(t){return s("el-option",{key:t.id,attrs:{label:t.name,value:t.id}})})),1)],1)],1),s("el-col",{attrs:{span:16}},[1==t.showClass?s("el-form-item",{attrs:{label:"Modbus "+this.$t("dz"),prop:"sensorAddr"}},[s("el-select",{staticStyle:{width:"250px"},attrs:{"allow-create":"",filterable:""},model:{value:t.sensorStatusForm.sensorAddr,callback:function(e){t.$set(t.sensorStatusForm,"sensorAddr",e)},expression:"sensorStatusForm.sensorAddr"}},t._l(t.sensorAddrs,(function(t){return s("el-option",{key:t.id,attrs:{label:t.name,value:t.id}})})),1)],1):t._e()],1)],1)],1),s("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[s("el-button",{attrs:{type:"primary"},on:{click:t.sensorStatusSubmitForm}},[t._v(t._s(t.$t("qd")))]),s("el-button",{on:{click:t.sensorStatusCancel}},[t._v(t._s(t.$t("qx")))])],1)],1)],1)},o=[],a=(s("4de4"),s("14d9"),s("b0c0"),s("d3b7"),s("7ba4")),r={name:"Server",data:function(){return{server:[],totalStatus:{},channelList:[],title:"",sensorStatusTitle:"",open:!1,form:{},sensorStatusForm:{},channelLoadTypes:["空1调","服务器","交换机","路由器","计算机","显示器","灯","其他"],activeName:"0",sensorStatusTabs:[{id:"0",name:"wsdcgq"}],waterImmersionStates:[{id:"0",name:"qr"},{id:"1",name:"wqr"}],accessControlStatuss:[{id:"0",name:"sb"},{id:"1",name:"sf"}],alarmStatuss:[{id:"0",name:"bj"},{id:"1",name:"wbj"}],connectionStatuss:[{id:"0",name:"zx"},{id:"1",name:"lix"}],cgqtds:[{id:"RS485",name:"RS485"},{id:"IN1",name:"IN1"},{id:"IN2",name:"IN2"},{id:"IN3",name:"IN3"},{id:"IN4",name:"IN4"}],sensorAddrs:[{id:"1",name:"1"},{id:"2",name:"2"},{id:"3",name:"3"},{id:"4",name:"4"},{id:"5",name:"5"},{id:"6",name:"6"},{id:"7",name:"7"},{id:"8",name:"8"},{id:"9",name:"9"},{id:"10",name:"10"},{id:"11",name:"11"},{id:"12",name:"12"},{id:"13",name:"13"},{id:"14",name:"14"}],sensorStatusOpen:!1,sensorStatusList:[],sensorStatusALLList:[],queryParams:{sensorName:void 0,productId:"",pageNum:1,pageSize:10},total:0,usertoken:"",showClass:!1}},mounted:function(){this.$bus.$on("SENSOR_STATUS_MONITORING",this.onSocketMessageToSensor)},created:function(){this.usertoken=this.$store.state.user.usertoken,this.queryProductList(),this.querySensorAddrs()},methods:{querySensorAddrs:function(){for(var t=[],e=1;e<=255;e++){var s={};s.id=e+"",s.name=e+"",t.push(s)}this.sensorAddrs=t},queryProductList:function(){var t=this,e={};e.token=this.usertoken,e.type="listSbRestartQuery",Object(a["e"])(e).then((function(e){t.productList=e.data,t.queryParams.productId=t.productList[0].productId,t.productType=t.productList[0].productType,t.querySensorStatusMonitoring()})).catch((function(){}))},getStringWidth:function(t){var e="14px Arial",s=document.createElement("canvas"),n=s.getContext("2d");n.font=e;var o=n.measureText(t);return o.width+40},tplSelectChange:function(t){this.showClass="RS485"==t},onSocketMessageToSensor:function(t){t.success&&null!=t.data&&""!=t.data.data&&null!=t.data.data&&(this.sensorStatusList=this.filterList(t.data.data,this.activeName),this.sensorStatusALLList=response.data)},getDity:function(t,e){var s="",n="",o=[];"accessControlStatus"==e?(o=this.accessControlStatuss,n=t.accessControlStatus):"alarmStatus"==e?(o=this.alarmStatuss,n=t.alarmStatus):"connectionStatus"==e?(o=this.connectionStatuss,n=t.connectionStatus):"waterImmersionState"==e||"waterImmersionState"==e?(o=this.waterImmersionStates,n=t.waterImmersionState):"sensorType"==e&&(o=this.sensorStatusTabs,n=t.sensorType);for(var a=0;a<o.length;a++){var r=o[a];if(n==r.id)return s=r.name,this.$t(r.name)}return s},sensorStatusAdd:function(){this.sensorStatusForm={},this.sensorStatusOpen=!0,this.showClass=!1,this.sensorStatusTitle=this.$t("xz")},querySensorStatusMonitoring:function(){var t=this,e={};e.token=this.usertoken,e.type="listQuery",e.sensorName=this.queryParams.sensorName,e.productId=this.queryParams.productId,Object(a["i"])(e).then((function(e){t.sensorStatusList=t.filterList(e.data,t.activeName),t.sensorStatusALLList=e.data})).catch((function(){}))},filterList:function(t,e){var s=this,n=t.filter((function(t){return t.sensorType===e}));return""!=this.queryParams.sensorName&&null!=this.queryParams.sensorName?n.filter((function(t){return t.sensorName.indexOf(s.queryParams.sensorName)>=0})):n},sensorStatusDelete:function(t){var e=this,s={};s.token=this.usertoken,s.sensorId=t.sensorId,s.productId=this.queryParams.productId,s.type="delete",this.$modal.confirm(this.$t("qdyscm")).then((function(){Object(a["i"])(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.productId=this.queryParams.productId,s.type="reset",this.$modal.confirm(this.$t("qryfwm")).then((function(){Object(a["i"])(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.productId=this.queryParams.productId,s.type="release",this.$modal.confirm(this.$t("qrysfm")).then((function(){Object(a["i"])(s)})).then((function(){e.querySensorStatusMonitoring(),e.$modal.msgSuccess(e.$t("zxcg"))})).catch((function(){}))},sensorStatusUpdate:function(t){"RS485"==t.cgqtd?this.showClass=!0:this.showClass=!1,this.sensorStatusForm=t,this.sensorStatusOpen=!0,this.sensorStatusTitle=this.$t("pz")},sensorStatusHandleCommand:function(t,e){var s=this,n={};switch(n.token=this.usertoken,n.sensorId=e.sensorId,n.productId=this.queryParams.productId,t){case"sensorStatusopen":n.type="open",this.$modal.confirm(this.$t("qrykqm")).then((function(){Object(a["i"])(n)})).then((function(){s.$modal.msgSuccess(s.$t("zxcg")),s.querySensorStatusMonitoring()})).catch((function(){}));break;case"sensorStatusclose":n.type="close",this.$modal.confirm(this.$t("qrygbm")).then((function(){Object(a["i"])(n)})).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.productId=t.queryParams.productId,s.sensorName=t.sensorStatusForm.sensorName,"RS485"==t.sensorStatusForm.cgqtd&&(s.sensorAddr=t.sensorStatusForm.sensorAddr),s.cgqtd=t.sensorStatusForm.cgqtd;var n=t;t.$modal.confirm(t.$t("qdybcm")).then((function(){void 0!=n.sensorStatusForm.sensorId&&""!=n.sensorStatusForm.sensorId?(n.loading=!0,s.type="update",Object(a["i"])(s).then((function(t){n.$modal.msgSuccess(n.$t("xgcg")),n.sensorStatusOpen=!1,n.querySensorStatusMonitoring(),n.loading=!1}))):(n.loading=!0,s.type="add",Object(a["i"])(s).then((function(t){n.$modal.msgSuccess(n.$t("xzcg")),n.sensorStatusOpen=!1,n.querySensorStatusMonitoring(),n.loading=!1})))})).then((function(){})).catch((function(){}))}}))},sensorStatusCancel:function(){this.sensorStatusOpen=!1},handleClick:function(t,e){this.activeName=t.name,this.querySensorStatusMonitoring()},getList:function(){var t=this;getServer().then((function(e){t.server=e.data}))},submitForm:function(){var t=this;this.$refs["form"].validate((function(e){if(e){var s={};s.token=t.usertoken,s.type="save",s.productChName=t.form.productChName,s.productChId=t.form.productChId,s.productId=t.queryParams.productId,s.ChannelLoadType=t.form.ChannelLoadType,t.loading=!0,channelStatusMonitoring(s).then((function(e){t.open=!1,t.queryChannelStatus()}))}}))},cancel:function(){this.open=!1},handleUpdate:function(t){this.form=t,this.open=!0,this.title=this.$t("xg")},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,n={};switch(n.token=this.usertoken,n.productChId=e.productChId,n.productId=this.queryParams.productId,t){case"channelopen":n.type="open",this.$modal.confirm(this.$t("qrykqm")).then((function(){channelStatusMonitoring(n)})).then((function(){s.$modal.msgSuccess(s.$t("zxcg"))})).catch((function(){}));break;case"channelclose":n.type="close",this.$modal.confirm(this.$t("qrygbm")).then((function(){channelStatusMonitoring(n)})).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"))}}},i=r,l=(s("5124"),s("c095"),s("2877")),u=Object(l["a"])(i,n,o,!1,null,"c5c57d28",null);e["default"]=u.exports},c095:function(t,e,s){"use strict";s("de09")},de09:function(t,e,s){}}]);
|