liujq 3 years ago
parent
commit
181fa13ce3

File diff suppressed because it is too large
+ 0 - 0
dist/index.html


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.17436565.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.3d6a8fb3.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/chunk-02eb56e6.ac19b482.js


+ 3 - 1
src/App.vue

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

+ 15 - 2
src/router/index.js

@@ -194,6 +194,17 @@ export let moreRoutes = [
   //   ]
   // },
 ]
+function formatStr (str) {
+  let newStr = ''
+  str.slice(1).split('/').map((item, i) => {
+    if (i > 0) {
+      newStr += item.slice(0, 1).toUpperCase() + item.slice(1)
+    } else {
+      newStr += item
+    }
+  })
+  return newStr
+}
 const fpUser = window.sessionStorage.getItem('fp_user') ? JSON.parse(window.sessionStorage.getItem('fp_user')) : {}
 if (fpUser.username === 'admin') {
   moreRoutes.push({
@@ -239,7 +250,7 @@ function formateMenu (arr) {
     if (item.perm_type === '1' || item.perm_type === '2') {
       let cObj = {
         path: item.path,
-        name: item.path,
+        name: formatStr(item.path),
         component: resolve => require([`@/views${item.path}`], resolve),
         meta: { title: item.name },
       }
@@ -262,6 +273,7 @@ const getMenu = () => {
     let cObj = {
       path: item.path,
       component: Layout,
+      name: formatStr(item.path),
       meta: { title: item.name, icon: 'dashboard' },
     }
     if (item.children && item.children.length > 0) {
@@ -271,7 +283,7 @@ const getMenu = () => {
       cObj.children = [
         {
           path: item.path,
-          name: item.path,
+          name: formatStr(item.path),
           component: resolve => require([`@/views${item.path}`], resolve),
           meta: { title: item.name },
           // , affix: true
@@ -283,6 +295,7 @@ const getMenu = () => {
   })
 }
 getMenu()
+console.log(asyncRoutes)
 export const constantRoutes = [
   {
     path: '/login',

+ 1 - 1
src/views/house/index.vue

@@ -73,7 +73,7 @@ import ThemeHouseEdit from './components/popup/ThemeHouseEdit'
 import HelpRule from './components/popup/HelpRule'
 import baseTable from '_m/baseTable.js'
 export default {
-  name: 'index',
+  name: 'houseIndex',
   components: {
     SearchForm,
     PopupEdit,

Some files were not shown because too many files changed in this diff