From 34eef73283bbec1ae3be4625728e5650a74d619a Mon Sep 17 00:00:00 2001 From: marvzhang Date: Fri, 13 Dec 2019 13:53:27 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=99=BE=E5=BA=A6=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1=E4=BA=8B=E4=BB=B6=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/App.vue | 4 +- .../components/Common/CrawlConfirmDialog.vue | 2 +- frontend/src/components/Config/ConfigList.vue | 18 +++++++-- .../Environment/EnvironmentList.vue | 6 +-- .../components/InfoView/SpiderInfoView.vue | 4 +- .../src/components/Overview/TaskOverview.vue | 4 +- .../components/TableView/FieldsTableView.vue | 31 +++----------- .../TableView/SettingFieldsTableView.vue | 40 +------------------ .../src/views/layout/components/Navbar.vue | 2 +- frontend/src/views/node/NodeList.vue | 6 +-- frontend/src/views/schedule/ScheduleList.vue | 8 ++-- frontend/src/views/spider/SpiderList.vue | 18 ++++----- frontend/src/views/task/TaskDetail.vue | 2 +- frontend/src/views/task/TaskList.vue | 10 ++--- frontend/src/views/user/UserList.vue | 4 +- 15 files changed, 54 insertions(+), 105 deletions(-) diff --git a/frontend/src/App.vue b/frontend/src/App.vue index 06a41cce..2a91e61a 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -30,10 +30,10 @@ export default { document.querySelector('.el-message__closeBtn').click() if (value === 1) { this.$st.sendPv('/allow_stats') - this.$st.sendEv('全局', '允许/禁止统计', 'value', 'allow') + this.$st.sendEv('全局', '允许/禁止统计', '允许') } else { this.$st.sendPv('/disallow_stats') - this.$st.sendEv('全局', '允许/禁止统计', 'value', 'disallow') + this.$st.sendEv('全局', '允许/禁止统计', '禁止') } } diff --git a/frontend/src/components/Common/CrawlConfirmDialog.vue b/frontend/src/components/Common/CrawlConfirmDialog.vue index f2ad70c2..42fc2b6f 100644 --- a/frontend/src/components/Common/CrawlConfirmDialog.vue +++ b/frontend/src/components/Common/CrawlConfirmDialog.vue @@ -80,7 +80,7 @@ export default { this.$message.success(this.$t('A task has been scheduled successfully')) }) this.$emit('close') - this.$st.sendEv('爬虫', '运行') + this.$st.sendEv('爬虫确认', '确认运行', this.form.runType) }) } }, diff --git a/frontend/src/components/Config/ConfigList.vue b/frontend/src/components/Config/ConfigList.vue index b1c93afc..9b274b3b 100644 --- a/frontend/src/components/Config/ConfigList.vue +++ b/frontend/src/components/Config/ConfigList.vue @@ -68,6 +68,7 @@ v-model="spiderForm.config.start_stage" :placeholder="$t('Start Stage')" :class="startStageClass" + @change="$st.sendEv('爬虫详情', '配置', '改变起始阶段')" > { this.previewLoading = false }) - this.$st.sendEv('爬虫详情-配置', '预览') + this.$st.sendEv('爬虫详情', '配置', '预览') }) } }) }, async onCrawl () { - this.$st.sendEv('爬虫详情-配置', '点击运行') + this.$st.sendEv('爬虫详情', '配置', '点击运行') const res = await this.onSave() if (res) { this.crawlConfirmDialogVisible = true @@ -580,7 +581,7 @@ export default { .finally(() => { this.extractFieldsLoading = false }) - this.$st.sendEv('爬虫详情-配置', '提取字段') + this.$st.sendEv('爬虫详情', '配置', '提取字段') }) } }) @@ -595,6 +596,7 @@ export default { return value }, onClickSelectorType (selectorType) { + this.$st.sendEv('爬虫详情', '配置', `点击阶段选择器类别-${selectorType}`) this.spiderForm.config.stages.forEach(stage => { // 列表 if (selectorType === 'css') { @@ -630,12 +632,14 @@ export default { ev.stopPropagation() }, onEditStage (stage) { + this.$st.sendEv('爬虫详情', '配置', '更改阶段名称') this.$set(stage, 'isEdit', !stage.isEdit) setTimeout(() => { this.$refs[`stage-name-${stage.name}`][0].focus() }, 0) }, onCopyStage (stage) { + this.$st.sendEv('爬虫详情', '配置', '复制阶段') const stages = this.spiderForm.config.stages const ts = Math.floor(new Date().getTime()).toString() const newStage = JSON.parse(JSON.stringify(stage)) @@ -668,6 +672,7 @@ export default { }) }, onRemoveStage (stage) { + this.$st.sendEv('爬虫详情', '配置', '删除阶段') const stages = this.spiderForm.config.stages for (let i = 0; i < stages.length; i++) { if (stage.name === stages[i].name) { @@ -689,6 +694,7 @@ export default { }) }, onAddStage (stage) { + this.$st.sendEv('爬虫详情', '配置', '添加阶段') const stages = this.spiderForm.config.stages for (let i = 0; i < stages.length; i++) { if (stage.name === stages[i].name) { @@ -813,10 +819,12 @@ ${f.css || f.xpath} ${f.attr ? ('(' + f.attr + ')') : ''} ${f.next_stage ? (' -- }, onCheckIsList (value, stage) { if (value) { + this.$st('爬虫详情', '配置', '勾选列表页') if (!stage.list_css && !stage.list_xpath) { stage.list_xpath = '//body' } } else { + this.$st('爬虫详情', '配置', '取消勾选列表页') stage.list_css = '' stage.list_xpath = '' } @@ -838,10 +846,12 @@ ${f.css || f.xpath} ${f.attr ? ('(' + f.attr + ')') : ''} ${f.next_stage ? (' -- }, onCheckIsPage (value, stage) { if (value) { + this.$st('爬虫详情', '配置', '勾选分页') if (!stage.page_css && !stage.page_xpath) { stage.page_xpath = '//body' } } else { + this.$st('爬虫详情', '配置', '取消勾选分页') stage.page_css = '' stage.page_xpath = '' } diff --git a/frontend/src/components/Environment/EnvironmentList.vue b/frontend/src/components/Environment/EnvironmentList.vue index e7c89a51..1b50715d 100644 --- a/frontend/src/components/Environment/EnvironmentList.vue +++ b/frontend/src/components/Environment/EnvironmentList.vue @@ -49,11 +49,11 @@ export default { name: '', value: '' }) - this.$st.sendEv('爬虫详情-环境', '添加') + this.$st.sendEv('爬虫详情', '环境', '添加') }, deleteEnv (index) { this.spiderForm.envs.splice(index, 1) - this.$st.sendEv('爬虫详情-环境', '删除') + this.$st.sendEv('爬虫详情', '环境', '删除') }, save () { this.$store.dispatch('spider/editSpider') @@ -63,7 +63,7 @@ export default { .catch(error => { this.$message.error(error) }) - this.$st.sendEv('爬虫详情-环境', '保存') + this.$st.sendEv('爬虫详情', '环境', '保存') } } } diff --git a/frontend/src/components/InfoView/SpiderInfoView.vue b/frontend/src/components/InfoView/SpiderInfoView.vue index bf05a2ba..f804bca1 100644 --- a/frontend/src/components/InfoView/SpiderInfoView.vue +++ b/frontend/src/components/InfoView/SpiderInfoView.vue @@ -112,7 +112,7 @@ export default { methods: { onCrawl () { this.crawlConfirmDialogVisible = true - this.$st.sendEv('爬虫详情-概览', '点击运行') + this.$st.sendEv('爬虫详情', '概览', '点击运行') }, onSave () { this.$refs['spiderForm'].validate(res => { @@ -126,7 +126,7 @@ export default { }) } }) - this.$st.sendEv('爬虫详情-概览', '保存') + this.$st.sendEv('爬虫详情', '概览', '保存') }, fetchSiteSuggestions (keyword, callback) { this.$request.get('/sites', { diff --git a/frontend/src/components/Overview/TaskOverview.vue b/frontend/src/components/Overview/TaskOverview.vue index 603f28ef..cd3de0a8 100644 --- a/frontend/src/components/Overview/TaskOverview.vue +++ b/frontend/src/components/Overview/TaskOverview.vue @@ -52,11 +52,11 @@ export default { methods: { onClickNodeTitle () { this.$router.push(`/nodes/${this.nodeForm._id}`) - this.$st.sendEv('任务详情-概览', '点击节点详情') + this.$st.sendEv('任务详情', '概览', '点击节点详情') }, onClickSpiderTitle () { this.$router.push(`/spiders/${this.spiderForm._id}`) - this.$st.sendEv('任务详情-概览', '点击爬虫详情') + this.$st.sendEv('任务详情', '概览', '点击爬虫详情') } }, created () { diff --git a/frontend/src/components/TableView/FieldsTableView.vue b/frontend/src/components/TableView/FieldsTableView.vue index 87bf88f1..26b6010d 100644 --- a/frontend/src/components/TableView/FieldsTableView.vue +++ b/frontend/src/components/TableView/FieldsTableView.vue @@ -1,11 +1,5 @@