fix: 大屏接口报错因时间计算在后的bug

This commit is contained in:
caoqianming 2024-03-21 09:06:36 +08:00
parent 25d3aaa0e2
commit 7fe92f1065
1 changed files with 46 additions and 41 deletions

View File

@ -69,7 +69,8 @@
<div id="loadingScreen"> <div id="loadingScreen">
<el-progress type="circle" :percentage="loadedPercent" :width=220 status="warning"> <el-progress type="circle" :percentage="loadedPercent" :width=220 status="warning">
<template #default="{ percentage }"> <template #default="{ percentage }">
<div style="font-size: 30px; color: white; font-weight: bold">{{ percentage }}%</div> <div style="font-size: 30px; color: white; font-weight: bold">{{ percentage }}%
</div>
<div style="font-size: 18px; color: white; margin-top: 10px">工厂模型加载中</div> <div style="font-size: 18px; color: white; margin-top: 10px">工厂模型加载中</div>
</template> </template>
</el-progress> </el-progress>
@ -124,8 +125,8 @@
<img src="img/gz_logo.png" alt="" style="width:100%"> <img src="img/gz_logo.png" alt="" style="width:100%">
</div> </div>
<div class="leftBlock" v-else> <div class="leftBlock" v-else>
<el-progress :width="70" type="circle" color="rgba(54, 217, 187, 1)" :percentage="dialogData.percentage" <el-progress :width="70" type="circle" color="rgba(54, 217, 187, 1)"
id="dashbordProcess"> :percentage="dialogData.percentage" id="dashbordProcess">
<span class="percentage-value" style="font-size: 16px">{{ dialogData.percentage }}%</span> <span class="percentage-value" style="font-size: 16px">{{ dialogData.percentage }}%</span>
</el-progress> </el-progress>
<span>完成进度</span> <span>完成进度</span>
@ -137,12 +138,14 @@
<div class="countWrap"> <div class="countWrap">
<div v-if="dialogData.deptName == '光纤预制管生产车间' || dialogData.deptName == '光学精密加工车间'"> <div v-if="dialogData.deptName == '光纤预制管生产车间' || dialogData.deptName == '光学精密加工车间'">
<p>光纤预制管</p> <p>光纤预制管</p>
<p> <span class="numberFont">{{ dialogData.count_guan }}</span><span class="numberUnit"></span> <p> <span class="numberFont">{{ dialogData.count_guan }}</span><span
class="numberUnit"></span>
</p> </p>
</div> </div>
<div v-if="dialogData.deptName == '光纤预制棒生产车间' || dialogData.deptName == '光学精密加工车间'"> <div v-if="dialogData.deptName == '光纤预制棒生产车间' || dialogData.deptName == '光学精密加工车间'">
<p>光纤预制棒</p> <p>光纤预制棒</p>
<p> <span class="numberFont">{{ dialogData.count_bang }}</span><span class="numberUnit"></span> <p> <span class="numberFont">{{ dialogData.count_bang }}</span><span
class="numberUnit"></span>
</p> </p>
</div> </div>
<div v-if="dialogData.deptName == '玻璃配合料制备车间'"> <div v-if="dialogData.deptName == '玻璃配合料制备车间'">
@ -152,7 +155,8 @@
</div> </div>
<div v-if="dialogData.deptName == '办公楼'"> <div v-if="dialogData.deptName == '办公楼'">
<p style="font-size:12px"> <p style="font-size:12px">
公司秉承善用资源服务建设的核心理念践行材料创造美好世界的企业使命坚持创新绩效和谐责任的核心价值观努力成长为具有创新精神和全球视野的光子材料领先企业</p> 公司秉承善用资源服务建设的核心理念践行材料创造美好世界的企业使命坚持创新绩效和谐责任的核心价值观努力成长为具有创新精神和全球视野的光子材料领先企业
</p>
</div> </div>
</div> </div>
</div> </div>
@ -195,11 +199,13 @@
</div> </div>
<div v-if="currentData.deptName == '玻璃配合料制备车间'"> <div v-if="currentData.deptName == '玻璃配合料制备车间'">
<p>配粉重量</p> <p>配粉重量</p>
<p> <span class="numberFont">{{ currentData.count }}</span><span class="numberUnit">kg</span> <p> <span class="numberFont">{{ currentData.count }}</span><span
class="numberUnit">kg</span>
</p> </p>
</div> </div>
<div v-if="currentData.deptName == '办公楼'"> <div v-if="currentData.deptName == '办公楼'">
<p>公司秉承善用资源服务建设的核心理念践行材料创造美好世界的企业使命坚持创新绩效和谐责任的核心价值观努力成长为具有创新精神和全球视野的光子材料领先企业</p> <p>公司秉承善用资源服务建设的核心理念践行材料创造美好世界的企业使命坚持创新绩效和谐责任的核心价值观努力成长为具有创新精神和全球视野的光子材料领先企业
</p>
</div> </div>
</div> </div>
</div> </div>
@ -256,10 +262,10 @@ export default {
initialBeta: Math.PI / 2, initialBeta: Math.PI / 2,
initialRadius: 2.5, initialRadius: 2.5,
initialTarget: null, initialTarget: null,
scene: null, // scene: null,
myui: null, // myui: null,
resizeTimeout: null, resizeTimeout: null,
engine: null, // engine: null,
loadedPercent: 0, loadedPercent: 0,
currentLightMesh: null, currentLightMesh: null,
infoVisibel: false, infoVisibel: false,
@ -387,8 +393,36 @@ export default {
this.blockTableHeight = height1 + 'px'; this.blockTableHeight = height1 + 'px';
document.getElementById('scrollTable').style.height = height1 + 'px' document.getElementById('scrollTable').style.height = height1 + 'px'
this.showTime(); this.showTime();
this.getDeptDetail(); //
const ondDayTime = 86400000
let cDate = new Date();
let yesterday = new Date(cDate.getTime() - ondDayTime);
let week = yesterday.getDay();//week
// console.log(week);
let weekFirst = week - 1;//
let weekLast = 7 - week;//
if (week == 0) {
weekFirst = 6;
weekLast = 0;//
} else {
weekFirst = week - 1;
weekLast = 7 - week;
}
let first = new Date(new Date(yesterday.getTime() - (weekFirst * ondDayTime)));//
let last = new Date(new Date(yesterday.getTime() + (weekLast * ondDayTime)));//
let dateArr = [];
for (let i = 0; i < 7; i++) {
let itemDate = new Date(first.getTime() + i * ondDayTime);
let item = itemDate.getDate();
dateArr.push(item);
}
this.weekDateList = dateArr;
this.start_date = first.getFullYear() + '-' + (first.getMonth() + 1) + '-' + first.getDate();
this.end_date = last.getFullYear() + '-' + (last.getMonth() + 1) + '-' + last.getDate();
this.yesterday = yesterday.getFullYear() + "-" + (yesterday.getMonth() + 1) + "-" + yesterday.getDate();
this.$nextTick(() => { this.$nextTick(() => {
this.getDeptDetail();
that.getsaleOut(); that.getsaleOut();
that.initDomStyle(); that.initDomStyle();
that.initFactory(); that.initFactory();
@ -422,35 +456,6 @@ export default {
}, 60000); }, 60000);
that.initChart(); that.initChart();
}) })
//
const ondDayTime = 86400000
let cDate = new Date();
let yesterday = new Date(cDate.getTime() - ondDayTime);
let week = yesterday.getDay();//week
// console.log(week);
let weekFirst = week - 1;//
let weekLast = 7 - week;//
if (week == 0) {
weekFirst = 6;
weekLast = 0;//
} else {
weekFirst = week - 1;
weekLast = 7 - week;
}
let first = new Date(new Date(yesterday.getTime() - (weekFirst * ondDayTime)));//
let last = new Date(new Date(yesterday.getTime() + (weekLast * ondDayTime)));//
let dateArr = [];
for (let i = 0; i < 7; i++) {
let itemDate = new Date(first.getTime() + i * ondDayTime);
let item = itemDate.getDate();
dateArr.push(item);
}
this.weekDateList = dateArr;
this.start_date = first.getFullYear() + '-' + (first.getMonth() + 1) + '-' + first.getDate();
this.end_date = last.getFullYear() + '-' + (last.getMonth() + 1) + '-' + last.getDate();
this.yesterday = yesterday.getFullYear() + "-" + (yesterday.getMonth() + 1) + "-" + yesterday.getDate();
this.getsaleOut();
this.getPlanRate(); this.getPlanRate();
this.getMaterialList(); this.getMaterialList();
}, },