whychw
2021-05-24 8e85954e958bcb1bba811884dbc9cde65e94aa04
1
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d62acac"],{"0b35":function(t,e,a){"use strict";a.r(e);var s,i,o,n,r=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"page_watercooling flex_column posA_full"},[a("div",{staticClass:"page_title"},[t._v("3号水冷装置运行界面")]),a("div",{staticClass:"btns-group"},[a("div",{staticClass:"btn",on:{click:function(e){return t.toWater(1)}}},[t._v("切换到1号水冷装置")]),a("div",{staticClass:"btn",on:{click:function(e){return t.toWater(2)}}},[t._v("切换到2号水冷装置")]),a("div",{staticClass:"btn",on:{click:t.exportData}},[t._v("数据导出")]),a("div",{staticClass:"btn btn-toggle",on:{click:t.changeStatus}},[t._v(t._s(t.showTable?"显示运行图":"显示表格"))])]),a("div",{staticClass:"page_content",class:{turn_end:t.showTable}},[a("div",{staticClass:"wraper"},[a("div",{ref:"container",staticClass:"canvas_container border-angle"},[a("canvas",{ref:"can",attrs:{id:"can",width:"1800",height:"700"}}),a("canvas",{ref:"can1",staticClass:"can1",attrs:{id:"can1",width:"1800",height:"700"}}),a("canvas",{ref:"can2",staticClass:"can1",attrs:{id:"can2",width:"1800",height:"700"}}),t._l(t.inputList,(function(e,s){return a("science-box",{key:"input_"+s,staticClass:"panel_input",class:{normal:2==s||3==s},attrs:{"no-header":"",cssWidth:e.position.width,cssHeight:e.position.height,top:e.position.top,left:e.position.left}},[a("div",{staticClass:"input-title",attrs:{slot:"title"},slot:"title"},[a("div",[t._v(t._s(e.title))])]),a("el-input",{staticClass:"input transparent",class:{alarm:e.alarm},attrs:{disabled:"",type:"text"},model:{value:e.value,callback:function(a){t.$set(e,"value",a)},expression:"item.value"}})],1)})),a("div",{staticClass:"panel_label",style:t.getStyle(t.panelList[0].position)},[a("div",{staticClass:"inner flexR_center"},[a("span",{staticClass:"indicator",class:{status_off:!t.G_status.H01,status_normal:t.G_status.H01}}),t._v(" H01")])]),t._l(t.panelList.slice(1),(function(e,s){return a("div",{key:"label_"+s,staticClass:"panel_label",style:t.getStyle(e.position)},[a("div",{staticClass:"inner"},[t._v(t._s(e.txt))])])})),a("div",{staticClass:"run_info flexR_center",style:t.getStyle(t.run_info)},[t._v("运行状态: "),a("div",{class:["indicator_css",{status_normal:t.G_status.Water_system_function,status_off:!t.G_status.Water_system_function}]})]),a("div",{staticClass:"rotate_motor",style:t.getStyle(t.rotate_motor)},[a("div",{staticClass:"motor",class:{motor_run:t.G_status.p01}})])],2)]),a("div",{staticClass:"wraper"},[a("div",{staticClass:"tab_table posA_full"},[a("el-tabs",{staticClass:"inner",attrs:{type:"border-card"}},[a("el-tab-pane",{attrs:{label:"实时数据"}},[a("assemble-table",{attrs:{data:t.tlist.rtData,len:4}})],1),a("el-tab-pane",{attrs:{label:"支路数据"}},[a("assemble-table",{attrs:{data:t.tlist.branchData,len:4}})],1),a("el-tab-pane",{attrs:{label:"状态数据"}},[a("assemble-table",{attrs:{data:t.tlist.stateData,len:4}})],1),a("el-tab-pane",{attrs:{label:"故障数据"}},[a("assemble-table",{attrs:{data:t.tlist.alarmData,len:4}})],1)],1)],1)])]),a("el-dialog",{attrs:{title:"数据导出",visible:t.exportDialogVisible,width:"400px"},on:{"update:visible":function(e){t.exportDialogVisible=e}}},[a("label",{staticClass:"pr_o6em"},[t._v("选择日期")]),a("el-date-picker",{attrs:{"value-format":"yyyy-MM-dd",type:"date",size:"small","picker-options":t.pickerOptions,placeholder:"选择日期"},model:{value:t.export_date,callback:function(e){t.export_date=e},expression:"export_date"}}),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(e){t.exportDialogVisible=!1}}},[t._v("关 闭")]),a("el-button",{attrs:{type:"primary"},on:{click:t.exportCsv}},[t._v("导 出")])],1)],1),a("progress-load",{attrs:{show:t.progress.show,percentage:t.progress.value,text:t.progress.text}})],1)},l=[],c=(a("4160"),a("a9e3"),a("b680"),a("b64b"),a("ac1f"),a("5319"),a("159b"),a("2348")),p=a("960b"),u=a("535f"),h=a("aab4"),d=a("f600"),f=a("2cd1"),g=5002,m={name:"WaterCooling_3",components:{ScienceBox:c["a"],AssembleTable:h["a"],ProgressLoad:f["a"]},data:function(){return{progress:{show:!1,value:0,text:""},exportDialogVisible:!1,export_date:(new Date).format("yyyy-MM-dd"),pickerOptions:{disabledDate:function(t){return t&&t.valueOf()>Date.now().valueOf()||t.valueOf()<Date.now().valueOf()-2592e6}},tlist:{rtData:[],branchData:[],stateData:[],alarmData:[]},showTable:!1,timer:new this.$common.Timeout,flag:!1,G_status:{Water_system_function:!1,p01:!1,p11:!1,H01:!1},run_info:{left:0,right:0,top:0,bottom:0,width:0,height:0},rotate_motor:{left:0,right:0,top:0,bottom:0,width:0,height:0},inputList:[{title:"TT02回水温度(℃)",position:{left:0,right:0,top:0,bottom:0,width:0,height:0},value:0,alarm:!1},{title:"PT02回水压力(bar)",position:{left:0,right:0,top:0,bottom:0,width:0,height:0},value:0,alarm:!1},{title:"环境温度(℃)",position:{left:0,right:0,top:0,bottom:0,width:0,height:0},value:0,alarm:!1},{title:"环境湿度(%)",position:{left:0,right:0,top:0,bottom:0,width:0,height:0},value:0,alarm:!1},{title:"PT01供水压力(bar)",position:{left:0,right:0,top:0,bottom:0,width:0,height:0},value:0,alarm:!1},{title:"FIT01冷却水流量(T/h)",position:{left:0,right:0,top:0,bottom:0,width:0,height:0},value:0,alarm:!1},{title:"TT01供水温度(℃)",position:{left:0,right:0,top:0,bottom:0,width:0,height:0},value:0,alarm:!1},{title:"TT21外水温度(℃)",position:{left:0,right:0,top:0,bottom:0,width:0,height:0},value:0,alarm:!1},{title:"PT21外水压力(bar)",position:{left:0,right:0,top:0,bottom:0,width:0,height:0},value:0,alarm:!1}],panelList:[{txt:"",position:{left:0,right:0,top:0,bottom:0,width:0,height:0}},{txt:"P01",position:{left:0,right:0,top:0,bottom:0,width:0,height:0}},{txt:"V001",position:{left:0,right:0,top:0,bottom:0,width:0,height:0}},{txt:"P11",position:{left:0,right:0,top:0,bottom:0,width:0,height:0}},{txt:"C11",position:{left:0,right:0,top:0,bottom:0,width:0,height:0}}]}},methods:{go:function(t){this.$router.push({path:t})},start:function(){},stop:function(){},toWater:function(t){this.$router.push({path:"/watercooling/index/"+t})},changeStatus:function(){this.showTable=!this.showTable},setInput:function(){for(var t=this.$refs.container,e=t.offsetWidth,a=t.offsetHeight,i=0;i<9;i++)this.inputList[i].position=this.$common.transSize(e,a,1800,700,s.getInfo("rect_input_"+i))},setPanelPos:function(){for(var t=this.$refs.container,e=t.offsetWidth,a=t.offsetHeight,i=0;i<5;i++)this.panelList[i].position=this.$common.transSize(e,a,1800,700,s.getInfo("rect_panel_"+i))},getStyle:function(t){return{left:t.left+"px",top:t.top+"px",width:t.width+"px",height:t.height+"px"}},getPos:function(){this.setInput(),this.setPanelPos(),this.getRunInfoPos(),this.getMotorPos()},getRunInfoPos:function(){var t=this.$refs.container,e=t.offsetWidth,a=t.offsetHeight;this.run_info=this.$common.transSize(e,a,1800,700,s.getInfo("rect_title_0"))},getMotorPos:function(){var t=this.$refs.container,e=t.offsetWidth,a=t.offsetHeight;this.rotate_motor=this.$common.transSize(e,a,1800,700,s.getInfo("rect_motor_0"))},getDate:function(){var t=this,e=[];return this.$api.water.getDate({water_id:g}).then((function(a){if(a=JSON.parse(a.data.result),a.code){var s=a.data[0],i=d["a"].type3.rtData;t.inputList[0].value=s.back_tem,t.inputList[1].value=s.back_pre,t.inputList[2].value=s.Tem_chamber,t.inputList[3].value=s.Humidity_chamber,t.inputList[4].value=s.Supply_pre,t.inputList[5].value=s.cooling_flow/10,t.inputList[6].value=s.supply_tmp,t.inputList[7].value=s.External_tmp,t.inputList[8].value=s.External_pre,Object.keys(s).forEach((function(t){"num"!=t&&"water_id"!=t&&e.push({text:i[t],key:t,val:s[t]})})),t.tlist.rtData=e}}))},getStatus:function(){var t=this,e=[];return this.$api.water.getStatus({water_id:g}).then((function(a){if(a=JSON.parse(a.data.result),a.code){var s=a.data[0],i=d["a"].type3.stateData;t.G_status.Water_system_function=s.Water_system_function,t.G_status.p01=s.P01_main_pump,t.G_status.p11=s.P11_replenish_pump,t.G_status.H01=s.H01_electric_heater,Object.keys(s).forEach((function(t){"num"!=t&&"water_id"!=t&&e.push({text:i[t],key:t,val:s[t]})})),t.tlist.stateData=e}}))},getAlarm:function(){var t=this,e=[];return this.$api.water.getAlarm({water_id:g}).then((function(a){if(a=JSON.parse(a.data.result),a.code){var s=a.data;if(!s.length)return!1;for(var i=0,o=s.length;i<o;i++)e.push({text:s[i]["alarm_name"],key:"",val:"告警"});t.tlist.alarmData=e}}))},loop:function(){var t=this;this.timer.start((function(){t.$axios.all([t.getDate(),t.getStatus(),t.getAlarm()]).then((function(){u["a"].update3(i,t.G_status,o),t.timer.open()})).catch((function(e){console.error(e),t.timer.open()}))}),1e3)},exportData:function(){this.exportDialogVisible=!0},getProgress:function(){var t=this;this.exportDialogVisible=!1,this.$api.common.getProgress().then((function(e){e=JSON.parse(e.data.result);var a=e.data[0]?Number(e.data[0].toFixed(0)):0;t.progress.value=a,t.progress.text=0==a?"数据加载中...":"文件下载中...",e.data<100&&t.progress.show?setTimeout(t.getProgress,50):t.progress.value=100}))},exportCsv:function(){var t=this,e={dev_name:"3号水冷装置",dev_id:g,export_num:5,table_name:this.export_date.replace(/-/g,"_"),record_time:this.export_date+" 00:00:00"};this.progress.show=!0,this.$api.common.clearProgress().then((function(){t.getProgress(),t.$api.common.download(e).then((function(e){if(e=JSON.parse(e.data.result),1==e.code){t.progress.show=!1,t.progress.value=0;var a=e.data[0],s=document.createElement("a");s.href=encodeURI(t.$config.url+"tomcat7_csv/"+a.fileName),s.download=a.fileName,document.body.appendChild(s),s.click(),document.body.removeChild(s),setTimeout((function(){t.progress.show=!1,t.progress.value=0}),1e3)}else t.progress.show=!1,t.progress.value=0,t.$layer.msg("生成文件失败!")})).catch((function(e){t.progress.show=!1,t.progress.value=0,t.$layer.msg("生成文件失败!"),console.warn(e)}))}))}},mounted:function(){var t=this;this.$refs.container;s=new p["a"]("can"),i=new p["a"]("can1"),o=new p["a"]("can2"),u["a"].main_3(s),this.getPos(),this.loop(),n=function(){t.getPos()},window.addEventListener("resize",n)},destroyed:function(){window.removeEventListener("resize",n),this.timer.stop(),u["a"].stop(3)}},_=m,v=(a("3deb"),a("2877")),b=Object(v["a"])(_,r,l,!1,null,"9cebbda0",null);e["default"]=b.exports},"3deb":function(t,e,a){"use strict";var s=a("addf"),i=a.n(s);i.a},addf:function(t,e,a){}}]);