jky-component-lib 0.0.98 → 0.0.100

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.
Files changed (65) hide show
  1. package/dist/es/add-input/style.css +1 -1
  2. package/dist/es/amap/ATrackPlayback.vue.d.ts +69 -0
  3. package/dist/es/amap/ATrackPlayback.vue.js +237 -0
  4. package/dist/es/amap/ATrackPlayback.vue3.js +5 -0
  5. package/dist/es/amap/index.d.ts +3 -1
  6. package/dist/es/amap/index.js +5 -0
  7. package/dist/es/amap/style.css +5 -12
  8. package/dist/es/amap/style2.css +12 -5
  9. package/dist/es/amap/style3.css +3 -0
  10. package/dist/es/components.js +5 -1
  11. package/dist/es/form/Form.vue.d.ts +5 -103
  12. package/dist/es/form/Form.vue.js +91 -156
  13. package/dist/es/form/FormItem.vue.js +3 -1
  14. package/dist/es/form/SelectTable.vue.js +14 -5
  15. package/dist/es/form/style.css +1 -21
  16. package/dist/es/index.js +8 -2
  17. package/dist/es/package.json.js +1 -1
  18. package/dist/es/page-table/ActionColumn.vue.d.ts +11 -0
  19. package/dist/es/page-table/ActionColumn.vue.js +137 -0
  20. package/dist/es/page-table/ActionColumn.vue3.js +5 -0
  21. package/dist/es/page-table/PageTable.vue.d.ts +51 -433
  22. package/dist/es/page-table/PageTable.vue.js +136 -76
  23. package/dist/es/page-table/PageTableColumn.vue.d.ts +36 -0
  24. package/dist/es/page-table/PageTableColumn.vue.js +121 -0
  25. package/dist/es/page-table/PageTableColumn.vue3.js +5 -0
  26. package/dist/es/page-table/Toolbar.vue.d.ts +1 -1
  27. package/dist/es/page-table/Toolbar.vue.js +2 -2
  28. package/dist/es/page-table/index.d.ts +5 -1
  29. package/dist/es/page-table/index.js +8 -0
  30. package/dist/es/page-table/style.css +9 -0
  31. package/dist/es/style.css +144 -0
  32. package/dist/es/styles.css +1 -1
  33. package/dist/lib/add-input/style.css +1 -1
  34. package/dist/lib/amap/ATrackPlayback.vue.d.ts +69 -0
  35. package/dist/lib/amap/ATrackPlayback.vue.js +237 -0
  36. package/dist/lib/amap/ATrackPlayback.vue3.js +5 -0
  37. package/dist/lib/amap/index.d.ts +3 -1
  38. package/dist/lib/amap/index.js +5 -0
  39. package/dist/lib/amap/style.css +5 -12
  40. package/dist/lib/amap/style2.css +12 -5
  41. package/dist/lib/amap/style3.css +3 -0
  42. package/dist/lib/components.js +33 -30
  43. package/dist/lib/form/Form.vue.d.ts +5 -103
  44. package/dist/lib/form/Form.vue.js +89 -154
  45. package/dist/lib/form/FormItem.vue.js +3 -1
  46. package/dist/lib/form/SelectTable.vue.js +13 -4
  47. package/dist/lib/form/style.css +1 -21
  48. package/dist/lib/index.js +26 -20
  49. package/dist/lib/package.json.js +1 -1
  50. package/dist/lib/page-table/ActionColumn.vue.d.ts +11 -0
  51. package/dist/lib/page-table/ActionColumn.vue.js +137 -0
  52. package/dist/lib/page-table/ActionColumn.vue3.js +5 -0
  53. package/dist/lib/page-table/PageTable.vue.d.ts +51 -433
  54. package/dist/lib/page-table/PageTable.vue.js +135 -75
  55. package/dist/lib/page-table/PageTableColumn.vue.d.ts +36 -0
  56. package/dist/lib/page-table/PageTableColumn.vue.js +121 -0
  57. package/dist/lib/page-table/PageTableColumn.vue3.js +5 -0
  58. package/dist/lib/page-table/Toolbar.vue.d.ts +1 -1
  59. package/dist/lib/page-table/Toolbar.vue.js +2 -2
  60. package/dist/lib/page-table/index.d.ts +5 -1
  61. package/dist/lib/page-table/index.js +8 -0
  62. package/dist/lib/page-table/style.css +9 -0
  63. package/dist/lib/style.css +144 -0
  64. package/dist/lib/styles.css +1 -1
  65. package/package.json +1 -1
@@ -37,10 +37,14 @@ var __async = (__this, __arguments, generator) => {
37
37
  step((generator = generator.apply(__this, __arguments)).next());
38
38
  });
39
39
  };
40
- import { defineComponent, ref, watch, useModel, computed, onMounted, resolveDirective, openBlock, createElementBlock, normalizeClass, createBlock, unref, withCtx, createVNode, mergeProps, createCommentVNode, resolveDynamicComponent, withDirectives, Fragment, renderList, renderSlot, createTextVNode, toDisplayString, normalizeStyle, mergeModels } from "vue";
40
+ import { defineComponent, useModel, computed, ref, watch, onMounted, resolveDirective, openBlock, createElementBlock, normalizeClass, createBlock, unref, withCtx, createVNode, mergeProps, createCommentVNode, resolveDynamicComponent, withDirectives, Fragment, renderList, renderSlot, normalizeStyle, mergeModels, nextTick } from "vue";
41
41
  import { useFullscreen } from "@vueuse/core";
42
42
  import { ElCard, ElTable, ElTableColumn, ElScrollbar, ElPagination } from "element-plus";
43
43
  import { JkyForm } from "../form/index.js";
44
+ import _sfc_main$3 from "./ActionColumn.vue.js";
45
+ /* empty css */
46
+ import _sfc_main$2 from "./PageTableColumn.vue.js";
47
+ /* empty css */
44
48
  import _sfc_main$1 from "./Toolbar.vue.js";
45
49
  /* empty css */
46
50
  const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, {
@@ -58,6 +62,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
58
62
  searchText: { default: "查询" },
59
63
  resetText: { default: "重置" },
60
64
  selection: { type: Boolean, default: false },
65
+ selectionColumn: { default: () => ({}) },
66
+ selectable: {},
61
67
  selectedRows: { default: () => [] },
62
68
  pagination: {},
63
69
  border: { type: Boolean, default: true },
@@ -72,22 +78,43 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
72
78
  paginationProps: { default: () => ({}) },
73
79
  toolbarButtonLimit: { default: 0 },
74
80
  toolbarButtons: {},
75
- autoSearchDelay: { default: 500 }
81
+ autoSearchDelay: { default: 500 },
82
+ actionColumn: { type: [Object, Boolean] }
76
83
  }, {
77
- "pagination": {
78
- default: () => ({
79
- position: "flex-end",
80
- currentPage: 1,
81
- pageSize: 10,
82
- total: 0
83
- })
84
- },
85
- "paginationModifiers": {}
84
+ "pageNo": { default: 1 },
85
+ "pageNoModifiers": {},
86
+ "pageSize": { default: 10 },
87
+ "pageSizeModifiers": {},
88
+ "total": { default: 0 },
89
+ "totalModifiers": {}
86
90
  }),
87
- emits: /* @__PURE__ */ mergeModels(["search", "reset", "refresh", "update:form", "rowClick", "rowDblclick", "selectionChange", "pageChange", "sortChange"], ["update:pagination"]),
91
+ emits: /* @__PURE__ */ mergeModels(["search", "reset", "refresh", "update:form", "rowClick", "rowDblclick", "selectionChange", "pageChange", "sortChange"], ["update:pageNo", "update:pageSize", "update:total"]),
88
92
  setup(__props, { expose: __expose, emit: __emit }) {
89
93
  const props = __props;
90
94
  const emit = __emit;
95
+ const defaults = {
96
+ pageNo: 1,
97
+ pageSize: 10,
98
+ total: 0
99
+ };
100
+ const pageNoModel = useModel(__props, "pageNo");
101
+ const pageSizeModel = useModel(__props, "pageSize");
102
+ const totalModel = useModel(__props, "total");
103
+ const pagination = computed({
104
+ get: () => __spreadValues({
105
+ pageNo: pageNoModel.value,
106
+ pageSize: pageSizeModel.value,
107
+ total: totalModel.value
108
+ }, props.pagination),
109
+ set: (newValue) => {
110
+ if (newValue.pageNo !== void 0)
111
+ pageNoModel.value = newValue.pageNo;
112
+ if (newValue.pageSize !== void 0)
113
+ pageSizeModel.value = newValue.pageSize;
114
+ if (newValue.total !== void 0)
115
+ totalModel.value = newValue.total;
116
+ }
117
+ });
91
118
  const form = ref(props.form || {});
92
119
  watch(() => props.form, (newVal) => {
93
120
  if (newVal) {
@@ -101,7 +128,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
101
128
  },
102
129
  { deep: true }
103
130
  );
104
- const pagination = useModel(__props, "pagination");
105
131
  const internalData = ref([]);
106
132
  const tableRef = ref(null);
107
133
  const formRef = ref(null);
@@ -145,27 +171,46 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
145
171
  var _a, _b;
146
172
  return !!((_a = props.dataSource) == null ? void 0 : _a.api) || (((_b = pagination.value) == null ? void 0 : _b.total) || 0) > 0;
147
173
  });
148
- function getColumnProps(column) {
149
- return __spreadValues({}, column);
174
+ const _showActionColumn = computed(() => {
175
+ if (props.actionColumn === false)
176
+ return false;
177
+ if (!props.actionColumn)
178
+ return true;
179
+ const config = props.actionColumn;
180
+ return config.show !== false;
181
+ });
182
+ const _actionColumnConfig = computed(() => {
183
+ if (props.actionColumn === false)
184
+ return void 0;
185
+ if (!props.actionColumn)
186
+ return void 0;
187
+ return props.actionColumn;
188
+ });
189
+ function _handleActionColumnClick(_button, _row, _index) {
150
190
  }
151
191
  function buildApiParams() {
152
- var _a, _b;
192
+ var _a, _b, _c, _d;
193
+ const pageNo = (_a = pageNoModel.value) != null ? _a : defaults.pageNo;
194
+ const pageSize = pageSizeModel.value || defaults.pageSize;
195
+ const responseProps = ((_b = props.dataSource) == null ? void 0 : _b.responseProps) || {};
196
+ const pageNoField = responseProps.pageNoField || "pageNo";
197
+ const pageSizeField = responseProps.pageSizeField || "pageSize";
153
198
  const baseParams = {
154
- currentPage: pagination.value.currentPage || 1,
155
- pageSize: pagination.value.pageSize || 10
199
+ [pageNoField]: pageNo,
200
+ [pageSizeField]: pageSize
156
201
  };
157
- if ((_a = props.dataSource) == null ? void 0 : _a.getApiParams) {
202
+ if ((_c = props.dataSource) == null ? void 0 : _c.getApiParams) {
158
203
  const dynamicParams = props.dataSource.getApiParams(form.value);
159
204
  return __spreadValues(__spreadValues(__spreadValues({}, baseParams), form.value), dynamicParams);
160
205
  }
161
- if ((_b = props.dataSource) == null ? void 0 : _b.apiParams) {
206
+ if ((_d = props.dataSource) == null ? void 0 : _d.apiParams) {
162
207
  return __spreadValues(__spreadValues(__spreadValues({}, baseParams), form.value), props.dataSource.apiParams);
163
208
  }
164
209
  return __spreadValues(__spreadValues({}, baseParams), form.value);
165
210
  }
166
211
  function loadData() {
167
212
  return __async(this, null, function* () {
168
- var _a;
213
+ var _a, _b, _c, _d;
169
214
  if (!((_a = props.dataSource) == null ? void 0 : _a.api)) {
170
215
  console.warn("PageTable: 没有配置 dataSource.api");
171
216
  return;
@@ -177,12 +222,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
177
222
  const responseProps = props.dataSource.responseProps || {};
178
223
  const recordsField = responseProps.recordsField || "records";
179
224
  const totalField = responseProps.totalField || "total";
225
+ const pageNoField = responseProps.pageNoField || "pageNo";
226
+ const pageSizeField = responseProps.pageSizeField || "pageSize";
180
227
  internalData.value = result[recordsField] || [];
181
- pagination.value.total = result[totalField] || 0;
182
- emit("pageChange", {
183
- currentPage: pagination.value.currentPage,
184
- pageSize: pagination.value.pageSize
185
- });
228
+ totalModel.value = (_b = result[totalField]) != null ? _b : defaults.total;
229
+ pageNoModel.value = (_c = result[pageNoField]) != null ? _c : defaults.pageNo;
230
+ pageSizeModel.value = (_d = result[pageSizeField]) != null ? _d : defaults.pageSize;
186
231
  if (props.selectedRows && props.selectedRows.length > 0) {
187
232
  setTimeout(() => {
188
233
  if (tableRef.value) {
@@ -203,9 +248,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
203
248
  } catch (error) {
204
249
  console.error("PageTable: 加载数据失败:", error);
205
250
  internalData.value = [];
206
- pagination.value.total = 0;
251
+ totalModel.value = 0;
207
252
  } finally {
208
253
  isLoading.value = false;
254
+ refreshTableLayout();
209
255
  }
210
256
  });
211
257
  }
@@ -213,47 +259,47 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
213
259
  var _a;
214
260
  emit("search", __spreadValues({}, form.value));
215
261
  if ((_a = props.dataSource) == null ? void 0 : _a.api) {
216
- pagination.value.currentPage = 1;
262
+ pageNoModel.value = defaults.pageNo;
217
263
  loadData();
218
264
  }
219
265
  }
220
266
  function handleReset() {
221
- var _a;
267
+ var _a, _b, _c;
222
268
  emit("reset");
223
269
  form.value = {};
224
270
  if (formRef.value) {
225
- formRef.value.resetFields();
271
+ (_b = (_a = formRef.value) == null ? void 0 : _a.form) == null ? void 0 : _b.resetFields();
226
272
  }
227
- if ((_a = props.dataSource) == null ? void 0 : _a.api) {
228
- pagination.value.currentPage = 1;
273
+ if ((_c = props.dataSource) == null ? void 0 : _c.api) {
274
+ pageNoModel.value = defaults.pageNo;
229
275
  loadData();
230
276
  }
231
277
  }
232
278
  function handlePageChange(page) {
233
279
  var _a;
234
- pagination.value.currentPage = page;
280
+ pageNoModel.value = page;
235
281
  if ((_a = props.dataSource) == null ? void 0 : _a.api) {
236
282
  loadData();
237
283
  } else if (pagination.value.onPageChange) {
238
284
  pagination.value.onPageChange(page);
239
285
  }
240
286
  emit("pageChange", {
241
- currentPage: pagination.value.currentPage,
242
- pageSize: pagination.value.pageSize
287
+ pageNo: pageNoModel.value || 1,
288
+ pageSize: pageSizeModel.value || 10
243
289
  });
244
290
  }
245
291
  function handlePageSizeChange(size) {
246
292
  var _a;
247
- pagination.value.pageSize = size;
248
- pagination.value.currentPage = 1;
293
+ pageSizeModel.value = size;
294
+ pageNoModel.value = 1;
249
295
  if ((_a = props.dataSource) == null ? void 0 : _a.api) {
250
296
  loadData();
251
297
  } else if (pagination.value.onPageSizeChange) {
252
298
  pagination.value.onPageSizeChange(size);
253
299
  }
254
300
  emit("pageChange", {
255
- currentPage: pagination.value.currentPage,
256
- pageSize: pagination.value.pageSize
301
+ pageNo: pageNoModel.value || 1,
302
+ pageSize: pageSizeModel.value || 10
257
303
  });
258
304
  }
259
305
  const selectedCount = ref(0);
@@ -270,6 +316,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
270
316
  function handleSortChange({ column, prop, order }) {
271
317
  emit("sortChange", { column, prop, order });
272
318
  }
319
+ function refreshTableLayout() {
320
+ nextTick(() => {
321
+ var _a;
322
+ (_a = tableRef.value) == null ? void 0 : _a.doLayout();
323
+ });
324
+ }
273
325
  __expose({
274
326
  refresh: loadData,
275
327
  getFilterData: () => __spreadValues({}, form.value),
@@ -328,7 +380,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
328
380
  createVNode(unref(JkyForm), mergeProps({
329
381
  ref_key: "formRef",
330
382
  ref: formRef
331
- }, __spreadValues({ inline: true }, __props.formProps), {
383
+ }, __spreadValues({ inline: true, grid: true }, __props.formProps), {
332
384
  modelValue: form.value,
333
385
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => form.value = $event),
334
386
  "show-footer": true,
@@ -354,7 +406,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
354
406
  "selected-count": selectedCount.value,
355
407
  "toolbar-button-limit": __props.toolbarButtonLimit,
356
408
  payload: {
357
- currentPage: ((_d = pagination.value) == null ? void 0 : _d.currentPage) || 1,
409
+ pageNo: ((_d = pagination.value) == null ? void 0 : _d.pageNo) || 1,
358
410
  pageSize: ((_e = pagination.value) == null ? void 0 : _e.pageSize) || 10,
359
411
  total: ((_f = pagination.value) == null ? void 0 : _f.total) || 0,
360
412
  tableData: internalData.value,
@@ -377,36 +429,44 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
377
429
  onRowDblclick: handleRowDblclick,
378
430
  onSortChange: handleSortChange
379
431
  }), {
380
- default: withCtx(() => [
381
- __props.selection ? (openBlock(), createBlock(unref(ElTableColumn), {
382
- key: 0,
383
- type: "selection",
384
- width: "55",
385
- align: "center"
386
- })) : createCommentVNode("", true),
387
- (openBlock(true), createElementBlock(Fragment, null, renderList(__props.columns, (column) => {
388
- return openBlock(), createBlock(unref(ElTableColumn), mergeProps({
389
- key: column.prop
390
- }, { ref_for: true }, getColumnProps(column)), {
391
- default: withCtx((scope) => [
392
- renderSlot(_ctx.$slots, `column-${column.prop}`, {
393
- row: scope.row,
394
- column: scope.column,
395
- index: scope.$index
396
- }, () => {
397
- var _a3;
398
- return [
399
- column.render ? (openBlock(), createBlock(resolveDynamicComponent((_a3 = column.render) == null ? void 0 : _a3.call(column, scope)), { key: 0 })) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
400
- createTextVNode(toDisplayString(column.formatter ? column.formatter(scope.row, scope.column, scope.row[column.prop], scope.$index) : scope.row[column.prop]), 1)
401
- ], 64))
402
- ];
403
- })
404
- ]),
405
- _: 2
406
- }, 1040);
407
- }), 128)),
408
- renderSlot(_ctx.$slots, "columns")
409
- ]),
432
+ default: withCtx(() => {
433
+ var _a3, _b3, _c3, _d2;
434
+ return [
435
+ __props.selection ? (openBlock(), createBlock(unref(ElTableColumn), mergeProps({
436
+ key: 0,
437
+ width: "55",
438
+ align: "center"
439
+ }, __props.selectionColumn, { type: "selection" }), null, 16)) : createCommentVNode("", true),
440
+ (openBlock(true), createElementBlock(Fragment, null, renderList(__props.columns, (column) => {
441
+ return openBlock(), createBlock(_sfc_main$2, mergeProps({
442
+ key: column.prop || column.label,
443
+ ref_for: true
444
+ }, column), null, 16);
445
+ }), 128)),
446
+ _showActionColumn.value ? (openBlock(), createBlock(unref(ElTableColumn), {
447
+ key: 1,
448
+ label: ((_a3 = _actionColumnConfig.value) == null ? void 0 : _a3.label) || "操作",
449
+ width: (_b3 = _actionColumnConfig.value) == null ? void 0 : _b3.width,
450
+ fixed: (_c3 = _actionColumnConfig.value) == null ? void 0 : _c3.fixed,
451
+ align: ((_d2 = _actionColumnConfig.value) == null ? void 0 : _d2.align) || "center"
452
+ }, {
453
+ default: withCtx((scope) => {
454
+ var _a4, _b4, _c4;
455
+ return [
456
+ ((_a4 = _actionColumnConfig.value) == null ? void 0 : _a4.render) ? (openBlock(), createBlock(resolveDynamicComponent((_c4 = (_b4 = _actionColumnConfig.value) == null ? void 0 : _b4.render) == null ? void 0 : _c4.call(_b4, scope)), { key: 0 })) : (openBlock(), createBlock(_sfc_main$3, {
457
+ key: 1,
458
+ row: scope.row,
459
+ index: scope.$index,
460
+ config: _actionColumnConfig.value,
461
+ onClick: _handleActionColumnClick
462
+ }, null, 8, ["row", "index", "config"]))
463
+ ];
464
+ }),
465
+ _: 1
466
+ }, 8, ["label", "width", "fixed", "align"])) : createCommentVNode("", true),
467
+ renderSlot(_ctx.$slots, "columns")
468
+ ];
469
+ }),
410
470
  _: 3
411
471
  }, 16, ["data", "border", "stripe", "height", "max-height", "empty-text"])), [
412
472
  [_directive_loading, isLoading.value]
@@ -428,11 +488,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
428
488
  var _a2, _b2, _c2, _d, _e, _f, _g, _h;
429
489
  return [
430
490
  createVNode(unref(ElPagination), mergeProps({
431
- "current-page": pagination.value.currentPage,
432
- "onUpdate:currentPage": _cache[1] || (_cache[1] = ($event) => pagination.value.currentPage = $event),
433
- "page-size": pagination.value.pageSize,
434
- "onUpdate:pageSize": _cache[2] || (_cache[2] = ($event) => pagination.value.pageSize = $event),
435
- total: pagination.value.total,
491
+ "current-page": pageNoModel.value,
492
+ "onUpdate:currentPage": _cache[1] || (_cache[1] = ($event) => pageNoModel.value = $event),
493
+ "page-size": pageSizeModel.value,
494
+ "onUpdate:pageSize": _cache[2] || (_cache[2] = ($event) => pageSizeModel.value = $event),
495
+ total: totalModel.value,
436
496
  "page-sizes": ((_a2 = pagination.value) == null ? void 0 : _a2.pageSizes) || [10, 20, 50, 100],
437
497
  layout: ((_b2 = pagination.value) == null ? void 0 : _b2.layout) || "total, sizes, prev, pager, next, jumper",
438
498
  "show-size-picker": (_d = (_c2 = pagination.value) == null ? void 0 : _c2.showSizePicker) != null ? _d : true,
@@ -0,0 +1,36 @@
1
+ import { PageTableColumnProps } from './types';
2
+ declare function __VLS_template(): {
3
+ attrs: Partial<{}>;
4
+ slots: Partial<Record<`column-${string}`, (_: {
5
+ row: any;
6
+ column: any;
7
+ index: any;
8
+ }) => any>>;
9
+ refs: {};
10
+ rootEl: any;
11
+ };
12
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
13
+ declare const __VLS_component: import('vue').DefineComponent<PageTableColumnProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<PageTableColumnProps> & Readonly<{}>, {
14
+ width: string | number;
15
+ label: string;
16
+ fixed: boolean | string;
17
+ formatter: (row: any, column: import('element-plus').TableColumnCtx<any>, cellValue: any, index: number) => VNode | string;
18
+ children: PageTableColumnProps[];
19
+ render: (scope: {
20
+ row: any;
21
+ column: import('element-plus').TableColumnCtx<any>;
22
+ index: number;
23
+ }) => any;
24
+ prop: string;
25
+ minWidth: string | number;
26
+ sortable: boolean | string;
27
+ align: string;
28
+ headerAlign: string;
29
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
30
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
31
+ export default _default;
32
+ type __VLS_WithTemplateSlots<T, S> = T & {
33
+ new (): {
34
+ $slots: S;
35
+ };
36
+ };
@@ -0,0 +1,121 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defProps = Object.defineProperties;
3
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __spreadValues = (a, b) => {
9
+ for (var prop in b || (b = {}))
10
+ if (__hasOwnProp.call(b, prop))
11
+ __defNormalProp(a, prop, b[prop]);
12
+ if (__getOwnPropSymbols)
13
+ for (var prop of __getOwnPropSymbols(b)) {
14
+ if (__propIsEnum.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ }
17
+ return a;
18
+ };
19
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
+ import { defineComponent, computed, resolveComponent, openBlock, createBlock, unref, normalizeProps, guardReactiveProps, createSlots, withCtx, createElementBlock, Fragment, renderList, mergeProps, renderSlot, resolveDynamicComponent, createTextVNode, toDisplayString, createCommentVNode } from "vue";
21
+ import { ElTableColumn } from "element-plus";
22
+ import { omit } from "lodash-es";
23
+ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, {
24
+ name: "JkyPageTableColumn"
25
+ }), {
26
+ __name: "PageTableColumn",
27
+ props: {
28
+ children: { default: () => [] },
29
+ render: { type: Function, default: void 0 },
30
+ id: {},
31
+ realWidth: {},
32
+ type: {},
33
+ label: { default: "" },
34
+ className: {},
35
+ labelClassName: {},
36
+ property: {},
37
+ prop: { default: "" },
38
+ width: { default: void 0 },
39
+ minWidth: { default: void 0 },
40
+ renderHeader: {},
41
+ sortable: { type: [Boolean, String], default: false },
42
+ sortMethod: {},
43
+ sortBy: {},
44
+ resizable: { type: Boolean },
45
+ columnKey: {},
46
+ rawColumnKey: {},
47
+ align: { default: "center" },
48
+ headerAlign: { default: "center" },
49
+ showOverflowTooltip: { type: [Boolean, Object] },
50
+ tooltipFormatter: {},
51
+ fixed: { type: [Boolean, String], default: void 0 },
52
+ formatter: { type: Function, default: void 0 },
53
+ selectable: {},
54
+ reserveSelection: { type: Boolean },
55
+ filterMethod: {},
56
+ filteredValue: {},
57
+ filters: {},
58
+ filterPlacement: {},
59
+ filterMultiple: { type: Boolean },
60
+ filterClassName: {},
61
+ index: {},
62
+ sortOrders: {},
63
+ renderCell: {},
64
+ colSpan: {},
65
+ rowSpan: {},
66
+ level: {},
67
+ filterable: { type: [Boolean, Function, Array] },
68
+ order: {},
69
+ isColumnGroup: { type: Boolean },
70
+ isSubColumn: { type: Boolean },
71
+ columns: {},
72
+ getColumnIndex: {},
73
+ no: {},
74
+ filterOpened: { type: Boolean },
75
+ renderFilterIcon: {},
76
+ renderExpand: {}
77
+ },
78
+ setup(__props) {
79
+ const props = __props;
80
+ const hasChildren = computed(() => {
81
+ return props.children && props.children.length > 0;
82
+ });
83
+ return (_ctx, _cache) => {
84
+ const _component_JkyPageTableColumn = resolveComponent("JkyPageTableColumn");
85
+ return openBlock(), createBlock(unref(ElTableColumn), normalizeProps(guardReactiveProps(unref(omit)(props, ["children"]))), createSlots({ _: 2 }, [
86
+ hasChildren.value ? {
87
+ name: "default",
88
+ fn: withCtx(() => [
89
+ (openBlock(true), createElementBlock(Fragment, null, renderList(props.children, (child) => {
90
+ return openBlock(), createBlock(_component_JkyPageTableColumn, mergeProps({
91
+ key: child.prop || child.label,
92
+ ref_for: true
93
+ }, unref(omit)(child, ["children"])), null, 16);
94
+ }), 128))
95
+ ]),
96
+ key: "0"
97
+ } : {
98
+ name: "default",
99
+ fn: withCtx((scope) => [
100
+ renderSlot(_ctx.$slots, `column-${props.prop}`, {
101
+ row: scope.row,
102
+ column: scope.column,
103
+ index: scope.$index
104
+ }, () => {
105
+ var _a;
106
+ return [
107
+ props.render ? (openBlock(), createBlock(resolveDynamicComponent((_a = props.render) == null ? void 0 : _a.call(props, scope)), { key: 0 })) : props.prop ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
108
+ createTextVNode(toDisplayString(props.formatter ? props.formatter(scope.row, scope.column, scope.row[props.prop], scope.$index) : scope.row[props.prop]), 1)
109
+ ], 64)) : createCommentVNode("", true)
110
+ ];
111
+ })
112
+ ]),
113
+ key: "1"
114
+ }
115
+ ]), 1040);
116
+ };
117
+ }
118
+ }));
119
+ export {
120
+ _sfc_main as default
121
+ };
@@ -0,0 +1,5 @@
1
+ import _sfc_main from "./PageTableColumn.vue.js";
2
+ /* empty css */
3
+ export {
4
+ _sfc_main as default
5
+ };
@@ -20,7 +20,7 @@ declare const _default: import('vue').DefineComponent<ToolbarProps, {
20
20
  selectedCount: number;
21
21
  toolbarButtonLimit: number;
22
22
  payload: {
23
- currentPage: number;
23
+ pageNo: number;
24
24
  pageSize: number;
25
25
  total: number;
26
26
  tableData: any[];
@@ -38,7 +38,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
38
38
  selectedCount: { default: 0 },
39
39
  toolbarButtonLimit: { default: 0 },
40
40
  payload: { default: () => ({
41
- currentPage: 1,
41
+ pageNo: 1,
42
42
  pageSize: 10,
43
43
  total: 0,
44
44
  tableData: [],
@@ -66,7 +66,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
66
66
  });
67
67
  function getButtonPayload() {
68
68
  return props.payload || {
69
- currentPage: 1,
69
+ pageNo: 1,
70
70
  pageSize: 10,
71
71
  total: 0,
72
72
  tableData: [],
@@ -1,5 +1,9 @@
1
1
  import { InstallWithSFC } from '../utils/types';
2
+ import { default as ActionColumn } from './ActionColumn.vue';
2
3
  import { default as PageTable } from './PageTable.vue';
3
- export type { ApiParamsGetter, FilterItemConfig, PageTableEmits, PageTableExpose, PageTableProps, PaginationConfig, TableApiFunction, TableApiResponse, TableColumnConfig, TableDataSource, TableResponseProps, ToolbarButtonConfig, ToolbarEmits, ToolbarProps, } from './types';
4
+ import { default as PageTableColumn } from './PageTableColumn.vue';
5
+ export type { ActionColumnButtonConfig, ActionColumnConfig, ActionColumnEmits, ActionColumnProps, ApiParamsGetter, FilterItemConfig, PageTableColumnProps, PageTableEmits, PageTableExpose, PageTableProps, PaginationConfig, TableApiFunction, TableApiResponse, TableColumnConfig, TableDataSource, TableResponseProps, ToolbarButtonConfig, ToolbarEmits, ToolbarProps, } from './types';
4
6
  export declare const JkyPageTable: InstallWithSFC<typeof PageTable>;
7
+ export declare const JkyActionColumn: InstallWithSFC<typeof ActionColumn>;
8
+ export declare const JkyPageTableColumn: InstallWithSFC<typeof PageTableColumn>;
5
9
  export default JkyPageTable;
@@ -1,8 +1,16 @@
1
1
  import { installWithSFC } from "../utils/with-install.js";
2
+ import _sfc_main$1 from "./ActionColumn.vue.js";
3
+ /* empty css */
2
4
  import _sfc_main from "./PageTable.vue.js";
3
5
  /* empty css */
6
+ import _sfc_main$2 from "./PageTableColumn.vue.js";
7
+ /* empty css */
4
8
  const JkyPageTable = installWithSFC(_sfc_main);
9
+ const JkyActionColumn = installWithSFC(_sfc_main$1);
10
+ const JkyPageTableColumn = installWithSFC(_sfc_main$2);
5
11
  export {
12
+ JkyActionColumn,
6
13
  JkyPageTable,
14
+ JkyPageTableColumn,
7
15
  JkyPageTable as default
8
16
  };
@@ -7,4 +7,13 @@
7
7
  justify-content: var(--jky-page-table_pagination-position);
8
8
  }
9
9
  }
10
+ .el-table__header col[name="gutter"] {
11
+ /* display: table-cell !important; */
12
+ }
13
+ }
14
+ /* ActionColumn 组件样式 */
15
+ .jky-action-column {
16
+ .el-button + .el-button {
17
+ margin-left: 0;
18
+ }
10
19
  }