From 8444c1e188ed58b8469699c9049ea1c033b8ed86 Mon Sep 17 00:00:00 2001
From: fei <791364011@qq.com>
Date: 星期四, 01 一月 2026 21:28:30 +0800
Subject: [PATCH] 增加修改代码

---
 src/views/archiveManager/index.vue |  244 ++++++++++++++++++++++++++++--------------------
 1 files changed, 141 insertions(+), 103 deletions(-)

diff --git a/src/views/archiveManager/index.vue b/src/views/archiveManager/index.vue
index c995fb3..aa291a8 100644
--- a/src/views/archiveManager/index.vue
+++ b/src/views/archiveManager/index.vue
@@ -359,7 +359,7 @@
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
-    <el-table v-loading="loading" :data="recordsList" @selection-change="handleSelectionChange">
+    <el-table v-loading="loading" :data="recordsList" @selection-change="handleSelectionChange" @sort-change="handleSortChange">
       <el-table-column type="selection" width="55" align="center" />
 
 
@@ -464,7 +464,7 @@
               </template>
             </el-table-column>
 
-            <el-table-column label="鐘舵��" align="center" prop="recordStatus" width="120">
+            <el-table-column label="鐘舵��" align="center"  sortable="custom" prop="recordStatus" width="120">
               <template slot-scope="scope">
                 <el-button :type="scope.row.recordStatus === '鏈綍鍏�' ? 'danger' : 'success'" size="mini">
                   {{ scope.row.recordStatus }}
@@ -473,7 +473,7 @@
             </el-table-column>
 
 <!--      <el-table-column label="${comment}" align="center" prop="id" /> -->
-      <el-table-column label="妗f鍙�" align="center" prop="recordId" />
+      <el-table-column label="妗f鍙�" align="center" sortable="custom" prop="recordId" width="120"/>
       <el-table-column label="鍙戞枃鍙�" align="center" prop="inquiryNumber" />
 
 
@@ -1060,7 +1060,10 @@
         archiveRoomNumber: null,
         microfilmNumber: null,
         remarks: null,
-        historicalReferenceNumber: null
+        historicalReferenceNumber: null,
+
+                orderByColumn: null,
+                isAsc: null
       },
     // Excel寮圭獥鐩稿叧鏁版嵁
     excelDialogVisible: false,
@@ -1151,9 +1154,9 @@
   beforeDestroy() {
     // 娓呯悊浜嬩欢鐩戝惉鍣ㄥ拰瀹氭椂鍣�
     document.removeEventListener('keydown', this.handleKeyDown);
-    if (this.excelPreviewTimeout) {
-      clearTimeout(this.excelPreviewTimeout);
-    }
+    // if (this.excelPreviewTimeout) {
+    //   clearTimeout(this.excelPreviewTimeout);
+    // }
     if (this.currentExcelUrl) {
       URL.revokeObjectURL(this.currentExcelUrl);
     }
@@ -1392,6 +1395,24 @@
         this.loading = false
       })
     },
+    // 鎺掑簭澶勭悊鏂规硶
+
+      // 娣诲姞handleSortChange鏂规硶
+          handleSortChange({ column, prop, order }) {
+           // alert(23)
+
+            if (order === 'ascending') {
+              this.queryParams.orderByColumn = prop;
+              this.queryParams.isAsc = 'asc';
+            } else if (order === 'descending') {
+              this.queryParams.orderByColumn = prop;
+              this.queryParams.isAsc = 'desc';
+            } else {
+              this.queryParams.orderByColumn = null;
+              this.queryParams.isAsc = null;
+            }
+            this.getList();
+          },
     // 鍙栨秷鎸夐挳
     cancel() {
       this.open = false
@@ -1512,15 +1533,25 @@
     handleInfo(row)
     {
 
+        //鍒ゆ柇蹇呴』淇敼鐨勫瓧娈垫槸鍚﹁ˉ鍏呭畬鏁翠簡
+       var valid = false;
+      var pageCount = row.pageCount
+      if(row.projectName!=null&&row.pageCount!=null&&row.caseTitle!=null&&row.constructionUnit)
+       valid = true;
+        if (valid) {
       var mid = row.id
       const roleId = 2
    //   alert(mid)
 
       var recordId = mid
-      var pageCount = row.pageCount
+
       var sho = true
     //  this.$router.push("/archiveManager/infoManagerAu/user/" + roleId+"/"+recordId)
       this.$router.push("/archiveManager/infoManagerAu/archiveMaterialManager/" + recordId+"/"+pageCount+"/"+sho)
+      }else
+      {
+        this.$modal.msgWarning("璇疯ˉ鍏呴〉鍙风瓑鐩稿叧淇℃伅锛屽啀缂栬緫鍗峰唴鐩綍锛�")
+      }
 
     },
     //
@@ -1738,7 +1769,9 @@
       this.getExcelFile(id).then(blob => {
         this.$modal.closeLoading();
         // 淇濆瓨鏂囦欢淇℃伅骞舵樉绀洪潤鎬佸脊绐�
+
         this.currentExcelUrl = URL.createObjectURL(blob);
+
         this.currentExcelBlob = blob;
         this.currentExcelId = id;
         this.excelDialogVisible = true;
@@ -1787,7 +1820,9 @@
       this.getExcelFile(id).then(blob => {
         this.$modal.closeLoading();
         // 淇濆瓨鏂囦欢淇℃伅骞舵樉绀洪潤鎬佸脊绐�
+        alert(23)
         this.currentExcelUrl = URL.createObjectURL(blob);
+        alert(this.currentExcelUrl)
         this.currentExcelBlob = blob;
         this.currentExcelId = id;
         this.excelDialogVisible = true;
@@ -1796,113 +1831,116 @@
         this.$modal.closeLoading();
         console.error('鑾峰彇Excel鏂囦欢澶辫触:', error);
         this.$modal.msgError('鑾峰彇Excel鏂囦欢澶辫触锛岃绋嶅悗閲嶈瘯');
+
+
+            this.showExcelPreview = false;
       });
-      // 閲嶇疆vue-office-excel缁勪欢
-      if (this.currentExcelUrl) {
-        const tempUrl = this.currentExcelUrl;
-        this.currentExcelUrl = '';
-        this.$nextTick(() => {
-          this.currentExcelUrl = tempUrl;
-        });
-      }
+      // // 閲嶇疆vue-office-excel缁勪欢
+      // if (this.currentExcelUrl) {
+      //   const tempUrl = this.currentExcelUrl;
+      //   this.currentExcelUrl = '';
+      //   this.$nextTick(() => {
+      //     this.currentExcelUrl = tempUrl;
+      //   });
+      // }
 
-      const previewContainer = this.$refs.excelPreviewContainer;
+      // const previewContainer = this.$refs.excelPreviewContainer;
 
-      // 娓呯┖棰勮瀹瑰櫒
-      if (previewContainer) {
-        previewContainer.innerHTML = '';
+      // // 娓呯┖棰勮瀹瑰櫒
+      // if (previewContainer) {
+      //   previewContainer.innerHTML = '';
 
-        // 灏濊瘯浣跨敤寰蒋Office Online棰勮鏈嶅姟浣滀负澶囬��
-        const officeOnlineUrl = `https://view.officeapps.live.com/op/embed.aspx?src=${encodeURIComponent(this.currentExcelUrl)}`;
+      //   // 灏濊瘯浣跨敤寰蒋Office Online棰勮鏈嶅姟浣滀负澶囬��
+      //   const officeOnlineUrl = `https://view.officeapps.live.com/op/embed.aspx?src=${encodeURIComponent(this.currentExcelUrl)}`;
 
-        // 鍒涘缓iframe鐢ㄤ簬棰勮
-        const iframe = document.createElement('iframe');
-        iframe.style.width = '100%';
-        iframe.style.height = '100%';
-        iframe.style.border = 'none';
-        iframe.style.minHeight = '600px';
-        iframe.src = officeOnlineUrl;
-        iframe.title = 'Excel鏂囦欢棰勮';
+      //   // 鍒涘缓iframe鐢ㄤ簬棰勮
+      //   const iframe = document.createElement('iframe');
+      //   iframe.style.width = '100%';
+      //   iframe.style.height = '100%';
+      //   iframe.style.border = 'none';
+      //   iframe.style.minHeight = '600px';
+      //   iframe.src = officeOnlineUrl;
+      //   iframe.title = 'Excel鏂囦欢棰勮';
 
-        // 鍒涘缓鍔犺浇鎸囩ず鍣�
-        const loadingIndicator = document.createElement('div');
-        loadingIndicator.className = 'loading-indicator';
-        loadingIndicator.innerHTML = `
-          <div class="loading-spinner"></div>
-          <p>姝e湪鍔犺浇Excel鏂囦欢锛岃绋嶅��...</p>
-        `;
-        previewContainer.style.position = 'relative';
-        previewContainer.appendChild(iframe);
-        previewContainer.appendChild(loadingIndicator);
+      //   // 鍒涘缓鍔犺浇鎸囩ず鍣�
+      //   const loadingIndicator = document.createElement('div');
+      //   loadingIndicator.className = 'loading-indicator';
+      //   loadingIndicator.innerHTML = `
+      //     <div class="loading-spinner"></div>
+      //     <p>姝e湪鍔犺浇Excel鏂囦欢锛岃绋嶅��...</p>
+      //   `;
+      //   previewContainer.style.position = 'relative';
+      //   previewContainer.appendChild(iframe);
+      //   previewContainer.appendChild(loadingIndicator);
 
-        // 鐩戝惉iframe鍔犺浇瀹屾垚
-        iframe.onload = () => {
-          this.excelLoading = false;
-          if (loadingIndicator && loadingIndicator.parentNode) {
-            loadingIndicator.parentNode.removeChild(loadingIndicator);
-          }
-        };
+      //   // 鐩戝惉iframe鍔犺浇瀹屾垚
+      //   iframe.onload = () => {
+      //     this.excelLoading = false;
+      //     if (loadingIndicator && loadingIndicator.parentNode) {
+      //       loadingIndicator.parentNode.removeChild(loadingIndicator);
+      //     }
+      //   };
 
-        // 璁剧疆瓒呮椂澶勭悊
-        this.excelPreviewTimeout = setTimeout(() => {
-          this.excelLoading = false;
-          if (loadingIndicator && loadingIndicator.parentNode) {
-            loadingIndicator.parentNode.removeChild(loadingIndicator);
-          }
+      //   // 璁剧疆瓒呮椂澶勭悊
+      //   this.excelPreviewTimeout = setTimeout(() => {
+      //     this.excelLoading = false;
+      //     if (loadingIndicator && loadingIndicator.parentNode) {
+      //       loadingIndicator.parentNode.removeChild(loadingIndicator);
+      //     }
 
-          // 灏濊瘯鐩存帴棰勮浣滀负澶囬�夋柟妗�
-          previewContainer.innerHTML = '';
-          const directIframe = document.createElement('iframe');
-          directIframe.style.width = '100%';
-          directIframe.style.height = '100%';
-          directIframe.style.border = 'none';
-          directIframe.style.minHeight = '600px';
-          directIframe.src = this.currentExcelUrl;
+      //     // 灏濊瘯鐩存帴棰勮浣滀负澶囬�夋柟妗�
+      //     previewContainer.innerHTML = '';
+      //     const directIframe = document.createElement('iframe');
+      //     directIframe.style.width = '100%';
+      //     directIframe.style.height = '100%';
+      //     directIframe.style.border = 'none';
+      //     directIframe.style.minHeight = '600px';
+      //     directIframe.src = this.currentExcelUrl;
 
-          const fallbackMessage = document.createElement('div');
-          fallbackMessage.textContent = 'Office棰勮鏈嶅姟鍔犺浇瓒呮椂锛屾鍦ㄥ皾璇曠洿鎺ラ瑙�...';
-          fallbackMessage.style.cssText = `
-            position: absolute;
-            top: 0;
-            left: 0;
-            right: 0;
-            padding: 10px;
-            background-color: #f56c6c;
-            color: white;
-            text-align: center;
-            font-size: 14px;
-            z-index: 10;
-          `;
+      //     const fallbackMessage = document.createElement('div');
+      //     fallbackMessage.textContent = 'Office棰勮鏈嶅姟鍔犺浇瓒呮椂锛屾鍦ㄥ皾璇曠洿鎺ラ瑙�...';
+      //     fallbackMessage.style.cssText = `
+      //       position: absolute;
+      //       top: 0;
+      //       left: 0;
+      //       right: 0;
+      //       padding: 10px;
+      //       background-color: #f56c6c;
+      //       color: white;
+      //       text-align: center;
+      //       font-size: 14px;
+      //       z-index: 10;
+      //     `;
 
-          previewContainer.appendChild(directIframe);
-          previewContainer.appendChild(fallbackMessage);
+      //     previewContainer.appendChild(directIframe);
+      //     previewContainer.appendChild(fallbackMessage);
 
-          directIframe.onload = () => {
-            if (fallbackMessage && fallbackMessage.parentNode) {
-              fallbackMessage.parentNode.removeChild(fallbackMessage);
-            }
-          };
+      //     directIframe.onload = () => {
+      //       if (fallbackMessage && fallbackMessage.parentNode) {
+      //         fallbackMessage.parentNode.removeChild(fallbackMessage);
+      //       }
+      //     };
 
-          // 浜屾瓒呮椂澶勭悊
-          setTimeout(() => {
-            if (directIframe && directIframe.parentNode) {
-              directIframe.parentNode.removeChild(directIframe);
-            }
-            const errorMessage = document.createElement('div');
-            errorMessage.innerHTML = `
-              <div style="text-align: center; padding: 40px;">
-                <h3 style="color: #f56c6c; margin-bottom: 20px;">棰勮澶辫触</h3>
-                <p style="color: #666; margin-bottom: 30px;">鏃犳硶鍦ㄦ祻瑙堝櫒涓瑙圗xcel鏂囦欢锛岃鐐瑰嚮涓嬫柟鎸夐挳涓嬭浇鏂囦欢鍚庢煡鐪嬨��</p>
-                <button onclick="this.parentNode.parentNode.querySelector('.download-btn').click()"
-                        style="padding: 8px 20px; background: #409EFF; color: white; border: none; border-radius: 4px; cursor: pointer;">
-                  涓嬭浇Excel鏂囦欢
-                </button>
-              </div>
-            `;
-            previewContainer.appendChild(errorMessage);
-          }, 20000);
-        }, 25000);
-      }
+      //     // 浜屾瓒呮椂澶勭悊
+      //     setTimeout(() => {
+      //       if (directIframe && directIframe.parentNode) {
+      //         directIframe.parentNode.removeChild(directIframe);
+      //       }
+      //       const errorMessage = document.createElement('div');
+      //       errorMessage.innerHTML = `
+      //         <div style="text-align: center; padding: 40px;">
+      //           <h3 style="color: #f56c6c; margin-bottom: 20px;">棰勮澶辫触</h3>
+      //           <p style="color: #666; margin-bottom: 30px;">鏃犳硶鍦ㄦ祻瑙堝櫒涓瑙圗xcel鏂囦欢锛岃鐐瑰嚮涓嬫柟鎸夐挳涓嬭浇鏂囦欢鍚庢煡鐪嬨��</p>
+      //           <button onclick="this.parentNode.parentNode.querySelector('.download-btn').click()"
+      //                   style="padding: 8px 20px; background: #409EFF; color: white; border: none; border-radius: 4px; cursor: pointer;">
+      //             涓嬭浇Excel鏂囦欢
+      //           </button>
+      //         </div>
+      //       `;
+      //       previewContainer.appendChild(errorMessage);
+      //     }, 20000);
+      //   }, 25000);
+      // }
     },
 
     /** 澶勭悊鎵撳嵃鎸夐挳鐐瑰嚮 */
@@ -1967,7 +2005,7 @@
         let filename = `record_${this.currentExcelId}`;
         if (includeQrCode) filename += '_qr';
         // if (selectedAnnotations.length > 0) {
-        //   filename += `_anno${selectedAnnotations.join('')}`;
+        //   filename += `_anno${selectedAnnotations.join('')}`;x
         // }
         filename += `_${new Date().getTime()}.xls`;
 

--
Gitblit v1.9.1