修改文档拆分的权限

This commit is contained in:
范强强
2024-02-20 09:56:02 +08:00
parent 8abe03b22a
commit a9ec74a912
3 changed files with 10 additions and 23 deletions
@@ -187,43 +187,38 @@ export default {
// 对比结果 // 对比结果
{ {
text: this.$t('docTool.comparison.comparisonResults'), text: this.$t('docTool.comparison.comparisonResults'),
clickEvent: 'comparisonResultsClick', clickEvent: 'comparisonResultsClick'
has: 'documentComparison:comparisonResults'
}, },
// 发布 // 发布
{ {
text: this.$t('release'), text: this.$t('release'),
clickEvent: 'subscribe', clickEvent: 'subscribe',
has: 'documentComparison:publishWithdraw',
show: (record) => { show: (record) => {
return record.createBy === this.userInfo.username && (!record.releaseState || record.releaseState === 'draft') return !record.releaseState || record.releaseState === 'draft'
} }
}, },
// 撤回 // 撤回
{ {
text: this.$t('withdraw'), text: this.$t('withdraw'),
clickEvent: 'subscribe', clickEvent: 'subscribe',
has: 'documentComparison:publishWithdraw',
show: (record) => { show: (record) => {
return record.createBy === this.userInfo.username && !(!record.releaseState || record.releaseState === 'draft') return !(!record.releaseState || record.releaseState === 'draft')
} }
}, },
// 编辑 // 编辑
{ {
text: this.$t('edit'), text: this.$t('edit'),
clickEvent: 'edit', clickEvent: 'edit',
has: 'documentComparison:edit',
show: (record) => { show: (record) => {
return (record.createBy === this.userInfo.username || this.administrators) && (!record.releaseState || record.releaseState === 'draft') return !record.releaseState || record.releaseState === 'draft'
} }
}, },
// 删除 // 删除
{ {
text: this.$t('delete'), text: this.$t('delete'),
clickEvent: 'handleDelete', clickEvent: 'handleDelete',
has: 'documentComparison:delete',
show: (record) => { show: (record) => {
return (record.createBy === this.userInfo.username || this.administrators) && (!record.releaseState || record.releaseState === 'draft') return !record.releaseState || record.releaseState === 'draft'
} }
} }
] ]
@@ -279,7 +274,7 @@ export default {
}, },
// 对比结果按钮点击 // 对比结果按钮点击
comparisonResultsClick (item) { comparisonResultsClick (item) {
if (item.createBy === this.userInfo.username && item.releaseState === 'draft') { if (item.releaseState === 'draft') {
item.isDisplay = 2 item.isDisplay = 2
} else { } else {
item.isDisplay = 1 item.isDisplay = 1
@@ -120,46 +120,41 @@ export default {
{ {
text: this.$t('release'), text: this.$t('release'),
clickEvent: 'handleRelease', clickEvent: 'handleRelease',
has: 'split:sarFileSplitInfo:release',
show: (record) => { show: (record) => {
// 创建人(更改权限更改的是这个字段)是当前登录人,且状态为编辑中可以发布 // 创建人(更改权限更改的是这个字段)是当前登录人,且状态为编辑中可以发布
return record.createBy === this.userInfo.id && record.splitStatus === SplitStatus.EDITING.value return record.splitStatus === SplitStatus.EDITING.value
} }
}, },
// 撤回 // 撤回
{ {
text: this.$t('withdraw'), text: this.$t('withdraw'),
clickEvent: 'handleWithdraw', clickEvent: 'handleWithdraw',
has: 'split:sarFileSplitInfo:withdraw',
show: (record) => { show: (record) => {
// 创建人(更改权限更改的是这个字段)是当前登录人,且状态为已发布可以撤回 // 创建人(更改权限更改的是这个字段)是当前登录人,且状态为已发布可以撤回
return record.createBy === this.userInfo.id && record.splitStatus === SplitStatus.RELEASED.value return record.splitStatus === SplitStatus.RELEASED.value
} }
}, },
// 查看 // 查看
{ {
text: this.$t('view'), text: this.$t('view'),
clickEvent: 'handleDetail', clickEvent: 'handleDetail',
has: 'split:sarFileSplitItems:page'
}, },
// 编辑 // 编辑
{ {
text: this.$t('edit'), text: this.$t('edit'),
clickEvent: 'handleEdit', clickEvent: 'handleEdit',
has: 'split:sarFileSplitItems:edit',
show: (record) => { show: (record) => {
// 创建人(更改权限更改的是这个字段)是当前登录人,且状态为编辑中可以编辑 // 创建人(更改权限更改的是这个字段)是当前登录人,且状态为编辑中可以编辑
return record.createBy === this.userInfo.id && record.splitStatus === SplitStatus.EDITING.value return record.splitStatus === SplitStatus.EDITING.value
} }
}, },
// 删除 // 删除
{ {
text: this.$t('delete'), text: this.$t('delete'),
clickEvent: 'handleDelete', clickEvent: 'handleDelete',
has: 'split:sarFileSplitInfo:delete',
show: (record) => { show: (record) => {
// 创建人(更改权限更改的是这个字段)是当前登录人或用户为管理员,且状态为编辑中可以删除 // 创建人(更改权限更改的是这个字段)是当前登录人或用户为管理员,且状态为编辑中可以删除
return (record.createBy === this.userInfo.id || this.administrators) return true
} }
} }
], ],
@@ -248,19 +248,16 @@ export default {
{ {
text: this.$t('edit'), text: this.$t('edit'),
clickEvent: 'handleEdit', clickEvent: 'handleEdit',
has: 'split:sarFileSplitItems:update'
}, },
// 复制 // 复制
{ {
text: this.$t('copy'), text: this.$t('copy'),
clickEvent: 'handleCopy', clickEvent: 'handleCopy',
has: 'split:sarFileSplitItems:copy'
}, },
// 删除 // 删除
{ {
text: this.$t('delete'), text: this.$t('delete'),
clickEvent: 'handleDelete', clickEvent: 'handleDelete',
has: 'split:sarFileSplitItems:delete'
} }
], ],
url: { url: {