ps-toolkit-ui 0.0.136 → 0.0.140

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.
@@ -2590,7 +2590,7 @@
2590
2590
  var _loop_1 = function (option) {
2591
2591
  var opt = new InputClass(this_1.table.environment, this_1.table.l, option.Name, option.Icon, option.InputType === exports.PermissionInputTypeEnum.Icon ? exports.InputType.Icon : exports.InputType.Button, 'blue h-25 m-h-5 d-ib va-m f-u');
2592
2592
  opt.row = this_1.row;
2593
- if (option.Action === 'Update') {
2593
+ if (option.AcceessType === exports.PermissionAccessTypeEnum.Update) {
2594
2594
  if (this_1.table.form) {
2595
2595
  opt.onClick = function () {
2596
2596
  _this.table.form.url = _this.table.url + 'Update/' + _this.row.Data.Id;
@@ -2621,9 +2621,12 @@
2621
2621
  opt.url = this_1.table.url + '/Update/' + this_1.row.Data.Id;
2622
2622
  }
2623
2623
  }
2624
- else if (option.Action === 'Delete') {
2624
+ else if (option.AcceessType === exports.PermissionAccessTypeEnum.Delete) {
2625
+ console.log(option, 'option');
2626
+ console.log(opt, 'opt');
2625
2627
  opt.class = opt.class.replace('blue', 'red');
2626
2628
  opt.onClick = function () {
2629
+ console.log(_this.row.Data.Id, 'opt onClick');
2627
2630
  if (_this.table.form) {
2628
2631
  _this.table.form.clear();
2629
2632
  }
@@ -2647,19 +2650,18 @@
2647
2650
  var p = new PermissionClass();
2648
2651
  p.RelatedId = this_1.table.permissions.RelatedId;
2649
2652
  p.Area = this_1.table.permissions.Area;
2650
- p.Controller = option.Controller ? option.Controller : this_1.table.permissions.Controller;
2651
- p.Action = this_1.table.permissions.Action;
2652
- opt.url = p.getUrl() + option.Action + '/{}';
2653
+ p.Controller = option.Controller;
2654
+ p.Action = option.Action;
2655
+ opt.url = p.getUrl() + '/' + this_1.row.Data.Id;
2653
2656
  opt.urlNewTab = option.InputAction === exports.PermissionInputActionEnum.LinkNewTab;
2654
2657
  }
2655
2658
  else if (option.InputAction === exports.PermissionInputActionEnum.Modal) {
2656
2659
  opt.modal = this_1.table.modals.find(function (x) { return x.name === option.Action; });
2657
- opt.onClick = function (btn) {
2660
+ opt.onClick = function () {
2658
2661
  var e_2, _a;
2659
2662
  if (opt.modal.table) {
2660
- console.log(_this.row.Options.filter(function (x) { return x.ParentId === option.Id; }), 'this.row.Options.filter(x => x.ParentId === option.Id)');
2661
2663
  var p = new PermissionClass();
2662
- p.RelatedId = btn.row.Data.Id;
2664
+ p.RelatedId = _this.row.Data.Id;
2663
2665
  p.Area = _this.table.permissions.Area;
2664
2666
  p.Controller = _this.table.permissions.Controller;
2665
2667
  p.Action = option.Action;
@@ -2673,8 +2675,8 @@
2673
2675
  }
2674
2676
  if (opt.modal.form) {
2675
2677
  opt.modal.form.name = option.Name;
2676
- opt.modal.form.url = opt.modal.form.baseUrl + 'Update/' + btn.row.Data.Id;
2677
- opt.modal.form.loadData(opt.modal.form.baseUrl + 'Get/' + btn.row.Data.Id);
2678
+ opt.modal.form.url = opt.modal.form.baseUrl + 'Update/' + _this.row.Data.Id;
2679
+ opt.modal.form.loadData(opt.modal.form.baseUrl + 'Get/' + _this.row.Data.Id);
2678
2680
  opt.modal.form.onSuccessBase = function () {
2679
2681
  opt.modal.hide();
2680
2682
  };
@@ -2685,11 +2687,11 @@
2685
2687
  var r = _c.value;
2686
2688
  if (r.table) {
2687
2689
  var p = new PermissionClass();
2688
- p.RelatedId = btn.row.Data.Id;
2690
+ p.RelatedId = _this.row.Data.Id;
2689
2691
  p.Area = _this.table.permissions.Area;
2690
- p.Controller = _this.table.permissions.Controller;
2692
+ p.Controller = option.Controller;
2691
2693
  p.Action = r.name;
2692
- p.Accesses = option.Accesses;
2694
+ p.Accesses = _this.row.Options.filter(function (x) { return x.ParentId === option.Id; });
2693
2695
  r.table.permissions = p;
2694
2696
  if (r.table.form) {
2695
2697
  r.table.form.url = p.getUrl() + 'Insert';
@@ -2715,31 +2717,31 @@
2715
2717
  p.Area = this_1.table.permissions.Area;
2716
2718
  p.Controller = 'Print';
2717
2719
  p.Action = option.Action;
2718
- opt.url = '/Report' + p.getUrl() + '/{}';
2720
+ opt.url = '/Report' + p.getUrl() + '/' + this_1.row.Data.Id;
2719
2721
  opt.urlNewTab = true;
2720
2722
  }
2721
2723
  else if (option.InputAction === exports.PermissionInputActionEnum.File) {
2722
2724
  var p = new PermissionClass();
2723
2725
  p.RelatedId = this_1.table.permissions.RelatedId;
2724
2726
  p.Area = this_1.table.permissions.Area;
2725
- p.Controller = this_1.table.permissions.Controller;
2726
- p.Action = (this_1.table.permissions.Action ? this_1.table.permissions.Action : '') + option.Action;
2727
- opt.url = '/File' + p.getUrl() + '/{}';
2727
+ p.Controller = option.Controller;
2728
+ p.Action = option.Action;
2729
+ opt.url = '/File' + p.getUrl() + '/' + this_1.row.Data.Id;
2728
2730
  opt.urlNewTab = true;
2729
2731
  }
2730
2732
  else if (option.InputAction === exports.PermissionInputActionEnum.Confirm) {
2731
- opt.onClick = function (btn) {
2733
+ opt.onClick = function () {
2732
2734
  var p = new PermissionClass();
2733
2735
  p.RelatedId = _this.table.permissions.RelatedId;
2734
2736
  p.Area = _this.table.permissions.Area;
2735
- p.Controller = _this.table.permissions.Controller;
2737
+ p.Controller = option.Controller;
2736
2738
  p.Action = option.Action;
2737
- _this.table.showConfirm(_this.table.l(option.Action + 'Confirm'), p.getUrl() + '/' + btn.row.Data.Id, null, function () {
2739
+ _this.table.showConfirm(_this.table.l(option.Action + 'Confirm'), p.getUrl() + '/' + _this.row.Data.Id, null, function () {
2738
2740
  _this.table.load();
2739
2741
  });
2740
2742
  };
2741
2743
  }
2742
- else if (option.Type === exports.PermissionTypeEnum.Option) {
2744
+ else {
2743
2745
  if (option.OnClick) {
2744
2746
  opt.onClick = function (btn) {
2745
2747
  option.OnClick(btn);
@@ -7242,9 +7244,8 @@
7242
7244
  return "continue";
7243
7245
  }
7244
7246
  var accessInp = new InputClass(this_1.environment, this_1.l, access.Name, access.Icon, access.InputType === exports.PermissionInputTypeEnum.Button ? exports.InputType.Button : exports.InputType.Icon, 'blue w-u h-30');
7245
- if (access.Action === 'Insert') {
7247
+ if (access.AccessType === exports.PermissionAccessTypeEnum.Insert) {
7246
7248
  accessInp.class = accessInp.class.replace('blue', 'green');
7247
- console.log(this_1.form, '111111111111');
7248
7249
  if (this_1.form) {
7249
7250
  this_1.form.url = this_1.form.baseUrl = this_1.url + 'Insert';
7250
7251
  if (!this_1.form.onTop) {
@@ -7258,7 +7259,6 @@
7258
7259
  }
7259
7260
  else {
7260
7261
  this_1.form.displayLabel = false;
7261
- console.log(this_1.form, '222222222');
7262
7262
  return "continue";
7263
7263
  }
7264
7264
  }