fantasy-ngzorro 2.2.22 → 2.2.23

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/README.md CHANGED
@@ -32,6 +32,7 @@
32
32
 
33
33
  | 更新人 | 更新时间 | 更新内容 |
34
34
  | ------ | -------- | -------- |
35
+ | — | 2026-10-23 | `hd-form-lines`:筛选结果中点「添加/复制」不再把当前可见行重复写入全量数据(2.2.23) |
35
36
  | — | 2026-10-20 | `hd-table`:行内 Select 支持 `onOpenChangeEvent` / `onSearchEvent`(对齐 form-lines;可 return 数组/Promise/Observable 由组件写回并刷新)(2.2.22) |
36
37
  | — | 2026-10-13 | `hd-table`:`showColSettings`(默认 true)可关闭列设置;`hd-filter`:可见条件 ≤2 自动加宽且整行占满 100%;`hd-form-lines`:全局搜索时左侧按钮紧挨搜索框(2.2.21) |
37
38
  | — | 2026-10-12 | `hd-form-lines` / `hd-detail-lines`:全局搜索框 `width` 改挂 `nz-input-group`,修复放大镜贴到最右侧(2.2.20) |
@@ -8889,7 +8889,9 @@
8889
8889
  }));
8890
8890
  }
8891
8891
  formGroupObj.lineIndex = this.fb.control(this.linesFormArray.controls.length + 1, []);
8892
- formGroupObj.isHdFormLineSearchAdd = this.fb.control(this.isFilterData, []);
8892
+ // 仅真正新增/复制的行在插入前单独置 true;搜索重建已有行必须为 false,
8893
+ // 否则筛选态下点「添加」会把第一行可见数据再插入一份
8894
+ formGroupObj.isHdFormLineSearchAdd = this.fb.control(false, []);
8893
8895
  /** @type {?} */
8894
8896
  var formGroupSubmit = this.fb.group(formGroupObj);
8895
8897
  this.formLines.forEach((/**
@@ -8993,6 +8995,7 @@
8993
8995
  var insertAt = this.getInsertIndexAfter(afterLine);
8994
8996
  /** @type {?} */
8995
8997
  var newLine = this.newLineItem();
8998
+ this.markSearchAddedLine(newLine);
8996
8999
  this.linesFormArray.insert(insertAt, newLine);
8997
9000
  this.calculateLineNumber();
8998
9001
  this.addLineEvent.emit(newLine);
@@ -9037,7 +9040,10 @@
9037
9040
  var sourceValues = line.getRawValue();
9038
9041
  /** @type {?} */
9039
9042
  var insertAt = sourceIndex + 1;
9040
- this.linesFormArray.insert(insertAt, this.createLineFromValues(sourceValues, false, true));
9043
+ /** @type {?} */
9044
+ var copiedLine = this.createLineFromValues(sourceValues, false, true);
9045
+ this.markSearchAddedLine(copiedLine);
9046
+ this.linesFormArray.insert(insertAt, copiedLine);
9041
9047
  this.calculateLineNumber();
9042
9048
  setTimeout((/**
9043
9049
  * @return {?}
@@ -9110,6 +9116,29 @@
9110
9116
  _this.collectDomData();
9111
9117
  }), 0);
9112
9118
  };
9119
+ /** 筛选结果中新增/复制的行打标,写回全量数据后立即清掉 */
9120
+ /**
9121
+ * 筛选结果中新增/复制的行打标,写回全量数据后立即清掉
9122
+ * @private
9123
+ * @param {?} line
9124
+ * @return {?}
9125
+ */
9126
+ HdFormLinesComponent.prototype.markSearchAddedLine = /**
9127
+ * 筛选结果中新增/复制的行打标,写回全量数据后立即清掉
9128
+ * @private
9129
+ * @param {?} line
9130
+ * @return {?}
9131
+ */
9132
+ function (line) {
9133
+ if (!this.isFilterData || !line) {
9134
+ return;
9135
+ }
9136
+ /** @type {?} */
9137
+ var flag = line.get("isHdFormLineSearchAdd");
9138
+ if (flag) {
9139
+ flag.setValue(true, { emitEvent: false });
9140
+ }
9141
+ };
9113
9142
  /** 在指定行后方的插入下标;无行则追加到末尾 */
9114
9143
  /**
9115
9144
  * 在指定行后方的插入下标;无行则追加到末尾
@@ -9210,8 +9239,7 @@
9210
9239
  }));
9211
9240
  }
9212
9241
  else if (lines_1.length > this.filterIndexStore.length) {
9213
- // 有新增数据的情况
9214
- // step 1: 先找新增的index下标
9242
+ // 有新增数据的情况:只认本次标记的新行,并插到筛选视图中的对应位置
9215
9243
  /** @type {?} */
9216
9244
  var getNowLines = this.validateHdFormLines.getRawValue().lines;
9217
9245
  /** @type {?} */
@@ -9222,10 +9250,29 @@
9222
9250
  break;
9223
9251
  }
9224
9252
  }
9225
- if (addIndex !== -1) {
9226
- this.storeFormLinesData.splice(this.filterIndexStore[addIndex - 1] + 1, 0, getNowLines[addIndex]);
9253
+ if (addIndex !== -1 && this.filterIndexStore.length > 0) {
9254
+ /** @type {?} */
9255
+ var insertAt = addIndex <= 0
9256
+ ? this.filterIndexStore[0]
9257
+ : this.filterIndexStore[addIndex - 1] + 1;
9258
+ /** @type {?} */
9259
+ var addedLine = __assign({}, getNowLines[addIndex], { isHdFormLineSearchAdd: false });
9260
+ this.storeFormLinesData.splice(insertAt, 0, addedLine);
9261
+ for (var i = 0; i < this.filterIndexStore.length; i++) {
9262
+ if (this.filterIndexStore[i] >= insertAt) {
9263
+ this.filterIndexStore[i]++;
9264
+ }
9265
+ }
9266
+ this.filterIndexStore.splice(addIndex, 0, insertAt);
9267
+ if (this.filterStoreFormLinesData) {
9268
+ this.filterStoreFormLinesData.splice(addIndex, 0, addedLine);
9269
+ }
9270
+ /** @type {?} */
9271
+ var flagCtrl = ((/** @type {?} */ (this.linesFormArray.at(addIndex)))).get("isHdFormLineSearchAdd");
9272
+ if (flagCtrl) {
9273
+ flagCtrl.setValue(false, { emitEvent: false });
9274
+ }
9227
9275
  }
9228
- this.filterIndexStore.push(this.filterIndexStore[addIndex - 1] + 1);
9229
9276
  }
9230
9277
  else {
9231
9278
  // 有删除数据的情况