fix : 修复权限按钮细节

This commit is contained in:
2024-05-23 23:42:09 +08:00
parent 43c9cb03d3
commit 549e307b3e
17 changed files with 276 additions and 118 deletions

View File

@@ -102,6 +102,11 @@ const tableConfig = reactive({
label: '所属公司',
align: 'center'
},
{
prop: 'approveName',
label: '审批人',
align: 'center'
},
{
prop: 'projectType',
label: '项目类型',
@@ -127,6 +132,11 @@ const tableConfig = reactive({
label: '起止时间',
align: 'center'
},
{
prop: 'taskNode',
label: '当前节点',
align: 'center'
},
{
prop: 'state',
label: '状态',
@@ -146,20 +156,27 @@ const tableConfig = reactive({
align: 'center',
showOverflowTooltip: false,
currentRender: ({row, index}) => {
let btn = [{label: '详情', func: () => handleDetail(row), type: 'primary'}]
// if (row.state === '3') {
btn.push({label: '附件', func: () => handleAttachment(row), type: 'primary'})
// } else if (row.state === '4') {
btn.push({label: '结项', func: () => handleConclusion(row), type: 'primary'})
btn.push({label: '编辑', func: () => handleEdit(row), type: 'primary'})
// }
let btn = []
let buttons = new Set(Array.from(row.buttons))
if (buttons.has("details")) {
btn.push({label: '详情', prem: ['mosr:requirement:info'], func: () => handleDetail(row), type: 'primary'})
}
if (buttons.has("attachments")) {
btn.push({label: '附件',prem: ['mosr:requirement:resubmit'], func: () => handleAttachment(row), type: 'primary'})
}
if (buttons.has("entry")) {
btn.push({label: '结项',prem: ['mosr:requirement:del'], func: () => handleConclusion(row), type: 'primary'})
}
if (buttons.has("edit")) {
btn.push({label: '编辑',prem: ['mosr:requirement:info'], func: () => handleEdit(row), type: 'primary'})
}
return (
<div style={{width: '100%'}}>
{
btn.map(item => (
<el-button
type={item.type}
// v-perm={item.auth}
v-perm={item.prem}
onClick={() => item.func()}
link
>
@@ -185,7 +202,8 @@ const handleDetail = (row) => {
router.push({
name:'Filing/detail',
query: {
id: row.requirementId
id: row.requirementId,
projectId: row.projectId
}
})
}