Skip to content

Commit a4e0a43

Browse files
committed
feat: chat table support copy value via right click
1 parent 9ddbefe commit a4e0a43

File tree

1 file changed

+6
-1
lines changed
  • frontend/src/views/chat/component/charts

1 file changed

+6
-1
lines changed

frontend/src/views/chat/component/charts/Table.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,13 @@ function copyData(event: any, s2?: TableSheet) {
107107
} else if (cells.length == 1) {
108108
const c = cells[0]
109109
const cellMeta = s2.facet.getCellMeta(c.rowIndex, c.colIndex)
110+
console.log(cellMeta)
110111
if (cellMeta) {
111-
copyToClipboard(cellMeta.fieldValue as string).finally(() => {
112+
let value = cellMeta.value as string
113+
if (value === null || value === undefined) {
114+
value = ''
115+
}
116+
copyToClipboard(value).finally(() => {
112117
ElMessage.success(t('qa.copied'))
113118
console.debug('copied:', cellMeta.fieldValue)
114119
})

0 commit comments

Comments
 (0)