This commit is contained in:
dengqichen 2024-12-17 16:59:41 +08:00
parent b3241f51fb
commit df3f6017f2
2 changed files with 16 additions and 12 deletions

View File

@ -183,6 +183,8 @@ const WorkflowDefinitionList: React.FC = () => {
{ {
title: '操作', title: '操作',
key: 'action', key: 'action',
fixed: 'right',
width: 200,
render: (_: any, record: WorkflowDefinition) => ( render: (_: any, record: WorkflowDefinition) => (
<Space size="middle"> <Space size="middle">
{record.status === 'DRAFT' && ( {record.status === 'DRAFT' && (
@ -212,21 +214,20 @@ const WorkflowDefinitionList: React.FC = () => {
} }
> >
<Table <Table
loading={loading}
dataSource={pageData?.content}
columns={columns} columns={columns}
dataSource={pageData?.content}
loading={loading}
rowKey="id" rowKey="id"
scroll={{ x: 1300 }}
pagination={{ pagination={{
total: pageData?.totalElements, current: (query.pageNum || 0) + 1,
pageSize: query.pageSize, pageSize: query.pageSize,
current: query.pageNum + 1, total: pageData?.totalElements || 0,
onChange: (page, pageSize) => { onChange: (page, pageSize) => setQuery({
setQuery({ ...query,
...query, pageNum: page - 1,
pageNum: page - 1, pageSize
pageSize }),
});
}
}} }}
/> />
<EditModal <EditModal

View File

@ -61,7 +61,7 @@ const WorkflowInstanceList: React.FC = () => {
render: (status: string) => { render: (status: string) => {
if (!status) return '暂无'; if (!status) return '暂无';
const statusMap: Record<string, { color: string; text: string }> = { const statusMap: Record<string, { color: string; text: string }> = {
TERMINATED: { color: 'red', text: '终止' }, TERMINATED: { color: 'red', text: '终止' },
COMPLETED: { color: 'green', text: '已完成' }, COMPLETED: { color: 'green', text: '已完成' },
RUNNING: { color: 'blue', text: '运行中' }, RUNNING: { color: 'blue', text: '运行中' },
}; };
@ -72,6 +72,8 @@ const WorkflowInstanceList: React.FC = () => {
{ {
title: '操作', title: '操作',
key: 'action', key: 'action',
fixed: 'right',
width: 120,
render: (_, record) => ( render: (_, record) => (
<Space size="middle"> <Space size="middle">
<a onClick={() => handleViewDetail(record)}></a> <a onClick={() => handleViewDetail(record)}></a>
@ -98,6 +100,7 @@ const WorkflowInstanceList: React.FC = () => {
dataSource={data} dataSource={data}
loading={loading} loading={loading}
rowKey="id" rowKey="id"
scroll={{ x: 1200 }}
locale={{ locale={{
emptyText: <Empty description="暂无数据" /> emptyText: <Empty description="暂无数据" />
}} }}