|
|
@@ -720,6 +720,7 @@ onBeforeUnmount(() => {
|
|
|
clientStore.ipc.removeAllListeners(icpList.socket.message + '_photo_take_finish');
|
|
|
clientStore.ipc.removeAllListeners(icpList.socket.message + '_run_mcu_update');
|
|
|
clientStore.ipc.removeAllListeners(icpList.socket.message + '_stop_action');
|
|
|
+ clientStore.ipc.removeAllListeners(icpList.socket.message + '_smart_shooter_photo_take');
|
|
|
/* window.removeEventListener('storage', handleStorageEvent);*/
|
|
|
|
|
|
|
|
|
@@ -757,6 +758,23 @@ const getLastPhotoRecord = async ()=>{
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+let smartShooterTimeout = null; // 在合适的位置定义一个全局变量用于保存定时器
|
|
|
+
|
|
|
+//拍照成功 SmartShooter
|
|
|
+clientStore.ipc.on(icpList.socket.message+'_smart_shooter_photo_take', async (event, result) => {
|
|
|
+ console.log('_smart_shooter_photo_take');
|
|
|
+ console.log(result);
|
|
|
+ if(result.code === 0 && result.data?.photo_file_name){
|
|
|
+ if (smartShooterTimeout) {
|
|
|
+ clearTimeout(smartShooterTimeout);
|
|
|
+ }
|
|
|
+ smartShooterTimeout = setTimeout(() => {
|
|
|
+ getPhotoRecords();
|
|
|
+ }, 2000);
|
|
|
+ }
|
|
|
+
|
|
|
+})
|
|
|
+
|
|
|
|
|
|
// 监听拍照完成后的最终状态事件
|
|
|
clientStore.ipc.on(icpList.socket.message + '_run_mcu_update', (event, result) => {
|