From 6416b40cf242340eaa163c498bd49d8103e73610 Mon Sep 17 00:00:00 2001
From: linwe <872216996@qq.com>
Date: Mon, 29 Jul 2024 17:01:52 +0800
Subject: [PATCH] 代码优化

---
 src/views/publicSecurity/noExplosionManage.vue |   29 ++++++++++++++++++++++-------
 1 files changed, 22 insertions(+), 7 deletions(-)

diff --git a/src/views/publicSecurity/noExplosionManage.vue b/src/views/publicSecurity/noExplosionManage.vue
index c629f2e..9857a15 100644
--- a/src/views/publicSecurity/noExplosionManage.vue
+++ b/src/views/publicSecurity/noExplosionManage.vue
@@ -43,6 +43,11 @@
       <audit-base ref="auditBase" @handleSubmit="submitAudit"></audit-base>
     </el-dialog>
 
+    <el-dialog :visible.sync="visibleWord" append-to-body destroy-on-close title="审核" width="50%"
+      custom-class="flow-design-dialog" :before-close="handleCloseWord">
+      <word ref="word"></word>
+    </el-dialog>
+
 
     <el-drawer title="无诈申请" :visible.sync="isDetail" :append-to-body="true" size="40%" direction="rtl">
       <div class="title">
@@ -108,7 +113,11 @@
               </div>
 
               <div v-if="type === 2" style="line-height: 100px;" v-for="pic in item.imageUrlsList">
-                <el-button @click="downloadFile(item.imageUrls)" type="primary">下载</el-button>
+                <el-button @click="lookFile(item.imageUrls)" type="primary">查看附件</el-button>
+              </div>
+
+              <div v-if="type === 2" style="line-height: 100px;" v-for="pic in item.imageUrlsList">
+                <el-button @click="downloadFile(item.imageUrls)" type="primary">下载附件</el-button>
               </div>
 
             </div>
@@ -129,6 +138,7 @@
   } from "@/api/task/task"
 
   import auditBase from './components/auditBase'
+  import word from '../../components/offce/word'
   import {
     mapGetters
   } from "vuex"
@@ -189,6 +199,7 @@
           }],
         },
         visible: false,
+        visibleWord: false,
         taskType: 0,
         curRow: {},
         roleBox: false,
@@ -391,6 +402,7 @@
 
     components: {
       auditBase,
+      word,
       campusReporting,
       hotelReporting,
       labelReporting,
@@ -471,14 +483,13 @@
         this.srcList.push(img)
       },
 
+      lookFile(url) {
+        this.visibleWord = true
+        this.$refs.word.initWord(url)
+      },
+
       downloadFile(url) {
         window.location.href = url
-        // window.open(url);
-        // const link = document.createElement('a');
-        // link.href = url;
-        // link.download = "";
-        // link.target = "_blank"; // 可选,如果希望在新窗口中下载文件,请取消注释此行
-        // link.click();
       },
       // 点击展开收缩
       flodQL(index) {
@@ -610,6 +621,10 @@
         this.cancelAudit()
       },
 
+      handleCloseWord() {
+        this.visibleWord = false
+      },
+
       // 取消审核
       cancelAudit() {
         this.visible = false

--
Gitblit v1.9.3