From 73fe3c5574c8fbb7b18fa9b76d53b918f6f921e1 Mon Sep 17 00:00:00 2001
From: wangfei <3597712270@qq.com>
Date: 星期三, 12 十一月 2025 11:09:04 +0800
Subject: [PATCH] 更换前端打包方式,将ip地址配置提取到public

---
 UI-Project/src/views/largescreen/largescreen.vue |  140 +++++++++++++++++++++-------------------------
 1 files changed, 64 insertions(+), 76 deletions(-)

diff --git a/UI-Project/src/views/largescreen/largescreen.vue b/UI-Project/src/views/largescreen/largescreen.vue
index 024ff7a..827d1cf 100644
--- a/UI-Project/src/views/largescreen/largescreen.vue
+++ b/UI-Project/src/views/largescreen/largescreen.vue
@@ -1,17 +1,18 @@
-<template>  
-  <el-card style="flex: 1;margin-left: 1px;margin-top: 10px;margin-right: 1px;" v-loading="loading">
-    <el-scrollbar height="800px">
-  <div style="font-size: 20px;font-weight: bold;">{{ $t('large.loading') }}{{ temperingtotal }} </div>
-  <div id="top" style="height: 150px;display: flex; justify-content: center; align-items: center;">  
-  <div class="echarts-container">
-  <div v-for="(processData, index) in processesData" :key="index" class="echarts-item" @click="showDialog">
-    <div :id="'pieChart_' + index" class="pie-chart"></div>
-  </div>
-</div>
-</div> 
-<div style="display: flex;">
+<template>
+  <div style="height: 500px;">
+    <el-card style="flex: 1;margin-left: 1px;margin-top: 10px;margin-right: 1px;" >
+      <el-scrollbar height="800px">
+        <div style="font-size: 20px;font-weight: bold;">{{ $t('large.loading') }}{{ temperingtotal }}</div>
+        <div id="top" style="height: 150px;display: flex; justify-content: center; align-items: center;">
+          <div class="echarts-container">
+            <div v-for="(processData, index) in processesData" :key="index" class="echarts-item" @click="showDialog">
+              <div :id="'pieChart_' + index" class="pie-chart"></div>
+            </div>
+          </div>
+        </div>
+        <div style="display: flex;">
 <div class="parter" style="margin-top: 10px;margin-left: 150px; height: 240px;width: 1000px;">
-    <img src="../../assets/dpxsa.png" style="margin-left: -10px; width: 100%;height: 100%;" alt="Your Image">
+    <img src="/dpxsa.png" style="margin-left: -10px; width: 100%;height: 100%;" alt="Your Image">
   <div  class="moving-rect lipiana" v-show="woshia"></div>
   <div  class="moving-rect lipianb" v-show="woshia"></div>
   <div  class="moving-rect lipianc" v-show="woshic"></div>
@@ -55,7 +56,7 @@
         <el-table-column prop="deliveryDate" align="center" :label="$t('large.deliveryDate')" min-width="100" />
         <el-table-column fixed="right" :label="$t('large.operate')" align="center" width="100">
           <template #default="scope">
-            <el-button size="mini" type="text" plain @click="handleBinda(scope.row)">{{ $t('large.mes') }}</el-button>
+            <el-button type="text" plain @click="handleBinda(scope.row)">{{ $t('large.mes') }}</el-button>
           </template>
       </el-table-column>
       </el-table>
@@ -74,7 +75,7 @@
         <el-table-column prop="width"  align="center" :label="$t('large.width')" min-width="100" />
         <el-table-column prop="height"  align="center" :label="$t('large.height')" min-width="100" />
         <el-table-column prop="area"  align="center" :label="$t('large.are')" min-width="100" />
-        <el-table-column prop="quantity"  align="center" :label="$t('large.number')" min-width="110" />
+        <el-table-column prop="quantity"  align="center" :label="$t('large.tionnumber')" min-width="110" />
         <el-table-column prop="numberPatches"  align="center" :label="$t('large.numberpatches')" min-width="110" />
         <el-table-column prop="receivedQuantity"  align="center" :label="$t('large.innumber')" min-width="110" />
         <el-table-column prop="terminationStatus"  align="center" :label="$t('large.productstatus')" min-width="110" />
@@ -94,8 +95,6 @@
           </el-table-column> 
         <el-table-column prop="packType"  align="center" :label="$t('large.quantity')" min-width="110" />
         <el-table-column prop="projectNo"  align="center" :label="$t('large.projectnumber')" min-width="110" />
-        <!-- <el-table-column prop="processingNote" fixed align="center" :label="$t('large.method')" min-width="110" /> -->
-        <!-- <el-table-column prop="deliveryDate" fixed align="center" :label="$t('large.deliveryDate')" min-width="130" /> -->
       </el-table>
   <template #footer>
     <div id="dialog-footer" style="text-align: center;">
@@ -104,33 +103,36 @@
   </template>
 </el-dialog>
 <el-dialog v-model="blind" top="10vh" width="70%" >
-  <el-date-picker style="margin-left: 1px;"  v-model="timeRange" type="daterange" format="YYYY/MM/DD" value-format="YYYY-MM-DD"
-  :start-placeholder="$t('large.starttime')" :end-placeholder="$t('large.endtime')" :default-time="defaultTime" />
-    <el-button type="primary" style="margin-left: 10px;margin-top: -6px;" @click="selectReportData()">{{ $t('large.inquire') }}</el-button>
-    <div style="height: 550px;display: flex;margin-top: 10px;justify-content: center; align-items: center;">  
-  <div class="echarts-container">
-  <div v-for="(processData, index) in dialogprocesses" :key="index" class="echarts-item">
-    <div :id="'dialogPieChart_' + index" class="pie-chart"></div>
+  <el-date-picker style="margin-left: 1px;" v-model="timeRange" type="daterange" format="YYYY/MM/DD" value-format="YYYY-MM-DD"
+                  :start-placeholder="$t('large.starttime')" :end-placeholder="$t('large.endtime')"
+                  :default-time="defaultTime"/>
+  <el-button type="primary" style="margin-left: 10px;margin-top: -6px;" @click="selectReportData()">
+    {{ $t('large.inquire') }}
+  </el-button>
+  <div style="height: 550px;display: flex;margin-top: 10px;justify-content: center; align-items: center;">
+    <div class="echarts-container">
+      <div v-for="(processData, index) in dialogprocesses" :key="index" class="echarts-item">
+        <div :id="'dialogPieChart_' + index" class="pie-chart"></div>
+      </div>
+    </div>
   </div>
+</el-dialog>
   </div>
-  </div>
-  </el-dialog> 
-</template>  
-<script setup>  
-import { Delete, Upload } from '@element-plus/icons-vue'
-import { ElMessage, ElMessageBox } from 'element-plus'
-import { ref, onMounted , onBeforeUnmount, reactive, computed, shallowRef, onUnmounted, watchEffect,nextTick  } from "vue";
+</template>
+<script setup>
+import {ElMessage} from 'element-plus'
+import {nextTick, onBeforeUnmount, onMounted, onUnmounted, ref} from "vue";
 import request from "@/utils/request"
-import { WebSocketHost ,host} from '@/utils/constants'
-import { initializeWebSocket, closeWebSocket } from '@/utils/WebSocketService';
-import { useI18n } from 'vue-i18n'
-const { t } = useI18n()
+import {host, WebSocketHost} from '@/utils/constants'
+import {closeWebSocket, initializeWebSocket} from '@/utils/WebSocketService';
+import {useI18n} from 'vue-i18n'
 import * as echarts from 'echarts';
+const {t} = useI18n()
 const tableData = ref([])
 const tableDatab = ref([])
 const tableDatac = ref([])
-const adjustedRects = ref([]);  
-const chartRefs = ref([]);  
+const adjustedRects = ref([]);
+const chartRefs = ref([]);
 const timeRange = ref([])
 const flake = ref(false)
 const flakeb = ref(false)
@@ -149,9 +151,7 @@
 const xiapian6 = ref(false)
 const blind = ref(false)
 const temperingtotal = ref(0)
- 
-const thisProcess = ref(); // 鐢ㄤ簬瀛樺偍process_id鐨勫搷搴斿紡寮曠敤 
-// 瀹氫箟涓�涓搷搴斿紡寮曠敤鏉ュ瓨鍌ㄥ浘琛ㄥ疄渚�    
+const thisProcess = ref();
 const chartDom = ref(null);  
 let chartInstance = null;  
 const blinda = ref(false)
@@ -169,13 +169,11 @@
     if (response.code == 200) {
       ElMessage.success(response.message);
       tableData.value = response.data;
-      console.log(tableData.value);
     } else {
       ElMessage.error(response.message);
     }
 }
 catch (error) {
-    // 澶勭悊閿欒
     console.error(error);
   }
 }
@@ -188,7 +186,7 @@
   case 2:  
     return 'success';  
 }  
-}  
+} 
 function getStatusText(warehousing) {  
 switch (warehousing) {
   case 0:  
@@ -205,15 +203,12 @@
 let socket4 = null;
 let socket5 = null;
 let socket6 = null;
-const socketUrl = `ws://${WebSocketHost}:${host}/api/temperingGlass/api/talk/screen`;
+const socketUrl = `ws://${window.ipConfig.serverUrl}/api/temperingGlass/api/talk/screen`;
 const handleMessage = (data) => {
-// tableData.value = data.awaitingRepairs[0]
 tableDatab.value = data.DoingTask[0]
 tableDatac.value = data.orders[0]
   socket.onmessage = (event) => {  
   const data = JSON.parse(event.data);  
-  console.log(data.device[0]);
-  
   processesData.value = data.device[0].map(rect => ({  
     ...rect,  
     completedQuantity: rect.completedQuantity,  
@@ -230,7 +225,7 @@
   chartRefs.value[index].dom = el;  
 }  
 } 
-const socketUrl2 = `ws://${WebSocketHost}:${host}/api/temperingGlass/api/talk/temperingIsRun`;
+const socketUrl2 = `ws://${window.ipConfig.serverUrl}/api/temperingGlass/api/talk/temperingIsRun`;
 const handleMessage2 = (data) => {
   const tasks = data.temperingTaskType[0];  
     flake.value = tasks.some(task => task.state == 1);
@@ -238,14 +233,14 @@
     flakec.value = tasks.some(task => task.state == 3);
 };
 // 鍗у紡鐞嗙墖
-const socketUrl3 = `ws://${WebSocketHost}:${host}/api/cacheGlass/api/talk/cacheGlassIsRun`;
+const socketUrl3 = `ws://${window.ipConfig.serverUrl}/api/cacheGlass/api/talk/cacheGlassIsRun`;
 const handleMessage3 = (data) => {
     const tasks = data.taskCaches[0];  
   woshia.value = tasks.some(task => task.line == 2001);  
   woshic.value = tasks.some(task => task.line == 2002);  
 };
 // 澶х悊鐗囩
-const socketUrl4 = `ws://${WebSocketHost}:${host}/api/cacheVerticalGlass/api/talk/isRun`;
+const socketUrl4 = `ws://${window.ipConfig.serverUrl}/api/cacheVerticalGlass/api/talk/isRun`;
 const handleMessage4 = (data) => {
     const tasks = data.bigStorageCageDetailsOutTask[0];  
     dalipiana.value = tasks.some(task => task.slot !== null && task.slot !== undefined);  
@@ -253,14 +248,14 @@
 dalipianb.value = taskss.some(task => task.slot !== null && task.slot !== undefined);  
 };
 // 涓婄墖
-const socketUrl5 = `ws://${WebSocketHost}:${host}/api/loadGlass/api/talk/loadGlassIsRun`;
+const socketUrl5 = `ws://${window.ipConfig.serverUrl}/api/loadGlass/api/talk/loadGlassIsRun`;
 const handleMessage5 = (data) => {
     const tasks = data.engineering;  
     shangpian.value = tasks.some(task => task.state == 1);
     temperingtotal.value = data.engineering[0].engineerId
   };
 // 涓嬬墖
-const socketUrl6 = `ws://${WebSocketHost}:${host}/api/unLoadGlass/api/talk/unLoadGlassIsRun`;
+const socketUrl6 = `ws://${window.ipConfig.serverUrl}/api/unLoadGlass/api/talk/unLoadGlassIsRun`;
 const handleMessage6 = (data) => {
   const tasks = data.downWorkstation[0];  
   const tasks1 = data.downGlassTask[0];  
@@ -312,7 +307,6 @@
       }
     ]
   };
- 
   chart.setOption(options);
 });
 };
@@ -354,7 +348,6 @@
       }
     ]
   };
- 
   chart.setOption(options);
 });
 };
@@ -387,7 +380,6 @@
     }
     });
 onBeforeUnmount(() => {
-console.log("鍏抽棴浜�")
 closeWebSocket();
 closeWebSocket2();
 closeWebSocket3();
@@ -405,8 +397,6 @@
     reportingWorkTime2: timeRange.value[1],
   })
   if (response.code === 200) {
-    console.log(response.data);
-    
     dialogprocesses.value = response.data.map(rect => ({  
     ...rect,  
     completedQuantity: rect.completedQuantity,  
@@ -415,14 +405,12 @@
   }));  
   await nextTick();
   renderPieCharts1();
-
     ElMessage.success(response.message);
   } else {
     ElMessage.error(response.message);
   }
 };
-</script>  
- 
+</script>
 <style scoped>  
 .echarts-container {
 display: flex;
@@ -439,19 +427,19 @@
 height: 100%;
 }
 .parter {
-    position: relative;
-    display: inline-block; /* 浣垮鍣ㄥぇ灏忛�傚簲鍥剧墖澶у皬 */
-  width: 1500px;
-  margin-left: -300px
+ position: relative;
+ display: inline-block; /* 浣垮鍣ㄥぇ灏忛�傚簲鍥剧墖澶у皬 */
+ width: 1500px;
+ margin-left: -300px
 }
 img {
-    display: block; /* 璁╁浘鐗囦互鍧楃骇鍏冪礌鏄剧ず */
-    max-width: 100%; /* 纭繚鍥剧墖涓嶈秴鍑哄鍣� */
+ display: block; /* 璁╁浘鐗囦互鍧楃骇鍏冪礌鏄剧ず */
+ max-width: 100%; /* 纭繚鍥剧墖涓嶈秴鍑哄鍣� */
 }
 .moving-rect {
-    width: 100px;
-    height: 50px;
-    position: absolute;
+ width: 100px;
+ height: 50px;
+ position: absolute;
 }
 .longa{
   z-index: 1;
@@ -518,13 +506,13 @@
   margin-left: 293px;
 }
 .xiapianji {
-    width: 20px;
-    height: 10px;
-    background-color: #529b2e;
-    top: 9px;
-    left: 200px;
-    transform: translateX(-50%);
-    animation: move-xiapianji 15s infinite;
+ width: 20px;
+ height: 10px;
+ background-color: #529b2e;
+ top: 9px;
+ left: 200px;
+ transform: translateX(-50%);
+ animation: move-xiapianji 15s infinite;
 }
 @keyframes move-xiapianji {
     0% {

--
Gitblit v1.8.0