bzkf3 2 éve%!(EXTRA string=óta)
szülő
commit
c24f9d72c6

+ 7 - 3
src/components/FileUpload/indey.vue

@@ -1,6 +1,6 @@
 <template>
   <el-upload :action="action" :data="data" name="filedata" :limit="$props.limit" :on-success="handleSuccess"
-    :before-upload="beforeUpload" :file-list="FILE_LIST">
+    :before-upload="beforeUpload" :file-list="FILE_LIST" :on-preview="handlePreview">
     <template #default>
       <slot>
         <el-button size="small" type="primary">点击上传</el-button>
@@ -66,7 +66,7 @@ export default ({
   methods: {
     handleSuccess(response, file, fileList) {
       console.log('handleSuccess :>> ', response, file, fileList);
-      this.$emit("success", fileList);
+      this.$emit("success", fileList.map((item) => ({ ...item, url: item.response.data.url, })))
     },
     beforeUpload() {
       if (this.$props.size) {
@@ -77,7 +77,11 @@ export default ({
         return isLtSize;
       }
     },
-
+    handlePreview(file) {
+      console.log('file :>> ', file);
+      const { part_url, name } = file;
+      window.open(`${window.globalVariables.api}/openapi/download.php?path=${part_url}&name=${name}`);
+    }
   }
 
 })

+ 1 - 1
src/views/xxgzjc/tjtj/detail.vue

@@ -139,7 +139,7 @@ export default defineComponent({
             jxj_id: props.id,
             jxjx_id: undefined,
             jxjx_to_id: user.uo_id,
-            jxjtl_path: file.part_url,
+            jxjtl_path: file.url,
           }
         }
       }).then(res => {