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