emp_ui/dist/static/js/chunk-d38c2e5a.f8a79f67.js

1 line
8.3 KiB
JavaScript

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-d38c2e5a"],{"044e":function(e,t,a){"use strict";a("0c8e")},"0c8e":function(e,t,a){},9406:function(e,t,a){"use strict";a.r(t);var i=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"main-box"},[a("div",{staticClass:"chart-container"},[a("div",{staticClass:"chart",attrs:{id:"DClevel-chart"}}),a("div",{staticClass:"DCAllDept"},[a("div",{staticClass:"radio-group"},[a("div",{staticClass:"chart-radio"},[a("el-radio-group",{attrs:{size:"medium"},on:{change:e.setDefaultDate},model:{value:e.activeButton,callback:function(t){e.activeButton=t},expression:"activeButton"}},[a("el-radio-button",{class:{"is-active":"-1week"===e.activeButton},attrs:{label:"-1week"}},[e._v("Last Week")]),a("el-radio-button",{class:{"is-active":"thisWeek"===e.activeButton},attrs:{label:"thisWeek"}},[e._v("This Week")]),a("el-radio-button",{class:{"is-active":"1week"===e.activeButton},attrs:{label:"1week"}},[e._v("Next Week")]),a("el-radio-button",{class:{"is-active":"1month"===e.activeButton},attrs:{label:"1month"}},[e._v("Next Four Weeks")])],1)],1)]),a("div",{staticClass:"chart1",attrs:{id:"main"}})])])])},n=[],r=a("c7eb"),o=a("ade3"),s=a("1da1"),l=(a("ac1f"),a("1276"),a("d3b7"),a("159b"),a("b680"),a("b0c0"),a("4e82"),a("13d5"),a("313e")),c=(a("5c96"),{name:"Dashboard",data:function(){return{activeButton:"thisWeek",startDate:"",DClevel6WeekDates:[],endDate:"",dataRes:[],data_sort:[],myChart:null,option:null,xAxisData:[],averageData:[],averageTrendLineData:[],averageChart:null}},mounted:function(){this.myChart=l["a"](document.getElementById("main")),this.averageChart=l["a"](document.getElementById("DClevel-chart")),this.setDefaultDate(),this.fetchDCAvgData()},methods:{setDefaultDate:function(){var e=new Date,t=e.getDay(),a=new Date(e.getFullYear(),e.getMonth(),e.getDate()-t-6+1),i=new Date(e.getFullYear(),e.getMonth(),e.getDate()-t+1),n=new Date(e.getFullYear(),e.getMonth(),e.getDate()-t+1+1),r=new Date(e.getFullYear(),e.getMonth(),e.getDate()-t+6+1+1),o=new Date(e.getFullYear(),e.getMonth(),e.getDate()-t+7+1+1),s=new Date(e.getFullYear(),e.getMonth(),e.getDate()-t+13+1+1),l=(new Date(e.getFullYear(),e.getMonth(),e.getDate()-t+14+1+1),new Date(e.getFullYear(),e.getMonth(),e.getDate()-t+20+1+1)),c=(new Date(e.getFullYear(),e.getMonth(),e.getDate()-t+21+1+1),new Date(e.getFullYear(),e.getMonth(),e.getDate()-t+27+1+1)),h=(new Date(e.getFullYear(),e.getMonth(),e.getDate()-t+28+1+1),new Date(e.getFullYear(),e.getMonth(),e.getDate()-t+34+1+1)),u=a.toISOString().split("T")[0],v=i.toISOString().split("T")[0],g=n.toISOString().split("T")[0],D=r.toISOString().split("T")[0],d=o.toISOString().split("T")[0],p=s.toISOString().split("T")[0],f=o.toISOString().split("T")[0],m=l.toISOString().split("T")[0],w=o.toISOString().split("T")[0],x=c.toISOString().split("T")[0],b=o.toISOString().split("T")[0],k=h.toISOString().split("T")[0];this.DClevel6WeekDates.push(u),this.DClevel6WeekDates.push(v),this.DClevel6WeekDates.push(g),this.DClevel6WeekDates.push(D),this.DClevel6WeekDates.push(d),this.DClevel6WeekDates.push(p),this.DClevel6WeekDates.push(f),this.DClevel6WeekDates.push(m),this.DClevel6WeekDates.push(w),this.DClevel6WeekDates.push(x),this.DClevel6WeekDates.push(b),this.DClevel6WeekDates.push(k),"1week"===this.activeButton?(this.startDate=d,this.endDate=p):"1month"===this.activeButton?(this.startDate=b,this.endDate=k):"-1week"===this.activeButton?(this.startDate=u,this.endDate=v):"thisWeek"===this.activeButton&&(this.startDate=g,this.endDate=D),this.fetchAllDeptData()},fetchAllDeptData:function(){var e=this;return Object(s["a"])(Object(r["a"])().mark((function t(){var a,i,n,s,l,c,h,u;return Object(r["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.$API.select.getDeptEfficiency(e.startDate,e.endDate);case 2:if(a=t.sent,e.xAxisData=[],0==a.code){for(e.dataRes=a.data,n=0,s=0,l=0,a.data.forEach((function(e){var t=e.value;"number"!==typeof t||isNaN(t)||(s+=t,l++)})),l>0&&(n=(s/l).toFixed(2)),c=[],h=0;h<e.dataRes.length;h++)u=e.dataRes[h],e.xAxisData.push(u.name),c.push(n);e.option={title:{text:"Service Delivery Engineers Workforce By Team",left:"center"},grid:{containLabel:!0},yAxis:{axisLabel:{formatter:function(e){return 100*e+"%"}}},xAxis:{type:"category",data:e.xAxisData,axisLabel:{interval:0,rotate:270}},visualMap:{type:"piecewise",orient:"horizontal",left:"center",top:"bottom",pieces:[{gt:.9,color:"#EC6602"},{gte:.75,lte:.9,color:"#00646E"},{gte:.5,lte:.75,color:"#00AF8E"},{gte:.35,lte:.5,color:"#00D7A0"},{gte:.2,lte:.35,color:"#00FFB9"},{lt:.2,color:"#FF0000"}],show:!0,min:0,max:1,calculable:!0,textStyle:{color:"#333"},formatter:function(e){return.9===e?"90%-100%":.75===e?"75%-90%":.5===e?"50%-75%":.35===e?"35%-50%":.2===e?"20%-35%":"0-20%"}},toolbox:{show:!0,feature:{mark:{show:!0},dataView:{show:!0,readOnly:!1},magicType:{show:!0,type:["bar","line"]},myTool1:{show:!0,title:"升序",icon:"M810.666667 128l170.666666 213.333333h-128v512h-85.333333V341.333333h-128l170.666667-213.333333z m-213.333334 640v85.333333H128v-85.333333h469.333333z m0-298.666667v85.333334H128v-85.333334h469.333333z m-85.333333-298.666666v85.333333H128V170.666667h384z",onclick:function(){var t=[],a=[];e.dataRes.sort((function(e,t){return e.value-t.value}));for(var i=0;i<e.dataRes.length;i++){var n=e.dataRes[i];a.push(n.name),t.push(n.value)}e.option.xAxis.data=a,e.option.series[0].data=t,e.myChart.setOption(e.option)}},myTool3:{show:!0,title:"还原",icon:"M3.8,33.4 M47,18.9h9.8V8.7 M56.3,20.1 C52.1,9,40.5,0.6,26.8,2.1C12.6,3.7,1.6,16.2,2.1,30.6 M13,41.1H3.1v10.2 M3.7,39.9c4.2,11.1,15.8,19.5,29.5,18 c14.2-1.6,25.2-14.1,24.7-28.5",onclick:function(){var t=[],a=[];e.dataRes.sort((function(e,t){return t.value-e.value}));for(var i=0;i<e.dataRes.length;i++){var n=e.dataRes[i];a.push(n.name),t.push(n.value)}e.option.xAxis.data=a,e.option.series[0].data=t,e.myChart.setOption(e.option)}},saveAsImage:{show:!0}},right:20,top:20},tooltip:{trigger:"axis",axisPointer:{type:"shadow"},formatter:function(e){for(var t="",a=0;a<e.length;a++){var i=e[a].seriesName,n=100*e[a].value;t+=i+": "+n.toFixed()+"%<br>"}return t}},legend:{orient:"vertical",right:10,top:80},series:[{name:"DeptValue",type:"bar",encode:{x:"value",y:"name"},data:e.dataRes,label:(i={show:!0,position:"insideRight",formatter:"{c}"},Object(o["a"])(i,"formatter",(function(e){var t=100*e.value;return t.toFixed()+"%"})),Object(o["a"])(i,"color","#000"),i)},{name:"AverageLine",type:"line",data:c,lineStyle:{color:"#0087BE"}}]},e.myChart.setOption(e.option)}else console.error(error);case 5:case"end":return t.stop()}}),t)})))()},fetchDCAvgData:function(){var e=this;return Object(s["a"])(Object(r["a"])().mark((function t(){var a,i,n,s,l;return Object(r["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.$API.select.getDC6WeekAverage(e.DClevel6WeekDates);case 2:a=t.sent,0==a.code?(e.averageData=a.data,e.averageTrendLineData=a.data,n=0,a.data.length>0&&(s=a.data.reduce((function(e,t){return e+t}),0),n=(s/a.data.length).toFixed(2)),l={title:{text:"Service Delivery Engineers Workforce",left:"center"},grid:{containLabel:!0},yAxis:{axisLabel:{formatter:function(e){return 100*e+"%"}}},xAxis:{type:"category",data:["上周","本周","未来一周","未来两周","未来三周","未来四周"],axisLabel:{interval:0,rotate:270}},visualMap:{orient:"horizontal",left:"center",min:0,max:1,text:[" High "," Low "],dimension:1,inRange:{color:["#00FFB9","#00D7A0","#00AF8E","#00646E"]}},toolbox:{show:!0,feature:{mark:{show:!0},dataView:{show:!0,readOnly:!1},saveAsImage:{show:!0}},right:20,top:20},tooltip:{trigger:"axis",axisPointer:{type:"shadow"},formatter:function(e){for(var t="",a=0;a<e.length;a++){var i=e[a].seriesName;if("TrendLine"!==i){var n=100*e[a].value;t+=i+": "+n.toFixed()+"%<br>"}}return t}},legend:{orient:"vertical",right:10,top:80},series:[{name:"AverageValue",type:"bar",encode:{x:"value",y:"name"},data:e.averageData,label:(i={show:!0,position:"insideRight",formatter:"{c}"},Object(o["a"])(i,"formatter",(function(e){var t=100*e.value;return t.toFixed()+"%"})),Object(o["a"])(i,"color","#000"),i)},{name:"TrendLine",type:"line",data:e.averageTrendLineData,lineStyle:{color:"#FF0000"}},{name:"AverageLine",type:"line",data:[n,n,n,n,n,n],lineStyle:{color:"#0087BE"}}]},e.averageChart.setOption(l)):console.error(error);case 4:case"end":return t.stop()}}),t)})))()}}}),h=c,u=(a("044e"),a("2877")),v=Object(u["a"])(h,i,n,!1,null,null,null);t["default"]=v.exports}}]);