@vipl520/dk-ui 1.0.58 → 1.0.60

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.js CHANGED
@@ -973,6 +973,10 @@
973
973
  title: {
974
974
  default: "",
975
975
  type: String
976
+ },
977
+ accordion: {
978
+ type: Boolean,
979
+ default: true
976
980
  }
977
981
  };
978
982
 
@@ -997,7 +1001,8 @@
997
1001
  loading: true
998
1002
  });
999
1003
  const collapseComponentData = vue.reactive({
1000
- modelValue: [0]
1004
+ modelValue: [0],
1005
+ accordion: props.accordion
1001
1006
  });
1002
1007
  const Type = data.form;
1003
1008
  vue.watch(
@@ -18855,34 +18860,49 @@
18855
18860
  class dkTableApi {
18856
18861
  controllerUrl;
18857
18862
  actionUrl;
18863
+ query;
18858
18864
  requestConfig = {};
18859
18865
  // 新增:用于存储配置的request参数
18860
18866
  constructor(controllerUrl, query) {
18861
- const qStr = this.objectToQuery(query);
18862
- 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;
18863
18874
  if (!controllerUrl.endsWith("/")) {
18864
18875
  controllerUrl += "/";
18865
18876
  }
18866
18877
  this.controllerUrl = controllerUrl;
18867
- this.actionUrl = /* @__PURE__ */ new Map([
18868
- ["index", this.buildFullUrl(controllerUrl + "index", qStr)],
18869
- ["add", this.buildFullUrl(controllerUrl + "add", qStr)],
18870
- ["edit", this.buildFullUrl(controllerUrl + "edit", qStr)],
18871
- ["del", this.buildFullUrl(controllerUrl + "del", qStr)],
18872
- ["sortable", this.buildFullUrl(controllerUrl + "sortable", qStr)],
18873
- ["table", this.buildFullUrl(controllerUrl + "table", qStr)],
18874
- // 获取表格数据
18875
- ["form", this.buildFullUrl(controllerUrl + "form", qStr)],
18876
- // 获取表单
18877
- ["recycle", this.buildFullUrl(controllerUrl + "recycle", qStr)],
18878
- // 回收站
18879
- ["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",
18880
18896
  // 回收站表格
18881
- ["destroy", this.buildFullUrl(controllerUrl + "destroy", qStr)],
18897
+ "destroy",
18882
18898
  // 回收站销毁
18883
- ["restore", this.buildFullUrl(controllerUrl + "restore", qStr)]
18899
+ "restore"
18884
18900
  // 回收站还原
18885
- ]);
18901
+ ];
18902
+ this.actionUrl = /* @__PURE__ */ new Map();
18903
+ for (const action of actions) {
18904
+ this.actionUrl.set(action, this.buildFullUrl(`${controllerUrl}${action}`, qStr));
18905
+ }
18886
18906
  }
18887
18907
  // 新增方法用于构建完整的URL
18888
18908
  buildFullUrl(baseUrl, queryStr) {