diff --git a/src/router/index.js b/src/router/index.js index bdbddbf..c55b9bf 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -20,17 +20,30 @@ import basic from "./basic" // 基础功能 // import payment from "./payment" // 缴费管理 // import smartMall from "./smartMall" // 智慧商城 // import operation from "./operation" // 运营管理 -// import set from "./set" // 设置 +import setting from "./setting" // 设置 const router = [ { path: "/", - name: "Layout", - title: "外框", + name: "basic", + title: "基础", component: Layout, redirect: '/Console', meta: {title: '首页'}, - children: [...basic] + children: [ + ...basic, + ] + }, + { + path: "/setting", + name: "setting", + title: "设置", + component: Layout, + redirect: '/basicSet', + meta: {title: '设置'}, + children: [ + ...setting, + ] }, { path: "/login", diff --git a/src/router/set.js b/src/router/set.js deleted file mode 100644 index 3555ba6..0000000 --- a/src/router/set.js +++ /dev/null @@ -1,9 +0,0 @@ -/* - * @Author: your name - * @Date: 2021-11-24 14:55:05 - * @LastEditTime: 2021-11-24 14:55:06 - * @LastEditors: Please set LastEditors - * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE - * @FilePath: /LittleBeeSaas/src/router/set.js - */ -export default [] \ No newline at end of file diff --git a/src/router/setting.js b/src/router/setting.js new file mode 100644 index 0000000..0298156 --- /dev/null +++ b/src/router/setting.js @@ -0,0 +1,11 @@ +export default [ + { + path: '/basicSet', + name: "basicSet", + title: "基础设置", + hide: false, + icon: 'container', + component: resolve => require(['@/views/Set/basicSet'], resolve), + meta: {title: '基础设置'} + }, +] \ No newline at end of file diff --git a/src/views/Employee/index.vue b/src/views/Employee/index.vue index 344a0e2..75f9cd1 100644 --- a/src/views/Employee/index.vue +++ b/src/views/Employee/index.vue @@ -262,6 +262,7 @@ export default { pager.pageSize = pagination.pageSize; this.pagination = pager; }, + onChange(){} }, }; diff --git a/src/views/Layout/index.vue b/src/views/Layout/index.vue index 66194e2..1afabd4 100644 --- a/src/views/Layout/index.vue +++ b/src/views/Layout/index.vue @@ -10,7 +10,7 @@ - + @@ -50,6 +50,12 @@ export default { }, immediate: true, }, + tagActive:{ + handler(val) { + sessionStorage.setItem('modal',this.menuTags[val].value) + }, + immediate: true, + } }, data() { return { @@ -58,23 +64,23 @@ export default { menuTags: [ { label: "基础功能", - value: "a" + value: "basic" }, { label: "缴费管理", - value: "b" + value: "payment" }, { label: "智慧商城", - value: "c" + value: "smartMall" }, { label: "运营管理", - value: "d" + value: "operation" }, { label: "设置", - value: "e" + value: "setting" } ], }; diff --git a/src/views/Layout/yMenu/index.vue b/src/views/Layout/yMenu/index.vue index 0b9b951..d37d4bf 100644 --- a/src/views/Layout/yMenu/index.vue +++ b/src/views/Layout/yMenu/index.vue @@ -56,7 +56,8 @@ export default { type: Boolean, default: false, indexPath: 0 - } + }, + num:Number, }, watch: { csd: { @@ -73,6 +74,13 @@ export default { }, immediate: true, }, + // 当num变化 重新渲染菜单 + num:{ + handler() { + this.initMenu() + }, + immediate: true, + } }, components: { @@ -105,14 +113,19 @@ export default { this.$router.push(key) }, initMenu() { + // console.log(this.$router); + // console.log(sessionStorage.getItem('modal')); + let modal= sessionStorage.getItem('modal') let routes = this.$router.options.routes || []; let farr = routes.filter(ele => { - return ele.name === 'Layout' + return ele.name === modal }); let arr = farr[0].children || []; let menus = []; this.routerToMenu(arr, menus); this.list = menus; + let path = farr[0].redirect + this.$router.push({path:path}) }, // 递归数据 routerToMenu(arr = [], menus) { @@ -141,7 +154,7 @@ export default { this.routerToMenu(arr[i].children, obj.children) } } - + // console.log(menus); } } diff --git a/src/views/Login/index.vue b/src/views/Login/index.vue index fcdac25..321562c 100644 --- a/src/views/Login/index.vue +++ b/src/views/Login/index.vue @@ -2,6 +2,7 @@
+ 智慧小区后台管理系统