Browse Source

预览文件加标题

da-xian 3 months ago
parent
commit
28062f60e4

+ 1 - 1
vue/src/components/basic/es-result/doc-view.vue

@@ -14,7 +14,7 @@
           <span>
             上传时间:<span class="key-tag">{{ it.date }}</span>
           </span><br>
-          <filePreview :fileName="it.file_name" :filePath="it.storage_path"></filePreview>
+          <filePreview :fileName="it.file_name" :filePath="it.storage_path" :title="it.well_common_name"></filePreview>
         </div>
       </div>
     </div>

+ 3 - 1
vue/src/components/basic/file-preview/index.vue

@@ -3,7 +3,7 @@
     <a-button type="link" size="small" @click="loadFile">预览</a-button>
   </a-spin>
   <a-modal :visible="visible" :ok-button-props="{ style: { display: 'none' } }"
-           wrap-class-name="full-modal" style="text-align: center"
+           wrap-class-name="full-modal" style="text-align: center" :title="title"
            cancel-text="关闭" @cancel="visible = !visible">
     <input type="file" @change="changeHandle"/>
     <a-spin tip="加载中..." size="small" :spinning="spinning">
@@ -37,6 +37,7 @@ export default defineComponent({
     VueOfficeDocx, VueOfficePdf, VueOfficeExcel
   },
   props: {
+    title: {type: String, default: "pdf预览"},
     fileName: {type: String, default: ""},
     filePath: {type: String, default: ""},
     accept: {
@@ -74,6 +75,7 @@ export default defineComponent({
             $message.error("文件加载失败!");
             return;
           }
+          spinning.value = false;
           visible.value = true;
         }
 

+ 1 - 1
vue/src/views/applyform/apply.vue

@@ -51,7 +51,7 @@
           <template #renderItem="{ item,index }">
             <a-list-item>
               <template #actions>
-                <filePreview :fileName="item.file_name" :filePath="item.storage_path"></filePreview>
+                <filePreview :fileName="item.file_name" :filePath="item.storage_path"  :title="item.well_common_name"></filePreview>
                 <a-button type="link" @click="downFile(item)" v-if="item.status==2" danger>下载</a-button>
               </template>
               <a-list-item-meta

+ 1 - 1
vue/src/views/applyform/reviewer.vue

@@ -55,7 +55,7 @@
           <template #renderItem="{ item,index }">
             <a-list-item>
               <template #actions>
-                <filePreview :fileName="item.file_name" :filePath="item.storage_path"></filePreview>
+                <filePreview :fileName="item.file_name" :filePath="item.storage_path" :title="item.well_common_name"></filePreview>
                 <a-button type="link" @click="downFile(item)" danger>下载</a-button>
               </template>
               <a-list-item-meta

+ 1 - 1
vue/src/views/wellinfo/detail.vue

@@ -217,7 +217,7 @@
                           <PlusOutlined v-if="!item.isApply" @click="onAddCart(item)" title="加入购物车"
                                         :style="{fontSize: '16px', color: '#08c'}"/>
                           <a-button type="link" @click="downFile(item)" v-if="item.isDown" danger>下载</a-button>
-                          <filePreview :fileName="item.file_name" :filePath="item.storage_path"></filePreview>
+                          <filePreview :fileName="item.file_name" :filePath="item.storage_path" :title="item.well_common_name"></filePreview>
                         </template>
                         <a-list-item-meta
                           :description="item.file_business_type">

+ 1 - 1
vue/src/views/wellinfo/index.vue

@@ -356,7 +356,7 @@
                 <PlusOutlined v-if="!item.isApply" @click="onAddCart(item)" title="加入购物车"
                               :style="{fontSize: '16px', color: '#08c'}"/>
                 <a-button type="link" @click="downFile(item)" v-if="item.isDown" danger>下载</a-button>
-                <filePreview :fileName="item.file_name" :filePath="item.storage_path"></filePreview>
+                <filePreview :fileName="item.file_name" :filePath="item.storage_path" :title="item.well_common_name"></filePreview>
               </template>
               <a-list-item-meta
                 :description="item.file_business_type">