| | |
| | | |
| | | export function createPurchaseTableColumns({ |
| | | handleView, |
| | | handleViewItems, |
| | | handleEdit, |
| | | handleDelete, |
| | | canEdit = true, |
| | |
| | | formatter: (row) => { |
| | | const operations = [{ key: 'view', label: '详情', icon: 'ri:eye-line' }] |
| | | |
| | | if (handleViewItems) { |
| | | operations.push({ |
| | | key: 'items', |
| | | label: '明细', |
| | | icon: 'ri:list-check-3' |
| | | }) |
| | | } |
| | | |
| | | if (canEdit && handleEdit) { |
| | | operations.push({ key: 'edit', label: '编辑', icon: 'ri:pencil-line' }) |
| | | } |
| | |
| | | list: operations, |
| | | onClick: (item) => { |
| | | if (item.key === 'view') handleView?.(row) |
| | | if (item.key === 'items') handleViewItems?.(row) |
| | | if (item.key === 'edit') handleEdit?.(row) |
| | | if (item.key === 'delete') handleDelete?.(row) |
| | | } |