Browse Source

fix(photography): 修复拍摄功能中的UI显示和加载状态问题

- 移除无图像路径时的标签显示逻辑
- 修复图像预览组件的条件渲染问题
- 优化重拍按钮的禁用条件判断
- 添加拍摄过程中的加载状态控制
panqiuyao 2 days ago
parent
commit
86faebea49

+ 1 - 0
frontend/src/views/Photography/mixin/usePhotography.ts

@@ -606,6 +606,7 @@ export default function usePhotography() {
         }
 
         ElMessage.success('正在拍摄中,请稍候')
+        takePictureLoading.value = true;
         socketStore.sendMessage({
           type: 'handler_take_picture',
         })

+ 3 - 6
frontend/src/views/Photography/shot.vue

@@ -106,8 +106,8 @@
                   class="history-item_image"
                   v-loading="!image.PhotoRecord.image_path && runAction.goods_art_no == item.goods_art_no"
                 >
-                  <span class="tag" v-if="!image.PhotoRecord.image_path">{{ image.action_name }}</span>
-                  <div class="el-image_view" v-if="image.PhotoRecord.image_path">
+<!--                  <span class="tag" v-if="!image.PhotoRecord.image_path">{{ image.action_name }}</span>-->
+                  <div class="el-image_view" >
                     <el-image
                       :src="getFilePath(image.PhotoRecord.image_path)"
                       :preview-src-list="getPreviewImageList(item)"
@@ -124,10 +124,7 @@
                         </div>
                       </template>
                     </el-image>
-                    <el-button v-if="image.action_name" :disabled="runLoading || takePictureLoading" class="reset-button" @click="reTakePicture(image.PhotoRecord)" v-log="{ describe: { action: '重拍单张图片', goods_art_no: image.PhotoRecord.goods_art_no, action_name: image.action_name } }">重拍</el-button>
-                  </div>
-                  <div v-else class="image-placeholder">
-                    <span class="tag">{{ image.action_name }}</span>
+                    <el-button v-if="image.action_name && !runLoading && !takePictureLoading" :disabled="runLoading || takePictureLoading" class="reset-button" @click="reTakePicture(image.PhotoRecord)" v-log="{ describe: { action: '重拍单张图片', goods_art_no: image.PhotoRecord.goods_art_no, action_name: image.action_name } }">重拍</el-button>
                   </div>
                 </div>
               </div>