From 55900c9b6519dbe3d0f02f914a1cb2b2be22a6a9 Mon Sep 17 00:00:00 2001
From: lzhe <lzhe@example.com>
Date: 星期三, 15 五月 2024 09:45:21 +0800
Subject: [PATCH] Merge branch 'master' of http://www.beijingsoft.cn:9090/r/smart-web
---
src/views/mdc/realtime-status/index.vue | 13 ++++--
src/views/mdc/status-record.vue | 23 +++++++++--
src/views/mdc/components/recordChartsByDate.vue | 3 -
src/views/mdc/alarm-statistics.vue | 16 +++++---
src/views/mdc/components/recordChartsByWorkstation.vue | 9 ++--
src/views/mdc/components/ShiftAlarm.vue | 5 +-
src/views/mdc/station-live.vue | 22 ++++++++++-
7 files changed, 64 insertions(+), 27 deletions(-)
diff --git a/src/views/mdc/alarm-statistics.vue b/src/views/mdc/alarm-statistics.vue
index 6d41bbd..e37006a 100644
--- a/src/views/mdc/alarm-statistics.vue
+++ b/src/views/mdc/alarm-statistics.vue
@@ -1,7 +1,7 @@
<!--
* @Date: 2024-04-09 22:11:21
* @LastEditors: Sneed
- * @LastEditTime: 2024-04-21 18:58:16
+ * @LastEditTime: 2024-05-14 20:40:54
* @FilePath: /belleson-frontend/Users/mache/Documents/demo/cps-web/src/views/mdc/alarm-statistics.vue
* 鏁堢巼鍒嗘瀽
-->
@@ -26,7 +26,7 @@
</el-main>
<el-footer>
<el-button @click="query()">鏌ヨ</el-button>
- <el-button>瀵煎嚭</el-button>
+ <!-- <el-button>瀵煎嚭</el-button> -->
</el-footer>
</el-container>
</el-aside>
@@ -101,12 +101,16 @@
},
methods: {
query(firstWorkKey) {
+ console.log('------')
let workstationId = firstWorkKey ? [firstWorkKey] : [...this.treeChecked]
- this.$refs[this.activeName].init({
- endDate: this.time[1],
- startDate: this.time[0],
- workstationId
+ this.$nextTick(() => {
+ this.$refs[this.activeName].init({
+ endDate: this.time[1],
+ startDate: this.time[0],
+ workstationId
+ })
})
+
}
}
}
diff --git a/src/views/mdc/components/ShiftAlarm.vue b/src/views/mdc/components/ShiftAlarm.vue
index b8f7cc2..1864fb1 100644
--- a/src/views/mdc/components/ShiftAlarm.vue
+++ b/src/views/mdc/components/ShiftAlarm.vue
@@ -1,7 +1,7 @@
<!--
* @Date: 2024-04-18 21:52:18
* @LastEditors: Sneed
- * @LastEditTime: 2024-04-23 19:45:00
+ * @LastEditTime: 2024-05-14 20:42:32
* @FilePath: /belleson-frontend/Users/mache/Documents/demo/cps-web/src/views/mdc/components/ShiftAlarm.vue
-->
<template>
@@ -89,9 +89,10 @@
},
methods: {
init(params) {
+ this.btnListActive = ''
+ console.log('++++++')
this.params = {
...this.params,
- ...params,
workstationId: params.workstationId.toString()
}
this.getTime({
diff --git a/src/views/mdc/components/recordChartsByDate.vue b/src/views/mdc/components/recordChartsByDate.vue
index 5a9d9a2..f541500 100644
--- a/src/views/mdc/components/recordChartsByDate.vue
+++ b/src/views/mdc/components/recordChartsByDate.vue
@@ -75,7 +75,6 @@
},
getColor(name) {
var color = '';
- console.log(this.achievements,name);
this.achievements.forEach(item=> {
if(item.code == name) {
color = item.color;
@@ -105,7 +104,6 @@
var endTime = moment(item1.endTime).diff(moment(initstart + " 00:00:00"), 'minutes');
var diff = moment(item1.endTime).diff(moment(item1.startTime), 'minutes') //寮�濮嬩簡澶氫箙
var color = this.getColor(item1.wcs);
- console.log(color,222)
item1.value = [index,startTime,endTime,diff];
item1.itemStyle = {"normal": {"color": color}};
item1.code = item.workstationInfo.code;
@@ -116,7 +114,6 @@
})
this.total = res.data.total;
//娓叉煋鍥捐〃
- console.log(yAxisData,newData,111)
this.setCharts(yAxisData,newData);
// 妫�鏌ユ槸鍚﹀瓨鍦╥d涓�'parentNodeDom'鐨凞OM鍏冪礌,鏈夊氨鍏堝垹闄�
var parentNodeDom = document.getElementById('parentNodeDom');
diff --git a/src/views/mdc/components/recordChartsByWorkstation.vue b/src/views/mdc/components/recordChartsByWorkstation.vue
index 61090a3..6aec7e8 100644
--- a/src/views/mdc/components/recordChartsByWorkstation.vue
+++ b/src/views/mdc/components/recordChartsByWorkstation.vue
@@ -11,7 +11,7 @@
import moment from 'moment';
import * as echarts from 'echarts';
export default {
- props: ['setWork','collectionstatus',"select"],
+ props: ['setWork','achievements',"select"],
watch: {
setWork(val) {
this.current = "1";
@@ -67,8 +67,8 @@
},
getColor(name) {
var color = '';
- this.collectionstatus.forEach(item=> {
- if(item.name == name) {
+ this.achievements.forEach(item=> {
+ if(item.code == name) {
color = item.color;
}
})
@@ -90,7 +90,7 @@
var startTime = moment(item1.startTime).diff(moment(initstart + " 00:00:00"), 'minutes');
var endTime = moment(item1.endTime).diff(moment(initstart + " 00:00:00"), 'minutes');
var diff = moment(item1.endTime).diff(moment(item1.startTime), 'minutes') //寮�濮嬩簡澶氫箙
- var color = this.getColor(item1.wcsDesc);
+ var color = this.getColor(item1.wcs);
item1.value = [index,startTime,endTime,diff];
item1.itemStyle = {"normal": {"color": color}};
item1.code = item.date;
@@ -109,7 +109,6 @@
var option = {
tooltip: {
formatter: function (params) {
- console.log(params)
return `<span class="tipdesc">宸ヤ綅</span>${params.data.name}</br>
<span class="tipdesc">鐘舵��</span>${params.data.wcsDesc}</br>
<span class="tipdesc">鎻忚堪</span>${params.data.feedbackDesc}</br>
diff --git a/src/views/mdc/realtime-status/index.vue b/src/views/mdc/realtime-status/index.vue
index 1664d1d..3aa324f 100644
--- a/src/views/mdc/realtime-status/index.vue
+++ b/src/views/mdc/realtime-status/index.vue
@@ -37,16 +37,16 @@
<el-icon><ArrowRight /></el-icon>
</div>
<div class="status-content-cardp" v-for="item in timestatus" style="width: 33.3333%; height: 50%;">
- <div class="status-card-box" style="border-color: rgb(89, 89, 89);">
+ <div class="status-card-box" style="border-color: #ccc;">
<div class="status-card-top">
<div class="status-card-detail">
<div title="461" class="status-card-detail-name">{{item.code}}</div>
<div class="status-card-detail-status">
- <div class="status-card-detail-point" style="background-color: rgb(89, 89, 89);"></div>{{item.statusName}}
- <div class="status-card-detail-time" style="color: rgb(89, 89, 89);">---</div>
+ <div class="status-card-detail-point" :style="{'background-color': item.statusStyle}"></div>{{item.statusName}}
+ <div class="status-card-detail-time" style="color: #ccc;">---</div>
</div>
</div>
- <div class="status-card-machine" style="border-color: rgb(89, 89, 89);">
+ <div class="status-card-machine" style="border-color: #ccc;">
<div class="status-card-machine-img">
<img src="./station.png" width="68" height="68">
</div>
@@ -92,6 +92,7 @@
},
data() {
return {
+ statusStyle: "#ccc",
titleMap: "",
visible: false,
visibleList: [],
@@ -149,7 +150,7 @@
var visibleList = JSON.parse(JSON.stringify(item.properties));
visibleList.forEach(item=> {
if(item.statusName) {
- item.namecolor = "rgb(89, 89, 89)";
+ item.namecolor = "#ccc";
item.statuscolor = "rgba(89, 89, 89, 0.14)";
}else {
item.namecolor = "rgb(127, 192, 192)";
@@ -195,12 +196,14 @@
var records = JSON.parse(JSON.stringify(res.data.records));
records.forEach(item=> {
item.statusName = "鏈煡";
+ item.statusStyle = '#ccc';
if(item.properties != null) {
item.properties.forEach(item1=> {
this.devicestatus.forEach(item2=> {
if(item2.status == item1.value) {
item.statusName = item2.statusName;
item1.statusName = item2.statusName;
+ item.statusStyle = item2.color;
}
})
})
diff --git a/src/views/mdc/station-live.vue b/src/views/mdc/station-live.vue
index f9f8bf6..4a63168 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)
}
})
},
diff --git a/src/views/mdc/status-record.vue b/src/views/mdc/status-record.vue
index f1b7877..91971d6 100644
--- a/src/views/mdc/status-record.vue
+++ b/src/views/mdc/status-record.vue
@@ -72,7 +72,7 @@
</div>
</div>
<!-- setWork 鍏ュ弬 -->
- <record-charts-by-workstation :setWork="setWork" :select="select" :collectionstatus="collectionstatus" v-if="!isshowempty"></record-charts-by-workstation>
+ <record-charts-by-workstation :setWork="setWork" :select="select" :achievements="achievements" v-if="!isshowempty"></record-charts-by-workstation>
</div>
</div>
<save-dialog v-if="dialog.save" ref="saveDialog" @success="addfeedbackSuccess" :workstationId="lastLevelId" @closed="dialog.save=false"></save-dialog>
@@ -166,12 +166,19 @@
},
methods: {
addfeedbackSuccess() {
+ var workstationName = "";
+ this.btnGongweiList.forEach(item=> {
+ if(item.id == this.btnGongweiListActive) {
+ workstationName = item.name;
+ }
+ })
this.setWork = {
endDate: this.time[1],
startDate: this.time[0],
humanFeedback: true,
machineFeedback: true,
- workstationId: this.lastLevelId
+ workstationId: this.lastLevelId,
+ workstationName: workstationName
}
},
table_edit(){
@@ -206,12 +213,19 @@
changeTabGongwei(item) { //鎸夊伐浣嶆煡璇�
this.btnGongweiListActive = item.id;
this.lastLevelId = this.btnGongweiListActive;
+ var workstationName = "";
+ this.btnGongweiList.forEach(item=> {
+ if(item.id == this.btnGongweiListActive) {
+ workstationName = item.name;
+ }
+ })
this.setWork = {
endDate: this.time[1],
startDate: this.time[0],
humanFeedback: true,
machineFeedback: true,
- workstationId: item.id
+ workstationId: item.id,
+ workstationName: workstationName
}
},
getachievements() { //鐝鐘舵�佽褰曢噰闆嗙姸鎬�
@@ -272,7 +286,8 @@
startDate: this.time[0],
humanFeedback: true,
machineFeedback: true,
- workstationId: this.select[0].id
+ workstationId: this.select[0].id,
+ workstationName: this.btnGongweiList[0].name
}
this.isshowempty = false;
}
--
Gitblit v1.9.3