Browse Source

修改

master
wen 2 years ago
parent
commit
3776525325
  1. 1
      src/components/Breadcrumb/index.vue
  2. 47
      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 { @@ -21,6 +21,7 @@ export default {
watch: {
$route() {
this.getBreadcrumb()
}
},
created() {

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

@ -67,26 +67,45 @@ export default { @@ -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({

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

@ -1,12 +1,36 @@ @@ -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',

20
src/router/index.js

@ -67,16 +67,16 @@ export const constantRoutes = [ @@ -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,

14
src/views/login/index.vue

@ -193,20 +193,6 @@ export default { @@ -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

80
src/views/subfile/index.vue

@ -0,0 +1,80 @@ @@ -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 @@ @@ -48,6 +48,7 @@
import { getList } from '@/api/table'
export default {
filters: {
statusFilter(status) {
const statusMap = {
@ -65,16 +66,10 @@ export default { @@ -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
})
}
}
}
</script>

2
vue.config.js

@ -31,13 +31,13 @@ module.exports = { @@ -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': {

Loading…
Cancel
Save