@vipl520/dk-ui 1.0.59 → 1.0.60

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.
package/dist/index.js CHANGED
@@ -18860,34 +18860,49 @@
18860
18860
  class dkTableApi {
18861
18861
  controllerUrl;
18862
18862
  actionUrl;
18863
+ query;
18863
18864
  requestConfig = {};
18864
18865
  // 新增:用于存储配置的request参数
18865
18866
  constructor(controllerUrl, query) {
18866
- const qStr = this.objectToQuery(query);
18867
- console.log("queryStr", qStr);
18867
+ let qStr = this.objectToQuery(query);
18868
+ if (controllerUrl.indexOf("?") > 0) {
18869
+ const path = controllerUrl.split("?");
18870
+ controllerUrl = path[0];
18871
+ qStr = qStr + "&" + path[1];
18872
+ }
18873
+ this.query = qStr;
18868
18874
  if (!controllerUrl.endsWith("/")) {
18869
18875
  controllerUrl += "/";
18870
18876
  }
18871
18877
  this.controllerUrl = controllerUrl;
18872
- this.actionUrl = /* @__PURE__ */ new Map([
18873
- ["index", this.buildFullUrl(controllerUrl + "index", qStr)],
18874
- ["add", this.buildFullUrl(controllerUrl + "add", qStr)],
18875
- ["edit", this.buildFullUrl(controllerUrl + "edit", qStr)],
18876
- ["del", this.buildFullUrl(controllerUrl + "del", qStr)],
18877
- ["sortable", this.buildFullUrl(controllerUrl + "sortable", qStr)],
18878
- ["table", this.buildFullUrl(controllerUrl + "table", qStr)],
18879
- // 获取表格数据
18880
- ["form", this.buildFullUrl(controllerUrl + "form", qStr)],
18881
- // 获取表单
18882
- ["recycle", this.buildFullUrl(controllerUrl + "recycle", qStr)],
18883
- // 回收站
18884
- ["recycleTable", this.buildFullUrl(controllerUrl + "recycleTable", qStr)],
18878
+ const actions = [
18879
+ "index",
18880
+ // 列表
18881
+ "add",
18882
+ // 新增
18883
+ "edit",
18884
+ // 编辑
18885
+ "del",
18886
+ // 删除
18887
+ "sortable",
18888
+ // 排序
18889
+ "table",
18890
+ // 表格数据
18891
+ "form",
18892
+ // 表单
18893
+ "recycle",
18894
+ // 回收站数据
18895
+ "recycleTable",
18885
18896
  // 回收站表格
18886
- ["destroy", this.buildFullUrl(controllerUrl + "destroy", qStr)],
18897
+ "destroy",
18887
18898
  // 回收站销毁
18888
- ["restore", this.buildFullUrl(controllerUrl + "restore", qStr)]
18899
+ "restore"
18889
18900
  // 回收站还原
18890
- ]);
18901
+ ];
18902
+ this.actionUrl = /* @__PURE__ */ new Map();
18903
+ for (const action of actions) {
18904
+ this.actionUrl.set(action, this.buildFullUrl(`${controllerUrl}${action}`, qStr));
18905
+ }
18891
18906
  }
18892
18907
  // 新增方法用于构建完整的URL
18893
18908
  buildFullUrl(baseUrl, queryStr) {