Merge #54 into develop_web from feature/20251219_zy

fix(web): update user profile

* feature/20251219_zy: (1 commits)
  fix(web): update user profile

Signed-off-by: zhaoying <zhaoying@redbearai.com>
Merged-by: zhaoying <zhaoying@redbearai.com>

CR-link: https://codeup.aliyun.com/redbearai/python/redbear-mem-open/change/54
This commit is contained in:
赵莹
2025-12-25 13:53:21 +08:00
5 changed files with 8 additions and 8 deletions

View File

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

View File

@@ -1150,7 +1150,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;