Merge branch 'main' into secondStage

This commit is contained in:
赵霄
2023-11-23 09:48:37 +08:00
5 changed files with 23 additions and 18 deletions
+2
View File
@@ -14,3 +14,5 @@ window._CONFIG.onlinePreviewDomainURL = 'http://127.0.0.1:8012/onlinePreview'
window._CONFIG.onlyOfficeUrl = 'http://127.0.0.1:8080' window._CONFIG.onlyOfficeUrl = 'http://127.0.0.1:8080'
// onlyOffice下载文件地址(暂时没用) // onlyOffice下载文件地址(暂时没用)
window._CONFIG.onlyOfficeDownloadFileUrl = 'http://localhost:8184/sys/common/download' window._CONFIG.onlyOfficeDownloadFileUrl = 'http://localhost:8184/sys/common/download'
// 管理员角色code,英文逗号拼接
window._CONFIG.adminRoleCode = 'admin'
@@ -233,8 +233,9 @@ export default {
computed: { computed: {
...mapGetters(['userInfo']), ...mapGetters(['userInfo']),
administrators () { administrators () {
const adminRoleList = window._CONFIG.adminRoleCode.split(',')
const userRoleList = this.userInfo.roleCode.split(',') const userRoleList = this.userInfo.roleCode.split(',')
return userRoleList.some(tt => tt === 'admin') return userRoleList.some(tt => adminRoleList.includes(tt))
} }
}, },
created () { created () {
@@ -102,14 +102,22 @@ import { releaseSplitStandard, changePermission, withdraw } from '@api/documentT
import ImportSplitResultModal from './modules/ImportSplitResultModal.vue' import ImportSplitResultModal from './modules/ImportSplitResultModal.vue'
import UserSelectModal from '../../../components/selection/UserSelectModal.vue' import UserSelectModal from '../../../components/selection/UserSelectModal.vue'
import { SplitStatus, StandardSource } from '@/enums/commonEnums' import { SplitStatus, StandardSource } from '@/enums/commonEnums'
import { mapGetters } from 'vuex'
export default { export default {
name: 'DocumentSplit', name: 'DocumentSplit',
components: { JTable, SplitText, ImportSplitResultModal, UserSelectModal }, components: { JTable, SplitText, ImportSplitResultModal, UserSelectModal },
mixins: [JeroListMixin], mixins: [JeroListMixin],
computed: {
...mapGetters(['userInfo']),
administrators () {
const adminRoleList = window._CONFIG.adminRoleCode.split(',')
const userRoleList = this.userInfo.roleCode.split(',')
return userRoleList.some(tt => adminRoleList.includes(tt))
}
},
data () { data () {
return { return {
userInfo: this.$store.getters.userInfo,
operationList: [ operationList: [
// 发布 // 发布
{ {
@@ -154,7 +162,7 @@ export default {
has: 'split:sarFileSplitInfo:delete', has: 'split:sarFileSplitInfo:delete',
show: (record) => { show: (record) => {
// 创建人(更改权限更改的是这个字段)是当前登录人或用户为管理员,且状态为编辑中可以删除 // 创建人(更改权限更改的是这个字段)是当前登录人或用户为管理员,且状态为编辑中可以删除
return (record.createBy === this.userInfo.id || this.userInfo.roleCode.split(',').some(tt => tt === 'admin')) return (record.createBy === this.userInfo.id || this.administrators)
} }
} }
], ],
@@ -238,7 +238,6 @@ export default {
moveUpFlag: false, moveUpFlag: false,
fullWidth: '', fullWidth: '',
parameter: {}, parameter: {},
administrators: false,
showAction: false, showAction: false,
flag: '4', // 查询要用到 flag: '4', // 查询要用到
operateSlotName: 'action', operateSlotName: 'action',
@@ -297,7 +296,12 @@ export default {
*/ */
return `calc(100vh - ${this.defaultHeight['user-info-height']} - ${this.defaultHeight['breadcrumb-height']} - ${this.defaultHeight.oneLineOperationHeight} - 48px - 48px - 54px - ${this.isBackTitle ? '56px' : '0px'})` return `calc(100vh - ${this.defaultHeight['user-info-height']} - ${this.defaultHeight['breadcrumb-height']} - ${this.defaultHeight.oneLineOperationHeight} - 48px - 48px - 54px - ${this.isBackTitle ? '56px' : '0px'})`
}, },
...mapGetters(['userInfo']) ...mapGetters(['userInfo']),
administrators () {
const adminRoleList = window._CONFIG.adminRoleCode.split(',')
const userRoleList = this.userInfo.roleCode.split(',')
return userRoleList.some(tt => adminRoleList.includes(tt))
}
}, },
mounted () { mounted () {
this.operateColumn.scopedSlots.customRender = 'action' this.operateColumn.scopedSlots.customRender = 'action'
@@ -313,14 +317,6 @@ export default {
if (this.needFilterTableBtn) { if (this.needFilterTableBtn) {
this.operationList = this.operationList.filter(item => !item.has || isHasPermission(item.has)) this.operationList = this.operationList.filter(item => !item.has || isHasPermission(item.has))
} }
this.administrators = false
if (this.userInfo.userRoleList && this.userInfo.userRoleList.length > 0) {
this.userInfo.userRoleList.forEach(res => {
if (res.roleCode === 'admin') {
this.administrators = true
}
})
}
this.infoId = this.$route.query.infoId this.infoId = this.$route.query.infoId
this.loadMenuData() this.loadMenuData()
}, },
@@ -77,11 +77,9 @@ export default {
...mapGetters(['userInfo']), ...mapGetters(['userInfo']),
// 是否管理员 // 是否管理员
isAdmin () { isAdmin () {
const roleList = this.userInfo.roleCode.split(',') const adminRoleList = window._CONFIG.adminRoleCode.split(',')
if (roleList && roleList.length > 0 && roleList.some(tt => tt === 'admin')) { const userRoleList = this.userInfo.roleCode.split(',')
return true return userRoleList.some(tt => adminRoleList.includes(tt))
}
return false
} }
}, },
data () { data () {