|
|
|
|
|
|
|
|
FormControlRender, |
|
|
FormControlRender, |
|
|
ProFormDependency, |
|
|
ProFormDependency, |
|
|
ProFormSwitch, |
|
|
ProFormSwitch, |
|
|
ProFormCascader, |
|
|
|
|
|
|
|
|
ProFormRadio, |
|
|
ProFormDatePicker |
|
|
ProFormDatePicker |
|
|
} from '@ant-design/pro-components'; |
|
|
} from '@ant-design/pro-components'; |
|
|
import { ConfigProvider, Flex, Space, Modal, message, Image, Row, Col, Switch, Form, Typography, Divider } from 'antd'; |
|
|
|
|
|
|
|
|
import { ConfigProvider, Flex, Space, Modal, message, Image, Row, Col, Switch, Form, Typography, Divider, Radio } from 'antd'; |
|
|
import { addArticle, updateArticle, listSection, GetArticleDetail } from '@/apis/api'; |
|
|
import { addArticle, updateArticle, listSection, GetArticleDetail } from '@/apis/api'; |
|
|
import { Imageprefix } from '@/constants'; |
|
|
import { Imageprefix } from '@/constants'; |
|
|
import UploadModel from '@/components/Common/upload'; |
|
|
import UploadModel from '@/components/Common/upload'; |
|
|
|
|
|
|
|
|
const selectfieldNames = { label: 'name', value: 'id' }; |
|
|
const selectfieldNames = { label: 'name', value: 'id' }; |
|
|
const cascaderfieldNames = { label: 'name', value: 'id', children: 'childs' }; |
|
|
const cascaderfieldNames = { label: 'name', value: 'id', children: 'childs' }; |
|
|
|
|
|
|
|
|
|
|
|
import { PostTalentsinfoAdd, PostTalentsinfoUpdate, GetTalentsinfoDetail } from '@/apis/api'; |
|
|
|
|
|
|
|
|
const PagesMainInformationArticleCreate: React.FC = ({ dispatch, dictModel, openModel, id }: any) => { |
|
|
const PagesMainInformationArticleCreate: React.FC = ({ dispatch, dictModel, openModel, id }: any) => { |
|
|
const formRef = useRef<ProFormInstance>(); |
|
|
const formRef = useRef<ProFormInstance>(); |
|
|
const [openPreview, setOpenPreview] = useState(false); |
|
|
const [openPreview, setOpenPreview] = useState(false); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
useEffect(() => { |
|
|
dispatch({ type: 'dictModel/getList', payload: { code: 2004, type: 'setPositionList' } }) |
|
|
|
|
|
dispatch({ type: 'dictModel/getList', payload: { code: 2009, type: 'setAreaList' } }) |
|
|
|
|
|
dispatch({ type: 'dictModel/getList', payload: { code: 2005, type: 'setPayList' } }) |
|
|
|
|
|
dispatch({ type: 'dictModel/getList', payload: { code: 2016, type: 'setAccommodationRequirementList' } }) |
|
|
|
|
|
dispatch({ type: 'dictModel/getList', payload: { code: 2017, type: 'setHolidayRestList' } }) |
|
|
|
|
|
dispatch({ type: 'dictModel/getList', payload: { code: 2018, type: 'setLicenseList' } }) |
|
|
|
|
|
dispatch({ type: 'dictModel/getList', payload: { code: 2021, type: 'setWorkExperienceList' } }) |
|
|
|
|
|
dispatch({ type: 'dictModel/getList', payload: { code: 2006, type: 'setEducationList' } }) |
|
|
dispatch({ type: 'dictModel/getList', payload: { code: 2006, type: 'setEducationList' } }) |
|
|
dispatch({ type: 'dictModel/getList', payload: { code: 2014, type: 'setTitleList' } }) |
|
|
|
|
|
dispatch({ type: 'dictModel/getList', payload: { code: 2015, type: 'setSkillCertificationeList' } }) |
|
|
|
|
|
dispatch({ type: 'dictModel/getList', payload: { code: 2007, type: 'setOtherLanguageList' } }) |
|
|
|
|
|
dispatch({ type: 'dictModel/getList', payload: { code: 2008, type: 'setDegreeList' } }) |
|
|
|
|
|
dispatch({ type: 'dictModel/getList', payload: { code: 2027, type: 'setIndustryPostList' } }) |
|
|
|
|
|
dispatch({ type: 'dictModel/getList', payload: { code: 2010, type: 'setPoliticalList' } }) |
|
|
|
|
|
|
|
|
|
|
|
}, []) |
|
|
}, []) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
formRef={formRef} |
|
|
formRef={formRef} |
|
|
request={async () => { |
|
|
request={async () => { |
|
|
if (id) { |
|
|
if (id) { |
|
|
let res = await GetArticleDetail({ id: id }) |
|
|
|
|
|
setUploadedFilephotoName(res.data.cover_img) |
|
|
|
|
|
|
|
|
let res = await GetTalentsinfoDetail({ id: id }) |
|
|
res.data.section_arr = [res.data.section_name] |
|
|
res.data.section_arr = [res.data.section_name] |
|
|
|
|
|
|
|
|
setDetail(res.data) |
|
|
setDetail(res.data) |
|
|
return res.data; |
|
|
return res.data; |
|
|
} else { |
|
|
} else { |
|
|
setDetail(null) |
|
|
setDetail(null) |
|
|
setUploadedFilephotoName('') |
|
|
|
|
|
return { |
|
|
return { |
|
|
title: '', |
|
|
title: '', |
|
|
cover_img: '', |
|
|
cover_img: '', |
|
|
|
|
|
|
|
|
values.section_id = values.section_arr.length > 0 ? values.section_arr[values.section_arr.length - 1] : 0; |
|
|
values.section_id = values.section_arr.length > 0 ? values.section_arr[values.section_arr.length - 1] : 0; |
|
|
delete values.section_arr; |
|
|
delete values.section_arr; |
|
|
} |
|
|
} |
|
|
let res = await updateArticle(values) |
|
|
|
|
|
|
|
|
let res = await PostTalentsinfoUpdate(values) |
|
|
message.success('提交成功') |
|
|
message.success('提交成功') |
|
|
dispatch({ type: 'openModel/getOpenModal', payload: false }) |
|
|
dispatch({ type: 'openModel/getOpenModal', payload: false }) |
|
|
} else { |
|
|
} else { |
|
|
values.section_id = values.section_arr.length > 0 ? values.section_arr[values.section_arr.length - 1] : 0; |
|
|
values.section_id = values.section_arr.length > 0 ? values.section_arr[values.section_arr.length - 1] : 0; |
|
|
delete values.section_arr; |
|
|
delete values.section_arr; |
|
|
let res = await addArticle(values) |
|
|
|
|
|
|
|
|
let res = await PostTalentsinfoAdd(values) |
|
|
message.success('提交成功') |
|
|
message.success('提交成功') |
|
|
dispatch({ type: 'openModel/getOpenModal', payload: false }) |
|
|
dispatch({ type: 'openModel/getOpenModal', payload: false }) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
> |
|
|
> |
|
|
<Row gutter={[16, 16]}> |
|
|
<Row gutter={[16, 16]}> |
|
|
<Col span={24}> |
|
|
<Col span={24}> |
|
|
<Divider orientation="left" plain >户口本信息</Divider> |
|
|
|
|
|
</Col> |
|
|
|
|
|
<Col span={8}> |
|
|
|
|
|
<ProFormText |
|
|
|
|
|
|
|
|
|
|
|
name="author" |
|
|
|
|
|
label="户口本存放位编号" |
|
|
|
|
|
placeholder="436346" |
|
|
|
|
|
rules={[{ required: true, message: '请输入户口本存放位编号' }]} |
|
|
|
|
|
/> |
|
|
|
|
|
</Col> |
|
|
|
|
|
<Col span={8}> |
|
|
|
|
|
<ProFormText |
|
|
|
|
|
|
|
|
|
|
|
name="author" |
|
|
|
|
|
label="单位名称" |
|
|
|
|
|
placeholder="菊城人才市场" |
|
|
|
|
|
rules={[{ required: true, message: '请输入单位名称' }]} |
|
|
|
|
|
/> |
|
|
|
|
|
</Col> |
|
|
|
|
|
<Col span={8}> |
|
|
|
|
|
<ProFormText |
|
|
<ProFormText |
|
|
name="author" |
|
|
name="author" |
|
|
label="入户人数" |
|
|
|
|
|
placeholder="10" |
|
|
|
|
|
|
|
|
label="户口卡编号" |
|
|
|
|
|
placeholder="请输入户口卡编号" |
|
|
|
|
|
rules={[{ required: true, message: '请输入户口卡编号' }]} |
|
|
/> |
|
|
/> |
|
|
</Col> |
|
|
</Col> |
|
|
<Col span={24}> |
|
|
|
|
|
<Divider orientation="left" plain >入户人员信息</Divider> |
|
|
|
|
|
</Col> |
|
|
|
|
|
<Col span={8}> |
|
|
|
|
|
<ProFormSegmented |
|
|
|
|
|
|
|
|
<Col span={4}> |
|
|
|
|
|
<ProFormRadio.Group |
|
|
name="gender" |
|
|
name="gender" |
|
|
label="是否随家人迁入" |
|
|
|
|
|
|
|
|
label="是否是主办人" |
|
|
request={async () => [ |
|
|
request={async () => [ |
|
|
{ label: '是', value: 1 }, |
|
|
{ label: '是', value: 1 }, |
|
|
{ label: '否', value: 2 } |
|
|
{ label: '否', value: 2 } |
|
|
]} |
|
|
]} |
|
|
|
|
|
rules={[{ required: true, message: '请选择是否是主办人' }]} |
|
|
/> |
|
|
/> |
|
|
</Col> |
|
|
</Col> |
|
|
<Col span={16}> |
|
|
<Col span={16}> |
|
|
<ProFormSelect |
|
|
|
|
|
width={'md'} |
|
|
|
|
|
name="education" |
|
|
|
|
|
label="选择随迁人员" |
|
|
|
|
|
fieldProps={{ |
|
|
|
|
|
fieldNames: selectfieldNames |
|
|
|
|
|
}} |
|
|
|
|
|
options={dictModel.educationList} |
|
|
|
|
|
/> |
|
|
|
|
|
</Col> |
|
|
|
|
|
<Col span={8}> |
|
|
|
|
|
<ProFormText |
|
|
<ProFormText |
|
|
name="author" |
|
|
name="author" |
|
|
label="姓名" |
|
|
label="姓名" |
|
|
placeholder="10" |
|
|
placeholder="10" |
|
|
/> |
|
|
|
|
|
</Col> |
|
|
|
|
|
<Col span={8}> |
|
|
|
|
|
<ProFormText |
|
|
|
|
|
label="身份证" |
|
|
|
|
|
name="id_number" |
|
|
|
|
|
placeholder="请输入身份证" |
|
|
|
|
|
validateTrigger='onBlur' |
|
|
|
|
|
rules={[{ |
|
|
|
|
|
required: false, |
|
|
|
|
|
}, () => ({ |
|
|
|
|
|
validator: (rule, value) => { |
|
|
|
|
|
let info = verifyIdCard(value); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rules={[{ required: true, message: '请输入姓名' }]} |
|
|
|
|
|
|
|
|
if (typeof (info) == 'boolean') { |
|
|
|
|
|
return Promise.resolve(); |
|
|
|
|
|
} |
|
|
|
|
|
return Promise.reject(new Error(info)); |
|
|
|
|
|
} |
|
|
|
|
|
})]} |
|
|
|
|
|
/> |
|
|
/> |
|
|
</Col> |
|
|
</Col> |
|
|
<Col span={8}> |
|
|
|
|
|
<ProFormSegmented |
|
|
|
|
|
|
|
|
<Col span={4}> |
|
|
|
|
|
<ProFormRadio.Group |
|
|
name="gender" |
|
|
name="gender" |
|
|
label="性别" |
|
|
label="性别" |
|
|
request={async () => [ |
|
|
request={async () => [ |
|
|
{ label: '男', value: '男' }, |
|
|
{ label: '男', value: '男' }, |
|
|
{ label: '女', value: '女' } |
|
|
{ label: '女', value: '女' } |
|
|
]} |
|
|
]} |
|
|
|
|
|
rules={[{ required: true, message: '请选择性别' }]} |
|
|
|
|
|
|
|
|
/> |
|
|
/> |
|
|
</Col> |
|
|
</Col> |
|
|
<Col span={8}> |
|
|
|
|
|
<ProFormSelect |
|
|
|
|
|
name="education" |
|
|
|
|
|
label="学历" |
|
|
|
|
|
fieldProps={{ |
|
|
|
|
|
fieldNames: selectfieldNames |
|
|
|
|
|
}} |
|
|
|
|
|
options={dictModel.educationList} |
|
|
|
|
|
|
|
|
<Col span={4}> |
|
|
|
|
|
<ProFormRadio.Group |
|
|
|
|
|
name="gender" |
|
|
|
|
|
label="是否是随迁人" |
|
|
|
|
|
request={async () => [ |
|
|
|
|
|
{ label: '是', value: 1 }, |
|
|
|
|
|
{ label: '否', value: 2 } |
|
|
|
|
|
]} |
|
|
|
|
|
rules={[{ required: true, message: '请选择是否是随迁人' }]} |
|
|
/> |
|
|
/> |
|
|
</Col> |
|
|
</Col> |
|
|
<Col span={8}> |
|
|
|
|
|
|
|
|
<Col span={14}> |
|
|
<ProFormSelect |
|
|
<ProFormSelect |
|
|
name="political_status" |
|
|
|
|
|
label="政治面貌" |
|
|
|
|
|
|
|
|
name="education" |
|
|
|
|
|
label="选择主办人员" |
|
|
fieldProps={{ |
|
|
fieldProps={{ |
|
|
|
|
|
width: '100%', |
|
|
fieldNames: selectfieldNames |
|
|
fieldNames: selectfieldNames |
|
|
}} |
|
|
}} |
|
|
options={dictModel.politicalList} |
|
|
|
|
|
/> |
|
|
|
|
|
</Col> |
|
|
|
|
|
<Col span={8}> |
|
|
|
|
|
<ProFormText |
|
|
|
|
|
name="author" |
|
|
|
|
|
label="毕业院校" |
|
|
|
|
|
placeholder="10" |
|
|
|
|
|
/> |
|
|
|
|
|
</Col> |
|
|
|
|
|
<Col span={8}> |
|
|
|
|
|
<ProFormText |
|
|
|
|
|
name="author" |
|
|
|
|
|
label="专业" |
|
|
|
|
|
placeholder="10" |
|
|
|
|
|
|
|
|
options={dictModel.educationList} |
|
|
/> |
|
|
/> |
|
|
</Col> |
|
|
</Col> |
|
|
<Col span={8}> |
|
|
|
|
|
<ProFormCascader |
|
|
|
|
|
label="籍贯" |
|
|
|
|
|
name="native_arr" |
|
|
|
|
|
fieldProps={{ |
|
|
|
|
|
fieldNames: cascaderfieldNames, |
|
|
|
|
|
options: dictModel.areaList, |
|
|
|
|
|
changeOnSelect: true |
|
|
|
|
|
}} |
|
|
|
|
|
placeholder="请选择籍贯" |
|
|
|
|
|
|
|
|
<Col span={6}> |
|
|
|
|
|
<ProFormDatePicker |
|
|
|
|
|
name="dob" |
|
|
|
|
|
label="入户时间" |
|
|
|
|
|
placeholder='请选择入户时间' |
|
|
|
|
|
width={'lg'} |
|
|
|
|
|
rules={[{ required: true, message: '请选择入户时间' }]} |
|
|
/> |
|
|
/> |
|
|
</Col> |
|
|
</Col> |
|
|
|
|
|
|
|
|
<Col span={8}> |
|
|
<Col span={8}> |
|
|
<ProFormSelect |
|
|
<ProFormSelect |
|
|
name="marital_status" |
|
|
|
|
|
label="婚姻状况" |
|
|
|
|
|
|
|
|
name="education" |
|
|
|
|
|
label="学历" |
|
|
fieldProps={{ |
|
|
fieldProps={{ |
|
|
fieldNames: selectfieldNames |
|
|
fieldNames: selectfieldNames |
|
|
}} |
|
|
}} |
|
|
options={dictModel.maritalList} |
|
|
|
|
|
|
|
|
placeholder='请选择学历' |
|
|
|
|
|
options={dictModel.educationList} |
|
|
|
|
|
rules={[{ required: true, message: '请选择学历' }]} |
|
|
|
|
|
|
|
|
/> |
|
|
/> |
|
|
</Col> |
|
|
</Col> |
|
|
<Col span={8}> |
|
|
<Col span={8}> |
|
|
<ProFormText |
|
|
<ProFormText |
|
|
name="author" |
|
|
name="author" |
|
|
label="联系电话" |
|
|
label="联系电话" |
|
|
placeholder="10" |
|
|
|
|
|
/> |
|
|
|
|
|
</Col> |
|
|
|
|
|
<Col span={8}> |
|
|
|
|
|
<ProFormDatePicker |
|
|
|
|
|
name="dob" |
|
|
|
|
|
label="入户时间" |
|
|
|
|
|
placeholder='请选择入户时间' |
|
|
|
|
|
width={'lg'} |
|
|
|
|
|
/> |
|
|
|
|
|
</Col> |
|
|
|
|
|
<Col span={8}> |
|
|
|
|
|
<ProFormText |
|
|
|
|
|
name="author" |
|
|
|
|
|
label="备注" |
|
|
|
|
|
placeholder="10" |
|
|
|
|
|
|
|
|
placeholder="请输入联系电话" |
|
|
|
|
|
rules={[{ required: true, message: '请输入联系电话' }]} |
|
|
|
|
|
|
|
|
/> |
|
|
/> |
|
|
</Col> |
|
|
</Col> |
|
|
|
|
|
|
|
|
</Row> |
|
|
</Row> |
|
|
|
|
|
|
|
|
</ProForm> |
|
|
</ProForm> |