Pārlūkot izejas kodu

Merge branch 'feature/Feature-copy' into develop

howie 2 gadi atpakaļ
vecāks
revīzija
3a958a9d5e

+ 4 - 4
src/App.vue

@@ -6,15 +6,15 @@
 
 <script>
 export default {
-  name: "App",
+  name: 'App',
   data() {
     return {
 
-    };
+    }
   },
 
-  methods:{
+  methods: {
 
   }
-};
+}
 </script>

+ 15 - 9
src/layout/components/AppMain.vue

@@ -1,26 +1,32 @@
 <template>
   <section class="app-main">
     <transition name="fade-transform" mode="out-in">
-    <router-view />
+      <keep-alive
+        v-if="$route.name"
+      >
+        <router-view
+          :key="$route.name
+          "
+        />
+      </keep-alive>
+      <router-view v-else />
     </transition>
   </section>
 </template>
 
 <script>
 export default {
-  name: "AppMain",
+  name: 'AppMain',
   computed: {
     cachedViews() {
-
-      return this.$store.state.tagsView.cachedViews;
+      return this.$store.state.tagsView.cachedViews
     },
     key() {
+      return this.$route.path
+    }
+  }
 
-      return this.$route.path;
-    },
-  },
-
-};
+}
 </script>
 
 <style scoped>

+ 133 - 139
src/permission.js

@@ -1,79 +1,78 @@
-import router from "./router";
-import { resetRouter } from "./router";
-import store from "./store";
-import { Message } from "element-ui";
-import NProgress from "nprogress"; // progress bar
-import "nprogress/nprogress.css"; // progress bar style
-import { getToken } from "@/utils/auth"; // get token from cookie
-import getPageTitle from "@/utils/get-page-title";
-import Layout from "@/layout";
-const _import = require("./router/_import_" + process.env.NODE_ENV); // 获取组件的方法
+import router from './router'
+import { resetRouter } from './router'
+import store from './store'
+import { Message } from 'element-ui'
+import NProgress from 'nprogress' // progress bar
+import 'nprogress/nprogress.css' // progress bar style
+import { getToken } from '@/utils/auth' // get token from cookie
+import getPageTitle from '@/utils/get-page-title'
+import Layout from '@/layout'
+const _import = require('./router/_import_' + process.env.NODE_ENV) // 获取组件的方法
 
-NProgress.configure({ showSpinner: false }); // NProgress Configuration
+NProgress.configure({ showSpinner: false }) // NProgress Configuration
 
-const whiteList = ["/login"]; // no redirect whitelist
+const whiteList = ['/login'] // no redirect whitelist
 
-router.beforeEach(async (to, from, next) => {
+router.beforeEach(async(to, from, next) => {
   // start progress bar
-  NProgress.start();
+  NProgress.start()
 
   // set page title
-  document.title = getPageTitle(to.meta.title);
+  document.title = getPageTitle(to.meta.title)
 
   // determine whether the user has logged in
-  const hasToken = getToken();
+  const hasToken = getToken()
   if (hasToken) {
-    if (to.path === "/login") {
+    if (to.path === '/login') {
       // if is logged in, redirect to the home page
-      next({ path: "/" });
-      NProgress.done();
+      next({ path: '/' })
+      NProgress.done()
     } else {
-      const hasGetUserInfo = store.getters.name;
+      const hasGetUserInfo = store.getters.name
       if (hasGetUserInfo) {
-        next();
+        next()
       } else {
         try {
           // get user info
-          await store.dispatch("user/getInfo");
+          await store.dispatch('user/getInfo')
 
           // 请求获取路由表
-          await store.dispatch("user/getRouter");
+          await store.dispatch('user/getRouter')
           if (store.getters.menus.length < 1) {
-            global.antRouter = [];
-            next();
+            global.antRouter = []
+            next()
           }
 
           // 设置路由
-          var newRoutes = [];
+          var newRoutes = []
 
           for (var route of store.getters.menus) {
-
-            const item = buildRootRoute(route);
-            newRoutes.push(item);
+            const item = buildRootRoute(route)
+            newRoutes.push(item)
           }
-          console.log(newRoutes,'8589');
+          console.log(newRoutes, '8589')
           // newRoutes.shift();
           // 添加一项根目录重定向页面
-          if (newRoutes[0].path != "/") {
-            let path = newRoutes[0].path;
+          if (newRoutes[0].path !== '/') {
+            let path = newRoutes[0].path
             if (newRoutes[0].children.length > 0) {
-              path = `${path}/${newRoutes[0].children[0].path}`;
+              path = `${path}/${newRoutes[0].children[0].path}`
             }
             if (newRoutes[0].children[0].children.length > 0) {
-              path = `${path}/${newRoutes[0].children[0].children[0].path}`;
+              path = `${path}/${newRoutes[0].children[0].children[0].path}`
             }
             newRoutes.unshift({
-              path: "/",
+              path: '/',
               component: Layout,
-              redirect: path,
-            });
+              redirect: path
+            })
           } else {
-            newRoutes[0].redirect = "/dashboard";
+            newRoutes[0].redirect = '/dashboard'
           }
 
-          console.log(newRoutes);
-          router.addRoutes(newRoutes); // 2.动态添加路由
-          global.antRouter = newRoutes; // 3.将路由数据传递给全局变量,做侧边栏菜单渲染工作
+          console.log(newRoutes)
+          router.addRoutes(newRoutes) // 2.动态添加路由
+          global.antRouter = newRoutes // 3.将路由数据传递给全局变量,做侧边栏菜单渲染工作
 
           // const menus = filterAsyncRouter(store.getters.menus) // 1.过滤路由
           // console.log(menus);
@@ -81,16 +80,16 @@ router.beforeEach(async (to, from, next) => {
           // global.antRouter = menus // 3.将路由数据传递给全局变量,做侧边栏菜单渲染工作
           next({
             ...to,
-            replace: true,
-          });
+            replace: true
+          })
           // next()
         } catch (error) {
           // remove token and go to login page to re-login
-          await store.dispatch("user/resetToken");
-          Message.error(error || "Has Error");
+          await store.dispatch('user/resetToken')
+          Message.error(error || 'Has Error')
           next('/login')
           // next(`/login?redirect=${to.path}`);
-          NProgress.done();
+          NProgress.done()
         }
       }
     }
@@ -99,20 +98,20 @@ router.beforeEach(async (to, from, next) => {
 
     if (whiteList.indexOf(to.path) !== -1) {
       // in the free login whitelist, go directly
-      next();
+      next()
     } else {
       // other pages that do not have permission to access are redirected to the login page.
       // next(`/login?redirect=${to.path}`);
       next('/login')
-      NProgress.done();
+      NProgress.done()
     }
   }
-});
+})
 
 router.afterEach(() => {
   // finish progress bar
-  NProgress.done();
-});
+  NProgress.done()
+})
 
 // 遍历后台传来的路由字符串,转换为组件对象
 // function filterAsyncRouter(asyncRouterMap) {
@@ -134,148 +133,143 @@ router.afterEach(() => {
 // }
 
 function buildRootRoute(route) {
-  const { url, icon, moduleName, moduleId, code, type,fullUrl  } = route;
-  var item = {};
-  item.path = url;
-  item.component = Layout;
-  item.name = code;
+  const { url, icon, moduleName, moduleId, code, type, fullUrl } = route
+  var item = {}
+  item.path = url
+  item.component = Layout
+  item.name = fullUrl || code
   item.meta = {
     title: moduleName,
-    icon: icon,
-  };
-  if (code == "index") {
-    item.path = "/";
-    item.alwaysShow = false;
-    let children = route.children;
-    route.children = [];
+    icon: icon
+  }
+  if (code == 'index') {
+    item.path = '/'
+    item.alwaysShow = false
+    const children = route.children
+    route.children = []
     route.children.push({
-      code: "dashboard",
-      moduleName: "首页",
+      code: 'dashboard',
+      moduleName: '首页',
       type: 2,
-      url: "/dashboard",
-      children: children,
-    });
+      url: '/dashboard',
+      children: children
+    })
   }
-  if (code == "issue") {
-    let children = route.children;
-    route.children = [];
+  if (code == 'issue') {
+    const children = route.children
+    route.children = []
     route.children.push({
-      code: "issue_index",
-      moduleName: "文件下发",
+      code: 'issue_index',
+      moduleName: '文件下发',
       type: 2,
-      url: "/index",
-      children: children,
-    });
-    item.alwaysShow = false;
+      url: '/index',
+      children: children
+    })
+    item.alwaysShow = false
   }
-  if (code == "notice") {
-    let children = route.children;
-    route.children = [];
+  if (code === 'notice') {
+    const children = route.children
+    route.children = []
     route.children.push({
-      code: "notice_index",
-      moduleName: "系统通知",
+      code: 'notice_index',
+      moduleName: '系统通知',
       type: 2,
-      url: "/index",
-      children: children,
-    });
-    item.alwaysShow = false;
+      url: '/index',
+      children: children
+    })
+    item.alwaysShow = false
   }
-  item.children = [];
+  item.children = []
   if (
-    (route.hasOwnProperty("children") && type === 1) ||
-    code == "issue" ||
-    code == "notice" ||
-    code == "index"
+    (route.hasOwnProperty('children') && type === 1) ||
+    code == 'issue' ||
+    code == 'notice' ||
+    code == 'index'
   ) {
-
     for (var child of route.children) {
-      item.children.push(buildRoute(child, fullUrl));
+      item.children.push(buildRoute(child, fullUrl))
     }
   }
-  return item;
+  return item
 }
 
 function buildRoute(route, p_url) {
-  const { url, moduleName, icon, moduleId, code, type, hidden,fullUrl } = route;
-  var item = {};
-  if (url.substr(0, 1) == "/") {
-    item.path = url.substr(1);
+  const { url, moduleName, icon, moduleId, code, type, hidden, fullUrl } = route
+  var item = {}
+  if (url.substr(0, 1) === '/') {
+    item.path = url.substr(1)
   } else {
-    item.path = url;
+    item.path = url
   }
   try {
-    if (code == "dashboard") {
+    if (code == 'dashboard') {
       // item.component = _import(`${url}/index`)
       item.component = (resolve) =>
-        require(["@/views" + `${url}/index`], resolve);
+        require(['@/views' + `${url}/index`], resolve)
     } else {
-
       if (fullUrl) {
-        item.component = _import(`${fullUrl}`);
-      }else{
-        item.component = _import(`${p_url}${url}`);
-
+        item.component = _import(`${fullUrl}`)
+      } else {
+        item.component = _import(`${p_url}${url}`)
       }
-
     }
   } catch (e) {
-    console.log(e);
+    console.log(e)
   }
-  item.name = code;
+  item.name = fullUrl || code
   item.meta = {
     title: moduleName,
-    icon: icon,
-  };
+    icon: icon
+  }
   if (route.children && type == 2) {
-    let roles = [];
+    const roles = []
     for (var role of route.children) {
-      roles.push(role.code);
+      roles.push(role.code)
     }
-    item.meta.roles = roles;
+    item.meta.roles = roles
   }
-  item.hidden = hidden;
-  item.children = [];
-  if (route.hasOwnProperty("children") && type === 1) {
+  item.hidden = hidden
+  item.children = []
+  // eslint-disable-next-line no-prototype-builtins
+  if (route.hasOwnProperty('children') && type === 1) {
     for (var child of route.children) {
-      item.children.push(buildThirdRoute(child, `${p_url}${url}`));
+      item.children.push(buildThirdRoute(child, `${p_url}${url}`))
     }
   }
-  return item;
+  return item
 }
 
 function buildThirdRoute(route, p_url) {
-
-  const { url, moduleName, icon, moduleId, code, hidden, type ,fullUrl } = route;
-  var item = {};
-  if (url.substr(0, 1) == "/") {
-    item.path = url.substr(1);
+  const { url, moduleName, icon, moduleId, code, hidden, type, fullUrl } = route
+  var item = {}
+  if (url.substr(0, 1) == '/') {
+    item.path = url.substr(1)
   } else {
-    tem.path = url;
+    tem.path = url
   }
   try {
     if (fullUrl) {
-      item.component = _import(`${fullUrl}`);
-    }else{
-      item.component = _import(`${p_url}${url}`);
+      item.component = _import(`${fullUrl}`)
+    } else {
+      item.component = _import(`${p_url}${url}`)
     }
-
   } catch (e) {
-    console.log(e);
+    console.log(e)
   }
-  item.name = code;
+  item.name = fullUrl || code
 
   item.meta = {
     title: moduleName,
-    icon: icon,
-  };
+    icon: icon
+  }
   if (route.children && type == 2) {
-    let roles = [];
+    const roles = []
     for (var role of route.children) {
-      roles.push(role.code);
+      roles.push(role.code)
     }
-    item.meta.roles = roles;
+    item.meta.roles = roles
   }
-  item.hidden = hidden;
-  item.children = [];
-  return item;
+  item.hidden = hidden
+  item.children = []
+  return item
 }

+ 70 - 66
src/store/modules/tagsView.js

@@ -1,162 +1,166 @@
 const state = {
   visitedViews: [],
-  cachedViews: [],
-};
+  cachedViews: []
+}
 
 const mutations = {
   ADD_VISITED_VIEW: (state, view) => {
-    if (state.visitedViews.some((v) => v.path === view.path)) return;
+    if (state.visitedViews.some((v) => v.path === view.path)) return
     state.visitedViews.push(
       Object.assign({}, view, {
-        title: view.meta.title || "no-name",
+        title: view.meta.title || 'no-name'
       })
-    );
+    )
   },
   ADD_CACHED_VIEW: (state, view) => {
-    if (state.cachedViews.includes(view.name)) return;
+    if (state.cachedViews.includes(view.name)) return
     if (!view.meta.noCache) {
-      state.cachedViews.push(view.name);
+      state.cachedViews.push(view.name)
+    }
+    if (state.visitedViews.length > 15) {
+      state.visitedViews.splice(0, 1)
+      state.cachedViews.splice(0, 1)
     }
   },
   SET_RESET_VIES: (state, view) => {
-    state.visitedViews = [];
+    state.visitedViews = []
   },
   DEL_VISITED_VIEW: (state, view) => {
     for (const [i, v] of state.visitedViews.entries()) {
       if (v.path === view.path) {
-        state.visitedViews.splice(i, 1);
-        break;
+        state.visitedViews.splice(i, 1)
+        break
       }
     }
   },
   DEL_CACHED_VIEW: (state, view) => {
-    const index = state.cachedViews.indexOf(view.name);
-    index > -1 && state.cachedViews.splice(index, 1);
+    const index = state.cachedViews.indexOf(view.name)
+    index > -1 && state.cachedViews.splice(index, 1)
   },
 
   DEL_OTHERS_VISITED_VIEWS: (state, view) => {
     state.visitedViews = state.visitedViews.filter((v) => {
-      return v.meta.affix || v.path === view.path;
-    });
+      return v.meta.affix || v.path === view.path
+    })
   },
   DEL_OTHERS_CACHED_VIEWS: (state, view) => {
-    const index = state.cachedViews.indexOf(view.name);
+    const index = state.cachedViews.indexOf(view.name)
     if (index > -1) {
-      state.cachedViews = state.cachedViews.slice(index, index + 1);
+      state.cachedViews = state.cachedViews.slice(index, index + 1)
     } else {
       // if index = -1, there is no cached tags
-      state.cachedViews = [];
+      state.cachedViews = []
     }
   },
 
   DEL_ALL_VISITED_VIEWS: (state) => {
     // keep affix tags
-    const affixTags = state.visitedViews.filter((tag) => tag.meta.affix);
-    state.visitedViews = affixTags;
+    const affixTags = state.visitedViews.filter((tag) => tag.meta.affix)
+    state.visitedViews = affixTags
   },
   DEL_ALL_CACHED_VIEWS: (state) => {
-    state.cachedViews = [];
+    state.cachedViews = []
   },
 
   UPDATE_VISITED_VIEW: (state, view) => {
     for (let v of state.visitedViews) {
       if (v.path === view.path) {
-        v = Object.assign(v, view);
-        break;
+        v = Object.assign(v, view)
+        break
       }
     }
-  },
-};
+  }
+}
 
 const actions = {
   addView({ dispatch }, view) {
-    dispatch("addVisitedView", view);
-    dispatch("addCachedView", view);
+    dispatch('addVisitedView', view)
+    dispatch('addCachedView', view)
   },
   addVisitedView({ commit }, view) {
-    commit("ADD_VISITED_VIEW", view);
+    commit('ADD_VISITED_VIEW', view)
   },
   addCachedView({ commit }, view) {
-    commit("ADD_CACHED_VIEW", view);
+    commit('ADD_CACHED_VIEW', view)
   },
 
   delView({ dispatch, state }, view) {
     return new Promise((resolve) => {
-      dispatch("delVisitedView", view);
-      dispatch("delCachedView", view);
+      dispatch('delVisitedView', view)
+      dispatch('delCachedView', view)
       resolve({
         visitedViews: [...state.visitedViews],
-        cachedViews: [...state.cachedViews],
-      });
-    });
+        cachedViews: [...state.cachedViews]
+      })
+    })
   },
   delVisitedView({ commit, state }, view) {
     return new Promise((resolve) => {
-      commit("DEL_VISITED_VIEW", view);
-      resolve([...state.visitedViews]);
-    });
+      commit('DEL_VISITED_VIEW', view)
+      resolve([...state.visitedViews])
+    })
   },
   delCachedView({ commit, state }, view) {
     return new Promise((resolve) => {
-      commit("DEL_CACHED_VIEW", view);
-      resolve([...state.cachedViews]);
-    });
+      commit('DEL_CACHED_VIEW', view)
+      resolve([...state.cachedViews])
+    })
   },
 
   delOthersViews({ dispatch, state }, view) {
     return new Promise((resolve) => {
-      dispatch("delOthersVisitedViews", view);
-      dispatch("delOthersCachedViews", view);
+      dispatch('delOthersVisitedViews', view)
+      dispatch('delOthersCachedViews', view)
       resolve({
         visitedViews: [...state.visitedViews],
-        cachedViews: [...state.cachedViews],
-      });
-    });
+        cachedViews: [...state.cachedViews]
+      })
+    })
   },
   delOthersVisitedViews({ commit, state }, view) {
     return new Promise((resolve) => {
-      commit("DEL_OTHERS_VISITED_VIEWS", view);
-      resolve([...state.visitedViews]);
-    });
+      commit('DEL_OTHERS_VISITED_VIEWS', view)
+      resolve([...state.visitedViews])
+    })
   },
   delOthersCachedViews({ commit, state }, view) {
     return new Promise((resolve) => {
-      commit("DEL_OTHERS_CACHED_VIEWS", view);
-      resolve([...state.cachedViews]);
-    });
+      commit('DEL_OTHERS_CACHED_VIEWS', view)
+      resolve([...state.cachedViews])
+    })
   },
 
   delAllViews({ dispatch, state }, view) {
     return new Promise((resolve) => {
-      dispatch("delAllVisitedViews", view);
-      dispatch("delAllCachedViews", view);
+      dispatch('delAllVisitedViews', view)
+      dispatch('delAllCachedViews', view)
       resolve({
         visitedViews: [...state.visitedViews],
-        cachedViews: [...state.cachedViews],
-      });
-    });
+        cachedViews: [...state.cachedViews]
+      })
+    })
   },
   delAllVisitedViews({ commit, state }) {
     return new Promise((resolve) => {
-      commit("DEL_ALL_VISITED_VIEWS");
-      resolve([...state.visitedViews]);
-    });
+      commit('DEL_ALL_VISITED_VIEWS')
+      resolve([...state.visitedViews])
+    })
   },
   delAllCachedViews({ commit, state }) {
     return new Promise((resolve) => {
-      commit("DEL_ALL_CACHED_VIEWS");
-      resolve([...state.cachedViews]);
-    });
+      commit('DEL_ALL_CACHED_VIEWS')
+      resolve([...state.cachedViews])
+    })
   },
 
   updateVisitedView({ commit }, view) {
-    commit("UPDATE_VISITED_VIEW", view);
-  },
-};
+    commit('UPDATE_VISITED_VIEW', view)
+  }
+}
 
 export default {
   namespaced: true,
   state,
   mutations,
-  actions,
-};
+  actions
+}

+ 5 - 2
src/views/basic_data/dealer.vue

@@ -1,7 +1,10 @@
 <template>
   <div>
-<router-view />
-     
+    <keep-alive>
+      <keep-alive>
+        <router-view />
+      </keep-alive></keep-alive>
+
   </div>
 </template>
 

+ 5 - 2
src/views/basic_data/logistics.vue

@@ -1,7 +1,10 @@
 <template>
   <div>
-<router-view />
-     
+    <keep-alive>
+      <keep-alive>
+        <router-view />
+      </keep-alive></keep-alive>
+
   </div>
 </template>
 

+ 5 - 2
src/views/basic_data/material.vue

@@ -1,7 +1,10 @@
 <template>
   <div>
-<router-view />
-     
+    <keep-alive>
+      <keep-alive>
+        <router-view />
+      </keep-alive></keep-alive>
+
   </div>
 </template>
 

+ 5 - 2
src/views/basic_data/stock.vue

@@ -1,7 +1,10 @@
 <template>
   <div>
-<router-view />
-     
+    <keep-alive>
+      <keep-alive>
+        <router-view />
+      </keep-alive></keep-alive>
+
   </div>
 </template>
 

+ 5 - 2
src/views/basic_data/supplier.vue

@@ -1,7 +1,10 @@
 <template>
   <div>
-<router-view />
-     
+    <keep-alive>
+      <keep-alive>
+        <router-view />
+      </keep-alive></keep-alive>
+
   </div>
 </template>
 

+ 5 - 2
src/views/basic_data/taker.vue

@@ -1,7 +1,10 @@
 <template>
   <div>
-<router-view />
-     
+    <keep-alive>
+      <keep-alive>
+        <router-view />
+      </keep-alive></keep-alive>
+
   </div>
 </template>
 

+ 5 - 2
src/views/basic_data/wallet.vue

@@ -1,7 +1,10 @@
 <template>
   <div>
-<router-view />
-     
+    <keep-alive>
+      <keep-alive>
+        <router-view />
+      </keep-alive></keep-alive>
+
   </div>
 </template>
 

+ 4 - 1
src/views/basic_data/warehouse.vue

@@ -1,7 +1,10 @@
 <template>
   <div>
 
-    <router-view />
+    <keep-alive>
+      <keep-alive>
+        <router-view />
+      </keep-alive></keep-alive>
 
   </div>
 </template>

+ 5 - 2
src/views/finance/cash.vue

@@ -1,7 +1,10 @@
 <template>
   <div>
-<router-view />
-     
+    <keep-alive>
+      <keep-alive>
+        <router-view />
+      </keep-alive></keep-alive>
+
   </div>
 </template>
 

+ 5 - 2
src/views/finance/details.vue

@@ -1,7 +1,10 @@
 <template>
   <div>
-<router-view />
-     
+    <keep-alive>
+      <keep-alive>
+        <router-view />
+      </keep-alive></keep-alive>
+
   </div>
 </template>
 

+ 5 - 2
src/views/finance/rebate.vue

@@ -1,7 +1,10 @@
 <template>
   <div>
-<router-view />
-     
+    <keep-alive>
+      <keep-alive>
+        <router-view />
+      </keep-alive></keep-alive>
+
   </div>
 </template>
 

+ 4 - 2
src/views/sales/price.vue

@@ -1,7 +1,9 @@
 <template>
   <div>
-<router-view />
-     
+    <keep-alive>
+      <router-view />
+    </keep-alive>
+
   </div>
 </template>
 

+ 3 - 1
src/views/sales/sales_policy.vue

@@ -1,7 +1,9 @@
 <template>
   <div>
 
-    <router-view />
+    <keep-alive>
+      <router-view />
+    </keep-alive>
 
   </div>
 </template>

+ 3 - 1
src/views/sales/sales_rebate.vue

@@ -1,7 +1,9 @@
 <template>
   <div>
 
-    <router-view />
+    <keep-alive>
+      <router-view />
+    </keep-alive>
 
   </div>
 </template>

+ 4 - 2
src/views/supply/adjust.vue

@@ -1,7 +1,9 @@
 <template>
   <div>
-<router-view />
-     
+    <keep-alive>
+      <router-view />
+    </keep-alive>
+
   </div>
 </template>
 

+ 4 - 2
src/views/supply/allot.vue

@@ -1,7 +1,9 @@
 <template>
   <div>
-<router-view />
-     
+    <keep-alive>
+      <router-view />
+    </keep-alive>
+
   </div>
 </template>
 

+ 4 - 2
src/views/supply/apply.vue

@@ -1,7 +1,9 @@
 <template>
   <div>
-<router-view />
-     
+    <keep-alive>
+      <router-view />
+    </keep-alive>
+
   </div>
 </template>
 

+ 3 - 3
src/views/supply/deliver.vue

@@ -1,8 +1,8 @@
 <template>
   <div>
-<router-view />
-     
-
+    <keep-alive>
+      <router-view />
+    </keep-alive>
 
   </div>
 </template>

+ 4 - 2
src/views/supply/direct.vue

@@ -1,7 +1,9 @@
 <template>
   <div>
-<router-view />
-     
+    <keep-alive>
+      <router-view />
+    </keep-alive>
+
   </div>
 </template>
 

+ 4 - 2
src/views/supply/displace.vue

@@ -1,7 +1,9 @@
 <template>
   <div>
-<router-view />
-     
+    <keep-alive>
+      <router-view />
+    </keep-alive>
+
   </div>
 </template>
 

+ 4 - 2
src/views/supply/engin.vue

@@ -1,7 +1,9 @@
 <template>
   <div>
-<router-view />
-     
+    <keep-alive>
+      <router-view />
+    </keep-alive>
+
   </div>
 </template>
 

+ 4 - 2
src/views/supply/implement.vue

@@ -1,7 +1,9 @@
 <template>
   <div>
-<router-view />
-     
+    <keep-alive>
+      <router-view />
+    </keep-alive>
+
   </div>
 </template>
 

+ 4 - 2
src/views/supply/pickup.vue

@@ -1,7 +1,9 @@
 <template>
   <div>
-<router-view />
-     
+    <keep-alive>
+      <router-view />
+    </keep-alive>
+
   </div>
 </template>
 

+ 4 - 2
src/views/supply/policy.vue

@@ -1,7 +1,9 @@
 <template>
   <div>
-<router-view />
-     
+    <keep-alive>
+      <router-view />
+    </keep-alive>
+
   </div>
 </template>
 

+ 4 - 2
src/views/supply/price.vue

@@ -1,7 +1,9 @@
 <template>
   <div>
-<router-view />
-     
+    <keep-alive>
+      <router-view />
+    </keep-alive>
+
   </div>
 </template>
 

+ 4 - 2
src/views/supply/purchase.vue

@@ -1,7 +1,9 @@
 <template>
   <div>
-<router-view />
-     
+    <keep-alive>
+      <router-view />
+    </keep-alive>
+
   </div>
 </template>
 

+ 4 - 2
src/views/supply/reserve.vue

@@ -1,7 +1,9 @@
 <template>
   <div>
-<router-view />
-     
+    <keep-alive>
+      <router-view />
+    </keep-alive>
+
   </div>
 </template>
 

+ 3 - 1
src/views/supply/retail.vue

@@ -1,6 +1,8 @@
 <template>
   <div>
-<router-view />
+    <keep-alive>
+      <router-view />
+    </keep-alive>
   </div>
 </template>
 

+ 4 - 2
src/views/supply/return.vue

@@ -1,7 +1,9 @@
 <template>
   <div>
-<router-view />
-     
+    <keep-alive>
+      <router-view />
+    </keep-alive>
+
   </div>
 </template>
 

+ 4 - 2
src/views/supply/sales.vue

@@ -1,7 +1,9 @@
 <template>
   <div>
-<router-view />
-     
+    <keep-alive>
+      <router-view />
+    </keep-alive>
+
   </div>
 </template>