@web-utils/form-ui 1.0.0-beta84 → 1.0.0-beta86
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/chunks/{8zYlq-t92.mjs → 4kjeIiag2.mjs} +1 -1
- package/chunks/{BMei9UHN2.mjs → 8h-xBLL82.mjs} +8 -2
- package/chunks/{FZqu01np2.mjs → BTGrh7dw2.mjs} +107 -107
- package/chunks/{GgLE1MYX2.mjs → BYu4QaK72.mjs} +1 -1
- package/chunks/{DgH_4qOn2.mjs → CpsHWpwH2.mjs} +43 -23
- package/chunks/{DFn9vkrz2.mjs → DSTNXl142.mjs} +1 -1
- package/chunks/{61ccpSFj2.mjs → DWN5uzm02.mjs} +8 -2
- package/chunks/{CTFV8OFH2.mjs → DrvwVjzq2.mjs} +1 -1
- package/chunks/{SLYmepqR.mjs → HFLY8Wla.mjs} +223 -214
- package/data-table-picker/index.mjs +1 -1
- package/form-table/index.d.ts +9 -0
- package/form-table/index.mjs +1 -1
- package/form-table-plus/index.d.ts +9 -0
- package/form-table-plus/index.mjs +1 -1
- package/form-tree-select/index.mjs +1 -1
- package/form-tree-select-multiple/index.mjs +1 -1
- package/form-view/index.mjs +1 -1
- package/index.mjs +9 -9
- package/package.json +1 -3
- package/pageable-table/index.d.ts +1 -1
- package/pageable-table/index.mjs +1 -1
- package/resolver/components.mjs +1 -1
- package/resolver/vite-optimize-deps-plugin.d.ts +1 -1
- package/resolver/vite-optimize-deps-plugin.mjs +1 -1
- package/sub-table/index.d.ts +9 -0
- package/sub-table/index.mjs +1 -1
- package/sub-table-plus/index.d.ts +9 -0
- package/sub-table-plus/index.mjs +1 -1
- package/table-view/index.d.ts +5 -5
- package/table-view/index.mjs +3 -3
- package/toolbar/index.d.ts +6 -1
- package/toolbar/index.mjs +1 -1
- package/vue-tree-select/index.mjs +1 -1
- package/web-types.json +1 -1
|
@@ -6,9 +6,10 @@ import { getDictLabel as c } from "../helper/dictionary.mjs";
|
|
|
6
6
|
import { t as l } from "./C_QfuxeQ.mjs";
|
|
7
7
|
import { t as u } from "./6eDDQWcr.mjs";
|
|
8
8
|
import { useVisibilityChange as ee } from "../hook/useVisibilityChange.mjs";
|
|
9
|
-
import { ElCheckbox as d, ElDrawer as f, ElEmpty as te, ElMessage as ne, ElPagination as
|
|
9
|
+
import { ElCheckbox as d, ElDrawer as f, ElEmpty as te, ElMessage as ne, ElPagination as p, ElRadio as m, ElTable as h, ElTableColumn as g } from "element-plus/es";
|
|
10
10
|
import "element-plus/es/components/base/style/css";
|
|
11
|
-
import { Fragment as
|
|
11
|
+
import { Fragment as _, computed as v, createBlock as y, createTextVNode as b, createVNode as x, inject as S, isVNode as C, mergeModels as w, mergeProps as T, nextTick as re, onUpdated as E, openBlock as D, provide as O, reactive as k, ref as A, toDisplayString as j, useModel as M, useTemplateRef as ie, watch as N, withCtx as P } from "vue";
|
|
12
|
+
import { isFunction as F } from "@web-utils/core";
|
|
12
13
|
import "element-plus/es/components/message/style/css";
|
|
13
14
|
import "element-plus/es/components/drawer/style/css";
|
|
14
15
|
import "element-plus/es/components/table/style/css";
|
|
@@ -17,11 +18,12 @@ import "element-plus/es/components/table-column/style/css";
|
|
|
17
18
|
import "element-plus/es/components/pagination/style/css";
|
|
18
19
|
import "element-plus/es/components/empty/style/css";
|
|
19
20
|
import "element-plus/es/components/radio/style/css";
|
|
20
|
-
import { useEventBus as
|
|
21
|
+
import { useEventBus as ae } from "@web-utils/vue/hooks/useEventBus";
|
|
22
|
+
import { uuid as oe } from "@web-utils/integrations/uuid";
|
|
21
23
|
//#region src/components/table/components/TableColumnSettingPanel.vue
|
|
22
|
-
var
|
|
24
|
+
var I = /* @__PURE__ */ Object.assign({ name: "TableColumnSettingPanel" }, {
|
|
23
25
|
__name: "TableColumnSettingPanel",
|
|
24
|
-
props: /* @__PURE__ */
|
|
26
|
+
props: /* @__PURE__ */ w({ columns: {
|
|
25
27
|
type: Array,
|
|
26
28
|
default: () => []
|
|
27
29
|
} }, {
|
|
@@ -31,9 +33,9 @@ var P = /* @__PURE__ */ Object.assign({ name: "TableColumnSettingPanel" }, {
|
|
|
31
33
|
},
|
|
32
34
|
modelModifiers: {}
|
|
33
35
|
}),
|
|
34
|
-
emits: /* @__PURE__ */
|
|
36
|
+
emits: /* @__PURE__ */ w(["update:settings"], ["update:modelValue"]),
|
|
35
37
|
setup(e, { expose: t, emit: n }) {
|
|
36
|
-
let r =
|
|
38
|
+
let r = M(e, "modelValue"), i = n, a = k({
|
|
37
39
|
hideProps: {},
|
|
38
40
|
fixedProps: {},
|
|
39
41
|
filterableProps: {},
|
|
@@ -42,49 +44,49 @@ var P = /* @__PURE__ */ Object.assign({ name: "TableColumnSettingPanel" }, {
|
|
|
42
44
|
n === "hide" ? a.hideProps[t.prop] = e : n === "fixed" ? a.fixedProps[t.prop] = e : n === "filterable" ? a.filterableProps[t.prop] = e : n === "sortable" && (a.sortableProps[t.prop] = e), i("update:settings", a);
|
|
43
45
|
};
|
|
44
46
|
return t({ settings: a }), (t, n) => {
|
|
45
|
-
let i =
|
|
46
|
-
return
|
|
47
|
+
let i = g, a = d, s = h, c = f;
|
|
48
|
+
return D(), y(c, {
|
|
47
49
|
modelValue: r.value,
|
|
48
50
|
"onUpdate:modelValue": n[0] || (n[0] = (e) => r.value = e),
|
|
49
51
|
class: "table-column-filter",
|
|
50
52
|
title: "表格设置",
|
|
51
53
|
"append-to-body": ""
|
|
52
54
|
}, {
|
|
53
|
-
default:
|
|
55
|
+
default: P(() => [x(s, {
|
|
54
56
|
data: e.columns,
|
|
55
57
|
border: ""
|
|
56
58
|
}, {
|
|
57
|
-
default:
|
|
58
|
-
|
|
59
|
-
default:
|
|
59
|
+
default: P(() => [
|
|
60
|
+
x(i, { label: "列名" }, {
|
|
61
|
+
default: P(({ row: e }) => [b(j(e.label), 1)]),
|
|
60
62
|
_: 1
|
|
61
63
|
}),
|
|
62
|
-
|
|
64
|
+
x(i, {
|
|
63
65
|
label: "隐藏",
|
|
64
66
|
align: "center"
|
|
65
67
|
}, {
|
|
66
|
-
default:
|
|
68
|
+
default: P(({ row: e }) => [x(a, { onChange: (t) => o(t, e, "hide") }, null, 8, ["onChange"])]),
|
|
67
69
|
_: 1
|
|
68
70
|
}),
|
|
69
|
-
|
|
71
|
+
x(i, {
|
|
70
72
|
label: "冻结",
|
|
71
73
|
align: "center"
|
|
72
74
|
}, {
|
|
73
|
-
default:
|
|
75
|
+
default: P(({ row: e }) => [x(a, { onChange: (t) => o(t, e, "fixed") }, null, 8, ["onChange"])]),
|
|
74
76
|
_: 1
|
|
75
77
|
}),
|
|
76
|
-
|
|
78
|
+
x(i, {
|
|
77
79
|
label: "过滤",
|
|
78
80
|
align: "center"
|
|
79
81
|
}, {
|
|
80
|
-
default:
|
|
82
|
+
default: P(({ row: e }) => [x(a, { onChange: (t) => o(t, e, "filterable") }, null, 8, ["onChange"])]),
|
|
81
83
|
_: 1
|
|
82
84
|
}),
|
|
83
|
-
|
|
85
|
+
x(i, {
|
|
84
86
|
label: "排序",
|
|
85
87
|
align: "center"
|
|
86
88
|
}, {
|
|
87
|
-
default:
|
|
89
|
+
default: P(({ row: e }) => [x(a, {
|
|
88
90
|
title: e.allowSort ? null : "该列不支持排序!",
|
|
89
91
|
disabled: !e.allowSort,
|
|
90
92
|
onChange: (t) => o(t, e, "sortable")
|
|
@@ -105,8 +107,8 @@ var P = /* @__PURE__ */ Object.assign({ name: "TableColumnSettingPanel" }, {
|
|
|
105
107
|
});
|
|
106
108
|
//#endregion
|
|
107
109
|
//#region src/components/table/components/TableColumnFilterable.vue?vue&type=script&lang.jsx
|
|
108
|
-
function
|
|
109
|
-
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !
|
|
110
|
+
function L(e) {
|
|
111
|
+
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !C(e);
|
|
110
112
|
}
|
|
111
113
|
//#endregion
|
|
112
114
|
//#region src/components/table/components/TableColumnFilterable.vue
|
|
@@ -114,20 +116,20 @@ var se = {
|
|
|
114
116
|
name: "TableColumnFilterable",
|
|
115
117
|
props: { ...l },
|
|
116
118
|
setup(t, { slots: n }) {
|
|
117
|
-
let r =
|
|
119
|
+
let r = S(o, null), i = e(t, (e) => e !== "filterMethod" && e !== "filters"), a = v(() => {
|
|
118
120
|
if (t.filterable && r) return (e, t, n) => t[n.property] === e;
|
|
119
|
-
}), s =
|
|
121
|
+
}), s = v(() => {
|
|
120
122
|
if (t.filterable && r) return [...new Set(r.records.value.map((e) => e[t.prop]).filter((e) => e))].map((e) => ({
|
|
121
123
|
text: e,
|
|
122
124
|
value: e
|
|
123
125
|
}));
|
|
124
126
|
});
|
|
125
|
-
return () =>
|
|
127
|
+
return () => x(u, T(i.value, {
|
|
126
128
|
filterMethod: a.value,
|
|
127
129
|
filters: s.value
|
|
128
|
-
}),
|
|
130
|
+
}), L(n) ? n : { default: () => [n] });
|
|
129
131
|
}
|
|
130
|
-
},
|
|
132
|
+
}, R = {
|
|
131
133
|
data: {
|
|
132
134
|
type: Array,
|
|
133
135
|
default: () => []
|
|
@@ -303,7 +305,7 @@ var se = {
|
|
|
303
305
|
selectExport: Boolean,
|
|
304
306
|
useVisibilityChange: Boolean,
|
|
305
307
|
rowDbClick: Function
|
|
306
|
-
},
|
|
308
|
+
}, z = {
|
|
307
309
|
data: !0,
|
|
308
310
|
rowDbClick: !0,
|
|
309
311
|
selectionWidth: !0,
|
|
@@ -330,7 +332,7 @@ var se = {
|
|
|
330
332
|
columns: !0,
|
|
331
333
|
payloadStyle: !0,
|
|
332
334
|
disabledRowKeys: !0
|
|
333
|
-
}, ce = (e) =>
|
|
335
|
+
}, ce = (e) => z[e] !== !0;
|
|
334
336
|
//#endregion
|
|
335
337
|
//#region src/components/table/PageableTable.vue?vue&type=script&lang.jsx
|
|
336
338
|
function le(e) {
|
|
@@ -338,105 +340,105 @@ function le(e) {
|
|
|
338
340
|
for (let n in e) t += `<TableColumnDef prop="${n}" label="${n}"/>\n`;
|
|
339
341
|
return t;
|
|
340
342
|
}
|
|
341
|
-
var
|
|
343
|
+
var B = {
|
|
342
344
|
loading: 1,
|
|
343
345
|
error: -1,
|
|
344
346
|
empty: 2,
|
|
345
347
|
success: 0
|
|
346
|
-
},
|
|
348
|
+
}, V = {
|
|
347
349
|
name: "PageableTable",
|
|
348
350
|
emits: { "page-loaded": null },
|
|
349
351
|
inheritAttrs: !1,
|
|
350
|
-
props: { ...
|
|
352
|
+
props: { ...R },
|
|
351
353
|
setup(e, { emit: l, attrs: u, slots: d, expose: f }) {
|
|
352
|
-
|
|
353
|
-
let
|
|
354
|
+
O(a, e.rowDbClick);
|
|
355
|
+
let y = ie("table"), S = A({
|
|
354
356
|
hideProps: {},
|
|
355
357
|
fixedProps: {},
|
|
356
358
|
filterableProps: {},
|
|
357
359
|
sortableProps: {}
|
|
358
|
-
}),
|
|
360
|
+
}), C = A(B.empty), w = A([]), D = A(null), k = A(!1), j = A([]), M = A({
|
|
359
361
|
total: 0,
|
|
360
362
|
page: 1,
|
|
361
363
|
limit: e.pageSize,
|
|
362
364
|
ascs: e.ascs,
|
|
363
365
|
descs: e.descs
|
|
364
|
-
}),
|
|
365
|
-
asc:
|
|
366
|
-
desc:
|
|
367
|
-
page:
|
|
368
|
-
limit:
|
|
366
|
+
}), P = A(0), L = A(0), R = v(() => e.reloadOnModelChange ? {
|
|
367
|
+
asc: M.value.ascs,
|
|
368
|
+
desc: M.value.descs,
|
|
369
|
+
page: M.value.page,
|
|
370
|
+
limit: M.value.limit,
|
|
369
371
|
model: e.model
|
|
370
372
|
} : {
|
|
371
|
-
asc:
|
|
372
|
-
desc:
|
|
373
|
-
page:
|
|
374
|
-
limit:
|
|
375
|
-
}),
|
|
373
|
+
asc: M.value.ascs,
|
|
374
|
+
desc: M.value.descs,
|
|
375
|
+
page: M.value.page,
|
|
376
|
+
limit: M.value.limit
|
|
377
|
+
}), z = v(() => {
|
|
376
378
|
var e;
|
|
377
|
-
let t = `${(
|
|
379
|
+
let t = `${(M.value.page - 1) * M.value.limit + (((e = w.value) == null ? void 0 : e.length) ?? 0)}`;
|
|
378
380
|
return t.length > 3 ? 60 + (t.length - 3) * 10 : 60;
|
|
379
|
-
}),
|
|
380
|
-
|
|
381
|
-
},
|
|
381
|
+
}), V = () => {
|
|
382
|
+
U();
|
|
383
|
+
}, H = (t, n, r) => {
|
|
382
384
|
if (e.clickRowSelect && Q(t)) {
|
|
383
385
|
var i;
|
|
384
|
-
if (
|
|
386
|
+
if (j.value.find((n) => n[e.rowKey] === t[e.rowKey])) {
|
|
385
387
|
var a;
|
|
386
|
-
(a =
|
|
388
|
+
(a = y.value) == null || a.toggleRowSelection(t, !1);
|
|
387
389
|
return;
|
|
388
390
|
}
|
|
389
|
-
(i =
|
|
391
|
+
(i = y.value) == null || i.toggleRowSelection(t);
|
|
390
392
|
}
|
|
391
|
-
},
|
|
393
|
+
}, U = () => {
|
|
392
394
|
var e, t;
|
|
393
|
-
let n = (e =
|
|
395
|
+
let n = (e = y.value) == null || (e = e.$children) == null ? void 0 : e.find((e) => {
|
|
394
396
|
var t;
|
|
395
397
|
return ((t = e.$options) == null ? void 0 : t.name) === "ElTableBody";
|
|
396
398
|
});
|
|
397
399
|
n == null || (t = n.$refs) == null || (t = t.tooltip) == null || t.hide();
|
|
398
|
-
},
|
|
399
|
-
|
|
400
|
-
},
|
|
401
|
-
|
|
402
|
-
},
|
|
403
|
-
e.payloadStyle === "body" ? (
|
|
404
|
-
},
|
|
405
|
-
Q(e) && (
|
|
406
|
-
},
|
|
407
|
-
|
|
400
|
+
}, ue = ({ scrollLeft: e, scrollTop: t }) => {
|
|
401
|
+
P.value = t, L.value = e;
|
|
402
|
+
}, de = () => {
|
|
403
|
+
ge(P.value, L.value);
|
|
404
|
+
}, fe = (e) => n(le(e)), pe = ({ prop: t, order: n }) => {
|
|
405
|
+
e.payloadStyle === "body" ? (M.value.ascs = n === "ascending" ? [t] : e.ascs, M.value.descs = n === "descending" ? [t] : e.descs) : (M.value.ascs = n === "ascending" ? t : "", M.value.descs = n === "descending" ? t : "");
|
|
406
|
+
}, me = (e) => {
|
|
407
|
+
Q(e) && (D.value = e);
|
|
408
|
+
}, he = (e) => {
|
|
409
|
+
j.value = e;
|
|
408
410
|
}, W = () => {
|
|
409
411
|
var e;
|
|
410
|
-
(e =
|
|
412
|
+
(e = y.value) == null || e.clearSelection();
|
|
411
413
|
}, G = () => {
|
|
412
414
|
let t;
|
|
413
415
|
return t = e.payloadStyle === "body" ? {
|
|
414
416
|
page: {
|
|
415
|
-
...
|
|
416
|
-
current:
|
|
417
|
-
size:
|
|
417
|
+
...M.value,
|
|
418
|
+
current: M.value.page,
|
|
419
|
+
size: M.value.limit
|
|
418
420
|
},
|
|
419
421
|
example: e.model || {}
|
|
420
422
|
} : {
|
|
421
|
-
...
|
|
422
|
-
current:
|
|
423
|
-
size:
|
|
423
|
+
...M.value,
|
|
424
|
+
current: M.value.page,
|
|
425
|
+
size: M.value.limit,
|
|
424
426
|
...e.model || {}
|
|
425
|
-
}, e.selectExport && (e.rowKey ? t.exportKeys =
|
|
427
|
+
}, e.selectExport && (e.rowKey ? t.exportKeys = j.value.map((t) => t[e.rowKey]) : t.exportKeys = j.value.map((e) => w.value.indexOf(e))), t;
|
|
426
428
|
}, K = async (t = !0) => {
|
|
427
429
|
if (!e.api && e.data !== !1) {
|
|
428
430
|
var n;
|
|
429
|
-
|
|
431
|
+
w.value = e.data, M.value.page = 1, M.value.total = (n = w.value) == null ? void 0 : n.length, M.value.limit = M.value.total < 1 ? e.pageSize : M.value.total;
|
|
430
432
|
return;
|
|
431
433
|
}
|
|
432
|
-
t !== !1 && (
|
|
434
|
+
t !== !1 && (w.value = []);
|
|
433
435
|
let r, i = G();
|
|
434
436
|
if (e.api) {
|
|
435
|
-
t !== !1 && (
|
|
437
|
+
t !== !1 && (C.value = B.loading);
|
|
436
438
|
try {
|
|
437
439
|
e.api && (r = await e.api(i));
|
|
438
440
|
} catch {
|
|
439
|
-
|
|
441
|
+
C.value = B.error;
|
|
440
442
|
return;
|
|
441
443
|
}
|
|
442
444
|
} else if (e.data) r = { data: { data: {
|
|
@@ -451,28 +453,28 @@ var R = {
|
|
|
451
453
|
return;
|
|
452
454
|
}
|
|
453
455
|
let { data: { data: a } = {} } = r || {}, { total: o, records: s } = a || {};
|
|
454
|
-
|
|
456
|
+
M.value.total = Number(o), w.value = await _e(s), !s || !s.length ? C.value = B.empty : C.value = B.success, q(), l("page-loaded", a);
|
|
455
457
|
}, q = () => {
|
|
456
|
-
|
|
458
|
+
re(() => {
|
|
457
459
|
var e;
|
|
458
|
-
(e =
|
|
460
|
+
(e = y.value) == null || e.doLayout();
|
|
459
461
|
});
|
|
460
462
|
}, J = async (e) => {
|
|
461
463
|
await K(e);
|
|
462
464
|
}, Y = () => {
|
|
463
|
-
|
|
465
|
+
M.value = {
|
|
464
466
|
total: 0,
|
|
465
467
|
page: 1,
|
|
466
468
|
limit: e.pageSize,
|
|
467
469
|
ascs: e.ascs,
|
|
468
470
|
descs: e.descs
|
|
469
471
|
};
|
|
470
|
-
},
|
|
471
|
-
|
|
472
|
+
}, ge = (e, t) => {
|
|
473
|
+
y.value.setScrollTop(e), y.value.setScrollLeft(t);
|
|
472
474
|
}, X = (e, t) => {
|
|
473
475
|
var n;
|
|
474
|
-
(n =
|
|
475
|
-
},
|
|
476
|
+
(n = y.value) == null || n.toggleRowSelection(e, t);
|
|
477
|
+
}, _e = async (t) => {
|
|
476
478
|
if (!t) return [];
|
|
477
479
|
let n = [...t];
|
|
478
480
|
for (let t of n) for (let n of e.dicOptions) if (t[`$${n.prop}`] = t[n.prop], n.dicData) {
|
|
@@ -481,20 +483,26 @@ var R = {
|
|
|
481
483
|
} else t[n.prop] = await c(n.dicType, t[n.prop]);
|
|
482
484
|
return n;
|
|
483
485
|
}, Z = () => {
|
|
484
|
-
|
|
486
|
+
k.value = !k.value;
|
|
485
487
|
}, Q = (t) => {
|
|
486
488
|
var n;
|
|
487
489
|
return !(t != null && t.disabled) && !((n = e.disabledRowKeys) != null && n.includes(t == null ? void 0 : t[e.rowKey]));
|
|
488
490
|
};
|
|
489
491
|
e.useVisibilityChange && ee({ onPageVisible: () => {
|
|
490
492
|
J(!1);
|
|
491
|
-
} }),
|
|
493
|
+
} }), ae("reloadTableView", (t) => {
|
|
492
494
|
t === e.viewId && K();
|
|
493
|
-
}),
|
|
495
|
+
}), N(() => e.url, Y), N(() => e.api, Y), N(() => e.data, K), N(() => R.value, K, {
|
|
494
496
|
deep: !0,
|
|
495
497
|
immediate: e.immediate
|
|
496
498
|
});
|
|
497
|
-
let
|
|
499
|
+
let ve = (t) => {
|
|
500
|
+
let n;
|
|
501
|
+
if (F(e.rowKey)) {
|
|
502
|
+
if (n = e.rowKey(t), n) return n;
|
|
503
|
+
} else if (e.rowKey && (n = t[e.rowKey], n)) return n;
|
|
504
|
+
return n = "__rowKey", t[n] || (t[n] = oe(!1)), t[n];
|
|
505
|
+
}, $ = v(() => {
|
|
498
506
|
let t = [];
|
|
499
507
|
if (d.default) {
|
|
500
508
|
var n;
|
|
@@ -507,7 +515,7 @@ var R = {
|
|
|
507
515
|
prop: o,
|
|
508
516
|
allowSort: a !== !1
|
|
509
517
|
};
|
|
510
|
-
i && (l.headerSlot = i.header, l.defaultSlot = i.default, l.expandSlot = i.expand, l.iconSlot = i["filter-icon"]), l.hide =
|
|
518
|
+
i && (l.headerSlot = i.header, l.defaultSlot = i.default, l.expandSlot = i.expand, l.iconSlot = i["filter-icon"]), l.hide = S.value.hideProps[o], l.filterable = S.value.filterableProps[o], l.sortable = S.value.sortableProps[o] === !0, l.fixed = s || S.value.fixedProps[o], t.push(l);
|
|
511
519
|
}
|
|
512
520
|
} else if (e.columns) for (let n = 0; n < e.columns.length; n++) {
|
|
513
521
|
let { prop: r, sortable: i, fixed: a, ...o } = e.columns[n], s = {
|
|
@@ -515,14 +523,14 @@ var R = {
|
|
|
515
523
|
prop: r,
|
|
516
524
|
allowSort: i !== !1
|
|
517
525
|
};
|
|
518
|
-
s.hide =
|
|
526
|
+
s.hide = S.value.hideProps[r], s.filterable = S.value.filterableProps[r], s.sortable = S.value.sortableProps[r] === !0, s.fixed = a || S.value.fixedProps[r], t.push(s);
|
|
519
527
|
}
|
|
520
528
|
return t;
|
|
521
529
|
});
|
|
522
|
-
|
|
523
|
-
|
|
530
|
+
E(() => {
|
|
531
|
+
de();
|
|
524
532
|
}), f({
|
|
525
|
-
records:
|
|
533
|
+
records: w,
|
|
526
534
|
getPage: K,
|
|
527
535
|
refresh: J,
|
|
528
536
|
reload: Y,
|
|
@@ -530,11 +538,11 @@ var R = {
|
|
|
530
538
|
clearSelection: W,
|
|
531
539
|
toggleRowSelection: X,
|
|
532
540
|
toggleSettings: Z,
|
|
533
|
-
currentRow:
|
|
541
|
+
currentRow: D,
|
|
534
542
|
getPageQuery: G,
|
|
535
543
|
tableColumns: $
|
|
536
|
-
}),
|
|
537
|
-
records:
|
|
544
|
+
}), O(o, {
|
|
545
|
+
records: w,
|
|
538
546
|
getPage: K,
|
|
539
547
|
refresh: J,
|
|
540
548
|
reload: Y,
|
|
@@ -543,125 +551,126 @@ var R = {
|
|
|
543
551
|
toggleRowSelection: X,
|
|
544
552
|
toggleSettings: Z
|
|
545
553
|
});
|
|
546
|
-
let { autoBindProps:
|
|
547
|
-
return () => {
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
class
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
554
|
+
let { autoBindProps: ye, listeners: be } = t(e, { predicate: ce });
|
|
555
|
+
return () => x("div", {
|
|
556
|
+
class: [
|
|
557
|
+
"pageable-table",
|
|
558
|
+
{ "auto-height": e.autoHeight },
|
|
559
|
+
u.class
|
|
560
|
+
],
|
|
561
|
+
style: u.style
|
|
562
|
+
}, [x("div", { class: "pageable-table-wrapper" }, [
|
|
563
|
+
d.toolbar && d.toolbar({ selectedRows: j.value }),
|
|
564
|
+
x(h, T(be.value, ye.value, {
|
|
565
|
+
ref: "table",
|
|
566
|
+
data: w.value,
|
|
567
|
+
class: ["flex-item", { "header-bold": e.headerBold }],
|
|
568
|
+
border: e.border,
|
|
569
|
+
stripe: !0,
|
|
570
|
+
rowKey: ve,
|
|
571
|
+
size: "default",
|
|
572
|
+
height: e.autoHeight ? null : "auto",
|
|
573
|
+
onScroll: ue,
|
|
574
|
+
onSortChange: pe,
|
|
575
|
+
onRowDblclick: V,
|
|
576
|
+
onRowClick: H,
|
|
577
|
+
onCellClick: U,
|
|
578
|
+
onCurrentChange: me,
|
|
579
|
+
onSelectionChange: he
|
|
580
|
+
}), {
|
|
581
|
+
default: () => {
|
|
582
|
+
let t = [];
|
|
583
|
+
if (e.multiple && e.selection && t.push(x(g, {
|
|
584
|
+
key: "selection",
|
|
585
|
+
type: "selection",
|
|
586
|
+
selectable: Q,
|
|
587
|
+
width: e.selectionWidth,
|
|
588
|
+
align: "center"
|
|
589
|
+
}, null)), !e.multiple && e.selection && t.push(x(g, {
|
|
590
|
+
key: "single-selection",
|
|
591
|
+
type: "single-selection",
|
|
592
|
+
"class-name": "single-select-column",
|
|
593
|
+
width: e.selectionWidth,
|
|
594
|
+
align: "center"
|
|
595
|
+
}, {
|
|
596
|
+
header: () => x(m, {
|
|
597
|
+
modelValue: !!D.value,
|
|
598
|
+
label: !0
|
|
599
|
+
}, { default: () => [x("span", null, null)] }),
|
|
600
|
+
default: ({ row: t }) => {
|
|
601
|
+
var n;
|
|
602
|
+
let r = e.rowKey || "id";
|
|
603
|
+
return x(m, {
|
|
595
604
|
label: !0,
|
|
596
|
-
disabled: !Q(
|
|
597
|
-
modelValue: n
|
|
598
|
-
}, { default: () => [
|
|
599
|
-
})), e.index && t.push(b(h, {
|
|
600
|
-
key: "index",
|
|
601
|
-
type: "index",
|
|
602
|
-
label: "序号",
|
|
603
|
-
width: L.value,
|
|
604
|
-
align: "center"
|
|
605
|
-
}, { default: ({ $index: e }) => (A.value.page - 1) * A.value.limit + e + 1 || e + 1 })), $.value.length > 0) for (let e = 0; e < $.value.length; e++) {
|
|
606
|
-
let n = $.value[e];
|
|
607
|
-
if (n.hide) continue;
|
|
608
|
-
let { prop: r, headerSlot: i, defaultSlot: a, expandSlot: o, iconSlot: s, ...c } = n;
|
|
609
|
-
t.push(b(se, w(c, { prop: r }), {
|
|
610
|
-
default: d[r] ? ({ row: e }) => d[r]({ row: e }) : a,
|
|
611
|
-
header: i,
|
|
612
|
-
expand: o,
|
|
613
|
-
"filter-icon": s
|
|
614
|
-
}));
|
|
605
|
+
disabled: !Q(t),
|
|
606
|
+
modelValue: ((n = D.value) == null ? void 0 : n[r]) === t[r]
|
|
607
|
+
}, { default: () => [x("span", null, null)] });
|
|
615
608
|
}
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
"
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
"
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
609
|
+
})), e.index && t.push(x(g, {
|
|
610
|
+
key: "index",
|
|
611
|
+
type: "index",
|
|
612
|
+
label: "序号",
|
|
613
|
+
width: z.value,
|
|
614
|
+
align: "center"
|
|
615
|
+
}, { default: ({ $index: e }) => (M.value.page - 1) * M.value.limit + e + 1 || e + 1 })), $.value.length > 0) for (let e = 0; e < $.value.length; e++) {
|
|
616
|
+
let n = $.value[e];
|
|
617
|
+
if (n.hide) continue;
|
|
618
|
+
let { prop: r, headerSlot: i, defaultSlot: a, expandSlot: o, iconSlot: s, ...c } = n;
|
|
619
|
+
t.push(x(se, T(c, { prop: r }), {
|
|
620
|
+
default: d[r] ? ({ row: e }) => d[r]({ row: e }) : a,
|
|
621
|
+
header: i,
|
|
622
|
+
expand: o,
|
|
623
|
+
"filter-icon": s
|
|
624
|
+
}));
|
|
625
|
+
}
|
|
626
|
+
else t.push(x(g, {
|
|
627
|
+
key: "default",
|
|
628
|
+
label: "点击表格行复制模板"
|
|
629
|
+
}, { default: ({ row: e }) => x("pre", {
|
|
630
|
+
class: "pointer",
|
|
631
|
+
onClick: () => fe(e)
|
|
632
|
+
}, [JSON.stringify(e, null, " ")]) }));
|
|
633
|
+
return t;
|
|
634
|
+
},
|
|
635
|
+
empty: () => d.empty ? d.empty() : x(_, null, [
|
|
636
|
+
C.value === B.loading && x("span", { class: "pageable-table-loading" }, [x("i", { class: "table-status-icon el-icon-loading" }, null), b("加载中...")]),
|
|
637
|
+
C.value === B.error && x(s, {
|
|
638
|
+
class: "pageable-table-error",
|
|
639
|
+
onClick: J
|
|
640
|
+
}, { default: () => [x("i", { class: "table-status-icon el-icon-error" }, null), b("加载失败,点击重试!")] }),
|
|
641
|
+
C.value !== B.loading && C.value !== B.error && x(te, null, null)
|
|
642
|
+
]),
|
|
643
|
+
append: d.append
|
|
644
|
+
}),
|
|
645
|
+
e.paging && x(p, {
|
|
646
|
+
"current-page": M.value.page,
|
|
647
|
+
"onUpdate:current-page": (e) => M.value.page = e,
|
|
648
|
+
"hide-on-single-page": e.hideOnSinglePage,
|
|
649
|
+
"page-size": M.value.limit,
|
|
650
|
+
"onUpdate:page-size": (e) => M.value.limit = e,
|
|
651
|
+
total: M.value.total,
|
|
652
|
+
"page-sizes": [
|
|
653
|
+
10,
|
|
654
|
+
25,
|
|
655
|
+
50,
|
|
656
|
+
100,
|
|
657
|
+
500,
|
|
658
|
+
1e3,
|
|
659
|
+
2e3
|
|
660
|
+
],
|
|
661
|
+
class: "flex-not-shrink",
|
|
662
|
+
background: !0,
|
|
663
|
+
layout: "total, sizes, prev, pager, next, jumper"
|
|
664
|
+
}, null),
|
|
665
|
+
x(I, {
|
|
666
|
+
settings: S.value,
|
|
667
|
+
"onUpdate:settings": (e) => S.value = e,
|
|
668
|
+
modelValue: k.value,
|
|
669
|
+
"onUpdate:modelValue": (e) => k.value = e,
|
|
670
|
+
columns: $.value
|
|
671
|
+
}, null)
|
|
672
|
+
]), x(i, { onNotify: q }, null)]);
|
|
664
673
|
}
|
|
665
674
|
};
|
|
666
675
|
//#endregion
|
|
667
|
-
export {
|
|
676
|
+
export { V as t };
|