hoeditor-web 3.1.218 → 3.1.220

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.
@@ -104403,7 +104403,7 @@ const textParams = {
104403
104403
  /***/ (function(__unused_webpack_module, __webpack_exports__) {
104404
104404
 
104405
104405
  "use strict";
104406
- /* harmony default export */ __webpack_exports__.A = ('3.1.218');
104406
+ /* harmony default export */ __webpack_exports__.A = ('3.1.220');
104407
104407
 
104408
104408
  /***/ }),
104409
104409
 
@@ -107176,7 +107176,10 @@ class Print {
107176
107176
  let heightPixes = hoEditorFactory.unitConvert.mmConversionPx(hoEditorFactory.pageProperty.heightMm, true);
107177
107177
  let orientation = widthPixes > heightPixes ? 'l' : 'p';
107178
107178
  let formats = [widthPixes, heightPixes];
107179
- let format = a4Size[orientation];
107179
+ let format = [widthPixes, heightPixes];
107180
+ if (hoEditorFactory.isFixedPrintToA4 == '1') {
107181
+ format = a4Size[orientation];
107182
+ }
107180
107183
  const svg2pdfOptions = {
107181
107184
  x: 0,
107182
107185
  y: 0
@@ -128541,6 +128544,8 @@ class TableFormula extends _ControlNode__WEBPACK_IMPORTED_MODULE_27__/* .Control
128541
128544
  /* harmony import */ var _HOEditorFactorys__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(57703);
128542
128545
  /* harmony import */ var _editor_draw_drawTree_DrawTree__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(58382);
128543
128546
  /* harmony import */ var _editor_draw_drawNode_DrawPageTable__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(87523);
128547
+ /* harmony import */ var _TextNode__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(32083);
128548
+
128544
128549
 
128545
128550
 
128546
128551
 
@@ -128941,7 +128946,7 @@ class TableNode extends _RectNode__WEBPACK_IMPORTED_MODULE_17__/* .RectNode */ .
128941
128946
  * @param count 插入的行数
128942
128947
  * @param copyIndex 插入时复制行的一些信息
128943
128948
  */
128944
- insertRows(r, count, copyIndex) {
128949
+ insertRows(r, count, copyIndex, copyColIndex) {
128945
128950
  if (r < 0 || r > this._rowCount || copyIndex < 0 || copyIndex > this._rowCount - 1) {
128946
128951
  throw new Error(`错误的插入位置或者错误的拷贝行`);
128947
128952
  }
@@ -129018,6 +129023,14 @@ class TableNode extends _RectNode__WEBPACK_IMPORTED_MODULE_17__/* .RectNode */ .
129018
129023
  newCell.initBlankDoc();
129019
129024
  newCell.childNodes[0].styleIndex = cell.childNodes[0].styleIndex;
129020
129025
  newCell.childNodes[0].paraNo = cell.childNodes[0].paraNo;
129026
+ if (copyColIndex !== undefined && copyColIndex >= 0 && copyColIndex < this._rowCount && c <= copyColIndex) {
129027
+ const copyCellNode = this._rows[mr][mc];
129028
+ if (copyCellNode) {
129029
+ const newText = copyCellNode.getCellText();
129030
+ const textNode = new _TextNode__WEBPACK_IMPORTED_MODULE_28__/* .TextNode */ .E(this._hoEditorFactoryID, this.rootNodes, newCell, _BaseNode__WEBPACK_IMPORTED_MODULE_15__/* .NodeType */ .Z6.ntText, newText, copyCellNode.childNodes[0].styleIndex);
129031
+ newCell.childNodes.push(textNode);
129032
+ }
129033
+ }
129021
129034
  newCell.drawCell.needUpdate = true;
129022
129035
  } else {
129023
129036
  const bcell = row[c];
@@ -222253,6 +222266,7 @@ const entry_lib_initLanguage = async (lang, languageList) => {
222253
222266
 
222254
222267
 
222255
222268
 
222269
+
222256
222270
 
222257
222271
 
222258
222272
  // import pd from '@/plugins/pretty-data';
@@ -227094,7 +227108,7 @@ class entry_lib_VueController {
227094
227108
  } else if (node instanceof entry_lib_ParagraphNode/* ParagraphNode */.f) {
227095
227109
  docText += '\n';
227096
227110
  } else if (node instanceof entry_lib_SignNode/* SignNode */.u && node.customProperty && node.customProperty.bce03) {
227097
- docText += node.customProperty.bce03;
227111
+ // docText += node.customProperty.bce03;
227098
227112
  }
227099
227113
  }
227100
227114
  };
@@ -230668,21 +230682,38 @@ class entry_lib_VueController {
230668
230682
  backFillTableData(index, data) {
230669
230683
  const hoEditorFactory = entry_lib_HOEditorFactorys/* HOEditorFactorys */.O.instance().getFactory(this._hoEditorFactoryID);
230670
230684
  let table = null;
230671
- let i = 0;
230672
- for (let k = 0; k < hoEditorFactory.docTree.mainNodes.length; k++) {
230673
- const node = hoEditorFactory.docTree.mainNodes[k];
230674
- if (node instanceof entry_lib_TableNode/* TableNode */.HA) {
230675
- i++;
230676
- if (i === index) {
230677
- table = node;
230678
- break;
230685
+ if (index === -1) {
230686
+ const hoEditorFactory = entry_lib_HOEditorFactorys/* HOEditorFactorys */.O.instance().getFactory(this._hoEditorFactoryID);
230687
+ const [isInTable, tableNode] = hoEditorFactory.vueController.getDomRange().inSameTable();
230688
+ table = tableNode;
230689
+ } else {
230690
+ let i = 0;
230691
+ for (let k = 0; k < hoEditorFactory.docTree.mainNodes.length; k++) {
230692
+ const node = hoEditorFactory.docTree.mainNodes[k];
230693
+ if (node instanceof entry_lib_TableNode/* TableNode */.HA) {
230694
+ i++;
230695
+ if (i === index) {
230696
+ table = node;
230697
+ break;
230698
+ }
230679
230699
  }
230680
230700
  }
230681
230701
  }
230682
230702
  if (table) {
230683
230703
  let rowIndex = this.getTableTitleMaxRowIndex(table);
230704
+ const cellInfo = {
230705
+ rowNo: [],
230706
+ colNo: []
230707
+ };
230708
+ table.childNodes.forEach(cell => {
230709
+ if (table && cell && cell instanceof entry_lib_CellNode/* CellNode */.H && cell.cellProperty.notAllowEdit) {
230710
+ cellInfo.rowNo.push(table.rows.indexOf(cell.row));
230711
+ cellInfo.colNo.push(cell.row.indexOf(cell));
230712
+ }
230713
+ });
230714
+ const maxRowNo = Math.max(...cellInfo.rowNo);
230684
230715
  if (rowIndex === -1) {
230685
- rowIndex = 0;
230716
+ rowIndex = maxRowNo || 0;
230686
230717
  }
230687
230718
  let rowCellNum = 0;
230688
230719
  for (let r = 0; r <= rowIndex; r++) {
@@ -230735,6 +230766,111 @@ class entry_lib_VueController {
230735
230766
  table.update();
230736
230767
  }
230737
230768
  }
230769
+ /**
230770
+ * 回填表格数据
230771
+ * @param index 第几个表格
230772
+ * @param data 回填的数据
230773
+ */
230774
+ backFillTableDataV2(data, direction) {
230775
+ const hoEditorFactory = entry_lib_HOEditorFactorys/* HOEditorFactorys */.O.instance().getFactory(this._hoEditorFactoryID);
230776
+ const [isInTable, tableNode] = hoEditorFactory.vueController.getDomRange().inSameTable();
230777
+ if (data.length == 0) return false;
230778
+ let maxCount = data[0].length; // 一组的最大数 行或者列
230779
+ if (isInTable && tableNode) {
230780
+ const cellInfo = {
230781
+ rowNo: [],
230782
+ colNo: []
230783
+ };
230784
+ tableNode.childNodes.forEach(cell => {
230785
+ if (cell && cell instanceof entry_lib_CellNode/* CellNode */.H && cell.cellProperty.notAllowEdit) {
230786
+ cellInfo.rowNo.push(tableNode.rows.indexOf(cell.row));
230787
+ cellInfo.colNo.push(cell.row.indexOf(cell));
230788
+ }
230789
+ });
230790
+ const maxRowNo = Math.max(...cellInfo.rowNo);
230791
+ const maxColNo = Math.max(...cellInfo.colNo);
230792
+ let hasTextColIndex = 0; // 找出最后一列不能回填的
230793
+ let hasTextRowIndex = 0;
230794
+ if (direction == "L") {
230795
+ // 横向显示 查找标题行或者不可编辑的单元格行
230796
+ let rowIndex = this.getTableTitleMaxRowIndex(tableNode);
230797
+ rowIndex = Math.max(maxRowNo, rowIndex) + 1; // 标题行和包含不可编辑的单元格行对比取出最大的行号当做标题行的结束行
230798
+ for (let r = rowIndex; r < tableNode.rowCount; r++) {
230799
+ for (let c = 0; c < tableNode.colCount; c++) {
230800
+ const cell = tableNode.rows[r][c];
230801
+ if (cell && cell.getCellText()) {
230802
+ hasTextColIndex = c;
230803
+ hasTextRowIndex = r;
230804
+ }
230805
+ }
230806
+ }
230807
+ hasTextRowIndex++;
230808
+ if (hasTextRowIndex != rowIndex) {
230809
+ // 类标题行行号 不等于 有内容行行号时候 差值补空方便从正文行正常回填
230810
+ for (let e = 0; e < hasTextRowIndex - rowIndex; e++) {
230811
+ data.unshift(' '.repeat(maxCount - 1).split(" "));
230812
+ if (e == hasTextRowIndex - rowIndex - 1 && hasTextColIndex > maxCount) {
230813
+ data.unshift(' '.repeat(maxCount - 1).split(" "));
230814
+ }
230815
+ }
230816
+ }
230817
+ // 处理
230818
+ this.backFillTableData(-1, data.flat());
230819
+ } else if (direction == "V") {
230820
+ // 纵向显示 查找不可编辑的单元格列
230821
+ for (let r = 0; r < tableNode.rowCount; r++) {
230822
+ for (let c = maxColNo + 1; c < tableNode.colCount; c++) {
230823
+ const cell = tableNode.rows[r][c];
230824
+ if (cell && cell.getCellText()) {
230825
+ hasTextColIndex = c;
230826
+ hasTextRowIndex = r;
230827
+ }
230828
+ }
230829
+ }
230830
+ hasTextColIndex++;
230831
+ let colIndex = maxColNo + 1; // 包含不可编辑的单元格列当做标题列的结束列 -- 由于不存在标题列属性设置,以不可编辑单元格所在列当作标题列处理
230832
+ if (hasTextColIndex != colIndex) {
230833
+ // 类标题列行号 不等于 有内容列行号时候 差值补空方便从正文行正常回填
230834
+ for (let e = 0; e < hasTextColIndex - colIndex; e++) {
230835
+ data.unshift(' '.repeat(maxCount - 1).split(" "));
230836
+ }
230837
+ }
230838
+ const diffCount = Math.ceil((data.length - (tableNode.colCount - colIndex) * tableNode.rowCount / maxCount) / (tableNode.colCount - colIndex));
230839
+ for (let d = 0; d < diffCount; d++) {
230840
+ for (let k = 0; k < maxCount; k++) {
230841
+ tableNode.insertRows(tableNode.rowCount, 1, k, maxColNo);
230842
+ }
230843
+ }
230844
+ // 判断起始行是否从第几组开始 回填内容多组
230845
+ let startRowIndex = Math.floor(hasTextRowIndex / maxCount) * maxCount;
230846
+ for (let k = 0; k < data.length; k++) {
230847
+ let group = Math.floor(k / (tableNode.colCount - colIndex));
230848
+ for (let y = 0; y < maxCount; y++) {
230849
+ let rowNo = 0;
230850
+ let colNo = 0;
230851
+ rowNo = startRowIndex + group * maxCount + y;
230852
+ colNo = colIndex + k % (tableNode.colCount - colIndex);
230853
+ const newText = data[k][y];
230854
+ if (newText && rowNo < tableNode.rowCount && colNo < tableNode.colCount) {
230855
+ const cell = tableNode.rows[rowNo][colNo];
230856
+ if (cell) {
230857
+ cell.childNodes.splice(1, cell.childNodes.length);
230858
+ const textNode = new entry_lib_TextNode/* TextNode */.E(this._hoEditorFactoryID, tableNode.rootNodes, cell, entry_lib_BaseNode/* NodeType */.Z6.ntText, newText, cell.childNodes[0].styleIndex);
230859
+ cell.drawCell.needUpdate = true;
230860
+ cell.childNodes.push(textNode);
230861
+ }
230862
+ } else {
230863
+ // console.log(rowNo, colNo);
230864
+ }
230865
+ }
230866
+ }
230867
+ tableNode.update();
230868
+ }
230869
+ return true;
230870
+ } else {
230871
+ return false;
230872
+ }
230873
+ }
230738
230874
  clacFormula(cell, formulaStr) {
230739
230875
  const hoEditorFactory = entry_lib_HOEditorFactorys/* HOEditorFactorys */.O.instance().getFactory(this._hoEditorFactoryID);
230740
230876
  let strRet = '';