qinhb 5 ヶ月 前
コミット
e5f9c115b9
3 ファイル変更19 行追加13 行削除
  1. 2 2
      .env.development
  2. 1 1
      .env.production
  3. 16 10
      src/components/RealTimeMsg/index.vue

+ 2 - 2
.env.development

@@ -11,9 +11,9 @@ VITE_APP_BASE_API = '/dev-api'
 VITE_APP_UPLOAD_URL = 'http://10.88.11.201:9000'
 
 # 开发接口地址
-VITE_APP_API_URL = 'http://10.88.11.200:8079'
+VITE_APP_API_URL = 'http://127.0.0.1:8079'
 # Websocket地址
-VITE_WEBSOCKET_URL = 'ws://10.88.11.200:8079'
+VITE_WEBSOCKET_URL = 'ws://127.0.0.1:8079'
 ``
 # 是否启用 Mock 服务
 VITE_MOCK_DEV_SERVER = false

+ 1 - 1
.env.production

@@ -12,4 +12,4 @@ VITE_APP_API_URL = ''
 
 
 # Websocket地址
-VITE_WEBSOCKET_URL = 'ws://10.88.11.200:8079'
+VITE_WEBSOCKET_URL = 'ws://192.168.0.100:8079'

+ 16 - 10
src/components/RealTimeMsg/index.vue

@@ -37,27 +37,27 @@
       </el-tooltip>
     </div>
     <!-- 静电环状态样式 -->
-    <!-- <div class="staticBox">
+     <div class="staticBox">
       <div :class="braceletState == 0 ? 'static type0' : 'static type1'">
         <div class="titleText">静电手环状态:</div>
         <div class="titleText state">
           {{ braceletState == 0 ? "离线" : "在线" }}
         </div>
       </div>
-      <el-button
+<!--      <el-button
         v-if="braceletState == 0"
         type="primary"
         class="staticBtn"
         @click="submit(item, index)"
         >重新检测</el-button
-      >
-    </div> -->
-    <!-- <div class="lightsBox">
-      <div><div class="titleText">电烙铁状态:</div></div>
-      <div class="light" :class="{ activeLight0: lightIndex == 0 }"></div>
+      >-->
+    </div>
+     <div class="lightsBox">
+      <div><div class="titleText">电烙铁温度:{{dltValue}}℃</div></div>
+<!--      <div class="light" :class="{ activeLight0: lightIndex == 0 }"></div>
       <div class="light" :class="{ activeLight1: lightIndex == 1 }"></div>
-      <div class="light" :class="{ activeLight2: lightIndex == 2 }"></div>
-    </div> -->
+      <div class="light" :class="{ activeLight2: lightIndex == 2 }"></div>-->
+    </div>
   </div>
 </template>
 
@@ -74,6 +74,7 @@ const porps = defineProps({
 });
 //true关闭 false打开
 const showStatus = ref(true);
+const dltValue = ref(0)
 const lightIndex = ref(null);
 const setExcelVal = (row, col, value) => {
   if (window.luckysheet) {
@@ -138,6 +139,11 @@ const addWebSocket = () => {
           JSON.parse(receivedMessage).content
         );
         break;
+      case "15":
+        let json = JSON.parse(receivedMessage).content;
+        braceletState.value = Number.parseInt(json.state);
+        dltValue.value = Number.parseInt(json.temp);
+        break;
     }
   };
   ws.value.onclose = () => {
@@ -246,7 +252,7 @@ onUnmounted(() => {
 .staticBox {
   position: fixed;
   top: 10px;
-  left: 10px;
+  left: 100px;
   display: flex;
   align-items: center;
   .static {