tft-fe/dist/js/1653.bc452354.js

1 line
7.1 KiB
JavaScript
Raw Normal View History

2023-06-16 16:19:40 +08:00
"use strict";(self["webpackChunktft_mes"]=self["webpackChunktft_mes"]||[]).push([[1653],{1653:function(t,e,r){r.r(e),r.d(e,{default:function(){return h}});var n=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",{ref:"deviceTree",attrs:{data:t.treeData,"node-key":"name",props:t.defaultProps,"default-expand-all":"","highlight-current":!0},on:{"node-click":t.clickDevice}})],1)]),e("el-col",{attrs:{span:20}},[e("div",{staticClass:"right-box"},[e("search-bar",{attrs:{formConfigs:t.formConfig},on:{headBtnClick:t.buttonClick}}),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:{limit:t.listQuery.size,total:t.total}})],1)])],1)},o=[],a=r(475),u=r(5591),i=r(5093),l=r(381),d=r.n(l);const s=[{prop:"name",label:"单元/设备名称",width:300},{prop:"startTime",label:"开始时间",minWidth:160,filter:a.g6},{prop:"endTime",label:"结束时间",minWidth:160,filter:a.g6},{prop:"glassInNum",label:"投入数量"},{prop:"glassOutNum",label:"输出数量"},{prop:"glassMissNum",label:"损失数量"}];var c={name:"ProductionData",data(){return{treeData:[],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:"结束时间",param:"timeVal",defaultSelect:[],width:350},{type:"button",btnName:"查询",name:"search",color:"primary"},{type:"separate"},{type:"button",btnName:"导出",name:"export",color:"primary",plain:!0}],tableProps:s,tableData:[],tableH:(0,a.NC)(275),total:0,listQuery:{current:1,size:20,unitName:"",eqName:""},centervisible:!1,addOrEditTitle:""}},mounted(){window.addEventListener("resize",(()=>{this.tableH=(0,a.NC)(275)})),this.formConfig[0].defaultSelect=[d()().format("yyyy-MM-DD")+"T00:00:00",d()().format("yyyy-MM-DD")+"T23:59:59"],this.listQuery.startTime=d()().format("yyyy-MM-DD")+"T00:00:00",this.listQuery.endTime=d()().format("yyyy-MM-DD")+"T23:59:59",this.getTree()},methods:{getTree(){(0,u.SI)().then((t=>{this.treeData=t.data,this.listQuery.unitName=t.data[0].children[0].name,setTimeout((()=>{this.$refs.deviceTree.setCurrentKey(this.listQuery.unitName)}),100),this.getList()}))},getList(){(0,i.Ol)({...this.listQuery}).then((t=>{console.log(t),0===t.code&&t.data?(this.tableData=t.data.records,this.total=t.data.total):(this.tableData=[],this.total=0)}))},clickDevice(t){t.children?t.children&&t.parent&&(this.listQuery.eqName="",this.listQuery.unitName=t.name):(this.listQuery.eqName=t.name,this.listQuery.unitName=""),this.getList()},buttonClick(t){switch(console.log(t),t.btnName){case"search":this.listQuery.startTime=t.timeVal?t.timeVal[0]:"",this.listQuery.endTime=t.timeVal?t.timeVal[1]:"",this.getList();break;default:(0,i.TQ)({...this.listQuery}).then((t=>{console.log(t);let e="";const r=t.headers["content-disposition"];r&&(e=decodeURIComponent(r.slice(r.indexOf("filename=")+9)));const n=new Blob([t.data]),o=new FileReader;o.readAsDataURL(n),o.onload=t=>{const r=document.createElement("a");r.download=e,r.href=t.target.result,document.body.appendChild(r),r.click(),document.body.removeChild(r)}}))}},successSubmit(t){alert(t),this.handleCancel()}}},m=c,f=r(1001),p=(0,f.Z)(m,n,o,!1,null,"afb2cca2",null),h=p.exports},5591:function(t,e,r){r.d(e,{FH:function(){return i},Hp:function(){return l},JQ:function(){return u},SI:function(){return a},WQ:function(){return c},b6:function(){return d},iv:function(){return o},m:function(){return s}});var n=r(8859);function o(){return(0,n.Z)({url:"/common/getList",method:"post"})}function a(){return(0,n.Z)({url:"/common/getTreeData",method:"post"})}function u(t){return(0,n.Z)({url:"/common/updateEqSeq",method:"post",data:t})}function i(t){return(0,n.Z)({url:"/common/attachment/downloadFile",method:"get",responseType:"blob",params:t,timeout:6e4})}function l(t){ret