From 62dc6632943e9235f060a068a808c6ed3d9e590f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B5=85=E5=BF=B5?= Date: Wed, 5 Aug 2026 14:13:21 +0800 Subject: [PATCH] feat: employee page with channel tabs (WeChat/WhatsApp account lists) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace the sparse staff-record table on /staff with a channel-tabbed employee account view mirroring the 云客 backend's 员工微信列表 + WhatsApp 员工列表. Each tab loads /api/accounts?channel= with its own pagination state; rows open the existing account all-fields drawer (reused from AccountList via accountFields.ts). WeChat tab columns: 头像/微信昵称/微信号/手机号/员工姓名/好友数/群数/ 发送/接收/数据库大小/在职/在线状态/最后更新. WhatsApp tab columns: 头像(el-avatar initials)/昵称/员工姓名/手机/销售手机/好友数/群数/ 联系人数/新增好友/在职/最后更新. Reads raw_json via the structured-first readField helper; tolerates boolean and 1/0 forms of isOnJob/onlineStatus. Also fix the avatar field key in accountFields.ts (headImageUrl, with headImgUrl as a legacy alias) so the WeChat drawer avatar renders — the upstream wxUser record uses headImageUrl. Co-Authored-By: Claude --- yunkes/src/utils/accountFields.ts | 5 +- yunkes/src/views/StaffList.vue | 698 ++++++++++++++++++++++-------- 2 files changed, 512 insertions(+), 191 deletions(-) diff --git a/yunkes/src/utils/accountFields.ts b/yunkes/src/utils/accountFields.ts index adcd01f..0f898cd 100644 --- a/yunkes/src/utils/accountFields.ts +++ b/yunkes/src/utils/accountFields.ts @@ -24,6 +24,7 @@ export const ACCOUNT_FIELD_LABELS: Record = { channel: '渠道', nickName: '昵称', alias: '微信号', + headImageUrl: '头像', headImgUrl: '头像', // 归属员工 userName: '员工姓名', @@ -75,7 +76,7 @@ const STRUCTURED_ALIAS: Record = { } /** Fields whose value is an image URL → render as a thumbnail. */ -const IMAGE_KEYS = new Set(['headImgUrl']) +const IMAGE_KEYS = new Set(['headImageUrl', 'headImgUrl']) /** Fields whose value is a millisecond epoch → format to local datetime. */ const TIMESTAMP_KEYS = new Set(['lastUpdate']) @@ -93,7 +94,7 @@ export interface AccountFieldGroup { export const ACCOUNT_FIELD_GROUPS: AccountFieldGroup[] = [ { title: '基本信息', - keys: ['wechatId', 'uid', 'channel', 'nickName', 'alias', 'headImgUrl'], + keys: ['wechatId', 'uid', 'channel', 'nickName', 'alias', 'headImageUrl', 'headImgUrl'], }, { title: '归属员工', diff --git a/yunkes/src/views/StaffList.vue b/yunkes/src/views/StaffList.vue index b4fff4f..3e607ba 100644 --- a/yunkes/src/views/StaffList.vue +++ b/yunkes/src/views/StaffList.vue @@ -1,128 +1,219 @@