소스 검색

常用数据点击获取

luolei 5 년 전
부모
커밋
3b5e0ba4e9
4개의 변경된 파일81개의 추가작업 그리고 40개의 파일을 삭제
  1. 59 40
      src/common/UsualSymptom.vue
  2. 1 0
      src/components/MainPage.vue
  3. 17 0
      src/store.js
  4. 4 0
      src/utils/api.js

+ 59 - 40
src/common/UsualSymptom.vue

@@ -10,11 +10,9 @@
         :class="[{'liSelect':item.select}]"
         :key="idx"
         @click="selectResult(item,idx)"
-        @touchstart.prevent="touchstart(item,idx)"
-        @touchend.prevent="touchend(item,idx+1)"
       >
         {{item.description||item.name}}
-        <img src="../images/icon_que.png" alt="解释说明" v-if="item.explains"/>
+        <img src="../images/icon_que.png" alt="解释说明" @click.stop="showExplain(item)" v-if="item.explains"/>
       </li>
     </ul>
 
@@ -27,13 +25,18 @@
       @search="search"
       @showDetil="showDetil"
     ></Search>
-    <!--<ConfirmBox :show="showConfirm" @confirmDialog="confirmDialog" @cancelDialog = "cancelDialog"></ConfirmBox>-->
+
+    <Tiptoast :show="showExp" :data="message" @close="closeTip"/>
+    <!-- <ConfirmBox :show="showConfirm" @confirmDialog="confirmDialog" @cancelDialog = "cancelDialog"></ConfirmBox> -->
   </div>
 </template>
 <script>
   import Radio from './Radio';
   import Search from '../components/Search.vue';
-  import ConfirmBox from '../common/ConfirmBox'
+  // 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:[],
@@ -44,47 +47,36 @@
         portaled:false,   //是否将radio渲染到最外层
         showConfirm:false,
         len:10,     //显示常用症状个数
+        showExp:false,
+        message:{
+          title:'',
+          text:''
+        },
       }
     },
+    computed:{
+      ...mapState({
+        pathInfo: state => state.pathInfo,
+      }),
+    },
     methods:{
       back(){
         this.$router.go(-1);
       },
-      touchend(item,flg) {//症状点开详情
-        clearTimeout(this.timer);
-        this.end = this.$store.state.scroll
-        if(JSON.stringify(this.start) != JSON.stringify(this.end)){
-          this.startNum = 0
-          return
-        }
-        let endTime = +new Date();
-        if(endTime - this.startTime < 500){//点击事件
-          if(this.startNum == 1){
-            this.common(item,flg);
-          }
-          this.startNum = 0
-          this.slideTxt = '点击展开'
-          this.degNum = 0
+      showExplain(it){
+        if(it.explains){
+            this.message.title = it.description || it.name;
+            this.message.text = it.explains;
+        }else{
+            this.message.title = "";
+            this.message.text = "暂无资料";
         }
-        this.startTime = "";
+        this.showExp = true
       },
-      touchstart(it){
-        this.startNum = ++this.startNum;
-        this.start = this.$store.state.scroll;
-        this.startTime = +new Date();
-        const that = this;
-        this.timer = setTimeout(function(){
-          // 长按事件
-          that.showExp = true;
-          if(it.explains){
-            that.message.title = it.description || it.name;
-            that.message.text = it.explains;
-          }else{
-            that.message.title = "";
-            that.message.text = "暂无资料";
-          }
-          this.startNum = 0
-        },600)
+      closeTip(){
+        this.showExp = false;
+        this.message.title = '';
+        this.message.text = '';
       },
       formatData(data){
         data.length=data.length>10?10:data.length;
@@ -100,6 +92,32 @@
       selectResult(item,idx){
         this.$emit('selectUsual',item,idx);
         this.$store.commit('setSearchShow', false);
+        let obj = {
+              "labelName": item.tagName,//标签名称
+              "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(){
 
@@ -117,8 +135,9 @@
     },
     components:{
       Radio,
-      ConfirmBox,
-      Search
+      // ConfirmBox,
+      Search,
+      Tiptoast
     }
   }
 </script>

+ 1 - 0
src/components/MainPage.vue

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

+ 17 - 0
src/store.js

@@ -59,8 +59,25 @@ const store = new Vuex.Store({
       "3": 0,
       "52": 0,
     },
+    addBuriedSomeList:[],//买点数据
   },
   mutations:{
+    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
+        }else{
+          ++num
+        }
+      }
+      if(num == list.length){//没有新增一项
+        list.push(item)
+      }
+      console.log(list)
+      state.addBuriedSomeList=list
+    },
     setFinish(state,param){
       let obj = state.finish
       let obj1 = state.currentTab

+ 4 - 0
src/utils/api.js

@@ -16,6 +16,7 @@ const urls = {
   getTagInfos:'/api/prec/retrieval/getTagInfos',//检索
   signIn:'/api/prec/patientInfo/signIn',//登录
   getDisclaimerInformations:'/api/prec/disclaimerInformation/getDisclaimerInformations',//配置文案
+  saveBuriedSome:'/api/prec/statistical/saveBuriedSome',//埋点
   // uploadImageThums:'http://192.168.3.1:8849/file/uploadImageThums',//多个文件上传同时生成缩略图
 }
 
@@ -23,6 +24,9 @@ export default {
   getDisclaimerInformations(){
     return axios.post(urls.getDisclaimerInformations)
   },
+  saveBuriedSome(param){
+    return axios.post(urls.saveBuriedSome,param)
+  },
   getHospitalDatas(param){
     return axios.post(urls.getHospitalDatas,param)
   },