tft-fe/dist/js/8603.aa2798b5.js

1 line
8.9 KiB
JavaScript
Raw Permalink Normal View History

2023-06-30 14:01:06 +08:00
"use strict";(self["webpackChunktft_mes"]=self["webpackChunktft_mes"]||[]).push([[8603],{8603:function(t,e,n){n.r(e),n.d(e,{default:function(){return q}});var a=function(){var t=this,e=t._self._c;return e("div",[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.defaultTree,"highlight-current":!0,"default-expand-all":""},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("rate-analysis-chart",{attrs:{chartData:t.chartData}})],1)])],1)],1)},r=[],o=n(5591),i=function(){var t=this,e=t._self._c;return e("div",[e("div",{staticStyle:{width:"100%"},style:{height:t.chartHeight+"px"},attrs:{id:"rateChart"}})])},u=[],c=n(7171),s=n(475),l=n(5468),m={name:"RateAnalysisChart",mixins:[l.Z],data(){return{chartDom:"",chart:"",chartHeight:(0,s.NC)(214)-35}},props:{chartData:{type:Array,required:!0,default:()=>[]}},mounted(){this.$nextTick((()=>{this.getChart()})),window.addEventListener("resize",(()=>{this.chartHeight=(0,s.NC)(214)-35}))},watch:{chartData:function(){this.getChart()}},methods:{getChart(){null!==this.chart&&""!==this.chart&&void 0!==this.chart&&this.chart.dispose(),this.chartDom=document.getElementById("rateChart"),this.chart=c.S1(this.chartDom);const t=[],e=[],n=[],a=new Array(31).fill(24);for(let i=1;i<=this.chartData.length;i++){let a="";a=i+"",t.push(a),e.push(this.chartData[i-1].operationHours),n.push(this.chartData[i-1].utilization.substring(0,5))}const r=["#73A0FA","#F6BE19","#5AD8A6"];var o={color:r,tooltip:{trigger:"axis",axisPointer:{type:"cross",crossStyle:{color:"#999"}}},legend:{data:["实际运行小时数","理论运行时长","设备利用率"]},xAxis:[{type:"category",data:t,axisPointer:{type:"shadow"}}],yAxis:[{type:"value",name:"理论运行时长",axisLabel:{formatter:"{value} h"}},{type:"value",name:"设备利用率",axisLabel:{formatter:"{value} %"}}],series:[{name:"实际运行小时数",type:"bar",tooltip:{valueFormatter:function(t){return t+" h"}},data:e},{name:"理论运行时长",type:"line",tooltip:{valueFormatter:function(t){return t+" h"}},data:a},{name:"设备利用率",type:"line",yAxisIndex:1,tooltip:{valueFormatter:function(t){return t+"%"}},data:n}]};o&&this.chart.setOption(o)}}},d=m,h=n(1001),p=(0,h.Z)(d,i,u,!1,null,null,null),f=p.exports,g=n(147),y={name:"utilizationRateAnalysis",data(){return{treeData:[],defaultTree:{children:"children",label:"name"},eqName:"",chooseMonth:"",formConfig:[{type:"datePicker",label:"月份选择",dateType:"month",format:"yyyy-MM",valueFormat:"yyyy-MM",placeholder:"月份选择",param:"timePosition",defaultSelect:"",width:200},{type:"button",btnName:"查询",name:"search",color:"primary"}],listQuery:{timePosition:"",name:""},chartData:[]}},components:{rateAnalysisChart:f},mounted(){this.setDefaultVal(),this.getTree()},methods:{setDefaultVal(){let t=new Date,e=t.getFullYear(),n=t.getMonth()+1<10?"0"+(t.getMonth()+1):t.getMonth()+1;this.formConfig[0].defaultSelect=e+"-"+n,this.listQuery.timePosition=e+"-"+n},getTree(){(0,o.SI)().then((t=>{this.treeData=t.data,this.eqName=t.data[0].children[0].children[0].name,this.listQuery.name=this.eqName,setTimeout((()=>{this.$refs.deviceTree.setCurrentKey(this.eqName)}),100)})),this.getData()},getData(){(0,g.jD)({...this.listQuery}).then((t=>{console.log(t),0===t.code&&t.data?this.chartData=t.data:this.chartData=[]}))},buttonClick(t){console.log(t),this.listQuery.timePosition=t.timePosition,this.getData()},clickDevice(t){t.children||(this.listQuery.name=t.name,this.eqName=t.name)}}},M=y,Z=(0,h.Z)(M,a,r,!1,null,"1683220e",null),q=Z.exports},5591:function(t,e,n){n.d(e,{FH:function(){return u},Hp:function(){return s},JQ:function(){return i},SI:function(){return o},Vx:function(){return l},WQ:function(){return h},b6:function(){return m},iv:function(){return r},jL:function(){return c},m:function(){return d}});var a=n(8859);function r(){return(0,a.