From ab386395f51aa1a2b3f550a32d4cd10d0ad88fda Mon Sep 17 00:00:00 2001 From: wumeimin0107 <321512939@qq.com> Date: Thu, 26 Dec 2024 18:41:27 +0800 Subject: [PATCH] feat(state): member field sort by display_name_pinyin default (#215) --- packages/grid/src/types/grid.ts | 2 +- packages/state/src/utils/field/model/member.ts | 4 ++-- src/app/utils/utils.ts | 16 ++++++++-------- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/packages/grid/src/types/grid.ts b/packages/grid/src/types/grid.ts index 676a0fe..94b30ab 100644 --- a/packages/grid/src/types/grid.ts +++ b/packages/grid/src/types/grid.ts @@ -30,7 +30,7 @@ export interface AIFieldConfig { export interface AITableUserInfo { uid?: string; display_name?: string; - name?: string; + display_name_pinyin?: string; avatar?: string; } diff --git a/packages/state/src/utils/field/model/member.ts b/packages/state/src/utils/field/model/member.ts index 855fd8e..74aaa15 100644 --- a/packages/state/src/utils/field/model/member.ts +++ b/packages/state/src/utils/field/model/member.ts @@ -27,8 +27,8 @@ export class MemberField extends Field { if (!userInfo) { continue; } - if (userInfo.name) { - names.push(userInfo.name); + if (userInfo.display_name_pinyin) { + names.push(userInfo.display_name_pinyin); } } } diff --git a/src/app/utils/utils.ts b/src/app/utils/utils.ts index 8d97826..3d623a8 100644 --- a/src/app/utils/utils.ts +++ b/src/app/utils/utils.ts @@ -1017,49 +1017,49 @@ export function getReferences(): AITableReferences { member_01: { uid: 'member_01', display_name: 'admin', - name: 'admin', + display_name_pinyin: 'admin', avatar: 'https://web.on-premises-alpha.pingcode.live/pc-avatar/c04446a4-bfcc-4a05-846c-e3241e1b68df_80x80.png' }, member_02: { uid: 'member_02', display_name: 'member', - name: 'member', + display_name_pinyin: 'member', avatar: '' }, member_03: { uid: 'member_03', display_name: 'Maple13', - name: 'Maple13', + display_name_pinyin: 'Maple13', avatar: '' }, member_04: { uid: 'member_04', display_name: 'canvas', - name: 'canvas', + display_name_pinyin: 'canvas', avatar: '' }, member_05: { uid: 'member_05', display_name: '虾米', - name: 'xiami', + display_name_pinyin: 'xiami', avatar: '' }, member_06: { uid: 'member_06', display_name: 'html', - name: 'html', + display_name_pinyin: 'html', avatar: '' }, member_07: { uid: 'member_07', display_name: 'css', - name: 'css', + display_name_pinyin: 'css', avatar: '' }, member_08: { uid: 'member_08', display_name: 'Angular', - name: 'Angular', + display_name_pinyin: 'Angular', avatar: '' } }