本帖最后由 Ellia.Duan 于 2023-10-19 10:56 编辑
情景:
需要复制多行的数据和格式 会导致部分电脑页面崩溃 数据量最大大概为 168次*60行*10列 + 40行*168次*10行
//动态插入行,复制样式
var row_addFrom = (itemList.length - 1) * 17;
var rowlist = row_addFrom + 5;
sheetFrom.addRows(rowlist, row_addFrom);
// 时间打点
for (let row_f = 1; row_f <= itemList.length; row_f++) {
let info = (row_f - 1) * 17 + 5;
let activeSheets = sheetFrom;
let fromRanges = [new GC.Spread.Sheets.Range(5, -1, 17, -1)];
let toRanges = [new GC.Spread.Sheets.Range(info, -1, 17 - 1)];
this.spread.commandManager().execute({
cmd: "clipboardPaste",
sheetName: "XXX",
fromSheet: activeSheets,
fromRanges: fromRanges,
pastedRanges: toRanges,
isCutting: false,
clipboardText: "",
pasteOption: GC.Spread.Sheets.ClipboardPasteOptions.all,
});
}
这一块有优化的方案吗?
|