【v17】fromJSON的options中包含会导致activeSheetIndex无效
本帖最后由 Ellia.Duan 于 2024-10-9 17:31 编辑如附件录屏所示,移动端模式下,Sheet1-3为隐藏sheet,activeSheetIndex 为 3 即Sheet4
调用fromJSON,
第二个参数不传,则默认展示sheet4
第二个参数传了incrementalLoading,则默认展示Sheet2,导致activeSheetIndex设置无效,隐藏的sheet内容展示出来了。
复现路径:https://developer.mescius.com/spreadjs/designer/index.html,控制台执行以下代码即可复现
const designer = new GC.Spread.Sheets.Designer.Designer(document.getElementById("gc-designer-container"));
const spread = designer.getWorkbook();
const sheet = spread.getActiveSheet();
spread.options.scrollByPixel = true;
spread.options.scrollbarShowMax = true;
spread.options.scrollbarMaxAlign = true;
spread.options.allowExtendPasteRange = true;
spread.fromJSON({
"version": "16.1.4",
"sheetCount": 5,
"allowUserDragDrop": false,
"allowUserDragFill": false,
"showHorizontalScrollbar": false,
"showVerticalScrollbar": false,
"scrollbarMaxAlign": true,
"tabStripPosition": 1,
"tabEditable": false,
"newTabVisible": false,
"allSheetsListVisible": 0,
"cutCopyIndicatorBorderColor": "#1564FF",
"backColor": "#ffffff",
"grayAreaBackColor": "#F5F7F9",
"useTouchLayout": true,
"allowExtendPasteRange": true,
"copyPasteHeaderOptions": 0,
"scrollByPixel": true,
"scrollbarAppearance": 1,
"customList": [],
"numbersFitMode": 1,
"allowInvalidFormula": true,
"sheets": {
"Sheet1": {
"name": "Sheet1",
"isSelected": false,
"zoomFactor": 0.75,
"visible": false,
"frozenTrailingRowStickToEdge": true,
"frozenTrailingColumnStickToEdge": true,
"theme": "Office",
"data": {
"defaultDataNode": {
"style": {
"backColor": null,
"foreColor": "#1B1C1E",
"vAlign": 1,
"font": "10pt PingFangSC-Regular",
"themeFont": null,
"formatter": null,
"locked": null,
"textIndent": null,
"wordWrap": null,
"showEllipsis": null,
"shrinkToFit": null,
"backgroundImage": null,
"cellType": null,
"tabStop": null,
"parentName": null,
"watermark": null,
"cellPadding": "3px 4px 1px 4px"
}
},
"dataTable": {
"1": {
"2": {
"value": "q",
"style": {
"backColor": null,
"foreColor": "#1B1C1E",
"_fontSize": "10pt",
"_fontSizeDigit": 10,
"_fontSizeUnit": "pt",
"_fontFamily": "PingFangSC-Regular",
"_font": "10pt PingFangSC-Regular",
"locked": true,
"hidden": false,
"textDecoration": 0,
"cellPadding": "3px 4px 1px 4px"
}
}
},
"2": {
"2": {
"value": 1,
"style": {
"backColor": null,
"foreColor": "#1B1C1E",
"_fontSize": "10pt",
"_fontSizeDigit": 10,
"_fontSizeUnit": "pt",
"_fontFamily": "PingFangSC-Regular",
"_font": "10pt PingFangSC-Regular",
"locked": true,
"hidden": false,
"cellPadding": "3px 4px 1px 4px"
}
}
},
"3": {
"2": {
"value": 1,
"style": {
"backColor": null,
"foreColor": "#1B1C1E",
"_fontSize": "10pt",
"_fontSizeDigit": 10,
"_fontSizeUnit": "pt",
"_fontFamily": "PingFangSC-Regular",
"_font": "10pt PingFangSC-Regular",
"locked": true,
"hidden": false,
"cellPadding": "3px 4px 1px 4px"
}
}
},
"4": {
"2": {
"value": 1,
"style": {
"backColor": null,
"foreColor": "#1B1C1E",
"_fontSize": "10pt",
"_fontSizeDigit": 10,
"_fontSizeUnit": "pt",
"_fontFamily": "PingFangSC-Regular",
"_font": "10pt PingFangSC-Regular",
"locked": true,
"hidden": false,
"cellPadding": "3px 4px 1px 4px"
}
}
},
"5": {
"2": {
"value": 1,
"style": {
"backColor": null,
"foreColor": "#1B1C1E",
"_fontSize": "10pt",
"_fontSizeDigit": 10,
"_fontSizeUnit": "pt",
"_fontFamily": "PingFangSC-Regular",
"_font": "10pt PingFangSC-Regular",
"locked": true,
"hidden": false,
"cellPadding": "3px 4px 1px 4px"
}
}
},
"6": {
"2": {
"value": 1,
"style": {
"backColor": null,
"foreColor": "#1B1C1E",
"_fontSize": "10pt",
"_fontSizeDigit": 10,
"_fontSizeUnit": "pt",
"_fontFamily": "PingFangSC-Regular",
"_font": "10pt PingFangSC-Regular",
"locked": true,
"hidden": false,
"cellPadding": "3px 4px 1px 4px"
}
}
},
"7": {
"2": {
"value": 1,
"style": {
"backColor": null,
"foreColor": "#1B1C1E",
"_fontSize": "10pt",
"_fontSizeDigit": 10,
"_fontSizeUnit": "pt",
"_fontFamily": "PingFangSC-Regular",
"_font": "10pt PingFangSC-Regular",
"locked": true,
"hidden": false,
"cellPadding": "3px 4px 1px 4px"
}
}
},
"8": {
"2": {
"value": 1,
"style": {
"backColor": null,
"foreColor": "#1B1C1E",
"_fontSize": "10pt",
"_fontSizeDigit": 10,
"_fontSizeUnit": "pt",
"_fontFamily": "PingFangSC-Regular",
"_font": "10pt PingFangSC-Regular",
"locked": true,
"hidden": false,
"cellPadding": "3px 4px 1px 4px"
}
}
}
},
"rowDataArray": [],
"columnDataArray": []
},
"rowHeaderData": {
"columnDataArray": [
{
"style": {
"font": "12px PingFangSC-Regular"
}
}
],
"defaultDataNode": {
"style": {
"themeFont": "Body"
}
}
},
"colHeaderData": {
"rowDataArray": [
{
"style": {
"font": "12px PingFangSC-Regular"
}
}
],
"defaultDataNode": {
"style": {
"themeFont": "Body"
}
}
},
"rowHeaderColInfos": [
{
"resizable": false,
"size": 50
}
],
"colHeaderRowInfos": [
{
"resizable": false,
"size": 26
}
],
"leftCellIndex": 0,
"topCellIndex": 0,
"selections": {
"0": {
"row": 0,
"col": 0,
"rowCount": 1,
"colCount": 1
},
"length": 1
},
"defaults": {
"colHeaderRowHeight": 20,
"colWidth": 104,
"rowHeaderColWidth": 40,
"rowHeight": 26,
"_isExcelDefaultColumnWidth": false
},
"rowOutlines": {
"items": []
},
"columnOutlines": {
"items": []
},
"cellStates": {},
"states": {},
"outlineColumnOptions": {},
"autoMergeRangeInfos": [],
"shapeCollectionOption": {
"snapMode": 0
},
"printInfo": {
"paperSize": {
"width": 850,
"height": 1100,
"kind": 1
}
},
"frozenlineColor": "#A8ACB3",
"allowCellOverflow": false,
"gridline": {
"color": "#E4E7ED"
},
"namedStyles": [
{
"backColor": null,
"foreColor": "#1B1C1E",
"hAlign": 3,
"vAlign": 1,
"font": "13.3333px PingFangSC-Regular",
"themeFont": null,
"formatter": null,
"locked": null,
"textIndent": null,
"wordWrap": null,
"showEllipsis": null,
"shrinkToFit": null,
"backgroundImage": null,
"cellType": null,
"tabStop": null,
"imeMode": 1,
"name": "defaultCellStyle",
"parentName": null,
"watermark": null,
"cellPadding": "3px 4px 1px 4px"
}
],
"rowCount": 200,
"index": 0,
"columnCount": 20,
"frozenRowCount": 0,
"frozenColCount": 0,
"frozenTrailingRowCount": 0,
"frozenTrailingColCount": 0,
"spans": [],
"rows": [
null,
{
"size": 26
},
{
"size": 26
},
{
"size": 26
},
{
"size": 26
},
{
"size": 26
},
{
"size": 26
},
{
"size": 26
},
{
"size": 26
}
],
"columns": [],
"floatingObjects": [],
"charts": []
},
"Sheet2": {
"name": "Sheet2",
"isSelected": false,
"zoomFactor": 0.75,
"visible": false,
"frozenTrailingRowStickToEdge": true,
"frozenTrailingColumnStickToEdge": true,
"theme": "Office",
"data": {
"defaultDataNode": {
"style": {
"backColor": null,
"foreColor": "#1B1C1E",
"vAlign": 1,
"font": "10pt PingFangSC-Regular",
"themeFont": null,
"formatter": null,
"locked": null,
"textIndent": null,
"wordWrap": null,
"showEllipsis": null,
"shrinkToFit": null,
"backgroundImage": null,
"cellType": null,
"tabStop": null,
"parentName": null,
"watermark": null,
"cellPadding": "3px 4px 1px 4px"
}
},
"dataTable": {
"6": {
"1": {
"value": 2,
"style": {
"backColor": null,
"foreColor": "#1B1C1E",
"_fontSize": "10pt",
"_fontSizeDigit": 10,
"_fontSizeUnit": "pt",
"_fontFamily": "PingFangSC-Regular",
"_font": "10pt PingFangSC-Regular",
"locked": true,
"hidden": false,
"cellPadding": "3px 4px 1px 4px"
}
}
}
},
"rowDataArray": [],
"columnDataArray": []
},
"rowHeaderData": {
"columnDataArray": [
{
"style": {
"font": "12px PingFangSC-Regular"
}
}
],
"defaultDataNode": {
"style": {
"themeFont": "Body"
}
}
},
"colHeaderData": {
"rowDataArray": [
{
"style": {
"font": "12px PingFangSC-Regular"
}
}
],
"defaultDataNode": {
"style": {
"themeFont": "Body"
}
}
},
"rowHeaderColInfos": [
{
"resizable": false,
"size": 50
}
],
"colHeaderRowInfos": [
{
"resizable": false,
"size": 26
}
],
"leftCellIndex": 0,
"topCellIndex": 0,
"selections": {
"0": {
"row": 0,
"col": 0,
"rowCount": 1,
"colCount": 1
},
"length": 1
},
"defaults": {
"colHeaderRowHeight": 20,
"colWidth": 104,
"rowHeaderColWidth": 40,
"rowHeight": 26,
"_isExcelDefaultColumnWidth": false
},
"rowOutlines": {
"items": []
},
"columnOutlines": {
"items": []
},
"cellStates": {},
"states": {},
"outlineColumnOptions": {},
"autoMergeRangeInfos": [],
"shapeCollectionOption": {
"snapMode": 0
},
"printInfo": {
"paperSize": {
"width": 850,
"height": 1100,
"kind": 1
}
},
"frozenlineColor": "#A8ACB3",
"allowCellOverflow": false,
"gridline": {
"color": "#E4E7ED"
},
"namedStyles": [
{
"backColor": null,
"foreColor": "#1B1C1E",
"hAlign": 3,
"vAlign": 1,
"font": "13.3333px PingFangSC-Regular",
"themeFont": null,
"formatter": null,
"locked": null,
"textIndent": null,
"wordWrap": null,
"showEllipsis": null,
"shrinkToFit": null,
"backgroundImage": null,
"cellType": null,
"tabStop": null,
"imeMode": 1,
"name": "defaultCellStyle",
"parentName": null,
"watermark": null,
"cellPadding": "3px 4px 1px 4px"
}
],
"rowCount": 200,
"index": 1,
"columnCount": 20,
"frozenRowCount": 0,
"frozenColCount": 0,
"frozenTrailingRowCount": 0,
"frozenTrailingColCount": 0,
"spans": [],
"rows": [
null,
null,
null,
null,
null,
null,
{
"size": 26
}
],
"columns": [],
"floatingObjects": [],
"charts": []
},
"Sheet3": {
"name": "Sheet3",
"isSelected": false,
"zoomFactor": 0.75,
"visible": false,
"frozenTrailingRowStickToEdge": true,
"frozenTrailingColumnStickToEdge": true,
"theme": "Office",
"data": {
"defaultDataNode": {
"style": {
"backColor": null,
"foreColor": "#1B1C1E",
"vAlign": 1,
"font": "10pt PingFangSC-Regular",
"themeFont": null,
"formatter": null,
"locked": null,
"textIndent": null,
"wordWrap": null,
"showEllipsis": null,
"shrinkToFit": null,
"backgroundImage": null,
"cellType": null,
"tabStop": null,
"parentName": null,
"watermark": null,
"cellPadding": "3px 4px 1px 4px"
}
},
"dataTable": {
"6": {
"1": {
"value": 3,
"style": {
"backColor": null,
"foreColor": "#1B1C1E",
"_fontSize": "10pt",
"_fontSizeDigit": 10,
"_fontSizeUnit": "pt",
"_fontFamily": "PingFangSC-Regular",
"_font": "10pt PingFangSC-Regular",
"locked": true,
"hidden": false,
"cellPadding": "3px 4px 1px 4px"
}
}
}
},
"rowDataArray": [],
"columnDataArray": []
},
"rowHeaderData": {
"columnDataArray": [
{
"style": {
"font": "12px PingFangSC-Regular"
}
}
],
"defaultDataNode": {
"style": {
"themeFont": "Body"
}
}
},
"colHeaderData": {
"rowDataArray": [
{
"style": {
"font": "12px PingFangSC-Regular"
}
}
],
"defaultDataNode": {
"style": {
"themeFont": "Body"
}
}
},
"rowHeaderColInfos": [
{
"resizable": false,
"size": 50
}
],
"colHeaderRowInfos": [
{
"resizable": false,
"size": 26
}
],
"leftCellIndex": 0,
"topCellIndex": 0,
"selections": {
"0": {
"row": 0,
"col": 0,
"rowCount": 1,
"colCount": 1
},
"length": 1
},
"defaults": {
"colHeaderRowHeight": 20,
"colWidth": 104,
"rowHeaderColWidth": 40,
"rowHeight": 26,
"_isExcelDefaultColumnWidth": false
},
"rowOutlines": {
"items": []
},
"columnOutlines": {
"items": []
},
"cellStates": {},
"states": {},
"outlineColumnOptions": {},
"autoMergeRangeInfos": [],
"shapeCollectionOption": {
"snapMode": 0
},
"printInfo": {
"paperSize": {
"width": 850,
"height": 1100,
"kind": 1
}
},
"frozenlineColor": "#A8ACB3",
"allowCellOverflow": false,
"gridline": {
"color": "#E4E7ED"
},
"namedStyles": [
{
"backColor": null,
"foreColor": "#1B1C1E",
"hAlign": 3,
"vAlign": 1,
"font": "13.3333px PingFangSC-Regular",
"themeFont": null,
"formatter": null,
"locked": null,
"textIndent": null,
"wordWrap": null,
"showEllipsis": null,
"shrinkToFit": null,
"backgroundImage": null,
"cellType": null,
"tabStop": null,
"imeMode": 1,
"name": "defaultCellStyle",
"parentName": null,
"watermark": null,
"cellPadding": "3px 4px 1px 4px"
}
],
"rowCount": 200,
"index": 2,
"columnCount": 20,
"frozenRowCount": 0,
"frozenColCount": 0,
"frozenTrailingRowCount": 0,
"frozenTrailingColCount": 0,
"spans": [],
"rows": [
null,
null,
null,
null,
null,
null,
{
"size": 26
}
],
"columns": [],
"floatingObjects": [],
"charts": []
},
"Sheet4": {
"name": "Sheet4",
"isSelected": true,
"zoomFactor": 0.75,
"visible": true,
"frozenTrailingRowStickToEdge": true,
"frozenTrailingColumnStickToEdge": true,
"theme": "Office",
"data": {
"defaultDataNode": {
"style": {
"backColor": null,
"foreColor": "#1B1C1E",
"vAlign": 1,
"font": "10pt PingFangSC-Regular",
"themeFont": null,
"formatter": null,
"locked": null,
"textIndent": null,
"wordWrap": null,
"showEllipsis": null,
"shrinkToFit": null,
"backgroundImage": null,
"cellType": null,
"tabStop": null,
"parentName": null,
"watermark": null,
"cellPadding": "3px 4px 1px 4px"
}
},
"dataTable": {
"7": {
"2": {
"value": 4,
"style": {
"backColor": null,
"foreColor": "#1B1C1E",
"_fontSize": "10pt",
"_fontSizeDigit": 10,
"_fontSizeUnit": "pt",
"_fontFamily": "PingFangSC-Regular",
"_font": "10pt PingFangSC-Regular",
"locked": true,
"hidden": false,
"cellPadding": "3px 4px 1px 4px"
}
}
}
},
"rowDataArray": [],
"columnDataArray": []
},
"rowHeaderData": {
"columnDataArray": [
{
"style": {
"font": "12px PingFangSC-Regular"
}
}
],
"defaultDataNode": {
"style": {
"themeFont": "Body"
}
}
},
"colHeaderData": {
"rowDataArray": [
{
"style": {
"font": "12px PingFangSC-Regular"
}
}
],
"defaultDataNode": {
"style": {
"themeFont": "Body"
}
}
},
"rowHeaderColInfos": [
{
"resizable": false,
"size": 50
}
],
"colHeaderRowInfos": [
{
"resizable": false,
"size": 26
}
],
"leftCellIndex": 0,
"topCellIndex": 0,
"selections": {
"0": {
"row": 0,
"col": 0,
"rowCount": 1,
"colCount": 1
},
"length": 1
},
"defaults": {
"colHeaderRowHeight": 20,
"colWidth": 104,
"rowHeaderColWidth": 40,
"rowHeight": 26,
"_isExcelDefaultColumnWidth": false
},
"rowOutlines": {
"items": []
},
"columnOutlines": {
"items": []
},
"cellStates": {},
"states": {},
"outlineColumnOptions": {},
"autoMergeRangeInfos": [],
"shapeCollectionOption": {
"snapMode": 0
},
"printInfo": {
"paperSize": {
"width": 850,
"height": 1100,
"kind": 1
}
},
"frozenlineColor": "#A8ACB3",
"allowCellOverflow": false,
"gridline": {
"color": "#E4E7ED"
},
"namedStyles": [
{
"backColor": null,
"foreColor": "#1B1C1E",
"hAlign": 3,
"vAlign": 1,
"font": "13.3333px PingFangSC-Regular",
"themeFont": null,
"formatter": null,
"locked": null,
"textIndent": null,
"wordWrap": null,
"showEllipsis": null,
"shrinkToFit": null,
"backgroundImage": null,
"cellType": null,
"tabStop": null,
"imeMode": 1,
"name": "defaultCellStyle",
"parentName": null,
"watermark": null,
"cellPadding": "3px 4px 1px 4px"
}
],
"rowCount": 200,
"index": 3,
"columnCount": 20,
"frozenRowCount": 0,
"frozenColCount": 0,
"frozenTrailingRowCount": 0,
"frozenTrailingColCount": 0,
"spans": [],
"rows": [
null,
null,
null,
null,
null,
null,
null,
{
"size": 26
}
],
"columns": [],
"floatingObjects": [],
"charts": []
},
"Sheet5": {
"name": "Sheet5",
"isSelected": false,
"zoomFactor": 0.75,
"visible": true,
"frozenTrailingRowStickToEdge": true,
"frozenTrailingColumnStickToEdge": true,
"theme": "Office",
"data": {
"defaultDataNode": {
"style": {
"backColor": null,
"foreColor": "#1B1C1E",
"vAlign": 1,
"font": "10pt PingFangSC-Regular",
"themeFont": null,
"formatter": null,
"locked": null,
"textIndent": null,
"wordWrap": null,
"showEllipsis": null,
"shrinkToFit": null,
"backgroundImage": null,
"cellType": null,
"tabStop": null,
"parentName": null,
"watermark": null,
"cellPadding": "3px 4px 1px 4px"
}
},
"dataTable": {
"7": {
"2": {
"value": 5,
"style": {
"backColor": null,
"foreColor": "#1B1C1E",
"_fontSize": "10pt",
"_fontSizeDigit": 10,
"_fontSizeUnit": "pt",
"_fontFamily": "PingFangSC-Regular",
"_font": "10pt PingFangSC-Regular",
"locked": true,
"hidden": false,
"cellPadding": "3px 4px 1px 4px"
}
}
}
},
"rowDataArray": [],
"columnDataArray": []
},
"rowHeaderData": {
"columnDataArray": [
{
"style": {
"font": "12px PingFangSC-Regular"
}
}
],
"defaultDataNode": {
"style": {
"themeFont": "Body"
}
}
},
"colHeaderData": {
"rowDataArray": [
{
"style": {
"font": "12px PingFangSC-Regular"
}
}
],
"defaultDataNode": {
"style": {
"themeFont": "Body"
}
}
},
"rowHeaderColInfos": [
{
"resizable": false,
"size": 50
}
],
"colHeaderRowInfos": [
{
"resizable": false,
"size": 26
}
],
"leftCellIndex": 0,
"topCellIndex": 0,
"selections": {
"0": {
"row": 0,
"col": 0,
"rowCount": 1,
"colCount": 1
},
"length": 1
},
"defaults": {
"colHeaderRowHeight": 20,
"colWidth": 104,
"rowHeaderColWidth": 40,
"rowHeight": 26,
"_isExcelDefaultColumnWidth": false
},
"rowOutlines": {
"items": []
},
"columnOutlines": {
"items": []
},
"cellStates": {},
"states": {},
"outlineColumnOptions": {},
"autoMergeRangeInfos": [],
"shapeCollectionOption": {
"snapMode": 0
},
"printInfo": {
"paperSize": {
"width": 850,
"height": 1100,
"kind": 1
}
},
"frozenlineColor": "#A8ACB3",
"allowCellOverflow": false,
"gridline": {
"color": "#E4E7ED"
},
"namedStyles": [
{
"backColor": null,
"foreColor": "#1B1C1E",
"hAlign": 3,
"vAlign": 1,
"font": "13.3333px PingFangSC-Regular",
"themeFont": null,
"formatter": null,
"locked": null,
"textIndent": null,
"wordWrap": null,
"showEllipsis": null,
"shrinkToFit": null,
"backgroundImage": null,
"cellType": null,
"tabStop": null,
"imeMode": 1,
"name": "defaultCellStyle",
"parentName": null,
"watermark": null,
"cellPadding": "3px 4px 1px 4px"
}
],
"rowCount": 200,
"index": 4,
"columnCount": 20,
"frozenRowCount": 0,
"frozenColCount": 0,
"frozenTrailingRowCount": 0,
"frozenTrailingColCount": 0,
"spans": [],
"rows": [
null,
null,
null,
null,
null,
null,
null,
{
"size": 26
}
],
"columns": [],
"floatingObjects": [],
"charts": []
}
},
"sheetTabCount": 0,
"namedPatterns": {},
"activeSheetIndex": 3
},{
incrementalLoading: {
}
})
本帖最后由 Ellia.Duan 于 2024-10-10 10:57 编辑
您好,问题已复现,我将深入调研下此问题。SJS-26716 您好,此问题已在17.1.7版本修复。此版本已发布,您可以下载测试下。
页:
[1]