Quellcode durchsuchen

Merge branch 'syf-scale1220' into test

1178232204@qq.com vor 3 Jahren
Ursprung
Commit
b151da82f9
5 geänderte Dateien mit 91 neuen und 61 gelöschten Zeilen
  1. 62 47
      src/App.vue
  2. 1 1
      src/components/MainPage.vue
  3. 1 1
      src/components/PathInfo.vue
  4. 11 4
      src/components/ScaleDetail.vue
  5. 16 8
      src/router/index.js

+ 62 - 47
src/App.vue

@@ -1,61 +1,76 @@
 <template>
   <div>
-    <p class="pc-enter" v-if="!isMobile&&!isScaleShow">请在手机端访问</p>
+    <p class="pc-enter" v-if="!isMobile && !isScaleShow">请在手机端访问</p>
     <div v-else id="app">
-        <router-view/>
-        <portal-target name="notification-outlet"></portal-target>
-        <portal-target name="notification-detail"></portal-target>
-        <portal-target name="notification-search"></portal-target>
-        <portal-target name="notification-usual"></portal-target>
-        <portal-target name="notification-head"></portal-target>
+      <keep-alive>
+        <router-view v-if="$route.meta.keepAlive"></router-view>
+      </keep-alive>
+      <router-view v-if="!$route.meta.keepAlive">
+      </router-view>
+      <!-- <router-view/> -->
+      <portal-target name="notification-outlet"></portal-target>
+      <portal-target name="notification-detail"></portal-target>
+      <portal-target name="notification-search"></portal-target>
+      <portal-target name="notification-usual"></portal-target>
+      <portal-target name="notification-head"></portal-target>
     </div>
   </div>
 </template>
 <script>
-  export default {
-    name:'App',
-    data:()=>{
-      return{
-        isMobile:/(iPhone|iPad|iPod|iOS|Android|SymbianOS|Windows Phone)/i.test(navigator.appVersion),
-        isScaleShow:false,
+export default {
+  name: "App",
+  data: () => {
+    return {
+      isMobile: /(iPhone|iPad|iPod|iOS|Android|SymbianOS|Windows Phone)/i.test(
+        navigator.appVersion
+      ),
+      isScaleShow: false,
+    };
+  },
+  watch: {
+    $route(to, from) {
+      console.log(to, from);
+      if (to.path !== "/ScaleShow") {
+        this.isScaleShow = false;
       }
     },
-    watch:{
-      $route(to,from){
-        console.log(to,from)
-        if(to.path!=="/ScaleShow"){
-          this.isScaleShow = false;
-        }
-      }
-    },
-    mounted(){
-      const isShow = this.$route.path==="/ScaleShow";
-      this.isScaleShow = isShow;
-      //console.log(isScaleShow,this.$route)
-      if(!this.isMobile&&!isShow){
-        return;
-      }
-      (/iphone|ipod|ipad/i.test(navigator.appVersion)) && document.addEventListener('blur', (e) => {
-        // 这里加了个类型判断,因为a等元素也会触发blur事件
-        if(['input', 'textarea'].includes(e.target.localName)) {
-        // if(MobileDevice.getModels().join(' or ').indexOf('6') == -1){
-        //   document.activeElement.scrollIntoView({behavior: "smooth",block:'end'})
-        // }
-          setTimeout(()=> {
-            document.scrollingElement.scrollTo(0, document.scrollingElement.scrollTop);
-          }, 100);
-        }
-      }, true)
-    },
-  }
+  },
+  mounted() {
+    const isShow = this.$route.path === "/ScaleShow";
+    this.isScaleShow = isShow;
+    //console.log(isScaleShow,this.$route)
+    if (!this.isMobile && !isShow) {
+      return;
+    }
+    /iphone|ipod|ipad/i.test(navigator.appVersion) &&
+      document.addEventListener(
+        "blur",
+        (e) => {
+          // 这里加了个类型判断,因为a等元素也会触发blur事件
+          if (["input", "textarea"].includes(e.target.localName)) {
+            // if(MobileDevice.getModels().join(' or ').indexOf('6') == -1){
+            //   document.activeElement.scrollIntoView({behavior: "smooth",block:'end'})
+            // }
+            setTimeout(() => {
+              document.scrollingElement.scrollTo(
+                0,
+                document.scrollingElement.scrollTop
+              );
+            }, 100);
+          }
+        },
+        true
+      );
+  },
+};
 </script>
 <style lang="less">
-  @import "./less/index.less";
-  .pc-enter{
-    margin: 20px 0 0;
-    text-align: center;
-    font-size: 14px;
-  }
+@import "./less/index.less";
+.pc-enter {
+  margin: 20px 0 0;
+  text-align: center;
+  font-size: 14px;
+}
 </style>
 
 

+ 1 - 1
src/components/MainPage.vue

@@ -368,7 +368,7 @@ export default {
     previewRes() {
       if (
         (this.userInfo.hospitalDeptName == "呼吸内科/咳嗽/戒烟门诊xs" ||
-          this.userInfo.hospitalDeptName == "呼吸内科/咳嗽/戒烟门诊") &&
+          this.userInfo.hospitalDeptName == "全科") &&
         !this.scaleInfo
       ) {
         this.showToast = true;

+ 1 - 1
src/components/PathInfo.vue

@@ -55,7 +55,7 @@
         @click="goScale"
         v-if="
           pathInfo.hospitalDeptName == '呼吸内科/咳嗽/戒烟门诊xs' ||
-          pathInfo.hospitalDeptName == '呼吸内科/咳嗽/戒烟门诊'
+          pathInfo.hospitalDeptName == '全科'
         "
       >
         <img src="../images/scale.png" />

+ 11 - 4
src/components/ScaleDetail.vue

@@ -11,7 +11,7 @@
         :key="index"
       >
         <p><i>*</i>{{ item.title }}</p>
-        <van-radio-group v-model="item.checked" >
+        <van-radio-group v-model="item.checked">
           <van-radio
             v-for="(it, i) in item.scaleList"
             :key="i"
@@ -45,11 +45,15 @@ export default {
       showToast: false,
       message: "量表填写成功,预问诊未填写是否去填写?",
       isSure: false,
-      score:0
+      score: 0,
     };
   },
   mounted() {
-    this.list = JSON.parse(JSON.stringify(data.asthmaScale));
+    if (this.scaleList) {
+      this.list = JSON.parse(JSON.stringify(scaleList[0].dataJson));
+    } else {
+      this.list = JSON.parse(JSON.stringify(data.asthmaScale));
+    }
   },
   components: {
     Toast,
@@ -57,6 +61,7 @@ export default {
   computed: {
     ...mapState({
       istrue: (state) => state.istrue,
+      scaleList: (state) => state.scaleList,
     }),
   },
   methods: {
@@ -78,16 +83,19 @@ export default {
     },
     goback() {
       this.$router.go(-1);
+      
     },
     comfirn() {
       this.$router.push({
         path: "/tab",
       });
+      this.showToast = false
     },
     cancel() {
       this.$router.push({
         path: "/preview",
       });
+      this.showToast = false
     },
     submit() {
       let top, errorDiv;
@@ -106,7 +114,6 @@ export default {
               score: this.getscore(),
             },
           ];
-          console.log(scaleList);
           this.$store.commit("saveScaleInfo", scaleList);
           if (this.istrue) {
             this.$router.push({

+ 16 - 8
src/router/index.js

@@ -20,7 +20,8 @@ const router = new Router({
       path:'/',
       name:'Login',
       meta:{
-        title:'智能预问诊'
+        title:'智能预问诊',
+        keepAlive: false,
       },
       component:Login
     },
@@ -28,7 +29,8 @@ const router = new Router({
       path:'/home',
       name:'PathInfo',
       meta:{
-        title:'挂号详情'
+        title:'挂号详情',
+        keepAlive: false,
       },
       component:PathInfo
     },
@@ -36,7 +38,8 @@ const router = new Router({
       path:'/tab',
       name:'MainPage',
       meta:{
-        title:'智能预问诊'
+        title:'智能预问诊',
+        keepAlive: false,
       },
       component:MainPage,
       /*children:[
@@ -63,7 +66,8 @@ const router = new Router({
       path:'/department',
       name:'Department',
       meta:{
-        title:'挂号信息'
+        title:'挂号信息',
+        keepAlive: false,
       },
       component:Department
     },
@@ -71,7 +75,8 @@ const router = new Router({
       path:'/preview',
       name:'Preview',
       meta:{
-        title:'预览病历'
+        title:'预览病历',
+        keepAlive: false,
       },
       component:Preview
     },
@@ -79,7 +84,8 @@ const router = new Router({
       path:'/chooseScale',
       name:'chooseScale',
       meta:{
-        title:'量表'
+        title:'量表',
+        keepAlive: false,
       },
       component:ChooseScale
     },
@@ -87,7 +93,8 @@ const router = new Router({
       path:'/scaleDetail',
       name:'scaleDetail',
       meta:{
-        title:'量表评估'
+        title:'量表评估',
+        keepAlive: true,
       },
       component:ScaleDetail
     },
@@ -95,7 +102,8 @@ const router = new Router({
       path:'/scaleShow',
       name:'scaleShow',
       meta:{
-        title:'量表详情'
+        title:'量表详情',
+        keepAlive: false,
       },
       component:ScaleShow
     }