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

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> </template>
<script> <script>
import store from '@/store'
import { sysOrgAdd, getOrgTree } from '@/api/modular/system/orgManage' import { sysOrgAdd, getOrgTree } from '@/api/modular/system/orgManage'
export default { export default {
data () { data () {
@ -106,6 +107,9 @@
this.orgTree = [] this.orgTree = []
return return
} }
const admintype = store.getters.admintype
// eslint-disable-next-line eqeqeq
if (admintype == '1') {
this.orgTree = [{ this.orgTree = [{
'id': '-1', 'id': '-1',
'parentId': '0', 'parentId': '0',
@ -114,6 +118,9 @@
'pid': '0', 'pid': '0',
'children': res.data 'children': res.data
}] }]
} else {
this.orgTree = res.data
}
}) })
}, },

View File

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