diff --git a/src/components/Breadcrumb/index.vue b/src/components/Breadcrumb/index.vue index 0140413..503a7ab 100644 --- a/src/components/Breadcrumb/index.vue +++ b/src/components/Breadcrumb/index.vue @@ -21,6 +21,7 @@ export default { watch: { $route() { this.getBreadcrumb() + } }, created() { diff --git a/src/layout/components/Sidebar/index.vue b/src/layout/components/Sidebar/index.vue index ec80862..04d8fb5 100644 --- a/src/layout/components/Sidebar/index.vue +++ b/src/layout/components/Sidebar/index.vue @@ -67,26 +67,45 @@ export default { }, methods: { - + SplicingMenuTree(menus, menusdatas) { + // console.log(menus); + // console.log(menusdatas); + // console.log(this.routes[0]); + menus.forEach(item => { + //console.log(menusdata[0]); + if (!menusdatas.children) { + this.$set(menusdatas,'children', []) + //menusdata[0].children = [] + } + + //Object.assign(menusdata[0],) + menusdatas.children.push( + { + path: '/subfile?id='+item.id, + meta: { title: item.directory, icon: 'dashboard' } + } + ); + //console.log(item.directories.length); + if (item.directories && item.directories.length > 0) { + this.SplicingMenuTree(item.directories, menusdatas.children[item.directories.length-1]) + } + }); + console.log(menusdata[0].children); + }, + getmunusdata() { let thiss = this; - console.log(menusdata[0]); + console.log(this.$route); + console.log(this.$store); + mirlist().then(response => { let datamain = response.data; //routesData(datamain.data.menus); //console.log(response); - - - datamain.data.menus.forEach(item => { - console.log(menusdata[0]); - menusdata[0].children.push( - { - path: '/usermange', - meta: { title: item.directory, icon: 'dashboard' } - } - ); - }); - this.$router.push({ path: 'usermange', query: { plan: 'private' }}) + + this.SplicingMenuTree(datamain.data.menus, menusdata[0]); + //this.routes = menusdata + //console.log(menusdata); }).catch(function (error) { thiss.$message({ diff --git a/src/layout/components/Sidebar/leftMenusData.js b/src/layout/components/Sidebar/leftMenusData.js index 3144a76..6f50e3a 100644 --- a/src/layout/components/Sidebar/leftMenusData.js +++ b/src/layout/components/Sidebar/leftMenusData.js @@ -1,12 +1,36 @@ // 菜单栏生成 let menusdata = [ + + // { + // id: '0', + // path: '/filemange', + // meta: { title: '文件管理', icon: 'dashboard' }, + // children: [ + // { + // path: '/subfile', + // meta: { title: 'Menu1-1' } + // }, + // { + // path: '/subfile', + // meta: { title: 'Menu1-2' }, + // children: [ + // { + // path: '/subfile', + // meta: { title: 'Menu1-2-1' } + // }, + // { + // path: '/subfile', + // meta: { title: 'Menu1-2-2' } + // } + // ] + // } + // ] + // }, { id: '0', path: '/filemange', - meta: { title: '文件管理', icon: 'dashboard' }, - children:[] }, { path: '/usermange', diff --git a/src/router/index.js b/src/router/index.js index 4f5e2d9..5cea91d 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -67,16 +67,16 @@ export const constantRoutes = [ meta: { title: '用户管理', icon: 'dashboard' } }] }, - // { - // path: '/', - // component: Layout, - // children: [{ - // path: 'filemangeff', - // name: 'filemangeff', - // component: () => import('@/views/usermanage/index'), - // meta: { title: 'text', icon: 'dashboard' } - // }] - // }, + { + path: '/', + component: Layout, + children: [{ + path: 'subfile', + name: 'Subfile', + component: () => import('@/views/subfile/index'), + meta: { title: '文件管理', icon: 'dashboard' } + }] + }, { path: '/systme', component: Layout, diff --git a/src/views/login/index.vue b/src/views/login/index.vue index 2a4a58b..d5ea54d 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -193,20 +193,6 @@ export default { type: 'error' }); }); - - // axios.post('/api/login', this.loginForm, {headers: {'Content-Type': 'multipart/form-data'} - // }).then(function (response) { - // console.log(response) - // thiss.$router.push({path: '/usermange'}) - // console.log('6666'); - // }).catch(function (error) { - // //console.log(error); - // this.$message({ - // showClose: true, - // message: error, - // type: 'error' - // }); - // }); } else { console.log('error submit!!') return false diff --git a/src/views/subfile/index.vue b/src/views/subfile/index.vue new file mode 100644 index 0000000..34a6c1c --- /dev/null +++ b/src/views/subfile/index.vue @@ -0,0 +1,80 @@ + + + diff --git a/src/views/usermanage/index.vue b/src/views/usermanage/index.vue index 55217b1..fc0430a 100644 --- a/src/views/usermanage/index.vue +++ b/src/views/usermanage/index.vue @@ -48,6 +48,7 @@ import { getList } from '@/api/table' export default { + filters: { statusFilter(status) { const statusMap = { @@ -65,16 +66,10 @@ export default { } }, created() { - this.fetchData() + }, methods: { - fetchData() { - this.listLoading = true - getList().then(response => { - this.list = response.data.items - this.listLoading = false - }) - } + } } diff --git a/vue.config.js b/vue.config.js index 5b77dac..25ca79b 100644 --- a/vue.config.js +++ b/vue.config.js @@ -31,13 +31,13 @@ module.exports = { lintOnSave: false, productionSourceMap: false, devServer: { + inline: false, port: port, open: true, overlay: { warnings: false, errors: true }, - inline: false, //before: require('./mock/mock-server.js'), proxy: { '/api': {