瀏覽代碼

页面缓存后期优化

Shannon_mu 3 年之前
父節點
當前提交
9112370a6c

+ 30 - 29
operationSupport/src/components/common/Home.vue

@@ -9,20 +9,21 @@
 <template>
     <div class="dmp-app">
         <v-sidebar></v-sidebar>
-        <div class="dmp-content" :style="{width: collapse ? 'calc(100% - 85px)' : 'calc(100% - 220px)'}">
+        <div class="dmp-content" :style="{ width: collapse ? 'calc(100% - 85px)' : 'calc(100% - 220px)' }">
             <v-head></v-head>
-                <div class="main-wrap">
-                    <transition name="move" mode="out-in">
-                        <keep-alive :include="tagsList">
+            <div class="main-wrap">
+                <transition name="move" mode="out-in">
+                    <!-- <keep-alive :include="tagsList">
                             <router-view></router-view>
-                        </keep-alive>
-                    </transition>
-                </div>          
+                        </keep-alive> -->
+                    <router-view></router-view>
+                </transition>
+            </div>
         </div>
         <xk-modal></xk-modal>
         <div class="dmp-alert" v-if="popupsList.length !== 0">
             <div class="dmp-alert-body" v-for="item in popupsList" :key="item.id">
-             <alert-modal :params="item"></alert-modal>
+                <alert-modal :params="item"></alert-modal>
             </div>
         </div>
     </div>
@@ -34,41 +35,41 @@ import vSidebar from './Sidebar.vue';
 import vTags from './Tags.vue';
 export default {
     data() {
-        return {
-        };
+        return {};
     },
-    computed:{
-        collapse(){
-            return this.$store.getters['getCollapse']
+    computed: {
+        collapse() {
+            return this.$store.getters['getCollapse'];
         },
-        tagsList(){
-            let arr = [],msg=this.$store.getters['getTagsList'];
+        tagsList() {
+            let arr = [],
+                msg = this.$store.getters['getTagsList'];
             for (let i = 0, len = msg.length; i < len; i++) {
                 msg[i].name && arr.push(msg[i].name);
             }
             return arr;
         },
-         popupsList() {
-          return this.$store.getters.getPopups;
+        popupsList() {
+            return this.$store.getters.getPopups;
         }
     },
-    methods:{
-         beforeunloadHandler() {
+    methods: {
+        beforeunloadHandler() {
             //页面刷新
-            let taglist=this.$store.getters['getTagsList']||[]
-            sessionStorage.setItem("tabs", JSON.stringify(taglist));
+            let taglist = this.$store.getters['getTagsList'] || [];
+            sessionStorage.setItem('tabs', JSON.stringify(taglist));
         },
         // 获取用户权限
         getElement() {
-            this.$http.post("/sc-user-center/menu/selectAuthCode").then(res => {
+            this.$http.post('/sc-user-center/menu/selectAuthCode').then((res) => {
                 let data = res.data || [];
-                this.$store.commit("setPermissionList", new Set(data));
-                console.log("获取到的权限标识为",data)
+                this.$store.commit('setPermissionList', new Set(data));
+                console.log('获取到的权限标识为', data);
             });
         },
         beforeunload() {
-            window.addEventListener('beforeunload', this.beforeunloadHandler, false)
-        },
+            window.addEventListener('beforeunload', this.beforeunloadHandler, false);
+        }
     },
     components: {
         vHead,
@@ -77,14 +78,14 @@ export default {
     },
     created() {
         this.getElement();
-        this.$store.dispatch("tags", JSON.parse(sessionStorage.getItem("tabs")) || []);
+        this.$store.dispatch('tags', JSON.parse(sessionStorage.getItem('tabs')) || []);
     },
     mounted() {
         this.beforeunload();
     },
     destroyed() {
-     window.removeEventListener('beforeunload', this.beforeunloadHandler, false);
-  }
+        window.removeEventListener('beforeunload', this.beforeunloadHandler, false);
+    }
 };
 </script>
 <style lang='scss' scoped>

+ 2 - 0
operationSupport/src/views/buildingManagement/pageJump/addoredit.vue

@@ -724,6 +724,8 @@ export default {
                     if (data.buildingUnitList.length !== 0) {
                         this.formdata = data;
                         this.formdata.householdsPerFloor = data.buildingUnitList[0].unitFloorList[0].roomList.length;
+                        
+                        debugger;
                         this.initialUnitList = {
                             checkedUnit: false,
                             enableUnit: 1, //勾选了复选框