tft-fe/dist/js/9881.d46fb1e2.js

1 line
6.1 KiB
JavaScript
Raw Permalink Normal View History

2023-06-30 14:01:06 +08:00
"use strict";(self["webpackChunktft_mes"]=self["webpackChunktft_mes"]||[]).push([[9881],{9881:function(t,e,a){a.r(e),a.d(e,{default:function(){return y}});var r=function(){var t=this,e=t._self._c;return e("el-row",{staticClass:"main-box",attrs:{gutter:10}},[e("el-col",{attrs:{span:4}},[e("div",{staticClass:"left-box"},[e("el-tree",{attrs:{data:t.treeData,props:t.defaultProps,"node-key":"id","default-expand-all":"","highlight-current":!0},on:{"node-click":t.clickDevice}})],1)]),e("el-col",{attrs:{span:20}},[e("div",{staticClass:"right-top"},[e("div",{staticClass:"top-search1"},[e("el-radio-group",{on:{change:t.typeChange},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"},["历史数据"===t.type?e("search-bar",{attrs:{formConfigs:t.formConfig},on:{headBtnClick:t.buttonClick}}):t._e()],1)]),e("div",{staticClass:"right-bottom"},[e("div",{staticClass:"title-box"},[e("span",{staticClass:"title"},[t._v(t._s(t.type))])]),e("base-table",{attrs:{page:t.listQuery.current,limit:t.listQuery.size,"table-props":t.tableProps,"table-data":t.tableData,"max-height":t.tableH}}),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.getReal}})],1)])],1)},n=[],i=a(475),o=a(5591),l=a(1942),s=a(381),u=a.n(s);const c=[{prop:"paramName",label:"工艺参数",showOverflowtooltip:!0},{prop:"variableName",label:"变量名称",showOverflowtooltip:!0},{prop:"eqName",label:"所属设备",width:150},{prop:"unitName",label:"所属单元",width:150},{prop:"alarmTime",label:"报警时间",filter:i.g6,width:180},{prop:"alarmValue",label:"报警值",width:100},{prop:"alarmType",label:"报警类型",width:100,filter:(0,i.fW)("alarmTypeVoList")},{prop:"alarmLimit",label:"报警限值",width:150}],p=[{type:"edit",btnName:"编辑"}];var d={name:"AbnormalAlert",data(){return{treeData:[],type:"实时数据",defaultProps:{children:"children",label:"name"},formConfig:[{type:"datePicker",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:"button",btnName:"查询",name:"search",color:"primary"}],tableProps:c,tableData:[],tableBtn:p,tableH:(0,i.NC)(340),total:0,listQuery:{current:1,size:20,equipmentId:null,proLineId:null,unitId:null,endTime:null,startTime:null},centervisible:!1,addOrEditTitle:""}},mounted(){window.addEventListener("resize",(()=>{this.tableH=(0,i.NC)(340)})),this.formConfig[0].defaultSelect=[u()().format("yyyy-MM-DD")+"T00:00:00",u()().format("yyyy-MM-DD")+"T23:59:59"],this.listQuery.startTime=u()().format("yyyy-MM-DD")+"T00:00:00",this.listQuery.endTime=u()().format("yyyy-MM-DD")+"T23:59:59",this.getTree(),this.getReal()},methods:{getTree(){(0,o.SI)().then((t=>{this.treeData=t.data}))},getReal(){(0,l.QC)({...this.listQuery}).then((t=>{0===t.code&&(this.tableData=t.data.records,this.total=t.data.total)}))},getHis(){(0,l.$p)({...this.listQuery}).then((t=>{0===t.code&&(this.tableData=t.data.records,this.total=t.data.total)}))},clickDevice(t){t.parent?t.parent&&!t.isAllowDrag?(this.listQuery.proLineId=null,this.listQuery.unitId=t.id,this.listQuery.equipmentId=null):t.parent&&t.isAllowDrag&&(this.listQuery.proLineId=null,this.listQuery.unitId=null,this.listQuery.equipmentId=t.id):(this.listQuery.proLineId=t.id,this.listQuery.unitId=null,this.listQuery.equipmentId=null),"实时数据"===this.type?this.getReal():this.getHis()},typeChange(t){console.log(t),"实时数据"===t?(this.tableData=[],this.total=0,this.getReal()):"历史数据"===t&&(this.tableData=[],this.total=0)},buttonClick(t){console.log(t),"search"===t.btnName&&(t.timeStr?(this.listQuery.startTime=t.timeStr[0],th