mirror of
https://github.com/nocodb/nocodb.git
synced 2026-05-04 04:36:53 +00:00
skip serialize for currency and percent
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { ColumnHelper, type ColumnType, type TableType } from 'nocodb-sdk'
|
||||
import { ColumnHelper } from 'nocodb-sdk'
|
||||
import type { type ColumnType, type TableType, UITypes } from 'nocodb-sdk'
|
||||
|
||||
export const valueToCopy = (
|
||||
rowObj: Row,
|
||||
@@ -9,10 +10,16 @@ export const valueToCopy = (
|
||||
meta: TableType
|
||||
metas: { [idOrTitle: string]: TableType | any }
|
||||
},
|
||||
option?: {
|
||||
skipUidt?: UITypes[]
|
||||
},
|
||||
) => {
|
||||
const { isPg, isMysql, meta, metas } = cb
|
||||
const textToCopy = (columnObj.title && rowObj.row[columnObj.title]) ?? ''
|
||||
|
||||
if (option?.skipUidt?.includes(columnObj.uidt as UITypes)) {
|
||||
return textToCopy
|
||||
}
|
||||
return ColumnHelper.parseValue(textToCopy, {
|
||||
col: columnObj,
|
||||
isMysql,
|
||||
@@ -30,6 +37,10 @@ export const serializeRange = (
|
||||
isPg: (sourceId: string) => boolean
|
||||
isMysql: (sourceId: string) => boolean
|
||||
meta: TableType
|
||||
metas?: { [idOrTitle: string]: TableType | any }
|
||||
},
|
||||
option?: {
|
||||
skipUidt?: UITypes[]
|
||||
},
|
||||
) => {
|
||||
let html = '<table>'
|
||||
@@ -40,7 +51,7 @@ export const serializeRange = (
|
||||
let copyRow = '<tr>'
|
||||
const jsonRow: string[] = []
|
||||
cols.forEach((col, i) => {
|
||||
const value = valueToCopy(row, col, cb)
|
||||
const value = valueToCopy(row, col, cb, option)
|
||||
copyRow += `<td>${value}</td>`
|
||||
text = `${text}${value}${cols.length - 1 !== i ? '\t' : ''}`
|
||||
jsonRow.push(value)
|
||||
|
||||
Reference in New Issue
Block a user