增加仓库和角色类型的数据权限控制

This commit is contained in:
季圣华
2021-05-19 23:29:15 +08:00
parent f1fa71d3cc
commit 931cdb736b
34 changed files with 142 additions and 75 deletions

View File

@@ -150,7 +150,7 @@
// 将首页添加到第一位
addIndexToFirst() {
this.pageList.splice(0, 0, {
name: 'dashboard-analysis',
name: '首页',
path: indexKey,
fullPath: indexKey,
meta: {

View File

@@ -1,48 +1,48 @@
<template>
<a-breadcrumb class="breadcrumb">
<a-breadcrumb-item v-for="(item, index) in breadList" :key="index">
<router-link v-if="item.name != name" :to="{ path: item.path }">
{{ item.meta.title }}
</router-link>
<span v-else>{{ item.meta.title }}</span>
</a-breadcrumb-item>
</a-breadcrumb>
</template>
<script>
export default {
data() {
return {
name: '',
breadList: [],
}
},
created () {
this.getBreadcrumb()
},
methods: {
getBreadcrumb() {
console.log('this.$route.matched', this.$route.matched)
this.breadList = []
this.breadList.push({ name: 'dashboard-analysis', path: '/dashboard/analysis', meta: { title: '首页' } })
this.name = this.$route.name
this.$route.matched.forEach((item) => {
// item.meta.name === 'dashboard' ? item.path = '/dashboard' : this.$route.path === item.path
this.breadList.push(item)
})
}
},
watch: {
$route() {
this.getBreadcrumb()
}
}
}
</script>
<style scoped>
<template>
<a-breadcrumb class="breadcrumb">
<a-breadcrumb-item v-for="(item, index) in breadList" :key="index">
<router-link v-if="item.name != name" :to="{ path: item.path }">
{{ item.meta.title }}
</router-link>
<span v-else>{{ item.meta.title }}</span>
</a-breadcrumb-item>
</a-breadcrumb>
</template>
<script>
export default {
data() {
return {
name: '',
breadList: [],
}
},
created () {
this.getBreadcrumb()
},
methods: {
getBreadcrumb() {
console.log('this.$route.matched', this.$route.matched)
this.breadList = []
this.breadList.push({ name: '首页', path: '/dashboard/analysis', meta: { title: '首页' } })
this.name = this.$route.name
this.$route.matched.forEach((item) => {
// item.meta.name === 'dashboard' ? item.path = '/dashboard' : this.$route.path === item.path
this.breadList.push(item)
})
}
},
watch: {
$route() {
this.getBreadcrumb()
}
}
}
</script>
<style scoped>
</style>

View File

@@ -107,7 +107,7 @@
// this.heartCheckFun();
},
destroyed: function () { // 离开页面生命周期函数
this.websocketclose();
//this.websocketclose();
},
methods: {
timerFun() {