图标样式更改
This commit is contained in:
@@ -43,13 +43,14 @@ const handleExport = async (values: API.ClassifyJobs.Params) => {
|
||||
}
|
||||
};
|
||||
const buildTree = (data: API.ClassifyJobs.Jobs[], parentId: number = 0,depth = 0): API.ClassifyJobs.Jobs[] => {
|
||||
return data
|
||||
const children = data
|
||||
.filter(item => item.parentId === parentId)
|
||||
.map(item => ({
|
||||
...item,
|
||||
depth,
|
||||
children: buildTree(data, item.jobId,depth + 1),
|
||||
}));
|
||||
return children || [];
|
||||
};
|
||||
|
||||
const ManagementList: React.FC = () => {
|
||||
@@ -73,10 +74,10 @@ const ManagementList: React.FC = () => {
|
||||
title: '岗位名称',
|
||||
dataIndex: 'jobName',
|
||||
|
||||
align: 'center',
|
||||
align: 'left',
|
||||
render: (text, record) => (
|
||||
<span style={{ paddingLeft: `${(record.depth || 0) * 20}px`,display:'inline-block' ,
|
||||
width:'100%'}}>
|
||||
<span style={{ display:'flex',alignItems:'center',
|
||||
}}>
|
||||
{text}
|
||||
</span>
|
||||
),
|
||||
@@ -104,67 +105,22 @@ const ManagementList: React.FC = () => {
|
||||
return <DictTag enums={jobsStatusEnum} value={record.status} />;
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
hideInSearch: true,
|
||||
align: 'center',
|
||||
dataIndex: 'jobId',
|
||||
width: 300,
|
||||
render: (_, record) => [
|
||||
<Button
|
||||
type="link"
|
||||
size="small"
|
||||
key="edit"
|
||||
icon={<FormOutlined />}
|
||||
hidden={!access.hasPerms('system:job:edit')}
|
||||
onClick={() => {
|
||||
setModalVisible(true);
|
||||
setCurrentRow(record);
|
||||
}}
|
||||
>
|
||||
编辑
|
||||
</Button>,
|
||||
// <Button
|
||||
// type="link"
|
||||
// size="small"
|
||||
// danger
|
||||
// key="delete"
|
||||
// icon={<DeleteOutlined />}
|
||||
// hidden={!access.hasPerms('system:job:remove')}
|
||||
// onClick={async () => {
|
||||
// Modal.confirm({
|
||||
// title: '删除',
|
||||
// content: '确定删除该项吗?',
|
||||
// okText: '确认',
|
||||
// cancelText: '取消',
|
||||
// onOk: async () => {
|
||||
// if(record.jobId){
|
||||
// const success = await handleRemoveOne(record.jobId.toString());
|
||||
|
||||
// if (success && actionRef.current) {
|
||||
// actionRef.current.reload();
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
// });
|
||||
// }}
|
||||
// >
|
||||
// 删除
|
||||
// </Button>,
|
||||
],
|
||||
},
|
||||
];
|
||||
return (
|
||||
<Fragment>
|
||||
<div style={{ width: '100%', float: 'right' }}>
|
||||
<ProTable<API.ClassifyJobs.Jobs>
|
||||
// params 是需要自带的参数
|
||||
// 这个参数优先级更高,会覆盖查询表单的参数
|
||||
actionRef={actionRef}
|
||||
formRef={formTableRef}
|
||||
rowKey="jobId"
|
||||
key="index"
|
||||
columns={columns}
|
||||
expandable={{
|
||||
childrenColumnName: 'children',
|
||||
defaultExpandAllRows: true,
|
||||
indentSize:24,
|
||||
rowExpandable: (record) => Array.isArray(record.children) && record.children.length > 0,
|
||||
}}
|
||||
search={{
|
||||
labelWidth: 120,
|
||||
}}
|
||||
@@ -173,7 +129,6 @@ const ManagementList: React.FC = () => {
|
||||
pageSize:1000
|
||||
});
|
||||
const treeData = buildTree(res.rows);
|
||||
console.log('完整树形结构:', JSON.stringify(treeData, null, 2));
|
||||
return {
|
||||
data: treeData,
|
||||
total: res.total,
|
||||
@@ -181,13 +136,6 @@ const ManagementList: React.FC = () => {
|
||||
};
|
||||
}}
|
||||
pagination={false}
|
||||
expandable={{
|
||||
childrenColumnName: 'children',
|
||||
defaultExpandAllRows: true,
|
||||
indentSize:30,
|
||||
rowExpandable: (record) => !!record.children?.length
|
||||
}}
|
||||
|
||||
toolBarRender={() => [
|
||||
<Button
|
||||
type="primary"
|
||||
|
||||
Reference in New Issue
Block a user