1
1
<template >
2
2
<Card >
3
3
<div class =" search-con search-con-top" >
4
- <Select v-model =" searchKey" class =" search-col" >
5
- <Option v-for =" item in columns" v-if =" item.key !== 'handle' && item.key !== 'status' && item.key !== ''" :value =" item.key" :key =" `search-col-${item.key}`" >{{ item.title }}</Option >
6
- </Select >
7
- <Input @on-change =" handleClear" clearable placeholder =" 输入关键字搜索" class =" search-input" v-model =" searchValue" />
4
+ <Input clearable placeholder =" 输入任务ID搜索" class =" search-input" v-model =" searchValue" />
8
5
<Button @click =" handleSearch" class =" search-btn" type =" primary" >搜索</Button >
9
6
<slot name =" new_btn" ><Button type =" primary" @click =" editModal('', 'post', '新建任务')" class =" search-btn" >新建</Button ></slot >
10
7
</div >
@@ -137,13 +134,12 @@ export default {
137
134
formList: [],
138
135
editModalData: ' ' ,
139
136
//
140
- searchKey: ' ' ,
141
137
searchValue: ' '
142
138
}
143
139
},
144
140
methods: {
145
- getCronJobsList (page , limit , key , value ) {
146
- getCronJobslist (page, limit, key , value).then (res => {
141
+ getCronJobsList (value ) {
142
+ getCronJobslist (this . pageNum , this . pageSize , value).then (res => {
147
143
if (res .data .code === 0 ) {
148
144
this .pageTotal = res .data .count
149
145
this .tableData = res .data .data
@@ -192,12 +188,7 @@ export default {
192
188
operationCron (value .data , this .editModalData ).then (res => {
193
189
if (res .data .code === 0 ) {
194
190
this .$Message .success (` ${ res .data .msg } ` )
195
- this .getCronJobsList (
196
- this .pageNum ,
197
- this .pageSize ,
198
- this .searchKey ,
199
- this .searchValue
200
- )
191
+ this .getCronJobsList (this .searchValue )
201
192
this .modalMap .modalVisible = false
202
193
} else {
203
194
this .$Message .error (` ${ res .data .msg } ` )
@@ -208,12 +199,7 @@ export default {
208
199
// 删除
209
200
delData (params ) {
210
201
if (confirm (` 确定要删除 ${ params .row .job_id } ` )) {
211
- operationCron (
212
- {
213
- job_id: params .row .job_id
214
- },
215
- ' delete'
216
- ).then (res => {
202
+ operationCron ( { job_id: params .row .job_id }, ' delete' ).then (res => {
217
203
if (res .data .code === 0 ) {
218
204
this .$Message .success (` ${ res .data .msg } ` )
219
205
this .tableData .splice (params .index , 1 )
@@ -241,31 +227,22 @@ export default {
241
227
changePage (value ) {
242
228
this .pageNum = value
243
229
this .getCronJobsList (
244
- this .pageNum ,
245
- this .pageSize ,
246
- this .searchKey ,
247
230
this .searchValue
248
231
)
249
232
},
250
233
// 每页条数
251
234
handlePageSize (value ) {
252
235
this .pageSize = value
253
- this .getCronJobsList (1 , this .pageSize , this .searchKey , this .searchValue )
254
- },
255
- handleClear (e ) {
256
- if (e .target .value === ' ' ) this .tableData = this .value
236
+ this .getCronJobsList ( this .searchValue )
257
237
},
258
238
handleSearch () {
259
239
this .getCronJobsList (
260
- this .pageNum ,
261
- this .pageSize ,
262
- this .searchKey ,
263
240
this .searchValue
264
241
)
265
242
}
266
243
},
267
244
mounted () {
268
- this .getCronJobsList (this . pageNum , this . pageSize )
245
+ this .getCronJobsList ()
269
246
}
270
247
}
271
248
</script >
@@ -280,7 +257,7 @@ export default {
280
257
}
281
258
&-input {
282
259
display : inline-block ;
283
- width : 200 px ;
260
+ width : 250 px ;
284
261
margin-left : 2px ;
285
262
}
286
263
&-btn {
0 commit comments