diff --git a/src/pages/dataModels/index.tsx b/src/pages/dataModels/index.tsx index 9a83aaa..c577e9e 100644 --- a/src/pages/dataModels/index.tsx +++ b/src/pages/dataModels/index.tsx @@ -40,7 +40,7 @@ type ProjectItem = { export default () => { const [state, setState] = useState({ page: 1, - limit: 6, + limit: 8, total: 0, projects: [], order: "updateTime", @@ -67,7 +67,7 @@ export default () => { total: res.data.total, projects: res.data.records?.map((m: any) => ({ ...m, - avatar: '/logo.svg' + avatar: '/logo.svg', })) }); } else { @@ -135,8 +135,10 @@ export default () => { ), ], }} + grid={{ gutter: 2, column: 4 }} + itemLayout="vertical" rowKey="id" - onRow={(record) => ({ + onItem={(record) => ({ onClick: () => openProject(record), style: { cursor: 'pointer' }, })} @@ -162,19 +164,6 @@ export default () => { dataIndex: 'avatar', search: false, }, - description: { - dataIndex: 'description', - search: false, - render: (text) => ( - - {text} - - ), - }, subTitle: { render: (_, row) => ( @@ -190,42 +179,45 @@ export default () => { search: false, }, content: { - dataIndex: 'updateTime', - render: (text) => ( -
{text}
+ render: (_, record) => ( + + + {record.description} + +
更新时间:{record.updateTime}
+
), }, actions: { - render: (text, row) => { - const actions = []; - - if (row.type === '1') { // Personal project - actions.push( - fetchProjects(null)} - trigger={'ant'} - project={row} - key={'RenameProject' + row.id} - />, - fetchProjects(null)} - project={row} - key={'RemoveProject' + row.id} - /> - ); - } else if (row.type === '2') { // Team project - actions.push( - - ); - } - - return actions; - }, - search: false, + cardActionProps: 'actions', + render: (_, record) => [ + record.type === '1' && ( + fetchProjects(null)} + trigger={'ant'} + project={record} + key={'RenameProject' + record.id} + /> + ), + record.type === '1' && ( + fetchProjects(null)} + project={record} + key={'RemoveProject' + record.id} + /> + ), + record.type === '2' && ( + + ), + ], }, }} />