feat(project-management): 优化文件归档表格状态展示和权限控制
This commit is contained in:
@@ -318,10 +318,18 @@ const tableConfig = reactive({
|
||||
width: 100,
|
||||
showOverflowTooltip: false,
|
||||
currentRender: ({row, index}) => {
|
||||
if (row.state !== null) {
|
||||
return (<Tag dictType={'project_filing'} value={row.state}/>)
|
||||
} else {
|
||||
return '--'
|
||||
let buttons = new Set(Array.from(row.buttons))
|
||||
if (!buttons.has("openFileSwitch")&&row.state!=1) {
|
||||
console.log('row',row)
|
||||
return (<Tag dictType={'project_filing'} value={'0'}/>)
|
||||
}else if (buttons.has("openFileSwitch")) {
|
||||
return (<Tag dictType={'project_filing'} value={'4'}/>)
|
||||
}else{
|
||||
if (row.state !== null) {
|
||||
return (<Tag dictType={'project_filing'} value={row.state}/>)
|
||||
} else {
|
||||
return '--'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -348,10 +356,10 @@ const tableConfig = reactive({
|
||||
btn.push({label: '编辑', prem: ['project:management:filing:conclusion'], func: () => handleEdit(row), type: 'primary'})
|
||||
}
|
||||
if (buttons.has("openFileSwitch")) {
|
||||
btn.push({label: '开启上传', prem: ['project:management:filing:conclusion'], func: () => handleOpenUpload(row,true), type: 'primary'})
|
||||
btn.push({label: '开启上传', prem: ['filing:attachment:switch'], func: () => handleOpenUpload(row,true), type: 'primary'})
|
||||
}
|
||||
if (buttons.has("closeFileSwitch")) {
|
||||
btn.push({label: '关闭上传', prem: ['project:management:filing:conclusion'], func: () => handleOpenUpload(row,false), type: 'primary'})
|
||||
btn.push({label: '关闭上传', prem: ['filing:attachment:switch'], func: () => handleOpenUpload(row,false), type: 'primary'})
|
||||
}
|
||||
return (
|
||||
<div style={{width: '100%'}}>
|
||||
@@ -426,6 +434,7 @@ const handleEdit = (row) => {
|
||||
})
|
||||
}
|
||||
const handleOpenUpload=(row,flag)=>{
|
||||
console.log('tableIns',tableIns.value)
|
||||
ElMessageBox.confirm(`是否确认${flag?'开启':'关闭'}上传文件?`, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
|
||||
Reference in New Issue
Block a user