From e38ecc06dbfea02080f197ed3352c7673be5e9ab Mon Sep 17 00:00:00 2001
From: fei <791364011@qq.com>
Date: 星期一, 17 十一月 2025 15:11:00 +0800
Subject: [PATCH] 修改了对应代码

---
 src/views/archiveManager/index.vue |  122 ++++++++++++++++++++++++++++++++--------
 1 files changed, 97 insertions(+), 25 deletions(-)

diff --git a/src/views/archiveManager/index.vue b/src/views/archiveManager/index.vue
index 690a203..0a0a9a4 100644
--- a/src/views/archiveManager/index.vue
+++ b/src/views/archiveManager/index.vue
@@ -300,7 +300,7 @@
                   icon="el-icon-edit"
                   @click="handleInfo(scope.row)"
                   v-hasPermi="['system:records:edit']"
-                >妗堝嵎璇︾粏淇℃伅</el-button>
+                >缂栬緫鍗峰唴鐩綍</el-button>
 
                 <el-button
                   size="mini"
@@ -362,9 +362,9 @@
 <!--      <el-table-column label="${comment}" align="center" prop="id" /> -->
       <el-table-column label="妗f鍙�" align="center" prop="recordId" />
       <el-table-column label="鍙戞枃鍙�" align="center" prop="inquiryNumber" />
-            <el-table-column label="椤圭洰鍚嶇О" align="center" prop="everyProjectName" />
 
-      <el-table-column label="妗堝嵎棰樺悕" align="center" prop="caseTitle" show-overflow-tooltip />
+
+      <el-table-column label="妗堝嵎棰樺悕" align="center" prop="caseTitle"  />
       <el-table-column label="鍏紑灞炴��" align="center" prop="publicAttribute" />
       <el-table-column label="缂栧埗鍗曚綅" align="center" prop="preparationUnit" />
       <el-table-column label="缂栧埗鏃ユ湡" align="center" prop="preparationDate" width="180">
@@ -385,7 +385,7 @@
       <el-table-column label="缂╁井鍙�" align="center" prop="microfilmNumber" />
       <el-table-column label="澶囨敞" align="center" prop="remarks" />
       <el-table-column label="鍘嗗彶鐩稿叧鍙戞枃鍙�" align="center" prop="historicalReferenceNumber" />
-
+<el-table-column label="椤圭洰鍚嶇О" align="center" prop="everyProjectName" />
     </el-table>
 
     <pagination
@@ -419,10 +419,11 @@
             <div class="option-group">
               <div class="option-label">閫夋嫨娉ㄨВ:</div>
               <div class="annotation-options">
-                <label v-for="i in 5" :key="i" class="annotation-checkbox">
-                  <input type="checkbox" v-model="excelOptions.selectedAnnotations" :value="i">
-                  <span>娉ㄨВ{{ i }}</span>
-                </label>
+              <label v-for="(annotation, index) in excelOptions.selectedAnnotations" :key="index" class="signature-checkbox">
+                              <input type="checkbox" v-model="excelOptions.subselectedAnnotations" :value="index">
+                              <span>{{ annotation }}
+                              </span>
+              </label>
               </div>
             </div>
 
@@ -431,10 +432,13 @@
               <div class="option-label">绛惧悕鏍忚缃�:</div>
               <div class="signature-options">
                 <div class="signature-checkboxes">
-                  <label v-for="i in 3" :key="i" class="signature-checkbox">
-                    <input type="checkbox" v-model="excelOptions.selectedSignatures" :value="i">
-                    <span>绛惧悕鏍弡{ i }}</span>
+                 <label v-for="(signature, index) in excelOptions.selectedSignatures" :key="index" class="signature-checkbox">
+                                 <input type="checkbox" v-model="excelOptions.subselectedSignatures" :value="index">
+                                 <span>{{ signature }}</span>
                   </label>
+
+
+
                 </div>
 <!--                <p v-if="excelOptions.selectedSignatures.length === 0" class="option-tip">璇烽�夋嫨鑷冲皯涓�涓鍚嶆爮</p> -->
               </div>
@@ -442,7 +446,8 @@
           </div>
         </div>
     <!-- 浼樺寲鐨凟xcel棰勮缁勪欢 -->
-    <div class="excel-preview-wrapper" v-if="excelDialogVisible">
+     <el-dialog class="excel-preview-wrapper" :visible.sync="showExcelPreview" :modal="false" width="80%" :show-close="true" @click="closeExcelPreviewDialog">
+    <div  @click.stop>
       <!-- 涓昏棰勮缁勪欢 -->
       <vue-office-excel
         v-if="currentExcelUrl"
@@ -464,7 +469,7 @@
         <button class="excel-dialog-btn download-btn" @click="handleDownloadClick">涓嬭浇Excel鏂囦欢</button>
       </div>
     </div>
-
+</el-dialog>
         <div class="excel-dialog-footer">
           <button class="excel-dialog-btn preview-btn" @click="handlePreviewClick">棰勮</button>
           <button class="excel-dialog-btn print-btn" @click="handlePrintClick">鎵撳嵃</button>
@@ -802,6 +807,7 @@
   name: "Records",
   data() {
     return {
+      showExcelPreview: false,
                   excel: 'http://localhost:8080/profile/upload/12.xls', //璁剧疆鏂囨。缃戠粶鍦板潃锛屽彲浠ユ槸鐩稿鍦板潃
 
       open_check: false,
@@ -885,8 +891,15 @@
     // Excel閫夐」閰嶇疆
     excelOptions: {
       includeQrCode: false, // 鏄惁鍖呭惈浜岀淮鐮�
-      selectedAnnotations: [], // 閫変腑鐨勬敞瑙e垪琛�
+      selectedAnnotations: ["鏈竻鍗曠敱妗f褰㈡垚閮ㄩ棬瀹屾垚",
+           "鏂囦欢绫诲瀷蹇呴』褰曞叆锛屽寘鎷粨璁烘潗鏂欍�佽繃绋嬫潗鏂欍�佺敵璇锋潗鏂欙紝鍏朵粬鏉愭枡",
+            "鍏紑灞炴�у繀椤诲綍鍏ワ紝涓诲姩鍏紑銆佷緷鐢宠鍏紑銆佸厤浜堝叕寮�",
+             "淇濈鏈熼檺:30骞存垨姘镐箙",
+            "椤靛彿鎸夌収姝e紡褰曞叆椤电爜涓哄噯"], // 閫変腑鐨勬敞瑙e垪琛�
       includeSignature: false, // 鏄惁鍖呭惈绛惧悕鏍�
+            selectedSignatures: ['涓氬姟绉戝绉讳氦浜�:', '瀹℃壒绉戠Щ浜や汉:', '妗f鏁寸悊鍏徃:'], // 閫変腑鐨勭鍚嶆爮鍒楄〃
+            subselectedSignatures: [],
+            subselectedAnnotations: [],
       signaturePosition: 'bottom' // 绛惧悕鏍忎綅缃細top/bottom
     },
       // 琛ㄥ崟鍙傛暟
@@ -1022,7 +1035,7 @@
         console.log("1111111333333",response.data)
         this.zoneTypeOptions = response.data.data.map(item => ({
           value: item.nnumber,
-          label: item.name
+          label: item.nnumber
         }))
       } catch (error) {
         console.error('鑾峰彇椤圭洰鍚嶇О鍒楄〃澶辫触:', error)
@@ -1046,7 +1059,7 @@
     listAllCategory().then(response => {
       this.recordTypeOptions = response.data.map(item => ({
         value: item.numb,
-        label: item.nname
+        label: item.numb
       }))
       resolve()
     })
@@ -1302,7 +1315,7 @@
     handleAuthUser: function(row) {
       const roleId = 2
       var archiveRecordsId = row.recordId
-   alert(roleId)
+
       this.$router.push("/archiveManager/infoManagerAu/user/" + roleId+"/"+archiveRecordsId)
     },
     /** 鍒犻櫎鎸夐挳鎿嶄綔 */
@@ -1336,6 +1349,8 @@
     /** 鏌ョ湅骞舵墦鍗癊xcel鏂囦欢 */
     viewAndPrintExcel(row) {
       const id = row.id || this.ids;
+     // alert(id)
+      this.recordId = id;
       this.$modal.loading('姝e湪鑾峰彇Excel鏂囦欢锛岃绋嶅��...');
 
       // 浠庡悗绔幏鍙朎xcel鏂囦欢
@@ -1364,6 +1379,7 @@
     /** 鍏抽棴Excel寮圭獥骞舵竻鐞嗚祫婧� */
     closeExcelDialog() {
       this.excelDialogVisible = false;
+    //  alert(this.excelDialogVisible)
       if (this.excelPreviewTimeout) {
         clearTimeout(this.excelPreviewTimeout);
         this.excelPreviewTimeout = null;
@@ -1374,12 +1390,32 @@
       }
       this.currentExcelBlob = null;
     },
+closeExcelPreviewDialog()
+{
 
+  this.showExcelPreview = false;
+},
     /** 澶勭悊棰勮鎸夐挳鐐瑰嚮 */
     handlePreviewClick() {
-      this.excelLoading = true;
+      this.showExcelPreview = true;
       this.excelRenderError = '';
+      var id = this.recordId ;
+      this.$modal.loading('姝e湪鑾峰彇Excel鏂囦欢锛岃绋嶅��...');
 
+      // 浠庡悗绔幏鍙朎xcel鏂囦欢
+      this.getExcelFile(id).then(blob => {
+        this.$modal.closeLoading();
+        // 淇濆瓨鏂囦欢淇℃伅骞舵樉绀洪潤鎬佸脊绐�
+        this.currentExcelUrl = URL.createObjectURL(blob);
+        this.currentExcelBlob = blob;
+        this.currentExcelId = id;
+        this.excelDialogVisible = true;
+        this.excelLoading = false;
+      }).catch(error => {
+        this.$modal.closeLoading();
+        console.error('鑾峰彇Excel鏂囦欢澶辫触:', error);
+        this.$modal.msgError('鑾峰彇Excel鏂囦欢澶辫触锛岃绋嶅悗閲嶈瘯');
+      });
       // 閲嶇疆vue-office-excel缁勪欢
       if (this.currentExcelUrl) {
         const tempUrl = this.currentExcelUrl;
@@ -1549,9 +1585,9 @@
         // 鏋勫缓鏂囦欢鍚嶏紝鍖呭惈閫夐」淇℃伅
         let filename = `record_${this.currentExcelId}`;
         if (includeQrCode) filename += '_qr';
-        if (selectedAnnotations.length > 0) {
-          filename += `_anno${selectedAnnotations.join('')}`;
-        }
+        // if (selectedAnnotations.length > 0) {
+        //   filename += `_anno${selectedAnnotations.join('')}`;
+        // }
         filename += `_${new Date().getTime()}.xlsx`;
 
         link.download = filename;
@@ -1587,7 +1623,7 @@
       });
     },
 
-    /** 娓呯悊Excel棰勮鐩稿叧璧勬簮 */
+    /** 娓呯悊Excel棰勮鐩稿叧璧勬簮骞跺叧闂璇濇 */
     cleanupExcelPreview(iframe, url) {
       setTimeout(() => {
         if (iframe && iframe.parentNode) {
@@ -1597,18 +1633,43 @@
           URL.revokeObjectURL(url);
         }
         this.excelRenderError = '';
+        this.showExcelPreview = false; // 鍏抽棴棰勮瀵硅瘽妗�
       }, 1000);
     },
 
     /** 浠庡悗绔幏鍙朎xcel鏂囦欢 */
     getExcelFile(id) {
+      var includeQrCode = this.excelOptions.includeQrCode;
+      var urls = `${process.env.VUE_APP_BASE_API}/system/records/recordFileList`+"/"+includeQrCode;
+
+
+      if(this.excelOptions.subselectedSignatures.length!=0)
+      {
+        var selectedSignatures = this.excelOptions.subselectedSignatures
+        urls = urls +'/'+ selectedSignatures
+        }
+      if(this.excelOptions.subselectedAnnotations.length!=0)
+      {
+        var selectedAnnotations = this.excelOptions.subselectedAnnotations
+        urls = urls+"/"+selectedAnnotations
+        }
+
       return new Promise((resolve, reject) => {
         // 棣栧厛灏濊瘯浣跨敤axios锛堥」鐩凡鏈夌殑HTTP瀹㈡埛绔級
         try {
+          // 鑾峰彇鐢ㄦ埛閫夋嫨鐨勬敞瑙�
+          const { selectedAnnotations } = this.excelOptions;
+
+          // 鏋勫缓鍙傛暟锛屽寘鍚敞瑙e唴瀹�
+          const params = {
+            recordId: id,
+
+          };
+
           axios({
             method: 'Post',
-            url: `${process.env.VUE_APP_BASE_API}/system/records/model`,
-            params: { id: id },
+            url: urls,
+            params: params,
             responseType: 'blob',
             headers: { 'Authorization': 'Bearer ' + getToken() }
           }).then(response => {
@@ -1629,9 +1690,20 @@
     fallbackGetExcelFile(id, resolve, reject) {
       try {
         const xhr = new XMLHttpRequest();
+
+        // 鏋勫缓鏌ヨ鍙傛暟锛屽寘鍚敞瑙e唴瀹�
+        const queryParams = new URLSearchParams({
+          id: id,
+          annotation1: "鏈竻鍗曠敱妗f褰㈡垚閮ㄩ棬瀹屾垚",
+          annotation2: "鏂囦欢绫诲瀷蹇呴』褰曞叆锛屽寘鎷粨璁烘潗鏂欍�佽繃绋嬫潗鏂欍�佺敵璇锋潗鏂欙紝鍏朵粬鏉愭枡",
+          annotation3: "鍏紑灞炴�у繀椤诲綍鍏ワ紝涓诲姩鍏紑銆佷緷鐢宠鍏紑銆佸厤浜堝叕寮�",
+          annotation4: "淇濈鏈熼檺:30骞存垨姘镐箙",
+          annotation5: "椤靛彿鎸夌収姝e紡褰曞叆椤电爜涓哄噯"
+        }).toString();
+
         // 灏濊瘯涓嶅悓鐨凙PI璺緞锛屼互閫傚簲鍙兘鐨勫悗绔疄鐜�
         const apiUrls = [
-          `${process.env.VUE_APP_BASE_API}/system/records/model?id=${id}`,
+          `${process.env.VUE_APP_BASE_API}/system/records/model?${queryParams}`,
           `${process.env.VUE_APP_BASE_API}/system/records/model`
         ];
 

--
Gitblit v1.9.1