fix(staff): format time columns in detail modal

YkStaffDetailModal Col gains optional formatter; baseCustomerCols time cols render via formatTime instead of raw epoch.

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
浅念
2026-08-05 18:58:06 +08:00
parent 55578cf299
commit 02a709ba93
2 changed files with 8 additions and 2 deletions
@@ -12,6 +12,8 @@ interface Col {
width?: number | string
minWidth?: number | string
align?: 'left' | 'center' | 'right'
/** el-table-column formatter (row, column, cellValue, index) → display string. */
formatter?: (row: any, column: any, cellValue: any, index: number) => string
}
const props = defineProps<{
modelValue: boolean
@@ -68,6 +70,7 @@ watch(
:width="c.width"
:min-width="c.minWidth"
:align="c.align"
:formatter="c.formatter"
show-overflow-tooltip
/>
</el-table>
+5 -2
View File
@@ -199,11 +199,14 @@ const detailFetcher = ref<(p: number, s: number) => Promise<any>>(
)
const detailCols = ref<any[]>([])
const fmtTime = (_r: any, _c: any, v: any): string =>
typeof v === 'number' && v > 0 ? formatTime(v) : v ? String(v) : '--'
const baseCustomerCols = [
{ prop: 'friend_nickname', label: '客户', minWidth: 140 },
{ prop: 'phone', label: '客户号码', width: 130 },
{ prop: 'last_chat_time', label: '最后沟通', width: 150 },
{ prop: 'add_time', label: '添加时间', width: 150 },
{ prop: 'last_chat_time', label: '最后沟通', width: 150, formatter: fmtTime },
{ prop: 'add_time', label: '添加时间', width: 150, formatter: fmtTime },
]
function openAddedModal(row: Account) {