ps-toolkit-ui 1.4.10 → 1.4.13

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.
@@ -931,7 +931,7 @@ class RequestClass {
931
931
  }
932
932
  btn.loading = true;
933
933
  }
934
- this.getClient(table.getUrl(), table.method, table.searchData(), (res) => {
934
+ this.getClient(table.url, table.method, table.searchData(), (res) => {
935
935
  if (res.status === ResultStatusEnum.Success) {
936
936
  table.rows = res.result.List;
937
937
  table.count = res.result.Count;
@@ -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();
@@ -2060,7 +2055,7 @@ class TableRowComponent {
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
  };
@@ -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')) {
@@ -6485,12 +6472,9 @@ class TableClass {
6485
6472
  }
6486
6473
  return this.searchForm ? this.searchForm.json(d) : d;
6487
6474
  }
6488
- getUrl() {
6489
- return this.url + 'list';
6490
- }
6491
6475
  showInsertModal(cId = null) {
6492
6476
  const insertAccess = this.permissions.getAccess(PermissionAccessTypeEnum.Insert);
6493
- this.form.url = this.form.baseUrl = this.url + 'insert' + (cId ? '/' + cId : '');
6477
+ this.form.url = this.form.baseUrl = insertAccess.Url + (cId ? '/' + cId : '');
6494
6478
  this.form.name = insertAccess.Name;
6495
6479
  this.form.method = Method.Post;
6496
6480
  this.form.inputs.filter(x => x.inEditDisabled).forEach(x => x.disabled = false);
@@ -6501,10 +6485,9 @@ class TableClass {
6501
6485
  this.permission = true;
6502
6486
  if (this.permissions) {
6503
6487
  const listAccess = this.permissions.getAccess(PermissionAccessTypeEnum.List);
6504
- console.log(listAccess);
6505
6488
  if (listAccess !== null) {
6506
6489
  this.title = listAccess.Name;
6507
- this.url = this.permissions.getUrl();
6490
+ this.url = listAccess.Url;
6508
6491
  if (this.permissions.Type !== PermissionTypeEnum.Form) {
6509
6492
  this.load();
6510
6493
  }
@@ -6525,7 +6508,7 @@ class TableClass {
6525
6508
  if (access.AccessType === PermissionAccessTypeEnum.Insert) {
6526
6509
  accessInp.class = accessInp.class.replace('blue', 'green');
6527
6510
  if (this.form) {
6528
- this.form.url = this.form.baseUrl = this.url + 'insert';
6511
+ this.form.url = this.form.baseUrl = access.Url;
6529
6512
  if (!this.form.onTop) {
6530
6513
  accessInp.onClick = () => {
6531
6514
  this.form.onSuccessBase = () => {
@@ -6547,7 +6530,7 @@ class TableClass {
6547
6530
  };
6548
6531
  }
6549
6532
  else {
6550
- accessInp.url = this.url + 'insert';
6533
+ accessInp.url = access.Url;
6551
6534
  }
6552
6535
  }
6553
6536
  }