tangning hai 6 meses
pai
achega
a826064a80

+ 39 - 27
src/views/account/product/index.vue

@@ -38,7 +38,13 @@
       </BasicTable>
       <BasicTable v-show="tableType == 41" @register="registerTableScene">
         <template #toolbar>
-          <a-button type="primary" v-if="getTypeCheckPerm('account-productTransfer-batch')" @click="handleMoveAll"> 批量迁移</a-button>
+          <a-button
+            type="primary"
+            v-if="getTypeCheckPerm('account-productTransfer-batch')"
+            @click="handleMoveAll"
+          >
+            批量迁移</a-button
+          >
         </template>
         <template #href="{ record }">
           <a v-if="record.name" target="_blank" :href="record.webSite || record.thumb">{{
@@ -98,7 +104,13 @@
         @register="registerTable"
       >
         <template #toolbar>
-          <a-button type="primary" v-if="tableType != 3 && getTypeCheckPerm('account-productTransfer-batch')" @click="handleMoveAll"> 批量迁移</a-button>
+          <a-button
+            type="primary"
+            v-if="tableType != 3 && getTypeCheckPerm('account-productTransfer-batch')"
+            @click="handleMoveAll"
+          >
+            批量迁移</a-button
+          >
         </template>
         <template #href="{ record }">
           <a
@@ -449,35 +461,35 @@
         if (tableType.value == 6 || tableType.value == 2) {
           params.isObj = 1;
         }
-        checkDownLoad(params).then((res) => {
+        checkDownLoad(params).then(async (res) => {
           console.log(res);
           if (res.downloadStatus != 3) {
             // 未下载过,需要打包
-            sceneDownload(params).then((downres) => {
-              console.log(downres);
-              openDownModal(true, {
-                ...record,
-              });
-              if (downres.downloadStatus == 1) {
-                if (timer.value) {
-                  afterClose();
-                }
-                timer.value = setInterval(() => {
-                  downloadProcess(params).then((processres) => {
-                    console.log('processres', res);
-                    if (processres.percent >= 100) {
-                      canDownload.value = false;
-                      afterClose();
-                      window.open(res.url);
-                      closeModal();
-                      cancelDownload();
-                    }
-                    downloadOption.value = processres;
-                    console.log(processres);
-                  });
-                }, 1000);
-              }
+            if (res.downloadStatus != 1) {
+              await sceneDownload(params);
+            }
+            openDownModal(true, {
+              ...record,
             });
+            if (res.downloadStatus == 1) {
+              if (timer.value) {
+                afterClose();
+              }
+              timer.value = setInterval(() => {
+                downloadProcess(params).then((processres) => {
+                  console.log('processres', res);
+                  if (processres.percent >= 100) {
+                    canDownload.value = false;
+                    afterClose();
+                    window.open(res.url);
+                    closeModal();
+                    cancelDownload();
+                  }
+                  downloadOption.value = processres;
+                  console.log(processres);
+                });
+              }, 1000);
+            }
           } else {
             window.open(res.downloadUrl);
           }

+ 26 - 31
src/views/customer/scene.vue

@@ -336,42 +336,37 @@
         if(tableType.value == 4 || tableType.value == 2){
           params.isObj = isObj
         }
-        checkDownLoad(params).then((res) => {
+        checkDownLoad(params).then(async (res) => {
           console.log(res);
           if (res.downloadStatus != 3) {
             // 未下载过,需要打包
-            sceneDownload(params).then((res) => {
-              console.log(res);
-              openDownModal(true, {
-                ...record,
-              });
-              if (res.downloadStatus == 1) {
-                if (timer.value) {
-                  afterClose();
-                }
-                timer.value = setInterval(() => {
-                  downloadProcess(params).then((res) => {
-                    if(res.status == '1003'){
-                      createMessage.error('下载失败');
-                      afterClose();
-                      return
-                    }
-                    if (res.percent >= 100) {
-                      canDownload.value = false;
-                      afterClose();
-                      window.open(res.url);
-                      cancelDownload();
-                      closeModal();
-                      return;
-                    }
-                    downloadOption.value = res;
-                    console.log(res);
-                  });
-                }, 1000);
-              }
+            if (res.downloadStatus != 1) {
+              await sceneDownload(params);
+            }
+            openDownModal(true, {
+              ...record,
             });
+            if (res.downloadStatus == 1) {
+              if (timer.value) {
+                afterClose();
+              }
+              timer.value = setInterval(() => {
+                downloadProcess(params).then((processres) => {
+                  console.log('processres', res);
+                  if (processres.percent >= 100) {
+                    canDownload.value = false;
+                    afterClose();
+                    window.open(res.url);
+                    closeModal();
+                    cancelDownload();
+                  }
+                  downloadOption.value = processres;
+                  console.log(processres);
+                });
+              }, 1000);
+            }
           } else {
-          window.open(res.downloadUrl);
+            window.open(res.downloadUrl);
           }
         });
       }

+ 26 - 32
src/views/productOperation/cameraScene.vue

@@ -342,42 +342,36 @@
           params.isObj = isObj;
         }
         canDownload.value = true;
-        checkDownLoad(params).then((res) => {
+        checkDownLoad(params).then(async (res) => {
+          console.log(res);
           if (res.downloadStatus != 3) {
             // 未下载过,需要打包
-            sceneDownload(params).then((res) => {
-              console.log(res);
-              openDownModal(true, {
-                ...record,
-                isObj: params.isObj,
-              });
-              if (res.downloadStatus == 1) {
-                if (timer.value) {
-                  afterClose();
-                }
-                timer.value = setInterval(() => {
-                  downloadProcess(params).then((res) => {
-                    if (res.status == '1003') {
-                      createMessage.error('下载失败');
-                      afterClose();
-                      return;
-                    }
-                    if (res.percent >= 100) {
-                      canDownload.value = false;
-                      afterClose();
-                      window.open(res.url);
-                      closeModal();
-                      cancelDownload();
-                      return;
-                    }
-                    downloadOption.value = res;
-                    console.log(res);
-                  });
-                }, 1000);
-              }
+            if (res.downloadStatus != 1) {
+              await sceneDownload(params);
+            }
+            openDownModal(true, {
+              ...record,
             });
+            if (res.downloadStatus == 1) {
+              if (timer.value) {
+                afterClose();
+              }
+              timer.value = setInterval(() => {
+                downloadProcess(params).then((processres) => {
+                  console.log('processres', res);
+                  if (processres.percent >= 100) {
+                    canDownload.value = false;
+                    afterClose();
+                    window.open(res.url);
+                    closeModal();
+                    cancelDownload();
+                  }
+                  downloadOption.value = processres;
+                  console.log(processres);
+                });
+              }, 1000);
+            }
           } else {
-            canDownload.value = false;
             window.open(res.downloadUrl);
           }
         });

+ 26 - 33
src/views/productOperation/viewKankan.vue

@@ -359,43 +359,36 @@
           params.isObj = isObj;
         }
         canDownload.value = true;
-        checkDownLoad(params).then((res) => {
+        checkDownLoad(params).then(async (res) => {
+          console.log(res);
           if (res.downloadStatus != 3) {
             // 未下载过,需要打包
-            sceneDownload(params).then((res) => {
-              console.log(res);
-              openDownModal(true, {
-                ...record,
-                isObj: params.isObj,
-              });
-              if (res.downloadStatus == 1) {
-                if (timer.value) {
-                  afterClose();
-                }
-                timer.value = setInterval(() => {
-                  downloadProcess(params).then((res) => {
-                    if (res.status == '1003') {
-                      createMessage.error('下载失败');
-                      afterClose();
-                      return;
-                    }
-                    if (res.percent >= 100) {
-                      canDownload.value = false;
-                      afterClose();
-                      window.open(res.url);
-                      closeModal();
-                      cancelDownload();
-                      return;
-
-                    }
-                    downloadOption.value = res;
-                    console.log(res);
-                  });
-                }, 1000);
-              }
+            if (res.downloadStatus != 1) {
+              await sceneDownload(params);
+            }
+            openDownModal(true, {
+              ...record,
             });
+            if (res.downloadStatus == 1) {
+              if (timer.value) {
+                afterClose();
+              }
+              timer.value = setInterval(() => {
+                downloadProcess(params).then((processres) => {
+                  console.log('processres', res);
+                  if (processres.percent >= 100) {
+                    canDownload.value = false;
+                    afterClose();
+                    window.open(res.url);
+                    closeModal();
+                    cancelDownload();
+                  }
+                  downloadOption.value = processres;
+                  console.log(processres);
+                });
+              }, 1000);
+            }
           } else {
-            canDownload.value = false;
             window.open(res.downloadUrl);
           }
         });