From aa5ae87eebd63c6c7830950cf8c879933f5887ec Mon Sep 17 00:00:00 2001 From: marvzhang Date: Wed, 8 Jan 2020 20:11:05 +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?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/TableView/TaskTableView.vue | 15 ++++++++++++++- frontend/src/views/layout/components/TagsView.vue | 4 ++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/TableView/TaskTableView.vue b/frontend/src/components/TableView/TaskTableView.vue index cd2ec10c..56abfab8 100644 --- a/frontend/src/components/TableView/TaskTableView.vue +++ b/frontend/src/components/TableView/TaskTableView.vue @@ -76,6 +76,9 @@ export default { this.clicked = false }, 100) this.$router.push(`/spiders/${row.spider_id}`) + if (this.$route.path.match(/\/nodes\//)) { + this.$st.sendEv('节点详情', '概览', '查看爬虫') + } }, onClickNode (row) { this.clicked = true @@ -83,9 +86,19 @@ export default { this.clicked = false }, 100) this.$router.push(`/nodes/${row.node_id}`) + if (this.$route.path.match(/\/spiders\//)) { + this.$st.sendEv('爬虫详情', '概览', '查看节点') + } }, onClickTask (row) { - if (!this.clicked) this.$router.push(`/tasks/${row._id}`) + if (!this.clicked) { + this.$router.push(`/tasks/${row._id}`) + if (this.$route.path.match(/\/nodes\//)) { + this.$st.sendEv('节点详情', '概览', '查看任务') + } else if (this.$route.path.match(/\/spiders\//)) { + this.$st.sendEv('爬虫详情', '概览', '查看任务') + } + } }, onRefresh () { if (this.$route.path.split('/')[1] === 'spiders') { diff --git a/frontend/src/views/layout/components/TagsView.vue b/frontend/src/views/layout/components/TagsView.vue index b72d874a..1222a854 100644 --- a/frontend/src/views/layout/components/TagsView.vue +++ b/frontend/src/views/layout/components/TagsView.vue @@ -9,6 +9,7 @@ :key="tag.path" tag="span" class="tags-view-item" + @click.native="clickSelectedTag(tag)" @click.middle.native="closeSelectedTag(tag)" @contextmenu.prevent.native="openMenu(tag,$event)"> {{ $t(generateTitle(tag.title)) }} @@ -138,6 +139,9 @@ export default { }) }) }, + clickSelectedTag (tag) { + this.$st.sendEv('全局', '点击标签', tag.name) + }, closeSelectedTag (view) { this.$store.dispatch('delView', view).then(({ visitedViews }) => { if (this.isActive(view)) {