Parcourir la source

内容改变重新计算页面高度

luolei il y a 5 ans
Parent
commit
83523fd9b5

+ 1 - 1
build/webpack.dev.conf.js

@@ -34,7 +34,7 @@ const devWebpackConfig = merge(baseWebpackConfig, {
     compress: true,
     // host: HOST || config.dev.host,
     // host: '192.168.3.6',
-    host: '192.168.1.106',
+    host: '192.168.1.103',
     port: PORT || config.dev.port,
     open: config.dev.autoOpenBrowser,
     overlay: config.dev.errorOverlay

+ 0 - 2
src/common/Label.vue

@@ -83,7 +83,6 @@ import {moduleCP} from '@utils/tools';
           return
         }
         this.showToast = true;
-        this.$emit("commitShowLabel",false)
         // 底部body不可滑动
         // const prehandler = function(e){e.preventDefault();}
         // document.body.addEventListener("touchmove",prehandler,false)
@@ -129,7 +128,6 @@ import {moduleCP} from '@utils/tools';
       cancelDel(){
         this.showToast = false;
         this.tempItem = {};
-        this.$emit("commitShowLabel",true)
       }
     }
   }

+ 4 - 4
src/common/MultiLineInput.vue

@@ -12,14 +12,14 @@
               v-model="item.value"
               :placeholder="item.placeholder"
               @input="changeVal($event,idx,content.type)" 
-              @blur="blur" 
+              @blur="blur"
               @click="handleClick">
             <input v-show="content.iptLis.length==1" class="contentVal" 
               :type="content.type=='number'?'tel':'text'" 
               :placeholder="content.placeholder" 
               v-model="item.value" 
               @input="changeVal($event,idx,content.type)" 
-              @blur="blur" 
+              @blur="blur"
               @click="handleClick">
             <span v-if="idx == 0&&content.iptLis.length>1">/</span>
           </template>
@@ -52,7 +52,7 @@ export default {
     select:{ //是否选中
       default:false,
       type:Boolean
-    },
+    }
   },
   data(){
     return {
@@ -92,7 +92,7 @@ export default {
     },
     handleClick(e){
       // 点击输入框时不选中该项
-      document.activeElement.scrollIntoViewIfNeeded(true);
+      // document.activeElement.scrollIntoViewIfNeeded(true);
       e.stopPropagation();
     }
   },

+ 11 - 2
src/components/AddContent.vue

@@ -70,7 +70,8 @@ export default {
       imgUrl:imageUrlPrefix,
       dataTrd: [],
       val: '',
-      allStr:''
+      allStr:'',
+      scroll:null
     }
   },
   created(){
@@ -78,10 +79,15 @@ export default {
   },
   mounted() {
     this.$nextTick(()=>{
-      this.scroll = setScroll(BScroll,true,'.addper')
+      let scroll = setScroll(BScroll,true,'.addper')
+      this.scroll = scroll
+      scroll.on('scroll', this.onScroll)
     })
   },
   methods: {
+    onScroll() {
+      document.activeElement.scrollIntoViewIfNeeded(true);        
+    },
     back() {
       this.$emit("back");
     },
@@ -121,6 +127,9 @@ export default {
       // console.log(allData.filter((item) => item.type == 52))
       this.allStr=getAllStr({data:tmpTrdData&&tmpTrdData[0].moduleDetailDTOList,type:this.allMoudles&&this.allMoudles.type}).allStr
       this.$store.commit('setDataAll',{data:data,idx:idx});
+      this.$nextTick(()=>{
+        this.scroll.refresh()
+      })
     },
   },
   components: {

+ 4 - 0
src/components/DetailBox.vue

@@ -65,6 +65,7 @@
         setTimeout(() => {
           let scroll = setScroll(BScroll,true,'.viewPrew')
           this.scroll = scroll
+          scroll.on('scroll', this.onScroll)
         }, 400);
         // fixedKeyboard();//给Window绑定事件
       })
@@ -75,6 +76,9 @@
       // $('body').css({'height':'100%','overflow-y':'auto'})
     },
     methods:{
+      onScroll() {
+        document.activeElement.scrollIntoViewIfNeeded(true);        
+      },
       close(){
         this.$emit("close");
       },

+ 13 - 11
src/components/DiagTreat.vue

@@ -13,7 +13,6 @@
               :ppId="it.id"
               :moduleType="datas.type"
               dom=".treatper"
-              @commitShowLabel="commitShowLabel"
               @setDetail="setDetail"/>
         <!-- 上传图片 -->
         <UploadImg v-if="it.controlType==4" 
@@ -99,21 +98,21 @@
         show:false,
         ppId:null,
         imgUrl:imageUrlPrefix,
+        scroll:null
       }
     },
     props:['datas','preName','nextName','modluesLen'],
     mounted(){
-      let scroll = setScroll(BScroll,true,'.treatper')
-      this.scroll = scroll
-      scroll.on('scroll', this.onScroll)
+      this.$nextTick(()=>{
+        let scroll = setScroll(BScroll,true,'.treatper')
+        this.scroll = scroll
+        scroll.on('scroll', this.onScroll)
+      })
     },
     methods:{
-      onScroll(pos) {
+      onScroll() {
         document.activeElement.scrollIntoViewIfNeeded(true);        
       },
-      commitShowLabel(flg){
-        this.scroll = setScroll(BScroll,flg,'.treatper')
-      },
       beBack(){
         this.$emit('back');
       },
@@ -128,20 +127,20 @@
         this.labelDetail = obj.detail;
         this.ppId = obj.ppId;
         this.show = true;
-        this.scroll = setScroll(BScroll,false,'.treatper')
       },
       complete(){
         this.show = false;
         this.labelDetail = {};
         this.ppId = null;
         // 处理明细选中的值
-        this.scroll = setScroll(BScroll,true,'.treatper')
+        this.$nextTick(()=>{
+          this.scroll.refresh()
+        })
       },
       closeDetal(){
         this.show = false;
         this.labelDetail = {};
         this.ppId = null;
-        this.scroll = setScroll(BScroll,true,'.treatper')
       },
       getText(){
         let textArr = this.checkText;
@@ -168,6 +167,9 @@
         }
         this.$store.commit('setDatas',{type:moduleCP['diagT'],data:data,pId:data.id,ppId:id});
         this.$store.commit('setText',{type:moduleCP['diagT'],text:data.value.replace(patt,'').replace(/\#\{/g,'').replace(/\}/g,''),textP:data.valueP.replace(patt,'').replace(/\#\{/g,'').replace(/\}/g,''),pId:data.id,flag:true}); 
+        this.$nextTick(()=>{
+          this.scroll.refresh()
+        })
       }
     },
     components:{

+ 15 - 23
src/components/Others.vue

@@ -63,23 +63,6 @@
               v-if="labelDetail.questionMapping&&labelDetail.questionMapping.length>0"
               @pComplete="complete"/>
     </div>
-    
-      <div class="foot" v-if="modluesLen==3&&!nextName||modluesLen==2">
-        <span class="back" @click="beBack">{{'返回'+ preName}}</span>
-        <span class="next" @click="toNext">{{'预览并提交病历'}}</span>
-      </div>
-      <div class="foot" v-else>
-        <span class="back" @click="beBack">{{'返回'+ preName}}</span>
-        <span class="next" @click="toNext">{{'进入'+ nextName}}</span>
-      </div>
-      <div class="detail" v-if="show">
-        <DetailBox @close="closeDetal" 
-                :data="labelDetail" 
-                :moduleType="datas.type"
-                :ppId="ppId"
-                v-if="labelDetail.questionMapping&&labelDetail.questionMapping.length>0"
-                @pComplete="complete"/>
-      </div>
   </div>
 </template>
 <script type="text/javascript">
@@ -114,10 +97,16 @@
     props:['datas','preName','nextName','modluesLen'],
     created(){},
     mounted(){
-      let scroll = setScroll(BScroll,true,'.otherper')
-      this.scroll = scroll
+      this.$nextTick(()=>{
+        let scroll = setScroll(BScroll,true,'.otherper')
+        this.scroll = scroll
+        scroll.on('scroll', this.onScroll)
+      })
     },
     methods:{
+      onScroll() {
+        document.activeElement.scrollIntoViewIfNeeded(true);
+      },
       beBack(){
         this.$emit('back');
       },
@@ -132,21 +121,20 @@
         this.labelDetail = obj.detail;
         this.ppId = obj.ppId;
         this.show = true;
-        
-        this.scroll = setScroll(BScroll,false,'.otherper')
       },
       complete(){
         this.show = false;
         this.labelDetail = {};
         this.ppId = null;
         // 处理明细选中的值
-        this.scroll = setScroll(BScroll,true,'.otherper')
+        this.$nextTick(()=>{
+          this.scroll.refresh()
+        })
       },
       closeDetal(){
         this.show = false;
         this.labelDetail = {};
         this.ppId = null;
-        this.scroll = setScroll(BScroll,true,'.otherper')
       },
       updataData(data,id,index){//输入框存值
         let list = this.dtoList;
@@ -165,6 +153,10 @@
         // this.$store.commit('setOrigin',{type:'3',data:data,pId:data.id});
         this.$store.commit('setDatas',{type:moduleCP['other'],data:data,pId:data.id,ppId:id});
         this.$store.commit('setText',{type:moduleCP['other'],text:data.value.replace(patt,'').replace(/\#\{/g,'').replace(/\}/g,''),textP:data.valueP.replace(patt,'').replace(/\#\{/g,'').replace(/\}/g,''),pId:data.id,flag:true}); 
+        
+        this.$nextTick(()=>{
+          this.scroll.refresh()
+        })
       },
       getText(){
         let textArr = this.checkText;

+ 11 - 8
src/components/Symptom.vue

@@ -121,10 +121,16 @@ export default {
     }
   },
   mounted(){
-    let scroll = setScroll(BScroll,true,'.symper')
-    this.scroll = scroll
+    this.$nextTick(()=>{
+      let scroll = setScroll(BScroll,true,'.symper')
+      this.scroll = scroll
+      scroll.on('scroll', this.onScroll)
+    })
   },
   methods: {
+    onScroll() {
+      document.activeElement.scrollIntoViewIfNeeded(true);        
+    },
     searchVal(val) {
       console.log(val)
     },
@@ -179,7 +185,6 @@ export default {
             this.$store.commit('setOrigin', { type: moduleCP['symp'], data: result.data });
             if (mapping && mapping.length > 0) {
               this.show = true;
-              // this.scroll = setScroll(BScroll,false,'.symper')
               if(flg){
                 return
               }
@@ -229,7 +234,6 @@ export default {
       this.getPush(sympText);
       this.show = false;
       this.questId = null;
-      // this.scroll = setScroll(BScroll,true,'.symper')
     },
     deletSymp(item, index) {
       this.delIndex = index;
@@ -238,7 +242,6 @@ export default {
         this.delText = "是否删除该信息?<br/>删除后将重新填写预问诊流程 <br/>(已填内容将清除)"
       }
       this.showToast = true;
-      // this.scroll = setScroll(BScroll,false,'.symper')
     },
     comfirnDel() {
       this.chooseSymp.splice(this.delIndex, 1);
@@ -263,17 +266,18 @@ export default {
       this.delIndex = null;
       this.questId = null;
       this.delText = "是否删除该信息?<br/>(已填内容将清除)";
-      // this.scroll = setScroll(BScroll,true,'.symper')
     },
     complete() {//明细填写完成
       this.searchShow = false;
       this.checkText = this.$store.state.symptom.text;
       this.show = false;
-      // this.scroll = setScroll(BScroll,true,'.symper')
       this.questId = null;
       // 推理 
       const sympText = this.getSympText();
       this.getPush(sympText);
+      this.$nextTick(()=>{
+        this.scroll.refresh()
+      })
     },
     showChecked(item) {
       const origin = this.$store.state.symptom.origin;
@@ -282,7 +286,6 @@ export default {
       if (data&&data.questionMapping && data.questionMapping.length > 0) {
         this.labelDetail = data;
         this.show = true;
-        // this.scroll = setScroll(BScroll,true,'.symper')        
       }
     },
     reload(id) {//清空重新赋值