Browse Source

Merge remote-tracking branch 'origin/dev-frontend'

panqiuyao 8 months ago
parent
commit
61eb34ddf4

+ 9 - 1
frontend/src/stores/modules/check.ts

@@ -7,6 +7,7 @@ import {ElMessage} from "element-plus";
 const socketStore = socket();
 const clientStore = client();
 
+
 export const checkInfo = defineStore('checkInfo', () => {
 
     // 定义设备列表
@@ -37,6 +38,7 @@ export const checkInfo = defineStore('checkInfo', () => {
     const checkTime = ref(0)
     let CKTimerInterval:any = null
     let CKCamControlInterval:any = null
+    let init_mcu_type = ref(true)
     const isCheckStatus = ref(true)
     const set_isCheckStatus = (value)=>{
         isCheckStatus.value = value
@@ -133,7 +135,12 @@ export const checkInfo = defineStore('checkInfo', () => {
                         console.log(result);
                         if(result.status === 2 ){
                             if(!mcu.isInitSend){
-                                socketStore.sendMessage({ type: 'init_mcu' });
+                                socketStore.sendMessage({
+                                    type: 'init_mcu',
+                                    data:{
+                                        value:init_mcu_type.value
+                                    }
+                                });
                                 mcu.isInitSend = true
                                 mcu.status = 1
                             }
@@ -141,6 +148,7 @@ export const checkInfo = defineStore('checkInfo', () => {
                                 devices[deviceName].status = result.status;
                                 devices[deviceName].msg = result.msg;
                                 mcu.status = 2
+                                init_mcu_type.value = false;
                             }
                             if(checkTime.value >= 60 &&   mcu.status !== 2){
                                 mcu.status == -1;

+ 3 - 1
frontend/src/views/Developer/index.vue

@@ -191,7 +191,9 @@ async function  connect_mcu__init(){
 
     socketStore.sendMessage({
       type: 'init_mcu',
-      data:"init_mcu"
+      data:{
+        value:true
+      }
     })
   }
 }

+ 4 - 1
frontend/src/views/Home/index.vue

@@ -259,9 +259,12 @@ async function connect_mcu__init(){
   if(clientStore.isClient){
 
     await socketStore.connectSocket();
+
     socketStore.sendMessage({
       type: 'init_mcu',
-      data:"init_mcu"
+      data:{
+        value:true
+      }
     })
   }
 

+ 5 - 13
frontend/src/views/Photography/check.vue

@@ -26,7 +26,7 @@
               </template>
             </div>
           </div>
-          <div class="example-image flex-col"><span class="example-text">示范图片</span></div>
+          <div class="example-image flex-col"><img src="https://huilimaimg.cnhqt.com/frontend/zhihuiyin/demo.jpg?x-oss-process=image/resize,w_400"></div>
         </div>
         <div v-if="step === 1" class="action-button flex cente">
           <div @click="takePictures" class="check-button  button--primary1 flex-col"><span class="button-text" v-loading="loading">拍照检查</span>
@@ -259,18 +259,10 @@ onBeforeUnmount(() => {
         height: 200px;
         margin-top: 10px;
         width: 200px;
-
-        .example-text {
-          width: 56px;
-          height: 20px;
-          overflow-wrap: break-word;
-          color: rgba(71, 71, 71, 1);
-          font-size: 14px;
-          font-weight: NaN;
-          text-align: left;
-          white-space: nowrap;
-          line-height: 20px;
-          margin: 90px 0 0 72px;
+        img {
+          width: 200px;
+          height: 200px;
+          display: block;
         }
       }
     }