1金币
本帖最后由 Richard.Huang 于 2024-5-29 12:02 编辑
产品:SpreadJS
版本:V17
复制粘贴快捷键与clipboardPaste表现不一致,快捷键为正常内容,clipboardPaste会将单元格中的换行识别为多个单元格。
源数据:
https://docs.qq.com/sheet/DR2F2cGlySW1WalNY?tab=BB08J2
快捷键粘贴:
cmd:clipboardPaste粘贴
- spread.commandManager().execute({
- cmd: "clipboardPaste",
- sheetName: "Sheet1",
- pastedRanges: [
- {
- row: 1,
- col: 1,
- rowCount: 6,
- colCount: 1,
- },
- ],
- isCutting: false,
- clipboardText: `1、范德萨发撒
- 2、范德萨发撒地方撒
- 1、发撒发大发的
- 2、范德萨发撒地方
- `,
- clipboardHtml: `<meta charset='utf-8'><html xmlns:x="tencent"><meta charset="utf-8"><style type='text/css'><!-- td { empty-cells:show;line-height:normal;color:#000;vertical-align:middle;outline-width:0;word-wrap:break-word;word-break:normal;white-space:nowrap;font-size:10pt; } table { border-collapse: collapse; } font{ white-space: pre-wrap }--></style><body><!--StartFragment--><table style="border-collapse:collapse;table-layout: fixed;width: 0;" selectType="cells"><col width="101" style="width: 101px;"><tr height="24" style="mso-height-source:auto;height:24px;" ><td style="font-size:10pt;border-left: .5pt solid #000000;border-top: .5pt solid #000000;border-right: .5pt solid #000000;border-bottom: .5pt solid #000000;vertical-align:middle;text-align:left;white-space:normal;width: 101px;" width="101" >1、范德萨发撒<br style="mso-data-placement:same-cell;">2、范德萨发撒地方撒</td></tr><tr height="24" style="mso-height-source:auto;height:24px;" ><td style="font-size: 10pt;width: 101px;" width="101" ></td></tr><tr height="24" style="mso-height-source:auto;height:24px;" ><td style="font-size: 10pt;width: 101px;" width="101" ></td></tr><tr height="24" style="mso-height-source:auto;height:24px;" ><td style="font-size: 10pt;width: 101px;" width="101" ></td></tr><tr height="24" style="mso-height-source:auto;height:24px;" ><td style="font-size:10pt;vertical-align:bottom;text-align:left;white-space:normal;width: 101px;" width="101" >1、发撒发大发的<br style="mso-data-placement:same-cell;">2、范德萨发撒地方</td></tr><tr height="24" style="mso-height-source:auto;height:24px;" ><td data-online-sheet-type='cell-image' tdocs-image-url='https://docimg10.docs.qq.com/image/AgAABuYP8cYKRZ1B9-FCbroSyjpkMF84.png?w=48&h=48' data-online-sheet-width='136' data-online-sheet-height='136' style="font-size:10pt;vertical-align:middle;text-align:left;white-space:no-wrap;width: 101px;" width="101" ><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAAAfRJREFUaEPtmc1xwjAQhVc9pIfQQw7BFQAdhBSRK/Y1RYR0AFSAc0gP0EN6UCJ5zAhZsrTWyrId+wAz4J/37Vut1hKDkR9s5PphBkjtIJ0Dh5elhGFsp0BVvwGU8pOzL/m9+cipwMMBDq85MP78J7IW66+NsyIUpjtAJVyNtr9w/cwAEDyASBXGzt3VtlzZAQQHQBl1GwcSwh+gD/E1FALCD6BP8UgIN0AK8QiIdoCU4m8QPIPNZzWPGI52gOOWR6k22Juu91addoAhRN8jlewAQ4l+DWFxwQxAEP3lwwLOT2/y8cX1BPnlhE2c+/MtpdUMQBD9fLGC3eOKDkA0hOt9pkdhTAAAvFmRmgAE6SOiFMGBCQAY0qjpwHErOk18b68lZxQH/gsAyewbyQEAbT4wpdDoAeYxEK2MphrE2fc7lD+XsFZCXG1oJwwTWcSX9lCE0QMYOlJbLxQ8kNVulCyFvAEI+iHyeQDVTotcDWypVQASB1AvNAKAwIXQMXu7vmWdaMIv9dKFAZRUxyrdxBe26iRMMR4810fdDqSA8BQvpPkD9FWZEOLxALEhDKsOrlKMc0C9G+W4QEZdldEdIHxslHLXMnDHMhxAd0Umpty1FMf9Nqvs6Xkh/2lZMnelDa0DmKdFOJfWgQgCXbecAVwRiv3/L47oKUCUA2Z8AAAAAElFTkSuQmCC" tdocs-image-url="https://docimg10.docs.qq.com/image/AgAABuYP8cYKRZ1B9-FCbroSyjpkMF84.png?w=48&h=48" tencent-sheet-cell-img='true'></td></tr></table><!--EndFragment--></body></html>`,
- pasteOption: GC.Spread.Sheets.ClipboardPasteOptions.all,
- });
复制代码 |
|