This commit is contained in:
lys 2025-06-11 09:55:13 +08:00
parent 57811df6e2
commit 2be569f8eb
1 changed files with 30 additions and 0 deletions

View File

@ -464,6 +464,36 @@ export function renderCols(initialState: any[], type: string, i18n?: AnyObject,
return col;
})
];
} else if (type === "declare") {
return [
..._.map(initialState, (g) => {
let col = { ...g, ellipsis: true };
switch (g.dataIndex) {
case "operate":
col = {
...col,
ellipsis: false,
width: 120,
render: (__: string, record: any) => {
return (
<Space>
{_.map(col?.operateType, (o) => (
<Button key={o.key} type="link" onClick={() => postMessageToParent(o.key, record)}>
{o.label}
</Button>
))}
</Space>
);
}
};
break;
default:
col = { ...col };
break;
}
return col;
})
];
}
return initialState;
}, [initialState, type, i18n, extraParams]);