✨ feat: 更新招聘会时间字段标签和验证逻辑
Some checks failed
Node CI / build (14.x, macOS-latest) (push) Has been cancelled
Node CI / build (14.x, ubuntu-latest) (push) Has been cancelled
Node CI / build (14.x, windows-latest) (push) Has been cancelled
Node CI / build (16.x, macOS-latest) (push) Has been cancelled
Node CI / build (16.x, ubuntu-latest) (push) Has been cancelled
Node CI / build (16.x, windows-latest) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
coverage CI / build (push) Has been cancelled
Node pnpm CI / build (16.x, macOS-latest) (push) Has been cancelled
Node pnpm CI / build (16.x, ubuntu-latest) (push) Has been cancelled
Node pnpm CI / build (16.x, windows-latest) (push) Has been cancelled
Some checks failed
Node CI / build (14.x, macOS-latest) (push) Has been cancelled
Node CI / build (14.x, ubuntu-latest) (push) Has been cancelled
Node CI / build (14.x, windows-latest) (push) Has been cancelled
Node CI / build (16.x, macOS-latest) (push) Has been cancelled
Node CI / build (16.x, ubuntu-latest) (push) Has been cancelled
Node CI / build (16.x, windows-latest) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
coverage CI / build (push) Has been cancelled
Node pnpm CI / build (16.x, macOS-latest) (push) Has been cancelled
Node pnpm CI / build (16.x, ubuntu-latest) (push) Has been cancelled
Node pnpm CI / build (16.x, windows-latest) (push) Has been cancelled
This commit is contained in:
@@ -139,9 +139,9 @@ const FairInfoTab: React.FC<Props> = ({ fairInfo, onFairUpdate }) => {
|
|||||||
</Descriptions.Item>
|
</Descriptions.Item>
|
||||||
<Descriptions.Item label="展位数量">{fairInfo.boothCount}</Descriptions.Item>
|
<Descriptions.Item label="展位数量">{fairInfo.boothCount}</Descriptions.Item>
|
||||||
<Descriptions.Item label="举办时间">{fairInfo.holdTime}</Descriptions.Item>
|
<Descriptions.Item label="举办时间">{fairInfo.holdTime}</Descriptions.Item>
|
||||||
<Descriptions.Item label="截止时间">{fairInfo.endTime}</Descriptions.Item>
|
<Descriptions.Item label="结束时间">{fairInfo.endTime}</Descriptions.Item>
|
||||||
<Descriptions.Item label="开放申请">{fairInfo.applyStartTime}</Descriptions.Item>
|
<Descriptions.Item label="报名开始时间">{fairInfo.applyStartTime}</Descriptions.Item>
|
||||||
<Descriptions.Item label="截止申请">{fairInfo.applyEndTime}</Descriptions.Item>
|
<Descriptions.Item label="报名截止时间">{fairInfo.applyEndTime}</Descriptions.Item>
|
||||||
<Descriptions.Item label="线上申请">
|
<Descriptions.Item label="线上申请">
|
||||||
{fairInfo.onlineApply ? '是' : '否'}
|
{fairInfo.onlineApply ? '是' : '否'}
|
||||||
</Descriptions.Item>
|
</Descriptions.Item>
|
||||||
|
|||||||
@@ -35,9 +35,9 @@ const CompanyFairDetailModal: React.FC<Props> = ({ fair, open, onCancel }) => (
|
|||||||
<Descriptions.Item label="展位数量">{fair.boothCount ?? '--'}</Descriptions.Item>
|
<Descriptions.Item label="展位数量">{fair.boothCount ?? '--'}</Descriptions.Item>
|
||||||
<Descriptions.Item label="已预定摊位数">{fair.reservedBoothCount ?? 0}</Descriptions.Item>
|
<Descriptions.Item label="已预定摊位数">{fair.reservedBoothCount ?? 0}</Descriptions.Item>
|
||||||
<Descriptions.Item label="举办时间">{fair.holdTime || '--'}</Descriptions.Item>
|
<Descriptions.Item label="举办时间">{fair.holdTime || '--'}</Descriptions.Item>
|
||||||
<Descriptions.Item label="截止时间">{fair.endTime || '--'}</Descriptions.Item>
|
<Descriptions.Item label="结束时间">{fair.endTime || '--'}</Descriptions.Item>
|
||||||
<Descriptions.Item label="开放申请">{fair.applyStartTime || '--'}</Descriptions.Item>
|
<Descriptions.Item label="报名开始时间">{fair.applyStartTime || '--'}</Descriptions.Item>
|
||||||
<Descriptions.Item label="截止申请">{fair.applyEndTime || '--'}</Descriptions.Item>
|
<Descriptions.Item label="报名截止时间">{fair.applyEndTime || '--'}</Descriptions.Item>
|
||||||
<Descriptions.Item label="线上申请">
|
<Descriptions.Item label="线上申请">
|
||||||
<Tag color={fair.onlineApply ? 'green' : 'default'}>{fair.onlineApply ? '是' : '否'}</Tag>
|
<Tag color={fair.onlineApply ? 'green' : 'default'}>{fair.onlineApply ? '是' : '否'}</Tag>
|
||||||
</Descriptions.Item>
|
</Descriptions.Item>
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import {
|
|||||||
} from '@ant-design/pro-components';
|
} from '@ant-design/pro-components';
|
||||||
import { Button, Divider, Form, Image, Input, message, Modal, Space, Upload } from 'antd';
|
import { Button, Divider, Form, Image, Input, message, Modal, Space, Upload } from 'antd';
|
||||||
import { PlusOutlined, UploadOutlined } from '@ant-design/icons';
|
import { PlusOutlined, UploadOutlined } from '@ant-design/icons';
|
||||||
|
import dayjs from 'dayjs';
|
||||||
import type {
|
import type {
|
||||||
OutdoorFairItem,
|
OutdoorFairItem,
|
||||||
OutdoorFairForm,
|
OutdoorFairForm,
|
||||||
@@ -140,6 +141,19 @@ const EditModal: React.FC<EditModalProps> = ({
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const validateRegistrationDeadline = (_rule: unknown, value: unknown) => {
|
||||||
|
const holdTime = form.getFieldValue('holdTime');
|
||||||
|
if (!value || !holdTime) {
|
||||||
|
return Promise.resolve();
|
||||||
|
}
|
||||||
|
const deadline = dayjs(value as any);
|
||||||
|
const fairHoldTime = dayjs(holdTime);
|
||||||
|
if (!deadline.isValid() || !fairHoldTime.isValid() || !deadline.isAfter(fairHoldTime)) {
|
||||||
|
return Promise.resolve();
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error('报名截止时间不能晚于招聘会举办时间'));
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ModalForm
|
<ModalForm
|
||||||
title={values ? '编辑线下招聘会' : '新增线下招聘会'}
|
title={values ? '编辑线下招聘会' : '新增线下招聘会'}
|
||||||
@@ -270,25 +284,29 @@ const EditModal: React.FC<EditModalProps> = ({
|
|||||||
/>
|
/>
|
||||||
<ProFormDateTimePicker
|
<ProFormDateTimePicker
|
||||||
name="endTime"
|
name="endTime"
|
||||||
label="截止时间"
|
label="结束时间"
|
||||||
width="md"
|
width="md"
|
||||||
rules={[{ required: true, message: '请选择截止时间' }]}
|
rules={[{ required: true, message: '请选择招聘会结束时间' }]}
|
||||||
fieldProps={{ format: 'YYYY-MM-DD HH:mm:ss' }}
|
fieldProps={{ format: 'YYYY-MM-DD HH:mm:ss' }}
|
||||||
/>
|
/>
|
||||||
</ProForm.Group>
|
</ProForm.Group>
|
||||||
<ProForm.Group>
|
<ProForm.Group>
|
||||||
<ProFormDateTimePicker
|
<ProFormDateTimePicker
|
||||||
name="applyStartTime"
|
name="applyStartTime"
|
||||||
label="开放申请"
|
label="报名开始时间"
|
||||||
width="md"
|
width="md"
|
||||||
rules={[{ required: true, message: '请选择开放申请时间' }]}
|
rules={[{ required: true, message: '请选择报名开始时间' }]}
|
||||||
fieldProps={{ format: 'YYYY-MM-DD HH:mm:ss' }}
|
fieldProps={{ format: 'YYYY-MM-DD HH:mm:ss' }}
|
||||||
/>
|
/>
|
||||||
<ProFormDateTimePicker
|
<ProFormDateTimePicker
|
||||||
name="applyEndTime"
|
name="applyEndTime"
|
||||||
label="截止申请"
|
label="报名截止时间"
|
||||||
width="md"
|
width="md"
|
||||||
rules={[{ required: true, message: '请选择截止申请时间' }]}
|
dependencies={['holdTime']}
|
||||||
|
rules={[
|
||||||
|
{ required: true, message: '请选择报名截止时间' },
|
||||||
|
{ validator: validateRegistrationDeadline },
|
||||||
|
]}
|
||||||
fieldProps={{ format: 'YYYY-MM-DD HH:mm:ss' }}
|
fieldProps={{ format: 'YYYY-MM-DD HH:mm:ss' }}
|
||||||
/>
|
/>
|
||||||
</ProForm.Group>
|
</ProForm.Group>
|
||||||
|
|||||||
Reference in New Issue
Block a user