fix(ui): 微信客户列表列布局对齐云客(头像+昵称+微信号复合单元格)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
浅念
2026-08-15 10:59:27 +08:00
parent 1f89eeddb0
commit d28936cf94
+23 -12
View File
@@ -96,6 +96,13 @@ function imageCell(row: Customer, camelKey: string): string | undefined {
const v = cell(row, camelKey)
return typeof v === 'string' && v !== '' ? v : undefined
}
/** 客户微信 复合单元格:头像 fallback 首字(昵称→friend_id)。 */
function initials(row: Customer): string {
const nick = cell(row, 'friendWxNickname')
const source =
typeof nick === 'string' && nick ? nick : row.friend_nickname ?? row.friend_id ?? '?'
return String(source).slice(0, 1) || '?'
}
/** WhatsApp tab 行序号(含分页偏移)。 */
function waSerial(index: number): number {
const st = tabState.whatsapp
@@ -355,15 +362,20 @@ onMounted(() => {
empty-text="暂无微信客户数据"
@row-click="openDrawer"
>
<el-table-column label="客户微信" min-width="200">
<el-table-column label="客户微信" min-width="220">
<template #default="{ row }">
<div class="yk-pair">
<span class="yk-pair__k">昵称</span>
<span class="yk-pair__v" :title="cellText(row, 'friendWxNickname')">{{ cellText(row, 'friendWxNickname') }}</span>
</div>
<div class="yk-pair">
<span class="yk-pair__k">微信号</span>
<span class="yk-pair__v">{{ cellText(row, 'friendWxId') }}</span>
<div class="yk-wxuser">
<el-avatar :size="36" :src="imageCell(row, 'friendHeadImageUrl')" shape="square">
{{ initials(row) }}
</el-avatar>
<div class="yk-wxuser__meta">
<div class="yk-staffinfo__nick" :title="cellText(row, 'friendWxNickname')">
{{ cellText(row, 'friendWxNickname') }}
</div>
<div class="yk-staffinfo__muted" :title="cellText(row, 'friendWxId')">
{{ cellText(row, 'friendWxId') }}
</div>
</div>
</div>
</template>
</el-table-column>
@@ -565,10 +577,9 @@ onMounted(() => {
.yk-customers__pager { margin-top: 12px; display: flex; justify-content: flex-end; }
.yk-customers__hint { margin: 8px 2px 0; font-size: 12px; color: #c0c4cc; }
/* label/value pair stack(客户微信 复合单元格)— 与 StaffList 一致 */
.yk-pair { display: flex; gap: 6px; line-height: 1.8; font-size: 13px; white-space: nowrap; }
.yk-pair__k { color: #909399; flex-shrink: 0; }
.yk-pair__v { color: #303133; overflow: hidden; text-overflow: ellipsis; }
/* 客户微信 复合单元格(头像 + 昵称 + 微信号,对齐云客) */
.yk-wxuser { display: flex; align-items: center; gap: 8px; }
.yk-wxuser__meta { min-width: 0; }
/* WhatsApp 文字行(员工信息 / 员工WA / 客户WA 复合单元格)— 与 StaffList 一致 */
.yk-staffinfo__nick { font-weight: 600; font-size: 13px; color: #303133; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }