Commit c92bdf1f authored by xxx's avatar xxx

1

parent 3476eb01
......@@ -42,11 +42,11 @@ export default {
//矿石开采效率
exploitationEfficiencyData:{
rate1:[0.5],
dayYield1:50,
dayMil1:30,
dayYield1:0,
dayMil1:0,
rate2:[0.5],
dayWorkTime2:8,
dayYield2:50,
dayWorkTime2:0,
dayYield2:0,
},
}
},
......@@ -56,11 +56,43 @@ export default {
methods:{
loadData(){
//矿石开采效率
HttpReq.truckDispatching.apiManmadesCheDayQueryDay({createTime:this.dayCurrentTimeFn(),size:9999,page:0}).then((res) => {
if(res.code == 200){
let text1 = 0;
let text2 = 0;
let text3 = 0;
res.data.forEach((item,index)=>{
text1 = text1 + (item.weight ? parseFloat(item.weight) : 0);
text2 = text2 + (item.mil ? parseFloat(item.mil) : 0);
text3 = text3 + (item.time ? parseFloat(item.time) : 0);
});
this.exploitationEfficiencyData.dayYield1 = text1;
this.exploitationEfficiencyData.dayMil1 = text2.toFixed(3);
this.exploitationEfficiencyData.dayWorkTime2 = text3;
this.exploitationEfficiencyData.dayYield2 = text1;
}
})
this.initLiquidEchart1();
this.initLiquidEchart2();
this.DPcomputer8BoxTimer = setInterval(() => {
//矿石开采效率
HttpReq.truckDispatching.apiManmadesCheDayQueryDay({createTime:this.dayCurrentTimeFn(),size:9999,page:0}).then((res) => {
if(res.code == 200){
let text1 = 0;
let text2 = 0;
let text3 = 0;
res.data.forEach((item,index)=>{
text1 = text1 + (item.weight ? parseFloat(item.weight) : 0);
text2 = text2 + (item.mil ? parseFloat(item.mil) : 0);
text3 = text3 + (item.time ? parseFloat(item.time) : 0);
});
this.exploitationEfficiencyData.dayYield1 = text1;
this.exploitationEfficiencyData.dayMil1 = text2.toFixed(3);
this.exploitationEfficiencyData.dayWorkTime2 = text3;
this.exploitationEfficiencyData.dayYield2 = text1;
}
})
this.initLiquidEchart1();
this.initLiquidEchart2();
},10000)
......@@ -176,6 +208,23 @@ export default {
});
}, 50)
},
//获取当前时间
dayCurrentTimeFn(){
var date = new Date();
var year = date.getFullYear(); //年 ,从 Date 对象以四位数字返回年份
var month = date.getMonth() + 1; //月 ,从 Date 对象返回月份 (0 ~ 11) ,date.getMonth()比实际月份少 1 个月
var day = date.getDate(); //日 ,从 Date 对象返回一个月中的某一天 (1 ~ 31)
//修改月份格式
if (month >= 1 && month <= 9) {
month = "0" + month;
}
//修改日期格式
if (day >= 0 && day <= 9) {
day = "0" + day;
}
let currentFormatDate = year + "-" + month + "-" + day;
return currentFormatDate
},
},
beforeDestroy(){
if(this.DPcomputer8BoxTimer) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment