master
This commit is contained in:
parent
57811df6e2
commit
2be569f8eb
|
|
@ -464,6 +464,36 @@ export function renderCols(initialState: any[], type: string, i18n?: AnyObject,
|
||||||
return col;
|
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;
|
return initialState;
|
||||||
}, [initialState, type, i18n, extraParams]);
|
}, [initialState, type, i18n, extraParams]);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue