浏览代码

refactor(frontend): 优化拍照功能的代码逻辑

- 移除多余的 IPC 事件监听器- 修改拍照请求的消息类型和数据结构
- 更新事件处理函数以适应新的消息类型
panqiuyao 4 月之前
父节点
当前提交
fabfad6507
共有 1 个文件被更改,包括 5 次插入5 次删除
  1. 5 5
      frontend/src/views/Photography/shot.vue

+ 5 - 5
frontend/src/views/Photography/shot.vue

@@ -542,13 +542,13 @@ const reTakePicture = async (img)=>{
     })
 
 
+    clientStore.ipc.removeAllListeners(icpList.socket.message + '_digicam_take_picture');
     socketStore.sendMessage({
-      type: 're_take_picture',
-      "data":{"record_id":img.id},
+      type: 'digicam_take_picture',
+      "data":{"id":img.id,"goods_art_no":img.goods_art_no},
     })
-    clientStore.ipc.removeAllListeners(icpList.socket.message + '_re_take_picture');
-    clientStore.ipc.on(icpList.socket.message + '_re_take_picture', (event, result) => {
-      console.log('_re_take_picture')
+    clientStore.ipc.on(icpList.socket.message + '_digicam_take_picture', (event, result) => {
+      console.log('_digicam_take_picture')
       console.log(result)
 
       runLoading.value = false;