From 831cfa4c439c6d073d706a82d2a439f8b1818498 Mon Sep 17 00:00:00 2001
From: yangys <y_ys79@sina.com>
Date: 星期二, 18 十一月 2025 16:59:50 +0800
Subject: [PATCH] Merge branch 'new' of http://www.beijingsoft.cn:9090/r/smart-web into new

---
 src/views/mdc/station-live.vue |  189 ++++++++++++++++++++++++++++++++++-------------
 1 files changed, 137 insertions(+), 52 deletions(-)

diff --git a/src/views/mdc/station-live.vue b/src/views/mdc/station-live.vue
index 6aa3a6a..04af844 100644
--- a/src/views/mdc/station-live.vue
+++ b/src/views/mdc/station-live.vue
@@ -1,8 +1,8 @@
 <!--
  * @Author: lzhe lzhe@example.com
  * @Date: 2024-03-26 10:28:33
- * @LastEditors: lzhe lzhe@example.com
- * @LastEditTime: 2024-11-08 18:26:10
+ * @LastEditors: 鏉庡枂(寮�鍙戠粍) lzhe@yxqiche.com
+ * @LastEditTime: 2025-11-18 16:57:42
  * @FilePath: /smart-web/src/views/master/person/main/index.vue
  * @Description: 杩欐槸榛樿璁剧疆,璇疯缃甡customMade`, 鎵撳紑koroFileHeader鏌ョ湅閰嶇疆 杩涜璁剧疆: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 -->
@@ -10,10 +10,54 @@
 	<div class="aposcope-main">
 		<div class="aposcope-left">
 			<!-- <div class="left-title">鏌ヨ鏉′欢</div> -->
-			<MYTree v-model="treeChecked" @loaded="query"></MYTree>
+			<MYTree v-model="treeChecked" @loaded="query" :isSelectId="$route.query.code"></MYTree>
 		</div>
 		<div class="aposcope-right">
-			<div class="content-machine-box">
+			<div class="content-machine-box" style="min-height: 450px;">
+				<div class="content-one content-border">
+					<div style="text-align: center;margin-bottom: 12px;margin-top:12px;">
+						<el-date-picker v-model="wcsDate" type="date" @change="wcschangedate" value-format="YYYY-MM-DD" size="small" />
+					</div>
+					<stationLiveItem :getwcsRData="getwcsRData"></stationLiveItem>
+				</div>
+				<div class="content-two content-border">
+					<tationLiveSpeed :dmpList="dmpList"></tationLiveSpeed>
+				</div>
+				<div class="content-three content-border">
+					<speenBaseInfo :stationFormData="stationForm" :dmpList="dmpList"></speenBaseInfo>
+				</div>
+			</div>
+			<div class="dataHr"></div>
+			<div class="content-zhou-box">
+				<div class="zhou-one content-zhou-border">
+			    	<div><div id="wcs-left" style="width: 100%;height:340px;"></div></div>
+				</div>
+				<div class="zhou-two content-zhou-border">
+					<el-table :data="tableData2" style="width: 100%;height:340px;">
+						<el-table-column prop="test" label="杞�"></el-table-column>
+						<el-table-column prop="test" label="鍧愭爣"></el-table-column>
+						<el-table-column prop="test" label="鎵煩"></el-table-column>
+					</el-table>
+				</div>
+				<div class="zhou-three content-zhou-border">
+					<el-table :data="alarmtableData" style="height:300px;">
+						<el-table-column prop="alarmCode" label="鎶ヨ鍙�"></el-table-column>
+						<el-table-column prop="alarmMsg" label="鎶ヨ鍐呭"></el-table-column>
+						<el-table-column prop="alarmTime" label="鎶ヨ鏃堕棿"></el-table-column>
+					</el-table>
+					<el-pagination
+						style="margin-top: 6px;padding-left: 6px;padding-right: 6px;width: 450;position:absolute;right:0;"
+						@size-change="alarmSizeChange"
+						@current-change="alarmCurrentChange"
+						:current-page="alarmsearchData.current"
+						:page-size="15"
+						layout="total, prev, pager, next"
+						:total="alarmtotal">
+					</el-pagination>
+				</div>
+			</div>
+			<div>------------------------------------</div>
+			<!-- <div class="content-machine-box">
 				<div class="content-machine-img"><img :src="stationForm.avatar" alt=""></div>
 				<div class="content-machine-detail">
 					<div class="content-machine-name">{{stationForm.machineName}}</div>
@@ -34,13 +78,10 @@
 						</el-row>
 					</el-form>
 				</div>
-			</div>
-			<div class="collect-info-panel">
+			</div> -->
+			<!-- <div class="collect-info-panel">
 				<div class="fact-analysis-realtim">
 					<div class="wimi-empty" style="background-color: rgb(255, 255, 255);" v-if="dmpList.length == 0">
-						<!-- <div class="wimi-empty-img" style="width: 150px; height: 150px;">
-							<img src="./quesheng.bd026700.png" style="height: auto; width: 100%;">
-						</div> -->
 						<div class="empty-description">
 							<div>鏆傛棤鏁版嵁</div>
 						</div>
@@ -51,17 +92,14 @@
 					</div>
 				</div>
 			</div>
-			
 			<el-tabs type="border-card" class="demo-tabs">
 			    <el-tab-pane label="宸ヤ綅鏁版嵁">
 					<div style="text-align: right;margin-bottom: 14px;">
 						<el-date-picker v-model="wcsDate" type="date" @change="wcschangedate" value-format="YYYY-MM-DD" size="small" />
 					</div>
 			    	<div class="wcs-main">
-			    		<div><div id="wcs-left" style="width: 100%;height:400px;"></div></div>
 			    		<div><div id="wcs-right" style="width: 100%;height:400px;"></div></div>
 			    	</div>
-					
 			    </el-tab-pane>
 			    <el-tab-pane label="鏈哄櫒灞ュ巻">
 					<div class="alarm-title">鎶ヨ淇℃伅灞ュ巻</div>
@@ -81,8 +119,7 @@
 						:total="alarmtotal">
 					</el-pagination>
 				</el-tab-pane>
-			 </el-tabs>
-
+			 </el-tabs> -->
 			 <div class="bottom-panel content-panel">
 				<div class="panel-title">鐝鐘舵�佽褰�</div>
 				<div class="panel-content bottom-panel-chart">
@@ -132,10 +169,18 @@
 	import * as echarts from 'echarts';
 	import saveDialog from './add-station-status';
 	import MYTree from './MYTree.vue';
+	import stationLiveItem from './components/StationLiveItem';  //楗肩姸鍥�
+	import tationLiveSpeed from './components/StationLiveSpeed';  //speed
+	import speenBaseInfo from './components/speenBaseInfo';  //speenBaseInfo
 	export default {
 		name: "state-feedback",
 		data(){
 			return {
+				currentPage4: 1,
+				getwcsRData: [],
+				tableData1: [],
+				tableData2: [],
+				tableData3: [],
 				treeChecked: [],
 				achievements: [],
 				collectionstatus: [],
@@ -151,9 +196,6 @@
 		                	fontSize:14
 		                }
 		            },  
-		            grid: {
-		            	top: 0,
-		            },
 		            tooltip: {  
 		                trigger: 'item',  
 		                //formatter: '{a} <br/>{b} : {c} ({d}%)'  
@@ -162,15 +204,14 @@
 		            legend: {  
 		                orient: 'vertical',  
 		                bottom: 'bottom',  
-		                data: ['璋冭瘯', '绂荤嚎', '寰呮満', '鎶ュ憡', '鎶ヨ', '杩愯']  
+		                data: ['璋冭瘯', '绂荤嚎', '寰呮満', '鎶ュ憡', '鎶ヨ', '杩愯']
 		            },  
 		            series: [  
-		                {  
-		                	top: -30,
+		                {
 		                    name: '鐢ㄦ椂:',  
 		                    type: 'pie',  
 		                    radius: '55%',  
-		                    center: ['40%', '50%'],  
+		                    center: ['50%', '50%'],  
 		                    data: [],  
 							itemStyle: {
 								borderRadius: 10,
@@ -296,18 +337,19 @@
 			}
 		},
 		created(){
-			
+		
 		},
 		watch: {
 			treeChecked() {
-				this.query()
+				this.query();
 			}
 		},
 		mounted(){
 			this.newDate();  //鑾峰彇褰撳墠鏃ユ湡
+			this.getachievements();
 		},
 		components: {
-			saveDialog,MYTree
+			saveDialog,MYTree,stationLiveItem,tationLiveSpeed,speenBaseInfo
 	    },
 		methods: {
 			table_edit(){
@@ -613,15 +655,16 @@
 				}
 				this.$HTTP.post(`/api/mdc/status-record/equipment-efficiency`,obj).then(res=> {
 					if(res.code == 200) {
-						var myChart = echarts.init(document.getElementById('wcs-right')); 
+						//var myChart = echarts.init(document.getElementById('wcs-right')); 
 						res.data.forEach(item=> {
 							item.value = (Number(item.value)*100).toFixed(2);
 							if(item.name == "杩愯鐜�") item.itemStyle = {color: '#73d13d'};
 							if(item.name == "鎶ヨ鐜�") item.itemStyle = {color: '#ff4d4f'};
 							if(item.name == "绋煎姩鐜�") item.itemStyle = {color: '#40a9ff'};
 						})
-						this.wcsOptionR.series[0].data = res.data;	
-						myChart.setOption(this.wcsOptionR);
+						//this.wcsOptionR.series[0].data = res.data;
+						this.getwcsRData = res.data;  //鏂板浘褰�
+						//myChart.setOption(this.wcsOptionR);
 					}
 				})
 			},
@@ -664,53 +707,54 @@
 							workstationIdList: this.treeChecked
 						}
 						if(res.data.dpConfig == null || res.data.dpConfig.length == 0) return;  //娌″�间笉鐢ㄥ惊鐜�
+
 						if(this.$TOOL.socket.websocket == null) {  //娌℃湁寤虹珛鍏堝缓绔�
 							this.$TOOL.socket.connectToWebSocket(this.$TOOL.cookie.get("TOKEN")); 
 						}
-						this.$TOOL.socket.sendDataToWebSocket(obj);  //鍙戦��
+						var intervalId123 = setInterval(function () {
+							if (that.$TOOL.socket.websocket.readyState == 1) {
+								clearInterval(intervalId123);
+								that.$TOOL.socket.sendDataToWebSocket(obj);  //鍙戦��
+							}
+						}, 500);
 						this.$TOOL.socket.websocket.onmessage = function(event) {  
 							var JSONData = JSON.parse(res.data.dpConfig);
+							var SpindleLoad = JSONData.some(obj => obj.dpName === 'spindleLoad'); //鍒ゆ柇鏄惁鏈変富杞磋礋杞�(SpindleLoad)锛�
+							var SpindleRate = JSONData.some(obj => obj.dpName === 'spindleRate'); //鍒ゆ柇鏄惁鏈変富杞村�嶇巼(SpindleRate)锛�
+							var FeedRate = JSONData.some(obj => obj.dpName === 'feedRate'); //鍒ゆ柇鏄惁鏈夎繘缁欏�嶇巼(FeedRate)锛�
+							if(!SpindleLoad) JSONData.push({dpName: "spindleLoad",dpLabel: "涓昏酱璐熻浇"});
+							if(!SpindleRate) JSONData.push({dpName: "spindleRate",dpLabel: "涓昏酱鍊嶇巼"});
+							if(!FeedRate) JSONData.push({dpName: "feedRate",dpLabel: "杩涚粰鍊嶇巼"});
 							var eventData = JSON.parse(event.data);
-							if(Object.keys(eventData.data).length == 0) return;
 					        JSONData.forEach((item,index)=> {  //绗竴姝ユ妸v鏀惧埌code閲�
 							    if(item.dpName == "DeviceStatus") {  //鏈哄櫒鐘舵��
 									if(eventData.data[item.dpName]) {
 										item.code = eventData.data[item.dpName].v;
 									}
+									setTimeout(()=> {
+										console.log(that.allwcs,888)
+									},5000)
 							        that.allwcs.forEach((item1)=> {
 							        	if(item.code == item1.code) {
 							        		item.codeName = item1.name;    //绗簩姝ユ妸v鐨刢ode鍜岃繍琛屽搴�
-							        		item.color = item1.color;
 							        	}
 							        })
 							    }else {
 							    	if(item.dpName == 'Alarm') {  //鎶ヨ
 										if(eventData.data[item.dpName]) {
-											var v = JSON.parse(eventData.data[item.dpName].v);
-											if(Array.isArray(v)) {  //濡傛灉鏄暟缁勶紝涓嶈祴鍊�
-												if(v.length == 0) {
-													JSONData.splice(index,1);
-												}else {
-													item.codeName = v[0].msg;
-												}
-											}else {
-												item.codeName = v.msg;
-											}
+											item.codeName = eventData.data[item.dpName].v;
 										}
 							    	}else {
 										if(eventData.data[item.dpName]) {
 											item.codeName = eventData.data[item.dpName].v;
-										}else {
-											item.codeName = "";
+										}else {  //ws娌℃湁鐨勬儏鍐�
+											if(item.dpName == "spindleLoad" || item.dpName == "spindleRate" || item.dpName == "feedRate") {
+												item.codeName = 0;
+											}else {
+												item.codeName = "";
+											}
 										}
 							    	}
-									that.allwcs.forEach((item1)=> {
-							        	if(item.code == item1.code) {
-							        		item.color = item1.color;
-							        	}else {
-											item.color = "#7FC0C0";
-										}
-							        })
 							    }
 							});
 							that.dmpList = JSONData;
@@ -803,15 +847,44 @@
     color: #fff;
     border-radius: 2px 2px 0 0;
 }
-.content-machine-box {
+.content-machine-box,.content-zhou-box {
 	display: flex;
-	align-items: center;
+	align-items: flex-start;
 	flex-direction: row;
     flex-wrap: nowrap;
     align-content: center;
     justify-content: flex-start;
-    background-color: rgba(59, 142, 142, .06);
     border-radius: 2px;
+	border: 1px solid #ccc;
+}
+.content-border {
+	height: 100%;
+}
+.content-zhou-border {
+	height: 100%;
+}
+.content-one {
+	width: 25%;
+}
+.content-two,.zhou-three {
+	flex: 1;
+	position: relative;
+}
+.content-two {
+	border-left: 1px solid #eee;
+	border-right: 1px solid #eee;
+	min-height: 450px;
+}
+.content-three {
+	width: 25%;
+}
+.zhou-one {
+	width: 330px;
+}
+.zhou-two {
+	width:28%;
+	border-left: 1px solid #eee;
+	border-right: 1px solid #eee;
 }
 .content-machine-img {
 	margin: 14px;
@@ -1016,4 +1089,16 @@
 	display: inline-block;
 	border-bottom: 1px solid #eee;
 }
+.dataHr {
+    background-color: #48ACF8;
+    height: 30px;
+    width: 100%;
+    text-align: center;
+    line-height: 30px;
+    font-size: 13px;
+    color: #fff;
+    font-weight: bold;
+    margin-top: 12px;
+    margin-bottom: 12px;
+}
 </style>
\ No newline at end of file

--
Gitblit v1.9.3