|
|
@ -912,24 +912,27 @@ export function useMultiSelect( |
|
|
|
const rows = unref(data).slice(startRow, endRow + 1) |
|
|
|
const rows = unref(data).slice(startRow, endRow + 1) |
|
|
|
const props = [] |
|
|
|
const props = [] |
|
|
|
|
|
|
|
|
|
|
|
if (e.clipboardData?.files?.length) { |
|
|
|
let pasteValue |
|
|
|
let pasteValue |
|
|
|
const files = e.clipboardData?.files |
|
|
|
for (const row of rows) { |
|
|
|
for (const row of rows) { |
|
|
|
// TODO handle insert new row
|
|
|
|
// TODO handle insert new row
|
|
|
|
if (!row || row.rowMeta.new) continue |
|
|
|
if (!row || row.rowMeta.new) continue |
|
|
|
|
|
|
|
|
|
|
|
for (const col of cols) { |
|
|
|
for (const col of cols) { |
|
|
|
if (!col.title || !isPasteable(row, col) || col.uidt !== UITypes.Attachment) { |
|
|
|
if (!col.title || !isPasteable(row, col)) { |
|
|
|
|
|
|
|
continue |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (files?.length) { |
|
|
|
|
|
|
|
if (col.uidt !== UITypes.Attachment) { |
|
|
|
continue |
|
|
|
continue |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
props.push(col.title) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (pasteValue === undefined) { |
|
|
|
if (pasteValue === undefined) { |
|
|
|
const fileUploadPayload = convertCellData( |
|
|
|
const fileUploadPayload = convertCellData( |
|
|
|
{ |
|
|
|
{ |
|
|
|
value: '', |
|
|
|
value: '', |
|
|
|
files: e.clipboardData?.files, |
|
|
|
files: files, |
|
|
|
to: col.uidt as UITypes, |
|
|
|
to: col.uidt as UITypes, |
|
|
|
column: col, |
|
|
|
column: col, |
|
|
|
appInfo: unref(appInfo), |
|
|
|
appInfo: unref(appInfo), |
|
|
@ -943,27 +946,8 @@ export function useMultiSelect( |
|
|
|
pasteValue = Array.isArray(uploadedFiles) && uploadedFiles.length ? JSON.stringify(uploadedFiles) : null |
|
|
|
pasteValue = Array.isArray(uploadedFiles) && uploadedFiles.length ? JSON.stringify(uploadedFiles) : null |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
if (pasteValue !== undefined) { |
|
|
|
pasteValue = convertCellData( |
|
|
|
row.row[col.title] = pasteValue |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
for (const row of rows) { |
|
|
|
|
|
|
|
// TODO handle insert new row
|
|
|
|
|
|
|
|
if (!row || row.rowMeta.new) continue |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (const col of cols) { |
|
|
|
|
|
|
|
if (!col.title) continue |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!isPasteable(row, col)) { |
|
|
|
|
|
|
|
continue |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
props.push(col.title) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const pasteValue = convertCellData( |
|
|
|
|
|
|
|
{ |
|
|
|
{ |
|
|
|
value: clipboardData, |
|
|
|
value: clipboardData, |
|
|
|
to: col.uidt as UITypes, |
|
|
|
to: col.uidt as UITypes, |
|
|
@ -973,13 +957,16 @@ export function useMultiSelect( |
|
|
|
isMysql(meta.value?.source_id), |
|
|
|
isMysql(meta.value?.source_id), |
|
|
|
true, |
|
|
|
true, |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (pasteValue !== undefined) { |
|
|
|
props.push(col.title) |
|
|
|
row.row[col.title] = pasteValue |
|
|
|
|
|
|
|
} |
|
|
|
if (pasteValue !== undefined) { |
|
|
|
|
|
|
|
row.row[col.title] = pasteValue |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (!props.length) return |
|
|
|
if (!props.length) return |
|
|
|
await bulkUpdateRows?.(rows, props) |
|
|
|
await bulkUpdateRows?.(rows, props) |
|
|
|
} |
|
|
|
} |
|
|
|