ps-toolkit-ui 1.9.63 → 1.9.64

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.
@@ -8110,11 +8110,14 @@
8110
8110
  }
8111
8111
  return this.searchForm ? this.searchForm.json(d) : d;
8112
8112
  };
8113
+ TableClass.prototype.getUrl = function (url) {
8114
+ return this.permissions.RelatedId ? url.replace('{}', this.permissions.RelatedId) : url.replace('/{}', '');
8115
+ };
8113
8116
  TableClass.prototype.showInsertModal = function (cId) {
8114
8117
  if (cId === void 0) { cId = null; }
8115
8118
  var insertAccess = this.permissions.getAccess(exports.PermissionAccessTypeEnum.Insert);
8116
8119
  this.form.isEdit = false;
8117
- this.form.url = this.form.baseUrl = insertAccess.Url.replace('{}', this.permissions.RelatedId) + (cId ? '/' + cId : '');
8120
+ this.form.url = this.form.baseUrl = this.getUrl(insertAccess.Url) + (cId ? '/' + cId : '');
8118
8121
  this.form.name = insertAccess.Name;
8119
8122
  this.form.method = exports.Method.Post;
8120
8123
  this.form.inputs.filter(function (x) { return x.inEditDisabled; }).forEach(function (x) { return x.disabled = false; });
@@ -8131,12 +8134,7 @@
8131
8134
  var listAccess = this.permissions.getAccess(exports.PermissionAccessTypeEnum.List);
8132
8135
  if (listAccess !== null) {
8133
8136
  this.title = listAccess.Name;
8134
- if (this.permissions.RelatedId) {
8135
- this.url = listAccess.Url.replace('{}', this.permissions.RelatedId);
8136
- }
8137
- else {
8138
- this.url = listAccess.Url.replace('/{}', '');
8139
- }
8137
+ this.url = this.getUrl(listAccess.Url);
8140
8138
  if (this.permissions.Type !== exports.PermissionTypeEnum.Form) {
8141
8139
  this.load();
8142
8140
  }
@@ -8160,7 +8158,7 @@
8160
8158
  if (access.AccessType === exports.PermissionAccessTypeEnum.Insert) {
8161
8159
  accessInp.class = accessInp.class.replace('blue', 'green');
8162
8160
  if (this_1.form) {
8163
- this_1.form.url = this_1.form.baseUrl = access.Url.replace('{}', this_1.permissions.RelatedId);
8161
+ this_1.form.url = this_1.form.baseUrl = this_1.getUrl(access.Url);
8164
8162
  if (!this_1.form.onTop) {
8165
8163
  accessInp.onClick = function () {
8166
8164
  _this.form.onSuccessBase = function () {
@@ -8193,7 +8191,7 @@
8193
8191
  p.Controller = 'print';
8194
8192
  p.Action = _this.permissions.Controller + (_this.permissions.Action ? _this.permissions.Action : '');
8195
8193
  var params = $$1.param(_this.searchData(true));
8196
- window.open('/report' + access.Url.replace('{}', _this.permissions.RelatedId) + (params ? '?' + params : ''), '_blank');
8194
+ window.open('/report' + _this.getUrl(access.Url) + (params ? '?' + params : ''), '_blank');
8197
8195
  };
8198
8196
  }
8199
8197
  else if (access.InputAction === exports.PermissionInputActionEnum.OnClick) {