Browse Source

mod:初始化检测

panqiuyao 8 months ago
parent
commit
7b5e1fc23e
2 changed files with 19 additions and 11 deletions
  1. 2 2
      frontend/src/stores/modules/check.ts
  2. 17 9
      frontend/src/views/Photography/check.vue

+ 2 - 2
frontend/src/stores/modules/check.ts

@@ -11,7 +11,7 @@ export const checkInfo = defineStore('checkInfo', () => {
 
     // 定义设备列表
     const devices = reactive({
-        mcu: {
+/*        mcu: {
             status: 0,
             msg_type: "connect_mcu",
             msg: "未连接",
@@ -20,7 +20,7 @@ export const checkInfo = defineStore('checkInfo', () => {
             status: 0,
             msg_type: "connect_bluetooth",
             msg: "未连接",
-        },
+        },*/
         cam_control: {
             status: 0,
             msg_type: "cam_control",

+ 17 - 9
frontend/src/views/Photography/check.vue

@@ -28,12 +28,12 @@
           <div class="example-image flex-col"><span class="example-text">示范图片</span></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">拍照检查</span>
+          <div @click="takePictures" class="check-button  button--primary1 flex-col"><span class="button-text" v-loading="loading">拍照检查</span>
           </div>
         </div>
 
         <div v-else class="action-button flex center">
-          <div @click="checkConfirm" class="check-button  button--white flex-col">
+          <div @click="checkConfirm(false)" class="check-button  button--white flex-col">
             <span class="button-text cu-p">重新拍照检查</span>
           </div>
           <router-link class="mar-left-20 " :to="{
@@ -51,7 +51,7 @@
   </div>
 
   <hardware-check
-   @confirm="checkConfirm"
+   @confirm="checkConfirm(true)"
   />
 </template>
 <script setup lang="ts">
@@ -80,11 +80,15 @@ const previewKey = ref(0)
 const preview = ref(digiCamControlWEB+'liveview.jpg')
 
 const step = ref(1)
-function checkConfirm(){
+function checkConfirm(init){
   step.value =1
-  menu.push({
-    type:'setting'
-  })
+  if(menu.length === 0){
+    menu.push({
+      type:'setting'
+    })
+  }
+  if(!init) previewKey.value++;
+
   showVideo()
 }
 
@@ -121,6 +125,7 @@ function hideVideo(){
 
 }
 
+const loading = ref(false)
 
 function takePictures() {
   if (clientStore.isClient) {
@@ -128,12 +133,15 @@ function takePictures() {
     clientStore.ipc.send(icpList.camera.takePictures);
     clientStore.ipc.on(icpList.camera.takePictures, async (event, result) => {
 
-
+      if(interval) clearInterval(interval)
+      loading.value = true;
+      imageUrlkey.value++;
       setTimeout(()=>{
         hideVideo()
         step.value = 2
         imageUrlkey.value++;
-      },5000)
+        loading.value = false;
+      },8000)
     })
   }
 }