From 02ed470278d6f905d996e3d83c67714a49600206 Mon Sep 17 00:00:00 2001 From: marvzhang Date: Thu, 30 Jan 2020 11:13:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=88=A0=E9=99=A4=E5=90=8E?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E6=89=80=E6=9C=89=E7=88=AC=E8=99=AB=E7=9A=84?= =?UTF-8?q?bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/store/modules/spider.js | 6 ------ frontend/src/views/spider/SpiderList.vue | 22 +++++++++++----------- 2 files changed, 11 insertions(+), 17 deletions(-) diff --git a/frontend/src/store/modules/spider.js b/frontend/src/store/modules/spider.js index ac1fc81b..b6dcf223 100644 --- a/frontend/src/store/modules/spider.js +++ b/frontend/src/store/modules/spider.js @@ -105,15 +105,9 @@ const actions = { }, editSpider ({ state, dispatch }) { return request.post(`/spiders/${state.spiderForm._id}`, state.spiderForm) - .then(() => { - dispatch('getSpiderList') - }) }, deleteSpider ({ state, dispatch }, id) { return request.delete(`/spiders/${id}`) - .then(() => { - dispatch('getSpiderList') - }) }, getSpiderData ({ state, commit }, id) { return request.get(`/spiders/${id}`) diff --git a/frontend/src/views/spider/SpiderList.vue b/frontend/src/views/spider/SpiderList.vue index d01b657f..b068448a 100644 --- a/frontend/src/views/spider/SpiderList.vue +++ b/frontend/src/views/spider/SpiderList.vue @@ -105,7 +105,8 @@ - + { - this.$store.dispatch('spider/deleteSpider', row._id) - .then(() => { - this.$message({ - type: 'success', - message: 'Deleted successfully' - }) - }) + }).then(async () => { + await this.$store.dispatch('spider/deleteSpider', row._id) + this.$message({ + type: 'success', + message: 'Deleted successfully' + }) + await this.getList() this.$st.sendEv('爬虫列表', '删除爬虫') }) }, @@ -721,7 +721,7 @@ export default { this.filter.type = tab.name this.getList() }, - getList () { + async getList () { let params = { page_num: this.pagination.pageNum, page_size: this.pagination.pageSize, @@ -730,7 +730,7 @@ export default { keyword: this.filter.keyword, type: this.filter.type } - this.$store.dispatch('spider/getSpiderList', params) + await this.$store.dispatch('spider/getSpiderList', params) } }, async created () {