chunk-0c0a0e11.1f7f96ff.js 11 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-0c0a0e11"],{"3f45":function(t,e,o){"use strict";o("cee6")},8647:function(t,e,o){"use strict";o.d(e,"b",(function(){return i})),o.d(e,"a",(function(){return n}));var a=o("b775");function i(t){return Object(a["a"])({url:"/monitor/online/list",method:"get",params:t})}function n(t){return Object(a["a"])({url:"/monitor/online/"+t,method:"delete"})}},"8bb5":function(t,e,o){"use strict";o.r(e);var a=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",{staticStyle:{width:"400px"},attrs:{label:this.$t("kzbgj"),prop:"fileName"}},[o("el-input",{staticStyle:{width:"300px"},attrs:{readonly:!0,disabled:!0},model:{value:t.fileName,callback:function(e){t.fileName=e},expression:"fileName"}})],1),o("el-form-item",[o("el-button",{staticStyle:{"border-radius":"10px","background-color":"#0E35FF","margin-left":"10px"},attrs:{type:"primary","min-width":t.getStringWidth(t.$t("gjxz"))},on:{click:t.handleImport}},[t._v(t._s(t.$t("gjxz")))]),o("el-button",{staticStyle:{"border-radius":"10px","background-color":"#0E35FF","margin-left":"10px"},attrs:{type:"primary","min-width":t.getStringWidth(t.$t("plsj"))},on:{click:t.handleUpdateAll}},[t._v(t._s(t.$t("plsj")))])],1)],1),o("el-card",{staticStyle:{"min-height":"700px","border-radius":"15px"}},[o("el-table",{ref:"multipleTable",attrs:{"max-height":"700",data:t.channelList,"row-key":t.rowKey,"header-cell-style":{background:"#FFFFFF",color:"#000000"}},on:{"selection-change":t.handleSelectionChange}},[o("el-table-column",{attrs:{type:"selection",width:"55",align:"center","reserve-selection":!0}}),o("el-table-column",{attrs:{align:"center",label:this.$t("sbmc"),prop:"productName"}}),o("el-table-column",{attrs:{align:"center",label:"产品ID",prop:"productId"}}),o("el-table-column",{attrs:{align:"center",label:this.$t("kzbh"),prop:"productNumber"}}),o("el-table-column",{attrs:{align:"center",label:this.$t("tdsl"),prop:"productChNumber","show-overflow-tooltip":!0}}),o("el-table-column",{attrs:{align:"center",label:this.$t("gjbbh"),prop:"productVersion","show-overflow-tooltip":!0}}),o("el-table-column",{attrs:{align:"center",label:this.$t("gjrq"),prop:"upgradeDate","show-overflow-tooltip":!0}}),o("el-table-column",{attrs:{align:"center",label:this.$t("dqzt"),prop:"status","show-overflow-tooltip":!0},scopedSlots:t._u([{key:"default",fn:function(e){return["0"==e.row.status||"4"==e.row.status?o("span",{staticStyle:{color:"red"}},[t._v(t._s(t.getDity(e.row,"status")))]):"1"==e.row.status||"3"==e.row.status?o("span",{staticStyle:{color:"green"}},[t._v(t._s(t.getDity(e.row,"status")))]):o("span",{staticStyle:{color:"#FFD966"}},[t._v(t._s(t.getDity(e.row,"status")))])]}}])}),o("el-table-column",{attrs:{label:this.$t("cz"),align:"center","class-name":"smfirmwareDateall-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("sej")))])]}}])})],1)],1),o("el-dialog",{attrs:{title:t.upload.title,visible:t.upload.open,width:"400px","close-on-click-modal":!1,"close-on-press-escape":!1,"append-to-body":""},on:{"update:visible":function(e){return t.$set(t.upload,"open",e)}}},[o("el-form",{ref:"form",staticClass:"left-align-form",attrs:{model:t.form,"label-width":"auto"}},[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)],1),o("el-upload",{ref:"upload",attrs:{limit:1,action:t.upload.url+"?productId="+this.productId+"&type=importData&token="+this.usertoken,disabled:t.upload.isUploading,"on-change":t.beforeUpload,"on-progress":t.handleFileUploadProgress,"on-success":t.handleFileSuccess,"auto-upload":!1,drag:""}},[o("i",{staticClass:"el-icon-upload"}),o("div",{staticClass:"el-upload__text"},[t._v(t._s(t.$t("drts"))),o("em",[t._v(t._s(t.$t("djsc")))])])]),o("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[o("el-button",{attrs:{type:"primary"},on:{click:t.submitFileForm}},[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",{staticClass:"dialogClass",staticStyle:{"overflow-y":"auto"},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-col",{staticStyle:{height:"500px","overflow-y":"auto"}},[o("el-card",[o("el-collapse",{attrs:{accordion:""},model:{value:t.activeNames,callback:function(e){t.activeNames=e},expression:"activeNames"}},t._l(t.hisData,(function(e,a){return o("el-collapse-item",{attrs:{name:a,title:e.productVersion+" - "+e.versionDate}},[o("li",[t._v(t._s(e.updateContent))])])})),1)],1)],1)],1)],1)},i=[],n=(o("a15b"),o("d81d"),o("b0c0"),o("8647")),l=o("7ba4"),s={name:"Online",data:function(){return{loading:!0,total:0,channelList:[],title:"",open:!1,sortnoOpen:!1,form:{},sortnoForm:{},modes:["开启","关闭"],queryParams:{productName:"",productNumber:"",token:"",type:""},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:[],upload:{open:!1,title:"",isUploading:!1,url:window.location.origin+"/pdu/controlBoardUpgradeUpload"},productChTypes:[{id:"1",name:"sblx1"},{id:"2",name:"sblx2"},{id:"3",name:"sblx3"},{id:"4",name:"sblx4"},{id:"5",name:"sblx5"}],statuss:[{id:"0",name:"lix"},{id:"1",name:"zx"},{id:"2",name:"sjz"},{id:"3",name:"sjcg"},{id:"4",name:"sjsb"}],hisData:[],activeNames:[],productId:"",file:null,fileName:"",validate:""}},mounted:function(){this.$bus.$on("CONTROL_BOARD_UPGRADE",this.onSocketMessageToUpgrade)},created:function(){console.log(window.location.origin),this.usertoken=this.$store.state.user.usertoken,this.handleQuery()},methods:{rowKey:function(t){return t.productId},dataRefreh:function(){var t=this;setInterval((function(){var e=[{productVersion:"V0.0.41",productId:"2024245-1",productChNumber:"33",productNumber:1,upgradeDate:"2024.09.24",productName:"PDU",status:Math.random()<.5?0:1},{productVersion:"V0.0.42",productId:"2024245-2",productChNumber:"33",productNumber:2,upgradeDate:"2024.09.24",productName:"PDU",status:"4"},{productVersion:"V0.0.40",productId:"2024245-3",productChNumber:"33",productNumber:3,upgradeDate:"2024.09.24",productName:"PDU",status:"1"}];t.channelList=e,console.log("执行成功")}),1e3)},onSocketMessageToUpgrade:function(t){if(t.success){var e=t.data.data;null!=t.data&&""!=e&&null!=e&&(this.channelList=e)}},handleSelectionChange:function(t){var e=t.map((function(t){return t.productId}));this.productId=e.join(",")},getStringWidth:function(t){var e="14px Arial",o=document.createElement("canvas"),a=o.getContext("2d");a.font=e;var i=a.measureText(t);return i.width+40},getDity:function(t,e){var o="",a="",i=[];"status"==e&&(i=this.statuss,a=t.status);for(var n=0;n<i.length;n++){var l=i[n];if(a==l.id)return o=l.name,this.$t(l.name)}return o},queryProductList:function(){var t=this,e={};e.token=this.usertoken,e.type="listCbQuery",Object(l["e"])(e).then((function(e){t.productList=e.data})).catch((function(){}))},handleImport:function(t){this.upload.title=this.$t("gjxz"),this.upload.open=!0,""!=this.fileName&&this.$refs.upload.clearFiles(),this.fileName="",this.validate=""},handleUpdate:function(t){if(this.$refs.multipleTable.clearSelection(),""!=this.fileName){this.validate="1",this.$refs.multipleTable.toggleRowSelection(t);var e=this;this.$modal.confirm(this.$t("qrsjts")).then((function(){e.$refs.upload.submit()})).then((function(){})).catch((function(){}))}else this.$modal.alert(this.$t("qxzgj"))},handleUpdateAll:function(){if(""!=this.fileName)if(""!=this.productId){this.validate="1";var t=this;this.$modal.confirm(this.$t("qrsjts")).then((function(){t.$refs.upload.submit()})).then((function(){})).catch((function(){}))}else this.$modal.alert(this.$t("qxzkzb"));else this.$modal.alert(this.$t("qxzgj"))},beforeUpload:function(t){""==this.validate&&(this.fileName=t.name)},handleFileUploadProgress:function(t,e,o){this.upload.isUploading=!0},handleFileSuccess:function(t,e,o){this.upload.open=!1,this.upload.isUploading=!1,this.$refs.upload.clearFiles(),this.$modal.alert(t.msg),this.cancel(),this.$refs.multipleTable.clearSelection()},submitFileForm:function(){this.upload.open=!1},handleAdd:function(){this.sortnoOpen=!0},handleCommand:function(t,e){var o={};switch(o.token=this.usertoken,o.productId=e.productId,o.productNumber=e.productNumber,t){case"channelopen":o.type="sBRestart",this.$modal.confirm(this.$t("qrsjts")).then((function(){Object(l["e"])(o)})).then((function(){})).catch((function(){}));break;default:break}},queryChannelStatus:function(){var t=this;this.queryParams.token=this.usertoken,this.queryParams.type="listCbQuery",this.loading=!0,Object(l["e"])(this.queryParams).then((function(e){t.channelList=e.data,t.$refs.multipleTable.toggleAllSelection()})).catch((function(){})),this.loading=!1},handleQuery:function(){this.queryChannelStatus()},resetQuery:function(){this.resetForm("queryForm"),this.handleQuery()},handleHis:function(t){var e=this;this.form=t;var o={};o.token=this.usertoken,o.type="listRtHisQuery",o.productId=t.productId,this.loading=!0,Object(l["e"])(o).then((function(t){null!=t.data&&(e.hisData=t.data)})).catch((function(){})),this.loading=!1,this.open=!0,this.title=this.$t("bbls"),this.activeNames=[0]},submitForm:function(){var t=this;this.$refs["form"].validate((function(e){if(e){var o={};o.token=t.usertoken,o.type="sXTimeSave",o.productChName=t.form.productChName,o.productChId=t.form.productChId,o.firingInterval=t.form.firingInterval,o.closeInterval=t.form.closeInterval,o.productId=t.form.productId,t.loading=!0,t.$modal.confirm(t.$t("qrsjts")).then((function(){var t=this;Object(l["k"])(o).then((function(e){t.open=!1,t.queryChannelStatus()}))})).then((function(){t.open=!1})).catch((function(){}))}}))},cancel:function(){""!=this.fileName&&this.$refs.upload.clearFiles(),this.fileName="",this.upload.open=!1},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(){}))}}},r=s,c=(o("3f45"),o("2877")),u=Object(c["a"])(r,a,i,!1,null,null,null);e["default"]=u.exports},cee6:function(t,e,o){}}]);