瀏覽代碼

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

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 1
 <template>
2 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 10
     <el-table :data="tableData">
4 11
       <el-table-column v-for="(item, index) in columns" :key="index" :label="item.label" :prop="item.key">
5 12
       </el-table-column>
@@ -43,7 +50,8 @@ export default {
43 50
         tableData: [],
44 51
         total: 0,
45 52
         pageSize: 10,
46
-        pageNum: 1
53
+        pageNum: 1,
54
+        searchWords: undefined
47 55
       }
48 56
     },
49 57
     mounted() {
@@ -81,8 +89,8 @@ export default {
81 89
         })
82 90
       },
83 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 94
           this.tableData = []
87 95
           res.data.records.map((item, index) => {
88 96
             const newItem = {...item}
@@ -102,6 +110,10 @@ export default {
102 110
           3: '审批驳回'
103 111
         }
104 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 129
   .table-pagination{
118 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 140
 </style>

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

@@ -1,5 +1,12 @@
1 1
 <template>
2 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 10
     <el-table :data="tableData">
4 11
       <el-table-column v-for="(item, index) in columns" :key="index" :label="item.label" :prop="item.key">
5 12
       </el-table-column>
@@ -41,7 +48,8 @@ export default {
41 48
         pageSize: 10,
42 49
         pageNum: 1,
43 50
         dialogVisible: false,
44
-        fileList: []
51
+        fileList: [],
52
+        searchWords: undefined
45 53
       }
46 54
     },
47 55
     mounted() {
@@ -58,8 +66,8 @@ export default {
58 66
         window.location.href = `${this.getUrl()}/xyjc/index-files/download/${row.id}`
59 67
       },
60 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 71
             if (res.success) {
64 72
                 this.tableData = res.data.records
65 73
                 this.total = res.data.total
@@ -68,6 +76,10 @@ export default {
68 76
       },
69 77
       getUrl() {
70 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 95
   .table-pagination{
84 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 106
 </style>

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

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

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

@@ -1,5 +1,12 @@
1 1
 <template>
2 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 10
     <el-table :data="tableData">
4 11
       <el-table-column v-for="(item, index) in columns" :key="index" :label="item.label" :prop="item.key">
5 12
       </el-table-column>
@@ -62,7 +69,8 @@ export default {
62 69
         pageNum: 1,
63 70
         radio: '2',
64 71
         dialogVisible: false,
65
-        selRow: {}
72
+        selRow: {},
73
+        searchWords: undefined
66 74
       }
67 75
     },
68 76
     mounted() {
@@ -96,8 +104,8 @@ export default {
96 104
         })
97 105
       },
98 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 109
           this.tableData = []
102 110
           res.data.records.map((item, index) => {
103 111
             const newItem = {...item}
@@ -117,6 +125,10 @@ export default {
117 125
           3: '审批驳回'
118 126
         }
119 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 144
   .table-pagination{
133 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 155
 .audit-dialog{
137 156
     .mg-bt{

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

@@ -1,5 +1,12 @@
1 1
 <template>
2 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 10
     <div class="button-block">
4 11
       <el-button type="primary" @click="handleUpload">上传</el-button>
5 12
     </div>
@@ -61,7 +68,8 @@ export default {
61 68
         pageSize: 10,
62 69
         pageNum: 1,
63 70
         dialogVisible: false,
64
-        fileList: []
71
+        fileList: [],
72
+        searchWords: undefined
65 73
       }
66 74
     },
67 75
     mounted() {
@@ -102,8 +110,8 @@ export default {
102 110
         return process.env.NODE_ENV !== 'development' ? config.build.BASE_API : config.dev.BASE_API;
103 111
       },
104 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 115
             if (res.success) {
108 116
                 this.tableData = res.data.records
109 117
                 this.total = res.data.total
@@ -114,6 +122,10 @@ export default {
114 122
         this.dialogVisible = false
115 123
         this.getTableData()
116 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 141
   .table-pagination{
130 142
     text-align: right;
131 143
   }
144
+  .search-card{
145
+    text-align: center;
146
+    .input-wrapper{
147
+        width: 36%;
148
+    }
149
+  }
132 150
 }
133 151
 </style>