图标样式更改

This commit is contained in:
yy
2025-04-23 15:40:43 +08:00
parent 2224e1acb4
commit e420f518b5
2 changed files with 88 additions and 127 deletions

View File

@@ -20,14 +20,27 @@ body,
.ant-pro-sider.ant-layout-sider.ant-pro-sider-fixed {
left: unset;
}
.ant-table-cell .ant-table-row-expand-icon {
vertical-align: middle;
margin-right: 8px;
}
.ant-table-row {
&-level-0 .ant-table-cell:first-child {
padding-left: 16px !important;
}
&-level-1 .ant-table-cell:first-child {
padding-left: 24px !important;
padding-left: 40px !important;
}
&-level-2 .ant-table-cell:first-child {
padding-left: 48px !important;
padding-left: 64px !important;
}
// 可根据需要添加更多层级
}
.ant-table-row .ant-table-cell:first-child {
display: flex;
align-items: center;
}
.ant-table-row-level-2 .ant-table-row-expand-icon {
display: none;
}
canvas {
display: block;

View File

@@ -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"