From a7b6aa5c857c091bc53a9f02fed855d926ecb90a Mon Sep 17 00:00:00 2001
From: lzhe <181968431@qq.com>
Date: 星期二, 14 五月 2024 23:43:48 +0800
Subject: [PATCH] 1
---
src/views/mdc/station-live.vue | 28 +++++++++++++++++++++++-----
1 files changed, 23 insertions(+), 5 deletions(-)
diff --git a/src/views/mdc/station-live.vue b/src/views/mdc/station-live.vue
index 0afc929..a07a20f 100644
--- a/src/views/mdc/station-live.vue
+++ b/src/views/mdc/station-live.vue
@@ -116,6 +116,7 @@
<save-dialog v-if="dialog.save" ref="saveDialog" @success="addfeedbackSuccess" :workstationId="lastLevelId" @closed="dialog.save=false"></save-dialog>
</template>
<script>
+ import moment from 'moment'
import * as echarts from 'echarts';
import saveDialog from './add-station-status'
export default {
@@ -233,7 +234,7 @@
},
xAxis: {
type: 'category',
- data: ['00:00:00', '02:00:00', '04:00:00', '06:00:00', '08:00:00', '10:00:00', '12:00:00', '14:00:00', '18:00:00'],
+ data: [],
},
yAxis: {
type: 'category',
@@ -364,6 +365,24 @@
item.value = 0;
})
this.wcsOptionLog.series[0].data = res.data;
+ //璁$畻鏃堕棿
+ var startOfDay = moment().startOf('day'); //00:00:00
+ var now = moment(); //褰撳墠鏃堕棿
+ var diffInMilliseconds = now.diff(startOfDay); //鏃堕棿宸�
+ var diffInHours = Math.floor(diffInMilliseconds / (1000 * 60 * 60)); //鏃堕棿宸浆鎹㈡垚灏忔椂
+ //鍒嗗壊
+ var everTime = Math.ceil(diffInHours/8);
+ var arrData = [];
+ for(var i=0;i<=diffInHours;i+=everTime) {
+ if(i<=10) {
+ var num = '0' + i;
+ }else {
+ var num = i;
+ }
+ arrData.push(num + ':00:00');
+ }
+ //璁$畻鏃堕棿缁撴潫
+ this.wcsOptionLog.xAxis.data = [...arrData,moment().format("HH:mm:ss")];
myChart.setOption(this.wcsOptionLog);
}
})
@@ -458,7 +477,6 @@
this.$HTTP.get(`/api/blade-cps/workstation/get-dmp-variables?machineId=${machineId}&workstationId=${lastLevelId}`).then(res=> {
if(res.code == 200) {
this.dmpList = res.data;
- console.log(this.dmpList,1)
}
})
},
@@ -763,7 +781,7 @@
position: absolute;
right: 10px;
top: -2px;
- color: #3b8e8e;
+ color: #409eff;
cursor: pointer;
}
.status-wrap.align-left, .status-wrap:first-child {
@@ -776,7 +794,7 @@
justify-content: start;
}
.collect-status {
- color: #3b8e8e;
+ color: #409eff;
margin-right: 16px;
font-size: 14px;
}
@@ -803,6 +821,6 @@
flex-wrap: wrap;
}
.status-wrap /deep/ .el-checkbox.el-checkbox--large {
- color: #3b8e8e;
+ color: #409eff;
}
</style>
\ No newline at end of file
--
Gitblit v1.9.3