dashboard

This commit is contained in:
chenjianan
2019-07-18 17:48:21 +08:00
parent 707dcb4278
commit a98f2720c3
6 changed files with 67 additions and 7 deletions

View File

@@ -13,6 +13,16 @@
</div>
</el-card>
<el-divider content-position="right"/>
<div v-for="(value1,index1) in fathers" :key="index1" style="width:100%">
<el-divider content-position="left">{{ value1.title }}</el-divider>
<router-link v-for="(value2,index2) in sons" v-if="value2.pid === value1.id" :key="index2" :to="value2.path">
<el-card shadow="hover" class="sudoku_item" style="height:160px;width:170px;margin: 5px;display: inline-block;">
<svg-icon :icon-class="value2.icon" class="bgc" style="display:block;margin: auto;border: 0 solid black;font-color:black;background-color: #ffffff;width:70px;height:70px" /><br>
<div style="text-align:center">{{ value2.title }}</div>
</el-card>
</router-link>
</div>
</div>
</div>
</el-card>
@@ -29,7 +39,9 @@ export default {
sudokus: [],
curSelect: null,
number: '',
timer: ''
timer: '',
fathers: [],
sons: []
}
},
computed: {
@@ -41,11 +53,53 @@ export default {
mounted() {
this.getFileList()
this.timer = setInterval(this.getFileList, 60 * 60 * 1000) // 60 分钟一刷新
this.initFirstModule()
this.initSecondModule()
},
beforeDestroy() {
clearInterval(this.timer)
},
methods: {
async initFirstModule() {
await request({
url: '',
method: 'post',
data: {
type: '3',
name: `select * from 基础表_角色模块信息 inner join 基础表_模块信息 on 基础表_角色模块信息.id = 基础表_模块信息.id where 角色编号= ${this.token} and [path] = '/'`
}
}).then(data => {
this.fathers = []
data.data.map(v => {
this.fathers.push({
id: v.id,
title: v.title
})
})
})
},
async initSecondModule() {
await request({
url: '',
method: 'post',
data: {
type: '3',
name: `select * from 基础表_角色模块信息 inner join 基础表_模块信息 on 基础表_角色模块信息.id = 基础表_模块信息.id where 角色编号= ${this.token} and [path] <> '/'`
}
}).then(data => {
console.log(data)
this.sons = []
data.data.map(v => {
this.sons.push({
id: v.id,
pid: v.pid,
path: v.path,
icon: v.icon,
title: v.title
})
})
})
},
async getFileList() {
await request({
url: '',
@@ -82,7 +136,13 @@ export default {
}
}
</script>
<style rel="stylesheet/scss" lang="scss">
.bgc{
* {
fill: black;
}
}
</style>
<style rel="stylesheet/scss" lang="scss" scoped>
/*.text {*/
/*font-size: 14px;*/