feat(react-web-next): 新增.editorconfig和.prettierrc配置文件,添加public/.gitkeep占位文件
This commit is contained in:
@@ -0,0 +1,65 @@
|
||||
import React, { useState } from 'react';
|
||||
import { PageContainer, ProFormText, ProTable, ProFormSelect } from '@ant-design/pro-components';
|
||||
import { Popconfirm, Space, message } from 'antd';
|
||||
import { PlusOutlined } from '@ant-design/icons';
|
||||
import { ordersApi } from '@/services/orders';
|
||||
import { ActionBar, GradientButton, SearchBarPlus } from '@/components/ui';
|
||||
|
||||
const EditTaskPage: React.FC = () => {
|
||||
const [params, setParams] = useState<Record<string, any>>({});
|
||||
|
||||
const columns: any[] = [
|
||||
{ dataIndex: 'index', valueType: 'indexBorder', width: 48 },
|
||||
{ title: '任务ID', dataIndex: 'id' },
|
||||
{ title: '订单号', dataIndex: 'orderNo' },
|
||||
{ title: '状态', dataIndex: 'status' },
|
||||
{ title: '创建时间', dataIndex: 'createTime', valueType: 'dateTime' },
|
||||
{
|
||||
title: '操作', key: 'action',
|
||||
render: (_: any, record: any) => (
|
||||
<Space>
|
||||
<Popconfirm title="确认删除?" onConfirm={async () => { try { await ordersApi.deleteEditTask(record.id); message.success('删除成功'); } catch { message.error('删除失败'); } }}>
|
||||
<a style={{ color: '#1677ff' }}>删除</a>
|
||||
</Popconfirm>
|
||||
</Space>
|
||||
)
|
||||
},
|
||||
];
|
||||
|
||||
return (
|
||||
<PageContainer header={{ title: '剪辑任务' }}>
|
||||
<SearchBarPlus
|
||||
defaultCollapsed={false}
|
||||
split
|
||||
span={8}
|
||||
onTenantChanged={() => { /* 后端上下文 */ }}
|
||||
onFinish={async (values) => setParams(values)}
|
||||
>
|
||||
<ProFormText name="orderNo" label="订单号" />
|
||||
<ProFormSelect name="status" label="状态" valueEnum={{ pending: '待处理', processing: '处理中', done: '完成' }} />
|
||||
</SearchBarPlus>
|
||||
|
||||
<ActionBar
|
||||
left={
|
||||
<Space>
|
||||
<GradientButton size="middle" type="primary" icon={<PlusOutlined />} onClick={async () => {
|
||||
const hide = message.loading('提交中...');
|
||||
try { await ordersApi.saveOrUpdateEditTask({ orderNo: 'DEMO' }); message.success('新增成功'); } catch { message.error('新增失败'); } finally { hide(); }
|
||||
}}>新增</GradientButton>
|
||||
</Space>
|
||||
}
|
||||
/>
|
||||
|
||||
<ProTable<any>
|
||||
rowKey="id"
|
||||
request={(p) => ordersApi.getEditTaskList({ ...p, ...params } as any)}
|
||||
columns={columns}
|
||||
search={false}
|
||||
pagination={{ showSizeChanger: true, showQuickJumper: true }}
|
||||
/>
|
||||
</PageContainer>
|
||||
);
|
||||
};
|
||||
|
||||
export default EditTaskPage;
|
||||
|
||||
Reference in New Issue
Block a user