|
|
@@ -1,11 +1,9 @@
|
|
|
import React, { useState, useEffect, useRef } from 'react'
|
|
|
-import { Button, Col, message, Row, Tabs, Upload } from 'antd'
|
|
|
+import { Col, message, Row, Tabs } from 'antd'
|
|
|
import ProForm, {
|
|
|
ProFormDatePicker,
|
|
|
ProFormSelect,
|
|
|
ProFormRadio,
|
|
|
- ProFormUploadDragger,
|
|
|
- ProFormUploadButton,
|
|
|
ProFormText
|
|
|
} from '@ant-design/pro-form'
|
|
|
import styles from './BaseView.less'
|
|
|
@@ -14,9 +12,10 @@ import {
|
|
|
householdRegistrationOptions,
|
|
|
marriageOptions
|
|
|
} from '@/components/EditableForm/src/useOptions'
|
|
|
-import { UploadOutlined } from '@ant-design/icons'
|
|
|
import { queryStaffOwner, updateBaseStaff, updateFinanceStaff } from '@/services/user'
|
|
|
import consts from '@/consts'
|
|
|
+import AvatarView from './AvatarView'
|
|
|
+import { isDevMode } from '@/utils/env'
|
|
|
|
|
|
const { TabPane } = Tabs
|
|
|
|
|
|
@@ -29,23 +28,6 @@ const { TabPane } = Tabs
|
|
|
// }
|
|
|
// callback()
|
|
|
// }
|
|
|
-// 头像组件 方便以后独立,增加裁剪之类的功能
|
|
|
-const AvatarView = ({ avatar }) => (
|
|
|
- <>
|
|
|
- <div className={styles.avatar_title}>头像</div>
|
|
|
- <div className={styles.avatar}>
|
|
|
- <img src={avatar} alt="avatar" />
|
|
|
- </div>
|
|
|
- <Upload showUploadList={false}>
|
|
|
- <div className={styles.button_view}>
|
|
|
- <Button>
|
|
|
- <UploadOutlined />
|
|
|
- 更换头像
|
|
|
- </Button>
|
|
|
- </div>
|
|
|
- </Upload>
|
|
|
- </>
|
|
|
-)
|
|
|
|
|
|
const BaseView = () => {
|
|
|
const baseRef = useRef(null)
|
|
|
@@ -65,6 +47,9 @@ const BaseView = () => {
|
|
|
}
|
|
|
initData()
|
|
|
}, [])
|
|
|
+ const avatar =
|
|
|
+ (isDevMode() ? 'http://cld2qa.com' : 'http://zhcld.com') +
|
|
|
+ (staff?.avatar2 ? staff?.avatar2 : '/global/img/avtra_2.jpg')
|
|
|
return (
|
|
|
<Tabs defaultActiveKey="1">
|
|
|
<TabPane tab="基本信息" key="1">
|
|
|
@@ -87,6 +72,7 @@ const BaseView = () => {
|
|
|
}
|
|
|
}}
|
|
|
>
|
|
|
+ <ProFormText name="avatar" hidden />
|
|
|
<Row>
|
|
|
<Col span={12}>
|
|
|
<ProFormText disabled name="jobNumber" label="工号" placeholder="" />
|
|
|
@@ -182,11 +168,14 @@ const BaseView = () => {
|
|
|
</ProForm>
|
|
|
</div>
|
|
|
<div className={styles.right}>
|
|
|
- <AvatarView avatar={''} />
|
|
|
+ <AvatarView
|
|
|
+ avatar={avatar}
|
|
|
+ setAvatar={avatar2 => baseRef?.current.setFieldsValue({ avatar: avatar2 })}
|
|
|
+ />
|
|
|
</div>
|
|
|
</div>
|
|
|
</TabPane>
|
|
|
- <TabPane tab="证件信息" key="2">
|
|
|
+ {/* <TabPane tab="证件信息" key="2">
|
|
|
<div className={styles.baseView}>
|
|
|
<div className="w-1/2">
|
|
|
<ProForm
|
|
|
@@ -227,7 +216,7 @@ const BaseView = () => {
|
|
|
</ProForm>
|
|
|
</div>
|
|
|
</div>
|
|
|
- </TabPane>
|
|
|
+ </TabPane> */}
|
|
|
<TabPane tab="财务信息" key="3">
|
|
|
<div className={styles.baseView}>
|
|
|
<div className="w-3/4">
|