feat(modal): YkStaffDetailModal Col 支持可选 onClick(单元格可点)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
浅念
2026-08-06 17:32:05 +08:00
parent ebac26822b
commit 1368e3a471
+9 -1
View File
@@ -14,6 +14,8 @@ interface Col {
align?: 'left' | 'center' | 'right'
/** el-table-column formatter (row, column, cellValue, index) → display string. */
formatter?: (row: any, column: any, cellValue: any, index: number) => string
/** 该列单元格可点:渲染为 link button,点击触发回调(用于 modal 内跳聊天等)。 */
onClick?: (row: any) => void
}
const props = defineProps<{
modelValue: boolean
@@ -72,7 +74,13 @@ watch(
:align="c.align"
:formatter="c.formatter"
show-overflow-tooltip
/>
>
<template v-if="c.onClick" #default="{ row }">
<el-button link type="primary" size="small" @click="c.onClick?.(row)">
{{ c.formatter ? c.formatter(row, c, row[c.prop], 0) : row[c.prop] }}
</el-button>
</template>
</el-table-column>
</el-table>
<div style="margin-top: 10px; display: flex; justify-content: flex-end">
<el-pagination