添加查看详情功能

This commit is contained in:
yy
2025-03-31 17:43:40 +08:00
parent b3238e5c2b
commit b140dd9aae
10 changed files with 346 additions and 122 deletions

View File

@@ -10,7 +10,7 @@ import {
} from '@/services/Management/list';
import { Button, FormInstance, message, Modal, Switch } from 'antd';
import { ActionType, ProColumns, ProTable } from '@ant-design/pro-components';
import { BarChartOutlined, DeleteOutlined, FormOutlined, PlusOutlined } from '@ant-design/icons';
import { AlignLeftOutlined, BarChartOutlined, DeleteOutlined, FormOutlined, PlusOutlined } from '@ant-design/icons';
import EditManageRow from './edit';
import { getDictValueEnum } from '@/services/system/dict';
import DictTag from '@/components/DictTag';
@@ -60,7 +60,7 @@ function ManagementList() {
const [hotEnum, setHotEnum] = useState<any>([]);
const [currentRow, setCurrentRow] = useState<API.ManagementList.Manage>();
const [modalVisible, setModalVisible] = useState<boolean>(false);
const [mode, setMode] = useState<'view' | 'edit' | 'create'>('create');
useEffect(() => {
getDictValueEnum('education', true, true).then((data) => {
setEducationEnum(data);
@@ -178,7 +178,22 @@ function ManagementList() {
dataIndex: 'jobId',
width: 300,
render: (jobId, record) => [
<div key="first-row" style={{ marginBottom: 8, display: 'flex', justifyContent: 'center' }}>
<Button
type="link"
size="small"
key="view"
icon={<AlignLeftOutlined />}
hidden={!access.hasPerms('area:business:List.view')}
onClick={() => {
setCurrentRow(record);
setModalVisible(true);
setMode('view'); // 新增状态控制模式
}}
>
</Button>
<Button
type="link"
size="small"
key="edit"
@@ -187,7 +202,9 @@ function ManagementList() {
onClick={() => history.push(`/management/see-matching/index/${record.jobId}`)}
>
</Button>,
</Button>
</div>,
<div key="second-row" style={{ display: 'flex', justifyContent: 'space-evenly'}}>
<Button
type="link"
size="small"
@@ -200,7 +217,7 @@ function ManagementList() {
}}
>
</Button>,
</Button>
<Button
type="link"
size="small"
@@ -226,7 +243,8 @@ function ManagementList() {
}}
>
</Button>,
</Button>
</div>
],
},
];
@@ -260,6 +278,7 @@ function ManagementList() {
onClick={async () => {
setCurrentRow(undefined);
setModalVisible(true);
setMode('create');
}}
>
<PlusOutlined />
@@ -281,6 +300,7 @@ function ManagementList() {
</div>
<EditManageRow
open={modalVisible}
mode={mode}
onSubmit={async (values) => {
let resData;
if (values.jobId) {