瀏覽代碼

前、后台文件、申请、审核页面加搜索

chaihaorui 1 年之前
父節點
當前提交
8a675eaf7a
共有 5 個文件被更改,包括 89 次插入14 次删除
  1. 22 3
      src/pages/homepage/apply.vue
  2. 22 3
      src/pages/homepage/file.vue
  3. 2 2
      src/pages/homepage/layouts/topBar.vue
  4. 22 3
      src/pages/index/audit.vue
  5. 21 3
      src/pages/index/file.vue

+ 22 - 3
src/pages/homepage/apply.vue

@@ -1,5 +1,12 @@
1
 <template>
1
 <template>
2
   <div class="body-wrapper">
2
   <div class="body-wrapper">
3
+    <div class="search-card">
4
+        <el-input class="input-wrapper" v-model="searchWords" placeholder="请输入关键字">
5
+            <el-button slot="append" class="searchbtn" @click="handleSearch">
6
+            <img src="../../../static/homepage/u432.svg" alt="">
7
+            </el-button>
8
+        </el-input>
9
+    </div>
3
     <el-table :data="tableData">
10
     <el-table :data="tableData">
4
       <el-table-column v-for="(item, index) in columns" :key="index" :label="item.label" :prop="item.key">
11
       <el-table-column v-for="(item, index) in columns" :key="index" :label="item.label" :prop="item.key">
5
       </el-table-column>
12
       </el-table-column>
@@ -43,7 +50,8 @@ export default {
43
         tableData: [],
50
         tableData: [],
44
         total: 0,
51
         total: 0,
45
         pageSize: 10,
52
         pageSize: 10,
46
-        pageNum: 1
53
+        pageNum: 1,
54
+        searchWords: undefined
47
       }
55
       }
48
     },
56
     },
49
     mounted() {
57
     mounted() {
@@ -81,8 +89,8 @@ export default {
81
         })
89
         })
82
       },
90
       },
83
       getTableData() {
91
       getTableData() {
84
-        const {pageNum, pageSize} = this
85
-        api.applyList({pageNum, pageSize}).then(res => {
92
+        const {pageNum, pageSize, searchWords} = this
93
+        api.applyList({pageNum, pageSize, resourceName: searchWords}).then(res => {
86
           this.tableData = []
94
           this.tableData = []
87
           res.data.records.map((item, index) => {
95
           res.data.records.map((item, index) => {
88
             const newItem = {...item}
96
             const newItem = {...item}
@@ -102,6 +110,10 @@ export default {
102
           3: '审批驳回'
110
           3: '审批驳回'
103
         }
111
         }
104
         return textMap[val]
112
         return textMap[val]
113
+      },
114
+      handleSearch() {
115
+        this.pageNum = 1
116
+        this.getTableData()
105
       }
117
       }
106
     }
118
     }
107
 }
119
 }
@@ -117,5 +129,12 @@ export default {
117
   .table-pagination{
129
   .table-pagination{
118
     text-align: right;
130
     text-align: right;
119
   }
131
   }
132
+  .search-card{
133
+    margin-bottom: 20px;
134
+    text-align: center;
135
+    .input-wrapper{
136
+        width: 36%;
137
+    }
138
+  }
120
 }
139
 }
121
 </style>
140
 </style>

+ 22 - 3
src/pages/homepage/file.vue

@@ -1,5 +1,12 @@
1
 <template>
1
 <template>
2
   <div class="body-wrapper">
2
   <div class="body-wrapper">
3
+    <div class="search-card">
4
+        <el-input class="input-wrapper" v-model="searchWords" placeholder="请输入关键字">
5
+            <el-button slot="append" class="searchbtn" @click="handleSearch">
6
+            <img src="../../../static/homepage/u432.svg" alt="">
7
+            </el-button>
8
+        </el-input>
9
+    </div>
3
     <el-table :data="tableData">
10
     <el-table :data="tableData">
4
       <el-table-column v-for="(item, index) in columns" :key="index" :label="item.label" :prop="item.key">
11
       <el-table-column v-for="(item, index) in columns" :key="index" :label="item.label" :prop="item.key">
5
       </el-table-column>
12
       </el-table-column>
@@ -41,7 +48,8 @@ export default {
41
         pageSize: 10,
48
         pageSize: 10,
42
         pageNum: 1,
49
         pageNum: 1,
43
         dialogVisible: false,
50
         dialogVisible: false,
44
-        fileList: []
51
+        fileList: [],
52
+        searchWords: undefined
45
       }
53
       }
46
     },
54
     },
47
     mounted() {
55
     mounted() {
@@ -58,8 +66,8 @@ export default {
58
         window.location.href = `${this.getUrl()}/xyjc/index-files/download/${row.id}`
66
         window.location.href = `${this.getUrl()}/xyjc/index-files/download/${row.id}`
59
       },
67
       },
60
       getTableData() {
68
       getTableData() {
61
-        const { pageNum, pageSize } = this
62
-        api.fileList({pageNum, pageSize}).then(res => {
69
+        const { pageNum, pageSize, searchWords } = this
70
+        api.fileList({pageNum, pageSize, fileName: searchWords}).then(res => {
63
             if (res.success) {
71
             if (res.success) {
64
                 this.tableData = res.data.records
72
                 this.tableData = res.data.records
65
                 this.total = res.data.total
73
                 this.total = res.data.total
@@ -68,6 +76,10 @@ export default {
68
       },
76
       },
69
       getUrl() {
77
       getUrl() {
70
         return process.env.NODE_ENV !== 'development' ? config.build.BASE_API : config.dev.BASE_API;
78
         return process.env.NODE_ENV !== 'development' ? config.build.BASE_API : config.dev.BASE_API;
79
+      },
80
+      handleSearch() {
81
+        this.pageNum = 1
82
+        this.getTableData()
71
       }
83
       }
72
     }
84
     }
73
 }
85
 }
@@ -83,5 +95,12 @@ export default {
83
   .table-pagination{
95
   .table-pagination{
84
     text-align: right;
96
     text-align: right;
85
   }
97
   }
98
+  .search-card{
99
+    margin-bottom: 20px;
100
+    text-align: center;
101
+    .input-wrapper{
102
+        width: 36%;
103
+    }
104
+  }
86
 }
105
 }
87
 </style>
106
 </style>

+ 2 - 2
src/pages/homepage/layouts/topBar.vue

@@ -5,14 +5,14 @@
5
       <span class="time-gap">{{ date }}</span>
5
       <span class="time-gap">{{ date }}</span>
6
     </p>
6
     </p>
7
     <div v-if="userName" class="head-bar-icon">
7
     <div v-if="userName" class="head-bar-icon">
8
-      <el-select v-model="userName" placeholder="请选择">
8
+      <!-- <el-select v-model="userName" placeholder="请选择">
9
         <el-option
9
         <el-option
10
           v-for="item in options"
10
           v-for="item in options"
11
           :key="item.value"
11
           :key="item.value"
12
           :label="item.label"
12
           :label="item.label"
13
           :value="item.value">
13
           :value="item.value">
14
         </el-option>
14
         </el-option>
15
-      </el-select>
15
+      </el-select> -->
16
       <!-- <span class="workbench" v-if="workBenchShow" @click="workBenchClick"
16
       <!-- <span class="workbench" v-if="workBenchShow" @click="workBenchClick"
17
         >工作台</span
17
         >工作台</span
18
       >
18
       >

+ 22 - 3
src/pages/index/audit.vue

@@ -1,5 +1,12 @@
1
 <template>
1
 <template>
2
   <div class="body-wrapper">
2
   <div class="body-wrapper">
3
+    <div class="search-card">
4
+        <el-input class="input-wrapper" v-model="searchWords" placeholder="请输入关键字">
5
+            <el-button slot="append" class="searchbtn" @click="handleSearch">
6
+            <img src="../../../static/homepage/u432.svg" alt="">
7
+            </el-button>
8
+        </el-input>
9
+    </div>
3
     <el-table :data="tableData">
10
     <el-table :data="tableData">
4
       <el-table-column v-for="(item, index) in columns" :key="index" :label="item.label" :prop="item.key">
11
       <el-table-column v-for="(item, index) in columns" :key="index" :label="item.label" :prop="item.key">
5
       </el-table-column>
12
       </el-table-column>
@@ -62,7 +69,8 @@ export default {
62
         pageNum: 1,
69
         pageNum: 1,
63
         radio: '2',
70
         radio: '2',
64
         dialogVisible: false,
71
         dialogVisible: false,
65
-        selRow: {}
72
+        selRow: {},
73
+        searchWords: undefined
66
       }
74
       }
67
     },
75
     },
68
     mounted() {
76
     mounted() {
@@ -96,8 +104,8 @@ export default {
96
         })
104
         })
97
       },
105
       },
98
       getTableData() {
106
       getTableData() {
99
-        const {pageNum, pageSize} = this
100
-        api.applyList({pageNum, pageSize}).then(res => {
107
+        const {pageNum, pageSize, searchWords} = this
108
+        api.applyList({pageNum, pageSize, resourceName: searchWords}).then(res => {
101
           this.tableData = []
109
           this.tableData = []
102
           res.data.records.map((item, index) => {
110
           res.data.records.map((item, index) => {
103
             const newItem = {...item}
111
             const newItem = {...item}
@@ -117,6 +125,10 @@ export default {
117
           3: '审批驳回'
125
           3: '审批驳回'
118
         }
126
         }
119
         return textMap[val]
127
         return textMap[val]
128
+      },
129
+      handleSearch() {
130
+        this.pageNum = 1
131
+        this.getTableData()
120
       }
132
       }
121
     }
133
     }
122
 }
134
 }
@@ -132,6 +144,13 @@ export default {
132
   .table-pagination{
144
   .table-pagination{
133
     text-align: right;
145
     text-align: right;
134
   }
146
   }
147
+  .search-card{
148
+    margin-bottom: 20px;
149
+    text-align: center;
150
+    .input-wrapper{
151
+        width: 36%;
152
+    }
153
+  }
135
 }
154
 }
136
 .audit-dialog{
155
 .audit-dialog{
137
     .mg-bt{
156
     .mg-bt{

+ 21 - 3
src/pages/index/file.vue

@@ -1,5 +1,12 @@
1
 <template>
1
 <template>
2
   <div class="body-wrapper">
2
   <div class="body-wrapper">
3
+    <div class="search-card">
4
+        <el-input class="input-wrapper" v-model="searchWords" placeholder="请输入关键字">
5
+            <el-button slot="append" class="searchbtn" @click="handleSearch">
6
+            <img src="../../../static/homepage/u432.svg" alt="">
7
+            </el-button>
8
+        </el-input>
9
+    </div>
3
     <div class="button-block">
10
     <div class="button-block">
4
       <el-button type="primary" @click="handleUpload">上传</el-button>
11
       <el-button type="primary" @click="handleUpload">上传</el-button>
5
     </div>
12
     </div>
@@ -61,7 +68,8 @@ export default {
61
         pageSize: 10,
68
         pageSize: 10,
62
         pageNum: 1,
69
         pageNum: 1,
63
         dialogVisible: false,
70
         dialogVisible: false,
64
-        fileList: []
71
+        fileList: [],
72
+        searchWords: undefined
65
       }
73
       }
66
     },
74
     },
67
     mounted() {
75
     mounted() {
@@ -102,8 +110,8 @@ export default {
102
         return process.env.NODE_ENV !== 'development' ? config.build.BASE_API : config.dev.BASE_API;
110
         return process.env.NODE_ENV !== 'development' ? config.build.BASE_API : config.dev.BASE_API;
103
       },
111
       },
104
       getTableData() {
112
       getTableData() {
105
-        const { pageNum, pageSize } = this
106
-        api.fileList({pageNum, pageSize}).then(res => {
113
+        const { pageNum, pageSize, searchWords } = this
114
+        api.fileList({pageNum, pageSize, fileName: searchWords}).then(res => {
107
             if (res.success) {
115
             if (res.success) {
108
                 this.tableData = res.data.records
116
                 this.tableData = res.data.records
109
                 this.total = res.data.total
117
                 this.total = res.data.total
@@ -114,6 +122,10 @@ export default {
114
         this.dialogVisible = false
122
         this.dialogVisible = false
115
         this.getTableData()
123
         this.getTableData()
116
         this.fileList = []
124
         this.fileList = []
125
+      },
126
+      handleSearch() {
127
+        this.pageNum = 1
128
+        this.getTableData()
117
       }
129
       }
118
     }
130
     }
119
 }
131
 }
@@ -129,5 +141,11 @@ export default {
129
   .table-pagination{
141
   .table-pagination{
130
     text-align: right;
142
     text-align: right;
131
   }
143
   }
144
+  .search-card{
145
+    text-align: center;
146
+    .input-wrapper{
147
+        width: 36%;
148
+    }
149
+  }
132
 }
150
 }
133
 </style>
151
 </style>