fix(web): update user profile
This commit is contained in:
@@ -1050,7 +1050,7 @@ export const en = {
|
|||||||
|
|
||||||
endUserProfile: 'Core Profile',
|
endUserProfile: 'Core Profile',
|
||||||
editEndUserProfile: 'Edit',
|
editEndUserProfile: 'Edit',
|
||||||
name: 'Name',
|
other_name: 'Name',
|
||||||
position: 'Position',
|
position: 'Position',
|
||||||
department: 'Department',
|
department: 'Department',
|
||||||
contact: 'Contact',
|
contact: 'Contact',
|
||||||
|
|||||||
@@ -1134,7 +1134,7 @@ export const zh = {
|
|||||||
|
|
||||||
endUserProfile: '核心档案',
|
endUserProfile: '核心档案',
|
||||||
editEndUserProfile: '编辑',
|
editEndUserProfile: '编辑',
|
||||||
name: '姓名',
|
other_name: '姓名',
|
||||||
position: '职位',
|
position: '职位',
|
||||||
department: '部门',
|
department: '部门',
|
||||||
contact: '联系方式',
|
contact: '联系方式',
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ const EndUserProfile:FC = () => {
|
|||||||
}
|
}
|
||||||
const formatItems = useCallback(() => {
|
const formatItems = useCallback(() => {
|
||||||
if (!data) return []
|
if (!data) return []
|
||||||
return ['name', 'position', 'department', 'contact', 'phone', 'hire_date'].map(key => ({
|
return ['other_name', 'position', 'department', 'contact', 'phone', 'hire_date'].map(key => ({
|
||||||
key,
|
key,
|
||||||
label: t(`userMemory.${key}`),
|
label: t(`userMemory.${key}`),
|
||||||
children: key === 'hire_date' && data[key] ? dayjs(data[key as keyof EndUser]).format('YYYY-MM-DD') : String(data[key as keyof EndUser] || ''),
|
children: key === 'hire_date' && data[key] ? dayjs(data[key as keyof EndUser]).format('YYYY-MM-DD') : String(data[key as keyof EndUser] || ''),
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ const EndUserProfileModal = forwardRef<EndUserProfileModalRef, EndUserProfileMod
|
|||||||
setLoading(true)
|
setLoading(true)
|
||||||
updatedEndUserProfile({
|
updatedEndUserProfile({
|
||||||
...values,
|
...values,
|
||||||
hire_date: values.hire_date.valueOf()
|
hire_date: values.hire_date?.valueOf() || null
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
setLoading(false)
|
setLoading(false)
|
||||||
@@ -85,8 +85,8 @@ const EndUserProfileModal = forwardRef<EndUserProfileModalRef, EndUserProfileMod
|
|||||||
>
|
>
|
||||||
<FormItem name="end_user_id" hidden></FormItem>
|
<FormItem name="end_user_id" hidden></FormItem>
|
||||||
<FormItem
|
<FormItem
|
||||||
name="name"
|
name="other_name"
|
||||||
label={t('userMemory.name')}
|
label={t('userMemory.other_name')}
|
||||||
>
|
>
|
||||||
<Input placeholder={t('common.enter')} />
|
<Input placeholder={t('common.enter')} />
|
||||||
</FormItem>
|
</FormItem>
|
||||||
@@ -118,7 +118,7 @@ const EndUserProfileModal = forwardRef<EndUserProfileModalRef, EndUserProfileMod
|
|||||||
name="hire_date"
|
name="hire_date"
|
||||||
label={t('userMemory.hire_date')}
|
label={t('userMemory.hire_date')}
|
||||||
>
|
>
|
||||||
<DatePicker className="rb:w-full" />
|
<DatePicker className="rb:w-full" allowClear />
|
||||||
</FormItem>
|
</FormItem>
|
||||||
</Form>
|
</Form>
|
||||||
</RbModal>
|
</RbModal>
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ export interface EndUser {
|
|||||||
department: string;
|
department: string;
|
||||||
contact: string;
|
contact: string;
|
||||||
phone: string;
|
phone: string;
|
||||||
hire_date: string | number | Dayjs
|
hire_date: string | number | Dayjs | null;
|
||||||
}
|
}
|
||||||
export interface EndUserProfileModalRef {
|
export interface EndUserProfileModalRef {
|
||||||
handleOpen: (vo: EndUser) => void;
|
handleOpen: (vo: EndUser) => void;
|
||||||
|
|||||||
Reference in New Issue
Block a user