From 5746f73d9eeb78db465cc9da55373e4d5c424d99 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期三, 16 四月 2025 15:22:32 +0800
Subject: [PATCH] 管理体系文件控制-查询回车搜索

---
 src/views/CNAS/systemManagement/documentControl/components/FileList.vue |  131 ++++++++++++++-----------------------------
 1 files changed, 44 insertions(+), 87 deletions(-)

diff --git a/src/views/CNAS/systemManagement/documentControl/components/FileList.vue b/src/views/CNAS/systemManagement/documentControl/components/FileList.vue
index 4696f3e..2a79b9a 100644
--- a/src/views/CNAS/systemManagement/documentControl/components/FileList.vue
+++ b/src/views/CNAS/systemManagement/documentControl/components/FileList.vue
@@ -1,29 +1,29 @@
 <template>
   <!-- 鏂囦欢娓呭崟 -->
-  <div class="file-list" style="height: 100%;">
+  <div>
     <div class="search">
-      <div class="search_thing">
-        <div class="search_label">鏂囦欢鍚嶇О锛�</div>
-        <div class="search_input"><el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="queryParams.name"
-            @keyup.enter.native="refreshTable()"></el-input></div>
+      <div>
+        <el-form :model="queryParams" ref="queryForm" size="small" :inline="true">
+          <el-form-item label="鏂囦欢鍚嶇О" prop="name">
+            <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="queryParams.name"
+                      @keyup.enter.native="refreshTable()"></el-input>
+          </el-form-item>
+          <el-form-item label="鏂囦欢鐘舵��" prop="state">
+            <el-select v-model="queryParams.state" size="small" @change="refreshTable()" clearable>
+              <el-option :label="item.label" :value="item.value" v-for="(item, index) in fileState"
+                         :key="index"></el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item>
+            <el-button type="primary" size="mini" @click="refreshTable">鏌ヨ</el-button>
+            <el-button size="mini" @click="refresh">閲嶇疆</el-button>
+          </el-form-item>
+        </el-form>
       </div>
-      <div class="search_thing">
-        <div class="search_label">鏂囦欢鐘舵�侊細</div>
-        <div class="search_input">
-          <el-select v-model="queryParams.state" size="small" @change="refreshTable()">
-            <el-option :label="item.label" :value="item.value" v-for="(item, index) in fileState"
-              :key="index"></el-option>
-          </el-select>
-        </div>
-      </div>
-      <div class="search_thing" style="padding-left: 30px;">
-        <el-button size="small" @click="refresh()">閲� 缃�</el-button>
-        <el-button size="small" type="primary" @click="refreshTable()">鏌� 璇�</el-button>
-      </div>
-      <div class="btns" style="padding-left: 30px;">
+      <div>
         <el-upload :action="action" :multiple="false" accept='.xls,.xlsx' :headers="uploadHeader"
-          :on-change="beforeUpload" :on-error="onError" ref='upload' :on-success="handleSuccessUp"
-          :show-file-list="false">
+                   :on-change="beforeUpload" :on-error="onError" ref='upload' :on-success="handleSuccessUp"
+                   :show-file-list="false">
           <el-button size="small" type="primary" :loading="upLoading">瀵煎叆</el-button></el-upload>
       </div>
     </div>
@@ -121,10 +121,18 @@
         {
           label: "绫诲埆", prop: "type", width: "120px", dataType: "tag",
           formatData: (params) => {
-            return this.fileType.find((m) => m.value == params).label;
+            if (this.fileType.find((m) => m.value == params)) {
+              return this.fileType.find((m) => m.value == params).label;
+            } else {
+              return null
+            }
           },
           formatType: (params) => {
-            return this.fileType.find((m) => m.value == params).type;
+            if (this.fileType.find((m) => m.value == params)) {
+              return this.fileType.find((m) => m.value == params).type;
+            } else {
+              return null
+            }
           },
         },
         {
@@ -137,10 +145,18 @@
         {
           label: "鏂囦欢鐘舵��", prop: "state", dataType: "tag",
           formatData: (params) => {
-            return this.fileState.find((m) => m.value == params).label;
+            if (this.fileState.find((m) => m.value == params)) {
+              return this.fileState.find((m) => m.value == params).label;
+            } else {
+              return null
+            }
           },
           formatType: (params) => {
-            return this.fileState.find((m) => m.value == params).type;
+            if (this.fileState.find((m) => m.value == params)) {
+              return this.fileState.find((m) => m.value == params).type;
+            } else {
+              return null
+            }
           },
         },
         {
@@ -252,37 +268,13 @@
     // 涓嬭浇鏂囦欢
     handleDown(row) {
       if (!row.url) return this.$message.warning('鏂囦欢鏈笂浼�')
-      this.$download.downloadFileFromUrl(row.url, row.url);
+      this.$download.saveAs(row.url, row.url);
     },
     // 鏌ョ湅鏂囦欢
     handleLook(row) {
       if (!row.url) return this.$message.warning('鏂囦欢鏈笂浼�')
       this.currentInfo = row
       this.lookDialogVisible = true
-    },
-    getPower() {
-      let power = JSON.parse(sessionStorage.getItem('power'))
-      let up = false
-      let upFile = false
-      let add = false
-      for (var i = 0; i < power.length; i++) {
-        if (power[i].menuMethod == 'doManageDocumentList') {
-          up = true
-        }
-        if (power[i].menuMethod == 'exportManageDocumentList') {
-          add = true
-        }
-        if (power[i].menuMethod == 'uploadFileManageDocumentList') {
-          upFile = true
-        }
-      }
-      if (!upFile) {
-        this.componentData.do.splice(1, 1)
-      }
-      if (!up) {
-        this.componentData.do.splice(0, 1)
-      }
-      this.addPower = add
     },
     // 涓婁紶鏂囦欢
     handleUp(row) {
@@ -393,44 +385,9 @@
 </script>
 
 <style scoped>
-.title {
-  height: 60px;
-  line-height: 60px;
-}
-
 .search {
-  background-color: #fff;
-  height: 40px;
+  height: 46px;
   display: flex;
-  align-items: center;
-  position: relative;
-}
-
-.search_thing {
-  width: 350px;
-  display: flex;
-  align-items: center;
-}
-
-.search_label {
-  width: 110px;
-  font-size: 14px;
-  text-align: right;
-}
-
-.search_input {
-  width: calc(100% - 110px);
-}
-
-.table {
-  background-color: #fff;
-  height: calc(100% - 60px - 80px);
-  padding: 20px;
-}
-
-.btns {
-  position: absolute;
-  right: 20px;
-  top: 5px;
+  justify-content: space-between;
 }
 </style>

--
Gitblit v1.9.3