|
@@ -1,25 +1,32 @@
|
|
|
import React from 'react'
|
|
import React from 'react'
|
|
|
-import { Input, Tabs } from 'antd'
|
|
|
|
|
|
|
+import { Col, Row, Tabs } from 'antd'
|
|
|
import ProForm, {
|
|
import ProForm, {
|
|
|
- ProFormDependency,
|
|
|
|
|
- ProFormFieldSet,
|
|
|
|
|
|
|
+ ProFormGroup,
|
|
|
|
|
+ ProFormDatePicker,
|
|
|
ProFormSelect,
|
|
ProFormSelect,
|
|
|
- ProFormText,
|
|
|
|
|
- ProFormTextArea
|
|
|
|
|
|
|
+ ProFormRadio,
|
|
|
|
|
+ ProFormUploadDragger,
|
|
|
|
|
+ ProFormUploadButton,
|
|
|
|
|
+ ProFormText
|
|
|
} from '@ant-design/pro-form'
|
|
} from '@ant-design/pro-form'
|
|
|
import styles from './BaseView.less'
|
|
import styles from './BaseView.less'
|
|
|
|
|
+import {
|
|
|
|
|
+ educationOptions,
|
|
|
|
|
+ householdRegistrationOptions,
|
|
|
|
|
+ marriageOptions
|
|
|
|
|
+} from '@/components/EditableForm/src/useOptions'
|
|
|
|
|
|
|
|
const { TabPane } = Tabs
|
|
const { TabPane } = Tabs
|
|
|
|
|
|
|
|
-const validatorPhone = (rule, value, callback) => {
|
|
|
|
|
- if (!value[0]) {
|
|
|
|
|
- callback('Please input your area code!')
|
|
|
|
|
- }
|
|
|
|
|
- if (!value[1]) {
|
|
|
|
|
- callback('Please input your phone number!')
|
|
|
|
|
- }
|
|
|
|
|
- callback()
|
|
|
|
|
-}
|
|
|
|
|
|
|
+// const validatorPhone = (rule, value, callback) => {
|
|
|
|
|
+// if (!value[0]) {
|
|
|
|
|
+// callback('Please input your area code!')
|
|
|
|
|
+// }
|
|
|
|
|
+// if (!value[1]) {
|
|
|
|
|
+// callback('Please input your phone number!')
|
|
|
|
|
+// }
|
|
|
|
|
+// callback()
|
|
|
|
|
+// }
|
|
|
// 头像组件 方便以后独立,增加裁剪之类的功能
|
|
// 头像组件 方便以后独立,增加裁剪之类的功能
|
|
|
// const AvatarView = ({ avatar }) => (
|
|
// const AvatarView = ({ avatar }) => (
|
|
|
// <>
|
|
// <>
|
|
@@ -39,6 +46,10 @@ const validatorPhone = (rule, value, callback) => {
|
|
|
// )
|
|
// )
|
|
|
|
|
|
|
|
const BaseView = () => {
|
|
const BaseView = () => {
|
|
|
|
|
+ const layout = {
|
|
|
|
|
+ layout: 'horizontal',
|
|
|
|
|
+ labelCol: { flex: '100px' }
|
|
|
|
|
+ }
|
|
|
const handleTabChange = key => {
|
|
const handleTabChange = key => {
|
|
|
console.log(key)
|
|
console.log(key)
|
|
|
}
|
|
}
|
|
@@ -48,7 +59,7 @@ const BaseView = () => {
|
|
|
<div className={styles.baseView}>
|
|
<div className={styles.baseView}>
|
|
|
<div className={styles.left}>
|
|
<div className={styles.left}>
|
|
|
<ProForm
|
|
<ProForm
|
|
|
- layout="vertical"
|
|
|
|
|
|
|
+ {...layout}
|
|
|
// onFinish={handleFinish}
|
|
// onFinish={handleFinish}
|
|
|
submitter={{
|
|
submitter={{
|
|
|
resetButtonProps: {
|
|
resetButtonProps: {
|
|
@@ -64,154 +75,120 @@ const BaseView = () => {
|
|
|
// ...currentUser,
|
|
// ...currentUser,
|
|
|
// phone: currentUser?.phone.split('-'),
|
|
// phone: currentUser?.phone.split('-'),
|
|
|
// }}
|
|
// }}
|
|
|
- hideRequiredMark
|
|
|
|
|
>
|
|
>
|
|
|
- <ProFormText
|
|
|
|
|
- width="md"
|
|
|
|
|
- name="email"
|
|
|
|
|
- label="邮箱"
|
|
|
|
|
- rules={[
|
|
|
|
|
- {
|
|
|
|
|
- required: true,
|
|
|
|
|
- message: '请输入您的邮箱!'
|
|
|
|
|
- }
|
|
|
|
|
- ]}
|
|
|
|
|
- />
|
|
|
|
|
- <ProFormText
|
|
|
|
|
- width="md"
|
|
|
|
|
- name="name"
|
|
|
|
|
- label="昵称"
|
|
|
|
|
- rules={[
|
|
|
|
|
- {
|
|
|
|
|
- required: true,
|
|
|
|
|
- message: '请输入您的昵称!'
|
|
|
|
|
- }
|
|
|
|
|
- ]}
|
|
|
|
|
- />
|
|
|
|
|
- <ProFormTextArea
|
|
|
|
|
- name="profile"
|
|
|
|
|
- label="个人简介"
|
|
|
|
|
- rules={[
|
|
|
|
|
- {
|
|
|
|
|
- required: true,
|
|
|
|
|
- message: '请输入个人简介!'
|
|
|
|
|
- }
|
|
|
|
|
- ]}
|
|
|
|
|
- placeholder="个人简介"
|
|
|
|
|
- />
|
|
|
|
|
- <ProFormSelect
|
|
|
|
|
- width="sm"
|
|
|
|
|
- name="country"
|
|
|
|
|
- label="国家/地区"
|
|
|
|
|
- rules={[
|
|
|
|
|
- {
|
|
|
|
|
- required: true,
|
|
|
|
|
- message: '请输入您的国家或地区!'
|
|
|
|
|
- }
|
|
|
|
|
- ]}
|
|
|
|
|
- options={[
|
|
|
|
|
- {
|
|
|
|
|
- label: '中国',
|
|
|
|
|
- value: 'China'
|
|
|
|
|
- }
|
|
|
|
|
- ]}
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ <Row>
|
|
|
|
|
+ <Col span={12}>
|
|
|
|
|
+ <ProFormText disabled name="jobNumber" label="工号" required />
|
|
|
|
|
+ <ProFormText disabled name="departmentId" label="办事处/部门" required />
|
|
|
|
|
+ <ProFormText disabled name="birthday" label="入职日期" required />
|
|
|
|
|
+ <ProFormText name="qq" label="QQ" required />
|
|
|
|
|
+ <ProFormText name="telephone" label="电话" required />
|
|
|
|
|
|
|
|
- <ProForm.Group title="所在省市" size={8}>
|
|
|
|
|
- <ProFormSelect
|
|
|
|
|
- rules={[
|
|
|
|
|
- {
|
|
|
|
|
- required: true,
|
|
|
|
|
- message: '请输入您的所在省!'
|
|
|
|
|
- }
|
|
|
|
|
- ]}
|
|
|
|
|
- width="sm"
|
|
|
|
|
- fieldProps={{
|
|
|
|
|
- labelInValue: true
|
|
|
|
|
- }}
|
|
|
|
|
- name="province"
|
|
|
|
|
- className={styles.item}
|
|
|
|
|
- request={async () => {
|
|
|
|
|
- return queryProvince().then(({ data }) => {
|
|
|
|
|
- return data.map(item => {
|
|
|
|
|
- return {
|
|
|
|
|
- label: item.name,
|
|
|
|
|
- value: item.id
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
- })
|
|
|
|
|
- }}
|
|
|
|
|
- />
|
|
|
|
|
- <ProFormDependency name={['province']}>
|
|
|
|
|
- {({ province }) => {
|
|
|
|
|
- return (
|
|
|
|
|
- <ProFormSelect
|
|
|
|
|
- params={{
|
|
|
|
|
- key: province?.value
|
|
|
|
|
- }}
|
|
|
|
|
- name="city"
|
|
|
|
|
- width="sm"
|
|
|
|
|
- rules={[
|
|
|
|
|
- {
|
|
|
|
|
- required: true,
|
|
|
|
|
- message: '请输入您的所在城市!'
|
|
|
|
|
- }
|
|
|
|
|
- ]}
|
|
|
|
|
- disabled={!province}
|
|
|
|
|
- className={styles.item}
|
|
|
|
|
- request={async () => {
|
|
|
|
|
- if (!province?.key) {
|
|
|
|
|
- return []
|
|
|
|
|
- }
|
|
|
|
|
- return queryCity(province.key || '').then(({ data }) => {
|
|
|
|
|
- return data.map(item => {
|
|
|
|
|
- return {
|
|
|
|
|
- label: item.name,
|
|
|
|
|
- value: item.id
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
- })
|
|
|
|
|
- }}
|
|
|
|
|
- />
|
|
|
|
|
- )
|
|
|
|
|
- }}
|
|
|
|
|
- </ProFormDependency>
|
|
|
|
|
- </ProForm.Group>
|
|
|
|
|
- <ProFormText
|
|
|
|
|
- width="md"
|
|
|
|
|
- name="address"
|
|
|
|
|
- label="街道地址"
|
|
|
|
|
- rules={[
|
|
|
|
|
- {
|
|
|
|
|
- required: true,
|
|
|
|
|
- message: '请输入您的街道地址!'
|
|
|
|
|
- }
|
|
|
|
|
- ]}
|
|
|
|
|
- />
|
|
|
|
|
- <ProFormFieldSet
|
|
|
|
|
- name="phone"
|
|
|
|
|
- label="联系电话"
|
|
|
|
|
- rules={[
|
|
|
|
|
- {
|
|
|
|
|
- required: true,
|
|
|
|
|
- message: '请输入您的联系电话!'
|
|
|
|
|
- },
|
|
|
|
|
- { validator: validatorPhone }
|
|
|
|
|
- ]}
|
|
|
|
|
- >
|
|
|
|
|
- <Input className={styles.area_code} />
|
|
|
|
|
- <Input className={styles.phone_number} />
|
|
|
|
|
- </ProFormFieldSet>
|
|
|
|
|
|
|
+ <ProFormRadio.Group options={['男', '女']} name="gender" label="性别" required />
|
|
|
|
|
+ <ProFormText name="nation" label="民族" />
|
|
|
|
|
+ <ProFormText name="graduateInstitutions" label="毕业院校" />
|
|
|
|
|
+ <ProFormSelect name="education" label="毕业学历" options={educationOptions} />
|
|
|
|
|
+ <ProFormSelect
|
|
|
|
|
+ name="qualifications"
|
|
|
|
|
+ label="最高学历"
|
|
|
|
|
+ options={educationOptions}
|
|
|
|
|
+ required
|
|
|
|
|
+ />
|
|
|
|
|
+ </Col>
|
|
|
|
|
+ <Col span={12}>
|
|
|
|
|
+ <ProFormText disabled name="username" label="姓名" required />
|
|
|
|
|
+ <ProFormText disabled name="position" label="岗位" required />
|
|
|
|
|
+ <ProFormText name="phone" label="手机" required />
|
|
|
|
|
+ <ProFormText name="wecat" label="微信" required />
|
|
|
|
|
+ <ProFormText name="email" label="邮箱" required />
|
|
|
|
|
+ <ProFormDatePicker name="birthday" label="出生日期" />
|
|
|
|
|
+ <ProFormSelect name="marriage" options={marriageOptions} label="婚姻状况" />
|
|
|
|
|
+ <ProFormText name="major" label="所学专业" />
|
|
|
|
|
+ <ProFormDatePicker name="graduationTime" label="毕业时间" />
|
|
|
|
|
+ </Col>
|
|
|
|
|
+ </Row>
|
|
|
|
|
+ <Row>
|
|
|
|
|
+ <Col span={12}>
|
|
|
|
|
+ <ProFormText name="registeredResidence" label="户口所在地" required />
|
|
|
|
|
+ </Col>
|
|
|
|
|
+ <Col span={12}>
|
|
|
|
|
+ <ProFormSelect
|
|
|
|
|
+ name="householdRegistrationType"
|
|
|
|
|
+ label="户籍类型"
|
|
|
|
|
+ required
|
|
|
|
|
+ options={householdRegistrationOptions}
|
|
|
|
|
+ />
|
|
|
|
|
+ </Col>
|
|
|
|
|
+ </Row>
|
|
|
|
|
+ <ProFormText name="living" label="现居住地" required />
|
|
|
|
|
+ <Row>
|
|
|
|
|
+ <Col span={12}>
|
|
|
|
|
+ <ProFormText name="nativePlace" label="籍贯" required />
|
|
|
|
|
+ </Col>
|
|
|
|
|
+ <Col span={12}>
|
|
|
|
|
+ <ProFormText name="emergencyContacts" label="紧急联系人" required />
|
|
|
|
|
+ </Col>
|
|
|
|
|
+ </Row>
|
|
|
</ProForm>
|
|
</ProForm>
|
|
|
</div>
|
|
</div>
|
|
|
<div className={styles.right}>{/* <AvatarView avatar={getAvatarURL()} /> */}</div>
|
|
<div className={styles.right}>{/* <AvatarView avatar={getAvatarURL()} /> */}</div>
|
|
|
</div>
|
|
</div>
|
|
|
</TabPane>
|
|
</TabPane>
|
|
|
<TabPane tab="证件信息" key="2">
|
|
<TabPane tab="证件信息" key="2">
|
|
|
- Content of Tab Pane 2
|
|
|
|
|
|
|
+ <ProForm {...layout}>
|
|
|
|
|
+ <ProFormText name="IDcards" label="身份证号码" required />
|
|
|
|
|
+ <ProFormText name="IDcardsValidity" label="身份证有效期" required />
|
|
|
|
|
+ <ProFormUploadButton name="IDcardsImgA" label="正面(国徽)" required />
|
|
|
|
|
+ <ProFormUploadButton
|
|
|
|
|
+ name="IDcardsImgB"
|
|
|
|
|
+ labelCol={{ span: 24 }}
|
|
|
|
|
+ label="反面(照片)"
|
|
|
|
|
+ required
|
|
|
|
|
+ />
|
|
|
|
|
+ <ProFormUploadDragger
|
|
|
|
|
+ name="certificate"
|
|
|
|
|
+ labelCol={{ span: 24 }}
|
|
|
|
|
+ label="毕业证书"
|
|
|
|
|
+ required
|
|
|
|
|
+ />
|
|
|
|
|
+ <ProFormUploadDragger name="diploma" labelCol={{ span: 24 }} label="学历证书" />
|
|
|
|
|
+ <ProFormUploadDragger name="professionalTitle" labelCol={{ span: 24 }} label="职称证书" />
|
|
|
|
|
+ </ProForm>
|
|
|
</TabPane>
|
|
</TabPane>
|
|
|
<TabPane tab="财务信息" key="3">
|
|
<TabPane tab="财务信息" key="3">
|
|
|
- Content of Tab Pane 3
|
|
|
|
|
|
|
+ <ProForm layout="horizontal" labelCol={{ flex: '150px' }}>
|
|
|
|
|
+ <ProFormGroup title="报销收款帐号">
|
|
|
|
|
+ <Row>
|
|
|
|
|
+ <Col span={12}>
|
|
|
|
|
+ <ProFormText name="remittanceName" label="收款人户名" required />
|
|
|
|
|
+ <ProFormText name="bankName" label="收款开户银行名称" required />
|
|
|
|
|
+ </Col>
|
|
|
|
|
+ <Col span={12}>
|
|
|
|
|
+ <ProFormText
|
|
|
|
|
+ name="coupletNumber"
|
|
|
|
|
+ label="联行号"
|
|
|
|
|
+ tooltip={
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <p>1.如果不是公司广发,务必填上银行联行号</p>
|
|
|
|
|
+ <p>2.如不清楚银行联行号请咨询报销查款专用 QQ:2870766094</p>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ }
|
|
|
|
|
+ />
|
|
|
|
|
+ <ProFormText name="bankNumber" label="收款帐号" required />
|
|
|
|
|
+ </Col>
|
|
|
|
|
+ </Row>
|
|
|
|
|
+ </ProFormGroup>
|
|
|
|
|
+ <ProFormGroup title="工资卡">
|
|
|
|
|
+ <Row>
|
|
|
|
|
+ <Col span={12}>
|
|
|
|
|
+ <ProFormText name="salaryCard" label="银行卡号" required />
|
|
|
|
|
+ </Col>
|
|
|
|
|
+ <Col span={12}>
|
|
|
|
|
+ <ProFormText name="salaryBankName" label="开户行" required />
|
|
|
|
|
+ </Col>
|
|
|
|
|
+ </Row>
|
|
|
|
|
+ </ProFormGroup>
|
|
|
|
|
+ </ProForm>
|
|
|
</TabPane>
|
|
</TabPane>
|
|
|
</Tabs>
|
|
</Tabs>
|
|
|
)
|
|
)
|