找回密码
 立即注册

QQ登录

只需一步,快速开始

qunma

高级会员

149

主题

347

帖子

1182

积分

高级会员

积分
1182

微信认证勋章

qunma
高级会员   /  发表于:2021-5-18 09:56  /   查看:6016  /  回复:19
本帖最后由 Derrick.Jiao 于 2021-8-26 13:37 编辑

坏的链接   好的链接    坏的报错 image.png174355467.png image.png688238219.png

19 个回复

倒序浏览
Derrick.Jiao讲师达人认证 悬赏达人认证 SpreadJS 开发认证
论坛元老   /  发表于:2021-5-18 10:00:53
沙发
您好,请问这个报错的Excel是怎么生成的呢,这边将正常的Excel导入在线表格编辑器再导出未能复现您的问题,麻烦您提供更多能复现问题的信息或者demo。
回复 使用道具 举报
qunma
高级会员   /  发表于:2021-5-18 10:47:42
板凳
Derrick.Jiao 发表于 2021-5-18 10:00
您好,请问这个报错的Excel是怎么生成的呢,这边将正常的Excel导入在线表格编辑器再导出未能复现您的问题, ...

报错是由于加了筛选,之前一直很稳定,昨天突然就挂了,我把报错的excel的json发给你?
回复 使用道具 举报
Derrick.Jiao讲师达人认证 悬赏达人认证 SpreadJS 开发认证
论坛元老   /  发表于:2021-5-18 10:53:41
地板
qunma 发表于 2021-5-18 10:47
报错是由于加了筛选,之前一直很稳定,昨天突然就挂了,我把报错的excel的json发给你?

您把json提供上传,我们这边测试一下。
回复 使用道具 举报
qunma
高级会员   /  发表于:2021-5-19 13:19:59
5#
Derrick.Jiao 发表于 2021-5-18 10:53
您把json提供上传,我们这边测试一下。

{"version":"14.0.5","sheetCount":3,"allowUserZoom":false,"tabStripRatio":0.7,"calcOnDemand":true,"allowExtendPasteRange":true,"copyPasteHeaderOptions":0,"scrollbarAppearance":1,"customList":[],"sheets":{"工作表1":{"name":"工作表1","isSelected":true,"activeRow":2,"theme":"Office","data":{"dataTable":{"0":{"0":{"tag":"{\"sheetUnique\":1673624841072}"}},"2":{"0":{"value":"剩余效期情况","style":{"cellType":{"seted":"seted"},"cellPadding":"0 15 0 0"},"tag":"{\"hasFilterIcon\":true}"}},"3":{"0":{"value":"1/2<剩余效期情况<2/3"}},"4":{"0":{"value":"1/2<剩余效期情况<2/3","style":{"hAlign":3,"vAlign":1,"font":"13.3333px sans-serif","imeMode":1}}},"5":{"0":{"value":"1/2<剩余效期情况<2/3","style":{"hAlign":3,"vAlign":1,"font":"13.3333px sans-serif","imeMode":1}}},"6":{"0":{"value":"剩余效期情况<2/3","style":{"hAlign":3,"vAlign":1,"font":"13.3333px sans-serif","imeMode":1}}},"7":{"0":{"value":"剩余效期情况<2/3","style":{"hAlign":3,"vAlign":1,"font":"13.3333px sans-serif","imeMode":1}}}},"rowDataArray":[null,null,{"tag":""},{"tag":""},null,null,{"tag":""}],"defaultDataNode":{"style":{"vAlign":1,"font":"13.3333px sans-serif","cellType":{"allowOverflow":true,"typeName":"1","editorType":1,"showEffect":true}}}},"rowHeaderData":{"defaultDataNode":{"style":{"themeFont":"Body"}}},"colHeaderData":{"defaultDataNode":{"style":{"themeFont":"Body"}}},"columns":[{"size":252}],"rowHeaderColInfos":[{"size":40}],"leftCellIndex":0,"topCellIndex":0,"selections":{"0":{"row":2,"rowCount":1,"col":0,"colCount":1},"length":1},"rowOutlines":{"items":[]},"columnOutlines":{"items":[]},"floatingObjects":[{"name":"filter_upperborder","y":40,"width":252,"startRow":2,"startColumn":0,"endRow":2,"endColumn":1,"allowResize":false,"allowMove":false,"typeName":"0","content":"<div style=\"border: 1px solid rgb(180, 206, 255); box-sizing: content-box;\"></div>","zIndex":600},{"name":"filter_rightborder","x":252,"y":40,"height":60,"startRow":2,"startColumn":1,"endRow":8,"endColumn":1,"allowResize":false,"allowMove":false,"typeName":"0","content":"<div style=\"border: 1px solid rgb(180, 206, 255); box-sizing: content-box;\"></div>","zIndex":600},{"name":"filter_buttomborder","y":100,"width":252,"startRow":8,"startColumn":0,"endRow":8,"endColumn":1,"allowResize":false,"allowMove":false,"typeName":"0","content":"<div style=\"border: 1px solid rgb(180, 206, 255); box-sizing: content-box;\"></div>","zIndex":600},{"name":"filter_leftborder","y":40,"height":60,"startRow":2,"startColumn":0,"endRow":8,"endColumn":0,"allowResize":false,"allowMove":false,"typeName":"0","content":"<div style=\"border: 1px solid rgb(180, 206, 255); box-sizing: content-box;\"></div>","zIndex":600},{"name":"batchAddRow","y":3940,"width":8,"startRow":200,"startColumn":0,"endRow":199,"endRowOffset":20,"endColumn":0,"endColumnOffset":8,"dynamicSize":false,"allowResize":false,"allowMove":false,"typeName":"0","content":"<div><div class=\"floatAddRow\">\n                  <span class=\"iconfont icontianjia floatAddRowFontClass\" onclick=\"floatAddRowOrCol(1,1)\"></span>\n                  在底部添加\n                  <input class=\"floatAddRowInput\" name=\"floatAddRowInput\" onclick=\"stopDefaultFloatInputEvent(event)\" id=\"floatAddRow\" value=\"10\" type=\"number\" min=\"1\" max=\"500\">\n                  <span class=\"floatAddRowHang\">行</span>\n                  <span class=\"floatAddRowBtn\" onclick=\"floatAddRowOrCol(1,2)\">确认添加</span>\n                </div></div>"},{"name":"batchAddCol","x":1430,"startRow":0,"startColumn":20,"endRow":0,"endColumn":19,"endColumnOffset":62,"dynamicSize":false,"allowResize":false,"allowMove":false,"typeName":"0","content":"<div><div class=\"floatAddCol\" style=\"margin-top:-20px;\">\n                  <span class=\"iconfont icontianjia floatAddColFontClass\" onclick=\"floatAddRowOrCol(2,1)\"></span>\n                  <p class=\"floatAddColP\">在右侧添加</p>\n                  <div>\n                    <input class=\"floatAddRowInput floatAddColInput\" name=\"floatAddColInput\" onclick=\"stopDefaultFloatInputEvent(event)\" id=\"floatAddCol\" value=\"10\" type=\"number\" min=\"1\" max=\"500\">\n                    <span class=\"floatAddRowHang floatAddRowLie\">列</span>\n                  </div>\n                  <span class=\"floatAddColBtn\" onclick=\"floatAddRowOrCol(2,2)\">确认添加</span>\n                </div></div>"}],"cellStates":{},"rowFilter":{"range":{"row":3,"rowCount":6,"col":0,"colCount":1},"typeName":"HideRowFilter","dialogVisibleInfo":{},"filterItemMap":[{"index":0,"conditions":[{"conType":2,"compareType":0,"expected":"剩余效期情况<2/3"}]}],"filteredColumns":[0],"filterButtonVisibleInfo":{"0":false},"showFilterButton":false,"filteredOutRows":[3,4,5,8]},"outlineColumnOptions":{},"autoMergeRangeInfos":[],"printInfo":{"paperSize":{"width":850,"height":1100,"kind":1}},"frozenlineColor":"rgba(89, 89, 89, 0.4)","sheetTabColor":"f7f7f7","allowCellOverflow":false,"protectionOptions":{"allowResizeColumns":true,"allowResizeRows":true},"index":0},"工作表2":{"name":"工作表2","isSelected":false,"theme":"Office","data":{"dataTable":{"0":{"0":{"tag":"{\"sheetUnique\":1769136815972}"}}},"defaultDataNode":{"style":{"vAlign":1,"font":"13.3333px sans-serif"}}},"rowHeaderData":{},"colHeaderData":{},"rowHeaderColInfos":[{"size":40}],"leftCellIndex":0,"topCellIndex":0,"selections":{"0":{"row":0,"rowCount":1,"col":0,"colCount":1},"length":1},"rowOutlines":{"items":[]},"columnOutlines":{"items":[]},"cellStates":{},"outlineColumnOptions":{},"autoMergeRangeInfos":[],"frozenlineColor":"rgba(89, 89, 89, 0.4)","sheetTabColor":"f7f7f7","protectionOptions":{"allowResizeColumns":true,"allowResizeRows":true},"index":1},"工作表3":{"name":"工作表3","isSelected":false,"theme":"Office","data":{"dataTable":{"0":{"0":{"tag":"{\"sheetUnique\":1708855028066}"}}},"defaultDataNode":{"style":{"vAlign":1,"font":"13.3333px sans-serif"}}},"rowHeaderData":{},"colHeaderData":{},"rowHeaderColInfos":[{"size":40}],"leftCellIndex":0,"topCellIndex":0,"selections":{"0":{"row":0,"rowCount":1,"col":0,"colCount":1},"length":1},"rowOutlines":{"items":[]},"columnOutlines":{"items":[]},"cellStates":{},"outlineColumnOptions":{},"autoMergeRangeInfos":[],"frozenlineColor":"rgba(89, 89, 89, 0.4)","sheetTabColor":"f7f7f7","protectionOptions":{"allowResizeColumns":true,"allowResizeRows":true},"index":2}}}
回复 使用道具 举报
qunma
高级会员   /  发表于:2021-5-19 13:24:07
6#
qunma 发表于 2021-5-19 13:19
{"version":"14.0.5","sheetCount":3,"allowUserZoom":false,"tabStripRatio":0.7,"calcOnDemand":true," ...

有筛选条件下,这样的方式导出,在导入到spread是可以的 ,但是
let ex = new ExcelIO.IO();
ex.save(this.spread.toJSON(), async blob => {
                let file = new window.File([blob], 'test.xlsx');
})

在转成xlsx文件 下载时就GG了

回复 使用道具 举报
Derrick.Jiao讲师达人认证 悬赏达人认证 SpreadJS 开发认证
论坛元老   /  发表于:2021-5-19 13:42:55
7#
qunma 发表于 2021-5-19 13:24
有筛选条件下,这样的方式导出,在导入到spread是可以的 ,但是
let ex = new ExcelIO.IO();
ex.save(t ...

由您提供的json这边未能复现您的问题,在粘贴发布中可能有部分内容被转义了,您若需要上传文件,麻烦您在高级模式中将文件上传。

另外,导出Excel我们推荐的是FileSaver.js的saveAS方法。

建议您使用14.1.0版本,并使用上述方式导出。若仍未解决您问题,麻烦您上传一个能运行的demo,这边调研一下。否则,沟通效率不高,您的问题也没有得到有效的解决。
回复 使用道具 举报
qunma
高级会员   /  发表于:2021-5-21 16:05:21
8#
Derrick.Jiao 发表于 2021-5-19 13:42
由您提供的json这边未能复现您的问题,在粘贴发布中可能有部分内容被转义了,您若需要上传文件,麻烦您在 ...

FileSaver.js的saveAS直接就导出了,我这边是想拿到这个file,然后上传到oss。有类似的方案吗?
初步定为到的问题是,带有<字符的筛选的字段会出现这个问题,可能是因为toJson之后生成的json文件通过File转义的时候出现了问题。
回复 使用道具 举报
Derrick.Jiao讲师达人认证 悬赏达人认证 SpreadJS 开发认证
论坛元老   /  发表于:2021-5-21 16:12:45
9#
qunma 发表于 2021-5-21 16:05
FileSaver.js的saveAS直接就导出了,我这边是想拿到这个file,然后上传到oss。有类似的方案吗?
初步 ...

这边没有类似的方案。目前这边推荐的是以json的形式导出或者用filesaver与ExcelIO导出Excel
回复 使用道具 举报
qunma
高级会员   /  发表于:2021-5-24 14:31:27
10#
Derrick.Jiao 发表于 2021-5-21 16:12
这边没有类似的方案。目前这边推荐的是以json的形式导出或者用filesaver与ExcelIO导出Excel

我发现官方也是有这个问题的。你们看下这个问题,看下gif会复现
QQ20210524-142440-HD.gif
回复 使用道具 举报
12下一页
您需要登录后才可以回帖 登录 | 立即注册
返回顶部