|
|
|
@ -1,5 +1,6 @@
|
|
|
|
|
import React, { useRef } from 'react';
|
|
|
|
|
import { history } from 'umi';
|
|
|
|
|
import React, { useRef,useState } from 'react';
|
|
|
|
|
import { history,useRequest } from 'umi';
|
|
|
|
|
import Base64 from 'base64-js';
|
|
|
|
|
import { ProFormInstance, ProFormRadio } from '@ant-design/pro-form';
|
|
|
|
|
import ProForm, {
|
|
|
|
|
StepsForm,
|
|
|
|
@ -14,7 +15,8 @@ import ProCard from '@ant-design/pro-card';
|
|
|
|
|
import { Button, Col, message, Row } from 'antd';
|
|
|
|
|
import { PageContainer } from '@ant-design/pro-layout';
|
|
|
|
|
import ProDescriptions from '@ant-design/pro-descriptions';
|
|
|
|
|
|
|
|
|
|
import { queryExaminationRule,queryPersonInfo,savePersonSignUpInfo } from './service';
|
|
|
|
|
import cookie from 'react-cookies';
|
|
|
|
|
const waitTime = (time: number = 100) => {
|
|
|
|
|
return new Promise((resolve) => {
|
|
|
|
|
setTimeout(() => {
|
|
|
|
@ -23,9 +25,35 @@ const waitTime = (time: number = 100) => {
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export default () => {
|
|
|
|
|
const formRef = useRef<ProFormInstance>();
|
|
|
|
|
const [baseInfo, setBaseInfo] = useState({});
|
|
|
|
|
const [testInfo, setTestInfo] = useState({});
|
|
|
|
|
const [backInfo, setBackInfo] = useState({});
|
|
|
|
|
|
|
|
|
|
const data = useRequest(() => {
|
|
|
|
|
return queryPersonInfo({
|
|
|
|
|
identity_id:cookie.load('identity_id'),
|
|
|
|
|
person_id:cookie.load('person_id')
|
|
|
|
|
});
|
|
|
|
|
},{
|
|
|
|
|
formatResult: (result) => {
|
|
|
|
|
console.log('result',result);
|
|
|
|
|
setBackInfo(result.table_List);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
// /** 获取题型 */
|
|
|
|
|
// const { data } = useRequest(() => {
|
|
|
|
|
// return queryExaminationRule();
|
|
|
|
|
// },{
|
|
|
|
|
// formatResult: (result) => {
|
|
|
|
|
// return result;
|
|
|
|
|
// }
|
|
|
|
|
// });
|
|
|
|
|
console.log('valu111111111111e',backInfo);
|
|
|
|
|
return (
|
|
|
|
|
<PageContainer content={''} extraContent={''}>
|
|
|
|
|
<ProCard>
|
|
|
|
@ -34,7 +62,7 @@ export default () => {
|
|
|
|
|
}>
|
|
|
|
|
formRef={formRef}
|
|
|
|
|
onFinish={async () => {
|
|
|
|
|
await waitTime(1000);
|
|
|
|
|
const data = await waitTime(1000);
|
|
|
|
|
message.success('提交成功');
|
|
|
|
|
}}
|
|
|
|
|
formProps={{
|
|
|
|
@ -54,9 +82,11 @@ export default () => {
|
|
|
|
|
stepProps={{
|
|
|
|
|
description: false,
|
|
|
|
|
}}
|
|
|
|
|
onFinish={async () => {
|
|
|
|
|
onFinish={async (values) => {
|
|
|
|
|
console.log('values',values);
|
|
|
|
|
console.log(formRef.current?.getFieldsValue());
|
|
|
|
|
await waitTime(2000);
|
|
|
|
|
setBaseInfo(values);
|
|
|
|
|
return true;
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
@ -68,76 +98,104 @@ export default () => {
|
|
|
|
|
width="md"
|
|
|
|
|
// tooltip="最长为 6 位汉字,需要与考生身份证一致"
|
|
|
|
|
placeholder="请输入姓名"
|
|
|
|
|
value={backInfo?.person_name}
|
|
|
|
|
// rules={[{ required: true }]}
|
|
|
|
|
value="锦书"
|
|
|
|
|
disabled
|
|
|
|
|
/>
|
|
|
|
|
<ProFormText name="idcard" label="身份证" />
|
|
|
|
|
<ProFormDatePicker name="birthday" label="出生年月" />
|
|
|
|
|
<ProFormRadio.Group
|
|
|
|
|
options={[
|
|
|
|
|
<ProFormSelect
|
|
|
|
|
label='性别'
|
|
|
|
|
name="sex"
|
|
|
|
|
rules={[{ required: true, message: '请选择性别' }]}
|
|
|
|
|
options={[
|
|
|
|
|
{
|
|
|
|
|
value: '1',
|
|
|
|
|
label: '男',
|
|
|
|
|
label: '男',
|
|
|
|
|
value: '男',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
value: '2',
|
|
|
|
|
label: '女',
|
|
|
|
|
label: '女',
|
|
|
|
|
value: '女',
|
|
|
|
|
},
|
|
|
|
|
]}
|
|
|
|
|
label="性别"
|
|
|
|
|
name="sex"
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
]}
|
|
|
|
|
placeholder="请选择"
|
|
|
|
|
/>
|
|
|
|
|
<ProFormDatePicker name="birthday"
|
|
|
|
|
label="出生年月"
|
|
|
|
|
fieldProps={{
|
|
|
|
|
format: 'YYYY-MM',
|
|
|
|
|
}}
|
|
|
|
|
/>
|
|
|
|
|
<ProFormText name="idCard" label="身份证号" />
|
|
|
|
|
<ProFormText name="address" label="家庭地址" />
|
|
|
|
|
<ProFormText name="contact" label="联系方式" width="lg" placeholder="联系方式" />
|
|
|
|
|
<ProFormText name="contact" label="联系方式" width="lg" placeholder="联系方式" />
|
|
|
|
|
</Col>
|
|
|
|
|
<Col lg={12} md={12} sm={24}>
|
|
|
|
|
<ProFormText name="org" label="所在学校" width="lg" placeholder="请填写" value='昆明市第一中学' disabled />
|
|
|
|
|
<ProFormText name="org" label="所在学校" width="md" placeholder="请填写" value={backInfo?.bureau_name} disabled />
|
|
|
|
|
<ProFormSelect
|
|
|
|
|
label='最高学历'
|
|
|
|
|
name="owner"
|
|
|
|
|
name="qualifications"
|
|
|
|
|
rules={[{ required: true, message: '请选择最高学历' }]}
|
|
|
|
|
options={[
|
|
|
|
|
{
|
|
|
|
|
label: '研究生',
|
|
|
|
|
value: '3',
|
|
|
|
|
label: '大专',
|
|
|
|
|
value: '大专',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: '本科',
|
|
|
|
|
value: '2',
|
|
|
|
|
label: '全日制本科',
|
|
|
|
|
value: '全日制本科',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: '专科',
|
|
|
|
|
value: '1',
|
|
|
|
|
label: '硕士研究生及以上...',
|
|
|
|
|
value: '硕士研究生及以上...',
|
|
|
|
|
},
|
|
|
|
|
]}
|
|
|
|
|
placeholder="请选择"
|
|
|
|
|
/>
|
|
|
|
|
<ProFormText name="address" label="毕业学校" />
|
|
|
|
|
<ProFormText name="address" label="专业" />
|
|
|
|
|
<ProFormText name="graduation" label="毕业院校" />
|
|
|
|
|
<ProFormText name="major" label="专业" />
|
|
|
|
|
<ProFormSelect
|
|
|
|
|
label='任教学科'
|
|
|
|
|
name="owner"
|
|
|
|
|
rules={[{ required: true, message: '请选择最高学历' }]}
|
|
|
|
|
name="subject"
|
|
|
|
|
rules={[{ required: true, message: '请选择任教学科' }]}
|
|
|
|
|
options={[
|
|
|
|
|
{
|
|
|
|
|
label: '语文',
|
|
|
|
|
value: '3',
|
|
|
|
|
value: '语文',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: '数学',
|
|
|
|
|
value: '2',
|
|
|
|
|
value: '数学',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: '英语',
|
|
|
|
|
value: '1',
|
|
|
|
|
value: '英语',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: '物理',
|
|
|
|
|
value: '物理',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: '化学',
|
|
|
|
|
value: '化学',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: '生物',
|
|
|
|
|
value: '生物',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: '历史',
|
|
|
|
|
value: '历史',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: '地理',
|
|
|
|
|
value: '地理',
|
|
|
|
|
},
|
|
|
|
|
]}
|
|
|
|
|
placeholder="请选择"
|
|
|
|
|
/>
|
|
|
|
|
</Col>
|
|
|
|
|
</Row>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</StepsForm.StepForm>
|
|
|
|
|
|
|
|
|
|
<StepsForm.StepForm<{
|
|
|
|
@ -149,7 +207,8 @@ export default () => {
|
|
|
|
|
description: false,
|
|
|
|
|
}}
|
|
|
|
|
onFinish={async () => {
|
|
|
|
|
console.log(formRef.current?.getFieldsValue());
|
|
|
|
|
// console.log('1111s',formRef.current?.getFieldsValue());
|
|
|
|
|
await waitTime(2000);
|
|
|
|
|
return true;
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
@ -157,12 +216,25 @@ export default () => {
|
|
|
|
|
layout='horizontal'
|
|
|
|
|
column={1}
|
|
|
|
|
//actionRef={actionRef}
|
|
|
|
|
title="高级定义列表 request"
|
|
|
|
|
request={async () => {
|
|
|
|
|
return Promise.resolve({
|
|
|
|
|
request={async (value) => {
|
|
|
|
|
const data = await queryExaminationRule({
|
|
|
|
|
examination_id: 1
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
setTestInfo(data.bean);
|
|
|
|
|
const dom=data.bean.examination_start_time+'-'+data.bean.examination_end_time;
|
|
|
|
|
return Promise.resolve({
|
|
|
|
|
success: true,
|
|
|
|
|
data: { id: '这是一段文本', object:'', date: '2020-07-30 08:00', duration:'', grade:100, through:'>60', learn: '>20 min', times: 2 },
|
|
|
|
|
});
|
|
|
|
|
data: { id: data?.bean.id,
|
|
|
|
|
object:data?.bean.examination_name,
|
|
|
|
|
date:data?dom:'--',
|
|
|
|
|
duration:data?.bean.examination_time+'分钟',
|
|
|
|
|
grade:data?.bean.sum_score+'分',
|
|
|
|
|
through:data?.bean.pass_score+'分',
|
|
|
|
|
learn:data?'在线学习时长不低于'+data.bean.learning_time+'分钟':'--',
|
|
|
|
|
},
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
}}
|
|
|
|
|
extra={false}
|
|
|
|
|
>
|
|
|
|
@ -173,7 +245,6 @@ export default () => {
|
|
|
|
|
<ProDescriptions.Item dataIndex="grade" label="满分" valueType="text" />
|
|
|
|
|
<ProDescriptions.Item dataIndex="through" label="通过标准" valueType="text" />
|
|
|
|
|
<ProDescriptions.Item dataIndex="learn" label="报名要求" valueType="text" />
|
|
|
|
|
<ProDescriptions.Item dataIndex="times" label="考试次数" valueType="text" />
|
|
|
|
|
</ProDescriptions>
|
|
|
|
|
</StepsForm.StepForm>
|
|
|
|
|
|
|
|
|
@ -186,59 +257,107 @@ export default () => {
|
|
|
|
|
onFinish={async () => {
|
|
|
|
|
console.log(formRef.current?.getFieldsValue());
|
|
|
|
|
// 跳转到指定路由
|
|
|
|
|
history.push('/registration/success');
|
|
|
|
|
return true;
|
|
|
|
|
// const success = await savePersonSignUpInfo({
|
|
|
|
|
// address:baseInfo?.address,
|
|
|
|
|
// birthday:baseInfo?.birthday,
|
|
|
|
|
// bureau_id:backInfo?.bureau_id,
|
|
|
|
|
// bureau_name:backInfo?.bureau_name,
|
|
|
|
|
// city_id:backInfo?.city_id,
|
|
|
|
|
// city_name:backInfo?.city_name,
|
|
|
|
|
// district_id:backInfo?.district_id,
|
|
|
|
|
// district_name:backInfo?.district_name,
|
|
|
|
|
// education:baseInfo?.qualifications,
|
|
|
|
|
// examination_id:1,
|
|
|
|
|
// gender:baseInfo?.sex,
|
|
|
|
|
// id_code:baseInfo?.idCard,
|
|
|
|
|
// identity_id:backInfo?.identity_id,
|
|
|
|
|
// major:baseInfo?.major,
|
|
|
|
|
// person_id:backInfo?.person_id,
|
|
|
|
|
// person_name:backInfo?.person_name,
|
|
|
|
|
// province_id:backInfo?.province_id,
|
|
|
|
|
// province_name:backInfo?.province_name,
|
|
|
|
|
// subject:baseInfo?.subject,
|
|
|
|
|
// tel:baseInfo?.contact,
|
|
|
|
|
// university:baseInfo?.graduation,
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
|
|
// console.log('success',success);
|
|
|
|
|
|
|
|
|
|
// if (success) {
|
|
|
|
|
// const msg='你已报名'+testInfo.examination_start_time+'-'+testInfo.examination_end_time+' '+testInfo.examination_name+',准考证号是'+success.admission_number+',请准时参加考试!';
|
|
|
|
|
// const info=JSON.stringify(msg)
|
|
|
|
|
// console.log('msg',msg);
|
|
|
|
|
// console.log('info',info);
|
|
|
|
|
// history.push( '/registration/success/'+info);
|
|
|
|
|
//
|
|
|
|
|
// // history.push('/registration/success');
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
const msg='你已报名'+testInfo.examination_start_time+'-'+testInfo.examination_end_time+' '+testInfo.examination_name+',准考证号是'+',请准时参加考试!';
|
|
|
|
|
const info=Base64.toByteArray(msg.toString());
|
|
|
|
|
console.log('info',info);
|
|
|
|
|
const aa=Base64.decode(info);
|
|
|
|
|
console.log('msg',msg);
|
|
|
|
|
// console.log('info',info);
|
|
|
|
|
console.log('aa',aa)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// return true;
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<Row gutter={24}>
|
|
|
|
|
<Col lg={12} md={12} sm={24}>
|
|
|
|
|
<ProDescriptions
|
|
|
|
|
layout='horizontal'
|
|
|
|
|
column={1}
|
|
|
|
|
//actionRef={actionRef}
|
|
|
|
|
title="高级定义列表 request"
|
|
|
|
|
request={async () => {
|
|
|
|
|
return Promise.resolve({
|
|
|
|
|
success: true,
|
|
|
|
|
data: { id: '这是一段文本', object:'', date: '2020-07-30 08:00', duration:'', grade:100, through:'>60', learn: '>20 min', times: 2 },
|
|
|
|
|
});
|
|
|
|
|
console.log('testInfo---',testInfo)
|
|
|
|
|
console.log('baseInfo----',baseInfo)
|
|
|
|
|
// return Promise.resolve({
|
|
|
|
|
// success: true,
|
|
|
|
|
// data: {
|
|
|
|
|
// last_id:testInfo.id,
|
|
|
|
|
// },
|
|
|
|
|
// });
|
|
|
|
|
}}
|
|
|
|
|
extra={false}
|
|
|
|
|
>
|
|
|
|
|
<ProDescriptions.Item dataIndex="id" hideInDescriptions />
|
|
|
|
|
<ProDescriptions.Item dataIndex="object" label="考试项目" valueType="text" />
|
|
|
|
|
<ProDescriptions.Item dataIndex="date" label="考试时间" valueType="text" />
|
|
|
|
|
<ProDescriptions.Item dataIndex="duration" label="考试时长" valueType="text" />
|
|
|
|
|
<ProDescriptions.Item dataIndex="grade" label="满分" valueType="text" />
|
|
|
|
|
<ProDescriptions.Item dataIndex="through" label="通过标准" valueType="text" />
|
|
|
|
|
<ProDescriptions.Item dataIndex="learn" label="报名要求" valueType="text" />
|
|
|
|
|
<ProDescriptions.Item dataIndex="times" label="考试次数" valueType="text" />
|
|
|
|
|
</ProDescriptions>
|
|
|
|
|
<ProDescriptions.Item dataIndex="last_id" hideInDescriptions >{testInfo?.id}</ProDescriptions.Item>
|
|
|
|
|
<ProDescriptions.Item dataIndex="last_name" label="考生姓名" valueType="text">{backInfo?.person_name}</ProDescriptions.Item>
|
|
|
|
|
<ProDescriptions.Item dataIndex="last_sex" label="性别" valueType="text">{baseInfo?.sex}</ProDescriptions.Item>
|
|
|
|
|
<ProDescriptions.Item dataIndex="last_idCard" label="身份证号" valueType="text" >{baseInfo?.idCard}</ProDescriptions.Item>
|
|
|
|
|
<ProDescriptions.Item dataIndex="last_birthday" label="出生年月" valueType="text" >{baseInfo?.birthday}</ProDescriptions.Item>
|
|
|
|
|
<ProDescriptions.Item dataIndex="last_address" label="家庭地址" valueType="text" >{baseInfo?.address}</ProDescriptions.Item>
|
|
|
|
|
<ProDescriptions.Item dataIndex="last_contact" label="联系方式" valueType="text" >{baseInfo?.contact}</ProDescriptions.Item>
|
|
|
|
|
<ProDescriptions.Item dataIndex="last_object" label="考试项目" valueType="text" >{testInfo?.examination_name}</ProDescriptions.Item>
|
|
|
|
|
<ProDescriptions.Item dataIndex="last_duration" label="考试时长" valueType="text" >{testInfo?.examination_time+'分钟'}</ProDescriptions.Item>
|
|
|
|
|
<ProDescriptions.Item dataIndex="last_through" label="通过标准" valueType="text" >{testInfo?.pass_score+'分'}</ProDescriptions.Item>
|
|
|
|
|
</ProDescriptions>
|
|
|
|
|
</Col>
|
|
|
|
|
<Col lg={12} md={12} sm={24}>
|
|
|
|
|
<ProDescriptions
|
|
|
|
|
layout='horizontal'
|
|
|
|
|
column={1}
|
|
|
|
|
//actionRef={actionRef}
|
|
|
|
|
title="高级定义列表 request"
|
|
|
|
|
request={async () => {
|
|
|
|
|
return Promise.resolve({
|
|
|
|
|
success: true,
|
|
|
|
|
data: { id: '这是一段文本', object:'', date: '2020-07-30 08:00', duration:'', grade:100, through:'>60', learn: '>20 min', times: 2 },
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// return Promise.resolve({
|
|
|
|
|
// success: true,
|
|
|
|
|
// data: { id: '这是一段文本', object:'', date: '2020-07-30 08:00', duration:'', grade:100, through:'>60', learn: '>20 min', times: 2 },
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
|
|
}}
|
|
|
|
|
extra={false}
|
|
|
|
|
>
|
|
|
|
|
<ProDescriptions.Item dataIndex="id" hideInDescriptions />
|
|
|
|
|
<ProDescriptions.Item dataIndex="object" label="考试项目" valueType="text" />
|
|
|
|
|
<ProDescriptions.Item dataIndex="date" label="考试时间" valueType="text" />
|
|
|
|
|
<ProDescriptions.Item dataIndex="duration" label="考试时长" valueType="text" />
|
|
|
|
|
<ProDescriptions.Item dataIndex="grade" label="满分" valueType="text" />
|
|
|
|
|
<ProDescriptions.Item dataIndex="through" label="通过标准" valueType="text" />
|
|
|
|
|
<ProDescriptions.Item dataIndex="learn" label="报名要求" valueType="text" />
|
|
|
|
|
<ProDescriptions.Item dataIndex="times" label="考试次数" valueType="text" />
|
|
|
|
|
<ProDescriptions.Item dataIndex="object" label="所在学校" valueType="text" >{backInfo?.bureau_name}</ProDescriptions.Item>
|
|
|
|
|
<ProDescriptions.Item dataIndex="date" label="最高学历" valueType="text" >{baseInfo?.qualifications}</ProDescriptions.Item>
|
|
|
|
|
<ProDescriptions.Item dataIndex="duration" label="毕业院校" valueType="text" >{baseInfo?.graduation}</ProDescriptions.Item>
|
|
|
|
|
<ProDescriptions.Item dataIndex="grade" label="专业" valueType="text" >{baseInfo?.major}</ProDescriptions.Item>
|
|
|
|
|
<ProDescriptions.Item dataIndex="through" label="任教学科" valueType="text" >{baseInfo?.subject}</ProDescriptions.Item>
|
|
|
|
|
<ProDescriptions.Item dataIndex="learn" label="考试时间" valueType="text" >{testInfo?.examination_start_time}-{testInfo?.examination_end_time}</ProDescriptions.Item>
|
|
|
|
|
<ProDescriptions.Item dataIndex="times" label="满分" valueType="text" >{testInfo?.sum_score+'分'}</ProDescriptions.Item>
|
|
|
|
|
</ProDescriptions>
|
|
|
|
|
</Col>
|
|
|
|
|
</Row>
|
|
|
|
@ -248,4 +367,4 @@ export default () => {
|
|
|
|
|
</PageContainer>
|
|
|
|
|
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|