Skip to content

Commit 0293465

Browse files
committed
feat: chat table support copy value via right click
1 parent 69819a5 commit 0293465

File tree

1 file changed

+7
-3
lines changed
  • frontend/src/views/chat/component/charts

1 file changed

+7
-3
lines changed

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,10 @@ 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)
111110
if (cellMeta) {
112111
let value = cellMeta.fieldValue
113112
if (value === null || value === undefined) {
114-
value = ''
113+
value = '-'
115114
}
116115
value = value + ''
117116
copyToClipboard(value).finally(() => {
@@ -138,7 +137,12 @@ function copyData(event: any, s2?: TableSheet) {
138137
currentRowData = []
139138
currentRowIndex = c.rowIndex
140139
}
141-
currentRowData.push(cellMeta.fieldValue as string)
140+
let value = cellMeta.fieldValue
141+
if (value === null || value === undefined) {
142+
value = '-'
143+
}
144+
value = value + ''
145+
currentRowData.push(value)
142146
}
143147
rowData.push(currentRowData.join('\t'))
144148
const finalValue = rowData.join('\n')

0 commit comments

Comments
 (0)