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.
@@ -1969,7 +1969,7 @@ class TableRowComponent {
1969
1969
  this.setOptions();
1970
1970
  }
1971
1971
  loadChildren(p) {
1972
- new RequestClass(this.table.environment, this.table.l).send(this.table.url + `List/${p}`, Method.Post, null, this.showChildren, (result) => {
1972
+ new RequestClass(this.table.environment, this.table.l).send(this.table.url + `/${p}`, Method.Post, null, this.showChildren, (result) => {
1973
1973
  this.children = result.List;
1974
1974
  setTimeout(() => {
1975
1975
  $$1(this.childrenDiv.nativeElement).slideDown();
@@ -1997,7 +1997,7 @@ class TableRowComponent {
1997
1997
  const data = [];
1998
1998
  // @ts-ignore
1999
1999
  $$1(this.childrenDiv.nativeElement).sortable('toArray').forEach(x => data.push(x));
2000
- new RequestClass(this.table.l).send(this.table.url + 'Sort', Method.Post, data, null, () => {
2000
+ new RequestClass(this.table.l).send(this.table.url + '/Sort', Method.Post, data, null, () => {
2001
2001
  if (this.table.onSort) {
2002
2002
  this.table.onSort();
2003
2003
  }
@@ -2015,12 +2015,7 @@ class TableRowComponent {
2015
2015
  inp.tooltip = option.Name;
2016
2016
  inp.onChange = () => {
2017
2017
  this.row.Data[option.Action] = !inp.data();
2018
- const p = new PermissionClass();
2019
- p.RelatedId = this.table.permissions.RelatedId;
2020
- p.Area = this.table.permissions.Area;
2021
- p.Controller = option.Controller;
2022
- p.Action = option.Action;
2023
- new RequestClass(this.table.environment, this.table.l).send(p.getUrl() + '/' + this.row.Data.Id, Method.Post, null, null, () => {
2018
+ new RequestClass(this.table.environment, this.table.l).send(option.url + '/' + this.row.Data.Id, Method.Post, null, null, () => {
2024
2019
  });
2025
2020
  };
2026
2021
  inp.displayLabel = false;
@@ -2035,7 +2030,7 @@ class TableRowComponent {
2035
2030
  if (option.AccessType === PermissionAccessTypeEnum.Update) {
2036
2031
  if (this.table.form) {
2037
2032
  opt.onClick = () => {
2038
- this.table.form.url = this.table.url + 'update/' + this.row.Data.Id;
2033
+ this.table.form.url = option.Url + '/' + this.row.Data.Id;
2039
2034
  if (this.table.hasChildren && this.row.Data.ParentId != null) {
2040
2035
  this.table.form.onSuccessBase = () => {
2041
2036
  this.table.modal.hide();
@@ -2056,11 +2051,11 @@ class TableRowComponent {
2056
2051
  this.table.load();
2057
2052
  };
2058
2053
  }
2059
- this.edit(opt);
2054
+ this.edit(opt, option);
2060
2055
  };
2061
2056
  }
2062
2057
  else {
2063
- opt.url = this.table.url + '/update/' + this.row.Data.Id;
2058
+ opt.url = option.Url + '/' + this.row.Data.Id;
2064
2059
  }
2065
2060
  }
2066
2061
  else if (option.AccessType === PermissionAccessTypeEnum.Delete) {
@@ -2074,7 +2069,7 @@ class TableRowComponent {
2074
2069
  this.changeRows.emit(this.row.Data);
2075
2070
  }
2076
2071
  else {
2077
- this.confirmShow.emit({ id: this.row.Data.Id, accept: () => {
2072
+ this.confirmShow.emit({ url: option.Url.replace('{}', this.row.Data.Id), accept: () => {
2078
2073
  if (this.table.hasChildren && this.table.childrenAutoLoad && this.row.Data.ParentId != null) {
2079
2074
  this.loadParent.emit(this.row.Data.ParentId);
2080
2075
  }
@@ -2086,20 +2081,12 @@ class TableRowComponent {
2086
2081
  };
2087
2082
  }
2088
2083
  else if (option.AccessType === PermissionAccessTypeEnum.Report) {
2089
- const p = new PermissionClass();
2090
- p.Area = this.table.permissions.Area;
2091
- p.Controller = 'Print';
2092
- p.Action = option.Controller;
2093
- opt.url = '/Report' + p.getUrl() + '/' + this.row.Data.Id;
2084
+ opt.url = '/Report' + option.Url + '/' + this.row.Data.Id;
2094
2085
  opt.urlNewTab = true;
2095
2086
  }
2096
2087
  else if (option.InputAction === PermissionInputActionEnum.Link || option.InputAction === PermissionInputActionEnum.LinkNewTab) {
2097
2088
  const p = new PermissionClass();
2098
- p.RelatedId = this.table.permissions.RelatedId;
2099
- p.Area = this.table.permissions.Area;
2100
- p.Controller = option.Controller;
2101
- p.Action = option.Action;
2102
- opt.url = p.getUrl() + '/' + this.row.Data.Id;
2089
+ opt.url = option.Url + '/' + this.row.Data.Id;
2103
2090
  opt.urlNewTab = option.InputAction === PermissionInputActionEnum.LinkNewTab;
2104
2091
  }
2105
2092
  else if (option.InputAction === PermissionInputActionEnum.Modal) {
@@ -2114,15 +2101,15 @@ class TableRowComponent {
2114
2101
  p.Accesses = this.row.Options.filter(x => x.ParentId === option.Id);
2115
2102
  opt.modal.table.permissions = p;
2116
2103
  if (opt.modal.table.form) {
2117
- opt.modal.table.form.url = p.getUrl() + 'insert';
2118
- opt.modal.table.form.baseUrl = p.getUrl() + 'insert';
2104
+ opt.modal.table.form.url = option.Url + 'insert';
2105
+ opt.modal.table.form.baseUrl = option.Url + 'insert';
2119
2106
  }
2120
2107
  opt.modal.table.set();
2121
2108
  }
2122
2109
  if (opt.modal.form) {
2123
2110
  opt.modal.form.name = option.Name;
2124
- opt.modal.form.url = opt.modal.form.baseUrl + 'update/' + this.row.Data.Id;
2125
- opt.modal.form.loadData(opt.modal.form.baseUrl + 'get/' + this.row.Data.Id);
2111
+ opt.modal.form.url = option.Url + 'update/' + this.row.Data.Id;
2112
+ opt.modal.form.loadData(option.Url + 'get/' + this.row.Data.Id);
2126
2113
  opt.modal.form.onSuccessBase = () => {
2127
2114
  opt.modal.hide();
2128
2115
  };
@@ -2138,8 +2125,8 @@ class TableRowComponent {
2138
2125
  p.Accesses = this.row.Options.filter(x => x.ParentId === option.Id);
2139
2126
  r.table.permissions = p;
2140
2127
  if (r.table.form) {
2141
- r.table.form.url = p.getUrl() + 'insert';
2142
- r.table.form.baseUrl = p.getUrl() + 'insert';
2128
+ r.table.form.url = option.Url + 'insert';
2129
+ r.table.form.baseUrl = option.Url + 'insert';
2143
2130
  }
2144
2131
  r.table.set();
2145
2132
  }
@@ -2153,7 +2140,7 @@ class TableRowComponent {
2153
2140
  p.Area = this.table.permissions.Area;
2154
2141
  p.Controller = option.Controller;
2155
2142
  p.Action = option.Action;
2156
- opt.url = '/File' + p.getUrl() + '/' + this.row.Data.Id;
2143
+ opt.url = '/File' + option.Url + '/' + this.row.Data.Id;
2157
2144
  opt.urlNewTab = true;
2158
2145
  }
2159
2146
  else if (option.InputAction === PermissionInputActionEnum.Confirm) {
@@ -2163,7 +2150,7 @@ class TableRowComponent {
2163
2150
  p.Area = this.table.permissions.Area;
2164
2151
  p.Controller = option.Controller;
2165
2152
  p.Action = option.Action;
2166
- this.table.showConfirm(this.table.l(option.Action + 'Confirm'), p.getUrl() + '/' + this.row.Data.Id, null, () => {
2153
+ this.table.showConfirm(this.table.l(option.Action + 'Confirm'), option.Url + '/' + this.row.Data.Id, null, () => {
2167
2154
  this.table.load();
2168
2155
  });
2169
2156
  };
@@ -2264,7 +2251,7 @@ class TableRowComponent {
2264
2251
  });
2265
2252
  return c;
2266
2253
  }
2267
- edit(opt) {
2254
+ edit(opt, option) {
2268
2255
  if (this.table.permissions.Type === PermissionTypeEnum.Form) {
2269
2256
  this.table.form.name = opt.name;
2270
2257
  this.table.form.setData(this.row.Data);
@@ -2273,7 +2260,7 @@ class TableRowComponent {
2273
2260
  this.table.form.inputs.filter(x => !x.inEditVisible).forEach(x => x.visible = false);
2274
2261
  }
2275
2262
  else {
2276
- new RequestClass(this.table.environment, this.table.l).send(this.table.url + 'Get/' + this.row.Data.Id, Method.Post, null, opt, (result) => {
2263
+ new RequestClass(this.table.environment, this.table.l).send(option.Url.replace('update', 'get').replace('{}', this.row.Data.Id), Method.Post, null, opt, (result) => {
2277
2264
  this.table.form.name = opt.name;
2278
2265
  this.table.form.setButtons(this.table.form.onTop, true, this.row.Data.Id);
2279
2266
  this.table.form.setData(result);
@@ -2497,7 +2484,7 @@ class TableComponent {
2497
2484
  return this.changeRows.emit(e);
2498
2485
  }
2499
2486
  onConfirmShow(e) {
2500
- this.confirm.show(this.table.l('DeleteConfirm'), this.table.url + 'Delete/' + e.id, null, e.accept);
2487
+ this.confirm.show(this.table.l('DeleteConfirm'), e.url, null, e.accept);
2501
2488
  }
2502
2489
  changeSort(e, s) {
2503
2490
  if ($$1(e.target).closest('.header-search').hasClass('header-search')) {