chunk-3abf8ea8.13586eee.js 19 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-3abf8ea8"],{"02bc":function(t,e,s){},3920:function(t,e,s){"use strict";s("02bc")},4763:function(t,e,s){"use strict";s.r(e);var o=function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"app-container"},[s("el-row",[s("el-col",{staticClass:"card-box",attrs:{span:24}},[s("el-card",[s("div",{attrs:{slot:"header"},slot:"header"},[s("span",{staticStyle:{"font-size":"20px","font-weight":"bold"}},[s("i",{staticClass:"el-icon-cpu"}),t._v(" 总体状态监控")]),s("span",{staticStyle:{"margin-left":"60px"}},[s("el-button",{attrs:{type:"primary"},nativeOn:{click:function(e){return e.preventDefault(),t.queryTotalStatus(e)}}},[t._v(" "+t._s(t.$t("cx")))])],1),s("span",{staticStyle:{"margin-left":"10px"}},[s("el-button",{attrs:{type:"primary"},nativeOn:{click:function(e){return e.preventDefault(),t.totalopen(e)}}},[t._v(" "+t._s(t.$t("zk")))])],1),s("span",{staticStyle:{"margin-left":"10px"}},[s("el-button",{attrs:{type:"primary"},nativeOn:{click:function(e){return e.preventDefault(),t.totalclose(e)}}},[t._v(" "+t._s(t.$t("zg")))])],1)]),s("div",{staticClass:"el-table el-table--enable-row-hover el-table--medium"},[s("el-row",{attrs:{span:24}},[s("el-col",{attrs:{span:4}},[s("div",{staticClass:"row-item"},[s("div",{staticClass:"row-item-title"},[t._v("总电压(V): ")]),s("div",{staticClass:"row-item-content"},[t._v(t._s(t.totalStatus.totalVoltage))])])]),s("el-col",{attrs:{span:4}},[s("div",{staticClass:"row-item"},[s("div",{staticClass:"row-item-title"},[t._v("总电流(A): ")]),s("div",{staticClass:"row-item-content"},[t._v(t._s(t.totalStatus.totalCurrent))])])]),s("el-col",{attrs:{span:4}},[s("div",{staticClass:"row-item"},[s("div",{staticClass:"row-item-title"},[t._v("总功率(W): ")]),s("div",{staticClass:"row-item-content"},[t._v(t._s(t.totalStatus.totalPower))])])]),s("el-col",{attrs:{span:4}},[s("div",{staticClass:"row-item"},[s("div",{staticClass:"row-item-title"},[t._v("频率(仅交流,HZ):")]),s("div",{staticClass:"row-item-content"},[t._v(t._s(t.totalStatus.productChPowerFreq))])])]),s("el-col",{attrs:{span:4}},[s("div",{staticClass:"row-item"},[s("div",{staticClass:"row-item-title"},[t._v("总耗电量(kWh): ")]),s("div",{staticClass:"row-item-content"},[t._v(t._s(t.totalStatus.productChConsumption))])])]),s("el-col",{attrs:{span:4}},[s("div",{staticClass:"row-item"},[s("div",{staticClass:"row-item-title"},[t._v("功率因数(仅交流): ")]),s("div",{staticClass:"row-item-content"},[t._v(t._s(t.totalStatus.productChPowerFactor))])])])],1)],1)])],1),s("el-col",{staticClass:"card-box",attrs:{span:24}},[s("el-card",[s("div",{attrs:{slot:"header"},slot:"header"},[s("span",{staticStyle:{"font-size":"20px","font-weight":"bold"}},[s("i",{staticClass:"el-icon-cpu"}),t._v(" 通道状态监控")]),s("span",{staticStyle:{"margin-left":"60px"}},[s("el-button",{attrs:{type:"primary"},nativeOn:{click:function(e){return e.preventDefault(),t.queryChannelStatus(e)}}},[t._v(" "+t._s(t.$t("cx")))])],1)]),s("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],attrs:{"max-height":"220",data:t.channelList}},[s("el-table-column",{attrs:{label:this.$t("tdmc"),prop:"productChName",width:"130"}}),s("el-table-column",{attrs:{label:this.$t("tdh"),prop:"productChId","show-overflow-tooltip":!0,width:"100"}}),s("el-table-column",{attrs:{label:this.$t("dy")+"(V)",prop:"productChVoltage","show-overflow-tooltip":!0,width:"100"}}),s("el-table-column",{attrs:{label:this.$t("dl")+"(A)",prop:"productChCurrent",width:"100"}}),s("el-table-column",{attrs:{label:this.$t("gl")+"(W)",prop:"productChPower",align:"center",width:"100"}}),s("el-table-column",{attrs:{label:this.$t("pl"),align:"center",prop:"productChPowerFreq",width:"180"}}),s("el-table-column",{attrs:{label:this.$t("hdl")+"(kWh)",align:"center",prop:"productChConsumption",width:"130"}}),s("el-table-column",{attrs:{label:this.$t("glys"),align:"center",prop:"productChPowerFactor",width:"180"}}),s("el-table-column",{attrs:{label:this.$t("zt"),align:"center",prop:"productChStatus",width:"100"}}),s("el-table-column",{attrs:{label:this.$t("cz"),align:"center",width:"130","class-name":"small-padding fixed-width"},scopedSlots:t._u([{key:"default",fn:function(e){return[s("el-button",{attrs:{size:"mini",type:"text"},on:{click:function(s){return t.handleUpdate(e.row)}}},[t._v(t._s(t.$t("xg")))]),s("el-dropdown",{staticStyle:{"margin-left":"10px"},attrs:{size:"mini"},on:{command:function(s){return t.handleCommand(s,e.row)}}},[s("el-button",{staticStyle:{"margin-left":"10px"},attrs:{size:"mini",type:"text"}},[t._v("通道开/关")]),s("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},["离线"==e.row.productChStatus?s("el-dropdown-item",{staticStyle:{"margin-left":"10px"},attrs:{command:"channelopen"}},[t._v(t._s(t.$t("dk")))]):t._e(),"在线"==e.row.productChStatus?s("el-dropdown-item",{staticStyle:{"margin-left":"10px"},attrs:{command:"channelclose"}},[t._v(t._s(t.$t("gb")))]):t._e()],1)],1)]}}])})],1)],1)],1),s("el-col",{staticClass:"card-box",attrs:{span:24}},[s("el-card",[s("div",{attrs:{slot:"header"},slot:"header"},[s("span",{staticStyle:{"font-size":"20px","font-weight":"bold"}},[s("i",{staticClass:"el-icon-cpu"}),t._v(" 传感器状态监控")]),s("span",{staticStyle:{"margin-left":"60px"}},[s("el-button",{attrs:{type:"primary"},nativeOn:{click:function(e){return e.preventDefault(),t.querySensorStatusMonitoring(e)}}},[t._v(" "+t._s(t.$t("cx")))])],1),s("span",{staticStyle:{"margin-left":"10px"}},[s("el-button",{attrs:{type:"primary"},nativeOn:{click:function(e){return e.preventDefault(),t.sensorStatusAdd(e)}}},[t._v(" "+t._s(t.$t("xz")))])],1)]),s("div",{staticClass:"el-table el-table--enable-row-hover el-table--medium"},[s("el-tabs",{on:{"tab-click":t.handleClick},model:{value:t.activeName,callback:function(e){t.activeName=e},expression:"activeName"}},t._l(t.sensorStatusTabs,(function(e){return s("el-tab-pane",{key:e.sensorId,attrs:{label:e.sensorName,name:e.sensorName}},[s("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],attrs:{"max-height":"220",data:t.sensorStatusList}},[s("el-table-column",{attrs:{label:this.$t("cgqxh"),prop:"sensorId","show-overflow-tooltip":!0,width:"120"}}),s("el-table-column",{attrs:{label:this.$t("cgqmc"),prop:"sensorName","show-overflow-tooltip":!0,width:"130"}}),s("el-table-column",{attrs:{label:"COM"+this.$t("kh"),prop:"comSlogan",width:"100"}}),s("el-table-column",{attrs:{label:this.$t("dz"),prop:"sensorAddr",align:"center",width:"100"}}),s("el-table-column",{attrs:{label:this.$t("btl"),align:"center",prop:"sensorBaud",width:"100"}}),s("el-table-column",{attrs:{label:this.$t("ljzt"),align:"center",prop:"connectionStatus",width:"130"}}),"温湿度传感器"===e.sensorName?s("el-table-column",{attrs:{label:this.$t("wdz")+"(℃)",align:"center",prop:"temperatureValue",width:"130"}}):t._e(),"温湿度传感器"===e.sensorName?s("el-table-column",{attrs:{label:this.$t("sdz")+"(%)",align:"center",prop:"humidityValue",width:"130"}}):t._e(),"烟雾探测器"===e.sensorName?s("el-table-column",{attrs:{label:this.$t("bjzt"),align:"center",prop:"alarmStatus",width:"100"}}):t._e(),"水位探测器"===e.sensorName?s("el-table-column",{attrs:{label:this.$t("sqrzt"),align:"center",prop:"waterImmersionState",width:"100"}}):t._e(),"门禁传感器"===e.sensorName?s("el-table-column",{attrs:{label:this.$t("mjsfzt"),align:"center",prop:"accessControlStatus",width:"100"}}):t._e(),"专用气体传感器"===e.sensorName?s("el-table-column",{attrs:{label:this.$t("qtld"),align:"center",prop:"gasConcentration",width:"100"}}):t._e(),"气流气压传感器"===e.sensorName?s("el-table-column",{attrs:{label:this.$t("qlz")+"(m/s)",align:"center",prop:"airflowValue",width:"100"}}):t._e(),"气流气压传感器"===e.sensorName?s("el-table-column",{attrs:{label:this.$t("qyz")+"(MPa)",align:"center",prop:"airPressureValue",width:"100"}}):t._e(),s("el-table-column",{attrs:{label:this.$t("cz"),align:"center",width:"180","class-name":"small-padding fixed-width"},scopedSlots:t._u([{key:"default",fn:function(o){return[s("el-button",{attrs:{size:"mini",type:"text"},on:{click:function(e){return t.sensorStatusUpdate(o.row)}}},[t._v(t._s(t.$t("pz")))]),"烟雾探测器"===e.sensorName&&"报警"==o.row.alarmStatus&&"在线"==o.row.connectionStatus?s("el-button",{attrs:{size:"mini",type:"text"},on:{click:function(e){return t.issueInstructionsReset(o.row)}}},[t._v(t._s(t.$t("fw")))]):t._e(),"门禁传感器"===e.sensorName?s("el-button",{attrs:{size:"mini",type:"text"},on:{click:function(e){return t.issueInstructionsRelease(o.row)}}},[t._v(t._s(t.$t("sf")))]):t._e(),"空调红外控制器"===e.sensorName?s("el-dropdown",{staticStyle:{"margin-left":"10px"},attrs:{size:"mini"},on:{command:function(e){return t.sensorStatusHandleCommand(e,o.row)}}},[s("el-button",{staticStyle:{"margin-left":"10px"},attrs:{size:"mini",type:"text"}},[t._v(t._s(t.$t("gd")))]),s("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},["在线"==o.row.connectionStatus?s("el-dropdown-item",{staticStyle:{"margin-left":"10px"},attrs:{command:"sensorStatusclose"}},[t._v(t._s(t.$t("gb")))]):t._e(),"离线"==o.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(o.row)}}},[t._v(t._s(t.$t("sc")))])]}}],null,!0)})],1)],1)})),1)],1)])],1)],1),s("el-dialog",{attrs:{title:t.title,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:"600px","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:16}},[s("el-col",{attrs:{span:12}},[s("el-form-item",{attrs:{label:this.$t("xuh"),prop:"sensorId"}},["配置"==t.sensorStatusTitle?s("el-input",{attrs:{readonly:!0,disabled:!0},model:{value:t.sensorStatusForm.sensorId,callback:function(e){t.$set(t.sensorStatusForm,"sensorId",e)},expression:"sensorStatusForm.sensorId"}}):t._e(),"新增"==t.sensorStatusTitle?s("el-input",{model:{value:t.sensorStatusForm.sensorId,callback:function(e){t.$set(t.sensorStatusForm,"sensorId",e)},expression:"sensorStatusForm.sensorId"}}):t._e()],1)],1),s("el-col",{attrs:{span:12}},[s("el-form-item",{attrs:{label:this.$t("mc"),prop:"sensorName"}},[s("el-input",{model:{value:t.sensorStatusForm.sensorName,callback:function(e){t.$set(t.sensorStatusForm,"sensorName",e)},expression:"sensorStatusForm.sensorName"}})],1)],1),s("el-col",{attrs:{span:12}},[s("el-form-item",{attrs:{label:this.$t("lx"),prop:"sensorType"}},[s("el-input",{model:{value:t.sensorStatusForm.sensorType,callback:function(e){t.$set(t.sensorStatusForm,"sensorType",e)},expression:"sensorStatusForm.sensorType"}})],1)],1),s("el-col",{attrs:{span:12}},[s("el-form-item",{attrs:{label:"COM"+this.$t("kh"),prop:"comSlogan"}},[s("el-input",{model:{value:t.sensorStatusForm.comSlogan,callback:function(e){t.$set(t.sensorStatusForm,"comSlogan",e)},expression:"sensorStatusForm.comSlogan"}})],1)],1),s("el-col",{attrs:{span:12}},[s("el-form-item",{attrs:{label:this.$t("btl"),prop:"sensorBaud"}},[s("el-input",{model:{value:t.sensorStatusForm.sensorBaud,callback:function(e){t.$set(t.sensorStatusForm,"sensorBaud",e)},expression:"sensorStatusForm.sensorBaud"}})],1)],1),s("el-col",{attrs:{span:12}},[s("el-form-item",{attrs:{label:this.$t("ljzt")}},[s("el-select",{staticStyle:{width:"100%"},model:{value:t.sensorStatusForm.connectionStatus,callback:function(e){t.$set(t.sensorStatusForm,"connectionStatus",e)},expression:"sensorStatusForm.connectionStatus"}},t._l(t.connectionStatuss,(function(t){return s("el-option",{key:t,attrs:{label:t,value:t}})})),1)],1)],1),s("el-col",[s("el-form-item",{attrs:{label:this.$t("dz"),prop:"sensorAddr"}},[s("el-input",{model:{value:t.sensorStatusForm.sensorAddr,callback:function(e){t.$set(t.sensorStatusForm,"sensorAddr",e)},expression:"sensorStatusForm.sensorAddr"}})],1)],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)},n=[],a=s("7ba4"),r={name:"Server",data:function(){return{server:[],totalStatus:{},channelList:[],title:"",sensorStatusTitle:"",open:!1,form:{},sensorStatusForm:{},channelLoadTypes:["空调","服务器","交换机","路由器","计算机","显示器","灯","其他"],activeName:"温湿度传感器",sensorStatusTabs:[],sensorStatusOpen:!1,sensorStatusList:[]}},created:function(){this.queryTotalStatus(),this.queryChannelStatus(),this.querySensorStatusMonitoring()},methods:{sensorStatusAdd:function(){this.sensorStatusForm={},this.sensorStatusOpen=!0,this.sensorStatusTitle=this.$t("xz")},querySensorStatusMonitoring:function(){var t=this,e={token:"",type:"listQuery"};Object(a["j"])(e).then((function(e){t.sensorStatusTabs=e.data,t.sensorStatusList=e.data})).catch((function(){}))},sensorStatusDelete:function(t){var e=this,s={token:""};s.sensorId=t.sensorId,s.type="delete",this.$modal.confirm(this.$t("qdyscm")).then((function(){Object(a["j"])(s)})).then((function(){e.$modal.msgSuccess(e.$t("zxcg")),e.querySensorStatusMonitoring()})).catch((function(){}))},issueInstructionsReset:function(t){var e=this,s={token:""};s.sensorId=t.sensorId,s.type="reset",this.$modal.confirm(this.$t("qryfwm")).then((function(){Object(a["j"])(s)})).then((function(){e.$modal.msgSuccess(e.$t("zxcg")),e.querySensorStatusMonitoring()})).catch((function(){}))},issueInstructionsRelease:function(t){var e=this,s={token:""};s.sensorId=t.sensorId,s.type="release",this.$modal.confirm(this.$t("qrysfm")).then((function(){Object(a["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,o={token:""};switch(o.sensorId=e.sensorId,t){case"sensorStatusopen":o.type="open",this.$modal.confirm(this.$t("qrykqm")).then((function(){Object(a["j"])(o)})).then((function(){s.$modal.msgSuccess(s.$t("zxcg")),s.querySensorStatusMonitoring()})).catch((function(){}));break;case"sensorStatusclose":o.type="close",this.$modal.confirm(this.$t("qrygbm")).then((function(){Object(a["j"])(o)})).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={token:""};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(a["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(a["j"])(s).then((function(e){t.$modal.msgSuccess(t.$t("xzcg")),t.sensorStatusOpen=!1,t.querySensorStatusMonitoring(),t.loading=!1})))}}))},sensorStatusCancel:function(){this.sensorStatusOpen=!1},handleClick:function(t,e){console.log(t,e)},getList:function(){var t=this;Object(a["g"])().then((function(e){t.server=e.data}))},submitForm:function(){var t=this;this.$refs["form"].validate((function(e){if(e){var s={token:"",type:"save"};s.productChName=t.form.productChName,s.productChId=t.form.productChId,s.ChannelLoadType=t.form.ChannelLoadType,t.loading=!0,Object(a["c"])(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={token:"",type:"listQuery"};this.loading=!0,Object(a["c"])(e).then((function(e){t.channelList=e.data})).catch((function(){})),this.loading=!1},handleCommand:function(t,e){var s=this,o={token:""};switch(o.productChId=e.productChId,t){case"channelopen":o.type="open",this.$modal.confirm(this.$t("qrykqm")).then((function(){Object(a["c"])(o)})).then((function(){s.$modal.msgSuccess(s.$t("zxcg"))})).catch((function(){}));break;case"channelclose":o.type="close",this.$modal.confirm(this.$t("qrygbm")).then((function(){Object(a["c"])(o)})).then((function(){s.$modal.msgSuccess(s.$t("zxcg"))})).catch((function(){}));break;default:break}},queryTotalStatus:function(){var t=this,e={token:"",type:"listQuery"};Object(a["i"])(e).then((function(e){t.totalStatus=e.data[0]}))},totalopen:function(){var t=this,e={token:"",type:"open"};this.$modal.confirm(this.$t("qrykqm")).then((function(){Object(a["i"])(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={token:"",type:"close"};this.$modal.confirm(this.$t("qrykqm")).then((function(){Object(a["i"])(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=r,i=(s("3920"),s("2877")),c=Object(i["a"])(l,o,n,!1,null,"758342c4",null);e["default"]=c.exports}}]);