|
|
@@ -125,19 +125,19 @@ export default {
|
|
|
loadTreeData () {
|
|
|
findTreeData({ categoryKey: this.categoryKey }).then(response => {
|
|
|
this.treeData = response.data || []
|
|
|
- if (this.hasPermission) {
|
|
|
- const data = response.data || []
|
|
|
- // this.treeData = this.treeData.filter(i => i.isShow !== '1')
|
|
|
- // 处理isShow,父级节点不显示子节点都不显示
|
|
|
- const noData = data.filter(item => item.isShow === '1')
|
|
|
- const noIdList = noData.map((obj, index) => { return obj.id }).join(',').split(',')
|
|
|
- const tree = data.filter(item => item.isShow !== '1' && !noIdList.includes(item.parentId))
|
|
|
- for (const item of tree) {
|
|
|
- item.authorityName = item.authorityName || '{"chaYue":"","buMen":"","shenCha":"","shenHeZouXiang":"","fenLei":""}'
|
|
|
- item.authorityObject = item.authorityObject || JSON.parse(item.authorityName)
|
|
|
- }
|
|
|
- this.treeData = tree
|
|
|
+ // if (this.hasPermission) {
|
|
|
+ const data = response.data || []
|
|
|
+ // this.treeData = this.treeData.filter(i => i.isShow !== '1')
|
|
|
+ // 处理isShow,父级节点不显示子节点都不显示
|
|
|
+ const noData = data.filter(item => item.isShow === '1')
|
|
|
+ const noIdList = noData.map((obj, index) => { return obj.id }).join(',').split(',')
|
|
|
+ const tree = data.filter(item => item.isShow !== '1' && !noIdList.includes(item.parentId))
|
|
|
+ for (const item of tree) {
|
|
|
+ item.authorityName = item.authorityName || '{"chaYue":"","buMen":"","shenCha":"","shenHeZouXiang":"","fenLei":""}'
|
|
|
+ item.authorityObject = item.authorityObject || JSON.parse(item.authorityName)
|
|
|
}
|
|
|
+ this.treeData = tree
|
|
|
+ // }
|
|
|
// 按照分类过滤
|
|
|
const routeName = this.$route.name
|
|
|
console.log(routeName)
|