feat: add detail sidebar for record list page, improve token list page (#3589)

This commit is contained in:
WindSpiritSR
2025-02-16 22:01:25 +08:00
committed by GitHub
parent 26718bc4a1
commit 2a5722e45b
6 changed files with 141 additions and 53 deletions

View File

@ -73,7 +73,7 @@ class BaseListPage extends React.Component {
this.fetch({pagination});
}
getColumnSearchProps = dataIndex => ({
getColumnSearchProps = (dataIndex, customRender = null) => ({
filterDropdown: ({setSelectedKeys, selectedKeys, confirm, clearFilters}) => (
<div style={{padding: 8}}>
<Input
@ -126,8 +126,8 @@ class BaseListPage extends React.Component {
setTimeout(() => this.searchInput.select(), 100);
}
},
render: text =>
this.state.searchedColumn === dataIndex ? (
render: (text, record, index) => {
const highlightContent = this.state.searchedColumn === dataIndex ? (
<Highlighter
highlightStyle={{backgroundColor: "#ffc069", padding: 0}}
searchWords={[this.state.searchText]}
@ -136,7 +136,10 @@ class BaseListPage extends React.Component {
/>
) : (
text
),
);
return customRender ? customRender({text, record, index}, highlightContent) : highlightContent;
},
});
handleSearch = (selectedKeys, confirm, dataIndex) => {