cloud-web-corejs 1.0.54-dev.645 → 1.0.54-dev.646

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.
@@ -153,8 +153,8 @@ modules = {
153
153
  buttonsColumnFixed: function () {
154
154
  return void 0 === this.widget.options.buttonsColumnFixed
155
155
  ? "right"
156
- : !!this.widget.options.buttonsColumnFixed &&
157
- this.widget.options.buttonsColumnFixed;
156
+ : !!this.widget.options.buttonsColumnFixed
157
+ && this.widget.options.buttonsColumnFixed;
158
158
  },
159
159
  formModel: {
160
160
  cache: !1,
@@ -188,8 +188,8 @@ modules = {
188
188
  },
189
189
  methods: {
190
190
  initTableCustomEvent() {
191
- let tableConfig =
192
- this.handleCustomEvent(this.widget.options.tableConfig) || {};
191
+ let tableConfig
192
+ = this.handleCustomEvent(this.widget.options.tableConfig) || {};
193
193
  this.eventConfig = tableConfig.eventConfig || {};
194
194
  },
195
195
  getTableColumnStatusWidgetLabelKey(obj) {
@@ -255,8 +255,8 @@ modules = {
255
255
  if (!formScriptEnabledTypes.includes(widgetType)) return;
256
256
 
257
257
  let formScriptEnabled = widget.options.formScriptEnabled || false;
258
- let commonAttributeEnabled =
259
- widget.options.commonAttributeEnabled || false;
258
+ let commonAttributeEnabled
259
+ = widget.options.commonAttributeEnabled || false;
260
260
  let commonAttributeCode = widget.options.commonAttributeCode;
261
261
  if (commonAttributeEnabled) {
262
262
  if (!commonAttributeCode) return;
@@ -453,10 +453,10 @@ modules = {
453
453
  let parentValue = row[parentField];
454
454
  // 根节点(parentField为null、undefined、空字符串或0)
455
455
  if (
456
- parentValue === null ||
457
- parentValue === undefined ||
458
- parentValue === "" ||
459
- parentValue === 0
456
+ parentValue === null
457
+ || parentValue === undefined
458
+ || parentValue === ""
459
+ || parentValue === 0
460
460
  ) {
461
461
  sortedRows.push(row);
462
462
  // 递归添加子节点
@@ -579,8 +579,8 @@ modules = {
579
579
  let ignoreFields = options?.ignoreFields || [];
580
580
  this.widget.widgetList.forEach((subWidget) => {
581
581
  if (
582
- !ignoreFields.length ||
583
- !ignoreFields.includes(subWidget.options.name)
582
+ !ignoreFields.length
583
+ || !ignoreFields.includes(subWidget.options.name)
584
584
  ) {
585
585
  let widgetRef = this.getWidgetRef(subWidget.options.name);
586
586
  if (widgetRef && widgetRef.setValue) widgetRef.setValue(null);
@@ -620,9 +620,9 @@ modules = {
620
620
  formCode = formConfig.addFormCode || formConfig.editFormCode;
621
621
  }
622
622
  let parentTarget = formRef.$attrs["parent-target"];
623
- parentTarget &&
624
- parentTarget.$attrs.openEditDialog &&
625
- parentTarget.$attrs.openEditDialog(row, param, {
623
+ parentTarget
624
+ && parentTarget.$attrs.openEditDialog
625
+ && parentTarget.$attrs.openEditDialog(row, param, {
626
626
  formCode,
627
627
  ...option,
628
628
  });
@@ -833,8 +833,8 @@ modules = {
833
833
  let currentData = obj.row;
834
834
  let fieldKeyName = this.getFieldKeyName(fieldWidget);
835
835
  let vabSearchName = fieldWidget.options.vabSearchName;
836
- let multipleChoices =
837
- fieldWidget.options.multipleChoices || false;
836
+ let multipleChoices
837
+ = fieldWidget.options.multipleChoices || false;
838
838
  let labelField = vabSearchName || fieldKeyName;
839
839
  if (!multipleChoices) {
840
840
  result = currentData[labelField] ?? null;
@@ -891,8 +891,8 @@ modules = {
891
891
  }
892
892
  }
893
893
  if (t.tableColumnConfig) {
894
- let tableColumnConfig =
895
- this.handleCustomEvent(t.tableColumnConfig) || {};
894
+ let tableColumnConfig
895
+ = this.handleCustomEvent(t.tableColumnConfig) || {};
896
896
  col = extendDeeply(col, tableColumnConfig);
897
897
  }
898
898
  return col;
@@ -936,8 +936,8 @@ modules = {
936
936
  let valueField = fieldWidget.options.valueKey || "value";
937
937
  fieldWidget.options.optionItems.forEach((oItem) => {
938
938
  if (
939
- oItem[valueField] === fieldModel ||
940
- this.findInArray(fieldModel, oItem[valueField]) !== -1
939
+ oItem[valueField] === fieldModel
940
+ || this.findInArray(fieldModel, oItem[valueField]) !== -1
941
941
  ) {
942
942
  resultList.push(this.$t1(oItem[labelField]));
943
943
  }
@@ -976,8 +976,8 @@ modules = {
976
976
 
977
977
  let isQueryAllPage = !this.widget.options.isNotQueryAllPage;
978
978
 
979
- let tableConfig =
980
- this.handleCustomEvent(this.widget.options.tableConfig) || {};
979
+ let tableConfig
980
+ = this.handleCustomEvent(this.widget.options.tableConfig) || {};
981
981
  this.tableConfig = tableConfig;
982
982
 
983
983
  let tableConfig2 = this.$baseLodash.cloneDeep(tableConfig);
@@ -1093,12 +1093,12 @@ modules = {
1093
1093
  .filter((column) => !!column?.params?.editWidget)
1094
1094
  .map((column) => column.params.editWidget);
1095
1095
 
1096
- let height =
1097
- this.widget.options.tableHeight || (isQueryTable ? "auto" : null);
1096
+ let height
1097
+ = this.widget.options.tableHeight || (isQueryTable ? "auto" : null);
1098
1098
  if (
1099
- !this.widget.options.tableHeight &&
1100
- isQueryTable &&
1101
- this.previewState
1099
+ !this.widget.options.tableHeight
1100
+ && isQueryTable
1101
+ && this.previewState
1102
1102
  ) {
1103
1103
  height = "550px";
1104
1104
  }
@@ -1205,11 +1205,11 @@ modules = {
1205
1205
  } */
1206
1206
  that.$nextTick(() => {
1207
1207
  setTimeout(function () {
1208
- dataTableConfig.callback &&
1209
- dataTableConfig.callback(rows);
1208
+ dataTableConfig.callback
1209
+ && dataTableConfig.callback(rows);
1210
1210
  tableOption.callback && tableOption.callback(rows);
1211
- tableConfig.treeCallback &&
1212
- tableConfig.treeCallback(rows);
1211
+ tableConfig.treeCallback
1212
+ && tableConfig.treeCallback(rows);
1213
1213
  }, 0);
1214
1214
  });
1215
1215
  } else {
@@ -1302,8 +1302,8 @@ modules = {
1302
1302
 
1303
1303
  let exportItemConfig = null;
1304
1304
  if (
1305
- this.widget.options.exportItemColumns &&
1306
- this.widget.options.exportItemColumns.length > 0
1305
+ this.widget.options.exportItemColumns
1306
+ && this.widget.options.exportItemColumns.length > 0
1307
1307
  ) {
1308
1308
  let formatKeys = [
1309
1309
  "d1",
@@ -1354,8 +1354,8 @@ modules = {
1354
1354
  );
1355
1355
  exportItemConfig = {
1356
1356
  scriptCode:
1357
- this.widget.options.exportItemScriptCode ||
1358
- this.widget.options.formScriptCode,
1357
+ this.widget.options.exportItemScriptCode
1358
+ || this.widget.options.formScriptCode,
1359
1359
  columns: exportItemColumns,
1360
1360
  param: () => {
1361
1361
  if (this.widget.options.exportItemParam) {
@@ -1493,8 +1493,8 @@ modules = {
1493
1493
  }
1494
1494
 
1495
1495
  let reqPath = typeof path === "function" ? path() : path;
1496
- let accessReturnType =
1497
- this.widget.options.accessReturnType || "2";
1496
+ let accessReturnType
1497
+ = this.widget.options.accessReturnType || "2";
1498
1498
 
1499
1499
  return new Promise((resolve, reject) => {
1500
1500
  let reqData = {
@@ -1530,8 +1530,8 @@ modules = {
1530
1530
  if (res.type === "success") {
1531
1531
  if (that.widget.options.isTreeTable) {
1532
1532
  if (rows.length > 0) {
1533
- let fullAllDataRowMap =
1534
- $grid.$refs.xTable.fullAllDataRowMap;
1533
+ let fullAllDataRowMap
1534
+ = $grid.$refs.xTable.fullAllDataRowMap;
1535
1535
  let parentField = $grid.treeConfig.parentField;
1536
1536
  let expandAll = $grid.treeConfig.expandAll || false;
1537
1537
  let isLazy = $grid.treeConfig.lazy;
@@ -1554,8 +1554,8 @@ modules = {
1554
1554
  lineData
1555
1555
  )
1556
1556
  ) {
1557
- let rest =
1558
- fullAllDataRowMap.get(lineData);
1557
+ let rest
1558
+ = fullAllDataRowMap.get(lineData);
1559
1559
  rest.treeLoaded = true;
1560
1560
  }
1561
1561
  });
@@ -1567,8 +1567,8 @@ modules = {
1567
1567
 
1568
1568
  let row = rows.find((item) => !item[parentField]);
1569
1569
  if (
1570
- row &&
1571
- (!expandAll || !expandIds.includes(row.id))
1570
+ row
1571
+ && (!expandAll || !expandIds.includes(row.id))
1572
1572
  ) {
1573
1573
  let hasChild = $grid.treeConfig.hasChild;
1574
1574
  if (row[hasChild]) {
@@ -1583,8 +1583,8 @@ modules = {
1583
1583
  }
1584
1584
  that.$nextTick(() => {
1585
1585
  setTimeout(function () {
1586
- dataTableConfig.callback &&
1587
- dataTableConfig.callback(rows);
1586
+ dataTableConfig.callback
1587
+ && dataTableConfig.callback(rows);
1588
1588
  tableOption.callback && tableOption.callback(rows);
1589
1589
  that.handleCustomEvent(
1590
1590
  that.widget.options.formScriptCallback,
@@ -1742,13 +1742,13 @@ modules = {
1742
1742
  if (["date-range", "time-range"].includes(wType)) {
1743
1743
  item.filter = "between";
1744
1744
  } else if (
1745
- ["input-batch", "checkbox"].includes(wType) ||
1746
- (wType === "select" && wItem.options.multiple)
1745
+ ["input-batch", "checkbox"].includes(wType)
1746
+ || (wType === "select" && wItem.options.multiple)
1747
1747
  ) {
1748
1748
  item.filter = "in";
1749
1749
  } else if (
1750
- ["radio", "time", "date"].includes(wType) ||
1751
- (wType === "select" && !wItem.options.multiple)
1750
+ ["radio", "time", "date"].includes(wType)
1751
+ || (wType === "select" && !wItem.options.multiple)
1752
1752
  ) {
1753
1753
  item.filter = "eq";
1754
1754
  } else {
@@ -1804,8 +1804,8 @@ modules = {
1804
1804
  this.loodHandleColumns(this.widget.options.tableColumns, (item) => {
1805
1805
  if (!item.children?.length && item.prop && item.label) {
1806
1806
  if (
1807
- item.formatS === "editSearch" &&
1808
- item.widget?.options?.multipleChoices
1807
+ item.formatS === "editSearch"
1808
+ && item.widget?.options?.multipleChoices
1809
1809
  ) {
1810
1810
  result.push(item.prop);
1811
1811
  }
@@ -1969,8 +1969,8 @@ modules = {
1969
1969
  },
1970
1970
  loadAccessData(flag) {
1971
1971
  if (
1972
- this.formModel[this.fieldKeyName] &&
1973
- this.formModel[this.fieldKeyName].length
1972
+ this.formModel[this.fieldKeyName]
1973
+ && this.formModel[this.fieldKeyName].length
1974
1974
  ) {
1975
1975
  this.initValue(this.formModel[this.fieldKeyName]);
1976
1976
  }
@@ -2039,9 +2039,9 @@ modules = {
2039
2039
  },
2040
2040
  isSingerlSearch(widget) {
2041
2041
  let widgetType = widget?.type;
2042
- let result =
2043
- widgetType === "singerSearch" ||
2044
- (widgetType === "vabsearch" && !widget.options.multipleChoices);
2042
+ let result
2043
+ = widgetType === "singerSearch"
2044
+ || (widgetType === "vabsearch" && !widget.options.multipleChoices);
2045
2045
  return result;
2046
2046
  },
2047
2047
  getColumnNullValue(widget, defaultValueEnabled) {
@@ -2058,10 +2058,10 @@ modules = {
2058
2058
 
2059
2059
  let defaultValue = widget.options.defaultValue;
2060
2060
  if (
2061
- defaultValue !== undefined &&
2062
- defaultValue !== null &&
2063
- defaultValue !== "" &&
2064
- defaultValueEnabled !== false
2061
+ defaultValue !== undefined
2062
+ && defaultValue !== null
2063
+ && defaultValue !== ""
2064
+ && defaultValueEnabled !== false
2065
2065
  ) {
2066
2066
  nullValue = defaultValue;
2067
2067
  } else if (widgetType === "select" && widget.options.multiple) {
@@ -2199,13 +2199,13 @@ modules = {
2199
2199
  columnOption.required = row.required || false;
2200
2200
  columnSelectedWidget.options = columnOption;
2201
2201
  if ("editDelete" === formatS) {
2202
- columnSelectedWidget.options.hiddenByWf =
2203
- columnSelectedWidget.options.hiddenByWf ?? true;
2204
- columnSelectedWidget.options.prefixIcon =
2205
- columnSelectedWidget.options.prefixIcon || "el-icon-delete";
2202
+ columnSelectedWidget.options.hiddenByWf
2203
+ = columnSelectedWidget.options.hiddenByWf ?? true;
2204
+ columnSelectedWidget.options.prefixIcon
2205
+ = columnSelectedWidget.options.prefixIcon || "el-icon-delete";
2206
2206
  } else if ("editButton" === formatS) {
2207
- columnSelectedWidget.options.prefixIcon =
2208
- columnSelectedWidget.options.prefixIcon || "el-icon-edit";
2207
+ columnSelectedWidget.options.prefixIcon
2208
+ = columnSelectedWidget.options.prefixIcon || "el-icon-edit";
2209
2209
  }
2210
2210
  } else {
2211
2211
  columnSelectedWidget.options.required = row.required || false;
@@ -2214,44 +2214,44 @@ modules = {
2214
2214
  columnSelectedWidget.options.label = "删除";
2215
2215
  columnSelectedWidget.options.labelHidden = true;
2216
2216
  columnSelectedWidget.options.hiddenByWf = true;
2217
- columnSelectedWidget.options.onClick =
2218
- "let tableParam = this.tableParam;\nlet tableRef = this.getWidgetRef(this.parentWidget.options.name);\ntableRef.deleteRow(tableParam.row,tableParam.rowIndex);";
2217
+ columnSelectedWidget.options.onClick
2218
+ = "let tableParam = this.tableParam;\nlet tableRef = this.getWidgetRef(this.parentWidget.options.name);\ntableRef.deleteRow(tableParam.row,tableParam.rowIndex);";
2219
2219
  } else if ("editButton" === formatS) {
2220
2220
  columnSelectedWidget.options.prefixIcon = "el-icon-edit";
2221
2221
  columnSelectedWidget.options.label = "查看";
2222
2222
  columnSelectedWidget.options.labelHidden = true;
2223
- columnSelectedWidget.options.onClick =
2224
- "let tableParam = this.tableParam;\nlet tableRef = this.getWidgetRef(this.parentWidget.options.name);\ntableRef.openEditDialog(tableParam.row)";
2223
+ columnSelectedWidget.options.onClick
2224
+ = "let tableParam = this.tableParam;\nlet tableRef = this.getWidgetRef(this.parentWidget.options.name);\ntableRef.openEditDialog(tableParam.row)";
2225
2225
  } else if ("addSiblingEditRow" === formatS) {
2226
2226
  columnSelectedWidget.options.prefixIcon = "el-icon-plus";
2227
2227
  columnSelectedWidget.options.label = "新增兄弟节点";
2228
2228
  columnSelectedWidget.options.labelHidden = false;
2229
- columnSelectedWidget.options.onClick =
2230
- "let tableParam = this.tableParam;\nthis.getParentTarget().addSiblingTreeRow(null,tableParam);";
2229
+ columnSelectedWidget.options.onClick
2230
+ = "let tableParam = this.tableParam;\nthis.getParentTarget().addSiblingTreeRow(null,tableParam);";
2231
2231
  } else if ("addChildTreeRow" === formatS) {
2232
2232
  columnSelectedWidget.options.prefixIcon = "el-icon-plus";
2233
2233
  columnSelectedWidget.options.label = "新增子节点";
2234
2234
  columnSelectedWidget.options.labelHidden = false;
2235
- columnSelectedWidget.options.onClick =
2236
- "let tableParam = this.tableParam;\nthis.getParentTarget().addChildTreeRow(null,tableParam);";
2235
+ columnSelectedWidget.options.onClick
2236
+ = "let tableParam = this.tableParam;\nthis.getParentTarget().addChildTreeRow(null,tableParam);";
2237
2237
  } else if ("moveUpRow" === formatS) {
2238
2238
  // columnSelectedWidget.options.prefixIcon = "el-icon-plus";
2239
2239
  columnSelectedWidget.options.label = "↑上移";
2240
2240
  columnSelectedWidget.options.labelHidden = false;
2241
- columnSelectedWidget.options.onClick =
2242
- "let tableParam = this.tableParam;\nthis.getParentTarget().moveUpRow(tableParam);";
2241
+ columnSelectedWidget.options.onClick
2242
+ = "let tableParam = this.tableParam;\nthis.getParentTarget().moveUpRow(tableParam);";
2243
2243
  } else if ("moveDownRow" === formatS) {
2244
2244
  // columnSelectedWidget.options.prefixIcon = "el-icon-plus";
2245
2245
  columnSelectedWidget.options.label = "↓下移";
2246
2246
  columnSelectedWidget.options.labelHidden = false;
2247
- columnSelectedWidget.options.onClick =
2248
- "let tableParam = this.tableParam;\nthis.getParentTarget().moveDownRow(tableParam);";
2247
+ columnSelectedWidget.options.onClick
2248
+ = "let tableParam = this.tableParam;\nthis.getParentTarget().moveDownRow(tableParam);";
2249
2249
  } else if ("removeTreeRow" === formatS) {
2250
2250
  columnSelectedWidget.options.prefixIcon = "el-icon-delete";
2251
2251
  columnSelectedWidget.options.label = "删除";
2252
2252
  columnSelectedWidget.options.labelHidden = true;
2253
- columnSelectedWidget.options.onClick =
2254
- "let tableParam = this.tableParam;\nthis.getParentTarget().removeTreeRow(tableParam);";
2253
+ columnSelectedWidget.options.onClick
2254
+ = "let tableParam = this.tableParam;\nthis.getParentTarget().removeTreeRow(tableParam);";
2255
2255
  }
2256
2256
  columnOption = columnSelectedWidget.options;
2257
2257
  }
@@ -2388,9 +2388,9 @@ modules = {
2388
2388
  isVabsearchFlagWidget(widget) {
2389
2389
  let type = widget?.type;
2390
2390
  return (
2391
- type === "vabsearch" ||
2392
- type === "singerSearch" ||
2393
- type === "multiSearch"
2391
+ type === "vabsearch"
2392
+ || type === "singerSearch"
2393
+ || type === "multiSearch"
2394
2394
  );
2395
2395
  },
2396
2396
  getColumnWidgetName(e) {
@@ -2431,8 +2431,8 @@ modules = {
2431
2431
  }
2432
2432
  let formRef = this.getFormRef();
2433
2433
  let dataTableConfig = formRef.$attrs.dataTableOption || {};
2434
- dataTableConfig.onCheckboxChange &&
2435
- dataTableConfig.onCheckboxChange(param);
2434
+ dataTableConfig.onCheckboxChange
2435
+ && dataTableConfig.onCheckboxChange(param);
2436
2436
  },
2437
2437
  handleCheckboxAll(param) {
2438
2438
  if (this.widget.options.onCheckboxAll) {
@@ -2611,8 +2611,8 @@ modules = {
2611
2611
  }
2612
2612
 
2613
2613
  // Object.assign(newRow, editDefaultRow, rowData);
2614
- newRow.id =
2615
- "row_" + new Date().valueOf() + Math.floor(Math.random() * 1000000);
2614
+ newRow.id
2615
+ = "row_" + new Date().valueOf() + Math.floor(Math.random() * 1000000);
2616
2616
  if (!toSibling) {
2617
2617
  newRow[parentField] = parent?.id || 0;
2618
2618
  } else {
@@ -2627,8 +2627,8 @@ modules = {
2627
2627
  if (toEnd === true) {
2628
2628
  tableRows.push(newRow);
2629
2629
  } else if (toSibling === true) {
2630
- let addIndex =
2631
- tableRows.findIndex(
2630
+ let addIndex
2631
+ = tableRows.findIndex(
2632
2632
  (item) => item._X_ROW_KEY === obj.row._X_ROW_KEY
2633
2633
  ) + 1;
2634
2634
  tableRows.splice(addIndex, 0, newRow);
@@ -2649,8 +2649,8 @@ modules = {
2649
2649
  if (toEnd === true) {
2650
2650
  tableRows.push(newRow);
2651
2651
  } else if (toSibling === true) {
2652
- let addIndex =
2653
- tableRows.findIndex(
2652
+ let addIndex
2653
+ = tableRows.findIndex(
2654
2654
  (item) => item._X_ROW_KEY === obj.row._X_ROW_KEY
2655
2655
  ) + 1;
2656
2656
  tableRows.splice(addIndex, 0, newRow);
@@ -2710,10 +2710,91 @@ modules = {
2710
2710
  this.handleWbs();
2711
2711
  });
2712
2712
  },
2713
+ getTableRowAuthCode(authName) {
2714
+ if (!authName) {
2715
+ return null;
2716
+ }
2717
+ let formRef = this.getFormRef();
2718
+ if (formRef && formRef.reportTemplate) {
2719
+ return formRef.reportTemplate.formCode + ":" + authName;
2720
+ }
2721
+ return null;
2722
+ },
2723
+ hasTableRowPermission(authName) {
2724
+ if (!authName) {
2725
+ return true;
2726
+ }
2727
+ let authCode = this.getTableRowAuthCode(authName);
2728
+ if (!authCode) {
2729
+ return true;
2730
+ }
2731
+ let dispermissions = this.$store.getters.dispermissions;
2732
+ return !dispermissions.includes(authCode);
2733
+ },
2734
+ getRowAddAuthName() {
2735
+ return (
2736
+ this.widget.options.rowAddAuthName ?? this.widget.options.treeRowAddName
2737
+ );
2738
+ },
2739
+ getRowEditAuthName() {
2740
+ return (
2741
+ this.widget.options.rowEditAuthName
2742
+ ?? this.widget.options.treeRowEditName
2743
+ );
2744
+ },
2745
+ getRowAddShow() {
2746
+ return (
2747
+ this.widget.options.rowAddShow ?? this.widget.options.treeRowAddShow
2748
+ );
2749
+ },
2750
+ getRowEditShow() {
2751
+ return (
2752
+ this.widget.options.rowEditShow ?? this.widget.options.treeRowEditShow
2753
+ );
2754
+ },
2755
+ isRowButtonShow(script, obj) {
2756
+ if (!script) {
2757
+ return true;
2758
+ }
2759
+ let result = this.handleCustomEvent(
2760
+ script,
2761
+ ["row", "rowIndex"],
2762
+ [obj?.row, obj?.rowIndex]
2763
+ );
2764
+ return result !== false;
2765
+ },
2766
+ canShowRowAdd(obj) {
2767
+ return (
2768
+ this.hasTableRowPermission(this.getRowAddAuthName())
2769
+ && this.isRowButtonShow(this.getRowAddShow(), obj)
2770
+ );
2771
+ },
2772
+ canShowRowEdit(obj) {
2773
+ let isAddRow = !this.hasSaveRow(obj?.row);
2774
+ if (isAddRow) return true;
2775
+ return (
2776
+ this.hasTableRowPermission(this.getRowEditAuthName())
2777
+ && this.isRowButtonShow(this.getRowEditShow(), obj)
2778
+ );
2779
+ },
2780
+ editRowEvent(obj) {
2781
+ if (!this.canShowRowEdit(obj)) {
2782
+ return false;
2783
+ }
2784
+ if (this.hasEditingRow(obj.$table, 1)) {
2785
+ return false;
2786
+ }
2787
+ let row = obj.row;
2788
+ obj.$table.editCloneRow = this.$baseLodash.cloneDeep(obj.row);
2789
+ obj.$table.setActiveRow(row);
2790
+ },
2713
2791
  addSiblingEditRow(rowData, obj) {
2714
2792
  this.addEditRow(rowData, obj, null, true);
2715
2793
  },
2716
2794
  addEditRow(rowData, obj, toEnd, toSibling) {
2795
+ if (rowData == null && obj && !this.canShowRowAdd(obj)) {
2796
+ return false;
2797
+ }
2717
2798
  let isEditTable = this.widget.options.isEditTable || false;
2718
2799
  let isTreeTable = this.widget.options.isTreeTable || false;
2719
2800
  let parent = obj?.row;
@@ -2733,8 +2814,8 @@ modules = {
2733
2814
  }
2734
2815
  }
2735
2816
 
2736
- newRow.id =
2737
- "row_" + new Date().valueOf() + Math.floor(Math.random() * 1000000);
2817
+ newRow.id
2818
+ = "row_" + new Date().valueOf() + Math.floor(Math.random() * 1000000);
2738
2819
  if (isTreeTable) {
2739
2820
  let parentField = $grid.treeConfig.parentField;
2740
2821
  if (!toSibling) {
@@ -2752,8 +2833,8 @@ modules = {
2752
2833
  if (toEnd === true) {
2753
2834
  tableRows.push(newRow);
2754
2835
  } else if (toSibling === true) {
2755
- let addIndex =
2756
- tableRows.findIndex(
2836
+ let addIndex
2837
+ = tableRows.findIndex(
2757
2838
  (item) => item._X_ROW_KEY === obj.row._X_ROW_KEY
2758
2839
  ) + 1;
2759
2840
  tableRows.splice(addIndex, 0, newRow);
@@ -2774,8 +2855,8 @@ modules = {
2774
2855
  if (toEnd === true) {
2775
2856
  tableRows.push(newRow);
2776
2857
  } else if (toSibling === true) {
2777
- let addIndex =
2778
- tableRows.findIndex(
2858
+ let addIndex
2859
+ = tableRows.findIndex(
2779
2860
  (item) => item._X_ROW_KEY === obj.row._X_ROW_KEY
2780
2861
  ) + 1;
2781
2862
  tableRows.splice(addIndex, 0, newRow);
@@ -2820,8 +2901,8 @@ modules = {
2820
2901
  let loopDo = (item, wbs) => {
2821
2902
  item.f_wbs = wbs;
2822
2903
  map[item._X_ROW_KEY] = wbs;
2823
- item[childrenField] &&
2824
- item[childrenField].forEach((subitem, subindex) => {
2904
+ item[childrenField]
2905
+ && item[childrenField].forEach((subitem, subindex) => {
2825
2906
  let sub_wbs = wbs + "." + (subindex + 1) + "";
2826
2907
  loopDo(subitem, sub_wbs);
2827
2908
  });