瀏覽代碼

添加线上问题和checklist埋点

wenbobowen 4 年之前
父節點
當前提交
1370d8bbde

+ 12 - 1
src/App.vue

@@ -47,7 +47,18 @@ export default {
     // },
     initOmegaTracker() {
       try {
-        window.log = OmegaTracker.getTracker(config)
+        const tracker = OmegaTracker.getTracker(config)
+        const _this = this
+        window.log = function({ c: master_func, d: detail_func }) {
+          const userName = localStorage.getItem('username')
+          const { bizId = null } = _this.$store.state.global || {}
+          tracker.trackEvent('phpublic_zhihui_project_management_ck', {
+            'biz_id': bizId,
+            'user': userName,
+            master_func,
+            detail_func
+          })
+        }
       } catch (error) {
         console.error(error)
       }

+ 1 - 2
src/api/workSchedule.js

@@ -1,6 +1,5 @@
 // 个人工作台和团队工作台
 import request from '@/utils/request'
-import { log } from '@/utils/global'
 import { TeamManagement } from '@/apiConfig/api'
 
 // 获取用户团队列表
@@ -67,7 +66,7 @@ export function deleteSelfSchedule(id) {
 
 // 获取指定时间段用户日程信息
 export function queryWorkListByTime(data) {
-  log({ c: 'self_workbench', d: 'get_calendar' })
+  window.log({ c: 'self_workbench', d: 'get_calendar' })
   return request({
     url: TeamManagement + '/workbench/personal/queryWorkListByTime',
     method: 'post',

+ 3 - 4
src/components/newLayout/Head.vue

@@ -64,7 +64,6 @@ import routes from '@/router/newRouter'
 import websocket from '@/views/workbench/mixins/websocket'
 import { memberGetLoginInMemberInfoByLdap } from '@/api/projectIndex'
 import { logoutUrl } from '@/apiConfig/requestIP.js'
-import { log } from '@/utils/global'
 import { verifyIsAdmin } from '@/api/configure.js'
 export default {
   mixins: [websocket],
@@ -93,7 +92,7 @@ export default {
   },
   methods: {
     goto(name) {
-      log({ c: 'project', d: `goto_${name}` })
+      window.log({ c: 'project', d: `goto_${name}` })
       this.$router.push({ name })
     },
     getTarget() {
@@ -118,9 +117,9 @@ export default {
     // 设置二级导航类型
     setNavTagType(type) {
       if (type === 2) {
-        log({ c: 'sys_setting', d: 'change_nav_bar_top' })
+        window.log({ c: 'sys_setting', d: 'change_nav_bar_top' })
       } else {
-        log({ c: 'sys_setting', d: 'change_nav_bar_side' })
+        window.log({ c: 'sys_setting', d: 'change_nav_bar_side' })
       }
       this.$store.dispatch('global/setNavTagType', type)
       localStorage.setItem('navTagType', type)

+ 0 - 12
src/utils/global.js

@@ -1,5 +1,4 @@
 import dayjs from 'dayjs'
-import store from '@/store'
 let timer = null
 export function debounce(func, delay) { // 防抖
   clearTimeout(timer)
@@ -52,14 +51,3 @@ export function formatHMS(data) {
   time = (hours < 10 ? ('0' + hours) : hours) + '小时' + (minutes < 10 ? ('0' + minutes) : minutes) + '分' + (seconds < 10 ? ('0' + seconds) : seconds) + '秒'
   return time
 }
-
-export function log({ c: master_func, d: detail_func }) {
-  const userName = localStorage.getItem('username')
-  const { bizId = null } = store.state.global || {}
-  window.log.trackEvent('phpublic_zhihui_project_management_ck', {
-    'biz_id': bizId,
-    'user': userName,
-    master_func,
-    detail_func
-  })
-}

+ 3 - 0
src/views/projectManage/onlineproblem/component/header/index.vue

@@ -78,6 +78,7 @@ export default {
       this.showMore = e
     },
     create() {
+      window.log({ c: 'problem', d: 'add_problem' })
       this.$router.push({ name: '质惠新建线上问题' })
     },
     async search(key, value) {
@@ -96,6 +97,8 @@ export default {
       data.year = '' + this.year
       data.month = this.month
       this.$emit('listSearch', data)
+      // 埋点搜索线上问题列表
+      window.log({ c: 'problem', d: 'get_problem_list' })
     }
   }
 }

+ 1 - 0
src/views/projectManage/onlineproblem/component/list.vue

@@ -77,6 +77,7 @@ export default {
           id: data.id
         }
       })
+      window.log({ c: 'problem', d: 'get_problem_detail' })
       window.open(href, '_blank')
     },
     goto(url) {

+ 2 - 0
src/views/projectManage/onlineproblem/create/index.vue

@@ -90,6 +90,7 @@ export default {
   methods: {
     back() {
       this.$router.push({ name: '线上问题 ', query: { id: 111 }})
+      window.log({ c: 'problem', d: 'add_cancel_problem' })
     },
     async createHandle() {
       const notInput = []
@@ -113,6 +114,7 @@ export default {
         improvements: this.improvements
       })
       if (res.code === 200) {
+        window.log({ c: 'problem', d: 'add_create_problem' })
         this.$router.push({ name: '线上问题 ' })
       }
     },

+ 1 - 0
src/views/projectManage/onlineproblem/detial/index.vue

@@ -228,6 +228,7 @@ export default {
     async update() {
       const res = await updateOnlineProblem({ ...this.updateData, id: this.form_data.id })
       if (res.code === 200) {
+        window.log({ c: 'problem', d: 'update_problem' })
         this.search()
       } else {
         this.form_data = JSON.parse(JSON.stringify(this.copy_form_data))

+ 4 - 0
src/views/projectManage/onlineproblem/index.vue

@@ -47,10 +47,14 @@ export default {
     async chartListSearch(code) {
       const chartList = await getChartListData({ ...this.chartSearchData, ...{ code }})
       this.dataList = [chartList.data] || []
+      // 埋点-搜索视图
+      window.log({ c: 'problem', d: 'get_problem_statistic' })
     },
     chartChangeList(code) {
       this.chartSearchData = { ...this.chartSearchData, ...{ code }}
       this.chartListSearch(code)
+      // 埋点-视图对应的列表
+      window.log({ c: 'problem', d: 'get_problem_statistic' })
     }
   }
 }

+ 1 - 2
src/views/projectManage/projectList/projectIndex.vue

@@ -329,7 +329,6 @@
 <script>
 import { EncryptId } from '@/utils/crypto-js.js'
 import { mapGetters } from 'vuex'
-import { log } from '@/utils/global'
 import {
   projectList,
   memberQueryMemberInfoByIDAPorName,
@@ -407,7 +406,7 @@ export default {
   },
   methods: {
     logHandle(d) {
-      log({ c: 'project', d })
+      window.log({ c: 'project', d })
     },
     test2(item, e) {
       // 获取团队人员信息

+ 7 - 1
src/views/projectManage/publishTask/index.vue

@@ -163,6 +163,7 @@ export default {
     // 监听滚动条
     const container = document.getElementsByClassName('main-wrapper')[0]
     container.addEventListener('scroll', this.handleScroll) // 监听滚动事件,然后用handleScroll这个方法进行相应的处理
+    window.log({ c: 'checklist', d: 'get_task_deploy' })
   },
   methods: {
     // 监听滚动条
@@ -318,6 +319,7 @@ export default {
           message: '保存成功',
           type: 'success'
         })
+        window.log({ c: 'checklist', d: 'update_task_deploy_checklist' })
       }
     },
 
@@ -352,7 +354,7 @@ export default {
           name: this.taskName
         }]
       }
-      // this.checkAllTem()
+      window.log({ c: 'checklist', d: 'add_task_deploy_checklist' })
     },
 
     // 编辑
@@ -446,6 +448,8 @@ export default {
       const anchorH = document.getElementById(targe).offsetTop
       const container = document.getElementsByClassName('main-wrapper')[0]
       container.scrollTop = anchorH - 30
+      // 锚点跳转
+      window.log({ c: 'checklist', d: 'anchor_task_deploy_checklist' })
     },
 
     // 解绑删除任务
@@ -481,6 +485,8 @@ export default {
           message: '检查项状态更新成功',
           type: 'success'
         })
+        // 确认checklist
+        window.log({ c: 'checklist', d: 'check_task_deploy_checklist' })
       }
     },
 

+ 1 - 2
src/views/projectManage/requirement/list/index.vue

@@ -226,7 +226,6 @@
 <script>
 import { EncryptId } from '@/utils/crypto-js.js'
 import { mapGetters } from 'vuex'
-import { log } from '@/utils/global'
 import {
   getRequirement,
   showRequirementEnum,
@@ -352,7 +351,7 @@ export default {
   },
   methods: {
     logHandle(d) {
-      log({ c: 'requirement', d })
+      window.log({ c: 'requirement', d })
     },
     getTableData() { // 查询
       if (this.bizId === -1) return

+ 1 - 2
src/views/projectManage/taskList/taskIndex.vue

@@ -244,7 +244,6 @@
 <script>
 import { EncryptId } from '@/utils/crypto-js.js'
 import { mapGetters } from 'vuex'
-import { log } from '@/utils/global'
 import {
   taskList,
   configShowTaskEnum,
@@ -359,7 +358,7 @@ export default {
   },
   methods: {
     logHandle(d) {
-      log({ c: 'task', d })
+      window.log({ c: 'task', d })
     },
     test2(item, e) {
       // 获取团队人员信息