【更新】前端增加编辑机构判断登录者是否为超管而展示不同的树

This commit is contained in:
小诺 2021-07-20 17:31:39 +08:00 committed by 俞宝山
parent 7ea83d770a
commit ad69372226
2 changed files with 30 additions and 16 deletions

View File

@ -70,6 +70,7 @@
</template>
<script>
import store from '@/store'
import { sysOrgAdd, getOrgTree } from '@/api/modular/system/orgManage'
export default {
data () {
@ -106,14 +107,20 @@
this.orgTree = []
return
}
this.orgTree = [{
'id': '-1',
'parentId': '0',
'title': '顶级',
'value': '0',
'pid': '0',
'children': res.data
}]
const admintype = store.getters.admintype
// eslint-disable-next-line eqeqeq
if (admintype == '1') {
this.orgTree = [{
'id': '-1',
'parentId': '0',
'title': '顶级',
'value': '0',
'pid': '0',
'children': res.data
}]
} else {
this.orgTree = res.data
}
})
},

View File

@ -80,6 +80,7 @@
</template>
<script>
import store from '@/store'
import { sysOrgEdit, getOrgTree } from '@/api/modular/system/orgManage'
export default {
data () {
@ -128,14 +129,20 @@
this.orgTree = []
return
}
this.orgTree = [{
'id': '-1',
'parentId': '0',
'title': '顶级',
'value': '0',
'pid': '0',
'children': res.data
}]
const admintype = store.getters.admintype
// eslint-disable-next-line eqeqeq
if (admintype == '1') {
this.orgTree = [{
'id': '-1',
'parentId': '0',
'title': '顶级',
'value': '0',
'pid': '0',
'children': res.data
}]
} else {
this.orgTree = res.data
}
})
},