@web-utils/form-ui 1.0.0-beta50 → 1.0.0-beta51
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/{zwXzk9ff2.mjs → BG8z3V9d2.mjs} +204 -129
- package/chunks/{kflKDW4T2.mjs → BQk3-Ppb2.mjs} +1 -1
- package/chunks/{hzaYr6Ud2.mjs → BQyL45PF2.mjs} +1 -1
- package/chunks/{Cln3RBAD.mjs → BWh6u1O0.mjs} +1 -1
- package/chunks/{Dkd5BC98.mjs → Bwbtu2cp.mjs} +0 -4
- package/chunks/{vXQf89tS.mjs → C7G-cAoI.mjs} +1 -1
- package/chunks/{BUGCiCnl.mjs → CXsoKP22.mjs} +4 -1
- package/chunks/{CqoVAnxC2.mjs → CqVd8D222.mjs} +0 -4
- package/chunks/{BA2KEptL.mjs → DKwp6AMl.mjs} +0 -4
- package/chunks/{D0Zg2CV0.mjs → D_Fs3bkZ.mjs} +1 -1
- package/chunks/{CxTg0r4n.mjs → Dt3lfDnL.mjs} +1 -1
- package/chunks/{cqIZWDHo.mjs → YFiU0ngn.mjs} +174 -166
- package/chunks/{B-zqRAXo.mjs → wDS9KBFw.mjs} +2 -4
- package/confirm-button/index.d.ts +9 -2
- package/confirm-button/index.mjs +1 -1
- package/confirmable/index.d.ts +9 -2
- package/confirmable/index.mjs +1 -1
- package/constants/index.d.ts +1 -0
- package/constants/index.mjs +2 -2
- package/editable-tree/index.mjs +1 -1
- package/form-button/index.d.ts +9 -2
- package/form-cascader/index.d.ts +8 -8
- package/form-cascader/index.mjs +1 -1
- package/form-input-cron-expression/index.mjs +1 -1
- package/form-input-time/index.d.ts +8 -8
- package/form-input-time/index.mjs +1 -1
- package/form-table-plus/index.mjs +1 -1
- package/form-time-select/index.d.ts +8 -8
- package/form-time-select/index.mjs +1 -1
- package/index.css +1 -1
- package/index.mjs +12 -12
- package/package.json +1 -1
- package/pageable-table/index.d.ts +2 -0
- package/pageable-table/index.mjs +1 -1
- package/pageable-table/style.css +1 -1
- package/sub-table/index.mjs +154 -89
- package/sub-table-plus/index.d.ts +4 -1
- package/sub-table-plus/index.mjs +1 -1
- package/table-column/index.mjs +1 -1
- package/table-view/index.d.ts +2 -1
- package/table-view/index.mjs +111 -108
- package/toolbar/index.mjs +1 -1
- package/toolbar-button/index.d.ts +2 -2
- package/toolbar-button/index.mjs +1 -1
- package/vue-cron/index.mjs +1 -1
- package/web-types.json +1 -1
- package/x-input-tag/index.mjs +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as e } from "./
|
|
1
|
+
import { t as e } from "./Dt3lfDnL.mjs";
|
|
2
2
|
import { t } from "./CkOD-_VV.mjs";
|
|
3
3
|
import { copy as n } from "@web-utils/core";
|
|
4
4
|
import { Fragment as r, createBlock as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createTextVNode as c, createVNode as l, openBlock as u, renderList as d, toDisplayString as f, withCtx as p } from "vue";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { i as e, n as t } from "./D_qiRmiE.mjs";
|
|
2
2
|
import { n, t as r } from "./CJdkjadi.mjs";
|
|
3
|
-
import { t as i } from "./
|
|
3
|
+
import { t as i } from "./C7G-cAoI.mjs";
|
|
4
4
|
import { createVNode as a, mergeProps as o, ref as s } from "vue";
|
|
5
5
|
import { ElInput as c, ElPopover as l } from "element-plus/es";
|
|
6
6
|
//#region src/components/form/props/input-cron.ts
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import { d as e, n as t, r as n } from "./DcTVYqeJ.mjs";
|
|
2
2
|
import { getDictLabel as r } from "../helper/dictionary.mjs";
|
|
3
|
-
import {
|
|
4
|
-
import { t as
|
|
5
|
-
import
|
|
6
|
-
import { t as
|
|
7
|
-
import { useVisibilityChange as
|
|
8
|
-
import "
|
|
9
|
-
import { Fragment as l, computed as u, createBlock as d, createTextVNode as f, createVNode as p, inject as m, isVNode as h, mergeModels as g, mergeProps as _, nextTick as v, onUpdated as ee, openBlock as y, provide as te, reactive as b, ref as x, toDisplayString as S, useModel as C, useTemplateRef as w, watch as T, withCtx as E } from "vue";
|
|
3
|
+
import { cellClickHandlerContextKey as i, pageableTableContextKey as a } from "../constants/index.mjs";
|
|
4
|
+
import { t as o } from "./Dt3lfDnL.mjs";
|
|
5
|
+
import s from "../element-resize-observer/index.mjs";
|
|
6
|
+
import { t as c } from "./wDS9KBFw.mjs";
|
|
7
|
+
import { useVisibilityChange as l } from "../hook/useVisibilityChange.mjs";
|
|
8
|
+
import { Fragment as ee, computed as u, createBlock as d, createTextVNode as f, createVNode as p, inject as m, isVNode as h, mergeModels as g, mergeProps as _, nextTick as v, onUpdated as te, openBlock as y, provide as b, reactive as x, ref as S, toDisplayString as C, useModel as w, useTemplateRef as T, watch as E, withCtx as D } from "vue";
|
|
10
9
|
import { ElMessage as ne } from "element-plus";
|
|
11
|
-
import { ElCheckbox as
|
|
12
|
-
import { useEventBus as
|
|
10
|
+
import { ElCheckbox as O, ElDrawer as k, ElEmpty as A, ElPagination as re, ElRadio as j, ElTable as M, ElTableColumn as N } from "element-plus/es";
|
|
11
|
+
import { useEventBus as ie } from "@web-utils/vue/hooks/useEventBus";
|
|
13
12
|
//#region src/components/table/components/TableColumnFilter.vue
|
|
14
|
-
var
|
|
13
|
+
var ae = /* @__PURE__ */ Object.assign({ name: "TableColumnFilter" }, {
|
|
15
14
|
__name: "TableColumnFilter",
|
|
16
15
|
props: /* @__PURE__ */ g({ columns: {
|
|
17
16
|
type: Array,
|
|
@@ -25,7 +24,7 @@ var oe = /* @__PURE__ */ Object.assign({ name: "TableColumnFilter" }, {
|
|
|
25
24
|
}),
|
|
26
25
|
emits: ["update:modelValue"],
|
|
27
26
|
setup(e, { expose: t }) {
|
|
28
|
-
let n =
|
|
27
|
+
let n = w(e, "modelValue"), r = x({}), i = x({}), a = x({}), o = x({}), s = (e, t, n) => {
|
|
29
28
|
n === "hide" ? r[t.prop] = e : n === "fixed" ? i[t.prop] = e : n === "filterable" ? a[t.prop] = e : n === "sortable" && (o[t.prop] = e);
|
|
30
29
|
};
|
|
31
30
|
return t({
|
|
@@ -34,7 +33,7 @@ var oe = /* @__PURE__ */ Object.assign({ name: "TableColumnFilter" }, {
|
|
|
34
33
|
filterableProps: a,
|
|
35
34
|
sortableProps: o
|
|
36
35
|
}), (t, r) => {
|
|
37
|
-
let i =
|
|
36
|
+
let i = N, a = O, o = M, c = k;
|
|
38
37
|
return y(), d(c, {
|
|
39
38
|
modelValue: n.value,
|
|
40
39
|
"onUpdate:modelValue": r[0] || (r[0] = (e) => n.value = e),
|
|
@@ -42,41 +41,41 @@ var oe = /* @__PURE__ */ Object.assign({ name: "TableColumnFilter" }, {
|
|
|
42
41
|
title: "表格设置",
|
|
43
42
|
"append-to-body": ""
|
|
44
43
|
}, {
|
|
45
|
-
default:
|
|
44
|
+
default: D(() => [p(o, {
|
|
46
45
|
data: e.columns,
|
|
47
46
|
border: ""
|
|
48
47
|
}, {
|
|
49
|
-
default:
|
|
48
|
+
default: D(() => [
|
|
50
49
|
p(i, { label: "列名" }, {
|
|
51
|
-
default:
|
|
50
|
+
default: D(({ row: e }) => [f(C(e.label), 1)]),
|
|
52
51
|
_: 1
|
|
53
52
|
}),
|
|
54
53
|
p(i, {
|
|
55
54
|
label: "隐藏",
|
|
56
55
|
align: "center"
|
|
57
56
|
}, {
|
|
58
|
-
default:
|
|
57
|
+
default: D(({ row: e }) => [p(a, { onChange: (t) => s(t, e, "hide") }, null, 8, ["onChange"])]),
|
|
59
58
|
_: 1
|
|
60
59
|
}),
|
|
61
60
|
p(i, {
|
|
62
61
|
label: "冻结",
|
|
63
62
|
align: "center"
|
|
64
63
|
}, {
|
|
65
|
-
default:
|
|
64
|
+
default: D(({ row: e }) => [p(a, { onChange: (t) => s(t, e, "fixed") }, null, 8, ["onChange"])]),
|
|
66
65
|
_: 1
|
|
67
66
|
}),
|
|
68
67
|
p(i, {
|
|
69
68
|
label: "过滤",
|
|
70
69
|
align: "center"
|
|
71
70
|
}, {
|
|
72
|
-
default:
|
|
71
|
+
default: D(({ row: e }) => [p(a, { onChange: (t) => s(t, e, "filterable") }, null, 8, ["onChange"])]),
|
|
73
72
|
_: 1
|
|
74
73
|
}),
|
|
75
74
|
p(i, {
|
|
76
75
|
label: "排序",
|
|
77
76
|
align: "center"
|
|
78
77
|
}, {
|
|
79
|
-
default:
|
|
78
|
+
default: D(({ row: e }) => [p(a, {
|
|
80
79
|
title: e.allowSort ? null : "该列不支持排序!",
|
|
81
80
|
disabled: !e.allowSort,
|
|
82
81
|
onChange: (t) => s(t, e, "sortable")
|
|
@@ -97,19 +96,19 @@ var oe = /* @__PURE__ */ Object.assign({ name: "TableColumnFilter" }, {
|
|
|
97
96
|
});
|
|
98
97
|
//#endregion
|
|
99
98
|
//#region src/components/table/components/TableColumnFilterable.vue?vue&type=script&lang.jsx
|
|
100
|
-
function
|
|
99
|
+
function P(e) {
|
|
101
100
|
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !h(e);
|
|
102
101
|
}
|
|
103
102
|
//#endregion
|
|
104
103
|
//#region src/components/table/components/TableColumnFilterable.vue
|
|
105
|
-
var
|
|
104
|
+
var F = {
|
|
106
105
|
name: "TableColumnFilterable",
|
|
107
106
|
props: {
|
|
108
107
|
filterable: Boolean,
|
|
109
108
|
prop: String
|
|
110
109
|
},
|
|
111
110
|
setup(e, { attrs: t, slots: n }) {
|
|
112
|
-
let r = m(
|
|
111
|
+
let r = m(a, null), i = u(() => {
|
|
113
112
|
if (e.filterable && r) return (e, t, n) => t[n.property] === e;
|
|
114
113
|
}), o = u(() => {
|
|
115
114
|
if (e.filterable && r) return [...new Set(r.records.value.map((t) => t[e.prop]).filter((e) => e))].map((e) => ({
|
|
@@ -117,14 +116,14 @@ var N = {
|
|
|
117
116
|
value: e
|
|
118
117
|
}));
|
|
119
118
|
});
|
|
120
|
-
return () => p(
|
|
119
|
+
return () => p(c, _(t, {
|
|
121
120
|
prop: e.prop,
|
|
122
121
|
filterable: e.filterable,
|
|
123
|
-
filterMethod:
|
|
122
|
+
filterMethod: i.value,
|
|
124
123
|
filters: o.value
|
|
125
|
-
}),
|
|
124
|
+
}), P(n) ? n : { default: () => [n] });
|
|
126
125
|
}
|
|
127
|
-
},
|
|
126
|
+
}, I = {
|
|
128
127
|
data: {
|
|
129
128
|
type: Array,
|
|
130
129
|
default: () => []
|
|
@@ -298,113 +297,115 @@ var N = {
|
|
|
298
297
|
payloadStyle: String,
|
|
299
298
|
disabledRowKeys: Array,
|
|
300
299
|
selectExport: Boolean,
|
|
301
|
-
useVisibilityChange: Boolean
|
|
302
|
-
|
|
300
|
+
useVisibilityChange: Boolean,
|
|
301
|
+
rowDbClick: Function
|
|
302
|
+
}, L = { data: !0 }, oe = (e) => L[e] !== !0;
|
|
303
303
|
//#endregion
|
|
304
304
|
//#region src/components/table/PageableTable.vue?vue&type=script&lang.jsx
|
|
305
|
-
function
|
|
305
|
+
function se(e) {
|
|
306
306
|
let t = "";
|
|
307
307
|
for (let n in e) t += `<TableColumnDef prop="${n}" label="${n}"/>\n`;
|
|
308
308
|
return t;
|
|
309
309
|
}
|
|
310
|
-
var
|
|
310
|
+
var R = {
|
|
311
311
|
loading: 1,
|
|
312
312
|
error: -1,
|
|
313
313
|
empty: 2,
|
|
314
314
|
success: 0
|
|
315
|
-
},
|
|
315
|
+
}, z = {
|
|
316
316
|
name: "PageableTable",
|
|
317
317
|
emits: { "page-loaded": null },
|
|
318
318
|
inheritAttrs: !1,
|
|
319
|
-
props: { ...
|
|
320
|
-
setup(
|
|
321
|
-
|
|
319
|
+
props: { ...I },
|
|
320
|
+
setup(c, { emit: d, attrs: m, slots: h, expose: g }) {
|
|
321
|
+
b(i, c.rowDbClick);
|
|
322
|
+
let y = T("table"), x = T("settingPanel"), C = S(R.empty), w = S([]), D = S(null), O = S(!1), k = S([]), P = S({
|
|
322
323
|
total: 0,
|
|
323
324
|
page: 1,
|
|
324
|
-
limit:
|
|
325
|
-
ascs:
|
|
326
|
-
descs:
|
|
327
|
-
}),
|
|
328
|
-
asc:
|
|
329
|
-
desc:
|
|
330
|
-
page:
|
|
331
|
-
limit:
|
|
332
|
-
model:
|
|
325
|
+
limit: c.pageSize,
|
|
326
|
+
ascs: c.ascs,
|
|
327
|
+
descs: c.descs
|
|
328
|
+
}), I = S(0), L = S(0), z = u(() => c.reloadOnModelChange ? {
|
|
329
|
+
asc: P.value.ascs,
|
|
330
|
+
desc: P.value.descs,
|
|
331
|
+
page: P.value.page,
|
|
332
|
+
limit: P.value.limit,
|
|
333
|
+
model: c.model
|
|
333
334
|
} : {
|
|
334
|
-
asc:
|
|
335
|
-
desc:
|
|
336
|
-
page:
|
|
337
|
-
limit:
|
|
338
|
-
}),
|
|
335
|
+
asc: P.value.ascs,
|
|
336
|
+
desc: P.value.descs,
|
|
337
|
+
page: P.value.page,
|
|
338
|
+
limit: P.value.limit
|
|
339
|
+
}), B = u(() => {
|
|
339
340
|
var e;
|
|
340
|
-
let t = `${(
|
|
341
|
+
let t = `${(P.value.page - 1) * P.value.limit + (((e = w.value) == null ? void 0 : e.length) ?? 0)}`;
|
|
341
342
|
return t.length > 3 ? 60 + (t.length - 3) * 10 : 60;
|
|
342
|
-
}),
|
|
343
|
-
|
|
344
|
-
},
|
|
345
|
-
if (
|
|
343
|
+
}), V = () => {
|
|
344
|
+
U();
|
|
345
|
+
}, H = (e, t, n) => {
|
|
346
|
+
if (c.clickRowSelect && $(e)) {
|
|
346
347
|
var r;
|
|
347
|
-
if (
|
|
348
|
+
if (k.value.find((t) => t[c.rowKey] === e[c.rowKey])) {
|
|
348
349
|
var i;
|
|
349
350
|
(i = y.value) == null || i.toggleRowSelection(e, !1);
|
|
350
351
|
return;
|
|
351
352
|
}
|
|
352
353
|
(r = y.value) == null || r.toggleRowSelection(e);
|
|
353
354
|
}
|
|
354
|
-
},
|
|
355
|
+
}, U = () => {
|
|
355
356
|
var e, t;
|
|
356
357
|
let n = (e = y.value) == null || (e = e.$children) == null ? void 0 : e.find((e) => {
|
|
357
358
|
var t;
|
|
358
359
|
return ((t = e.$options) == null ? void 0 : t.name) === "ElTableBody";
|
|
359
360
|
});
|
|
360
361
|
n == null || (t = n.$refs) == null || (t = t.tooltip) == null || t.hide();
|
|
361
|
-
},
|
|
362
|
-
|
|
363
|
-
},
|
|
364
|
-
|
|
365
|
-
},
|
|
366
|
-
|
|
362
|
+
}, W = ({ scrollLeft: e, scrollTop: t }) => {
|
|
363
|
+
I.value = t, L.value = e;
|
|
364
|
+
}, G = () => {
|
|
365
|
+
pe(I.value, L.value);
|
|
366
|
+
}, ce = (e) => t(se(e)), le = ({ prop: e, order: t }) => {
|
|
367
|
+
c.payloadStyle === "body" ? (P.value.ascs = t === "ascending" ? [e] : c.ascs, P.value.descs = t === "descending" ? [e] : c.descs) : (P.value.ascs = t === "ascending" ? e : "", P.value.descs = t === "descending" ? e : "");
|
|
367
368
|
}, ue = (e) => {
|
|
368
|
-
$(e) && (
|
|
369
|
+
$(e) && (D.value = e);
|
|
369
370
|
}, de = (e) => {
|
|
370
|
-
|
|
371
|
-
},
|
|
371
|
+
k.value = e;
|
|
372
|
+
}, K = () => {
|
|
372
373
|
var e;
|
|
373
374
|
(e = y.value) == null || e.clearSelection();
|
|
374
375
|
}, fe = () => {
|
|
375
376
|
let e;
|
|
376
|
-
return e =
|
|
377
|
+
return e = c.payloadStyle === "body" ? {
|
|
377
378
|
page: {
|
|
378
|
-
...
|
|
379
|
-
current:
|
|
380
|
-
size:
|
|
379
|
+
...P.value,
|
|
380
|
+
current: P.value.page,
|
|
381
|
+
size: P.value.limit
|
|
381
382
|
},
|
|
382
|
-
example:
|
|
383
|
+
example: c.model || {}
|
|
383
384
|
} : {
|
|
384
|
-
...
|
|
385
|
-
current:
|
|
386
|
-
size:
|
|
387
|
-
...
|
|
388
|
-
},
|
|
389
|
-
},
|
|
390
|
-
if (!
|
|
385
|
+
...P.value,
|
|
386
|
+
current: P.value.page,
|
|
387
|
+
size: P.value.limit,
|
|
388
|
+
...c.model || {}
|
|
389
|
+
}, c.selectExport && (c.rowKey ? e.exportKeys = k.value.map((e) => e[c.rowKey]) : e.exportKeys = k.value.map((e) => w.value.indexOf(e))), e;
|
|
390
|
+
}, q = async (e = !0) => {
|
|
391
|
+
if (!c.api && c.data !== !1) {
|
|
391
392
|
var t;
|
|
392
|
-
|
|
393
|
+
w.value = c.data, P.value.page = 1, P.value.total = (t = w.value) == null ? void 0 : t.length, P.value.limit = P.value.total;
|
|
393
394
|
return;
|
|
394
395
|
}
|
|
395
|
-
e !== !1 && (
|
|
396
|
+
e !== !1 && (w.value = []);
|
|
396
397
|
let n, r = fe();
|
|
397
|
-
if (
|
|
398
|
-
e !== !1 && (
|
|
398
|
+
if (c.api) {
|
|
399
|
+
e !== !1 && (C.value = R.loading);
|
|
399
400
|
try {
|
|
400
|
-
|
|
401
|
+
c.api && (n = await c.api(r));
|
|
401
402
|
} catch {
|
|
402
|
-
|
|
403
|
+
C.value = R.error;
|
|
403
404
|
return;
|
|
404
405
|
}
|
|
405
|
-
} else if (
|
|
406
|
-
total:
|
|
407
|
-
records:
|
|
406
|
+
} else if (c.data) n = { data: { data: {
|
|
407
|
+
total: c.data.length,
|
|
408
|
+
records: c.data
|
|
408
409
|
} } };
|
|
409
410
|
else {
|
|
410
411
|
ne.warning({
|
|
@@ -414,73 +415,73 @@ var I = {
|
|
|
414
415
|
return;
|
|
415
416
|
}
|
|
416
417
|
let { data: { data: i } = {} } = n || {}, { total: a, records: o } = i || {};
|
|
417
|
-
|
|
418
|
-
},
|
|
418
|
+
P.value.total = Number(a), w.value = await me(o), !o || !o.length ? C.value = R.empty : C.value = R.success, J(), d("page-loaded", i);
|
|
419
|
+
}, J = () => {
|
|
419
420
|
v(() => {
|
|
420
421
|
var e;
|
|
421
422
|
(e = y.value) == null || e.doLayout();
|
|
422
423
|
});
|
|
423
|
-
},
|
|
424
|
-
await
|
|
425
|
-
},
|
|
426
|
-
|
|
424
|
+
}, Y = async (e) => {
|
|
425
|
+
await q(e);
|
|
426
|
+
}, X = () => {
|
|
427
|
+
P.value = {
|
|
427
428
|
total: 0,
|
|
428
429
|
page: 1,
|
|
429
|
-
limit:
|
|
430
|
-
ascs:
|
|
431
|
-
descs:
|
|
430
|
+
limit: c.pageSize,
|
|
431
|
+
ascs: c.ascs,
|
|
432
|
+
descs: c.descs
|
|
432
433
|
};
|
|
433
|
-
},
|
|
434
|
+
}, pe = (e, t) => {
|
|
434
435
|
y.value.setScrollTop(e), y.value.setScrollLeft(t);
|
|
435
436
|
}, Z = (e, t) => {
|
|
436
437
|
var n;
|
|
437
438
|
(n = y.value) == null || n.toggleRowSelection(e, t);
|
|
438
|
-
},
|
|
439
|
+
}, me = async (e) => {
|
|
439
440
|
if (!e) return [];
|
|
440
441
|
let t = [...e];
|
|
441
|
-
for (let e of t) for (let t of
|
|
442
|
+
for (let e of t) for (let t of c.dicOptions) if (e[`$${t.prop}`] = e[t.prop], t.dicData) {
|
|
442
443
|
var n;
|
|
443
444
|
e[t.prop] = ((n = t.dicData.find((n) => n.modelValue === e[t.prop])) == null ? void 0 : n.label) || e[t.prop];
|
|
444
445
|
} else e[t.prop] = await r(t.dicType, e[t.prop]);
|
|
445
446
|
return t;
|
|
446
447
|
}, Q = () => {
|
|
447
|
-
|
|
448
|
+
O.value = !O.value;
|
|
448
449
|
}, $ = (e) => {
|
|
449
450
|
var t;
|
|
450
|
-
return !(e != null && e.disabled) && !((t =
|
|
451
|
+
return !(e != null && e.disabled) && !((t = c.disabledRowKeys) != null && t.includes(e == null ? void 0 : e[c.rowKey]));
|
|
451
452
|
};
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
} }),
|
|
455
|
-
e ===
|
|
456
|
-
}),
|
|
453
|
+
c.useVisibilityChange && l({ onPageVisible: () => {
|
|
454
|
+
Y(!1);
|
|
455
|
+
} }), ie("reloadTableView", (e) => {
|
|
456
|
+
e === c.viewId && q();
|
|
457
|
+
}), E(() => c.url, X), E(() => c.api, X), E(() => c.data, q), E(() => z.value, q, {
|
|
457
458
|
deep: !0,
|
|
458
|
-
immediate:
|
|
459
|
-
}),
|
|
460
|
-
|
|
459
|
+
immediate: c.immediate
|
|
460
|
+
}), te(() => {
|
|
461
|
+
G();
|
|
461
462
|
}), g({
|
|
462
|
-
records:
|
|
463
|
-
getPage:
|
|
464
|
-
refresh:
|
|
465
|
-
reload:
|
|
466
|
-
doLayout:
|
|
467
|
-
clearSelection:
|
|
463
|
+
records: w,
|
|
464
|
+
getPage: q,
|
|
465
|
+
refresh: Y,
|
|
466
|
+
reload: X,
|
|
467
|
+
doLayout: J,
|
|
468
|
+
clearSelection: K,
|
|
468
469
|
toggleRowSelection: Z,
|
|
469
470
|
toggleSettings: Q
|
|
470
|
-
}),
|
|
471
|
-
records:
|
|
472
|
-
getPage:
|
|
473
|
-
refresh:
|
|
474
|
-
reload:
|
|
475
|
-
doLayout:
|
|
476
|
-
clearSelection:
|
|
471
|
+
}), b(a, {
|
|
472
|
+
records: w,
|
|
473
|
+
getPage: q,
|
|
474
|
+
refresh: Y,
|
|
475
|
+
reload: X,
|
|
476
|
+
doLayout: J,
|
|
477
|
+
clearSelection: K,
|
|
477
478
|
toggleRowSelection: Z,
|
|
478
479
|
toggleSettings: Q
|
|
479
480
|
});
|
|
480
|
-
let { autoBindProps:
|
|
481
|
+
let { autoBindProps: he, listeners: ge } = e(c, { predicate: oe });
|
|
481
482
|
return () => {
|
|
482
483
|
var e;
|
|
483
|
-
let t =
|
|
484
|
+
let t = D.value && D.value[m["row-key"] || c.rowKey || "id"] === (D.value && c.rowKey ? D.value[c.rowKey] : (e = D.value) == null ? void 0 : e.id), r = [];
|
|
484
485
|
if (h.default) {
|
|
485
486
|
var i;
|
|
486
487
|
let e = n((i = h.default) == null ? void 0 : i.call(h));
|
|
@@ -494,99 +495,106 @@ var I = {
|
|
|
494
495
|
};
|
|
495
496
|
i && (l.headerSlot = i.header, l.defaultSlot = i.default, l.expandSlot = i.expand, l.iconSlot = i["filter-icon"]), r.push(l);
|
|
496
497
|
}
|
|
497
|
-
} else if (
|
|
498
|
-
let { prop: t, sortable: n, fixed: i, ...a } =
|
|
498
|
+
} else if (c.columns) for (let e = 0; e < c.columns.length; e++) {
|
|
499
|
+
let { prop: t, sortable: n, fixed: i, ...a } = c.columns[e], o = {
|
|
499
500
|
...a,
|
|
500
501
|
prop: t,
|
|
501
502
|
allowSort: n !== !1
|
|
502
503
|
};
|
|
503
|
-
|
|
504
|
+
x.value && (o.hide = x.value.hideProps[t], o.filterable = x.value.filterableProps[t], o.sortable = x.value.sortableProps[t] === !0, o.fixed = i || x.value.fixedProps[t]), r.push(o);
|
|
504
505
|
}
|
|
505
|
-
return p("div", {
|
|
506
|
-
|
|
507
|
-
|
|
506
|
+
return p("div", {
|
|
507
|
+
class: [
|
|
508
|
+
"pageable-table",
|
|
509
|
+
{ "auto-height": c.autoHeight },
|
|
510
|
+
m.class
|
|
511
|
+
],
|
|
512
|
+
style: m.style
|
|
513
|
+
}, [p("div", { class: "pageable-table-wrapper" }, [
|
|
514
|
+
h.toolbar && h.toolbar({ selectedRows: k.value }),
|
|
515
|
+
p(M, _(ge.value, he.value, {
|
|
508
516
|
ref: "table",
|
|
509
|
-
data:
|
|
510
|
-
class: ["flex-item", { "header-bold":
|
|
511
|
-
border:
|
|
517
|
+
data: w.value,
|
|
518
|
+
class: ["flex-item", { "header-bold": c.headerBold }],
|
|
519
|
+
border: c.border,
|
|
512
520
|
stripe: !0,
|
|
513
521
|
size: "default",
|
|
514
|
-
height:
|
|
515
|
-
onScroll:
|
|
522
|
+
height: c.autoHeight ? null : "auto",
|
|
523
|
+
onScroll: W,
|
|
516
524
|
onSortChange: le,
|
|
517
|
-
onRowDblclick:
|
|
518
|
-
onRowClick:
|
|
519
|
-
onCellClick:
|
|
525
|
+
onRowDblclick: V,
|
|
526
|
+
onRowClick: H,
|
|
527
|
+
onCellClick: U,
|
|
520
528
|
onCurrentChange: ue,
|
|
521
529
|
onSelectionChange: de
|
|
522
530
|
}), {
|
|
523
531
|
default: () => {
|
|
524
532
|
let e = [];
|
|
525
|
-
if (
|
|
533
|
+
if (c.multiple && c.selection && e.push(p(N, {
|
|
526
534
|
key: "selection",
|
|
527
535
|
type: "selection",
|
|
528
536
|
selectable: $,
|
|
529
|
-
width:
|
|
537
|
+
width: c.selectionWidth,
|
|
530
538
|
align: "center"
|
|
531
|
-
}, null)), !
|
|
539
|
+
}, null)), !c.multiple && c.selection && e.push(p(N, {
|
|
532
540
|
key: "single-selection",
|
|
533
541
|
type: "single-selection",
|
|
534
542
|
"class-name": "single-select-column",
|
|
535
|
-
width:
|
|
543
|
+
width: c.selectionWidth,
|
|
536
544
|
align: "center"
|
|
537
545
|
}, {
|
|
538
|
-
header: () => p(
|
|
539
|
-
modelValue: !!
|
|
546
|
+
header: () => p(j, {
|
|
547
|
+
modelValue: !!D.value,
|
|
540
548
|
label: !0
|
|
541
549
|
}, { default: () => [p("span", null, null)] }),
|
|
542
|
-
default: ({ row: e }) => p(
|
|
550
|
+
default: ({ row: e }) => p(j, {
|
|
543
551
|
label: !0,
|
|
544
552
|
disabled: !$(e),
|
|
545
553
|
modelValue: t
|
|
546
554
|
}, { default: () => [p("span", null, null)] })
|
|
547
|
-
})),
|
|
555
|
+
})), c.index && e.push(p(N, {
|
|
548
556
|
key: "index",
|
|
549
557
|
type: "index",
|
|
550
558
|
label: "序号",
|
|
551
|
-
width:
|
|
559
|
+
width: B.value,
|
|
552
560
|
align: "center"
|
|
553
|
-
}, { default: ({ $index: e }) => (
|
|
561
|
+
}, { default: ({ $index: e }) => (P.value.page - 1) * P.value.limit + e + 1 || e + 1 })), r.length > 0) for (let t = 0; t < r.length; t++) {
|
|
554
562
|
let n = r[t];
|
|
555
563
|
if (n.hide) continue;
|
|
556
564
|
let { prop: i, headerSlot: a, defaultSlot: o, expandSlot: s, iconSlot: c, ...l } = n;
|
|
557
|
-
e.push(p(
|
|
565
|
+
e.push(p(F, _(l, { prop: i }), {
|
|
558
566
|
default: h[i] ? ({ row: e }) => h[i]({ row: e }) : o,
|
|
559
567
|
header: a,
|
|
560
568
|
expand: s,
|
|
561
569
|
"filter-icon": c
|
|
562
570
|
}));
|
|
563
571
|
}
|
|
564
|
-
else e.push(p(
|
|
572
|
+
else e.push(p(N, {
|
|
565
573
|
key: "default",
|
|
566
574
|
label: "点击表格行复制模板"
|
|
567
575
|
}, { default: ({ row: e }) => p("pre", {
|
|
568
576
|
class: "pointer",
|
|
569
|
-
onClick: () =>
|
|
577
|
+
onClick: () => ce(e)
|
|
570
578
|
}, [JSON.stringify(e, null, " ")]) }));
|
|
571
579
|
return e;
|
|
572
580
|
},
|
|
573
|
-
empty: () => h.empty ? h.empty() : p(
|
|
574
|
-
|
|
575
|
-
|
|
581
|
+
empty: () => h.empty ? h.empty() : p(ee, null, [
|
|
582
|
+
C.value === R.loading && p("span", { class: "pageable-table-loading" }, [p("i", { class: "table-status-icon el-icon-loading" }, null), f("加载中...")]),
|
|
583
|
+
C.value === R.error && p(o, {
|
|
576
584
|
class: "pageable-table-error",
|
|
577
|
-
onClick:
|
|
585
|
+
onClick: Y
|
|
578
586
|
}, { default: () => [p("i", { class: "table-status-icon el-icon-error" }, null), f("加载失败,点击重试!")] }),
|
|
579
|
-
|
|
587
|
+
C.value !== R.loading && C.value !== R.error && p(A, null, null)
|
|
580
588
|
]),
|
|
581
589
|
append: h.append
|
|
582
590
|
}),
|
|
583
|
-
|
|
584
|
-
"current-page":
|
|
585
|
-
"onUpdate:current-page": (e) =>
|
|
586
|
-
"hide-on-single-page":
|
|
587
|
-
"page-size":
|
|
588
|
-
"onUpdate:page-size": (e) =>
|
|
589
|
-
total:
|
|
591
|
+
c.paging && p(re, {
|
|
592
|
+
"current-page": P.value.page,
|
|
593
|
+
"onUpdate:current-page": (e) => P.value.page = e,
|
|
594
|
+
"hide-on-single-page": c.hideOnSinglePage,
|
|
595
|
+
"page-size": P.value.limit,
|
|
596
|
+
"onUpdate:page-size": (e) => P.value.limit = e,
|
|
597
|
+
total: P.value.total,
|
|
590
598
|
"page-sizes": [
|
|
591
599
|
10,
|
|
592
600
|
25,
|
|
@@ -600,15 +608,15 @@ var I = {
|
|
|
600
608
|
background: !0,
|
|
601
609
|
layout: "total, sizes, prev, pager, next, jumper"
|
|
602
610
|
}, null),
|
|
603
|
-
p(
|
|
611
|
+
p(ae, {
|
|
604
612
|
ref: "settingPanel",
|
|
605
|
-
modelValue:
|
|
606
|
-
"onUpdate:modelValue": (e) =>
|
|
613
|
+
modelValue: O.value,
|
|
614
|
+
"onUpdate:modelValue": (e) => O.value = e,
|
|
607
615
|
columns: r
|
|
608
616
|
}, null)
|
|
609
|
-
]), p(
|
|
617
|
+
]), p(s, { onNotify: J }, null)]);
|
|
610
618
|
};
|
|
611
619
|
}
|
|
612
620
|
};
|
|
613
621
|
//#endregion
|
|
614
|
-
export {
|
|
622
|
+
export { z as t };
|