From 0c6b2eb953f5ed4df00a77a5f7b14b9ff6c563fe Mon Sep 17 00:00:00 2001
From: fei <791364011@qq.com>
Date: 星期日, 04 一月 2026 23:59:06 +0800
Subject: [PATCH] 修改代码

---
 src/views/archiveManager/archiveMaterial/index.vue |  602 ++++++++++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 534 insertions(+), 68 deletions(-)

diff --git a/src/views/archiveManager/archiveMaterial/index.vue b/src/views/archiveManager/archiveMaterial/index.vue
index 6b2df7a..79fd6da 100644
--- a/src/views/archiveManager/archiveMaterial/index.vue
+++ b/src/views/archiveManager/archiveMaterial/index.vue
@@ -1,6 +1,8 @@
 <template>
     <div class="app-container">
-         <h2 class="title-border">娣诲姞妗堝嵎璇︾粏璁板綍</h2>
+
+      <div v-if="sho">
+         <h2 class="title-border">娣诲姞妗堝嵎璇︾粏璁板綍   {褰撳墠褰曞叆浜唟{total}}鏉</h2>
  <el-form ref="form" :model="form" :rules="rules" label-width="100px">
 
    <el-row>
@@ -14,7 +16,31 @@
     <el-row>
     <el-col :span="16">
           <el-form-item label="璐d换鑰�" prop="creator">
-            <el-input v-model="form.creator" placeholder="璇疯緭鍏ヨ矗浠昏��" />
+            <div class="title-search-wrapper">
+              <el-input
+                type="textarea"
+                rows="1"
+                v-model="form.creator"
+                placeholder="璇疯緭鍏ヨ矗浠昏��"
+                @input="handleCreatorInput"
+                @focus="showCreatorSuggestions = true"
+                @blur="handleCreatorBlur"
+              />
+              <!-- 涓嬫媺寤鸿妗� -->
+              <div
+                v-if="showCreatorSuggestions && creatorSuggestions.length > 0"
+                class="title-suggestions"
+              >
+                <div
+                  v-for="(item, index) in creatorSuggestions"
+                  :key="index"
+                  class="suggestion-item"
+                  @mousedown="selectCreatorSuggestion(item)"
+                >
+                  {{ item }}
+                </div>
+              </div>
+            </div>
           </el-form-item>
           </el-col>
   </el-row>
@@ -22,7 +48,31 @@
 
   <el-col :span="16">
           <el-form-item label="鏂囦欢棰樺悕" prop="title">
-            <el-input v-model="form.title" placeholder="璇疯緭鍏ユ枃浠堕鍚�" />
+            <div class="title-search-wrapper">
+              <el-input
+                type="textarea"
+                rows="1"
+                v-model="form.title"
+                placeholder="璇疯緭鍏ユ枃浠堕鍚�"
+                @input="handleTitleInput"
+                @focus="showTitleSuggestions = true"
+                @blur="handleTitleBlur"
+              />
+              <!-- 涓嬫媺寤鸿妗� -->
+              <div
+                v-if="showTitleSuggestions && titleSuggestions.length > 0"
+                class="title-suggestions"
+              >
+                <div
+                  v-for="(item, index) in titleSuggestions"
+                  :key="index"
+                  class="suggestion-item"
+                  @mousedown="selectTitleSuggestion(item)"
+                >
+                  {{ item }}
+                </div>
+              </div>
+            </div>
           </el-form-item>
     </el-col>
     </el-row>
@@ -43,6 +93,7 @@
           <el-select
             v-model="form.fileStyle"
             placeholder="璇烽�夋嫨鏉愭枡绫诲瀷"
+            @change="handleFileStyleChange"
           >
             <el-option
               v-for="item in fileStyleOptions"
@@ -189,7 +240,7 @@
 
         </div>
 
-
+</div>
 
 <div class="title-border"></div>
 
@@ -197,7 +248,7 @@
 
 
 
-      <el-row :gutter="12" class="mb8">
+      <el-row :gutter="12" class="mb8 fixed-row">
         <el-col :span="1.5">
           <el-button
             type="primary"
@@ -210,6 +261,7 @@
         </el-col>
         <el-col :span="1.5">
           <el-button
+          v-if="sho"
             type="success"
             plain
             icon="el-icon-edit"
@@ -219,6 +271,17 @@
             v-hasPermi="['system:materials:edit']"
           >淇敼</el-button>
         </el-col>
+           <el-col :span="1.5">
+          <el-button
+            type="warning"
+            plain
+            icon="el-icon-download"
+            size="mini"
+            @click="handleExportDir"
+            v-hasPermi="['system:materials:list']"
+
+          >瀵煎嚭鍗峰唴鐩綍</el-button>
+        </el-col>
         <el-col :span="1.5">
           <el-button
             type="warning"
@@ -226,11 +289,13 @@
             icon="el-icon-download"
             size="mini"
             @click="handleExport"
+            v-hasPermi="['system:materials:list']"
 
-          >瀵煎嚭</el-button>
+          >瀵煎嚭鐢靛瓙鏂囦欢鐩綍</el-button>
         </el-col>
         <el-col :span="1.5">
           <el-button
+          v-if="sho"
             type="danger"
             plain
             icon="el-icon-delete"
@@ -243,6 +308,7 @@
 
           <el-col :span="1.5">
           <el-button
+          v-if="sho"
             type="success"
             plain
             icon="el-icon-edit"
@@ -288,7 +354,7 @@
         >瀵煎叆妯℃澘涓嬭浇</el-button>
       </el-col>
 
-        <el-col :span="1.5">
+        <el-col      v-if="sho" :span="1.5">
 
         <el-upload
           action=""
@@ -310,7 +376,7 @@
 
       <el-table v-loading="loading" :data="materialsList" @selection-change="handleSelectionChange">
         <el-table-column type="selection" width="55" align="center" />
-        <el-table-column label="鎿嶄綔" align="center" width="160" class-name="small-padding ">
+        <el-table-column v-if="sho" label="鎿嶄綔" align="center" width="160" class-name="small-padding ">
               <template slot-scope="scope">
                 <el-button
                   size="mini"
@@ -347,8 +413,8 @@
         </el-table-column>
         <el-table-column label="椤靛彿" sortable align="center" prop="pageNumber"  />
         <el-table-column label="澶囨敞" align="center" prop="remarks" />
-                <el-table-column label="椤垫" sortable align="center" prop="pageOrder"  />
-
+            <!--          <el-table-column label="椤垫" sortable align="center" prop="pageOrder"  />
+--->
         <el-table-column label="鎵�澶勯樁娈�" sortable align="center" width="180" prop="stage" />
         <el-table-column label="鍏紑灞炴��" sortable align="center" width="180" prop="publicity" />
         <el-table-column label="鏄惁涓洪檮鍥惧強闄勪欢" align="center" prop="isAttachment" />
@@ -359,13 +425,13 @@
 
         <el-table-column label="鏄惁娑夊瘑鍙婃晱鎰熶俊鎭�" align="center" prop="isSensitive" />
         <el-table-column label="鏄惁娉ㄩ攢" align="center" prop="isCanceled" />
-        <el-table-column label="鏍煎紡" align="center" prop="format" />
+     <!--   <el-table-column label="鏍煎紡" align="center" prop="format" />
         <el-table-column label="骞呴潰" align="center" prop="sizeType" />
         <el-table-column label="姘村钩鍒嗚鲸鐜�" align="center" prop="horizontalResolution" />
         <el-table-column label="鍨傜洿鍒嗚鲸鐜�" align="center" prop="verticalResolution" />
         <el-table-column label="瀹藉害" align="center" prop="width" />
         <el-table-column label="楂樺害" align="center" prop="height" />
-        <el-table-column label="澶у皬" align="center" prop="fileSize" />
+        <el-table-column label="澶у皬" align="center" prop="fileSize" /> -->
         <el-table-column label="闄勪欢鍙婂巻鍙插彂鏂囧彿" align="center" prop="attachmentHistoryNumbers" />
 
 
@@ -393,13 +459,13 @@
            <el-row>
            <el-col :span="16">
                <el-form-item label="璐d换鑰�" prop="creator">
-                   <el-input v-model="forms.creator" placeholder="璇疯緭鍏ヨ矗浠昏��" />
+                   <el-input type="textarea" rows="1" v-model="forms.creator" placeholder="璇疯緭鍏ヨ矗浠昏��" />
                  </el-form-item>
            </el-col>
 
            </el-row>
            <el-form-item label="鏂囦欢棰樺悕" prop="title">
-             <el-input v-model="forms.title" placeholder="璇疯緭鍏ユ枃浠堕鍚�" />
+             <el-input type="textarea" rows="1" v-model="forms.title" placeholder="璇疯緭鍏ユ枃浠堕鍚�" />
            </el-form-item>
                  <el-form-item label="鏃ユ湡" prop="date">
                   <el-input v-model="forms.date" placeholder="璇疯緭鍏ユ棩鏈� (鏍煎紡锛歽yyy-mm-dd)" style="width: 200px;" />
@@ -416,9 +482,9 @@
     <el-form-item label="鏉愭枡绫诲瀷" prop="fileStyle">
           <el-select
             v-model="forms.fileStyle"
-
             placeholder="璇烽�夋嫨鏉愭枡绫诲瀷"
             clearable
+            @change="handleFileStyleChange2"
           >
             <el-option
               v-for="item in fileStyleOptions"
@@ -428,7 +494,7 @@
             />
           </el-select>
         </el-form-item>
-     <el-form-item label="椤靛彿" prop="pageNumber">
+     <el-form-item label="椤靛彿" prop="pageNumber" v-if="forms.fileStyle !== '鍏朵粬鏉愭枡'">
         <el-col :span="8">
           <el-input
             v-model.number="forms.pageNumber"
@@ -571,9 +637,11 @@
       <el-form-item label="鏂囦欢棰樺悕" prop="title">
         <el-input
           v-model="queryParams.title"
-          placeholder="璇疯緭鍏ユ枃浠堕鐩�"
+          placeholder="璇疯緭鍏ユ枃浠堕鍚�"
           clearable
           @keyup.enter.native="handleQuery"
+          :validate-event="false"
+          @blur="validateQueryTitle"
         />
       </el-form-item>
       <el-form-item label="鏃ユ湡" prop="date">
@@ -586,7 +654,7 @@
           placeholder="璇烽�夋嫨鏃ユ湡">
         </el-date-picker> -->
       </el-form-item>
-      <el-form-item label="椤靛彿" prop="pageNumber">
+    <!--  <el-form-item label="椤靛彿" prop="pageNumber">
         <el-col :span="8">
           <el-input
             v-model.number="queryParams.pageNumber"
@@ -606,7 +674,7 @@
           clearable
           @keyup.enter.native="handleQuery"
         />
-      </el-form-item>
+      </el-form-item> -->
      <el-form-item label="鏂囧瓧鏉愭枡" prop="fileStyle">
           <el-select
             v-model="queryParams.fileStyle"
@@ -740,7 +808,7 @@
   </template>
 
   <script>
-  import { listMaterials, enload, getMaterials, delMaterials, addMaterials, updateMaterials } from "@/api/system/materials"
+  import {insertFile, getFileCount,islegal, listMaterials, enload, getMaterials, delMaterials, addMaterials, updateMaterials } from "@/api/system/materials"
 import { getToken } from '@/utils/auth'
 import store from '@/store'
 import { updateStatusById } from "@/api/system/records"
@@ -750,15 +818,27 @@
     name: "Materials",
     data() {
       return {
+        //鏄惁鏄剧ず鐩稿叧鍐呭
+        sho: true,
+        totalPageCount: 0,
+        // 璁板綍鍏冪礌鍒濆浣嶇疆鍜岀姸鎬�
+  originalOffsetLeft: 0,
+        originalWidth: 0,
+            placeholderEl: null,
+
        importDialogVisible: false,
       fileList: [],
-      uploadUrl:  process.env.VUE_APP_BASE_API +'/system/materials/upload/'+this.recordId, // 鏇挎崲涓哄疄闄呯殑涓婁紶鎺ュ彛
+      uploadUrl:  process.env.VUE_APP_BASE_API +'/system/materials/uploads/'+this.recordId, // 鏇挎崲涓哄疄闄呯殑涓婁紶鎺ュ彛
            headers: {
         Authorization: 'Bearer ' + getToken()
       },
       uploadParams: {
         type: 'material' // 鑷畾涔変笂浼犵被鍨�
       },
+      // 涓婁紶鐘舵�佽窡韪�
+      uploadSuccessCount: 0,
+      uploadFailCount: 0,
+      totalUploadFiles: 0,
       // 娣诲姞鏉愭枡绫诲瀷閫夐」
       fileStyleOptions: [
           { value: '鏂囧瓧鏉愭枡', label: '鏂囧瓧鏉愭枡' },
@@ -819,6 +899,13 @@
         materialsList: [],
         // 寮瑰嚭灞傛爣棰�
         title: "",
+        // 鏂囦欢棰樺悕鎼滅储鐩稿叧
+        titleSuggestions: [], // 鍖归厤鐨勬枃浠堕鍚嶅缓璁垪琛�
+        showTitleSuggestions: false, // 鏄惁鏄剧ず寤鸿妗�
+        titleSearchTimer: null, // 闃叉姈瀹氭椂鍣�
+        creatorSuggestions: [], // 鍖归厤鐨勮矗浠讳汉寤鸿鍒楄〃
+        showCreatorSuggestions: false, // 鏄惁鏄剧ず璐d换浜哄缓璁
+        creatorSearchTimer: null, // 璐d换浜烘煡璇㈤槻鎶栧畾鏃跺櫒
         // 鏄惁鏄剧ず寮瑰嚭灞�
         open: false,
         titles: "",
@@ -863,36 +950,91 @@
         // 琛ㄥ崟鏍¢獙
         rules: {
           creator: [
-           // { required: true, message: "鍒涘缓鑰呬笉鑳戒负绌�", trigger: "blur" }
+           // { required: true, message: "鍒涘缓鑰呬笉鑳戒负绌�", trigger: "blur" },
+            { max: 85, message: "鏈�澶ч暱搴︿负85涓瓧绗�", trigger: "blur" }
           ],
           title: [
-            { required: true, message: "妗堝嵎棰樺悕涓嶈兘涓虹┖", trigger: "blur" }
+            { required: true, message: "妗堝嵎棰樺悕涓嶈兘涓虹┖", trigger: "blur" },
+             { pattern: /^[^\\/:*?"<>涓╙+$/, message: "鏂囦欢鍚嶄笉鑳藉寘鍚� \\\:*?<>涓� 绛夌壒娈婂瓧绗�", trigger: "blur" },
+            { max: 85, message: "鏈�澶ч暱搴︿负85涓瓧绗�", trigger: "blur" }
           ],
           date: [
           //  { required: true, message: "鏃ユ湡涓嶈兘涓虹┖", trigger: "blur" },
-            { pattern: /^\d{4}-\d{2}-\d{2}$/, message: "鏃ユ湡鏍煎紡蹇呴』涓簓yyy-mm-dd", trigger: "blur" }
+            { pattern: /^\d{4}-\d{2}-\d{2}$/, message: "鏃ユ湡鏍煎紡蹇呴』涓簓yyy-mm-dd", trigger: "blur" },
+            { max: 85, message: "鏈�澶ч暱搴︿负85涓瓧绗�", trigger: "blur" }
           ],
           pageNumber: [
             { required: true, message: "椤靛彿涓嶈兘涓虹┖", trigger: "blur" },
             { type: 'number', message: '椤靛彿蹇呴』涓烘暟瀛楃被鍨�', trigger: ['blur', 'change'] },
-            { pattern: /^\d+$/, message: '璇疯緭鍏ユ鏁存暟', trigger: 'blur' }
+            { pattern: /^[1-9]\d*$/, message: '璇疯緭鍏ュぇ浜�0鐨勬鏁存暟', trigger: 'blur' },
+            { validator: (rule, value, callback) => {
+                if (this.totalPageCount > 0 && value > this.totalPageCount) {
+                  callback(new Error(`椤靛彿涓嶈兘瓒呰繃鎬婚〉鏁�${this.totalPageCount}`));
+                } else {
+                  callback();
+                }
+              }, trigger: ['blur', 'change']
+            },
+            // { max: 85, message: "鏈�澶ч暱搴︿负85涓瓧绗�", trigger: "blur" }
           ],
           stage: [
-            { required: true, message: "鎵�澶勯樁娈典笉鑳戒负绌�", trigger: "change" }
+            { required: true, message: "鎵�澶勯樁娈典笉鑳戒负绌�", trigger: "change" },
+            { max: 85, message: "鏈�澶ч暱搴︿负85涓瓧绗�", trigger: "blur" }
+          ],
+          fileStyle: [
+            { required: true, message: "鏉愭枡绫诲瀷涓嶈兘涓虹┖", trigger: "change" },
+            { max: 85, message: "鏈�澶ч暱搴︿负85涓瓧绗�", trigger: "blur" }
+          ],
+          isAttachment: [
+            { required: true, message: "鏄惁涓洪檮浠朵笉鑳戒负绌�", trigger: "change" },
+            { max: 85, message: "鏈�澶ч暱搴︿负85涓瓧绗�", trigger: "blur" }
+          ],
+          retentionPeriod: [
+            { required: true, message: "淇濈鏈熼檺涓嶈兘涓虹┖", trigger: "change" },
+            { max: 85, message: "鏈�澶ч暱搴︿负85涓瓧绗�", trigger: "blur" }
+          ],
+          isSensitive: [
+            { required: true, message: "鏄惁鏁忔劅涓嶈兘涓虹┖", trigger: "change" },
+            { max: 85, message: "鏈�澶ч暱搴︿负85涓瓧绗�", trigger: "blur" }
+          ],
+          isCanceled: [
+            { required: true, message: "鏄惁娉ㄩ攢涓嶈兘涓虹┖", trigger: "change" },
+            { max: 85, message: "鏈�澶ч暱搴︿负85涓瓧绗�", trigger: "blur" }
           ]
         }
       }
     },
+
+
+
    mounted() {
+     // 娣诲姞婊氬姩浜嬩欢鐩戝惉
+     window.addEventListener('scroll', this.handleScroll);
     // 鏀逛负鐩戝惉keydown浜嬩欢
     document.addEventListener('keydown', this.handleKeyDown)
   },
   beforeDestroy() {
+    // 绉婚櫎婊氬姩浜嬩欢鐩戝惉
+
     document.removeEventListener('keydown', this.handleKeyDown)
+    // 绉婚櫎婊氬姩浜嬩欢鐩戝惉
+    window.removeEventListener('scroll', this.handleScroll);
+    // 娓呯悊鍗犱綅绗�
+    if (this.placeholderEl && this.placeholderEl.parentNode) {
+      this.placeholderEl.parentNode.removeChild(this.placeholderEl);
+    }
   },
     created() {
       //const roleId = this.$route.params && this.$route.params.roleId
       const recordId = this.$route.params && this.$route.params.recordId
+
+      this.totalPageCount = this.$route.params && this.$route.params.pageCount
+
+      this.sho = this.$route.params && this.$route.params.sho
+      // 灏嗗瓧绗︿覆杞崲涓哄竷灏斿��
+      this.sho = this.sho === true || this.sho === "true"
+
+      //alert(this.totalPageCount)
       //alert(recordId)
       this.recordId = recordId;
       this.uploadUrl = process.env.VUE_APP_BASE_API +'/system/materials/upload/'+this.recordId
@@ -913,30 +1055,49 @@
     methods: {
         // 涓婁紶澶辫触鍥炶皟
     handleError(err, file, fileList) {
-      this.$modal.msgError("涓婁紶澶辫触: " + err.message)
-       // 娓呴櫎涓婁紶鍒楄〃
-  this.$refs.upload.clearFiles();
+      // 澶辫触璁℃暟+1
+      this.uploadFailCount++;
+      // 妫�鏌ユ槸鍚︽墍鏈夋枃浠堕兘涓婁紶瀹屾垚
+      this.checkUploadComplete();
     },
           // 涓婁紶鎴愬姛鍥炶皟
     handleSuccess(response, file, fileList) {
       if (response.code === 200) {
-        this.$modal.msgSuccess("涓婁紶鎴愬姛")
- // 娓呴櫎涓婁紶鍒楄〃
-  this.$refs.upload.clearFiles();
-  // 鍏抽棴涓婁紶瀵硅瘽妗�
-  this.importDialogVisible = false;
-        // 鍒锋柊鍒楄〃鏁版嵁
-        this.getList();        // 杩欓噷鍙互璋冪敤鎺ュ彛鍏宠仈涓婁紶鐨勬枃浠跺拰褰撳墠璁板綍
-        //鏇存柊妗f鐨勭姸鎬�
-
+        // 鎴愬姛璁℃暟+1
+        this.uploadSuccessCount++;
       } else {
-        // alert(234)
-        console.log(response)
-        this.$modal.msgError(response.msg)
+        // 澶辫触璁℃暟+1
+        this.uploadFailCount++;
+      }
+      // 妫�鏌ユ槸鍚︽墍鏈夋枃浠堕兘涓婁紶瀹屾垚
+      this.checkUploadComplete();
+    },
+    // 妫�鏌ユ墍鏈夋枃浠舵槸鍚︿笂浼犲畬鎴�
+    checkUploadComplete() {
+      // 褰撴墍鏈夋枃浠堕兘涓婁紶瀹屾垚鏃�
+      if (this.uploadSuccessCount + this.uploadFailCount === this.totalUploadFiles) {
+        if (this.uploadFailCount === 0) {
+          // 鎵�鏈夋枃浠朵笂浼犳垚鍔�
+          this.$modal.msgSuccess("鎵�鏈夋枃浠朵笂浼犳垚鍔�");
+        } else {
+          // 閮ㄥ垎鏂囦欢涓婁紶澶辫触
+          this.$modal.msgError(`涓婁紶瀹屾垚锛屼絾鏈� ${this.uploadFailCount} 涓枃浠朵笂浼犲け璐);
+        }
+        // 娓呴櫎涓婁紶鍒楄〃
+        this.$refs.upload.clearFiles();
+        // 鍏抽棴涓婁紶瀵硅瘽妗�
+        this.importDialogVisible = false;
+        // 鍒锋柊鍒楄〃鏁版嵁
+        this.getList();
       }
     },
-       // 鎵撳紑瀵煎叆瀵硅瘽妗�
+     // 鎵撳紑瀵煎叆瀵硅瘽妗�
     handleImport() {
+      //鐢熸垚鏂扮殑璁板綍
+      insertFile(this.recordId, this.totalPageCount).then(response => {
+        console.log(response)
+      //  alert(3245)
+        })
       this.importDialogVisible = true
     },
     // 鏂囦欢绉婚櫎
@@ -959,14 +1120,36 @@
         this.$modal.msgWarning('璇峰厛閫夋嫨鏂囦欢鍐嶄笂浼�')
         return
       }
-      if(fileCount!==this.total)
-      {
-        this.$modal.msgWarning('璇烽�夋嫨涓庤褰曟暟涓�鑷寸殑鏂囦欢鎴栬�呬慨鏀瑰搴旂殑椤电爜浣垮叾瀵瑰簲')
-        return
-      }
+     // alert(this.recordId)
+
+
       //鍒ゆ柇椤靛彿涓庝笂浼犱笂浼犵殑鏂囦欢鐨勯〉鍙锋槸涓嶆槸涓�涓�瀵瑰簲鐨�
-      // 鎵ц涓婁紶
-      this.$refs.upload.submit()
+     // islegal(this.recordId).then(response => {
+     //   console.log(response.data)
+     //   var res = response.data.res
+     //  console.log(res)
+       //alert(response.data.total)
+       if(fileCount!=this.totalPageCount)
+       {
+         this.$modal.msgWarning('璇烽�夋嫨涓庤褰曟暟涓�鑷寸殑鏂囦欢')
+         return
+       }
+       else
+       {
+         // 鍒濆鍖栦笂浼犵姸鎬佽鏁�
+         this.uploadSuccessCount = 0;
+         this.uploadFailCount = 0;
+         this.totalUploadFiles = fileCount;
+         // 鎵ц涓婁紶
+           this.$refs.upload.submit()
+           this.getList()
+       }
+       // else
+       // {
+       //   this.$modal.msgError("椤靛彿涓嶈繛缁紝璇蜂慨鏀逛负杩炵画姝g‘鐨勯〉鍙凤紒")
+       // }
+     //})
+
     },
     clearFileList() {
       this.fileList = [];
@@ -999,7 +1182,8 @@
         this.loading = true
         listMaterials(this.queryParams).then(response => {
           console.log(response)
-          this.materialsList = response.data.data
+          // 杩囨护鎺塿isible涓�0鐨勮褰�
+          this.materialsList = response.data.data.filter(item => item.visible !== 0)
           this.total = response.data.total
           this.loading = false
         })
@@ -1040,6 +1224,129 @@
         }
         this.resetForm("forms")
       },
+      // 澶勭悊鏂囦欢棰樺悕杈撳叆浜嬩欢
+      handleTitleInput() {
+        // 娓呴櫎涔嬪墠鐨勫畾鏃跺櫒锛堥槻鎶栵級
+        if (this.titleSearchTimer) {
+          clearTimeout(this.titleSearchTimer);
+        }
+
+        // 褰撹緭鍏ユ涓虹┖鏃讹紝娓呯┖寤鸿鍒楄〃
+        if (!this.form.title.trim()) {
+          this.titleSuggestions = [];
+          return;
+        }
+
+        // 璁剧疆鏂扮殑瀹氭椂鍣紝寤惰繜鎵ц鏌ヨ
+        this.titleSearchTimer = setTimeout(() => {
+          this.searchTitleSuggestions();
+        }, 300);
+      },
+
+      // 鎼滅储鏂囦欢棰樺悕寤鸿
+      searchTitleSuggestions() {
+        // 浣跨敤鐜版湁鐨刲istMaterials API锛屼紶鍏itle浣滀负鏌ヨ鍙傛暟
+        listMaterials(
+       {
+          title: this.form.title,
+          pageSize: 10 // 闄愬埗杩斿洖鏁伴噺
+        }).then(response => {
+          console.log(response.data.data)
+        //  alert(23)
+          // 鎻愬彇骞跺幓閲峵itle瀛楁
+          const titles = response.data.data.map(item => item.title);
+          // 鍘婚噸澶勭悊
+          this.titleSuggestions = [...new Set(titles)];
+          // 鏄剧ず寤鸿妗�
+          this.showTitleSuggestions = true;
+        }).catch(() => {
+          // 閿欒澶勭悊
+          this.titleSuggestions = [];
+        });
+      },
+
+      // 澶勭悊澶辩劍浜嬩欢
+      handleTitleBlur() {
+        // 寤惰繜闅愯棌锛屼互渚垮彲浠ョ偣鍑婚�夋嫨寤鸿椤�
+        setTimeout(() => {
+          this.showTitleSuggestions = false;
+        }, 200);
+      },
+
+      // 閫夋嫨寤鸿椤�
+      selectTitleSuggestion(title) {
+        this.form.title = title;
+        this.showTitleSuggestions = false;
+      },
+
+      // 澶勭悊璐d换浜鸿緭鍏ヤ簨浠�
+      handleCreatorInput() {
+        // 娓呴櫎涔嬪墠鐨勫畾鏃跺櫒锛堥槻鎶栵級
+        if (this.creatorSearchTimer) {
+          clearTimeout(this.creatorSearchTimer);
+        }
+
+        // 褰撹緭鍏ユ涓虹┖鏃讹紝娓呯┖寤鸿鍒楄〃
+        if (!this.form.creator.trim()) {
+          this.creatorSuggestions = [];
+          return;
+        }
+
+        // 璁剧疆鏂扮殑瀹氭椂鍣紝寤惰繜鎵ц鏌ヨ
+        this.creatorSearchTimer = setTimeout(() => {
+          this.searchCreatorSuggestions();
+        }, 300);
+      },
+
+      // 鎼滅储璐d换浜哄缓璁�
+      searchCreatorSuggestions() {
+        // 浣跨敤鐜版湁鐨刲istMaterials API锛屼紶鍏reator浣滀负鏌ヨ鍙傛暟
+        listMaterials(
+        {
+          creator: this.form.creator,
+          pageSize: 10 // 闄愬埗杩斿洖鏁伴噺
+        }).then(response => {
+          // 鎻愬彇骞跺幓閲峜reator瀛楁
+          const creators = response.data.data.map(item => item.creator).filter(Boolean);
+          // 鍘婚噸澶勭悊
+          this.creatorSuggestions = [...new Set(creators)];
+          // 鏄剧ず寤鸿妗�
+          this.showCreatorSuggestions = true;
+        }).catch(() => {
+          // 閿欒澶勭悊
+          this.creatorSuggestions = [];
+        });
+      },
+
+      // 澶勭悊璐d换浜鸿緭鍏ユ澶辩劍浜嬩欢
+      handleCreatorBlur() {
+        // 寤惰繜闅愯棌锛屼互渚垮彲浠ョ偣鍑婚�夋嫨寤鸿椤�
+        setTimeout(() => {
+          this.showCreatorSuggestions = false;
+        }, 200);
+      },
+
+      // 閫夋嫨璐d换浜哄缓璁」
+      selectCreatorSuggestion(creator) {
+        this.form.creator = creator;
+        this.showCreatorSuggestions = false;
+      },
+
+      // 澶勭悊鏉愭枡绫诲瀷鍙樺寲
+      handleFileStyleChange(value) {
+        // 褰撻�夋嫨'鍏朵粬鏉愭枡'鏃讹紝娓呯┖椤电爜瀛楁
+        if (value === '鍏朵粬鏉愭枡') {
+          this.form.pageNumber = null;
+        }
+      },
+      // 澶勭悊鏉愭枡绫诲瀷鍙樺寲锛堜慨鏀硅〃鍗曪級
+      handleFileStyleChange2(value) {
+        // 褰撻�夋嫨'鍏朵粬鏉愭枡'鏃讹紝灏嗛〉鍙疯缃负0
+        if (value === '鍏朵粬鏉愭枡') {
+          this.forms.pageNumber = null;
+        }
+      },
+
       // 琛ㄥ崟閲嶇疆
       reset() {
         this.form = {
@@ -1072,8 +1379,24 @@
         }
         this.resetForm("form")
       },
+
+      // 楠岃瘉鏌ヨ琛ㄥ崟涓殑鏂囦欢棰樺悕
+      validateQueryTitle() {
+        const illegalCharsPattern = /[\\/:*?<>涓╙/;
+        if (this.queryParams.title && illegalCharsPattern.test(this.queryParams.title)) {
+          this.$message.error("鏂囦欢鍚嶄笉鑳藉寘鍚� \\:/:*?<>涓� 绛夌壒娈婂瓧绗�");
+          this.queryParams.title = this.queryParams.title.replace(illegalCharsPattern, '');
+        }
+      },
       /** 鎼滅储鎸夐挳鎿嶄綔 */
       handleQuery() {
+        // 鎼滅储鍓嶆牎楠屾枃浠堕鍚�
+        const illegalCharsPattern = /[\\/:*?<>涓╙/;
+        if (this.queryParams.title && illegalCharsPattern.test(this.queryParams.title)) {
+          this.$message.error("鏂囦欢鍚嶄笉鑳藉寘鍚� \\:/:*?<>涓� 绛夌壒娈婂瓧绗�");
+          this.queryParams.title = this.queryParams.title.replace(illegalCharsPattern, '');
+          return; // 闃绘鎼滅储锛岀洿鍒扮敤鎴蜂慨姝h緭鍏�
+        }
         this.queryParams.pageNum = 1
         this.getList()
       },
@@ -1100,6 +1423,10 @@
         const materialId = row.materialId || this.ids
         getMaterials(materialId).then(response => {
           this.forms = response.data
+          // 濡傛灉鏉愭枡绫诲瀷鏄�"鍏朵粬鏉愭枡"锛屽皢椤靛彿璁剧疆涓�0
+          if (this.forms.fileStyle === '鍏朵粬鏉愭枡') {
+            this.forms.pageNumber = null;
+          }
           this.open = true
           this.title = "淇敼妗堝嵎璇︾粏淇℃伅"
         })
@@ -1176,14 +1503,14 @@
 
           // 淇濆瓨鎴愬姛鍚庯紝鍏夋爣璺冲洖鏂囦欢缂栧彿杈撳叆妗�
           this.$nextTick(() => {
-            this.$refs.documentNumberInput.focus();
+            this.$refs.documentNumberInput.select();
           });
           this.getList()
-        })
-        }
-        else
-        {
-          this.$message.error('璇峰~鍐欐墍鏈夊繀濉瓧娈�');
+          })
+          }
+          else
+          {
+            this.$message.error('璇峰~鍐欐墍鏈夊繀濉瓧娈�');
 
         }
         })
@@ -1195,10 +1522,7 @@
             if (this.forms.materialId != null) {
               updateMaterials(this.forms).then(response => {
                 this.$modal.msgSuccess("淇敼鎴愬姛")
-                // 淇敼鎴愬姛鍚庯紝鍏夋爣璺冲洖鏂囦欢缂栧彿杈撳叆妗�
-                this.$nextTick(() => {
-                  this.$refs.documentNumberInput.focus();
-                });
+
                 this.open = false
                 this.getList()
               })
@@ -1218,11 +1542,45 @@
           this.$modal.msgSuccess("鍒犻櫎鎴愬姛")
         }).catch(() => {})
       },
-      /** 瀵煎嚭鎸夐挳鎿嶄綔 */
+           /** 瀵煎嚭鎸夐挳鎿嶄綔 - 鏀寔瀵煎嚭閫変腑琛屾垨鍏ㄩ儴鏁版嵁 */
+      handleExportDir() {
+        // 鍒ゆ柇鏄惁鏈夐�変腑鐨勮
+        if (this.ids && this.ids.length > 0) {
+          // 鏄剧ず瀵煎嚭閫変腑琛岀殑鎻愮ず
+          this.$message.info(`姝e湪瀵煎嚭${this.ids.length}鏉¢�変腑鐨勬暟鎹�...`);
+          // 瀵煎嚭閫変腑鐨勮鏁版嵁
+          this.download('system/materials/exportDir', {
+            ids: this.ids.join(','),
+         //   exportType: 'selected'
+          }, `materiaDir_selected_${new Date().getTime()}.xls`)
+        } else {
+          // 鏄剧ず瀵煎嚭鍏ㄩ儴鏁版嵁鐨勬彁绀�
+          this.$message.info('姝e湪瀵煎嚭绗﹀悎褰撳墠鏌ヨ鏉′欢鐨勬墍鏈夋暟鎹�...');
+          // 娌℃湁閫変腑琛屾椂锛屽鍑哄綋鍓嶆煡璇㈡潯浠剁殑鏁版嵁
+          this.download('system/materials/exportDir', {
+            ...this.queryParams
+          }, `materiaDir_${new Date().getTime()}.xls`)
+        }
+      },
+      /** 瀵煎嚭鎸夐挳鎿嶄綔 - 鏀寔瀵煎嚭閫変腑琛屾垨鍏ㄩ儴鏁版嵁 */
       handleExport() {
-        this.download('system/materials/export', {
-          ...this.queryParams
-        }, `materials_${new Date().getTime()}.xlsx`)
+        // 鍒ゆ柇鏄惁鏈夐�変腑鐨勮
+        if (this.ids && this.ids.length > 0) {
+          // 鏄剧ず瀵煎嚭閫変腑琛岀殑鎻愮ず
+          this.$message.info(`姝e湪瀵煎嚭${this.ids.length}鏉¢�変腑鐨勬暟鎹�...`);
+          // 瀵煎嚭閫変腑鐨勮鏁版嵁
+          this.download('system/materials/export', {
+            ids: this.ids.join(','),
+         //   exportType: 'selected'
+          }, `materials_selected_${new Date().getTime()}.xls`)
+        } else {
+          // 鏄剧ず瀵煎嚭鍏ㄩ儴鏁版嵁鐨勬彁绀�
+          this.$message.info('姝e湪瀵煎嚭绗﹀悎褰撳墠鏌ヨ鏉′欢鐨勬墍鏈夋暟鎹�...');
+          // 娌℃湁閫変腑琛屾椂锛屽鍑哄綋鍓嶆煡璇㈡潯浠剁殑鏁版嵁
+          this.download('system/materials/export', {
+            ...this.queryParams
+          }, `materials_${new Date().getTime()}.xls`)
+        }
       },
 
        /** 瀵煎叆妯℃澘涓嬭浇鎿嶄綔*/
@@ -1230,7 +1588,7 @@
     {
       this.download('/system/materials/model', {
 
-      }, `materials_${new Date().getTime()}.xlsx`)
+      }, `materials_${new Date().getTime()}.xls`)
     },
        /** 瀵煎叆鎿嶄綔*/
     async handleImportData({file}){
@@ -1241,7 +1599,7 @@
   // }
   const formData = new FormData();
   formData.append('file', file);
- // formData.append('recordId', this.recordId)
+  formData.append('recordId', this.recordId)
   // alert(this.recordId)
   console.log(file)
 
@@ -1293,13 +1651,121 @@
 
       }).catch(() => {})
     },
-    }
+
+    // 婊氬姩浜嬩欢澶勭悊
+    handleScroll() {
+      const fixedRow = document.querySelector('.fixed-row');
+      if (!fixedRow) return;
+
+      // 鑾峰彇鍏冪礌褰撳墠浣嶇疆淇℃伅
+      const rect = fixedRow.getBoundingClientRect();
+      const parentRect = fixedRow.parentNode.getBoundingClientRect();
+
+      // 璁板綍鍏冪礌鐨勫師濮嬩綅缃紙鐩稿浜庢枃妗i《閮ㄧ殑浣嶇疆锛�
+      if (!this.originalTop) {
+        this.originalTop = rect.top + window.pageYOffset;
+      }
+
+      // 妫�鏌ュ厓绱犳槸鍚﹀簲璇ヨ繘鍏ユ偓娴姸鎬侊紙褰撴粴鍔ㄤ綅缃秴杩囧厓绱犲師濮嬩綅缃椂锛�
+      if (window.pageYOffset >= this.originalTop) {
+        // 鍙湪涓嶅湪floating鐘舵�佹椂娣诲姞锛岄伩鍏嶉噸澶嶆搷浣�
+        if (!fixedRow.classList.contains('floating')) {
+          // 璁板綍鍏冪礌鍘熷鐨勫乏鍋忕Щ閲忥紙鐩稿浜庣埗瀹瑰櫒锛�
+          this.originalOffsetLeft = rect.left - parentRect.left;
+          // 璁板綍鍏冪礌鐨勫師濮嬪搴�
+          this.originalWidth = rect.width;
+
+          // 娣诲姞floating绫伙紝浣垮厓绱犲浐瀹氬湪椤堕儴
+          fixedRow.classList.add('floating');
+          // 璁剧疆鍥哄畾浣嶇疆鏃剁殑鏍峰紡锛屼繚鎸佷笌鍘熷甯冨眬涓�鑷�
+          fixedRow.style.left = this.originalOffsetLeft + 'px';
+          fixedRow.style.width = this.originalWidth + 'px';
+
+          // 娣诲姞涓存椂鍗犱綅绗︼紝闃叉椤甸潰甯冨眬璺冲姩
+          if (!this.placeholderEl) {
+            this.placeholderEl = document.createElement('div');
+            this.placeholderEl.style.height = rect.height + 'px';
+            this.placeholderEl.style.marginBottom = '10px';
+            this.placeholderEl.style.boxSizing = 'border-box';
+            fixedRow.parentNode.insertBefore(this.placeholderEl, fixedRow.nextSibling);
+          }
+        }
+      } else {
+        // 褰撴粴鍔ㄤ綅缃洖鍒板厓绱犲師濮嬩綅缃互涓婃椂锛岀Щ闄ゆ偓娴姸鎬侊紝鎭㈠鍒版枃妗f祦涓�
+        if (fixedRow.classList.contains('floating')) {
+          // 绉婚櫎floating绫�
+          fixedRow.classList.remove('floating');
+          // 閲嶇疆鏍峰紡锛岃娴忚鍣ㄤ娇鐢ㄥ師濮嬫牱寮�
+          fixedRow.style.left = '';
+          fixedRow.style.width = '';
+          // 绉婚櫎鍗犱綅绗︼紝璁╁厓绱犲洖鍒板師濮嬩綅缃�
+          if (this.placeholderEl && this.placeholderEl.parentNode) {
+            this.placeholderEl.parentNode.removeChild(this.placeholderEl);
+            this.placeholderEl = null;
+          }
+        }
+      }
+    },
+
+}
   }
-  </script>
+</script>
 <style scoped>
+.title-search-wrapper {
+        position: relative;
+        width: 100%;
+      }
+
+      .title-suggestions {
+        position: absolute;
+        top: 100%;
+        left: 0;
+        right: 0;
+        z-index: 1000;
+        background-color: #fff;
+        border: 1px solid #dcdfe6;
+        border-radius: 4px;
+        box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
+        max-height: 200px;
+        overflow-y: auto;
+        margin-top: 4px;
+      }
+
+      .suggestion-item {
+        padding: 10px 15px;
+        cursor: pointer;
+        transition: background-color 0.2s;
+      }
+
+      .suggestion-item:hover {
+        background-color: #f5f7fa;
+      }
+
 .title-border {
   border-bottom: 1px solid #dcdfe6;
   padding-bottom: 10px;
   margin-bottom: 20px;
 }
+.fixed-row {
+  position: static;
+  z-index: 1000;
+  background-color: #fff;
+  padding: 10px;
+  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
+  margin-bottom: 10px;
+  box-sizing: border-box;
+}
+.fixed-row.floating {
+  position: fixed;
+  top: 0;
+  z-index: 2000;
+  padding: 10px;
+  margin-bottom: 0;
+  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
+  background-color: #fff;
+}
 </style>
+
+
+
+

--
Gitblit v1.9.1