update 资料中心树操作数据权限控制
This commit is contained in:
@@ -22,7 +22,9 @@
|
||||
</template>
|
||||
<span class="tree-node-custom-title">{{ record.folderName }}</span>
|
||||
</a-tooltip>
|
||||
<div class="tree-operate-node-btn-box" :class="{'tree-operate-node-btn-box-hide': record.id !== mouseInNodeKey}">
|
||||
<div class="tree-operate-node-btn-box"
|
||||
:class="{'tree-operate-node-btn-box-hide': record.id !== mouseInNodeKey}"
|
||||
v-if="hasManagePermission(record)">
|
||||
<!--新增同级-->
|
||||
<a-button icon="plus"
|
||||
class="tree-operate-node-btn"
|
||||
@@ -142,6 +144,7 @@ import ProfileCenterModal from './modules/ProfileCenterModal.vue'
|
||||
import ProfileCenterTreeModal from './modules/ProfileCenterTreeModal.vue'
|
||||
import { filterObj } from '../../../utils/util'
|
||||
import { downloadFile } from '../../../api/manage'
|
||||
import { mapGetters } from 'vuex'
|
||||
|
||||
export default {
|
||||
name: 'ProfileCenterList',
|
||||
@@ -214,6 +217,9 @@ export default {
|
||||
treeLoading: false
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(['userInfo'])
|
||||
},
|
||||
created () {
|
||||
this.initTreeData()
|
||||
},
|
||||
@@ -358,6 +364,22 @@ export default {
|
||||
},
|
||||
handleDownload ({ id, fileName }) {
|
||||
downloadFile(`/laws/dataCenter/lawsDataCenterFile/download?id=${id}`, fileName)
|
||||
},
|
||||
hasManagePermission ({ authManageIds }) {
|
||||
if (!authManageIds) {
|
||||
return true
|
||||
}
|
||||
const adminRoleList = window._CONFIG.adminRoleCode.split(',')
|
||||
const userRoleList = this.userInfo.roleCode.split(',')
|
||||
const isAdmin = userRoleList.some(tt => adminRoleList.includes(tt))
|
||||
if (isAdmin) {
|
||||
return true
|
||||
}
|
||||
const authManageArr = authManageIds.split(',')
|
||||
if (authManageArr.includes(this.userInfo.id)) {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user