tnx-shared 5.3.290 → 5.3.292

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.
Files changed (34) hide show
  1. package/bundles/tnx-shared.umd.js +180 -136
  2. package/bundles/tnx-shared.umd.js.map +1 -1
  3. package/bundles/tnx-shared.umd.min.js +1 -1
  4. package/bundles/tnx-shared.umd.min.js.map +1 -1
  5. package/classes/base/list-base.d.ts +4 -3
  6. package/classes/base/list-base.d.ts.map +1 -1
  7. package/classes/base/list-component-base.d.ts.map +1 -1
  8. package/classes/form-schema.d.ts +1 -0
  9. package/classes/form-schema.d.ts.map +1 -1
  10. package/components/autocomplete-picker/autocomplete-picker.component.d.ts.map +1 -1
  11. package/components/common-search-form/common-search-form.component.d.ts.map +1 -1
  12. package/components/dropdown/dropdown.component.d.ts +2 -0
  13. package/components/dropdown/dropdown.component.d.ts.map +1 -1
  14. package/components/entity-picker/entity-picker-dialog/components/entity-picker-data/entity-picker-data.component.d.ts.map +1 -1
  15. package/components/entity-picker/entity-picker-dialog/components/entity-picker-selected/entity-picker-selected.component.d.ts.map +1 -1
  16. package/esm2015/classes/base/list-base.js +56 -39
  17. package/esm2015/classes/base/list-component-base.js +3 -3
  18. package/esm2015/classes/form-schema.js +2 -1
  19. package/esm2015/components/autocomplete-picker/autocomplete-picker.component.js +7 -5
  20. package/esm2015/components/common-search-form/common-search-form.component.js +5 -2
  21. package/esm2015/components/dropdown/dropdown.component.js +19 -23
  22. package/esm2015/components/entity-picker/entity-picker-dialog/components/entity-picker-data/entity-picker-data.component.js +2 -1
  23. package/esm2015/components/entity-picker/entity-picker-dialog/components/entity-picker-selected/entity-picker-selected.component.js +2 -1
  24. package/esm2015/services/base.service.js +5 -3
  25. package/esm2015/services/canbo-hoso.service.js +7 -3
  26. package/esm2015/services/dm-chucvu.service.js +1 -2
  27. package/fesm2015/tnx-shared.js +95 -70
  28. package/fesm2015/tnx-shared.js.map +1 -1
  29. package/package.json +2 -2
  30. package/services/base.service.d.ts +0 -2
  31. package/services/base.service.d.ts.map +1 -1
  32. package/services/canbo-hoso.service.d.ts.map +1 -1
  33. package/services/dm-chucvu.service.d.ts.map +1 -1
  34. package/tnx-shared.metadata.json +1 -1
@@ -2063,6 +2063,7 @@
2063
2063
  _this.insertPlusUrl = '';
2064
2064
  _this.loadInFirstDisplay = true;
2065
2065
  _this.autoGetData = true;
2066
+ _this.isAllowDisabled = true;
2066
2067
  _this.valueField = 'id';
2067
2068
  _this.displayField = 'ten';
2068
2069
  _this.autoDisplayFirst = false;
@@ -8015,6 +8016,7 @@
8015
8016
  var EXCEL_EXTENSION$1 = '.xlsx';
8016
8017
  var BaseService = /** @class */ (function () {
8017
8018
  function BaseService(http, injector, serviceUri) {
8019
+ var _a, _b;
8018
8020
  this.serviceUri = '';
8019
8021
  this.endPoint = '';
8020
8022
  this.serviceCode = '';
@@ -8024,8 +8026,6 @@
8024
8026
  this.apiGetData = 'GetData';
8025
8027
  this.apiGetAll = 'GetAllByFilter';
8026
8028
  this.apiGetDetailByFilter = 'GetByFilter';
8027
- this.fieldSort = '';
8028
- this.fieldSuDung = '';
8029
8029
  this.disableFieldNotUse = false;
8030
8030
  this.RETRY_COUNT = 0;
8031
8031
  this.REPLAY_COUNT = 1;
@@ -8035,6 +8035,8 @@
8035
8035
  this.serviceUri = serviceUri;
8036
8036
  this._commonService = injector.get(CommonService);
8037
8037
  this._signalrServicePrivate = injector.get(SignalRService);
8038
+ var environment = this._injector.get(ModuleConfigService).getConfig().environment;
8039
+ this.disableFieldNotUse = (_b = (_a = environment === null || environment === void 0 ? void 0 : environment.cauHinhNghiepVu) === null || _a === void 0 ? void 0 : _a.disableFieldNotUse) !== null && _b !== void 0 ? _b : false;
8038
8040
  }
8039
8041
  BaseService.prototype.setCurrentServiceUri = function (key) {
8040
8042
  };
@@ -8273,8 +8275,8 @@
8273
8275
  BaseService.prototype.checkDuplicatedByField = function (field, value, id) {
8274
8276
  return __awaiter(this, void 0, void 0, function () {
8275
8277
  var filters, result;
8276
- return __generator(this, function (_a) {
8277
- switch (_a.label) {
8278
+ return __generator(this, function (_c) {
8279
+ switch (_c.label) {
8278
8280
  case 0:
8279
8281
  filters = [
8280
8282
  new Filter({
@@ -8290,7 +8292,7 @@
8290
8292
  ];
8291
8293
  return [4 /*yield*/, this.checkExistByFilter(filters)];
8292
8294
  case 1:
8293
- result = _a.sent();
8295
+ result = _c.sent();
8294
8296
  if (!result.success)
8295
8297
  return [2 /*return*/, true];
8296
8298
  return [2 /*return*/, result.data];
@@ -8384,7 +8386,7 @@
8384
8386
  * @private
8385
8387
  */
8386
8388
  BaseService.prototype.getTreeModelBase = function (rawData, fieldParent, fieldParentTreeItem) {
8387
- var e_1, _a;
8389
+ var e_1, _c;
8388
8390
  if (rawData == null || rawData.length == 0) {
8389
8391
  return [];
8390
8392
  }
@@ -8418,7 +8420,7 @@
8418
8420
  catch (e_1_1) { e_1 = { error: e_1_1 }; }
8419
8421
  finally {
8420
8422
  try {
8421
- if (rawData_1_1 && !rawData_1_1.done && (_a = rawData_1.return)) _a.call(rawData_1);
8423
+ if (rawData_1_1 && !rawData_1_1.done && (_c = rawData_1.return)) _c.call(rawData_1);
8422
8424
  }
8423
8425
  finally { if (e_1) throw e_1.error; }
8424
8426
  }
@@ -8432,7 +8434,7 @@
8432
8434
  * @private
8433
8435
  */
8434
8436
  BaseService.prototype.getTreeData = function (rawData, fieldParent, fieldParentTreeItem) {
8435
- var e_2, _a, e_3, _b, e_4, _c;
8437
+ var e_2, _c, e_3, _d, e_4, _e;
8436
8438
  if (rawData == null)
8437
8439
  return [];
8438
8440
  // let count = 0;
@@ -8519,12 +8521,12 @@
8519
8521
  catch (e_2_1) { e_2 = { error: e_2_1 }; }
8520
8522
  finally {
8521
8523
  try {
8522
- if (rawData_2_1 && !rawData_2_1.done && (_a = rawData_2.return)) _a.call(rawData_2);
8524
+ if (rawData_2_1 && !rawData_2_1.done && (_c = rawData_2.return)) _c.call(rawData_2);
8523
8525
  }
8524
8526
  finally { if (e_2) throw e_2.error; }
8525
8527
  }
8526
8528
  var funcSetPrefix = function (node, parentNode, prefix) {
8527
- var e_5, _a;
8529
+ var e_5, _c;
8528
8530
  // count++;
8529
8531
  node.data._prefix = prefix;
8530
8532
  node.data._level = parentNode.data._level + 1;
@@ -8533,15 +8535,15 @@
8533
8535
  return;
8534
8536
  }
8535
8537
  try {
8536
- for (var _b = __values(node.children), _c = _b.next(); !_c.done; _c = _b.next()) {
8537
- var child = _c.value;
8538
+ for (var _d = __values(node.children), _e = _d.next(); !_e.done; _e = _d.next()) {
8539
+ var child = _e.value;
8538
8540
  funcSetPrefix(child, node, prefix + '---');
8539
8541
  }
8540
8542
  }
8541
8543
  catch (e_5_1) { e_5 = { error: e_5_1 }; }
8542
8544
  finally {
8543
8545
  try {
8544
- if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
8546
+ if (_e && !_e.done && (_c = _d.return)) _c.call(_d);
8545
8547
  }
8546
8548
  finally { if (e_5) throw e_5.error; }
8547
8549
  }
@@ -8561,15 +8563,15 @@
8561
8563
  continue;
8562
8564
  }
8563
8565
  try {
8564
- for (var _d = (e_4 = void 0, __values(node.children)), _e = _d.next(); !_e.done; _e = _d.next()) {
8565
- var child = _e.value;
8566
+ for (var _f = (e_4 = void 0, __values(node.children)), _g = _f.next(); !_g.done; _g = _f.next()) {
8567
+ var child = _g.value;
8566
8568
  funcSetPrefix(child, node, '|--');
8567
8569
  }
8568
8570
  }
8569
8571
  catch (e_4_1) { e_4 = { error: e_4_1 }; }
8570
8572
  finally {
8571
8573
  try {
8572
- if (_e && !_e.done && (_c = _d.return)) _c.call(_d);
8574
+ if (_g && !_g.done && (_e = _f.return)) _e.call(_f);
8573
8575
  }
8574
8576
  finally { if (e_4) throw e_4.error; }
8575
8577
  }
@@ -8578,7 +8580,7 @@
8578
8580
  catch (e_3_1) { e_3 = { error: e_3_1 }; }
8579
8581
  finally {
8580
8582
  try {
8581
- if (roots_1_1 && !roots_1_1.done && (_b = roots_1.return)) _b.call(roots_1);
8583
+ if (roots_1_1 && !roots_1_1.done && (_d = roots_1.return)) _d.call(roots_1);
8582
8584
  }
8583
8585
  finally { if (e_3) throw e_3.error; }
8584
8586
  }
@@ -8737,13 +8739,13 @@
8737
8739
  BaseService.prototype.getWorkflowSettingByCode = function (workflowCode) {
8738
8740
  return __awaiter(this, void 0, void 0, function () {
8739
8741
  var workflowSetting, jsonSchema, stateMachineData;
8740
- return __generator(this, function (_a) {
8741
- switch (_a.label) {
8742
+ return __generator(this, function (_c) {
8743
+ switch (_c.label) {
8742
8744
  case 0: return [4 /*yield*/, this.getDetailByFilter([
8743
8745
  this.newFilter('code', exports.Operator.equal, workflowCode)
8744
8746
  ])];
8745
8747
  case 1:
8746
- workflowSetting = (_a.sent()).data;
8748
+ workflowSetting = (_c.sent()).data;
8747
8749
  if (workflowSetting == null)
8748
8750
  return [2 /*return*/, null];
8749
8751
  jsonSchema = workflowSetting['data'];
@@ -8835,11 +8837,11 @@
8835
8837
  FileSaver__namespace.saveAs(res, fileName);
8836
8838
  }).catch(function (err) { return __awaiter(_this, void 0, void 0, function () {
8837
8839
  var errorText;
8838
- return __generator(this, function (_a) {
8839
- switch (_a.label) {
8840
+ return __generator(this, function (_c) {
8841
+ switch (_c.label) {
8840
8842
  case 0: return [4 /*yield*/, err.error.text()];
8841
8843
  case 1:
8842
- errorText = _a.sent();
8844
+ errorText = _c.sent();
8843
8845
  console.error(errorText);
8844
8846
  return [2 /*return*/];
8845
8847
  }
@@ -8933,8 +8935,8 @@
8933
8935
  if (sortDir === void 0) { sortDir = null; }
8934
8936
  return __awaiter(this, void 0, void 0, function () {
8935
8937
  var arrFilter, arrSort, arrResult;
8936
- return __generator(this, function (_a) {
8937
- switch (_a.label) {
8938
+ return __generator(this, function (_c) {
8939
+ switch (_c.label) {
8938
8940
  case 0:
8939
8941
  arrValue = (arrValue || []).filter(function (val, ind, arr) { return (val === 0 || val) && arr.indexOf(val) === ind; });
8940
8942
  if (!arrValue || !arrValue.length)
@@ -8953,7 +8955,7 @@
8953
8955
  }
8954
8956
  return [4 /*yield*/, this.getAll(arrFilter, getFields, arrSort)];
8955
8957
  case 1:
8956
- arrResult = (_a.sent()).data;
8958
+ arrResult = (_c.sent()).data;
8957
8959
  return [2 /*return*/, (arrResult || [])];
8958
8960
  }
8959
8961
  });
@@ -8964,11 +8966,11 @@
8964
8966
  if (valueField === void 0) { valueField = null; }
8965
8967
  return __awaiter(this, void 0, void 0, function () {
8966
8968
  var arrResult, rsDic;
8967
- return __generator(this, function (_a) {
8968
- switch (_a.label) {
8969
+ return __generator(this, function (_c) {
8970
+ switch (_c.label) {
8969
8971
  case 0: return [4 /*yield*/, this.getByField(field, arrValue, getFields)];
8970
8972
  case 1:
8971
- arrResult = _a.sent();
8973
+ arrResult = _c.sent();
8972
8974
  rsDic = {};
8973
8975
  if (!arrResult.length) {
8974
8976
  return [2 /*return*/, rsDic];
@@ -9017,7 +9019,7 @@
9017
9019
  };
9018
9020
  BaseService.prototype.getDataTrinhKy = function (item, rowData) {
9019
9021
  return __awaiter(this, void 0, void 0, function () {
9020
- return __generator(this, function (_a) {
9022
+ return __generator(this, function (_c) {
9021
9023
  return [2 /*return*/, []];
9022
9024
  });
9023
9025
  });
@@ -20177,6 +20179,8 @@
20177
20179
  }),
20178
20180
  new ColumnSchemaBase({
20179
20181
  field: 'email',
20182
+ operator: exports.Operator.equal,
20183
+ isOverrideFilter: true,
20180
20184
  width: '180px'
20181
20185
  }),
20182
20186
  new ColumnSchemaBase({
@@ -20746,7 +20750,8 @@
20746
20750
  new EntityPickerColumn({
20747
20751
  label: 'Email',
20748
20752
  code: 'email',
20749
- fullTextSearch: true,
20753
+ operator: exports.Operator.equal,
20754
+ isOverrideFilter: true,
20750
20755
  width: '170px',
20751
20756
  }),
20752
20757
  new EntityPickerColumn({
@@ -20816,7 +20821,8 @@
20816
20821
  new EntityPickerColumn({
20817
20822
  label: 'Email',
20818
20823
  code: 'email',
20819
- fullTextSearch: true,
20824
+ operator: exports.Operator.equal,
20825
+ isOverrideFilter: true,
20820
20826
  width: '170px',
20821
20827
  })
20822
20828
  ];
@@ -24440,7 +24446,7 @@
24440
24446
  isArrayField: col.isArrayField ? true : false
24441
24447
  });
24442
24448
  templateFilter.push(filter);
24443
- _this.filterSchema.dropdown[col.field] = new DropdownControlSchema(Object.assign(Object.assign({}, col), { appendTo: 'body', placeholder: "Ch\u1ECDn " + col.label, multiple: filterMuliple.includes(filter.operator), loadOnInit: true, isServerLoad: col.isServerLoad }));
24449
+ _this.filterSchema.dropdown[col.field] = new DropdownControlSchema(Object.assign(Object.assign({}, col), { appendTo: 'body', placeholder: "Ch\u1ECDn " + col.label, multiple: filterMuliple.includes(filter.operator), loadOnInit: true, isServerLoad: col.isServerLoad, isAllowDisabled: false }));
24444
24450
  }
24445
24451
  else {
24446
24452
  _this._notifierService.showWarning("Ch\u01B0a c\u1EA5u h\u00ECnh baseService ho\u1EB7c dataSource cho c\u1ED9t " + col.field + ": " + col.label);
@@ -24869,7 +24875,7 @@
24869
24875
  }
24870
24876
  else {
24871
24877
  if (col.baseService || (col.dataSource && col.dataSource.length > 0)) {
24872
- searchInfo.fieldDropdown[col.field] = new DropdownControlSchema(Object.assign(Object.assign({}, col), { label: col.label, operator: col.multiple ? exports.Operator.in : exports.Operator.equal, mdWidth: col.mdWidth ? col.mdWidth : 10, loadOnInit: true }));
24878
+ searchInfo.fieldDropdown[col.field] = new DropdownControlSchema(Object.assign(Object.assign({}, col), { label: col.label, operator: col.multiple ? exports.Operator.in : exports.Operator.equal, mdWidth: col.mdWidth ? col.mdWidth : 10, loadOnInit: true, isAllowDisabled: false }));
24873
24879
  searchInfo.schema.push(searchInfo.fieldDropdown[col.field]);
24874
24880
  }
24875
24881
  else if (col.dataType == 'int') {
@@ -27676,7 +27682,7 @@
27676
27682
  var resultValidate, flashShow;
27677
27683
  return __generator(this, function (_b) {
27678
27684
  switch (_b.label) {
27679
- case 0: return [4 /*yield*/, this.validateEdit()];
27685
+ case 0: return [4 /*yield*/, this.validateEdit(rowData)];
27680
27686
  case 1:
27681
27687
  resultValidate = _b.sent();
27682
27688
  if (!resultValidate) {
@@ -27702,7 +27708,7 @@
27702
27708
  });
27703
27709
  });
27704
27710
  };
27705
- ListBase.prototype.validateEdit = function () {
27711
+ ListBase.prototype.validateEdit = function (rowData) {
27706
27712
  return __awaiter(this, void 0, void 0, function () {
27707
27713
  return __generator(this, function (_b) {
27708
27714
  return [2 /*return*/, true];
@@ -27734,35 +27740,57 @@
27734
27740
  ListBase.prototype.getPromiseDeleteItem = function (rowData) {
27735
27741
  return this.setting.baseService.delete(rowData.id, this.deletePlusUrl);
27736
27742
  };
27743
+ ListBase.prototype.validateDelete = function (items) {
27744
+ return __awaiter(this, void 0, void 0, function () {
27745
+ return __generator(this, function (_b) {
27746
+ return [2 /*return*/, true];
27747
+ });
27748
+ });
27749
+ };
27737
27750
  ListBase.prototype._delete = function (rowData) {
27738
- var _this = this;
27739
- if (rowData.__disableDelete) {
27740
- return;
27741
- }
27742
- this._notifierService.showDeleteConfirm().then(function (rs) {
27743
- if (!rs) {
27744
- return;
27745
- }
27746
- if (_this.setting.baseService) {
27747
- _this.getPromiseDeleteItem(rowData)
27748
- .then(function (response) {
27749
- if (response.success) {
27750
- _this.beforeReloadAfterDelete([rowData.id]);
27751
- if (_this.setting.showVersionButton) {
27752
- _this.context.fireEvent(ComCtxConstants.COMMON.RELOAD_DATA_VERSION, {}, true);
27751
+ return __awaiter(this, void 0, void 0, function () {
27752
+ var resultValidate;
27753
+ var _this = this;
27754
+ return __generator(this, function (_b) {
27755
+ switch (_b.label) {
27756
+ case 0:
27757
+ if (rowData.__disableDelete) {
27758
+ return [2 /*return*/];
27753
27759
  }
27754
- else {
27755
- _this._triggerProcessData();
27760
+ return [4 /*yield*/, this.validateDelete([rowData])];
27761
+ case 1:
27762
+ resultValidate = _b.sent();
27763
+ if (!resultValidate) {
27764
+ return [2 /*return*/];
27756
27765
  }
27757
- _this._notifierService.showDeleteDataSuccess();
27758
- }
27759
- else {
27760
- _this._notifierService.showWarningByResponse(response);
27761
- }
27762
- }, function (error) {
27763
- _this._notifierService.showDeleteDataError();
27764
- });
27765
- }
27766
+ this._notifierService.showDeleteConfirm().then(function (rs) {
27767
+ if (!rs) {
27768
+ return;
27769
+ }
27770
+ if (_this.setting.baseService) {
27771
+ _this.getPromiseDeleteItem(rowData)
27772
+ .then(function (response) {
27773
+ if (response.success) {
27774
+ _this.beforeReloadAfterDelete([rowData.id]);
27775
+ if (_this.setting.showVersionButton) {
27776
+ _this.context.fireEvent(ComCtxConstants.COMMON.RELOAD_DATA_VERSION, {}, true);
27777
+ }
27778
+ else {
27779
+ _this._triggerProcessData();
27780
+ }
27781
+ _this._notifierService.showDeleteDataSuccess();
27782
+ }
27783
+ else {
27784
+ _this._notifierService.showWarningByResponse(response);
27785
+ }
27786
+ }, function (error) {
27787
+ _this._notifierService.showDeleteDataError();
27788
+ });
27789
+ }
27790
+ });
27791
+ return [2 /*return*/];
27792
+ }
27793
+ });
27766
27794
  });
27767
27795
  };
27768
27796
  ListBase.prototype.getPromiseDeleteItems = function (items) {
@@ -27770,23 +27798,37 @@
27770
27798
  return this.setting.baseService.deleteMany(ids, this.deleteManyPlusUrl);
27771
27799
  };
27772
27800
  ListBase.prototype._deleteMultiple = function (items) {
27773
- var _this = this;
27774
- 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(function (rs) {
27775
- if (!rs) {
27776
- return;
27777
- }
27778
- if (_this.setting.baseService) {
27779
- _this.getPromiseDeleteItems(items).then(function (response) {
27780
- if (response.success) {
27781
- _this.beforeReloadAfterDelete(items.map(function (q) { return q.id; }));
27782
- _this._triggerProcessData();
27783
- _this._notifierService.showDeleteDataSuccess();
27784
- }
27785
- else {
27786
- _this._notifierService.showWarningByResponse(response);
27787
- }
27788
- });
27789
- }
27801
+ return __awaiter(this, void 0, void 0, function () {
27802
+ var resultValidate;
27803
+ var _this = this;
27804
+ return __generator(this, function (_b) {
27805
+ switch (_b.label) {
27806
+ case 0: return [4 /*yield*/, this.validateDelete(items)];
27807
+ case 1:
27808
+ resultValidate = _b.sent();
27809
+ if (!resultValidate) {
27810
+ return [2 /*return*/];
27811
+ }
27812
+ 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(function (rs) {
27813
+ if (!rs) {
27814
+ return;
27815
+ }
27816
+ if (_this.setting.baseService) {
27817
+ _this.getPromiseDeleteItems(items).then(function (response) {
27818
+ if (response.success) {
27819
+ _this.beforeReloadAfterDelete(items.map(function (q) { return q.id; }));
27820
+ _this._triggerProcessData();
27821
+ _this._notifierService.showDeleteDataSuccess();
27822
+ }
27823
+ else {
27824
+ _this._notifierService.showWarningByResponse(response);
27825
+ }
27826
+ });
27827
+ }
27828
+ });
27829
+ return [2 /*return*/];
27830
+ }
27831
+ });
27790
27832
  });
27791
27833
  };
27792
27834
  ListBase.prototype.beforeReloadAfterDelete = function (ids) {
@@ -32432,6 +32474,9 @@
32432
32474
  _this.handleSearch(null, evt.control.field);
32433
32475
  };
32434
32476
  }
32477
+ if (column instanceof DropdownControlSchema) {
32478
+ column.isAllowDisabled = false;
32479
+ }
32435
32480
  if (column instanceof NumberRangeControlSchema) {
32436
32481
  _this.lstNumberRangeControl.push(column.field);
32437
32482
  }
@@ -32478,7 +32523,7 @@
32478
32523
  if (isLazyLoad) {
32479
32524
  _this.lstControlLazyLoad.push(column.field);
32480
32525
  }
32481
- result.push(new DropdownControlSchema(Object.assign(Object.assign({}, column), { placeholder: (_a = column.placeholder) !== null && _a !== void 0 ? _a : "Ch\u1ECDn " + column.label, multiple: !column.single, dataSource: dataSource, mdWidth: _this.mdWidth, isLazyLoad: isLazyLoad, showLabel: false, showClear: true, onChanged: function (evt) {
32526
+ result.push(new DropdownControlSchema(Object.assign(Object.assign({}, column), { placeholder: (_a = column.placeholder) !== null && _a !== void 0 ? _a : "Ch\u1ECDn " + column.label, isAllowDisabled: false, multiple: !column.single, dataSource: dataSource, mdWidth: _this.mdWidth, isLazyLoad: isLazyLoad, showLabel: false, showClear: true, onChanged: function (evt) {
32482
32527
  var _a;
32483
32528
  if (column.dataType == exports.DataType.boolean) {
32484
32529
  evt.parentModel[column.field] = column.single ? (_a = evt.value.id) !== null && _a !== void 0 ? _a : evt.value : evt.value.map(function (p) { return p.id; });
@@ -32792,6 +32837,8 @@
32792
32837
  _this.loading = false;
32793
32838
  _this.page = 1;
32794
32839
  _this.totalPage = 2;
32840
+ _this.fieldSuDung = 'suDung';
32841
+ _this.disableFieldNotUse = false;
32795
32842
  _this.modifyOptionWhenFilter = function (options) {
32796
32843
  _this.dropdownOptions = _this.dropdown._options;
32797
32844
  _this._modifyOptionWhenFilter(options);
@@ -32923,13 +32970,14 @@
32923
32970
  if (this.control.loadOnInit && !this.control.isLazyLoad) {
32924
32971
  this._getData();
32925
32972
  }
32973
+ if (this.control.baseService instanceof MasterDataService) {
32974
+ this.control.maxItemDisplay = 9999;
32975
+ }
32976
+ this.disableFieldNotUse = this.control.baseService['disableFieldNotUse'];
32926
32977
  }
32927
32978
  if (!this._deviceDetectorService.isDesktop()) {
32928
32979
  this.hideTransitionOptions = this.showTransitionOptions = '';
32929
32980
  }
32930
- if (this.control.baseService instanceof MasterDataService) {
32931
- this.control.maxItemDisplay = 9999;
32932
- }
32933
32981
  if (this.control.onInit) {
32934
32982
  this.control.onInit(this);
32935
32983
  }
@@ -33093,6 +33141,7 @@
33093
33141
  this._getData();
33094
33142
  };
33095
33143
  DropdownComponent.prototype.combineDataSource = function (dataSource, page) {
33144
+ var _this = this;
33096
33145
  this.autofocusSelectedItem = true;
33097
33146
  if (!dataSource)
33098
33147
  dataSource = [];
@@ -33131,9 +33180,9 @@
33131
33180
  this._hasLoadedDatasource = true;
33132
33181
  }
33133
33182
  }
33134
- if (this.control.baseService && this.control.baseService['disableFieldNotUse']) {
33135
- var fieldSuDung_1 = this.control.baseService['fieldSuDung'];
33136
- this.dataSourceInternal.forEach(function (item) { return item.inactive = !item.value[fieldSuDung_1]; });
33183
+ if (this.disableFieldNotUse && this.control.isAllowDisabled
33184
+ && this.dataSourceInternal.some(function (p) { return p.value.hasOwnProperty(_this.fieldSuDung); })) {
33185
+ this.dataSourceInternal.forEach(function (item) { return item.inactive = !item.value[_this.fieldSuDung]; });
33137
33186
  }
33138
33187
  };
33139
33188
  DropdownComponent.prototype.appendDataSource = function (destSource, dataSource, direction) {
@@ -33437,25 +33486,13 @@
33437
33486
  if (page === void 0) { page = 1; }
33438
33487
  if (pageSize === void 0) { pageSize = null; }
33439
33488
  return __awaiter(this, void 0, void 0, function () {
33440
- var dataSource, totalPage, fieldSuDung, dropdownOptions, response, result, dataSource_3, dataSource_3_1, item;
33489
+ var dataSource, totalPage, dropdownOptions, response, result, dataSource_3, dataSource_3_1, item;
33441
33490
  var e_5, _a;
33442
- var _this = this;
33443
33491
  return __generator(this, function (_b) {
33444
33492
  switch (_b.label) {
33445
33493
  case 0:
33446
33494
  dataSource = null;
33447
33495
  totalPage = 1;
33448
- if (this.control.baseService['fieldSort']) {
33449
- this.control.sorts = [this.newSort(this.control.baseService['fieldSort'])];
33450
- }
33451
- fieldSuDung = this.control.baseService['fieldSuDung'];
33452
- if (fieldSuDung) {
33453
- this.control.sorts.splice(0, 0, this.newSort(fieldSuDung, -1));
33454
- this.control.fieldPlus += "," + fieldSuDung;
33455
- this.control.funcGetLabel = function (item) {
33456
- return item[fieldSuDung] ? item[_this.control.displayField] : item[_this.control.displayField] + " (Kh\u00F4ng s\u1EED d\u1EE5ng)";
33457
- };
33458
- }
33459
33496
  dropdownOptions = this._crudService.createDropdownOptions(this.control);
33460
33497
  dropdownOptions.page = page;
33461
33498
  if (pageSize) {
@@ -33590,14 +33627,18 @@
33590
33627
  var _this = this;
33591
33628
  if (this.control.multiple) {
33592
33629
  if (!event.itemValue) {
33593
- // Trường hợp select all
33594
- if (event.value.length) {
33595
- this._value = this.dataSourceInternal.map(function (q) { return q.value; });
33596
- }
33597
33630
  // Trường hợp unselect all
33598
- else {
33631
+ if (!event.value.length || event.value.every(function (p) { return p.hasOwnProperty(_this.fieldSuDung) && !p[_this.fieldSuDung]; })) {
33599
33632
  this._value = [];
33600
33633
  }
33634
+ // Trường hợp select all
33635
+ else {
33636
+ var tmpDataSource = __spreadArray([], __read(this.dataSourceInternal));
33637
+ if (this.dataSourceInternal.some(function (p) { return p.hasOwnProperty('inactive'); })) {
33638
+ tmpDataSource = tmpDataSource.filter(function (p) { return !p.inactive; });
33639
+ }
33640
+ this._value = tmpDataSource.map(function (q) { return q.value; });
33641
+ }
33601
33642
  }
33602
33643
  else if (this.control.selectDescendant) {
33603
33644
  var parentIds_1 = [event.itemValue[this.control.valueField]];
@@ -40301,7 +40342,6 @@
40301
40342
  _this.entityName = 'DM_ChucVu';
40302
40343
  _this.endPoint = _moduleConfigService.getConfig().environment.apiDomain.canboEndpoint;
40303
40344
  _this._moduleConfig = _moduleConfigService.getConfig();
40304
- _this.fieldSuDung = 'trangThai';
40305
40345
  return _this;
40306
40346
  }
40307
40347
  return DmChucVuService;
@@ -43808,26 +43848,28 @@
43808
43848
  };
43809
43849
  AutoCompletePickerComponent.prototype.buildFilterKeyword = function () {
43810
43850
  var _this = this;
43851
+ var _a;
43852
+ var operator = (_a = this.control.operatorFieldSearchText) !== null && _a !== void 0 ? _a : exports.Operator.contain;
43811
43853
  if (this.fieldSearchText.length == 1) {
43812
- this.getFilterOnSearch = function (value) { return _this.newFilter(_this.control.displayField, exports.Operator.contain, value); };
43854
+ this.getFilterOnSearch = function (value) { return _this.newFilter(_this.control.displayField, operator, value); };
43813
43855
  }
43814
43856
  else {
43815
43857
  this.getFilterOnSearch = function (value) {
43816
- var e_1, _a;
43858
+ var e_1, _b;
43817
43859
  var result = new Filter({
43818
43860
  logic: 'or',
43819
43861
  filters: []
43820
43862
  });
43821
43863
  try {
43822
- for (var _b = __values(_this.fieldSearchText), _c = _b.next(); !_c.done; _c = _b.next()) {
43823
- var fieldSearch = _c.value;
43824
- result.filters.push(_this.newFilter(fieldSearch, exports.Operator.contain, value));
43864
+ for (var _c = __values(_this.fieldSearchText), _d = _c.next(); !_d.done; _d = _c.next()) {
43865
+ var fieldSearch = _d.value;
43866
+ result.filters.push(_this.newFilter(fieldSearch, operator, value));
43825
43867
  }
43826
43868
  }
43827
43869
  catch (e_1_1) { e_1 = { error: e_1_1 }; }
43828
43870
  finally {
43829
43871
  try {
43830
- if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
43872
+ if (_d && !_d.done && (_b = _c.return)) _b.call(_c);
43831
43873
  }
43832
43874
  finally { if (e_1) throw e_1.error; }
43833
43875
  }
@@ -43889,14 +43931,14 @@
43889
43931
  };
43890
43932
  AutoCompletePickerComponent.prototype.showPickForm = function () {
43891
43933
  return __awaiter(this, void 0, void 0, function () {
43892
- return __generator(this, function (_a) {
43893
- switch (_a.label) {
43934
+ return __generator(this, function (_b) {
43935
+ switch (_b.label) {
43894
43936
  case 0:
43895
43937
  if (!this.control.modifyInitSearchData) return [3 /*break*/, 2];
43896
43938
  return [4 /*yield*/, this.control.modifyInitSearchData(this)];
43897
43939
  case 1:
43898
- _a.sent();
43899
- _a.label = 2;
43940
+ _b.sent();
43941
+ _b.label = 2;
43900
43942
  case 2:
43901
43943
  this.dirty = false;
43902
43944
  this.showFormPicker = true;
@@ -43908,8 +43950,8 @@
43908
43950
  AutoCompletePickerComponent.prototype.getData = function () {
43909
43951
  return __awaiter(this, void 0, void 0, function () {
43910
43952
  var filters, allow, dataSource;
43911
- return __generator(this, function (_a) {
43912
- switch (_a.label) {
43953
+ return __generator(this, function (_b) {
43954
+ switch (_b.label) {
43913
43955
  case 0:
43914
43956
  filters = [];
43915
43957
  if (this.control.multiple) {
@@ -43924,22 +43966,22 @@
43924
43966
  }
43925
43967
  return [4 /*yield*/, appendDefaultFilter(filters, this.control.defaultFilters)];
43926
43968
  case 1:
43927
- _a.sent();
43969
+ _b.sent();
43928
43970
  if (this.keyword && this.keyword.length > 0) {
43929
43971
  filters.push(this.getFilterOnSearch(this.keyword));
43930
43972
  }
43931
43973
  if (!this.control.modifyFilter) return [3 /*break*/, 3];
43932
43974
  return [4 /*yield*/, this.control.modifyFilter(filters, this, this.currentNode)];
43933
43975
  case 2:
43934
- allow = _a.sent();
43976
+ allow = _b.sent();
43935
43977
  if (allow === false) {
43936
43978
  this.results = [];
43937
43979
  return [2 /*return*/];
43938
43980
  }
43939
- _a.label = 3;
43981
+ _b.label = 3;
43940
43982
  case 3: return [4 /*yield*/, this.control.baseService.getDataDropdownByFilter(filters, this.getDropdownOptions())];
43941
43983
  case 4:
43942
- dataSource = _a.sent();
43984
+ dataSource = _b.sent();
43943
43985
  this.fireEventAfterGetDataDropDown(dataSource);
43944
43986
  this.reStructureDataSource(dataSource);
43945
43987
  this.results = this.dataSource;
@@ -44131,8 +44173,8 @@
44131
44173
  AutoCompletePickerComponent.prototype.handleHide = function (evt) {
44132
44174
  return __awaiter(this, void 0, void 0, function () {
44133
44175
  var dataSource, dataSource;
44134
- return __generator(this, function (_a) {
44135
- switch (_a.label) {
44176
+ return __generator(this, function (_b) {
44177
+ switch (_b.label) {
44136
44178
  case 0:
44137
44179
  this.showFormPicker = false;
44138
44180
  if (!this.dirty) return [3 /*break*/, 7];
@@ -44143,9 +44185,9 @@
44143
44185
  this.newFilter(this.control.valueField, exports.Operator.in, this.value)
44144
44186
  ], this.getDropdownOptions(this.value.length))];
44145
44187
  case 1:
44146
- dataSource = _a.sent();
44188
+ dataSource = _b.sent();
44147
44189
  this.fireEventAfterGetDataDropDown(dataSource);
44148
- _a.label = 2;
44190
+ _b.label = 2;
44149
44191
  case 2:
44150
44192
  this.reStructureDataSource(dataSource);
44151
44193
  this.selectedValueObject = this.dataSource;
@@ -44157,9 +44199,9 @@
44157
44199
  this.newFilter(this.control.valueField, exports.Operator.equal, this.value)
44158
44200
  ], this.getDropdownOptions(1))];
44159
44201
  case 4:
44160
- dataSource = _a.sent();
44202
+ dataSource = _b.sent();
44161
44203
  this.fireEventAfterGetDataDropDown(dataSource);
44162
- _a.label = 5;
44204
+ _b.label = 5;
44163
44205
  case 5:
44164
44206
  this.reStructureDataSource(dataSource);
44165
44207
  if (this.dataSource.length > 0) {
@@ -44168,10 +44210,10 @@
44168
44210
  else {
44169
44211
  this.selectedValueObject = null;
44170
44212
  }
44171
- _a.label = 6;
44213
+ _b.label = 6;
44172
44214
  case 6:
44173
44215
  this.updateSelectedValue();
44174
- _a.label = 7;
44216
+ _b.label = 7;
44175
44217
  case 7: return [2 /*return*/];
44176
44218
  }
44177
44219
  });
@@ -44189,7 +44231,7 @@
44189
44231
  }
44190
44232
  };
44191
44233
  AutoCompletePickerComponent.prototype.reStructureDataSource = function (sources) {
44192
- var e_2, _a;
44234
+ var e_2, _b;
44193
44235
  if (sources != null && sources.length > 0) {
44194
44236
  var arr = [];
44195
44237
  try {
@@ -44202,7 +44244,7 @@
44202
44244
  catch (e_2_1) { e_2 = { error: e_2_1 }; }
44203
44245
  finally {
44204
44246
  try {
44205
- if (sources_1_1 && !sources_1_1.done && (_a = sources_1.return)) _a.call(sources_1);
44247
+ if (sources_1_1 && !sources_1_1.done && (_b = sources_1.return)) _b.call(sources_1);
44206
44248
  }
44207
44249
  finally { if (e_2) throw e_2.error; }
44208
44250
  }
@@ -44228,8 +44270,8 @@
44228
44270
  return new Promise(function (resolve, reject) { return __awaiter(_this, void 0, void 0, function () {
44229
44271
  var filters;
44230
44272
  var _this = this;
44231
- return __generator(this, function (_a) {
44232
- switch (_a.label) {
44273
+ return __generator(this, function (_b) {
44274
+ switch (_b.label) {
44233
44275
  case 0:
44234
44276
  if (!this.control.multiple) return [3 /*break*/, 4];
44235
44277
  if (!(obj != null && obj.length > 0)) return [3 /*break*/, 2];
@@ -44237,7 +44279,7 @@
44237
44279
  filters.push(this.newFilter(this.control.valueField, exports.Operator.in, obj));
44238
44280
  return [4 /*yield*/, appendDefaultFilter(filters, this.control.defaultFilters)];
44239
44281
  case 1:
44240
- _a.sent();
44282
+ _b.sent();
44241
44283
  this.control.baseService.getDataDropdownByFilter(filters, this.getDropdownOptions(obj.length)).then(function (res) {
44242
44284
  _this.fireEventAfterGetDataDropDown(res);
44243
44285
  _this.reStructureDataSource(res);
@@ -44250,7 +44292,7 @@
44250
44292
  this.results = [];
44251
44293
  this.selectedValueObject = [];
44252
44294
  resolve(this.selectedValueObject);
44253
- _a.label = 3;
44295
+ _b.label = 3;
44254
44296
  case 3: return [3 /*break*/, 5];
44255
44297
  case 4:
44256
44298
  if (obj != null) {
@@ -44272,7 +44314,7 @@
44272
44314
  this.selectedValueObject = null;
44273
44315
  resolve(this.selectedValueObject);
44274
44316
  }
44275
- _a.label = 5;
44317
+ _b.label = 5;
44276
44318
  case 5: return [2 /*return*/];
44277
44319
  }
44278
44320
  });
@@ -45955,6 +45997,7 @@
45955
45997
  funcSetValueRow: column.funcSetValueRow,
45956
45998
  dataSource: column.dataSource,
45957
45999
  groupCode: column.groupCode,
46000
+ isOverrideFilter: column.isOverrideFilter,
45958
46001
  order: column.order
45959
46002
  });
45960
46003
  if (column.dataType == 'custom') {
@@ -46210,6 +46253,7 @@
46210
46253
  funcSetValueRow: column.funcSetValueRow,
46211
46254
  dataSource: column.dataSource,
46212
46255
  groupCode: column.groupCode,
46256
+ isOverrideFilter: column.isOverrideFilter,
46213
46257
  order: column.order
46214
46258
  });
46215
46259
  if (column.dataType == 'custom') {