tangning пре 19 часа
родитељ
комит
a0e6c528a7
3 измењених фајлова са 30 додато и 11 уклоњено
  1. 1 1
      src/request/index.ts
  2. 1 1
      src/view/case/photos/canvas-photo-editor.js
  3. 28 9
      src/view/material/sceneImg.vue

+ 1 - 1
src/request/index.ts

@@ -104,7 +104,7 @@ axios.interceptors.request.use(async (config) => {
     config.data = fromData;
     config.headers["Content-Type"] = "multipart/form-data";
   }
-  if (config.url === "/fusion/ai/getByImage") {
+  if (config.url === "/fusion/ai/getByImage" || config.url === "/fusion/casePhotoRoll/getByCaseId") {
     return config;
   }
   openLoading(config.url);

+ 1 - 1
src/view/case/photos/canvas-photo-editor.js

@@ -967,7 +967,7 @@ export class CanvasPhotoEditor {
       }
       img.onerror = (err) => {
       }
-      img.src = photo.url
+      img.src = photo.url + '?t=' + new Date().getTime()
       this.imgCache.set(photo.id, img)
       return
     }

+ 28 - 9
src/view/material/sceneImg.vue

@@ -255,9 +255,10 @@
                   <div class="text">
                     {{ items.name }}
                   </div>
+                  <div class="operation" :style="{color: items.genStatus == -1 ? 'red' : ''}" v-if="items.genStatus != 0">{{ items.genStatus == 1 ? 'AI制卷中...' : '制卷失败' }}</div>
                   <div
                     class="operation"
-                    v-if="!show && childrenList.value == items.id"
+                    v-else-if="!show && childrenList.value == items.id"
                   >
                     <el-icon title="下载" @click="exportToPDF(false, items)"
                       ><Download
@@ -505,16 +506,16 @@
       <showpages
         ref="showPagesRef"
         :photos="photos"
-        v-if="childrenList.src"
+        v-if="childrenList.src && childrenList.item.genStatus == 0"
         :pageCount="childrenList.item.pageCount || 0"
         :content="childrenList.src"
       />
       <div v-else class="noView">
         <div
           class="noViewTitle"
-          v-if="childrenList.item && childrenList.item.filesUrl"
+          v-if="childrenList.item.genStatus != 0"
         >
-          <div class="zbzc">暂不支持预览</div>
+          <div class="zbzc">{{ childrenList.item.genStatus == 1 ? 'AI制卷中...' : '制卷失败' }}</div>
         </div>
         <div v-else class="noViewTitle">暂无数据</div>
       </div>
@@ -735,11 +736,9 @@ function handleSuccess(item) {
 onActivated(() =>{
   getList(true);
 })
-function getList(refresh = false) {
-  //new  0 现场图 1 照片卷 2 现场照片 3 勘验笔录
-  //old  0 现场照片 1 现场图 2 勘验笔录
+let refreshTimer: NodeJS.Timeout | null = null;
+function getPhotoRollList(){
   getCasePhotoRollList(caseId.value).then((res) => {
-    casePhotoList.value = res || [];
     let count = 0;
     casePhotoList.value = res.map((ele) => {
       let content = ele.content && JSON.parse(ele.content);
@@ -750,6 +749,14 @@ function getList(refresh = false) {
         pageCount: count - number,
       };
     });
+    let isloading = casePhotoList.value.some((ele) => ele.genStatus == 1);//存在制卷中的数据进行刷新流程
+    if(isloading){
+      refreshTimer = setTimeout(startAutoRefresh, 3000);
+    }else{
+      // 有结果 → 清除定时器,停止刷新
+      clearInterval(refreshTimer);
+      refreshTimer = null;
+    }
     if (
       active1.value == "照片卷" &&
       casePhotoList.value &&
@@ -759,6 +766,18 @@ function getList(refresh = false) {
       handlItem2(item);
     }
   });
+}
+function startAutoRefresh(): void {
+  // 防止重复启动
+  if (refreshTimer) clearTimeout(refreshTimer);
+  
+  // 立即执行一次检查
+  getPhotoRollList();
+}
+function getList(refresh = false) {
+  //new  0 现场图 1 照片卷 2 现场照片 3 勘验笔录
+  //old  0 现场照片 1 现场图 2 勘验笔录
+  getPhotoRollList();
   updateByTreeFileLists(caseId.value).then((res) => {
     list.value =
       res.find((ele) => ele.filesTypeName == "三录材料")?.childrenList || [];
@@ -1181,7 +1200,7 @@ async function frameLoad(sdk, num) {
     });
     console.log("返回数据1", data);
     loadingAiPhone.value.close();
-    // handledrawCasePhotos(data.id);
+    await handlItem2(data);
     getList(true);
   } catch (error) {
     console.log("捕获到错误", error);