tnx-shared 5.3.290 → 5.3.291

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.
@@ -23649,7 +23649,7 @@ class ListBase extends ComponentBaseWithButton {
23649
23649
  }
23650
23650
  _edit(rowData, scopeDataEdit = {}) {
23651
23651
  return __awaiter(this, void 0, void 0, function* () {
23652
- const resultValidate = yield this.validateEdit();
23652
+ const resultValidate = yield this.validateEdit(rowData);
23653
23653
  if (!resultValidate) {
23654
23654
  return;
23655
23655
  }
@@ -23666,7 +23666,7 @@ class ListBase extends ComponentBaseWithButton {
23666
23666
  this.showDetailForm = true;
23667
23667
  });
23668
23668
  }
23669
- validateEdit() {
23669
+ validateEdit(rowData) {
23670
23670
  return __awaiter(this, void 0, void 0, function* () {
23671
23671
  return true;
23672
23672
  });
@@ -23690,34 +23690,45 @@ class ListBase extends ComponentBaseWithButton {
23690
23690
  getPromiseDeleteItem(rowData) {
23691
23691
  return this.setting.baseService.delete(rowData.id, this.deletePlusUrl);
23692
23692
  }
23693
+ validateDelete(items) {
23694
+ return __awaiter(this, void 0, void 0, function* () {
23695
+ return true;
23696
+ });
23697
+ }
23693
23698
  _delete(rowData) {
23694
- if (rowData.__disableDelete) {
23695
- return;
23696
- }
23697
- this._notifierService.showDeleteConfirm().then(rs => {
23698
- if (!rs) {
23699
+ return __awaiter(this, void 0, void 0, function* () {
23700
+ if (rowData.__disableDelete) {
23699
23701
  return;
23700
23702
  }
23701
- if (this.setting.baseService) {
23702
- this.getPromiseDeleteItem(rowData)
23703
- .then(response => {
23704
- if (response.success) {
23705
- this.beforeReloadAfterDelete([rowData.id]);
23706
- if (this.setting.showVersionButton) {
23707
- this.context.fireEvent(ComCtxConstants.COMMON.RELOAD_DATA_VERSION, {}, true);
23703
+ const resultValidate = yield this.validateDelete([rowData]);
23704
+ if (!resultValidate) {
23705
+ return;
23706
+ }
23707
+ this._notifierService.showDeleteConfirm().then(rs => {
23708
+ if (!rs) {
23709
+ return;
23710
+ }
23711
+ if (this.setting.baseService) {
23712
+ this.getPromiseDeleteItem(rowData)
23713
+ .then(response => {
23714
+ if (response.success) {
23715
+ this.beforeReloadAfterDelete([rowData.id]);
23716
+ if (this.setting.showVersionButton) {
23717
+ this.context.fireEvent(ComCtxConstants.COMMON.RELOAD_DATA_VERSION, {}, true);
23718
+ }
23719
+ else {
23720
+ this._triggerProcessData();
23721
+ }
23722
+ this._notifierService.showDeleteDataSuccess();
23708
23723
  }
23709
23724
  else {
23710
- this._triggerProcessData();
23725
+ this._notifierService.showWarningByResponse(response);
23711
23726
  }
23712
- this._notifierService.showDeleteDataSuccess();
23713
- }
23714
- else {
23715
- this._notifierService.showWarningByResponse(response);
23716
- }
23717
- }, error => {
23718
- this._notifierService.showDeleteDataError();
23719
- });
23720
- }
23727
+ }, error => {
23728
+ this._notifierService.showDeleteDataError();
23729
+ });
23730
+ }
23731
+ });
23721
23732
  });
23722
23733
  }
23723
23734
  getPromiseDeleteItems(items) {
@@ -23725,22 +23736,28 @@ class ListBase extends ComponentBaseWithButton {
23725
23736
  return this.setting.baseService.deleteMany(ids, this.deleteManyPlusUrl);
23726
23737
  }
23727
23738
  _deleteMultiple(items) {
23728
- this._notifierService.showDeleteConfirm('Bạn chắc chắn muốn xóa bản ghi đã chọn (Và các bản ghi con tương ứng)?').then(rs => {
23729
- if (!rs) {
23739
+ return __awaiter(this, void 0, void 0, function* () {
23740
+ const resultValidate = yield this.validateDelete(items);
23741
+ if (!resultValidate) {
23730
23742
  return;
23731
23743
  }
23732
- if (this.setting.baseService) {
23733
- this.getPromiseDeleteItems(items).then(response => {
23734
- if (response.success) {
23735
- this.beforeReloadAfterDelete(items.map(q => q.id));
23736
- this._triggerProcessData();
23737
- this._notifierService.showDeleteDataSuccess();
23738
- }
23739
- else {
23740
- this._notifierService.showWarningByResponse(response);
23741
- }
23742
- });
23743
- }
23744
+ this._notifierService.showDeleteConfirm('Bạn có chắc chắn muốn xóa bản ghi đã chọn (Và các bản ghi con tương ứng)?').then(rs => {
23745
+ if (!rs) {
23746
+ return;
23747
+ }
23748
+ if (this.setting.baseService) {
23749
+ this.getPromiseDeleteItems(items).then(response => {
23750
+ if (response.success) {
23751
+ this.beforeReloadAfterDelete(items.map(q => q.id));
23752
+ this._triggerProcessData();
23753
+ this._notifierService.showDeleteDataSuccess();
23754
+ }
23755
+ else {
23756
+ this._notifierService.showWarningByResponse(response);
23757
+ }
23758
+ });
23759
+ }
23760
+ });
23744
23761
  });
23745
23762
  }
23746
23763
  beforeReloadAfterDelete(ids) {