water-ldht/dist/static/js/chunk-07132e86.466db2eb.js

7 lines
5.0 KiB
JavaScript

/*!
* build: vue-admin-beautiful
* vue-admin-beautiful author: chuzhixin 1204505056@qq.com
* vue-admin-beautiful QQ Group(QQ群): 972435319、1139183756
* time: 2024-10-10 11:14:28
*/
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-07132e86"],{"17ab":function(t,e,n){"use strict";n.r(e);var a=n("f2bf");const r={id:"personnel",style:{width:"100%",height:"300px"}};function o(t,e,n,o,i,c){return Object(a["openBlock"])(),Object(a["createElementBlock"])("div",r)}n("14d9");var i=n("313e"),c=n("365c"),d=n("5f99"),s={props:{time:{type:Array},all:{type:Boolean,default:!1}},data(){return{chartPie:null,yData:[],xData:[],maintenanceTime:"",isAllProject:!1}},watch:{time(t){this.maintenanceTime=t,this.getInspectionData(),setTimeout(()=>{this.drawCharts()},2e3)},all(t){this.isAllProject=t,this.getInspectionData(),setTimeout(()=>{this.drawCharts()},2e3)}},mounted:function(){},methods:{async getInspectionData(){var t=sessionStorage.getItem("projectId"),e={};e=0==this.isAllProject?{start:Object(d["getDate"])(this.maintenanceTime[0]),end:Object(d["getDate"])(this.maintenanceTime[1]),projectId:t}:{start:Object(d["getDate"])(this.maintenanceTime[0]),end:Object(d["getDate"])(this.maintenanceTime[1])};const{data:n}=await Object(c["getInspectionData"])(e);var a=[],r=[];n.byUser.forEach((function(t,e){e<10&&(a.push(t.key),r.push(t.data))})),this.xData=a,this.yData=r},drawPieChart(){this.chartPie=i["a"](document.getElementById("personnel")),this.chartPie.setOption({tooltip:{trigger:"item",axisPointer:{type:"shadow"}},title:{left:"center",text:"Statistics by personnel"},grid:{left:"3%",right:"4%",bottom:"3%",containLabel:!0},xAxis:[{type:"category",data:this.xData,axisTick:{alignWithLabel:!0}}],yAxis:[{type:"value"}],series:[{name:"Direct",type:"bar",barWidth:"60%",data:this.yData}]})},drawCharts(){this.drawPieChart()}}},u=n("d959"),l=n.n(u);const g=l()(s,[["render",o]]);e["default"]=g},"365c":function(t,e,n){"use strict";n.r(e),n.d(e,"getBasicData",(function(){return r})),n.d(e,"getConsumptionData",(function(){return o})),n.d(e,"getInspectionData",(function(){return i})),n.d(e,"getAlarmData",(function(){return c})),n.d(e,"getTaskData",(function(){return d})),n.d(e,"getAttendanceData",(function(){return s}));var a=n("b775");function r(t){var e="?month="+t.month;return void 0!=t.projectId&&(e+="&projectId="+t.projectId),Object(a["default"])({url:"/overview/basic"+e,method:"get",data:t})}function o(t){var e="?start="+t.start+"&end="+t.end;return void 0!=t.projectId&&(e+="&projectId="+t.projectId),Object(a["default"])({url:"/overview/energyConsumption"+e,method:"get",data:t})}function i(t){var e="?start="+t.start+"&end="+t.end;return void 0!=t.projectId&&(e+="&projectId="+t.projectId),Object(a["default"])({url:"/overview/inspection"+e,method:"get",data:t})}function c(t){var e="?start="+t.start+"&end="+t.end;return void 0!=t.projectId&&(e+="&projectId="+t.projectId),Object(a["default"])({url:"/overview/alarm"+e,method:"get",data:t})}function d(t){var e="?start="+t.start+"&end="+t.end;return void 0!=t.projectId&&(e+="&projectId="+t.projectId),Object(a["default"])({url:"/overview/task"+e,method:"get",data:t})}function s(t){var e="?start="+t.start+"&end="+t.end;return void 0!=t.projectId&&(e+="&projectId="+t.projectId),Object(a["default"])({url:"/overview/attendance"+e,method:"get",data:t})}},"5f99":function(t,e,n){"use strict";function a(t,e){const n=parseInt(t),a=new Date,r=a.getDate(),o=new Date(a.setDate(r+n)),i=o.getFullYear(),c=o.getMonth()+1,d=o.getDate();let s,u;s=c<10?"0"+c:c,u=d<10?"0"+d:d;const l=e||"-";return i+l+s+l+u}function r(t=""){var e=new Date;""!=t&&(e=new Date(t));const n=e.getFullYear();let a=e.getMonth(),r=e.getDate();return a+=1,a=a.toString().padStart(2,"0"),r=r.toString().padStart(2,"0"),`${n}-${a}-${r}`}function o(t=""){var e=new Date;""!=t&&(e=new Date(t));const n=e.getFullYear();let a=e.getMonth();return a+=1,a=a.toString().padStart(2,"0"),`${n}-${a}`}function i(t=""){var e=new Date;""!=t&&(e=new Date(t));const n=e.getFullYear();return""+n}function c(t){const e=new Date,n=e.getFullYear(),a=e.getMonth()+1,r=e.getDate(),o=a-t,i=o<0?o+12:o>10?o:"0"+o,c=a>9?a:"0"+a,d=r>9?r:"0"+r,s=n+"-"+i+"-"+d,u=n+"-"+c+"-"+d;return[s,u]}function d(){const t=new Date,e=t.getFullYear(),n=t.getMonth()+1,a=t.getDate(),r=new Date(t);r.setDate(t.getDate()-1);const o=r.getFullYear(),i=(r.getMonth()+1).toString().padStart(2,"0"),c=r.getDate().toString().padStart(2,"0"),d=n>9?n:"0"+n,s=a>9?a:"0"+a,u=o+"-"+i+"-"+c,l=e+"-"+d+"-"+s;return[u,l]}function s(t){var e=new Date;""!=t&&(e=new Date(t));const n=e.getFullYear();let a=e.getMonth()+1;a=a<10?"0"+a:a;let r=e.getDate();r=r<10?"0"+r:r;let o=e.getHours();o=o<10?"0"+o:o;let i=e.getMinutes();i=i<10?"0"+i:i;let c=e.getSeconds();return c=c<10?"0"+c:c,n+"-"+a+"-"+r+" "+o+":"+i+":"+c}n.r(e),n.d(e,"getFMdate",(function(){return a})),n.d(e,"getDate",(function(){return r})),n.d(e,"getDate1",(function(){return o})),n.d(e,"getDate2",(function(){return i})),n.d(e,"getPastTime",(function(){return c})),n.d(e,"getPastTime1",(function(){return d})),n.d(e,"formatDateTime",(function(){return s}))}}]);