feat : 按钮全新啊demo

This commit is contained in:
clay
2024-05-23 15:48:31 +08:00
parent d6de4d5854
commit 17207b2c87

View File

@@ -94,11 +94,17 @@ const tableConfig = reactive({
align: 'center',
showOverflowTooltip: false,
currentRender: ({row, index}) => {
console.log('row',row.buttons)
let btn = [{label: '详情', func: () => handleDetail(row), type: 'primary'}]
if (row.state === '3' || row.state === '2') {
let btn = []
let buttons = new Set(Array.from(row.buttons))
if (buttons.has("details")){
btn.push({label: '详情', func: () => handleDetail(row), type: 'primary'})
}
if (buttons.has("edit")) {
btn.push({label: '编辑', func: () => handleEdit(row), type: 'primary'})
}
if (buttons.has("report")) {
btn.push({label: '需求上报', func: () => handleEdit(row), type: 'primary'})
}
return (
<div style={{width: '100%'}}>
{