فهرست منبع

埋点添加完成

luolei 5 سال پیش
والد
کامیت
779db37ca1
5فایلهای تغییر یافته به همراه27 افزوده شده و 34 حذف شده
  1. 1 28
      src/common/UsualSymptom.vue
  2. 0 1
      src/components/MainPage.vue
  3. 17 1
      src/components/Preview.vue
  4. 6 0
      src/components/Search.vue
  5. 3 4
      src/store.js

+ 1 - 28
src/common/UsualSymptom.vue

@@ -35,8 +35,6 @@
   import Search from '../components/Search.vue';
   // import ConfirmBox from '../common/ConfirmBox'
   import Tiptoast from '../common/Tiptoast.vue';
-  import {mapState} from 'vuex';
-  import api from '@utils/api.js';
   export default {
     name:'UsualSymptom',
     props:[],
@@ -54,11 +52,6 @@
         },
       }
     },
-    computed:{
-      ...mapState({
-        pathInfo: state => state.pathInfo,
-      }),
-    },
     methods:{
       back(){
         this.$router.go(-1);
@@ -93,32 +86,12 @@
         this.$emit('selectUsual',item,idx);
         this.$store.commit('setSearchShow', false);
         let obj = {
-              "labelName": item.tagName,//标签名称
+              "labelName": item.tagName||item.name,//标签名称
               "operationNum": 1,//次数
               "operationType": 1,//1常见2搜索
             }
         this.$store.commit('addBuriedSome', obj);
       },
-      saveBuriedSome(){
-        let params = {
-          "doctorId": this.pathInfo.doctorId||'',
-          "hospitalDeptId": this.pathInfo.hospitalDeptId||'',
-          "hospitalId": this.pathInfo.hospitalDeptId||'',
-          "inquiryCode": this.pathInfo.hospitalDeptId||'',
-          "patientId": this.pathInfo.hospitalDeptId||'',
-          "taggeds": [
-            {
-              "labelName": "string",//标签名称
-              "operationNum": 0,//次数
-              "operationType": "string",//1常见2搜索
-            }
-          ]
-        }
-        
-        api.saveBuriedSome(params).then((res)=>{
-
-        })
-      },
       confirmDialog(){
 
       },

+ 0 - 1
src/components/MainPage.vue

@@ -277,7 +277,6 @@ export default {
             return ;
           }
           let qaLis = data.questionMapping;
-          console.log(qaLis)
           //qaLis.length=2;     //开发测试代码,要删除
           qaLis[0].show=true;   //第一题自动显示
           this.type = qaLis[0].controlType;

+ 17 - 1
src/components/Preview.vue

@@ -170,6 +170,8 @@ export default {
     ...mapState({
       tabType: state => state.tabType,
       config: state => state.sysConfig,
+      pathInfo: state => state.pathInfo,
+      addBuriedSomeList:state=>state.addBuriedSomeList
     })
   },
   created(){
@@ -309,6 +311,7 @@ export default {
         // "type": 0//病历分类(1:门诊,2:住院)
       }
       // console.log(params)
+      this.saveBuriedSome()//埋点
       api.saveInquiry(params).then((res) => {
         if (res.data.code == 0) {
           this.$store.commit('handleToggleShow', false);
@@ -318,7 +321,20 @@ export default {
           this.defaultWaring(res)
         }
       }).catch((err)=>{
-          this.defaultWaring(err)
+        this.defaultWaring(err)
+      })
+    },
+    saveBuriedSome(){
+        let params = {
+          "doctorId": this.pathInfo.doctorId||'',
+          "hospitalDeptId": this.pathInfo.hospitalDeptId||'',
+          "hospitalId": this.pathInfo.hospitalDeptId||'',
+          "inquiryCode": this.pathInfo.hospitalDeptId||'',
+          "patientId": this.pathInfo.hospitalDeptId||'',
+          "taggeds": this.addBuriedSomeList||[]
+        }
+        api.saveBuriedSome(params).then((res)=>{
+          console.log('埋点')
         })
     },
     defaultWaring(res){

+ 6 - 0
src/components/Search.vue

@@ -87,6 +87,12 @@ export default {
       }*/
       let timer = setTimeout(() => {
         this.$emit('showDetil',item);
+        let obj = {
+              "labelName": item.tagName||item.name,//标签名称
+              "operationNum": 1,//次数
+              "operationType": 1,//1常见2搜索
+            }
+        this.$store.commit('addBuriedSome', obj);
         clearTimeout(timer)
       }, 250);
       // this.$emit('search', false)

+ 3 - 4
src/store.js

@@ -65,9 +65,9 @@ const store = new Vuex.Store({
     addBuriedSome(state,item){
       let list = state.addBuriedSomeList,num=0
       for(let i = 0;i < list.length;i++){
-        let part = list[i],num = list[i].operationNum
-        if(part.labelName == item.labelName&&part.operationType == item.operationType){//已经存在+1
-          part.operationNum = ++num
+        let num = list[i].operationNum
+        if(list[i].labelName == item.labelName&&list[i].operationType == item.operationType){//已经存在+1
+          list[i].operationNum = ++num
         }else{
           ++num
         }
@@ -75,7 +75,6 @@ const store = new Vuex.Store({
       if(num == list.length){//没有新增一项
         list.push(item)
       }
-      console.log(list)
       state.addBuriedSomeList=list
     },
     setFinish(state,param){