tnx-shared 5.1.420 → 5.1.422

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.
@@ -7479,10 +7479,10 @@
7479
7479
  result.push(data);
7480
7480
  continue;
7481
7481
  }
7482
- data._level = ++dataParent._level;
7482
+ data._level = dataParent._level + 1;
7483
7483
  data._prefix = dataParent._root === true
7484
7484
  ? '|--'
7485
- : dataParent.data._prefix + '---';
7485
+ : dataParent._prefix + '---';
7486
7486
  dataMap.set(nodeKey, data);
7487
7487
  result.push(data);
7488
7488
  }
@@ -7599,7 +7599,7 @@
7599
7599
  var e_5, _a;
7600
7600
  // count++;
7601
7601
  node.data._prefix = prefix;
7602
- node.data._level = ++parentNode.data._level;
7602
+ node.data._level = parentNode.data._level + 1;
7603
7603
  result.push(node.data);
7604
7604
  if (node.children == null || node.children.length == 0) {
7605
7605
  return;
@@ -7679,17 +7679,46 @@
7679
7679
  options = new DropdownOptions();
7680
7680
  this.setDefaultOptionsTree(options, fieldParent);
7681
7681
  return new Promise(function (resolve, reject) {
7682
- _this._getDataDropdownByFilter(filters, options)
7683
- .then(function (res) {
7684
- var treeData = options.isTreeBaseModel === true
7685
- ? _this.getTreeModelBase(res.data, fieldParent, options.fieldParentTreeItem)
7686
- : _this.getTreeData(res.data, fieldParent, options.fieldParentTreeItem);
7687
- res.data = treeData;
7688
- resolve(res);
7689
- })
7690
- .catch(function (err) { return reject(err); });
7682
+ if (options.isTreeBaseModel) {
7683
+ var gridInfo = _this.generateGridInfoDropdown(filters, options);
7684
+ _this.baseGetTreeData(gridInfo)
7685
+ .then(function (res) {
7686
+ var treeData = _this.getTreeModelBase(res.data, fieldParent, options.fieldParentTreeItem);
7687
+ res.data = treeData;
7688
+ resolve(res);
7689
+ })
7690
+ .catch(function (err) { return reject(err); });
7691
+ }
7692
+ else {
7693
+ _this._getDataDropdownByFilter(filters, options)
7694
+ .then(function (res) {
7695
+ var treeData = _this.getTreeData(res.data, fieldParent, options.fieldParentTreeItem);
7696
+ res.data = treeData;
7697
+ resolve(res);
7698
+ })
7699
+ .catch(function (err) { return reject(err); });
7700
+ }
7691
7701
  });
7692
7702
  };
7703
+ BaseService.prototype.getFieldsFromDropdownOptions = function (options) {
7704
+ var fields = [];
7705
+ if (options.valueField && options.valueField !== '') {
7706
+ fields.push(options.valueField);
7707
+ }
7708
+ if (options.displayField && options.displayField !== '') {
7709
+ fields.push(options.displayField);
7710
+ }
7711
+ if (options.fieldParentTreeItem && options.fieldParentTreeItem !== '') {
7712
+ fields.push(options.fieldParentTreeItem);
7713
+ }
7714
+ if (options.fieldTree && options.fieldTree !== '') {
7715
+ fields.push(options.fieldTree);
7716
+ }
7717
+ if (options.fieldPlus && options.fieldPlus !== '') {
7718
+ fields.push.apply(fields, __spread(options.fieldPlus.split(',').filter(function (x) { return x !== ''; })));
7719
+ }
7720
+ return Array.from(new Set(fields)).join(',');
7721
+ };
7693
7722
  /**
7694
7723
  * get detail với api do Dev tự viết, mặc định url 'Custom/{id}'
7695
7724
  * @param id - id bản ghi
@@ -11236,6 +11265,14 @@
11236
11265
  });
11237
11266
  }
11238
11267
  };
11268
+ UserService.prototype.removeUser = function (id) {
11269
+ var url = this.serviceUri + "/RemoveUser/" + id;
11270
+ return this.defaultDelete(url);
11271
+ };
11272
+ UserService.prototype.modifyUserInfo = function (id, userInfo) {
11273
+ var url = this.serviceUri + "/ModifyUserInfo/" + id;
11274
+ return this.defaultPut(url, userInfo);
11275
+ };
11239
11276
  return UserService;
11240
11277
  }(BaseService));
11241
11278
  UserService.ɵprov = i0.ɵɵdefineInjectable({ factory: function UserService_Factory() { return new UserService(i0.ɵɵinject(i1$1.HttpClient), i0.ɵɵinject(i0.INJECTOR), i0.ɵɵinject(ModuleConfigService), i0.ɵɵinject(AuthenService), i0.ɵɵinject(i4.OAuthService), i0.ɵɵinject(SignalRService), i0.ɵɵinject(ExceptionHandlerService), i0.ɵɵinject(ApplicationContextService)); }, token: UserService, providedIn: "root" });
@@ -32394,7 +32431,7 @@
32394
32431
  };
32395
32432
  DropdownComponent.prototype.setDefaultSetting = function () {
32396
32433
  var _this = this;
32397
- if (this.control.isTree) {
32434
+ if (this.control.isTree || this.control.isTreeBaseModel) {
32398
32435
  this.delayFilter = 200;
32399
32436
  if (!this.control.funcGetLabel) {
32400
32437
  this.control.funcGetLabel = function (item) {