@vipl520/dk-ui 1.0.57 → 1.0.58

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. package/dist/index.js +33 -16
  2. package/dist/index.min.js +3 -3
  3. package/dist/index.min.js.map +1 -1
  4. package/dist/index.min.mjs +4 -4
  5. package/dist/index.min.mjs.map +1 -1
  6. package/dist/index.mjs +33 -16
  7. package/dist/web-types.json +1 -1
  8. package/es/table/index.d.ts +15 -0
  9. package/es/table/src/props.d.ts +4 -0
  10. package/es/table/src/props.mjs +6 -0
  11. package/es/table/src/props.mjs.map +1 -1
  12. package/es/table/src/table.vue.d.ts +9 -0
  13. package/es/table/src/table.vue2.mjs +1 -1
  14. package/es/table/src/table.vue2.mjs.map +1 -1
  15. package/es/table/utils/dkTable.d.ts +1 -1
  16. package/es/table/utils/dkTable.mjs +2 -2
  17. package/es/table/utils/dkTable.mjs.map +1 -1
  18. package/es/table/utils/dkTableApi.d.ts +3 -1
  19. package/es/table/utils/dkTableApi.mjs +21 -12
  20. package/es/table/utils/dkTableApi.mjs.map +1 -1
  21. package/es/url-input/src/url-input-table.vue2.mjs +3 -1
  22. package/es/url-input/src/url-input-table.vue2.mjs.map +1 -1
  23. package/lib/table/index.d.ts +15 -0
  24. package/lib/table/src/props.d.ts +4 -0
  25. package/lib/table/src/props.js +6 -0
  26. package/lib/table/src/props.js.map +1 -1
  27. package/lib/table/src/table.vue.d.ts +9 -0
  28. package/lib/table/src/table.vue2.js +1 -1
  29. package/lib/table/src/table.vue2.js.map +1 -1
  30. package/lib/table/utils/dkTable.d.ts +1 -1
  31. package/lib/table/utils/dkTable.js +2 -2
  32. package/lib/table/utils/dkTable.js.map +1 -1
  33. package/lib/table/utils/dkTableApi.d.ts +3 -1
  34. package/lib/table/utils/dkTableApi.js +21 -12
  35. package/lib/table/utils/dkTableApi.js.map +1 -1
  36. package/lib/url-input/src/url-input-table.vue2.js +3 -1
  37. package/lib/url-input/src/url-input-table.vue2.js.map +1 -1
  38. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -15823,6 +15823,12 @@
15823
15823
  return [];
15824
15824
  },
15825
15825
  type: Array
15826
+ },
15827
+ query: {
15828
+ default: () => {
15829
+ return {};
15830
+ },
15831
+ type: Object
15826
15832
  }
15827
15833
  };
15828
15834
 
@@ -18851,31 +18857,40 @@
18851
18857
  actionUrl;
18852
18858
  requestConfig = {};
18853
18859
  // 新增:用于存储配置的request参数
18854
- constructor(controllerUrl) {
18860
+ constructor(controllerUrl, query) {
18861
+ const qStr = this.objectToQuery(query);
18862
+ console.log("queryStr", qStr);
18855
18863
  if (!controllerUrl.endsWith("/")) {
18856
18864
  controllerUrl += "/";
18857
18865
  }
18858
18866
  this.controllerUrl = controllerUrl;
18859
18867
  this.actionUrl = /* @__PURE__ */ new Map([
18860
- ["index", controllerUrl + "index"],
18861
- ["add", controllerUrl + "add"],
18862
- ["edit", controllerUrl + "edit"],
18863
- ["del", controllerUrl + "del"],
18864
- ["sortable", controllerUrl + "sortable"],
18865
- ["table", controllerUrl + "table"],
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)],
18866
18874
  // 获取表格数据
18867
- ["form", controllerUrl + "form"],
18875
+ ["form", this.buildFullUrl(controllerUrl + "form", qStr)],
18868
18876
  // 获取表单
18869
- ["recycle", controllerUrl + "recycle"],
18877
+ ["recycle", this.buildFullUrl(controllerUrl + "recycle", qStr)],
18870
18878
  // 回收站
18871
- ["recycleTable", controllerUrl + "recycleTable"],
18879
+ ["recycleTable", this.buildFullUrl(controllerUrl + "recycleTable", qStr)],
18872
18880
  // 回收站表格
18873
- ["destroy", controllerUrl + "destroy"],
18881
+ ["destroy", this.buildFullUrl(controllerUrl + "destroy", qStr)],
18874
18882
  // 回收站销毁
18875
- ["restore", controllerUrl + "restore"]
18883
+ ["restore", this.buildFullUrl(controllerUrl + "restore", qStr)]
18876
18884
  // 回收站还原
18877
18885
  ]);
18878
18886
  }
18887
+ // 新增方法用于构建完整的URL
18888
+ buildFullUrl(baseUrl, queryStr) {
18889
+ return queryStr ? `${baseUrl}?${queryStr}` : baseUrl;
18890
+ }
18891
+ objectToQuery(obj) {
18892
+ return Object.keys(obj).map((key) => encodeURIComponent(key) + "=" + encodeURIComponent(obj[key])).join("&");
18893
+ }
18879
18894
  /**
18880
18895
  * 配置request参数
18881
18896
  * @param config 包含HTTP方法、请求头等额外参数的对象
@@ -19139,9 +19154,9 @@
19139
19154
  form: {},
19140
19155
  fieldData: /* @__PURE__ */ new Map()
19141
19156
  });
19142
- constructor(url, before = {}, after = {}) {
19157
+ constructor(url, before = {}, after = {}, query) {
19143
19158
  this.url = url;
19144
- this.api = new dkTableApi(url);
19159
+ this.api = new dkTableApi(url, query);
19145
19160
  this.before = before;
19146
19161
  this.after = after;
19147
19162
  this.buttonCallback = (event, data) => {
@@ -23491,7 +23506,7 @@
23491
23506
  const props = __props;
23492
23507
  const FormRef = vue.ref();
23493
23508
  const TableRef = vue.ref();
23494
- const DkTable = new dkTable(props.tableApi, props.tableBefore, props.tableAfter);
23509
+ const DkTable = new dkTable(props.tableApi, props.tableBefore, props.tableAfter, props.query);
23495
23510
  vue.provide("DkTable", DkTable);
23496
23511
  vue.onMounted(() => {
23497
23512
  DkTable.getTable(props.cacheTable)?.then(() => {
@@ -27094,7 +27109,9 @@
27094
27109
  ref: DkTableRef,
27095
27110
  "table-api": __props.item.tableUrl,
27096
27111
  "cache-table": __props.item.cacheTable,
27097
- height: "300px"
27112
+ height: "300px",
27113
+ query: { _form: "url_input" },
27114
+ buttons: ["refresh", "add", "export_csv", "edit", "delete", "comSearch", "quickSearch", "columnDisplay"]
27098
27115
  }, {
27099
27116
  cate_id_slot: vue.withCtx(({ row }) => [
27100
27117
  vue.createTextVNode(