ps-toolkit-ui 1.4.9 → 1.4.12

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.
@@ -1335,7 +1335,7 @@
1335
1335
  }
1336
1336
  btn.loading = true;
1337
1337
  }
1338
- this.getClient(table.getUrl(), table.method, table.searchData(), function (res) {
1338
+ this.getClient(table.url, table.method, table.searchData(), function (res) {
1339
1339
  if (res.status === exports.ResultStatusEnum.Success) {
1340
1340
  table.rows = res.result.List;
1341
1341
  table.count = res.result.Count;
@@ -2534,7 +2534,7 @@
2534
2534
  };
2535
2535
  TableRowComponent.prototype.loadChildren = function (p) {
2536
2536
  var _this = this;
2537
- new RequestClass(this.table.environment, this.table.l).send(this.table.url + ("List/" + p), exports.Method.Post, null, this.showChildren, function (result) {
2537
+ new RequestClass(this.table.environment, this.table.l).send(this.table.url + ("/" + p), exports.Method.Post, null, this.showChildren, function (result) {
2538
2538
  _this.children = result.List;
2539
2539
  setTimeout(function () {
2540
2540
  $__namespace(_this.childrenDiv.nativeElement).slideDown();
@@ -2563,7 +2563,7 @@
2563
2563
  var data = [];
2564
2564
  // @ts-ignore
2565
2565
  $__namespace(_this.childrenDiv.nativeElement).sortable('toArray').forEach(function (x) { return data.push(x); });
2566
- new RequestClass(_this.table.l).send(_this.table.url + 'Sort', exports.Method.Post, data, null, function () {
2566
+ new RequestClass(_this.table.l).send(_this.table.url + '/Sort', exports.Method.Post, data, null, function () {
2567
2567
  if (_this.table.onSort) {
2568
2568
  _this.table.onSort();
2569
2569
  }
@@ -2583,12 +2583,7 @@
2583
2583
  inp.tooltip = option.Name;
2584
2584
  inp.onChange = function () {
2585
2585
  _this.row.Data[option.Action] = !inp.data();
2586
- var p = new PermissionClass();
2587
- p.RelatedId = _this.table.permissions.RelatedId;
2588
- p.Area = _this.table.permissions.Area;
2589
- p.Controller = option.Controller;
2590
- p.Action = option.Action;
2591
- new RequestClass(_this.table.environment, _this.table.l).send(p.getUrl() + '/' + _this.row.Data.Id, exports.Method.Post, null, null, function () {
2586
+ new RequestClass(_this.table.environment, _this.table.l).send(option.url + '/' + _this.row.Data.Id, exports.Method.Post, null, null, function () {
2592
2587
  });
2593
2588
  };
2594
2589
  inp.displayLabel = false;
@@ -2617,7 +2612,7 @@
2617
2612
  if (option.AccessType === exports.PermissionAccessTypeEnum.Update) {
2618
2613
  if (this_2.table.form) {
2619
2614
  opt.onClick = function () {
2620
- _this.table.form.url = _this.table.url + 'update/' + _this.row.Data.Id;
2615
+ _this.table.form.url = option.Url + '/' + _this.row.Data.Id;
2621
2616
  if (_this.table.hasChildren && _this.row.Data.ParentId != null) {
2622
2617
  _this.table.form.onSuccessBase = function () {
2623
2618
  _this.table.modal.hide();
@@ -2642,7 +2637,7 @@
2642
2637
  };
2643
2638
  }
2644
2639
  else {
2645
- opt.url = this_2.table.url + '/update/' + this_2.row.Data.Id;
2640
+ opt.url = option.Url + '/' + this_2.row.Data.Id;
2646
2641
  }
2647
2642
  }
2648
2643
  else if (option.AccessType === exports.PermissionAccessTypeEnum.Delete) {
@@ -2668,20 +2663,12 @@
2668
2663
  };
2669
2664
  }
2670
2665
  else if (option.AccessType === exports.PermissionAccessTypeEnum.Report) {
2671
- var p = new PermissionClass();
2672
- p.Area = this_2.table.permissions.Area;
2673
- p.Controller = 'Print';
2674
- p.Action = option.Controller;
2675
- opt.url = '/Report' + p.getUrl() + '/' + this_2.row.Data.Id;
2666
+ opt.url = '/Report' + option.Url + '/' + this_2.row.Data.Id;
2676
2667
  opt.urlNewTab = true;
2677
2668
  }
2678
2669
  else if (option.InputAction === exports.PermissionInputActionEnum.Link || option.InputAction === exports.PermissionInputActionEnum.LinkNewTab) {
2679
2670
  var p = new PermissionClass();
2680
- p.RelatedId = this_2.table.permissions.RelatedId;
2681
- p.Area = this_2.table.permissions.Area;
2682
- p.Controller = option.Controller;
2683
- p.Action = option.Action;
2684
- opt.url = p.getUrl() + '/' + this_2.row.Data.Id;
2671
+ opt.url = option.Url + '/' + this_2.row.Data.Id;
2685
2672
  opt.urlNewTab = option.InputAction === exports.PermissionInputActionEnum.LinkNewTab;
2686
2673
  }
2687
2674
  else if (option.InputAction === exports.PermissionInputActionEnum.Modal) {
@@ -2697,15 +2684,15 @@
2697
2684
  p.Accesses = _this.row.Options.filter(function (x) { return x.ParentId === option.Id; });
2698
2685
  opt.modal.table.permissions = p;
2699
2686
  if (opt.modal.table.form) {
2700
- opt.modal.table.form.url = p.getUrl() + 'insert';
2701
- opt.modal.table.form.baseUrl = p.getUrl() + 'insert';
2687
+ opt.modal.table.form.url = option.Url + 'insert';
2688
+ opt.modal.table.form.baseUrl = option.Url + 'insert';
2702
2689
  }
2703
2690
  opt.modal.table.set();
2704
2691
  }
2705
2692
  if (opt.modal.form) {
2706
2693
  opt.modal.form.name = option.Name;
2707
- opt.modal.form.url = opt.modal.form.baseUrl + 'update/' + _this.row.Data.Id;
2708
- opt.modal.form.loadData(opt.modal.form.baseUrl + 'get/' + _this.row.Data.Id);
2694
+ opt.modal.form.url = option.Url + 'update/' + _this.row.Data.Id;
2695
+ opt.modal.form.loadData(option.Url + 'get/' + _this.row.Data.Id);
2709
2696
  opt.modal.form.onSuccessBase = function () {
2710
2697
  opt.modal.hide();
2711
2698
  };
@@ -2723,8 +2710,8 @@
2723
2710
  p.Accesses = _this.row.Options.filter(function (x) { return x.ParentId === option.Id; });
2724
2711
  r.table.permissions = p;
2725
2712
  if (r.table.form) {
2726
- r.table.form.url = p.getUrl() + 'insert';
2727
- r.table.form.baseUrl = p.getUrl() + 'insert';
2713
+ r.table.form.url = option.Url + 'insert';
2714
+ r.table.form.baseUrl = option.Url + 'insert';
2728
2715
  }
2729
2716
  r.table.set();
2730
2717
  }
@@ -2746,7 +2733,7 @@
2746
2733
  p.Area = this_2.table.permissions.Area;
2747
2734
  p.Controller = option.Controller;
2748
2735
  p.Action = option.Action;
2749
- opt.url = '/File' + p.getUrl() + '/' + this_2.row.Data.Id;
2736
+ opt.url = '/File' + option.Url + '/' + this_2.row.Data.Id;
2750
2737
  opt.urlNewTab = true;
2751
2738
  }
2752
2739
  else if (option.InputAction === exports.PermissionInputActionEnum.Confirm) {
@@ -2756,7 +2743,7 @@
2756
2743
  p.Area = _this.table.permissions.Area;
2757
2744
  p.Controller = option.Controller;
2758
2745
  p.Action = option.Action;
2759
- _this.table.showConfirm(_this.table.l(option.Action + 'Confirm'), p.getUrl() + '/' + _this.row.Data.Id, null, function () {
2746
+ _this.table.showConfirm(_this.table.l(option.Action + 'Confirm'), option.Url + '/' + _this.row.Data.Id, null, function () {
2760
2747
  _this.table.load();
2761
2748
  });
2762
2749
  };
@@ -7445,13 +7432,10 @@
7445
7432
  }
7446
7433
  return this.searchForm ? this.searchForm.json(d) : d;
7447
7434
  };
7448
- TableClass.prototype.getUrl = function () {
7449
- return this.url + 'list';
7450
- };
7451
7435
  TableClass.prototype.showInsertModal = function (cId) {
7452
7436
  if (cId === void 0) { cId = null; }
7453
7437
  var insertAccess = this.permissions.getAccess(exports.PermissionAccessTypeEnum.Insert);
7454
- this.form.url = this.form.baseUrl = this.url + 'insert' + (cId ? '/' + cId : '');
7438
+ this.form.url = this.form.baseUrl = insertAccess.Url + (cId ? '/' + cId : '');
7455
7439
  this.form.name = insertAccess.Name;
7456
7440
  this.form.method = exports.Method.Post;
7457
7441
  this.form.inputs.filter(function (x) { return x.inEditDisabled; }).forEach(function (x) { return x.disabled = false; });
@@ -7467,7 +7451,7 @@
7467
7451
  var listAccess = this.permissions.getAccess(exports.PermissionAccessTypeEnum.List);
7468
7452
  if (listAccess !== null) {
7469
7453
  this.title = listAccess.Name;
7470
- this.url = this.permissions.getUrl();
7454
+ this.url = listAccess.Url;
7471
7455
  if (this.permissions.Type !== exports.PermissionTypeEnum.Form) {
7472
7456
  this.load();
7473
7457
  }
@@ -7488,7 +7472,7 @@
7488
7472
  if (access.AccessType === exports.PermissionAccessTypeEnum.Insert) {
7489
7473
  accessInp.class = accessInp.class.replace('blue', 'green');
7490
7474
  if (this_1.form) {
7491
- this_1.form.url = this_1.form.baseUrl = this_1.url + 'insert';
7475
+ this_1.form.url = this_1.form.baseUrl = access.Url;
7492
7476
  if (!this_1.form.onTop) {
7493
7477
  accessInp.onClick = function () {
7494
7478
  _this.form.onSuccessBase = function () {
@@ -7510,7 +7494,7 @@
7510
7494
  };
7511
7495
  }
7512
7496
  else {
7513
- accessInp.url = this_1.url + 'insert';
7497
+ accessInp.url = access.Url;
7514
7498
  }
7515
7499
  }
7516
7500
  }