Browse Source

mod:一键停止

panqiuyao 8 months ago
parent
commit
5d78f56ae2
1 changed files with 13 additions and 0 deletions
  1. 13 0
      frontend/src/views/Photography/shot.vue

+ 13 - 0
frontend/src/views/Photography/shot.vue

@@ -71,6 +71,7 @@
           <span class="history-title flex between">
             <div>拍摄记录</div>
             <div class="c-666 fs-12" v-if="goodsList.length">
+                    <el-button :disabled="!(runLoading || takePictureLoading)" @click="oneClickStop" class="input-button" type="primary" size="mini">一键停止</el-button>
                     <el-button :disabled="runLoading || takePictureLoading" @click="delAll" class="input-button" type="primary" size="mini">一键删除</el-button>
             </div>
           </span>
@@ -553,6 +554,18 @@ onMounted(async () => {
 })
 
 
+const oneClickStop = ()=>{
+
+  if(!(runLoading.value || takePictureLoading.value)){
+    ElMessage.error('拍摄程序已结束,不需要单独停止!')
+    return
+  }else{
+
+    socketStore.sendMessage({
+      type: 'stop_action',
+    })
+  }
+}
 const onRemoteControl = (type)=>{
   if(type == 'take_picture'){