rapid-spreadjs 1.0.159 → 1.0.160

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js CHANGED
@@ -813,7 +813,7 @@ const BusinessUtils = {
813
813
  * @param contentColStartIndex 表格内容列起始索引,默认为:1
814
814
  * @param contentTotalColCount 表格内容列总数,默认为:77
815
815
  * @param addRowHeight 添加的表格行高,默认为:24(单位为像素)
816
- * @returns 返回生成的检测对象属性行对象
816
+ * @returns 返回生成的检测对象属性行单元格数组和行对象数组,格式如:{ allRowCells: [[{row:0,col:0}]], attrObjs: [[{fieldName:"attr1",title:"属性1",value:"值1"}]] }
817
817
  */
818
818
  createTestObjectAttrsCells: (gc, sheet, testObjectAttrs, addRowIndex = 0, deleteRowsCount = 0, isVertical = true, valueAlign = 'left', valuePaddingLeft = 0, contentColStartIndex = 1, contentTotalColCount = 77, addRowHeight = 24) => {
819
819
  if (!testObjectAttrs || testObjectAttrs.length === 0) {
@@ -859,7 +859,10 @@ const BusinessUtils = {
859
859
  : gc.Spread.Sheets.HorizontalAlign.left);
860
860
  }
861
861
  };
862
+ // 返回所有单元格的二维数组
863
+ let allRowCells = [];
862
864
  for (let i = 0; i < testObjectAttrsChunk.length; i++) {
865
+ let curRowCells = [];
863
866
  const rowAttrArr = testObjectAttrsChunk[i];
864
867
  // 获取总行数
865
868
  const totalRowCount = addRowIndex + i; //sheet.getRowCount();
@@ -888,6 +891,8 @@ const BusinessUtils = {
888
891
  sheet.setValue(totalRowCount, contentColStartIndex + titleCellColumnCount, rowAttrArr[0].blindDisplayStatus != null && rowAttrArr[0].blindDisplayStatus != undefined && rowAttrArr[0].blindDisplayStatus == true
889
892
  ? '此处隐藏'
890
893
  : rowAttrArr[0].value);
894
+ curRowCells.push({ row: totalRowCount, col: contentColStartIndex });
895
+ curRowCells.push({ row: totalRowCount, col: contentColStartIndex + titleCellColumnCount });
891
896
  setFontSizeFamily(totalRowCount, contentColStartIndex);
892
897
  setFontSizeFamily(totalRowCount, contentColStartIndex + titleCellColumnCount, true);
893
898
  // 设置“此处隐藏”单元格的字体样式
@@ -912,6 +917,8 @@ const BusinessUtils = {
912
917
  sheet.setValue(totalRowCount, colIndexValue, rowAttrArr[1].blindDisplayStatus != null && rowAttrArr[1].blindDisplayStatus != undefined && rowAttrArr[1].blindDisplayStatus == true
913
918
  ? '此处隐藏'
914
919
  : rowAttrArr[1].value);
920
+ curRowCells.push({ row: totalRowCount, col: colIndexTitle });
921
+ curRowCells.push({ row: totalRowCount, col: colIndexValue });
915
922
  setFontSizeFamily(totalRowCount, colIndexTitle);
916
923
  setFontSizeFamily(totalRowCount, colIndexValue, true);
917
924
  // 设置“此处隐藏”单元格的字体样式
@@ -929,6 +936,8 @@ const BusinessUtils = {
929
936
  sheet.setValue(totalRowCount, colIndexValue, rowAttrArr[2].blindDisplayStatus != null && rowAttrArr[2].blindDisplayStatus != undefined && rowAttrArr[2].blindDisplayStatus == true
930
937
  ? '此处隐藏'
931
938
  : rowAttrArr[2].value);
939
+ curRowCells.push({ row: totalRowCount, col: colIndexTitle });
940
+ curRowCells.push({ row: totalRowCount, col: colIndexValue });
932
941
  setFontSizeFamily(totalRowCount, colIndexTitle);
933
942
  setFontSizeFamily(totalRowCount, colIndexValue, true);
934
943
  // 设置“此处隐藏”单元格的字体样式
@@ -936,10 +945,15 @@ const BusinessUtils = {
936
945
  sheet.getCell(totalRowCount, colIndexValue).fontFamily('宋体').fontSize('12px').fontStyle('italic');
937
946
  }
938
947
  }
948
+ // 将当前行的所有单元格添加到allRowCells数组中
949
+ allRowCells.push(curRowCells);
939
950
  }
940
951
  // 恢复绘制
941
952
  sheet.resumePaint();
942
- return testObjectAttrsChunk;
953
+ return {
954
+ allRowCells: allRowCells,
955
+ attrObjs: testObjectAttrsChunk,
956
+ };
943
957
  },
944
958
  /**
945
959
  * 获取检测对象属性值集合