fix(web): update user profile

This commit is contained in:
zhaoying
2025-12-25 13:52:50 +08:00
parent e608d8f9d0
commit bfed5404b4
5 changed files with 8 additions and 8 deletions

View File

@@ -1050,7 +1050,7 @@ export const en = {
endUserProfile: 'Core Profile',
editEndUserProfile: 'Edit',
name: 'Name',
other_name: 'Name',
position: 'Position',
department: 'Department',
contact: 'Contact',

View File

@@ -1134,7 +1134,7 @@ export const zh = {
endUserProfile: '核心档案',
editEndUserProfile: '编辑',
name: '姓名',
other_name: '姓名',
position: '职位',
department: '部门',
contact: '联系方式',

View File

@@ -37,7 +37,7 @@ const EndUserProfile:FC = () => {
}
const formatItems = useCallback(() => {
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,
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] || ''),

View File

@@ -47,7 +47,7 @@ const EndUserProfileModal = forwardRef<EndUserProfileModalRef, EndUserProfileMod
setLoading(true)
updatedEndUserProfile({
...values,
hire_date: values.hire_date.valueOf()
hire_date: values.hire_date?.valueOf() || null
})
.then(() => {
setLoading(false)
@@ -85,8 +85,8 @@ const EndUserProfileModal = forwardRef<EndUserProfileModalRef, EndUserProfileMod
>
<FormItem name="end_user_id" hidden></FormItem>
<FormItem
name="name"
label={t('userMemory.name')}
name="other_name"
label={t('userMemory.other_name')}
>
<Input placeholder={t('common.enter')} />
</FormItem>
@@ -118,7 +118,7 @@ const EndUserProfileModal = forwardRef<EndUserProfileModalRef, EndUserProfileMod
name="hire_date"
label={t('userMemory.hire_date')}
>
<DatePicker className="rb:w-full" />
<DatePicker className="rb:w-full" allowClear />
</FormItem>
</Form>
</RbModal>

View File

@@ -126,7 +126,7 @@ export interface EndUser {
department: string;
contact: string;
phone: string;
hire_date: string | number | Dayjs
hire_date: string | number | Dayjs | null;
}
export interface EndUserProfileModalRef {
handleOpen: (vo: EndUser) => void;