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