From 548096cf02369eee2ffd7c070669117435d7298a Mon Sep 17 00:00:00 2001 From: marvzhang Date: Fri, 21 Feb 2020 22:32:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=8A=A0=E8=BD=BD=E6=95=88?= =?UTF-8?q?=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/Scrapy/SpiderScrapy.vue | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/frontend/src/components/Scrapy/SpiderScrapy.vue b/frontend/src/components/Scrapy/SpiderScrapy.vue index 43c4700c..784b2c44 100644 --- a/frontend/src/components/Scrapy/SpiderScrapy.vue +++ b/frontend/src/components/Scrapy/SpiderScrapy.vue @@ -252,6 +252,7 @@ > {{s}} + @@ -405,7 +406,8 @@ export default { template: 'basic' }, isAddSpiderLoading: false, - activeTabName: 'settings' + activeTabName: 'settings', + loadingDict: {} } }, methods: { @@ -637,11 +639,17 @@ export default { this.$st.sendEv('爬虫详情', 'Scrapy 设置', '保存Items') }, async onClickSpider (spiderName) { - const res = await this.$store.dispatch('spider/getSpiderScrapySpiderFilepath', { - id: this.$route.params.id, - spiderName - }) - this.$emit('click-spider', res.data.data) + if (this.loadingDict[spiderName]) return + this.$set(this.loadingDict, spiderName, true) + try { + const res = await this.$store.dispatch('spider/getSpiderScrapySpiderFilepath', { + id: this.$route.params.id, + spiderName + }) + this.$emit('click-spider', res.data.data) + } finally { + this.$set(this.loadingDict, spiderName, false) + } this.$st.sendEv('爬虫详情', 'Scrapy 设置', '点击爬虫') } }