From 8c845919e0224dde028ef6cd003e238e3f9bc918 Mon Sep 17 00:00:00 2001 From: ulleo Date: Wed, 3 Dec 2025 15:56:58 +0800 Subject: [PATCH] feat: chat table support copy value via right click --- frontend/src/views/chat/component/charts/Table.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/frontend/src/views/chat/component/charts/Table.ts b/frontend/src/views/chat/component/charts/Table.ts index 11a2e241..36b90fd6 100644 --- a/frontend/src/views/chat/component/charts/Table.ts +++ b/frontend/src/views/chat/component/charts/Table.ts @@ -107,11 +107,10 @@ function copyData(event: any, s2?: TableSheet) { } else if (cells.length == 1) { const c = cells[0] const cellMeta = s2.facet.getCellMeta(c.rowIndex, c.colIndex) - console.log(cellMeta) if (cellMeta) { let value = cellMeta.fieldValue if (value === null || value === undefined) { - value = '' + value = '-' } value = value + '' copyToClipboard(value).finally(() => { @@ -138,7 +137,12 @@ function copyData(event: any, s2?: TableSheet) { currentRowData = [] currentRowIndex = c.rowIndex } - currentRowData.push(cellMeta.fieldValue as string) + let value = cellMeta.fieldValue + if (value === null || value === undefined) { + value = '-' + } + value = value + '' + currentRowData.push(value) } rowData.push(currentRowData.join('\t')) const finalValue = rowData.join('\n')