更新百度统计事件名称

This commit is contained in:
marvzhang
2019-12-13 13:53:27 +08:00
parent 556b2841ec
commit 34eef73283
15 changed files with 54 additions and 105 deletions

View File

@@ -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('全局', '允许/禁止统计', '禁止')
}
}

View File

@@ -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)
})
}
},

View File

@@ -68,6 +68,7 @@
v-model="spiderForm.config.start_stage"
:placeholder="$t('Start Stage')"
:class="startStageClass"
@change="$st.sendEv('爬虫详情', '配置', '改变起始阶段')"
>
<el-option
v-for="n in spiderForm.config.stages.map(s => s.name)"
@@ -502,7 +503,7 @@ export default {
this.spiderForm.crawl_type = value
},
async onSave () {
this.$st.sendEv('爬虫详情-配置', '保存')
this.$st.sendEv('爬虫详情', '配置', '保存')
this.saveLoading = true
try {
const res = await this.$store.dispatch('spider/postConfigSpiderConfig')
@@ -542,13 +543,13 @@ export default {
.finally(() => {
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 = ''
}

View File

@@ -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('爬虫详情', '环境', '保存')
}
}
}

View File

@@ -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', {

View File

@@ -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 () {

View File

@@ -1,11 +1,5 @@
<template>
<div class="fields-table-view">
<!-- <el-row class="button-group-container">-->
<!-- <label class="title">{{$t(this.title)}}</label>-->
<!-- <div class="button-group">-->
<!-- <el-button type="primary" size="small" @click="addField" icon="el-icon-plus">{{$t('Add Field')}}</el-button>-->
<!-- </div>-->
<!-- </el-row>-->
<el-row>
<el-table :data="fields"
class="table edit"
@@ -171,32 +165,14 @@ export default {
}
},
methods: {
addField () {
this.fields.push({
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 => {
if (row.name !== d.name) {
this.$set(d, 'is_detail', false)
}
})
this.$st.sendEv('爬虫详情-配置', '设置详情页URL')
this.$st.sendEv('爬虫详情', '配置', '更改字段')
},
onClickSelectorType (row, selectorType) {
this.$st.sendEv('爬虫详情', '配置', `点击字段选择器类别-${selectorType}`)
if (selectorType === 'css') {
if (row.xpath) this.$set(row, 'xpath', '')
if (!row.css) this.$set(row, 'css', 'body')
@@ -206,6 +182,7 @@ export default {
}
},
onClickIsAttribute (row, isAttribute) {
this.$st.sendEv('爬虫详情', '配置', '设置字段属性')
if (!isAttribute) {
// 文本
if (row.attr) this.$set(row, 'attr', '')
@@ -224,6 +201,7 @@ export default {
}
},
onRemoveField (row) {
this.$st.sendEv('爬虫详情', '配置', '删除字段')
for (let i = 0; i < this.fields.length; i++) {
if (row.name === this.fields[i].name) {
this.fields.splice(i, 1)
@@ -238,6 +216,7 @@ export default {
}
},
onAddField (row) {
this.$st.sendEv('爬虫详情', '配置', '添加字段')
for (let i = 0; i < this.fields.length; i++) {
if (row.name === this.fields[i].name) {
this.fields.splice(i + 1, 0, {

View File

@@ -77,51 +77,14 @@ export default {
}
},
methods: {
addField () {
this.list.push({
type: 'css',
extract_type: 'text'
})
this.$st.sendEv('爬虫详情-配置', '添加字段')
},
deleteField (index) {
this.list.splice(index, 1)
this.$st.sendEv('爬虫详情-配置', '删除字段')
},
onChange (row) {
if (this.list.filter(d => d.name === row.name).length > 1) {
this.$message.error(this.$t(`Duplicated field names for ${row.name}`))
}
this.$store.commit('spider/SET_SPIDER_FORM_CONFIG_SETTINGS', this.list)
this.$st.sendEv('爬虫详情-配置', '更改字段')
},
onCheck (row) {
this.list.forEach(d => {
if (row.name !== d.name) {
this.$set(d, 'is_detail', false)
}
})
this.$st.sendEv('爬虫详情-配置', '设置详情页URL')
},
onClickSelectorType (row, selectorType) {
if (selectorType === 'css') {
if (row.xpath) this.$set(row, 'xpath', '')
if (!row.css) this.$set(row, 'css', 'body')
} else {
if (row.css) this.$set(row, 'css', '')
if (!row.xpath) this.$set(row, 'xpath', '//body')
}
},
onClickIsAttribute (row, isAttribute) {
if (!isAttribute) {
// 文本
if (row.attr) this.$set(row, 'attr', '')
} else {
// 属性
if (!row.attr) this.$set(row, 'attr', 'href')
}
},
onRemoveField (row) {
this.$st.sendEv('爬虫详情', '配置', '删除设置')
const list = JSON.parse(JSON.stringify(this.list))
for (let i = 0; i < list.length; i++) {
if (row.name === list[i].name) {
@@ -137,6 +100,7 @@ export default {
this.$store.commit('spider/SET_SPIDER_FORM_CONFIG_SETTINGS', list)
},
onAddField (row) {
this.$st.sendEv('爬虫详情', '配置', '添加设置')
const list = JSON.parse(JSON.stringify(this.list))
for (let i = 0; i < list.length; i++) {
if (row.name === list[i].name) {

View File

@@ -74,7 +74,7 @@ export default {
this.$i18n.locale = lang
this.$store.commit('lang/SET_LANG', lang)
this.$st.sendEv('全局', '切换中英文', 'lang', lang)
this.$st.sendEv('全局', '切换中英文', lang)
}
}
}

View File

@@ -202,7 +202,7 @@ export default {
},
onRefresh () {
this.$store.dispatch('node/getNodeList')
this.$st.sendEv('节点', '刷新')
this.$st.sendEv('节点列表', '刷新')
},
onSubmit () {
const vm = this
@@ -246,13 +246,13 @@ export default {
message: 'Deleted successfully'
})
})
this.$st.sendEv('节点', '删除', 'id', row._id)
this.$st.sendEv('节点列表', '删除节点')
})
},
onView (row) {
this.$router.push(`/nodes/${row._id}`)
this.$st.sendEv('节点', '查看', 'id', row._id)
this.$st.sendEv('节点列表', '查看节点')
},
onPageChange () {
this.$store.dispatch('node/getNodeList')

View File

@@ -212,7 +212,7 @@ export default {
this.isEdit = false
this.dialogVisible = true
this.$store.commit('schedule/SET_SCHEDULE_FORM', { node_ids: [] })
this.$st.sendEv('定时任务', '添加')
this.$st.sendEv('定时任务', '添加定时任务')
},
onAddSubmit () {
this.$refs.scheduleForm.validate(res => {
@@ -238,7 +238,7 @@ export default {
}
}
})
this.$st.sendEv('定时任务', '提交')
this.$st.sendEv('定时任务', '提交定时任务')
},
isShowRun (row) {
},
@@ -246,7 +246,7 @@ export default {
this.$store.commit('schedule/SET_SCHEDULE_FORM', row)
this.dialogVisible = true
this.isEdit = true
this.$st.sendEv('定时任务', '修改', 'id', row._id)
this.$st.sendEv('定时任务', '修改定时任务')
},
onRemove (row) {
this.$confirm(this.$t('Are you sure to delete the schedule task?'), this.$t('Notification'), {
@@ -263,7 +263,7 @@ export default {
})
}).catch(() => {
})
this.$st.sendEv('定时任务', '删除', 'id', row._id)
this.$st.sendEv('定时任务', '删除定时任务')
},
onCrawl (row) {
// 停止定时任务

View File

@@ -370,17 +370,17 @@ export default {
}
await this.$store.dispatch('spider/getSpiderList')
this.$router.push(`/spiders/${res2.data.data._id}`)
this.$st.sendEv('爬虫', '添加爬虫-可配置爬虫')
this.$st.sendEv('爬虫列表', '添加爬虫', '可配置爬虫')
})
},
onAddCustomized () {
this.addDialogVisible = false
this.addCustomizedDialogVisible = true
this.$st.sendEv('爬虫', '添加爬虫-自定义爬虫')
this.$st.sendEv('爬虫列表', '添加爬虫', '自定义爬虫')
},
onRefresh () {
this.getList()
this.$st.sendEv('爬虫', '刷新')
this.$st.sendEv('爬虫列表', '刷新')
},
onSubmit () {
const vm = this
@@ -434,19 +434,19 @@ export default {
message: 'Deleted successfully'
})
})
this.$st.sendEv('爬虫', '删除')
this.$st.sendEv('爬虫列表', '删除爬虫')
})
},
onCrawl (row, ev) {
ev.stopPropagation()
this.crawlConfirmDialogVisible = true
this.activeSpiderId = row._id
this.$st.sendEv('爬虫', '点击运行')
this.$st.sendEv('爬虫列表', '点击运行')
},
onView (row, ev) {
ev.stopPropagation()
this.$router.push('/spiders/' + row._id)
this.$st.sendEv('爬虫', '查看')
this.$st.sendEv('爬虫列表', '查看爬虫')
},
onImport () {
this.$refs.importForm.validate(valid => {
@@ -467,7 +467,7 @@ export default {
})
}
})
this.$st.sendEv('爬虫', '导入爬虫')
this.$st.sendEv('爬虫列表', '导入爬虫')
},
openImportDialog () {
this.dialogVisible = true
@@ -495,10 +495,6 @@ export default {
callback(data)
})
},
onSiteSelect (item) {
this.$store.commit('spider/SET_FILTER_SITE', item._id)
this.$st.sendEv('爬虫', '搜索网站')
},
onAddConfigurableSiteSelect (item) {
this.spiderForm.site = item._id
},

View File

@@ -97,7 +97,7 @@ export default {
},
downloadCSV () {
this.$store.dispatch('task/getTaskResultExcel', this.$route.params.id)
this.$st.sendEv('任务详情-结果', '下载CSV')
this.$st.sendEv('任务详情', '结果', '下载CSV')
},
getTaskLog () {
if (this.$route.params.id) {

View File

@@ -221,7 +221,7 @@ export default {
},
onRefresh () {
this.$store.dispatch('task/getTaskList')
this.$st.sendEv('任务', '搜索')
this.$st.sendEv('任务列表', '搜索')
},
onRemoveMultipleTask () {
if (this.multipleSelection.length === 0) {
@@ -267,20 +267,20 @@ export default {
message: 'Deleted successfully'
})
})
this.$st.sendEv('任务', '删除', 'id', row._id)
this.$st.sendEv('任务列表', '删除任务')
})
},
onView (row) {
this.$router.push(`/tasks/${row._id}`)
this.$st.sendEv('任务', '搜索', 'id', row._id)
this.$st.sendEv('任务列表', '查看任务')
},
onClickSpider (row) {
this.$router.push(`/spiders/${row.spider_id}`)
this.$st.sendEv('任务', '点击爬虫详情', 'id', row.spider_id)
this.$st.sendEv('任务列表', '点击爬虫详情')
},
onClickNode (row) {
this.$router.push(`/nodes/${row.node_id}`)
this.$st.sendEv('任务', '点击节点详情', 'id', row.node_id)
this.$st.sendEv('任务列表', '点击节点详情')
},
onPageChange () {
setTimeout(() => {

View File

@@ -161,7 +161,7 @@ export default {
message: this.$t('Deleted successfully')
})
})
this.$st.sendEv('用户', '删除', 'id', row._id)
this.$st.sendEv('用户列表', '删除用户')
})
// this.$store.commit('user/SET_USER_FORM', row)
},
@@ -178,7 +178,7 @@ export default {
})
}
})
this.$st.sendEv('用户', '编辑')
this.$st.sendEv('用户列表', '编辑用户')
}
},
created () {