| 1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-171ee19a"],{"073c":function(t,e,o){"use strict";o.r(e);var r=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",{staticClass:"app-container"},[o("el-form",{ref:"queryForm",attrs:{model:t.queryParams,size:"small",inline:!0,"label-width":"auto"}},[o("el-form-item",{attrs:{label:this.$t("sbmc"),prop:"productName"}},[o("el-select",{staticStyle:{width:"100%"},attrs:{"allow-create":"",filterable:!1},model:{value:t.queryParams.productId,callback:function(e){t.$set(t.queryParams,"productId",e)},expression:"queryParams.productId"}},t._l(t.productList,(function(t){return o("el-option",{key:t.productId,attrs:{label:t.productName,value:t.productId}})})),1)],1),o("el-form-item",[o("el-button",{attrs:{type:"primary",icon:"el-icon-search",size:"mini"},on:{click:t.handleQuery}},[t._v(t._s(t.$t("ss")))])],1),o("el-form-item",{staticStyle:{position:"absolute",right:"0%","margin-right":"5%"}},[o("el-button",{staticStyle:{"background-color":"#656B8B"},attrs:{type:"primary",size:"mini"},on:{click:t.sensorStatusAdd}},[t._v(t._s(t.$t("tj")))])],1)],1),o("el-card",{staticStyle:{"min-height":"700px","border-radius":"15px"}},[o("el-table",{attrs:{"max-height":"700",data:t.swithList,"header-cell-style":{background:"#FFFFFF",color:"#000000"}}},[o("el-table-column",{attrs:{label:this.$t("sbmc"),prop:"productName"}}),t._e(),o("el-table-column",{attrs:{label:this.$t("kgbh"),prop:"switchId"}}),o("el-table-column",{attrs:{label:this.$t("kgmc"),prop:"switchName"}}),o("el-table-column",{attrs:{label:this.$t("cjdz"),prop:"cjdz"}}),o("el-table-column",{attrs:{label:this.$t("jdh"),prop:"jdh"}}),o("el-table-column",{attrs:{label:this.$t("kztdlb"),prop:"productChIds","show-overflow-tooltip":!0}}),o("el-table-column",{attrs:{label:this.$t("zt"),align:"center",prop:"switchStatus"},scopedSlots:t._u([{key:"default",fn:function(e){return["0"==e.row.switchStatus?o("span",{staticStyle:{color:"red"}},[t._v(t._s(t.getDity(e.row,"switchStatus")))]):"1"==e.row.switchStatus?o("span",{staticStyle:{color:"green"}},[t._v(t._s(t.getDity(e.row,"switchStatus")))]):o("span",{staticStyle:{color:"#c747b1"}},[t._v(t._s(t.getDity(e.row,"switchStatus")))])]}}])}),o("el-table-column",{attrs:{label:this.$t("cz"),align:"center","class-name":"small-padding fixed-width"},scopedSlots:t._u([{key:"default",fn:function(e){return[o("el-button",{attrs:{size:"mini",type:"text"},on:{click:function(o){return t.handleUpdate(e.row)}}},[t._v(t._s(t.$t("pz")))]),o("el-button",{staticStyle:{color:"#586EAD"},attrs:{size:"mini",type:"text"},on:{click:function(o){return t.handleDelete(e.row)}}},[t._v(t._s(t.$t("sc")))])]}}])})],1)],1),o("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}}},[o("el-form",{ref:"form",attrs:{model:t.form,"label-width":"150px"}},[o("el-form-item",{staticStyle:{display:"none"},attrs:{label:"产品ID:",prop:"productId"}},[o("el-input",{attrs:{readonly:!0,disabled:!0},model:{value:t.form.productId,callback:function(e){t.$set(t.form,"productId",e)},expression:"form.productId"}})],1),o("el-form-item",{staticStyle:{display:"none"},attrs:{label:this.$t("kgbh"),prop:"switchId"}},[o("el-input",{attrs:{readonly:!0,disabled:!0},model:{value:t.form.switchId,callback:function(e){t.$set(t.form,"switchId",e)},expression:"form.switchId"}})],1),o("el-form-item",{attrs:{label:this.$t("cjfs")}},[o("el-select",{staticStyle:{width:"100%"},attrs:{"allow-create":"",clearable:"",filterable:""},model:{value:t.form.cjfs,callback:function(e){t.$set(t.form,"cjfs",e)},expression:"form.cjfs"}},t._l(t.cjfss,(function(t){return o("el-option",{key:t,attrs:{label:t,value:t}})})),1)],1),o("el-form-item",{attrs:{label:"COM "+this.$t("kh"),prop:"comkh"}},[o("el-input",{model:{value:t.form.comkh,callback:function(e){t.$set(t.form,"comkh",e)},expression:"form.comkh"}})],1),o("el-form-item",{attrs:{label:this.$t("cjdz"),prop:"cjdz"}},[o("el-input",{model:{value:t.form.cjdz,callback:function(e){t.$set(t.form,"cjdz",e)},expression:"form.cjdz"}})],1),o("el-form-item",{attrs:{label:this.$t("jdh"),prop:"jdh"}},[o("el-input",{model:{value:t.form.jdh,callback:function(e){t.$set(t.form,"jdh",e)},expression:"form.jdh"}})],1),o("el-form-item",{attrs:{label:this.$t("td"),prop:"productChIds"}},[o("el-select",{staticStyle:{width:"100%"},attrs:{clearable:"",multiple:""},model:{value:t.form.productChIds,callback:function(e){t.$set(t.form,"productChIds",e)},expression:"form.productChIds"}},t._l(t.channelList,(function(t){return o("el-option",{key:t.productChId,attrs:{label:t.productChName,value:t.productChId}})})),1)],1)],1),o("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[o("el-button",{attrs:{type:"primary"},on:{click:t.submitForm}},[t._v(t._s(t.$t("qd")))]),o("el-button",{on:{click:t.cancel}},[t._v(t._s(t.$t("qx")))])],1)],1),o("el-dialog",{attrs:{title:t.title1,visible:t.open1,width:"500px","close-on-click-modal":!1,"close-on-press-escape":!1,"append-to-body":""},on:{"update:visible":function(e){t.open1=e}}},[o("el-form",{ref:"form1",attrs:{model:t.form1,rules:t.rules1,"label-width":"120px"}},[o("el-form-item",{staticStyle:{display:"none"},attrs:{label:"产品ID:",prop:"productId"}},[o("el-input",{attrs:{readonly:!0,disabled:!0},model:{value:t.form1.productId,callback:function(e){t.$set(t.form1,"productId",e)},expression:"form1.productId"}})],1),o("el-form-item",{attrs:{label:this.$t("kgbh"),prop:"switchId"}},[o("el-input",{attrs:{readonly:!0,disabled:!0},model:{value:t.form1.switchId,callback:function(e){t.$set(t.form1,"switchId",e)},expression:"form1.switchId"}})],1),o("el-form-item",{attrs:{label:this.$t("kgmc"),prop:"switchName"}},[o("el-input",{model:{value:t.form1.switchName,callback:function(e){t.$set(t.form1,"switchName",e)},expression:"form1.switchName"}})],1),o("el-form-item",{attrs:{label:this.$t("td")}},[o("el-select",{staticStyle:{width:"100%"},attrs:{clearable:"",multiple:""},model:{value:t.form1.productChIds,callback:function(e){t.$set(t.form1,"productChIds",e)},expression:"form1.productChIds"}},t._l(t.channelList,(function(t){return o("el-option",{key:t.productChId,attrs:{label:t.productChName,value:t.productChId}})})),1)],1)],1),o("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[o("el-button",{attrs:{type:"primary"},on:{click:t.submitForm1}},[t._v(t._s(t.$t("qd")))]),o("el-button",{on:{click:t.cancel1}},[t._v(t._s(t.$t("qx")))])],1)],1)],1)},s=[],n=(o("a15b"),o("14d9"),o("a434"),o("b0c0"),o("e9c4"),o("b64b"),o("d3b7"),o("8647")),i=o("7ba4"),a={name:"Online",data:function(){return{loading:!0,total:0,channelList:[],swithList:[],title:"",open:!1,title1:"",open1:!1,sortnoOpen:!1,form:{},form1:{},sortnoForm:{},modes:[{id:"0",name:"gb"},{id:"1",name:"kq"}],switchStatuss:[{id:"0",name:"duank"},{id:"1",name:"jt"},{id:"-1",name:"lix"}],queryParams:{productChName:"",productChId:"",token:"",type:""},productType:"",usertoken:"",tableData:[],tableProps:[{prop:"sortno",isShow:!0,label:"序号",width:"55",minWidth:"100",align:"center",type:"index"},{prop:"productChId",isShow:!0,label:"通道号",width:"150",minWidth:"100",align:"center",type:"index"},{prop:"productChName",isShow:!0,label:"通道名称",width:"",minWidth:"100",align:"center"},{prop:"status",isShow:!0,label:"状态",width:"",minWidth:"100",align:"center"}],productList:[],rules:{switchName:[{required:!0,message:this.$i18n.t("bnwk"),trigger:"blur"}],productChIds:[{required:!0,message:this.$i18n.t("bnwk"),trigger:"blur"}]},rules1:{switchName:[{required:!0,message:this.$i18n.t("bnwk"),trigger:"blur"}]},cjfss:["RS485","DI"]}},mounted:function(){this.$bus.$on("SWITH_STATUS_MONITORING",this.switchEquipmentMintenance)},created:function(){this.usertoken=this.$store.state.user.usertoken,this.queryProductList()},methods:{switchEquipmentMintenance:function(t){if(t.success){var e=t.data.data;if(null!=t.data&&""!=e&&null!=e){for(var o=[],r=0;r<e.length;r++){var s=e[r];s.productId==this.queryParams.productId&&o.push(s)}this.swithList=o}}},getDity:function(t,e){var o="",r="",s=[];"productChStatus"==e?(s=this.productChStatuss,r=t.productChStatus):"alarmStatus"==e?(s=this.alarmStatuss,r=t.alarmStatus):"connectionStatus"==e?(s=this.connectionStatuss,r=t.connectionStatus):"waterImmersionState"==e||"waterImmersionState"==e?(s=this.waterImmersionStates,r=t.waterImmersionState):"productPhOrders"==e?(s=this.productPhOrders,r=t.productPhOrder):"outputTypes"==e?(s=this.outputTypes,r=t.outputType):"switchStatus"==e&&(s=this.switchStatuss,r=t.switchStatus);for(var n=0;n<s.length;n++){var i=s[n];if(r==i.id)return o=i.name,this.$t(i.name)}return o},sortByfiring:function(t,e){var o=t.deadline,r=e.deadline;return console.log("--\x3esortByfiring"),console.log(o),console.log(r),console.log("--\x3esortByfiring"),o-r},sortByClose:function(t,e){var o=t.deadline,r=e.deadline;return console.log("--\x3esortByClose"),console.log(o),console.log(r),console.log("--\x3esortByClose"),o-r},queryProductList:function(){var t=this,e={};e.token=this.usertoken,e.type="listKgSbQuery",Object(i["f"])(e).then((function(e){null!=e.data&&(t.productList=e.data,t.queryParams.productId=t.productList[0].productId,t.productType=t.productList[0].productType,t.handleQuery())})).catch((function(){}))},handleAdd:function(){this.sortnoOpen=!0},moveUp:function(t,e){if(t>0){var o=this.tableData[t-1];this.tableData.splice(t-1,1),this.tableData.splice(t,0,o)}else alert("已经是第一条,不可上移")},moveDown:function(t,e){if(t+1===this.tableData.length)alert("已经是最后一条,不可下移");else{var o=this.tableData[t+1];this.tableData.splice(t+1,1),this.tableData.splice(t,0,o)}},handleSelectChange:function(t){var e=this;this.queryParams.token=this.usertoken,this.queryParams.type="listSortnoQuery",Object(i["k"])(this.queryParams).then((function(t){e.tableData=t.data})).catch((function(){}))},queryChannelStatus:function(){var t=this;this.queryParams.token=this.usertoken,this.queryParams.type="listSwitchtatusQuery",this.loading=!0,Object(i["f"])(this.queryParams).then((function(e){null!=e.data&&void 0!=e.data&&(t.swithList=e.data)})).catch((function(){}));var e={type:"listQuery"};e.token=this.usertoken,e.productId=this.queryParams.productId,Object(i["c"])(e).then((function(e){if(null!=e.data)if("3"==t.productType){for(var o,r=[],s=function(){o=e.data[n];var t={};t.productChId=o.productChId,t.productChName=o.productChName;var s=r.some((function(e){return e.productChId===t.productChId}));s||r.push(t)},n=0;n<e.data.length;n++)s();t.channelList=r}else t.channelList=e.data})).catch((function(){})),this.loading=!1},handleUpdate:function(t){this.form1=JSON.parse(JSON.stringify(t)),this.form1.productChIds=t.productChIds.split(","),this.open1=!0,this.title1=this.$t("pz")},handleDelete:function(t){var e={};e.token=this.usertoken,e.type="switchDelete",e.productId=t.productId,e.switchId=t.switchId;var o=this;this.$modal.confirm(this.$t("qdyscm")).then((function(){Object(i["f"])(e).then((function(t){o.$modal.msgSuccess(o.$t("zxcg")),o.handleQuery()}))})).then((function(){})).catch((function(){}))},handleQuery:function(){this.queryChannelStatus()},resetQuery:function(){this.resetForm("queryForm"),this.handleQuery()},handleCommand:function(t,e){var o=this,r={};switch(r.token=this.usertoken,r.productChId=e.productChId,t){case"channelopen":r.type="open",this.$modal.confirm(this.$t("qrykqm")).then((function(){Object(i["c"])(r)})).then((function(){o.$modal.msgSuccess(o.$t("zxcg"))})).catch((function(){}));break;case"channelclose":r.type="close",this.$modal.confirm(this.$t("qrygbm")).then((function(){Object(i["c"])(r)})).then((function(){o.$modal.msgSuccess(o.$t("zxcg"))})).catch((function(){}));break;default:break}},submitForm:function(){var t=this;this.$refs["form"].validate((function(e){if(e){var o={};if(o.token=t.usertoken,o.type="switchSave",null==t.form.productChIds||void 0==t.form.productChIds||""==t.form.productChIds)return void t.$modal.msgWarning(t.$t("td")+" "+t.$i18n.t("bnwk"));o.productChIds=t.form.productChIds.join(","),o.cjfs=t.form.cjfs,o.productChId=t.form.productChId,o.comkh=t.form.comkh,o.cjdz=t.form.cjdz,o.jdh=t.form.jdh,o.productId=t.form.productId,t.loading=!0;var r=t;t.$modal.confirm(t.$t("qdybcm")).then((function(){Object(i["f"])(o).then((function(t){r.$modal.msgSuccess(r.$t("zxcg")),r.handleQuery()}))})).then((function(){t.open=!1})).catch((function(){}))}}))},cancel:function(){this.open=!1,this.handleQuery()},submitForm1:function(){var t=this;this.$refs["form1"].validate((function(e){if(e){var o={};if(o.token=t.usertoken,o.type="switchUpdate",null==t.form1.productChIds||void 0==t.form1.productChIds||""==t.form1.productChIds)return void t.$modal.msgWarning(t.$t("td")+" "+t.$i18n.t("bnwk"));o.productChIds=t.form1.productChIds.join(","),o.productId=t.form1.productId,o.switchName=t.form1.switchName,o.switchId=t.form1.switchId,t.loading=!0;var r=t;t.$modal.confirm(t.$t("qdybcm")).then((function(){Object(i["f"])(o).then((function(t){r.$modal.msgSuccess(r.$t("zxcg")),r.handleQuery()}))})).then((function(){t.open1=!1})).catch((function(){}))}}))},cancel1:function(){this.open1=!1,this.handleQuery()},sortnoSave:function(){var t=this.tableData;if(0!=this.tableData.length){var e={};e.token=this.usertoken,e.type="sortnoSave";for(var o=0;o<t.length;o++){var r=t[o];r.sortno=o+1}e.sortnoList=JSON.stringify(t),this.$modal.confirm(this.$t("qdybcpx")).then((function(){var t=this;Object(i["k"])(e).then((function(e){t.sortnoOpen=!1,t.queryChannelStatus()}))})).then((function(){})).catch((function(){}))}else this.$modal.msgSuccess(this.$t("zxcg"))},sortnoCancel:function(){this.sortnoOpen=!1,this.handleQuery()},handleForceLogout:function(t){var e=this;this.$modal.confirm(this.$t("sfqztc")+t.userName+this.$t("yhm")).then((function(){return Object(n["a"])(t.tokenId)})).then((function(){e.getList(),e.$modal.msgSuccess(e.$t("qtcg"))})).catch((function(){}))},sensorStatusAdd:function(){this.form={},this.form.productId=this.queryParams.productId,this.open=!0,this.title=this.$t("xz")}}},c=a,l=o("2877"),u=Object(l["a"])(c,r,s,!1,null,null,null);e["default"]=u.exports},8647:function(t,e,o){"use strict";o.d(e,"b",(function(){return s})),o.d(e,"a",(function(){return n}));var r=o("b775");function s(t){return Object(r["a"])({url:"/monitor/online/list",method:"get",params:t})}function n(t){return Object(r["a"])({url:"/monitor/online/"+t,method:"delete"})}}}]);
|