diff --git a/yunkes/src/views/CustomerList.vue b/yunkes/src/views/CustomerList.vue index f0884da..66ab37d 100644 --- a/yunkes/src/views/CustomerList.vue +++ b/yunkes/src/views/CustomerList.vue @@ -16,7 +16,8 @@ import { buildCustomerSections, fromTypeLabel, readField } from '@/utils/custome * 客户列表 — channel-tabbed view mirroring 云客「沟通」板块的客户列表. * * 微信客户 tab 对齐 云客 /cms/wechat/wechatlist/wechatdetail/1/{wxId} - * (7 列: 客户微信/数据来源/客户备注名/最近沟通时间/发送条数/接收条数/操作). + * (16 列: 客户信息/手机号码/描述/地区/个性签名/好友标签/发送消息数/接收消息数/ + * 最近联系时间/员工微信/员工信息/创建时间/添加时间/添加类型/好友来源/好友类型 + 操作). * WhatsApp客户 tab 对齐 云客 /cms/wechat/waBusiness/friendlist * (7 列: 序号/员工信息/员工WhatsApp/客户WhatsApp/添加时间/最新消息时间/操作). * 两 channel 列不同 → 各自独立列定义(同 StaffList 模式)。 @@ -92,6 +93,32 @@ function cellNum(row: Customer, camelKey: string, fallback = 0): number { function fromTypeText(row: Customer): string { return fromTypeLabel(cell(row, 'fromType')) } +/** 添加类型列:addType 数值代码→文案(未知值原样透出)。 */ +function addTypeText(row: Customer): string { + const v = cell(row, 'addType') + if (v === 1 || v === '1') return '搜索添加' + if (v === 2 || v === '2') return '群聊添加' + if (v === 3 || v === '3') return '手机号添加' + const s = String(v ?? '').trim() + return s && s !== 'null' && s !== 'undefined' ? s : '--' +} +/** 好友标签列:contactLabelValues 可能是字符串数组/对象数组/单值,统一成顿号分隔文本。 */ +function contactLabelsText(row: Customer): string { + const v = cell(row, 'contactLabelValues') + if (Array.isArray(v)) { + const parts = v + .map((item) => { + if (typeof item === 'string') return item.trim() + if (item !== null && typeof item === 'object' && 'labelName' in item) { + return String((item as { labelName?: unknown }).labelName ?? '').trim() + } + return String(item ?? '').trim() + }) + .filter((s) => s !== '') + return parts.length > 0 ? parts.join('、') : '--' + } + return cellText(row, 'contactLabelValues') +} function imageCell(row: Customer, camelKey: string): string | undefined { const v = cell(row, camelKey) return typeof v === 'string' && v !== '' ? v : undefined @@ -340,7 +367,7 @@ onMounted(() => { { empty-text="暂无微信客户数据" @row-click="openDrawer" > - + - - + + - - + + - - + + - + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + +