添加查看详情功能
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user