| 1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-6545ef94"],{8647:function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"a",(function(){return s}));var o=n("b775");function i(t){return Object(o["a"])({url:"/monitor/online/list",method:"get",params:t})}function s(t){return Object(o["a"])({url:"/monitor/online/"+t,method:"delete"})}},b3ad:function(t,e,n){"use strict";n.r(e);var o=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"app-container"},[n("el-row",{staticClass:"mb8",attrs:{gutter:10}},[n("el-col",{attrs:{span:1.5}},[n("el-button",{attrs:{type:"primary",plain:"",icon:"el-icon-plus",size:"mini"},on:{click:t.sensorStatusAdd}},[t._v(t._s(t.$t("xz")))])],1)],1),n("el-card",{staticStyle:{"min-height":"700px","border-radius":"15px"}},[n("el-table",{attrs:{"max-height":"700",data:t.channelList,"header-cell-style":{background:"#FFFFFF",color:"#000000"}}},[n("el-table-column",{attrs:{label:this.$t("fzh"),prop:"fzh","min-width":t.getStringWidth(t.$t("fzh")),"show-overflow-tooltip":!0}}),t._e(),n("el-table-column",{attrs:{label:this.$t("fzmc"),prop:"fzmc","min-width":t.getStringWidth(t.$t("fzmc")),"show-overflow-tooltip":!0}}),n("el-table-column",{attrs:{label:this.$t("tdhs"),prop:"tdhs","min-width":t.getStringWidth(t.$t("tdhs")),"show-overflow-tooltip":!0}}),n("el-table-column",{attrs:{label:this.$t("tdmcs"),prop:"tdmcs","min-width":t.getStringWidth(t.$t("tdmcs")),"show-overflow-tooltip":!0}}),n("el-table-column",{attrs:{label:this.$t("cz"),"min-width":t.getStringWidth(t.$t("cz")),align:"center","class-name":"small-padding fixed-width"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("el-button",{attrs:{size:"mini",type:"text",icon:"el-icon-edit"},on:{click:function(n){return t.handleUpdate(e.row)}}},[t._v(t._s(t.$t("xg")))]),0!=e.row.parentId?n("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["system:dept:remove"],expression:"['system:dept:remove']"}],attrs:{size:"mini",type:"text",icon:"el-icon-delete"},on:{click:function(n){return t.handleDelete(e.row)}}},[t._v(t._s(t.$t("sc")))]):t._e(),n("el-dropdown",{staticStyle:{"margin-left":"10px"},attrs:{size:"mini"},on:{command:function(n){return t.mqttCommand(n,e.row)}}},[n("el-button",{staticStyle:{"margin-left":"10px"},attrs:{icon:"el-icon-d-arrow-right",size:"mini",type:"text"}},[t._v(t._s(t.$t("gd")))]),n("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},[n("el-dropdown-item",{staticStyle:{"margin-left":"10px"},attrs:{command:"close"}},[t._v(t._s(t.$t("gb")))]),n("el-dropdown-item",{staticStyle:{"margin-left":"10px"},attrs:{command:"open"}},[t._v(t._s(t.$t("kq")))])],1)],1)]}}])})],1)],1),n("el-dialog",{attrs:{title:t.title,visible:t.open,width:"500px","close-on-click-modal":!1,"close-on-press-escape":!1,"append-to-body":""},on:{"update:visible":function(e){t.open=e}}},[n("el-form",{ref:"form",attrs:{model:t.form,rules:t.rules,"label-width":"auto"}},[n("el-form-item",{attrs:{label:this.$t("lx"),prop:"mode"}},[n("el-select",{staticStyle:{width:"100%"},attrs:{"allow-create":"",clearable:"",filterable:!1},on:{change:t.handleSelectChange},model:{value:t.form.mode,callback:function(e){t.$set(t.form,"mode",e)},expression:"form.mode"}},t._l(t.modes,(function(e){return n("el-option",{key:e.id,attrs:{label:t.$t(e.name),value:e.id}})})),1)],1),"0"==t.form.mode?n("el-form-item",{attrs:{label:this.$t("xlgs"),prop:"xlnumber"}},[n("el-input",{attrs:{type:"number"},model:{value:t.form.xlnumber,callback:function(e){t.$set(t.form,"xlnumber",e)},expression:"form.xlnumber"}})],1):t._e(),"1"==t.form.mode?n("el-form-item",{attrs:{label:this.$t("jggs"),prop:"jgnumber"}},[n("el-input",{attrs:{type:"number"},model:{value:t.form.jgnumber,callback:function(e){t.$set(t.form,"jgnumber",e)},expression:"form.jgnumber"}})],1):t._e()],1),n("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[n("el-button",{attrs:{type:"primary"},on:{click:t.submitForm}},[t._v(t._s(t.$t("qd")))]),n("el-button",{on:{click:t.cancel}},[t._v(t._s(t.$t("qx")))])],1)],1),n("el-dialog",{attrs:{title:t.title,visible:t.updateopen,width:"500px","close-on-click-modal":!1,"close-on-press-escape":!1,"append-to-body":""},on:{"update:visible":function(e){t.updateopen=e}}},[n("el-form",{ref:"form1",attrs:{model:t.form1,"label-width":"auto"}},[n("el-form-item",{attrs:{label:this.$t("fzmc"),prop:"fzmc"}},[n("el-input",{model:{value:t.form1.fzmc,callback:function(e){t.$set(t.form1,"fzmc",e)},expression:"form1.fzmc"}})],1),t._e()],1),n("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[n("el-button",{attrs:{type:"primary"},on:{click:t.submitForm2}},[t._v(t._s(t.$t("qd")))]),n("el-button",{on:{click:t.cancel2}},[t._v(t._s(t.$t("qx")))])],1)],1)],1)},i=[],s=n("8647"),r=n("7ba4"),a={name:"Online",data:function(){return{loading:!0,total:0,channelList:[],title:"",open:!1,updateopen:!1,form:{},form1:{},channelLoadTypes:["空调","服务器","交换机","路由器","计算机","显示器","灯","其他"],modes:[{id:"0",name:"xlfz"},{id:"1",name:"jgfz"}],queryParams:{serverName:"",productChId:"",token:"",type:""},usertoken:"",mode:"",mode2:"",rules:{mode:[{required:!0,message:this.$i18n.t("lx")+" "+this.$i18n.t("bnwk"),trigger:"blur"}],xlnumber:[{required:!0,message:this.$i18n.t("xlgs")+" "+this.$i18n.t("bnwk"),trigger:"blur"}],jgnumber:[{required:!0,message:this.$i18n.t("jggs")+" "+this.$i18n.t("bnwk"),trigger:"blur"}]}}},created:function(){this.usertoken=this.$store.state.user.usertoken,this.queryChannelStatus()},methods:{getStringWidth:function(t){var e="14px Arial",n=document.createElement("canvas"),o=n.getContext("2d");o.font=e;var i=o.measureText(t);return i.width+40},mqttCommand:function(t,e){var n=this,o={};switch(o.token=this.usertoken,o.fzh=e.fzh,t){case"open":o.type="fzOpen",this.$modal.confirm(this.$t("qrykqm")).then((function(){Object(r["k"])(o)})).then((function(){n.$modal.msgSuccess(n.$t("zxcg")),n.queryChannelStatus()})).catch((function(){}));break;case"close":o.type="fzClose",this.$modal.confirm(this.$t("qrygbm")).then((function(){Object(r["k"])(o)})).then((function(){n.$modal.msgSuccess(n.$t("zxcg")),n.queryChannelStatus()})).catch((function(){}));break;default:break}},changeMode:function(t){this.mode=t},handleSelectChange:function(t){this.form.mode=t},queryChannelStatus:function(){var t=this;this.queryParams.token=this.usertoken,this.queryParams.type="listFzQuery",this.loading=!0,Object(r["k"])(this.queryParams).then((function(e){null!=e.data&&(t.channelList=e.data)})).catch((function(){})),this.loading=!1},sensorStatusAdd:function(){this.form={},this.open=!0,this.title=this.$t("xz")},handleUpdate:function(t){this.form1=t,this.updateopen=!0,this.title=this.$t("xg")},handleQuery:function(){this.queryChannelStatus()},resetQuery:function(){this.resetForm("queryForm"),this.handleQuery()},handleCommand:function(t,e){var n=this,o={};switch(o.token=this.usertoken,o.productChId=e.productChId,t){case"channelopen":o.type="open",this.$modal.confirm(this.$t("qrykqm")).then((function(){channelStatusMonitoring(o)})).then((function(){n.$modal.msgSuccess(n.$t("zxcg"))})).catch((function(){}));break;case"channelclose":o.type="close",this.$modal.confirm(this.$t("qrygbm")).then((function(){channelStatusMonitoring(o)})).then((function(){n.$modal.msgSuccess(n.$t("zxcg"))})).catch((function(){}));break;default:break}},submitForm:function(){var t=this;this.$refs["form"].validate((function(e){if(e){var n={};n.token=t.usertoken,n.type="fzSave",n.fzmc=t.form.fzmc,n.mode=t.form.mode,n.xlnumber=t.form.xlnumber,n.jgnumber=t.form.jgnumber,t.loading=!0;var o=t;t.$modal.confirm(t.$t("qdybcm")).then((function(){Object(r["k"])(n).then((function(t){o.open=!1,o.queryChannelStatus()}))})).then((function(){t.$modal.msgSuccess(t.$t("zxcg"))})).catch((function(){}))}}))},submitForm2:function(){var t=this,e={};e.token=this.usertoken,e.type="updateFz",e.fzh=this.form1.fzh,e.fzmc=this.form1.fzmc,this.loading=!0;var n=this;this.$modal.confirm(this.$t("qdybcm")).then((function(){Object(r["k"])(e).then((function(t){n.updateopen=!1,n.queryChannelStatus()}))})).then((function(){t.$modal.msgSuccess(t.$t("zxcg"))})).catch((function(){}))},handleDelete:function(t){var e=this,n={};n.token=this.usertoken,n.type="deleteFz",n.fzh=t.fzh;var o=this;this.$modal.confirm(this.$t("qdyscm")).then((function(){return Object(r["k"])(n)})).then((function(){o.$modal.msgSuccess(e.$t("sccg")),o.queryChannelStatus()})).catch((function(){}))},cancel:function(){this.open=!1,this.queryChannelStatus()},cancel2:function(){this.updateopen=!1,this.queryChannelStatus()},handleForceLogout:function(t){var e=this;this.$modal.confirm(this.$t("sfqztc")+t.userName+this.$t("yhm")).then((function(){return Object(s["a"])(t.tokenId)})).then((function(){e.getList(),e.$modal.msgSuccess(e.$t("qtcg"))})).catch((function(){}))}}},l=a,c=n("2877"),m=Object(c["a"])(l,o,i,!1,null,null,null);e["default"]=m.exports}}]);
|