| 1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-0d247607"],{4508:function(t,e,r){},"6d49":function(t,e,r){"use strict";r.r(e);var a=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"app-container"},[r("el-form",{ref:"queryForm",attrs:{model:t.queryParams,size:"small",inline:!0,"label-width":"auto"}},[r("el-form-item",{attrs:{label:this.$t("sbmc"),prop:"productName"}},[r("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 r("el-option",{key:t.productId,attrs:{label:t.productName,value:t.productId}})})),1)],1),r("el-form-item",{attrs:{label:this.$t("rq"),prop:"startDate"}},[r("el-date-picker",{attrs:{clearable:"",type:"date","value-format":"yyyy-MM-dd"},model:{value:t.queryParams.setDate,callback:function(e){t.$set(t.queryParams,"setDate",e)},expression:"queryParams.setDate"}})],1),r("el-form-item",{attrs:{label:this.$t("tdmc"),prop:"productChName"}},[r("el-input",{attrs:{clearable:""},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.handleQuery(e)}},model:{value:t.queryParams.productChName,callback:function(e){t.$set(t.queryParams,"productChName",e)},expression:"queryParams.productChName"}})],1),r("el-form-item",{attrs:{label:this.$t("tdh"),prop:"productChId"}},[r("el-input",{attrs:{clearable:""},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.handleQuery(e)}},model:{value:t.queryParams.productChId,callback:function(e){t.$set(t.queryParams,"productChId",e)},expression:"queryParams.productChId"}})],1),r("el-form-item",[r("el-button",{attrs:{type:"primary","min-width":t.getStringWidth(t.$t("ss")),icon:"el-icon-search",size:"mini"},on:{click:t.handleQuery}},[t._v(t._s(t.$t("ss")))]),r("el-button",{attrs:{type:"primary","min-width":t.getStringWidth(t.$t("xz")),icon:"el-icon-plus",size:"mini"},on:{click:t.handleAdd}},[t._v(t._s(t.$t("xz")))])],1)],1),r("el-row",[r("el-col",{attrs:{span:14}},[r("el-card",{staticStyle:{"min-height":"700px","border-radius":"15px"}},[r("el-calendar",{scopedSlots:t._u([{key:"dateCell",fn:function(e){e.date;var a=e.data;return[r("el-popover",{attrs:{placement:"top-start",width:"240",trigger:"hover"}},[r("p",{class:t.rqi.indexOf(a.day)>-1?"is-selected":"",attrs:{slot:"reference"},on:{click:function(e){return t.handleBianJi(a.day)}},slot:"reference"},[t._v(" "+t._s(a.day.split("-").slice(1).join("-"))+" "),r("br"),r("a",{staticStyle:{overflow:"hidden","text-overflow":"ellipsis",display:"-webkit-box","-webkit-box-orient":"vertical","-webkit-line-clamp":"2"}},[t._v(" "+t._s(t.rqi.indexOf(a.day)>-1?t.rqineirong[a.day].productChName+"("+t.rqineirong[a.day].setStatuss+")":""))])]),t.rqi.indexOf(a.day)>-1?[r("div",{staticClass:"top-title",staticStyle:{"border-bottom":"1px solid #eee"}},[t._v(" "+t._s(t.$t("szxxxx"))+" ")]),r("div",{staticClass:"center-content",staticStyle:{margin:"10px 0","font-size":"14px"}},[r("div",{staticClass:"center-content-one"},[t._v(t._s(t.$t("tdh"))+":"+t._s(t.rqineirong[a.day].productChIds))]),r("div",{staticClass:"center-content-one"},[t._v(t._s(t.$t("tdmc"))+":"+t._s(t.rqineirong[a.day].productChNames))]),r("div",{staticClass:"center-content-one"},[t._v(t._s(t.$t("szsj"))+":"+t._s(t.rqineirong[a.day].setTimes))]),r("div",{staticClass:"center-content-one"},[t._v(t._s(t.$t("szzt"))+":"+t._s(t.rqineirong[a.day].setStatuss))])])]:t._e()],2)]}}])})],1)],1),r("el-col",{attrs:{span:10}},[r("el-card",{staticStyle:{"min-height":"700px","border-radius":"15px","margin-left":"10px"}},[r("el-button",{staticStyle:{"background-color":"#656B8B"},attrs:{type:"primary",icon:"el-icon-delete",size:"mini"},on:{click:t.handleDelete}},[t._v(t._s(t.$t("sc")))]),r("el-table",{staticStyle:{"overflow-y":"auto"},attrs:{"min-height":"700px",data:t.dsList,"header-cell-style":{background:"#FFFFFF",color:"#000000"}},on:{"selection-change":t.handleSelectionChange}},[r("el-table-column",{attrs:{type:"selection",width:"55",align:"center"}}),r("el-table-column",{attrs:{label:this.$t("sbmc"),prop:"productChName","min-width":t.getStringWidth(t.$t("sbmc")),"show-overflow-tooltip":!0}}),t._e(),t._e(),r("el-table-column",{attrs:{label:this.$t("rq"),prop:"setDate","min-width":t.getStringWidth(t.$t("rq")),"show-overflow-tooltip":!0}}),r("el-table-column",{attrs:{label:this.$t("szsj"),"min-width":t.getStringWidth(t.$t("szsj")),prop:"setTime","show-overflow-tooltip":!0}}),r("el-table-column",{attrs:{label:this.$t("zt"),prop:"setStatus","min-width":t.getStringWidth(t.$t("zt")),"show-overflow-tooltip":!0},scopedSlots:t._u([{key:"default",fn:function(e){return[r("span",[t._v(t._s(t.getDity(e.row,"setStatus","1")))])]}}])}),r("el-table-column",{attrs:{label:this.$t("cf"),"min-width":t.getStringWidth(t.$t("cf")),prop:"triggerStatus","show-overflow-tooltip":!0},scopedSlots:t._u([{key:"default",fn:function(e){return["1"==e.row.triggerStatus?r("span",{staticStyle:{color:"green"}},[t._v(t._s(t.getDity(e.row,"triggerStatus","1")))]):r("span",[t._v(t._s(t.getDity(e.row,"triggerStatus","1")))])]}}])})],1)],1)],1)],1),r("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}}},[r("el-form",{ref:"form",attrs:{model:t.form,rules:t.rules,"label-width":"auto"}},[r("el-form-item",{attrs:{label:this.$t("td"),prop:"productChId"}},[r("el-select",{staticStyle:{width:"100%"},attrs:{multiple:""},model:{value:t.form.productChId,callback:function(e){t.$set(t.form,"productChId",e)},expression:"form.productChId"}},t._l(t.channelList,(function(t){return r("el-option",{key:t.productChId,attrs:{label:t.productChName,value:t.productChId}})})),1)],1),r("el-form-item",{attrs:{label:this.$t("zt"),prop:"setStatus"}},[r("el-select",{staticStyle:{width:"100%"},attrs:{"allow-create":"",filterable:!1},model:{value:t.form.setStatus,callback:function(e){t.$set(t.form,"setStatus",e)},expression:"form.setStatus"}},t._l(t.productChStatuss,(function(e){return r("el-option",{key:e.id,attrs:{label:t.$t(e.name),value:e.id}})})),1)],1),r("el-form-item",{attrs:{label:this.$t("el.datepicker.startDate"),prop:"startDate"}},[r("el-date-picker",{attrs:{clearable:"",type:"date","value-format":"yyyy-MM-dd"},model:{value:t.form.startDate,callback:function(e){t.$set(t.form,"startDate",e)},expression:"form.startDate"}})],1),r("el-form-item",{attrs:{label:this.$t("el.datepicker.endDate"),prop:"endDate"}},[r("el-date-picker",{attrs:{clearable:"",type:"date","value-format":"yyyy-MM-dd"},model:{value:t.form.endDate,callback:function(e){t.$set(t.form,"endDate",e)},expression:"form.endDate"}})],1),r("el-form-item",{attrs:{label:this.$t("sj"),prop:"channelTime"}},[r("el-time-picker",{attrs:{clearable:"",type:"time","value-format":"HH:mm:ss"},model:{value:t.form.channelTime,callback:function(e){t.$set(t.form,"channelTime",e)},expression:"form.channelTime"}})],1)],1),r("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[r("el-button",{attrs:{type:"primary"},on:{click:t.submitForm}},[t._v(t._s(t.$t("qd")))]),r("el-button",{on:{click:t.cancel}},[t._v(t._s(t.$t("qx")))])],1)],1)],1)},n=[],i=(r("c740"),r("d81d"),r("14d9"),r("fb6a"),r("b0c0"),r("8647")),s=r("7ba4"),o={name:"Online",data:function(){return{loading:!0,total:0,channelList:[],dsList:[],title:"",open:!1,form:{productChId:"",productChName:"",dateTime:""},channelLoadTypes:["空调","服务器","交换机","路由器","计算机","显示器","灯","其他"],queryParams:{productChName:"",productChId:"",productId:"",token:"",type:""},usertoken:"",rqineirong:{},rqi:[],show:!1,productChStatuss:[{id:"0",name:"duank"},{id:"1",name:"jt"}],triggerStatuss:[{id:"0",name:"wcf"},{id:"1",name:"ycf"}],ids:[],productList:[],productType:"",rules:{productChId:[{required:!0,message:this.$i18n.t("td")+" "+this.$i18n.t("bnwk"),trigger:"blur"}],setStatus:[{required:!0,message:this.$i18n.t("zt")+" "+this.$i18n.t("bnwk"),trigger:"blur"}],startDate:[{required:!0,message:this.$i18n.t("el.datepicker.startDate")+" "+this.$i18n.t("bnwk"),trigger:"blur"}],endDate:[{required:!0,message:this.$i18n.t("el.datepicker.endDate")+" "+this.$i18n.t("bnwk"),trigger:"blur"}],channelTime:[{required:!0,message:this.$i18n.t("sj")+" "+this.$i18n.t("bnwk"),trigger:"blur"}]}}},created:function(){this.usertoken=this.$store.state.user.usertoken,this.queryProductList()},methods:{getStringWidth:function(t){var e="14px Arial",r=document.createElement("canvas"),a=r.getContext("2d");a.font=e;var n=a.measureText(t);return n.width+40},queryProductList:function(){var t=this,e={};e.token=this.usertoken,e.type="listSbRestartQuery",Object(s["f"])(e).then((function(e){null!=e.data&&(t.productList=e.data,t.productType=t.productList[0].productType,t.queryParams.productId=t.productList[0].productId,t.handleQuery())})).catch((function(){}))},handleSelectionChange:function(t){this.ids=t.map((function(t){return t.idx})),this.single=1!=t.length,this.multiple=!t.length},showText:function(){this.show=!0},getChannelDsList:function(){var t=this;this.show=!0,this.queryParams.token=this.usertoken,this.queryParams.type="listDsQuery",Object(s["k"])(this.queryParams).then((function(e){null!=e.data&&(t.dsList=e.data,t.queryParams.type="listRlQuery",Object(s["k"])(t.queryParams).then((function(e){if(null!=e.data){var r=e.data;t.rqineirong={},t.rqi=[];for(var a=0;a<r.length;a++){var n={};for(var i in r[a]){var s=i.slice(0,13);t.rqi.push(r[a][i]),n[s]=r[a][i]}t.rqineirong[r[a].setDates]=n}}})))}))},queryChannelStatus:function(){var t=this;this.queryParams.token=this.usertoken,this.queryParams.type="listQuery",this.loading=!0,Object(s["c"])(this.queryParams).then((function(e){if(null!=e.data)if("3"==t.productType){for(var r,a=[],n=function(){r=e.data[i];var t={};t.productChId=r.productChId,t.productChName=r.productChName;var n=a.findIndex((function(e){return e.productChId==t.productChId}));if(-1!=n)return 1;a.push(t)},i=0;i<e.data.length;i++)n();t.channelList=a}else t.channelList=e.data})).catch((function(){})),this.loading=!1},handleBianJi:function(t){var e=new Date,r=new Date(t+" 23:59:59");r>=e&&(this.form.startDate=t,this.form.endDate=t,this.open=!0,this.title=this.$t("xz"),this.queryChannelStatus())},handleAdd:function(t){this.form.channelDate=t,this.open=!0,this.title=this.$t("xz"),this.queryChannelStatus()},handleQuery:function(){this.getChannelDsList()},resetQuery:function(){this.resetForm("queryForm"),this.handleQuery()},handleCommand:function(t,e){var r=this,a={};switch(a.token=this.usertoken,a.productChId=e.productChId,t){case"channelopen":a.type="open",this.$modal.confirm(this.$t("qrykqm")).then((function(){Object(s["c"])(a)})).then((function(){r.$modal.msgSuccess(r.$t("zxcg"))})).catch((function(){}));break;case"channelclose":a.type="close",this.$modal.confirm(this.$t("qrygbm")).then((function(){Object(s["c"])(a)})).then((function(){r.$modal.msgSuccess(r.$t("zxcg"))})).catch((function(){}));break;default:break}},submitForm:function(){var t=this;this.$refs["form"].validate((function(e){if(e){var r={};r.token=t.usertoken,r.type="dsSave",r.productChName=t.form.productChName,r.productChId=t.form.productChId,r.setStatus=t.form.setStatus,r.startDate=t.form.startDate,r.endDate=t.form.endDate,r.channelTime=t.form.channelTime;var a=new Date,n=new Date(t.form.startDate+" "+t.form.channelTime),i=new Date(t.form.endDate+" "+t.form.channelTime);if(n<a||i<a)return void t.$modal.msgWarning(t.$t("xzrqygq"));if(n>i)return void t.$modal.msgWarning(t.$t("xzrqygq1"));t.loading=!0;var o=t;t.$modal.confirm(t.$t("qdybcm")).then((function(){Object(s["k"])(r).then((function(t){o.$modal.msgSuccess(o.$t("zxcg")),o.handleQuery(),o.cancel()}))})).then((function(){})).catch((function(){}))}}))},cancel:function(){this.open=!1,this.form={productChId:void 0,startDate:void 0,endDate:void 0,channelTime:void 0,setStatus:void 0},this.resetForm("form")},handleDelete:function(t){var e=this,r={};r.token=this.usertoken,r.type="deleteDs",r.idx=t.idx||this.ids,null!=r.idx&&""!=r.idx?this.$modal.confirm(this.$t("qdyscm")).then((function(){return Object(s["k"])(r)})).then((function(){e.handleQuery(),e.$modal.msgSuccess(e.$t("sccg"))})).catch((function(){})):this.$modal.alertWarning(this.$t("qxcsc"))},getDity:function(t,e,r){var a="",n="",i=[];"productChStatus"==e?(i=this.productChStatuss,n=t.productChStatus):"setStatus"==e?(i=this.productChStatuss,n="0"==r?t:t.setStatus):"alarmStatus"==e?(i=this.alarmStatuss,n=t.alarmStatus):"connectionStatus"==e?(i=this.connectionStatuss,n=t.connectionStatus):"waterImmersionState"==e||"waterImmersionState"==e?(i=this.waterImmersionStates,n=t.waterImmersionState):"triggerStatus"==e&&(i=this.triggerStatuss,n=t.triggerStatus);for(var s=0;s<i.length;s++){var o=i[s];if(n==o.id)return a=o.name,this.$t(o.name)}return a},handleForceLogout:function(t){var e=this;this.$modal.confirm(this.$t("sfqztc")+t.userName+this.$t("yhm")).then((function(){return Object(i["a"])(t.tokenId)})).then((function(){e.getList(),e.$modal.msgSuccess(e.$t("qtcg"))})).catch((function(){}))}}},l=o,c=(r("f9a8"),r("2877")),u=Object(c["a"])(l,a,n,!1,null,null,null);e["default"]=u.exports},8647:function(t,e,r){"use strict";r.d(e,"b",(function(){return n})),r.d(e,"a",(function(){return i}));var a=r("b775");function n(t){return Object(a["a"])({url:"/monitor/online/list",method:"get",params:t})}function i(t){return Object(a["a"])({url:"/monitor/online/"+t,method:"delete"})}},f9a8:function(t,e,r){"use strict";r("4508")}}]);
|