feat(modal): YkStaffDetailModal Col 支持可选 onClick(单元格可点)
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -14,6 +14,8 @@ interface Col {
|
|||||||
align?: 'left' | 'center' | 'right'
|
align?: 'left' | 'center' | 'right'
|
||||||
/** el-table-column formatter (row, column, cellValue, index) → display string. */
|
/** el-table-column formatter (row, column, cellValue, index) → display string. */
|
||||||
formatter?: (row: any, column: any, cellValue: any, index: number) => string
|
formatter?: (row: any, column: any, cellValue: any, index: number) => string
|
||||||
|
/** 该列单元格可点:渲染为 link button,点击触发回调(用于 modal 内跳聊天等)。 */
|
||||||
|
onClick?: (row: any) => void
|
||||||
}
|
}
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
modelValue: boolean
|
modelValue: boolean
|
||||||
@@ -72,7 +74,13 @@ watch(
|
|||||||
:align="c.align"
|
:align="c.align"
|
||||||
:formatter="c.formatter"
|
:formatter="c.formatter"
|
||||||
show-overflow-tooltip
|
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>
|
</el-table>
|
||||||
<div style="margin-top: 10px; display: flex; justify-content: flex-end">
|
<div style="margin-top: 10px; display: flex; justify-content: flex-end">
|
||||||
<el-pagination
|
<el-pagination
|
||||||
|
|||||||
Reference in New Issue
Block a user