Explorar el Código

4. 智能开方页 侧边栏默认展开

cc12458 hace 1 año
padre
commit
bcfea95f80
Se han modificado 1 ficheros con 3 adiciones y 3 borrados
  1. 3 3
      src/utils/minix/prescribing.js

+ 3 - 3
src/utils/minix/prescribing.js

@@ -59,7 +59,7 @@ export default {
         })
         })
     },
     },
     mounted() {
     mounted() {
-        this.isShrink = window.localStorage.getItem('isShrink') == 0 ? false : true
+        this.isShrink = window.sessionStorage.getItem('isShrink') == 1
         this.getMaxMinDoaseNumber()
         this.getMaxMinDoaseNumber()
     },
     },
     methods: {
     methods: {
@@ -87,7 +87,7 @@ export default {
         // 设置收缩模式
         // 设置收缩模式
         setShrink() {
         setShrink() {
             this.isShrink = !this.isShrink
             this.isShrink = !this.isShrink
-            window.localStorage.setItem('isShrink', this.isShrink ? 1 : 0)
+            window.sessionStorage.setItem('isShrink', this.isShrink ? 1 : 0)
             this.setWidth()
             this.setWidth()
         },
         },
         // 
         // 
@@ -99,7 +99,7 @@ export default {
                 document.body.style.width = '1280px'
                 document.body.style.width = '1280px'
             }
             }
             if (width < 800) {
             if (width < 800) {
-                let isShrink = window.localStorage.getItem('isShrink')
+                let isShrink = window.sessionStorage.getItem('isShrink')
                 isShrink = Number(isShrink)
                 isShrink = Number(isShrink)
                 if (!isShrink) {
                 if (!isShrink) {
                     // 扩展状态
                     // 扩展状态