luolei 5 лет назад
Родитель
Сommit
a9894615ca

+ 1 - 1
src/App.vue

@@ -1,5 +1,5 @@
 <template>
-    <div id="app" onresize="document.activeElement.scrollIntoView(true);">
+    <div id="app">
         <router-view/>
         <portal-target name="notification-outlet"></portal-target>
         <portal-target name="notification-detail"></portal-target>

+ 6 - 2
src/common/CheckBox.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="check-wrap" v-if="item">
     <!-- <img :src="datas.url.replace('{imageUrlPrefix}',imgUrl)" v-if="datas.url"> -->
-    <p v-for="(it,index) in datas.questionDetailList" :key="it.id" class="list" @click="handleClick(it,index)">
+    <p v-for="(it,index) in datas.questionDetailList" :key="it.id" class="list" @click="handleClick(it,index,'',true)">
       <img :src="it.select==1?check:defaultPic">
       <!-- <span :class="{'check':it.select==1}">{{it.name}}</span> -->
       <span v-if="((it.description||it.name).indexOf('${'))==-1" :class="[{'check':it.select==1},{'exclu':exclusion !==999 && it.exclusion !== exclusion}]">{{it.description||it.name}}</span>
@@ -47,13 +47,17 @@ import OptionInp from '../common/OptionInp.vue';
       this.resetExc();
     },
     methods:{
-      handleClick(it,index,flag){
+      handleClick(it,index,flag,flg){
         const that = this;
         const list = this.datas;
         let data = list.questionDetailList&&list.questionDetailList.slice(0);
         // 处理互斥
         const excluArr = data.filter(it=>it.exclusion==1);
         const filArr = data.filter(it=>it.select==1);
+        if(flg){
+          document.activeElement.blur();
+          document.activeElement.scrollIntoViewIfNeeded(true);
+        }
         if(excluArr.length>0){//有互斥
           if(filArr.length>0){//有选中
             if(it.exclusion !== filArr[0].exclusion){

+ 6 - 2
src/common/Input.vue

@@ -24,12 +24,16 @@
         if(this.item.controlType==7){//数字键盘
           this.val = e.target.value=e.target.value.replace(/[^\d]/g,'')
         }
-      },
-      blur(){
         document.activeElement.scrollIntoViewIfNeeded(true);
         this.borColor = false;
         const newData = Object.assign({},this.item,{value:this.val,valueP:this.val});
         this.$emit("updata",newData);
+      },
+      blur(){
+        document.activeElement.scrollIntoViewIfNeeded(true);
+        // this.borColor = false;
+        // const newData = Object.assign({},this.item,{value:this.val,valueP:this.val});
+        // this.$emit("updata",newData);
       }
     },
     watch:{

+ 6 - 2
src/common/Label.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="label-wrap" v-if="item">
-    <p v-for="(it,index) in datas.questionMapping" :key="it.id" :class="['symp',{'check':it.select==1},{'exclu':exclusion !==999 && it.exclusionType !== exclusion}]" @click="handleClick(it,index)">
+    <p v-for="(it,index) in datas.questionMapping" :key="it.id" :class="['symp',{'check':it.select==1},{'exclu':exclusion !==999 && it.exclusionType !== exclusion}]" @click="handleClick(it,index,true)">
       <span>{{it.description||it.name}}</span>
       <!-- <span v-if="it.select==1" @click="deletSymp($event,it,index)"><img src="../images/delete.png" alt=""></span> -->
       <span v-if="it.select==1" @click="deletSymp($event,it,index)"><img src="../images/del.png" alt=""></span>
@@ -40,10 +40,14 @@ import {moduleCP} from '@utils/tools';
       Toast
     },
     methods:{
-      handleClick(it,index){
+      handleClick(it,index,flg){
         const arr = this.datas.questionMapping;
         const excluArr = arr.filter(it=>it.exclusionType==1);
         const filArr = arr.filter(it=>it.select==1);
+        if(flg){
+          document.activeElement.blur();
+          document.activeElement.scrollIntoViewIfNeeded(true);
+        }
         if(excluArr.length>0){//有互斥
           if(filArr.length>0){//有选中
             if(it.exclusionType !== filArr[0].exclusionType){

+ 1 - 0
src/common/Radio.vue

@@ -53,6 +53,7 @@ import OptionInp from '../common/OptionInp.vue';
         this.$emit("updata",newData);
         if(flg){
           document.activeElement.blur();
+          document.activeElement.scrollIntoViewIfNeeded(true);
         }
       },
       inpVal(val,index){//输入框失焦处理  

+ 1 - 1
src/components/AddContent.vue

@@ -142,7 +142,7 @@ export default {
   font-size: 0.3rem;
   overflow: hidden;
   .content {
-    padding-right: .3rem;
+    // padding-right: .3rem;
   }
   .btscroll;  
   h3 {

+ 4 - 2
src/components/DetailBox.vue

@@ -62,8 +62,10 @@
         if(hasCheck){
           this.checkF = true;
         }
-        let scroll = setScroll(BScroll,true,'.viewPrew')
-        this.scroll = scroll
+        setTimeout(() => {
+          let scroll = setScroll(BScroll,true,'.viewPrew')
+          this.scroll = scroll
+        }, 400);
         // fixedKeyboard();//给Window绑定事件
       })
     },

+ 4 - 0
src/components/DiagTreat.vue

@@ -105,8 +105,12 @@
     mounted(){
       let scroll = setScroll(BScroll,true,'.treatper')
       this.scroll = scroll
+      scroll.on('scroll', this.onScroll)
     },
     methods:{
+      onScroll(pos) {
+        document.activeElement.scrollIntoViewIfNeeded(true);        
+      },
       commitShowLabel(flg){
         this.scroll = setScroll(BScroll,flg,'.treatper')
       },

+ 3 - 1
src/utils/tools.js

@@ -270,7 +270,9 @@ function concatVal(data){
 function setScroll(scroll,flg,wrapper){
   return new scroll(wrapper?wrapper:'.wrapper',{
       scrollY: flg,
-      click: true
+      click: true,
+      probeType:3,
+      bounceTime:500
   })
 }
 module.exports =  {