jky-component-lib 0.0.99 → 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/amap/style.css +6 -2
- package/dist/es/amap/style2.css +12 -5
- package/dist/es/amap/style3.css +2 -13
- package/dist/es/components.js +2 -1
- package/dist/es/form/Form.vue.d.ts +2 -100
- package/dist/es/form/Form.vue.js +3 -1
- package/dist/es/index.js +2 -1
- package/dist/es/package.json.js +1 -1
- package/dist/es/page-table/PageTable.vue.d.ts +32 -423
- package/dist/es/page-table/PageTable.vue.js +78 -69
- 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 +3 -1
- package/dist/es/page-table/index.js +4 -0
- package/dist/es/style.css +56 -0
- package/dist/lib/amap/style.css +6 -2
- package/dist/lib/amap/style2.css +12 -5
- package/dist/lib/amap/style3.css +2 -13
- package/dist/lib/components.js +1 -0
- package/dist/lib/form/Form.vue.d.ts +2 -100
- package/dist/lib/form/Form.vue.js +3 -1
- package/dist/lib/index.js +1 -0
- package/dist/lib/package.json.js +1 -1
- package/dist/lib/page-table/PageTable.vue.d.ts +32 -423
- package/dist/lib/page-table/PageTable.vue.js +75 -66
- 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 +3 -1
- package/dist/lib/page-table/index.js +4 -0
- package/dist/lib/style.css +56 -0
- package/package.json +1 -1
|
@@ -45,6 +45,8 @@ const ElementPlus = require("element-plus");
|
|
|
45
45
|
const index = require("../form/index.js");
|
|
46
46
|
const ActionColumn_vue_vue_type_script_setup_true_lang = require("./ActionColumn.vue.js");
|
|
47
47
|
;/* empty css */
|
|
48
|
+
const PageTableColumn_vue_vue_type_script_setup_true_lang = require("./PageTableColumn.vue.js");
|
|
49
|
+
;/* empty css */
|
|
48
50
|
const Toolbar_vue_vue_type_script_setup_true_lang = require("./Toolbar.vue.js");
|
|
49
51
|
;/* empty css */
|
|
50
52
|
const _sfc_main = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadValues({}, {
|
|
@@ -62,6 +64,8 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadValu
|
|
|
62
64
|
searchText: { default: "查询" },
|
|
63
65
|
resetText: { default: "重置" },
|
|
64
66
|
selection: { type: Boolean, default: false },
|
|
67
|
+
selectionColumn: { default: () => ({}) },
|
|
68
|
+
selectable: {},
|
|
65
69
|
selectedRows: { default: () => [] },
|
|
66
70
|
pagination: {},
|
|
67
71
|
border: { type: Boolean, default: true },
|
|
@@ -79,20 +83,40 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadValu
|
|
|
79
83
|
autoSearchDelay: { default: 500 },
|
|
80
84
|
actionColumn: { type: [Object, Boolean] }
|
|
81
85
|
}, {
|
|
82
|
-
"
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
})
|
|
89
|
-
},
|
|
90
|
-
"paginationModifiers": {}
|
|
86
|
+
"pageNo": { default: 1 },
|
|
87
|
+
"pageNoModifiers": {},
|
|
88
|
+
"pageSize": { default: 10 },
|
|
89
|
+
"pageSizeModifiers": {},
|
|
90
|
+
"total": { default: 0 },
|
|
91
|
+
"totalModifiers": {}
|
|
91
92
|
}),
|
|
92
|
-
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"]),
|
|
93
94
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
94
95
|
const props = __props;
|
|
95
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
|
+
});
|
|
96
120
|
const form = vue.ref(props.form || {});
|
|
97
121
|
vue.watch(() => props.form, (newVal) => {
|
|
98
122
|
if (newVal) {
|
|
@@ -106,7 +130,6 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadValu
|
|
|
106
130
|
},
|
|
107
131
|
{ deep: true }
|
|
108
132
|
);
|
|
109
|
-
const pagination = vue.useModel(__props, "pagination");
|
|
110
133
|
const internalData = vue.ref([]);
|
|
111
134
|
const tableRef = vue.ref(null);
|
|
112
135
|
const formRef = vue.ref(null);
|
|
@@ -150,9 +173,6 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadValu
|
|
|
150
173
|
var _a, _b;
|
|
151
174
|
return !!((_a = props.dataSource) == null ? void 0 : _a.api) || (((_b = pagination.value) == null ? void 0 : _b.total) || 0) > 0;
|
|
152
175
|
});
|
|
153
|
-
function getColumnProps(column) {
|
|
154
|
-
return __spreadValues({}, column);
|
|
155
|
-
}
|
|
156
176
|
const _showActionColumn = vue.computed(() => {
|
|
157
177
|
if (props.actionColumn === false)
|
|
158
178
|
return false;
|
|
@@ -171,23 +191,28 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadValu
|
|
|
171
191
|
function _handleActionColumnClick(_button, _row, _index) {
|
|
172
192
|
}
|
|
173
193
|
function buildApiParams() {
|
|
174
|
-
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";
|
|
175
200
|
const baseParams = {
|
|
176
|
-
|
|
177
|
-
|
|
201
|
+
[pageNoField]: pageNo,
|
|
202
|
+
[pageSizeField]: pageSize
|
|
178
203
|
};
|
|
179
|
-
if ((
|
|
204
|
+
if ((_c = props.dataSource) == null ? void 0 : _c.getApiParams) {
|
|
180
205
|
const dynamicParams = props.dataSource.getApiParams(form.value);
|
|
181
206
|
return __spreadValues(__spreadValues(__spreadValues({}, baseParams), form.value), dynamicParams);
|
|
182
207
|
}
|
|
183
|
-
if ((
|
|
208
|
+
if ((_d = props.dataSource) == null ? void 0 : _d.apiParams) {
|
|
184
209
|
return __spreadValues(__spreadValues(__spreadValues({}, baseParams), form.value), props.dataSource.apiParams);
|
|
185
210
|
}
|
|
186
211
|
return __spreadValues(__spreadValues({}, baseParams), form.value);
|
|
187
212
|
}
|
|
188
213
|
function loadData() {
|
|
189
214
|
return __async(this, null, function* () {
|
|
190
|
-
var _a;
|
|
215
|
+
var _a, _b, _c, _d;
|
|
191
216
|
if (!((_a = props.dataSource) == null ? void 0 : _a.api)) {
|
|
192
217
|
console.warn("PageTable: 没有配置 dataSource.api");
|
|
193
218
|
return;
|
|
@@ -199,12 +224,12 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadValu
|
|
|
199
224
|
const responseProps = props.dataSource.responseProps || {};
|
|
200
225
|
const recordsField = responseProps.recordsField || "records";
|
|
201
226
|
const totalField = responseProps.totalField || "total";
|
|
227
|
+
const pageNoField = responseProps.pageNoField || "pageNo";
|
|
228
|
+
const pageSizeField = responseProps.pageSizeField || "pageSize";
|
|
202
229
|
internalData.value = result[recordsField] || [];
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
pageSize: pagination.value.pageSize
|
|
207
|
-
});
|
|
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;
|
|
208
233
|
if (props.selectedRows && props.selectedRows.length > 0) {
|
|
209
234
|
setTimeout(() => {
|
|
210
235
|
if (tableRef.value) {
|
|
@@ -225,7 +250,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadValu
|
|
|
225
250
|
} catch (error) {
|
|
226
251
|
console.error("PageTable: 加载数据失败:", error);
|
|
227
252
|
internalData.value = [];
|
|
228
|
-
|
|
253
|
+
totalModel.value = 0;
|
|
229
254
|
} finally {
|
|
230
255
|
isLoading.value = false;
|
|
231
256
|
refreshTableLayout();
|
|
@@ -236,47 +261,47 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadValu
|
|
|
236
261
|
var _a;
|
|
237
262
|
emit("search", __spreadValues({}, form.value));
|
|
238
263
|
if ((_a = props.dataSource) == null ? void 0 : _a.api) {
|
|
239
|
-
|
|
264
|
+
pageNoModel.value = defaults.pageNo;
|
|
240
265
|
loadData();
|
|
241
266
|
}
|
|
242
267
|
}
|
|
243
268
|
function handleReset() {
|
|
244
|
-
var _a;
|
|
269
|
+
var _a, _b, _c;
|
|
245
270
|
emit("reset");
|
|
246
271
|
form.value = {};
|
|
247
272
|
if (formRef.value) {
|
|
248
|
-
formRef.value.resetFields();
|
|
273
|
+
(_b = (_a = formRef.value) == null ? void 0 : _a.form) == null ? void 0 : _b.resetFields();
|
|
249
274
|
}
|
|
250
|
-
if ((
|
|
251
|
-
|
|
275
|
+
if ((_c = props.dataSource) == null ? void 0 : _c.api) {
|
|
276
|
+
pageNoModel.value = defaults.pageNo;
|
|
252
277
|
loadData();
|
|
253
278
|
}
|
|
254
279
|
}
|
|
255
280
|
function handlePageChange(page) {
|
|
256
281
|
var _a;
|
|
257
|
-
|
|
282
|
+
pageNoModel.value = page;
|
|
258
283
|
if ((_a = props.dataSource) == null ? void 0 : _a.api) {
|
|
259
284
|
loadData();
|
|
260
285
|
} else if (pagination.value.onPageChange) {
|
|
261
286
|
pagination.value.onPageChange(page);
|
|
262
287
|
}
|
|
263
288
|
emit("pageChange", {
|
|
264
|
-
|
|
265
|
-
pageSize:
|
|
289
|
+
pageNo: pageNoModel.value || 1,
|
|
290
|
+
pageSize: pageSizeModel.value || 10
|
|
266
291
|
});
|
|
267
292
|
}
|
|
268
293
|
function handlePageSizeChange(size) {
|
|
269
294
|
var _a;
|
|
270
|
-
|
|
271
|
-
|
|
295
|
+
pageSizeModel.value = size;
|
|
296
|
+
pageNoModel.value = 1;
|
|
272
297
|
if ((_a = props.dataSource) == null ? void 0 : _a.api) {
|
|
273
298
|
loadData();
|
|
274
299
|
} else if (pagination.value.onPageSizeChange) {
|
|
275
300
|
pagination.value.onPageSizeChange(size);
|
|
276
301
|
}
|
|
277
302
|
emit("pageChange", {
|
|
278
|
-
|
|
279
|
-
pageSize:
|
|
303
|
+
pageNo: pageNoModel.value || 1,
|
|
304
|
+
pageSize: pageSizeModel.value || 10
|
|
280
305
|
});
|
|
281
306
|
}
|
|
282
307
|
const selectedCount = vue.ref(0);
|
|
@@ -383,7 +408,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadValu
|
|
|
383
408
|
"selected-count": selectedCount.value,
|
|
384
409
|
"toolbar-button-limit": __props.toolbarButtonLimit,
|
|
385
410
|
payload: {
|
|
386
|
-
|
|
411
|
+
pageNo: ((_d = pagination.value) == null ? void 0 : _d.pageNo) || 1,
|
|
387
412
|
pageSize: ((_e = pagination.value) == null ? void 0 : _e.pageSize) || 10,
|
|
388
413
|
total: ((_f = pagination.value) == null ? void 0 : _f.total) || 0,
|
|
389
414
|
tableData: internalData.value,
|
|
@@ -409,32 +434,16 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadValu
|
|
|
409
434
|
default: vue.withCtx(() => {
|
|
410
435
|
var _a3, _b3, _c3, _d2;
|
|
411
436
|
return [
|
|
412
|
-
__props.selection ? (vue.openBlock(), vue.createBlock(vue.unref(ElementPlus.ElTableColumn), {
|
|
437
|
+
__props.selection ? (vue.openBlock(), vue.createBlock(vue.unref(ElementPlus.ElTableColumn), vue.mergeProps({
|
|
413
438
|
key: 0,
|
|
414
|
-
type: "selection",
|
|
415
439
|
width: "55",
|
|
416
440
|
align: "center"
|
|
417
|
-
})) : vue.createCommentVNode("", true),
|
|
441
|
+
}, __props.selectionColumn, { type: "selection" }), null, 16)) : vue.createCommentVNode("", true),
|
|
418
442
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(__props.columns, (column) => {
|
|
419
|
-
return vue.openBlock(), vue.createBlock(
|
|
420
|
-
key: column.prop
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
vue.renderSlot(_ctx.$slots, `column-${column.prop}`, {
|
|
424
|
-
row: scope.row,
|
|
425
|
-
column: scope.column,
|
|
426
|
-
index: scope.$index
|
|
427
|
-
}, () => {
|
|
428
|
-
var _a4;
|
|
429
|
-
return [
|
|
430
|
-
column.render ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent((_a4 = column.render) == null ? void 0 : _a4.call(column, scope)), { key: 0 })) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
|
|
431
|
-
vue.createTextVNode(vue.toDisplayString(column.formatter ? column.formatter(scope.row, scope.column, scope.row[column.prop], scope.$index) : scope.row[column.prop]), 1)
|
|
432
|
-
], 64))
|
|
433
|
-
];
|
|
434
|
-
})
|
|
435
|
-
]),
|
|
436
|
-
_: 2
|
|
437
|
-
}, 1040);
|
|
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);
|
|
438
447
|
}), 128)),
|
|
439
448
|
_showActionColumn.value ? (vue.openBlock(), vue.createBlock(vue.unref(ElementPlus.ElTableColumn), {
|
|
440
449
|
key: 1,
|
|
@@ -481,11 +490,11 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadValu
|
|
|
481
490
|
var _a2, _b2, _c2, _d, _e, _f, _g, _h;
|
|
482
491
|
return [
|
|
483
492
|
vue.createVNode(vue.unref(ElementPlus.ElPagination), vue.mergeProps({
|
|
484
|
-
"current-page":
|
|
485
|
-
"onUpdate:currentPage": _cache[1] || (_cache[1] = ($event) =>
|
|
486
|
-
"page-size":
|
|
487
|
-
"onUpdate:pageSize": _cache[2] || (_cache[2] = ($event) =>
|
|
488
|
-
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,
|
|
489
498
|
"page-sizes": ((_a2 = pagination.value) == null ? void 0 : _a2.pageSizes) || [10, 20, 50, 100],
|
|
490
499
|
layout: ((_b2 = pagination.value) == null ? void 0 : _b2.layout) || "total, sizes, prev, pager, next, jumper",
|
|
491
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,7 +1,9 @@
|
|
|
1
1
|
import { InstallWithSFC } from '../utils/types';
|
|
2
2
|
import { default as ActionColumn } from './ActionColumn.vue';
|
|
3
3
|
import { default as PageTable } from './PageTable.vue';
|
|
4
|
-
|
|
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';
|
|
5
6
|
export declare const JkyPageTable: InstallWithSFC<typeof PageTable>;
|
|
6
7
|
export declare const JkyActionColumn: InstallWithSFC<typeof ActionColumn>;
|
|
8
|
+
export declare const JkyPageTableColumn: InstallWithSFC<typeof PageTableColumn>;
|
|
7
9
|
export default JkyPageTable;
|
|
@@ -5,8 +5,12 @@ const ActionColumn_vue_vue_type_script_setup_true_lang = require("./ActionColumn
|
|
|
5
5
|
;/* empty css */
|
|
6
6
|
const PageTable_vue_vue_type_script_setup_true_lang = require("./PageTable.vue.js");
|
|
7
7
|
;/* empty css */
|
|
8
|
+
const PageTableColumn_vue_vue_type_script_setup_true_lang = require("./PageTableColumn.vue.js");
|
|
9
|
+
;/* empty css */
|
|
8
10
|
const JkyPageTable = withInstall.installWithSFC(PageTable_vue_vue_type_script_setup_true_lang.default);
|
|
9
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);
|
|
10
13
|
exports.JkyActionColumn = JkyActionColumn;
|
|
11
14
|
exports.JkyPageTable = JkyPageTable;
|
|
15
|
+
exports.JkyPageTableColumn = JkyPageTableColumn;
|
|
12
16
|
exports.default = JkyPageTable;
|
package/dist/lib/style.css
CHANGED
|
@@ -558,6 +558,10 @@
|
|
|
558
558
|
}
|
|
559
559
|
}
|
|
560
560
|
|
|
561
|
+
.m-0 {
|
|
562
|
+
margin: calc(var(--spacing) * 0);
|
|
563
|
+
}
|
|
564
|
+
|
|
561
565
|
.mx-auto {
|
|
562
566
|
margin-inline: auto;
|
|
563
567
|
}
|
|
@@ -1414,6 +1418,22 @@
|
|
|
1414
1418
|
mask-repeat: no-repeat;
|
|
1415
1419
|
}
|
|
1416
1420
|
|
|
1421
|
+
.icon-\[mdi--file-excel\] {
|
|
1422
|
+
width: 1em;
|
|
1423
|
+
height: 1em;
|
|
1424
|
+
-webkit-mask-image: var(--svg);
|
|
1425
|
+
-webkit-mask-image: var(--svg);
|
|
1426
|
+
-webkit-mask-image: var(--svg);
|
|
1427
|
+
mask-image: var(--svg);
|
|
1428
|
+
--svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24' height='24'%3E%3Cpath fill='black' d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8zm1.8 18H14l-2-3.4l-2 3.4H8.2l2.9-4.5L8.2 11H10l2 3.4l2-3.4h1.8l-2.9 4.5zM13 9V3.5L18.5 9z'/%3E%3C/svg%3E");
|
|
1429
|
+
background-color: currentColor;
|
|
1430
|
+
display: inline-block;
|
|
1431
|
+
-webkit-mask-size: 100% 100%;
|
|
1432
|
+
mask-size: 100% 100%;
|
|
1433
|
+
-webkit-mask-repeat: no-repeat;
|
|
1434
|
+
mask-repeat: no-repeat;
|
|
1435
|
+
}
|
|
1436
|
+
|
|
1417
1437
|
.icon-\[mdi--format-list-bulleted\] {
|
|
1418
1438
|
width: 1em;
|
|
1419
1439
|
height: 1em;
|
|
@@ -1478,6 +1498,22 @@
|
|
|
1478
1498
|
mask-repeat: no-repeat;
|
|
1479
1499
|
}
|
|
1480
1500
|
|
|
1501
|
+
.icon-\[mdi--plus\] {
|
|
1502
|
+
width: 1em;
|
|
1503
|
+
height: 1em;
|
|
1504
|
+
-webkit-mask-image: var(--svg);
|
|
1505
|
+
-webkit-mask-image: var(--svg);
|
|
1506
|
+
-webkit-mask-image: var(--svg);
|
|
1507
|
+
mask-image: var(--svg);
|
|
1508
|
+
--svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24' height='24'%3E%3Cpath fill='black' d='M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z'/%3E%3C/svg%3E");
|
|
1509
|
+
background-color: currentColor;
|
|
1510
|
+
display: inline-block;
|
|
1511
|
+
-webkit-mask-size: 100% 100%;
|
|
1512
|
+
mask-size: 100% 100%;
|
|
1513
|
+
-webkit-mask-repeat: no-repeat;
|
|
1514
|
+
mask-repeat: no-repeat;
|
|
1515
|
+
}
|
|
1516
|
+
|
|
1481
1517
|
.icon-\[mdi--refresh\] {
|
|
1482
1518
|
width: 1em;
|
|
1483
1519
|
height: 1em;
|
|
@@ -1494,6 +1530,22 @@
|
|
|
1494
1530
|
mask-repeat: no-repeat;
|
|
1495
1531
|
}
|
|
1496
1532
|
|
|
1533
|
+
.icon-\[mdi--upload\] {
|
|
1534
|
+
width: 1em;
|
|
1535
|
+
height: 1em;
|
|
1536
|
+
-webkit-mask-image: var(--svg);
|
|
1537
|
+
-webkit-mask-image: var(--svg);
|
|
1538
|
+
-webkit-mask-image: var(--svg);
|
|
1539
|
+
mask-image: var(--svg);
|
|
1540
|
+
--svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24' height='24'%3E%3Cpath fill='black' d='M9 16v-6H5l7-7l7 7h-4v6zm-4 4v-2h14v2z'/%3E%3C/svg%3E");
|
|
1541
|
+
background-color: currentColor;
|
|
1542
|
+
display: inline-block;
|
|
1543
|
+
-webkit-mask-size: 100% 100%;
|
|
1544
|
+
mask-size: 100% 100%;
|
|
1545
|
+
-webkit-mask-repeat: no-repeat;
|
|
1546
|
+
mask-repeat: no-repeat;
|
|
1547
|
+
}
|
|
1548
|
+
|
|
1497
1549
|
.icon-\[mi--switch\] {
|
|
1498
1550
|
width: 1em;
|
|
1499
1551
|
height: 1em;
|
|
@@ -2377,6 +2429,10 @@
|
|
|
2377
2429
|
padding: calc(var(--spacing) * 8);
|
|
2378
2430
|
}
|
|
2379
2431
|
|
|
2432
|
+
.px-1 {
|
|
2433
|
+
padding-inline: calc(var(--spacing) * 1);
|
|
2434
|
+
}
|
|
2435
|
+
|
|
2380
2436
|
.px-2 {
|
|
2381
2437
|
padding-inline: calc(var(--spacing) * 2);
|
|
2382
2438
|
}
|