tangning 9 months ago
parent
commit
9eea7ac3bd
3 changed files with 24 additions and 4 deletions
  1. 1 1
      src/utils/http/axios/index.ts
  2. 13 1
      src/views/case/list.vue
  3. 10 2
      src/views/mediaLibrary/list.vue

+ 1 - 1
src/utils/http/axios/index.ts

@@ -201,7 +201,7 @@ function createAxios(opt?: Partial<CreateAxiosOptions>) {
         // authentication schemes,e.g: Bearer
         // authenticationScheme: 'Bearer',
         authenticationScheme: '',
-        timeout: '',
+        timeout: 60 * 60 * 1000,
         // 基础接口地址
         // baseURL: globSetting.apiUrl,
 

+ 13 - 1
src/views/case/list.vue

@@ -50,7 +50,7 @@
                   //    userInfo.roleId == 48),
                   // disabled: !(record.status == 1 || (record.status == -2 && record.payStatus == 1)),
                   //icon: 'carbon:download',
-                  onClick: handleDownload.bind(null, record),
+                  onClick: createConfirmDownload.bind(null, record),
                 },
                 {
                   label: '删除',
@@ -391,6 +391,17 @@
       let timer: null = ref(null);
       const downloadOption = ref<Object>({});
       const canDownload = ref<boolean>(true);
+      function createConfirmDownload(record: Recordable) {
+        createConfirm({
+          title: '提示',
+          okText: '继续',
+          content: '案件资源过大会导致离线包下载失败,请尽可能缩小案件资源后再下载。',
+          onOk: async () => {
+            handleDownload(record)
+          },
+        });
+      }
+
       function handleDownload(record: Recordable) {
         console.log('handleDownload', record, canDownload.value);
         canDownload.value = true;
@@ -524,6 +535,7 @@
         handleAdd,
         reload,
         getCheckPerm,
+        createConfirmDownload,
       };
     },
   });

+ 10 - 2
src/views/mediaLibrary/list.vue

@@ -11,8 +11,8 @@
           v-if="record.fileUrl"
           target="_blank"
           :title="record.name"
-          :href="record.fileUrl"
-          >{{ record.name }}</a
+          @click="floadileUrl(record)">
+          {{ record.name }}</a
         >
         <span v-else-if="record.name">{{ record.name }}</span>
         <span v-else>-</span>
@@ -423,6 +423,13 @@
           ...record,
         });
       }
+      function floadileUrl(record) {
+        if (record.fileType == 3) {
+          afterClose();
+        }else{
+          return window.open(record.fileUrl);
+        }
+      }
       onMounted(() => {});
       return {
         registerTable,
@@ -455,6 +462,7 @@
         qrCodeUrl,
         exportExcel,
         handleGrounping,
+        floadileUrl,
       };
     },
   });