图标样式更改

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

@@ -1,64 +1,77 @@
html, html,
body, body,
#root { #root {
height: 100%; height: 100%;
margin: 0; margin: 0;
padding: 0; padding: 0;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol',
'Noto Color Emoji'; 'Noto Color Emoji';
} }
.colorWeak { .colorWeak {
filter: invert(80%); filter: invert(80%);
} }
.ant-layout { .ant-layout {
min-height: 100vh !important; min-height: 100vh !important;
} }
.ant-pro-sider.ant-layout-sider.ant-pro-sider-fixed { .ant-pro-sider.ant-layout-sider.ant-pro-sider-fixed {
left: unset; left: unset;
} }
.ant-table-row { .ant-table-cell .ant-table-row-expand-icon {
&-level-1 .ant-table-cell:first-child { vertical-align: middle;
padding-left: 24px !important; margin-right: 8px;
} }
&-level-2 .ant-table-cell:first-child { .ant-table-row {
padding-left: 48px !important; &-level-0 .ant-table-cell:first-child {
} padding-left: 16px !important;
// 可根据需要添加更多层级 }
} &-level-1 .ant-table-cell:first-child {
canvas { padding-left: 40px !important;
display: block; }
} &-level-2 .ant-table-cell:first-child {
padding-left: 64px !important;
body { }
text-rendering: optimizeLegibility; }
-webkit-font-smoothing: antialiased; .ant-table-row .ant-table-cell:first-child {
-moz-osx-font-smoothing: grayscale; display: flex;
} align-items: center;
}
ul, .ant-table-row-level-2 .ant-table-row-expand-icon {
ol { display: none;
list-style: none; }
} canvas {
display: block;
@media (max-width: 768px) { }
.ant-table {
width: 100%; body {
overflow-x: auto; text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
&-thead > tr, -moz-osx-font-smoothing: grayscale;
&-tbody > tr { }
> th,
> td { ul,
white-space: pre; ol {
list-style: none;
> span { }
display: block;
} @media (max-width: 768px) {
} .ant-table {
} width: 100%;
} overflow-x: auto;
}
&-thead > tr,
&-tbody > tr {
> th,
> td {
white-space: pre;
> span {
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[] => { const buildTree = (data: API.ClassifyJobs.Jobs[], parentId: number = 0,depth = 0): API.ClassifyJobs.Jobs[] => {
return data const children = data
.filter(item => item.parentId === parentId) .filter(item => item.parentId === parentId)
.map(item => ({ .map(item => ({
...item, ...item,
depth, depth,
children: buildTree(data, item.jobId,depth + 1), children: buildTree(data, item.jobId,depth + 1),
})); }));
return children || [];
}; };
const ManagementList: React.FC = () => { const ManagementList: React.FC = () => {
@@ -73,10 +74,10 @@ const ManagementList: React.FC = () => {
title: '岗位名称', title: '岗位名称',
dataIndex: 'jobName', dataIndex: 'jobName',
align: 'center', align: 'left',
render: (text, record) => ( render: (text, record) => (
<span style={{ paddingLeft: `${(record.depth || 0) * 20}px`,display:'inline-block' , <span style={{ display:'flex',alignItems:'center',
width:'100%'}}> }}>
{text} {text}
</span> </span>
), ),
@@ -104,67 +105,22 @@ const ManagementList: React.FC = () => {
return <DictTag enums={jobsStatusEnum} value={record.status} />; 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 ( return (
<Fragment> <Fragment>
<div style={{ width: '100%', float: 'right' }}> <div style={{ width: '100%', float: 'right' }}>
<ProTable<API.ClassifyJobs.Jobs> <ProTable<API.ClassifyJobs.Jobs>
// params 是需要自带的参数
// 这个参数优先级更高,会覆盖查询表单的参数
actionRef={actionRef} actionRef={actionRef}
formRef={formTableRef} formRef={formTableRef}
rowKey="jobId" rowKey="jobId"
key="index" key="index"
columns={columns} columns={columns}
expandable={{
childrenColumnName: 'children',
defaultExpandAllRows: true,
indentSize:24,
rowExpandable: (record) => Array.isArray(record.children) && record.children.length > 0,
}}
search={{ search={{
labelWidth: 120, labelWidth: 120,
}} }}
@@ -173,7 +129,6 @@ const ManagementList: React.FC = () => {
pageSize:1000 pageSize:1000
}); });
const treeData = buildTree(res.rows); const treeData = buildTree(res.rows);
console.log('完整树形结构:', JSON.stringify(treeData, null, 2));
return { return {
data: treeData, data: treeData,
total: res.total, total: res.total,
@@ -181,13 +136,6 @@ const ManagementList: React.FC = () => {
}; };
}} }}
pagination={false} pagination={false}
expandable={{
childrenColumnName: 'children',
defaultExpandAllRows: true,
indentSize:30,
rowExpandable: (record) => !!record.children?.length
}}
toolBarRender={() => [ toolBarRender={() => [
<Button <Button
type="primary" type="primary"