Skip to content

Commit bc5ea54

Browse files
committed
fix(view): 增加刷新功能
1 parent 09007fe commit bc5ea54

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

admin/src/views/api_excel/index.vue

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<el-button type="primary" size="medium">
55
<router-link to="/api_excel/add">上传测试</router-link>
66
</el-button>
7+
<el-button :loading="reload" type="primary" class="reload" plain @click="fetchData">{{ reload_name }}</el-button>
78
</el-row>
89
<el-table
910
v-loading="listLoading"
@@ -141,6 +142,8 @@ export default {
141142
},
142143
data() {
143144
return {
145+
reload: false,
146+
reload_name: '点击刷新',
144147
list: null,
145148
listLoading: true,
146149
perpage: 10,
@@ -260,15 +263,19 @@ export default {
260263
})
261264
},
262265
fetchData() {
263-
this.listLoading = true
266+
this.listLoading = this.reload = true
267+
this.reload_name = '加载中'
264268
const params = Object.assign({ 'page': this.listQuery.page }, { 'perPage': this.perpage })
265269
getList(params).then(response => {
266270
this.list = response.data.data
267271
this.listLoading = false
268272
this.total = response.data.total
269273
this.url = response.data.appUrl
270-
console.log('type', Object.prototype.toString.call(this.list))
271-
274+
// console.log('type', Object.prototype.toString.call(this.list))
275+
setTimeout(() => {
276+
this.reload = false
277+
this.reload_name = '刷新'
278+
}, 800)
272279
this.initWebSocket(8)
273280
})
274281
},
@@ -354,4 +361,8 @@ export default {
354361
.pagination {
355362
margin: 20px auto;
356363
}
364+
.reload {
365+
margin-right: 300px;
366+
float: right;
367+
}
357368
</style>

0 commit comments

Comments
 (0)