fantasy-ngzorro 1.3.14 → 1.3.15

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.
@@ -1624,6 +1624,8 @@
1624
1624
  var _this = this;
1625
1625
  this.fb = fb;
1626
1626
  this.cdr = cdr;
1627
+ this.allowEmpty = true;
1628
+ this.deleteLastLineEvent = new core.EventEmitter();
1627
1629
  this.showKeyboardOperateTip = false;
1628
1630
  this.tableLoading = false;
1629
1631
  this.showSearch = false;
@@ -1632,7 +1634,7 @@
1632
1634
  this.changeEvent = new core.EventEmitter();
1633
1635
  this.showDeleteConfirm = false;
1634
1636
  this.paginationPageIndex = 1;
1635
- this.paginationPageSize = 10;
1637
+ this.paginationPageSize = 2;
1636
1638
  // 合计区域
1637
1639
  this.showTotal = false;
1638
1640
  this.totalOption = [];
@@ -1658,6 +1660,7 @@
1658
1660
  this.activeDomY = null;
1659
1661
  this.activeDom = null;
1660
1662
  this.activeSelectedComponentOpen = false;
1663
+ this.deleteLineEvent = new core.EventEmitter();
1661
1664
  this.textWidthCache = {};
1662
1665
  this.searchSubscription = this.searchSubject.pipe(operators.debounceTime(this.debounceTimeout)).subscribe((/**
1663
1666
  * @param {?} __0
@@ -2932,6 +2935,14 @@
2932
2935
  */
2933
2936
  function (index) {
2934
2937
  var _this = this;
2938
+ console.log('index', index);
2939
+ // 最后一条数据的时候要判断一下
2940
+ if (this.linesFormArray.controls.length === 1 && !this.allowEmpty) {
2941
+ if (this.deleteLastLineEvent) {
2942
+ this.deleteLastLineEvent.emit();
2943
+ }
2944
+ return;
2945
+ }
2935
2946
  this.linesFormArray.removeAt(index - 1);
2936
2947
  if (!this.isFilterData && this.linesFormArray.controls && this.linesFormArray.controls.length === 0) {
2937
2948
  this.addFormLine();
@@ -3282,6 +3293,8 @@
3282
3293
  ]; };
3283
3294
  HdFormLinesComponent.propDecorators = {
3284
3295
  formInputDomList: [{ type: core.ViewChildren, args: ['formInputDom',] }],
3296
+ allowEmpty: [{ type: core.Input }],
3297
+ deleteLastLineEvent: [{ type: core.Output }],
3285
3298
  showKeyboardOperateTip: [{ type: core.Input }],
3286
3299
  tableLoading: [{ type: core.Input }],
3287
3300
  showSearch: [{ type: core.Input }],
@@ -3293,8 +3306,13 @@
3293
3306
  showDeleteConfirm: [{ type: core.Input }],
3294
3307
  showTotal: [{ type: core.Input }],
3295
3308
  totalOption: [{ type: core.Input }],
3296
- columnsNumber: [{ type: core.Input }]
3309
+ columnsNumber: [{ type: core.Input }],
3310
+ deleteLineEvent: [{ type: core.Output }]
3297
3311
  };
3312
+ __decorate([
3313
+ ngZorroAntd.InputBoolean(),
3314
+ __metadata("design:type", Boolean)
3315
+ ], HdFormLinesComponent.prototype, "allowEmpty", void 0);
3298
3316
  __decorate([
3299
3317
  ngZorroAntd.InputBoolean(),
3300
3318
  __metadata("design:type", Boolean)
@@ -3321,6 +3339,10 @@
3321
3339
  /** @type {?} */
3322
3340
  HdFormLinesComponent.prototype.formInputDomList;
3323
3341
  /** @type {?} */
3342
+ HdFormLinesComponent.prototype.allowEmpty;
3343
+ /** @type {?} */
3344
+ HdFormLinesComponent.prototype.deleteLastLineEvent;
3345
+ /** @type {?} */
3324
3346
  HdFormLinesComponent.prototype.showKeyboardOperateTip;
3325
3347
  /** @type {?} */
3326
3348
  HdFormLinesComponent.prototype.tableLoading;
@@ -3395,6 +3417,8 @@
3395
3417
  HdFormLinesComponent.prototype.activeDom;
3396
3418
  /** @type {?} */
3397
3419
  HdFormLinesComponent.prototype.activeSelectedComponentOpen;
3420
+ /** @type {?} */
3421
+ HdFormLinesComponent.prototype.deleteLineEvent;
3398
3422
  /**
3399
3423
  * @type {?}
3400
3424
  * @private