burying points for analytics

This commit is contained in:
Marvin Zhang
2019-05-30 21:14:30 +08:00
parent 6cd8d0585b
commit a27cef6868
20 changed files with 161 additions and 20 deletions

View File

@@ -159,6 +159,7 @@ export default {
this.spiderForm.crawl_type = value
},
onSave () {
this.$st.sendEv('爬虫详情-配置', '保存')
return new Promise((resolve, reject) => {
this.saveLoading = true
this.$store.dispatch('spider/updateSpiderFields')
@@ -203,6 +204,7 @@ export default {
.finally(() => {
this.previewLoading = false
})
this.$st.sendEv('爬虫详情-配置', '预览')
})
},
onCrawl () {
@@ -215,6 +217,7 @@ export default {
.then(() => {
this.$message.success(this.$t(`Spider task has been scheduled`))
})
this.$st.sendEv('爬虫详情-配置', '运行')
})
},
onExtractFields () {
@@ -235,6 +238,7 @@ export default {
.finally(() => {
this.extractFieldsLoading = false
})
this.$st.sendEv('爬虫详情-配置', '提取字段')
})
}
},

View File

@@ -49,10 +49,11 @@ export default {
name: '',
value: ''
})
console.log(this.spiderForm)
this.$st.sendEv('爬虫详情-环境', '添加')
},
deleteEnv (index) {
this.spiderForm.envs.splice(index, 1)
this.$st.sendEv('爬虫详情-环境', '删除')
},
save () {
this.$store.dispatch('spider/updateSpiderEnvs')
@@ -62,6 +63,7 @@ export default {
.catch(error => {
this.$message.error(error)
})
this.$st.sendEv('爬虫详情-环境', '保存')
}
}
}

View File

@@ -55,6 +55,7 @@ export default {
})
}
})
this.$st.sendEv('节点详情', '保存')
}
}
}

View File

@@ -127,6 +127,7 @@ export default {
.then(() => {
this.$message.success(this.$t(`Spider task has been scheduled`))
})
this.$st.sendEv('爬虫详情-概览', '运行')
})
}
})
@@ -149,6 +150,7 @@ export default {
.then(() => {
this.$message.success(this.$t(`Spider has been deployed`))
})
this.$st.sendEv('爬虫详情-概览', '部署')
})
}
})
@@ -165,6 +167,7 @@ export default {
})
}
})
this.$st.sendEv('爬虫详情-概览', '保存')
},
fetchSiteSuggestions (keyword, callback) {
this.$request.get('/sites', {

View File

@@ -52,9 +52,11 @@ export default {
methods: {
onClickNodeTitle () {
this.$router.push(`/nodes/${this.nodeForm._id}`)
this.$st.sendEv('任务详情-概览', '点击节点详情')
},
onClickSpiderTitle () {
this.$router.push(`/spiders/${this.spiderForm._id}`)
this.$st.sendEv('任务详情-概览', '点击爬虫详情')
}
},
created () {

View File

@@ -109,14 +109,17 @@ export default {
type: 'css',
extract_type: 'text'
})
this.$st.sendEv('爬虫详情-配置', '添加字段')
},
deleteField (index) {
this.fields.splice(index, 1)
this.$st.sendEv('爬虫详情-配置', '删除字段')
},
onNameChange (row) {
if (this.fields.filter(d => d.name === row.name).length > 1) {
this.$message.error(this.$t(`Duplicated field names for ${row.name}`))
}
this.$st.sendEv('爬虫详情-配置', '更改字段')
},
onCheck (row) {
this.fields.forEach(d => {
@@ -124,6 +127,7 @@ export default {
this.$set(d, 'is_detail', false)
}
})
this.$st.sendEv('爬虫详情-配置', '设置详情页URL')
}
}
}