diff --git a/src/views/enterpriseStandardLibrary/standard/EnterpriseStandardList.vue b/src/views/enterpriseStandardLibrary/standard/EnterpriseStandardList.vue index 86f1f331..edfcffc8 100644 --- a/src/views/enterpriseStandardLibrary/standard/EnterpriseStandardList.vue +++ b/src/views/enterpriseStandardLibrary/standard/EnterpriseStandardList.vue @@ -237,6 +237,8 @@ import { ACCESS_TOKEN } from '@/store/mutation-types' import { previewPdf } from '@/utils/previewPdf' import { kkFilePreview } from '@/utils/kkFilePreview' import { getFileInfo } from '@api/api' +import { OperationType, StandardSource } from '../../../enums/commonEnums' +import { mapGetters } from 'vuex' export default { name: 'EnterpriseStandardList', @@ -305,6 +307,15 @@ export default { mounted () { this.initTreeData() }, + computed: { + ...mapGetters(['userInfo']), + // 当前用户是否管理员 + isAdmin () { + const adminRoleList = window._CONFIG.adminRoleCode.split(',') + const userRoleList = this.userInfo.roleCode.split(',') + return userRoleList.some(tt => adminRoleList.includes(tt)) + } + }, methods: { // 获取左侧树数据 initTreeData (params) { @@ -383,6 +394,18 @@ export default { this.mouseInNodeKey = null } }, + // 管理员直接新增企标到企标库,非管理员新增跳转到企标制修订发起页面 + handleAdd () { + if (!this.isAdmin) { + this.$router.push({ + path: '/workCenter/enterpriseStandardRevision/enterpriseStandardRevisionFlow' + }) + return + } + this.$refs.modalForm.add() + this.$refs.modalForm.title = this.$t('newlyAdded') + this.$refs.modalForm.disableSubmit = false + }, /** * 重置查询 */