1 line
8.1 KiB
JavaScript
1 line
8.1 KiB
JavaScript
"use strict";(self["webpackChunktft_mes"]=self["webpackChunktft_mes"]||[]).push([[4750],{4750:function(t,e,r){r.r(e),r.d(e,{default:function(){return Q}});var i=function(){var t=this,e=t._self._c;return e("div",{ref:"container",staticClass:"processMonitoring",attrs:{id:"container"}},[e("div",{staticClass:"top-box"},[e("div",{staticClass:"top-search1"},[e("el-radio-group",{on:{change:t.changeType},model:{value:t.type,callback:function(e){t.type=e},expression:"type"}},[e("el-radio-button",{attrs:{label:"实时数据"}},[t._v("实时数据")]),e("el-radio-button",{attrs:{label:"历史数据"}},[t._v("历史数据")])],1)],1),e("div",{staticClass:"top-search2"},[e("search-bar",{ref:"searchBarForm",attrs:{formConfigs:t.formConfig},on:{headBtnClick:t.buttonClick,"cascader-change":t.cascaderSelect}})],1)]),e("div",{staticClass:"bottom-box"},[e("div",{staticClass:"title-box"},[e("span",{staticClass:"title"},[t._v(t._s(t.type))])]),"实时数据"===t.type?e("div",[e("base-table",{attrs:{page:t.listQuery.current,limit:t.listQuery.size,"table-props":t.tableProps,"table-data":t.tableData,"max-height":t.tableH,"row-class-name":t.tableRowClassName}}),e("pagination",{attrs:{page:t.listQuery.current,limit:t.listQuery.size,total:t.total},on:{"update:page":function(e){return t.$set(t.listQuery,"current",e)},"update:limit":function(e){return t.$set(t.listQuery,"size",e)},pagination:t.getRealList}})],1):e("div",[e("process-monitoring-chart",{attrs:{beilv:t.beilv}})],1)])])},a=[],s=function(){var t=this,e=t._self._c;return e("div",{style:{height:700*t.beilv+"px",width:"100%"},attrs:{id:"processMonitoring"}})},o=[],n=r(7171),l=r(5468),u={mixins:[l.Z],name:"ProcessMonitoringChart",props:{chartMsg:{type:Object,default:()=>({chart:""})},beilv:{type:Number,default:1}},watch:{chartMsg:function(){this.initChart()}},beforeDestroy(){this.chart&&(this.chart.dispose(),this.chart=null)},methods:{initChart(){null!==this.chart&&""!==this.chart&&void 0!==this.chart&&this.chart.dispose();var t=document.getElementById("processMonitoring");this.chart=n.S1(t);var e={color:["#5B8FF9"],tooltip:{trigger:"axis",textStyle:{color:"#fff"},backgroundColor:"rgba(150, 150, 150, 1)",borderColor:"rgba(150, 150, 150, 1)"},xAxis:{type:"category",data:["Mon","Tue","Wed","Thu","Fri","Sat","Sun"]},yAxis:{type:"value"},series:[{data:[150,230,224,218,135,147,260],type:"line"}]};this.chart.setOption(e,!0)}}},m=u,c=r(1001),h=(0,c.Z)(m,s,o,!1,null,null,null),p=h.exports,d=r(1942),f=r(5591),g=r(475);const y=[{prop:"paramName",label:"工艺参数",minWidth:150,showOverflowtooltip:!0},{prop:"variableName",label:"变量名称",minWidth:150,showOverflowtooltip:!0},{prop:"eqName",label:"所属设备",minWidth:150},{prop:"unitName",label:"所属单元",minWidth:120},{prop:"value",label:"实时值",minWidth:120}];var b={name:"ProcessMonitoring",data(){return{beilv:1,type:"实时数据",formConfig:[{type:"",label:"",dateType:"datetimerange",format:"yyyy-MM-dd HH:mm:ss",valueFormat:"yyyy-MM-ddTHH:mm:ss",rangeSeparator:"-",startPlaceholder:"开始时间",endPlaceholder:"结束时间",placeholder:"时间范围",param:"timeStr",width:350},{type:"cascader",label:"产线/单元/设备",selectOptions:[],param:"equipmentId",cascaderProps:{checkStrictly:!1,value:"id",label:"name"},onChange:!0,width:250},{type:"select",label:"工艺参数",labelField:"paramName",valueField:"paramName",selectOptions:[],filterable:!0,param:"paramName",defaultSelect:"",width:180},{type:"button",btnName:"查询",name:"search",color:"primary"}],listQuery:{current:1,size:20,equipmentId:"",paramName:"",startTime:"",endTime:""},tableProps:y,tableData:[],tableH:(0,g.NC)(340),total:0,historyList:[]}},components:{processMonitoringChart:p},mounted(){this.beilv=document.getElementById("container").offsetWidth/1920,window.addEventListener("resize",(()=>{this.tableH=(0,g.NC)(340),this.beilv=document.getElementById("container").offsetWidth/1920,console.log(this.beilv)})),this.getTree(),this.getRealList()},methods:{getRealList(){(0,d.KF)({...this.listQuery}).then((t=>{console.log(t),0===t.code&&(this.tableData=t.data.records,this.total=t.data.total)}))},getHistoryList(){return this.listQuery.startTime&&this.listQuery.endTime?this.listQuery.equipmentId?this.listQuery.paramName?void(0,d.F6)({startTime:this.listQuery.startTime,endTime:this.listQuery.endTime,equipmentId:this.listQuery.equipmentId,paramName:this.listQuery.paramName}).then((t=>{0===t.code&&(this.historyList=t)})):(this.$message.error("工艺参数不能为空"),!1):(this.$message.error("设备名称不能为空"),!1):(this.$message.error("时间范围不能为空"),!1)},getTree(){(0,f.SI)().then((t=>{this.formConfig[1].selectOptions=t.data}))},buttonClick(t){"实时数据"===this.type?(this.listQuery.startTime="",this.listQuery.endTime="",this.listQuery.equipmentId=t.equipmentId?t.equipmentId[2]:"",this.listQuery.paramName=t.paramName?t.paramName:"",this.getRealList()):(this.listQuery.startTime=t.timeStr?t.timeStr[0]:"",this.listQuery.endTime=t.timeStr?t.timeStr[1]:"",this.listQuery.equipmentId=t.equipmentId?t.equipmentId[2]:"",this.listQuery.paramName=t.paramName?t.paramName:"",this.getHistoryList())},changeType(t){this.$refs.searchBarForm.resetForm(),this.listQuery.startTime="",this.listQuery.endTime="",this.listQuery.equipmentId="",this.listQuery.paramName="",this.formConfig[2].selectOptions=[],"历史数据"===t?(this.formConfig[0].type="datePicker",this.formConfig[0].label="时间范围",this.formConfig[0].defaultSelect=[],this.formConfig[1].defaultSelect=[],this.formConfig[2].defaultSelect=""):(this.formConfig[0].type="",this.formConfig[0].label="",this.formConfig[0].defaultSelect=[],this.formConfig[1].defaultSelect=[],this.formConfig[2].defaultSelect="",this.getRealList())},cascaderSelect(t){console.log(t),3===t.value.length?(console.log("333333333333333"),this.listQuery.equipmentId=t.value[2],(0,d.Tt)({current:1,size:1e3,equipmentId:this.listQuery.equipmentId}).then((t=>{console.log(t);let e={...this.$refs.searchBarForm.formInline};this.$refs.searchBarForm.resetForm(),this.formConfig[0].defaultSelect=e.timeStr,this.formConfig[1].defaultSelect=JSON.parse(JSON.stringify(e.equipmentId)),this.formConfig[2].defaultSelect="",this.formConfig[2].selectOptions=t.data}))):(console.log("清空"),this.formConfig[1].defaultSelect="",this.$refs.searchBarForm.resetForm(),this.formConfig[2].selectOptions=[])},tableRowClassName({row:t}){return t.overLimit?"danger-row":""}}},C=b,v=(0,c.Z)(C,i,a,!1,null,"bcfbbbf2",null),Q=v.exports},5591:function(t,e,r){r.d(e,{FH:function(){return n},Hp:function(){return l},JQ:function(){return o},SI:function(){return s},WQ:function(){return c},b6:function(){return u},iv:function(){return a},m:function(){return m}});var i=r(8859);function a(){return(0,i.Z)({url:"/common/getList",method:"post"})}function s(){return(0,i.Z)({url:"/common/getTreeData",method:"post"})}function o(t){return(0,i.Z)({url:"/common/updateEqSeq",method:"post",data:t})}function n(t){return(0,i.Z)({url:"/common/attachment/downloadFile",method:"get",responseType:"blob",params:t,timeout:6e4})}function l(t){return(0,i.Z)({url:"/common/getAlarmData",method:"post",data:t})}function u(t){return(0,i.Z)({url:"/common/getProductData",method:"post",data:t})}function m(t){return(0,i.Z)({url:"/common/getMaterialData",method:"post",data:t})}const c="/api/common/attachment/uploadFileFormData"},1942:function(t,e,r){r.d(e,{$p:function(){return l},AO:function(){return m},F6:function(){return o},FK:function(){return u},KF:function(){return s},QC:function(){return n},Tt:function(){return a},db:function(){return c}});var i=r(8859);function a(t){return(0,i.Z)({url:"/process/processMonitor/paramList",method:"post",data:t})}function s(t){return(0,i.Z)({url:"/process/processMonitor/pageReal",method:"post",data:t})}function o(t){return(0,i.Z)({url:"/process/processMonitor/history",method:"post",data:t})}function n(t){return(0,i.Z)({url:"/process/alram/pageReal",method:"post",data:t})}function l(t){return(0,i.Z)({url:"/process/alram/pageHis",method:"post",data:t})}function u(t){return(0,i.Z)({url:"/process/paramSet/page",method:"post",data:t})}function m(t){return(0,i.Z)({url:"/process/paramSet/get",method:"post",data:t})}function c(t){return(0,i.Z)({url:"/process/paramSet/update",method:"post",data:t})}}}]); |