ps-toolkit-ui 1.4.11 → 1.4.14

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.
@@ -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();
@@ -2638,11 +2633,11 @@
2638
2633
  _this.table.load();
2639
2634
  };
2640
2635
  }
2641
- _this.edit(opt);
2636
+ _this.edit(opt, option);
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) {
@@ -2656,7 +2651,7 @@
2656
2651
  _this.changeRows.emit(_this.row.Data);
2657
2652
  }
2658
2653
  else {
2659
- _this.confirmShow.emit({ id: _this.row.Data.Id, accept: function () {
2654
+ _this.confirmShow.emit({ url: option.Url.replace('{}', _this.row.Data.Id), accept: function () {
2660
2655
  if (_this.table.hasChildren && _this.table.childrenAutoLoad && _this.row.Data.ParentId != null) {
2661
2656
  _this.loadParent.emit(_this.row.Data.ParentId);
2662
2657
  }
@@ -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
  };
@@ -2871,7 +2858,7 @@
2871
2858
  });
2872
2859
  return c;
2873
2860
  };
2874
- TableRowComponent.prototype.edit = function (opt) {
2861
+ TableRowComponent.prototype.edit = function (opt, option) {
2875
2862
  var _this = this;
2876
2863
  if (this.table.permissions.Type === exports.PermissionTypeEnum.Form) {
2877
2864
  this.table.form.name = opt.name;
@@ -2881,7 +2868,7 @@
2881
2868
  this.table.form.inputs.filter(function (x) { return !x.inEditVisible; }).forEach(function (x) { return x.visible = false; });
2882
2869
  }
2883
2870
  else {
2884
- new RequestClass(this.table.environment, this.table.l).send(this.table.url + 'Get/' + this.row.Data.Id, exports.Method.Post, null, opt, function (result) {
2871
+ new RequestClass(this.table.environment, this.table.l).send(option.Url.replace('update', 'get').replace('{}', this.row.Data.Id), exports.Method.Post, null, opt, function (result) {
2885
2872
  _this.table.form.name = opt.name;
2886
2873
  _this.table.form.setButtons(_this.table.form.onTop, true, _this.row.Data.Id);
2887
2874
  _this.table.form.setData(result);
@@ -3136,7 +3123,7 @@
3136
3123
  return this.changeRows.emit(e);
3137
3124
  };
3138
3125
  TableComponent.prototype.onConfirmShow = function (e) {
3139
- this.confirm.show(this.table.l('DeleteConfirm'), this.table.url + 'Delete/' + e.id, null, e.accept);
3126
+ this.confirm.show(this.table.l('DeleteConfirm'), e.url, null, e.accept);
3140
3127
  };
3141
3128
  TableComponent.prototype.changeSort = function (e, s) {
3142
3129
  if ($__namespace(e.target).closest('.header-search').hasClass('header-search')) {