Browse Source

修改

master
wen 2 years ago
parent
commit
3776525325
  1. 1
      src/components/Breadcrumb/index.vue
  2. 43
      src/layout/components/Sidebar/index.vue
  3. 28
      src/layout/components/Sidebar/leftMenusData.js
  4. 20
      src/router/index.js
  5. 14
      src/views/login/index.vue
  6. 80
      src/views/subfile/index.vue
  7. 11
      src/views/usermanage/index.vue
  8. 2
      vue.config.js

1
src/components/Breadcrumb/index.vue

@ -21,6 +21,7 @@ export default {
watch: { watch: {
$route() { $route() {
this.getBreadcrumb() this.getBreadcrumb()
} }
}, },
created() { created() {

43
src/layout/components/Sidebar/index.vue

@ -67,26 +67,45 @@ export default {
}, },
methods: { 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() { getmunusdata() {
let thiss = this; let thiss = this;
console.log(menusdata[0]); console.log(this.$route);
console.log(this.$store);
mirlist().then(response => { mirlist().then(response => {
let datamain = response.data; let datamain = response.data;
//routesData(datamain.data.menus); //routesData(datamain.data.menus);
//console.log(response); //console.log(response);
this.SplicingMenuTree(datamain.data.menus, menusdata[0]);
datamain.data.menus.forEach(item => { //this.routes = menusdata
console.log(menusdata[0]); //console.log(menusdata);
menusdata[0].children.push(
{
path: '/usermange',
meta: { title: item.directory, icon: 'dashboard' }
}
);
});
this.$router.push({ path: 'usermange', query: { plan: 'private' }})
}).catch(function (error) { }).catch(function (error) {
thiss.$message({ thiss.$message({

28
src/layout/components/Sidebar/leftMenusData.js

@ -1,12 +1,36 @@
// 菜单栏生成 // 菜单栏生成
let menusdata = [ 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', id: '0',
path: '/filemange', path: '/filemange',
meta: { title: '文件管理', icon: 'dashboard' }, meta: { title: '文件管理', icon: 'dashboard' },
children:[]
}, },
{ {
path: '/usermange', path: '/usermange',

20
src/router/index.js

@ -67,16 +67,16 @@ export const constantRoutes = [
meta: { title: '用户管理', icon: 'dashboard' } meta: { title: '用户管理', icon: 'dashboard' }
}] }]
}, },
// { {
// path: '/', path: '/',
// component: Layout, component: Layout,
// children: [{ children: [{
// path: 'filemangeff', path: 'subfile',
// name: 'filemangeff', name: 'Subfile',
// component: () => import('@/views/usermanage/index'), component: () => import('@/views/subfile/index'),
// meta: { title: 'text', icon: 'dashboard' } meta: { title: '文件管理', icon: 'dashboard' }
// }] }]
// }, },
{ {
path: '/systme', path: '/systme',
component: Layout, component: Layout,

14
src/views/login/index.vue

@ -193,20 +193,6 @@ export default {
type: 'error' 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 { } else {
console.log('error submit!!') console.log('error submit!!')
return false return false

80
src/views/subfile/index.vue

@ -0,0 +1,80 @@
<template>
<div class="app-container">
<el-table
v-loading="listLoading"
:data="list"
element-loading-text="Loading"
border
fit
highlight-current-row
>
<el-table-column align="center" label="ID" width="95">
<template slot-scope="scope">
{{ scope.$index }}
</template>
</el-table-column>
<el-table-column label="标题">
<template slot-scope="scope">
{{ scope.row.title }}
</template>
</el-table-column>
<el-table-column label="昵称" width="110" align="center">
<template slot-scope="scope">
<span>{{ scope.row.author }}</span>
</template>
</el-table-column>
<el-table-column label="时间" width="110" align="center">
<template slot-scope="scope">
{{ scope.row.pageviews }}
</template>
</el-table-column>
<el-table-column class-name="status-col" label="状态" width="110" align="center">
<template slot-scope="scope">
<el-tag :type="scope.row.status | statusFilter">{{ scope.row.status }}</el-tag>
</template>
</el-table-column>
<el-table-column align="center" prop="created_at" label="操作" width="200">
<template slot-scope="scope">
<i class="el-icon-time" />
<span>{{ scope.row.display_time }}</span>
</template>
</el-table-column>
</el-table>
</div>
</template>
<script>
//import { getList } from '@/api/table'
export default {
watch: {
$route(to, from) {
}
},
filters: {
statusFilter(status) {
const statusMap = {
published: 'success',
draft: 'gray',
deleted: 'danger'
}
return statusMap[status]
}
},
data() {
return {
list: null,
listLoading: true
}
},
created() {
},
methods: {
}
}
</script>

11
src/views/usermanage/index.vue

@ -48,6 +48,7 @@
import { getList } from '@/api/table' import { getList } from '@/api/table'
export default { export default {
filters: { filters: {
statusFilter(status) { statusFilter(status) {
const statusMap = { const statusMap = {
@ -65,16 +66,10 @@ export default {
} }
}, },
created() { created() {
this.fetchData()
}, },
methods: { methods: {
fetchData() {
this.listLoading = true
getList().then(response => {
this.list = response.data.items
this.listLoading = false
})
}
} }
} }
</script> </script>

2
vue.config.js

@ -31,13 +31,13 @@ module.exports = {
lintOnSave: false, lintOnSave: false,
productionSourceMap: false, productionSourceMap: false,
devServer: { devServer: {
inline: false,
port: port, port: port,
open: true, open: true,
overlay: { overlay: {
warnings: false, warnings: false,
errors: true errors: true
}, },
inline: false,
//before: require('./mock/mock-server.js'), //before: require('./mock/mock-server.js'),
proxy: { proxy: {
'/api': { '/api': {

Loading…
Cancel
Save