view-ui-plus-derive 0.1.1 → 0.1.3
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/README.md +69 -11
- package/dist/index.d.ts +76 -26
- package/dist/index.js +781 -725
- package/dist/less/Combi.less +38 -0
- package/dist/less/CountRange.less +36 -0
- package/dist/less/DateRange.less +38 -0
- package/dist/less/MCalendar.less +70 -0
- package/dist/less/PageTable.less +94 -0
- package/dist/less/ToggleColumn.less +26 -0
- package/dist/less/common.less +7 -0
- package/dist/less/index.less +6 -0
- package/dist/styles/PageTable.css +1 -1
- package/dist/umd/index.css +1 -1
- package/dist/umd/index.js +1 -1
- package/package.json +12 -10
package/dist/index.js
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { defineComponent as _, shallowRef as
|
|
2
|
-
import { getPathValue as
|
|
3
|
-
import
|
|
1
|
+
import { defineComponent as _, shallowRef as Se, computed as L, onMounted as me, watch as F, resolveComponent as A, createElementBlock as N, openBlock as $, withDirectives as ae, createVNode as O, withCtx as D, createTextVNode as j, toDisplayString as H, unref as y, vShow as ue, Fragment as Q, renderList as ee, createBlock as U, renderSlot as z, ref as E, mergeProps as G, inject as Ke, useSlots as Ue, normalizeClass as P, createCommentVNode as W, createElementVNode as te, nextTick as q, shallowReactive as Te, useTemplateRef as he, normalizeProps as Be, guardReactiveProps as De, createSlots as we, getCurrentInstance as ve, onBeforeUnmount as Ae, mergeModels as xe, useModel as Ye, reactive as Ge } from "vue";
|
|
2
|
+
import { getPathValue as pe, setPathValue as _e, deepMerge as Je, makeObjectByPath as qe, omitOwnKeys as We } from "utils-where";
|
|
3
|
+
import Xe from "./locale/zh-CN.js";
|
|
4
4
|
/* empty css */
|
|
5
5
|
/* empty css */
|
|
6
|
-
import { i as
|
|
6
|
+
import { i as Re } from "./directives/v-iview-select.js";
|
|
7
7
|
/* empty css */
|
|
8
8
|
/* empty css */
|
|
9
|
-
import { Checkbox as
|
|
9
|
+
import { Checkbox as $e } from "view-ui-plus";
|
|
10
10
|
/* empty css */
|
|
11
11
|
/* empty css */
|
|
12
|
-
const
|
|
12
|
+
const M = {
|
|
13
13
|
i18n: null,
|
|
14
14
|
prefix: "d",
|
|
15
|
-
msg:
|
|
16
|
-
t(t, ...
|
|
17
|
-
return
|
|
15
|
+
msg: Xe,
|
|
16
|
+
t(t, ...k) {
|
|
17
|
+
return M.i18n?.global.t(M.prefix + "." + t, ...k) ?? pe(M.msg, M.prefix + "." + t) ?? t;
|
|
18
18
|
}
|
|
19
|
-
},
|
|
19
|
+
}, Ze = {
|
|
20
20
|
name: "AllCheckbox"
|
|
21
|
-
},
|
|
22
|
-
...
|
|
21
|
+
}, Qe = /* @__PURE__ */ _({
|
|
22
|
+
...Ze,
|
|
23
23
|
props: {
|
|
24
24
|
modelValue: Array,
|
|
25
25
|
/**
|
|
@@ -69,57 +69,57 @@ const A = {
|
|
|
69
69
|
all: Boolean
|
|
70
70
|
},
|
|
71
71
|
emits: ["update:modelValue", "update:all", "change"],
|
|
72
|
-
setup(t, { emit:
|
|
73
|
-
const a = t, e =
|
|
72
|
+
setup(t, { emit: k }) {
|
|
73
|
+
const a = t, e = k, l = Se(a.modelValue || []), n = L({
|
|
74
74
|
get() {
|
|
75
75
|
return l.value.length === a.list.length;
|
|
76
76
|
},
|
|
77
77
|
set(d) {
|
|
78
|
-
l.value = d ? a.list.map((
|
|
78
|
+
l.value = d ? a.list.map((p) => p[a.keyMap.value]) : [];
|
|
79
79
|
}
|
|
80
|
-
}), i =
|
|
80
|
+
}), i = L(
|
|
81
81
|
() => l.value.length > 0 && l.value.length < a.list.length
|
|
82
82
|
);
|
|
83
|
-
function
|
|
83
|
+
function g() {
|
|
84
84
|
e("update:modelValue", l.value), e("update:all", n.value), e("change", l.value, n.value);
|
|
85
85
|
}
|
|
86
|
-
return
|
|
86
|
+
return me(() => {
|
|
87
87
|
e("update:all", n.value);
|
|
88
|
-
}),
|
|
88
|
+
}), F(
|
|
89
89
|
() => a.modelValue,
|
|
90
90
|
(d) => {
|
|
91
91
|
l.value !== d && (l.value = d || [], e("update:all", n.value));
|
|
92
92
|
}
|
|
93
|
-
), (d,
|
|
94
|
-
const
|
|
95
|
-
return
|
|
96
|
-
|
|
93
|
+
), (d, p) => {
|
|
94
|
+
const v = A("Checkbox"), u = A("CheckboxGroup");
|
|
95
|
+
return $(), N("div", null, [
|
|
96
|
+
ae(O(v, {
|
|
97
97
|
modelValue: n.value,
|
|
98
|
-
"onUpdate:modelValue":
|
|
98
|
+
"onUpdate:modelValue": p[0] || (p[0] = (x) => n.value = x),
|
|
99
99
|
indeterminate: i.value,
|
|
100
|
-
onOnChange:
|
|
100
|
+
onOnChange: g
|
|
101
101
|
}, {
|
|
102
|
-
default:
|
|
103
|
-
j(
|
|
102
|
+
default: D(() => [
|
|
103
|
+
j(H(t.title ?? y(M).t("allCheckbox.title")), 1)
|
|
104
104
|
]),
|
|
105
105
|
_: 1
|
|
106
106
|
}, 8, ["modelValue", "indeterminate"]), [
|
|
107
|
-
[
|
|
107
|
+
[ue, !t.hideAll]
|
|
108
108
|
]),
|
|
109
|
-
|
|
109
|
+
O(u, {
|
|
110
110
|
modelValue: l.value,
|
|
111
|
-
"onUpdate:modelValue":
|
|
111
|
+
"onUpdate:modelValue": p[1] || (p[1] = (x) => l.value = x),
|
|
112
112
|
class: "ivu-inline-block",
|
|
113
|
-
onOnChange:
|
|
113
|
+
onOnChange: g
|
|
114
114
|
}, {
|
|
115
|
-
default:
|
|
116
|
-
(
|
|
117
|
-
key:
|
|
118
|
-
label:
|
|
115
|
+
default: D(() => [
|
|
116
|
+
($(!0), N(Q, null, ee(t.list, (x) => ($(), U(v, {
|
|
117
|
+
key: x[t.keyMap.value],
|
|
118
|
+
label: x[t.keyMap.value]
|
|
119
119
|
}, {
|
|
120
|
-
default:
|
|
121
|
-
|
|
122
|
-
j(
|
|
120
|
+
default: D(() => [
|
|
121
|
+
z(d.$slots, "default", { item: x }, () => [
|
|
122
|
+
j(H(x[t.keyMap.label]), 1)
|
|
123
123
|
])
|
|
124
124
|
]),
|
|
125
125
|
_: 2
|
|
@@ -130,10 +130,10 @@ const A = {
|
|
|
130
130
|
]);
|
|
131
131
|
};
|
|
132
132
|
}
|
|
133
|
-
}),
|
|
133
|
+
}), et = {
|
|
134
134
|
name: "BaseSwitch"
|
|
135
|
-
},
|
|
136
|
-
...
|
|
135
|
+
}, tt = /* @__PURE__ */ _({
|
|
136
|
+
...et,
|
|
137
137
|
props: {
|
|
138
138
|
modelValue: [String, Number, Boolean],
|
|
139
139
|
/**
|
|
@@ -160,49 +160,52 @@ const A = {
|
|
|
160
160
|
falseLabel: String
|
|
161
161
|
},
|
|
162
162
|
emits: ["update:modelValue", "change"],
|
|
163
|
-
setup(t, { emit:
|
|
164
|
-
const a = t, e =
|
|
163
|
+
setup(t, { emit: k }) {
|
|
164
|
+
const a = t, e = k, l = E(a.modelValue), n = (i) => {
|
|
165
165
|
e("update:modelValue", i), e("change", i);
|
|
166
166
|
};
|
|
167
|
-
return
|
|
167
|
+
return F(
|
|
168
168
|
() => a.modelValue,
|
|
169
169
|
(i) => {
|
|
170
170
|
l.value !== i && (l.value = i);
|
|
171
171
|
}
|
|
172
|
-
), (i,
|
|
173
|
-
const d =
|
|
174
|
-
return
|
|
172
|
+
), (i, g) => {
|
|
173
|
+
const d = A("Switch");
|
|
174
|
+
return $(), U(d, G({
|
|
175
175
|
modelValue: l.value,
|
|
176
|
-
"onUpdate:modelValue":
|
|
176
|
+
"onUpdate:modelValue": g[0] || (g[0] = (p) => l.value = p),
|
|
177
177
|
onOnChange: n
|
|
178
178
|
}, i.$attrs, {
|
|
179
179
|
trueValue: t.trueValue,
|
|
180
180
|
falseValue: t.falseValue
|
|
181
181
|
}), {
|
|
182
|
-
open:
|
|
183
|
-
|
|
184
|
-
j(
|
|
182
|
+
open: D(() => [
|
|
183
|
+
z(i.$slots, "open", {}, () => [
|
|
184
|
+
j(H(t.trueLabel), 1)
|
|
185
185
|
])
|
|
186
186
|
]),
|
|
187
|
-
close:
|
|
188
|
-
|
|
189
|
-
j(
|
|
187
|
+
close: D(() => [
|
|
188
|
+
z(i.$slots, "close", {}, () => [
|
|
189
|
+
j(H(t.falseLabel), 1)
|
|
190
190
|
])
|
|
191
191
|
]),
|
|
192
192
|
_: 3
|
|
193
193
|
}, 16, ["modelValue", "trueValue", "falseValue"]);
|
|
194
194
|
};
|
|
195
195
|
}
|
|
196
|
-
}),
|
|
196
|
+
}), Ie = Symbol("vupdPrefix"), I = (t) => {
|
|
197
|
+
const k = Ke(Ie, "");
|
|
198
|
+
return k ? k.replace(/\B([A-Z])/g, "-$1").toLowerCase() + "-" + t : t;
|
|
199
|
+
}, at = {
|
|
197
200
|
key: 0,
|
|
198
201
|
class: "ivu-input-group-prepend"
|
|
199
|
-
},
|
|
202
|
+
}, lt = {
|
|
200
203
|
key: 1,
|
|
201
204
|
class: "ivu-input-group-append"
|
|
202
|
-
},
|
|
205
|
+
}, nt = {
|
|
203
206
|
name: "Combi"
|
|
204
|
-
},
|
|
205
|
-
...
|
|
207
|
+
}, ot = /* @__PURE__ */ _({
|
|
208
|
+
...nt,
|
|
206
209
|
props: {
|
|
207
210
|
/**
|
|
208
211
|
* 前置文本
|
|
@@ -214,29 +217,31 @@ const A = {
|
|
|
214
217
|
append: String
|
|
215
218
|
},
|
|
216
219
|
setup(t) {
|
|
217
|
-
const
|
|
218
|
-
return (n, i) => (
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
220
|
+
const k = Ue(), a = t, e = L(() => !!a.prepend || !!k.prepend?.().length), l = L(() => !!a.append || !!k.append?.().length);
|
|
221
|
+
return (n, i) => ($(), N("div", {
|
|
222
|
+
class: P([y(I)("combi"), "ivu-input-group"])
|
|
223
|
+
}, [
|
|
224
|
+
e.value ? ($(), N("div", at, [
|
|
225
|
+
z(n.$slots, "prepend", {}, () => [
|
|
226
|
+
j(H(t.prepend), 1)
|
|
222
227
|
])
|
|
223
228
|
])) : W("", !0),
|
|
224
229
|
te("div", {
|
|
225
|
-
class:
|
|
230
|
+
class: P([y(I)("combi-cell"), { "with-append": l.value, "with-prepend": e.value }])
|
|
226
231
|
}, [
|
|
227
|
-
|
|
232
|
+
z(n.$slots, "default")
|
|
228
233
|
], 2),
|
|
229
|
-
l.value ? (
|
|
230
|
-
|
|
231
|
-
j(
|
|
234
|
+
l.value ? ($(), N("div", lt, [
|
|
235
|
+
z(n.$slots, "append", {}, () => [
|
|
236
|
+
j(H(t.append), 1)
|
|
232
237
|
])
|
|
233
238
|
])) : W("", !0)
|
|
234
|
-
]));
|
|
239
|
+
], 2));
|
|
235
240
|
}
|
|
236
|
-
}),
|
|
241
|
+
}), it = {
|
|
237
242
|
name: "CountRange"
|
|
238
|
-
},
|
|
239
|
-
...
|
|
243
|
+
}, ut = /* @__PURE__ */ _({
|
|
244
|
+
...it,
|
|
240
245
|
props: {
|
|
241
246
|
/**
|
|
242
247
|
* 双向绑定最小值
|
|
@@ -326,11 +331,11 @@ const A = {
|
|
|
326
331
|
hideJoiner: Boolean
|
|
327
332
|
},
|
|
328
333
|
emits: ["update:begin", "update:end", "change-min", "change-max", "change"],
|
|
329
|
-
setup(t, { emit:
|
|
330
|
-
const a = t, e =
|
|
334
|
+
setup(t, { emit: k }) {
|
|
335
|
+
const a = t, e = k, l = E(a.begin), n = E(a.end), i = L(() => ({
|
|
331
336
|
min: a.min,
|
|
332
337
|
max: a.max,
|
|
333
|
-
placeholder: a.minHolder ??
|
|
338
|
+
placeholder: a.minHolder ?? M.t("countRange.minHolder"),
|
|
334
339
|
disabled: a.disabled || a.minDisabled,
|
|
335
340
|
class: a.minClass,
|
|
336
341
|
controlsOutside: a.controlsOutside,
|
|
@@ -342,10 +347,10 @@ const A = {
|
|
|
342
347
|
parser: a.parser,
|
|
343
348
|
activeChange: a.activeChange,
|
|
344
349
|
...a.minAttr
|
|
345
|
-
})),
|
|
350
|
+
})), g = L(() => ({
|
|
346
351
|
min: l.value,
|
|
347
352
|
max: a.max,
|
|
348
|
-
placeholder: a.maxHolder ??
|
|
353
|
+
placeholder: a.maxHolder ?? M.t("countRange.maxHolder"),
|
|
349
354
|
disabled: a.disabled || a.maxDisabled,
|
|
350
355
|
class: a.maxClass,
|
|
351
356
|
controlsOutside: a.controlsOutside,
|
|
@@ -359,39 +364,41 @@ const A = {
|
|
|
359
364
|
...a.maxAttr
|
|
360
365
|
})), d = () => {
|
|
361
366
|
e("update:begin", l.value), e("update:end", n.value);
|
|
362
|
-
},
|
|
363
|
-
n.value != null &&
|
|
364
|
-
},
|
|
365
|
-
d(), e("change-max",
|
|
366
|
-
}, u = (
|
|
367
|
-
l.value !==
|
|
368
|
-
},
|
|
369
|
-
n.value !==
|
|
367
|
+
}, p = (s) => {
|
|
368
|
+
n.value != null && s > n.value && (n.value = s + 1 > g.value.max ? g.value.max : s + 1), d(), e("change-min", s), e("change", s, n.value, !1);
|
|
369
|
+
}, v = (s) => {
|
|
370
|
+
d(), e("change-max", s), e("change", l.value, s, !0);
|
|
371
|
+
}, u = (s) => {
|
|
372
|
+
l.value !== s && (l.value = s !== void 0 ? s : null);
|
|
373
|
+
}, x = (s) => {
|
|
374
|
+
n.value !== s && (n.value = s !== void 0 ? s : null);
|
|
370
375
|
};
|
|
371
|
-
return
|
|
372
|
-
const
|
|
373
|
-
return
|
|
374
|
-
|
|
376
|
+
return F(() => a.begin, u), F(() => a.end, x), (s, b) => {
|
|
377
|
+
const C = A("InputNumber");
|
|
378
|
+
return $(), N("div", {
|
|
379
|
+
class: P(y(I)("count-range"))
|
|
380
|
+
}, [
|
|
381
|
+
O(C, G({
|
|
375
382
|
modelValue: l.value,
|
|
376
|
-
"onUpdate:modelValue":
|
|
377
|
-
}, i.value, { onOnChange:
|
|
378
|
-
|
|
379
|
-
class:
|
|
383
|
+
"onUpdate:modelValue": b[0] || (b[0] = (T) => l.value = T)
|
|
384
|
+
}, i.value, { onOnChange: p }), null, 16, ["modelValue"]),
|
|
385
|
+
ae(te("span", {
|
|
386
|
+
class: P([y(I)("count-range-joiner"), t.joinerClass])
|
|
380
387
|
}, null, 2), [
|
|
381
|
-
[
|
|
388
|
+
[ue, !t.hideJoiner]
|
|
382
389
|
]),
|
|
383
|
-
|
|
390
|
+
O(C, G({
|
|
384
391
|
modelValue: n.value,
|
|
385
|
-
"onUpdate:modelValue":
|
|
386
|
-
},
|
|
387
|
-
]);
|
|
392
|
+
"onUpdate:modelValue": b[1] || (b[1] = (T) => n.value = T)
|
|
393
|
+
}, g.value, { onOnChange: v }), null, 16, ["modelValue"])
|
|
394
|
+
], 2);
|
|
388
395
|
};
|
|
389
396
|
}
|
|
390
|
-
}),
|
|
397
|
+
}), st = { key: 1 }, dt = {
|
|
391
398
|
name: "RemoteSelect",
|
|
392
399
|
inheritAttrs: !1
|
|
393
|
-
},
|
|
394
|
-
...
|
|
400
|
+
}, Me = /* @__PURE__ */ _({
|
|
401
|
+
...dt,
|
|
395
402
|
props: {
|
|
396
403
|
modelValue: [String, Array, Number],
|
|
397
404
|
list: Array,
|
|
@@ -459,11 +466,11 @@ const A = {
|
|
|
459
466
|
type: Function,
|
|
460
467
|
default({
|
|
461
468
|
multiple: t,
|
|
462
|
-
keyMap:
|
|
469
|
+
keyMap: k,
|
|
463
470
|
list: a,
|
|
464
471
|
value: e
|
|
465
472
|
}) {
|
|
466
|
-
return t ? a.filter((l) => e.includes(l[
|
|
473
|
+
return t ? a.filter((l) => e.includes(l[k.value])) : a.find((l) => l[k.value] === e) || {};
|
|
467
474
|
}
|
|
468
475
|
},
|
|
469
476
|
/**
|
|
@@ -481,32 +488,32 @@ const A = {
|
|
|
481
488
|
}
|
|
482
489
|
},
|
|
483
490
|
emits: ["update:modelValue", "update:chosen", "update:list", "update:refresh", "load"],
|
|
484
|
-
setup(t, { expose:
|
|
485
|
-
const e = t, l = a, n =
|
|
491
|
+
setup(t, { expose: k, emit: a }) {
|
|
492
|
+
const e = t, l = a, n = E(e.modelValue ?? ""), i = E([]), g = E(!1), d = E({}), p = L(
|
|
486
493
|
() => d.value && Object.keys(d.value).length > 0 ? typeof e.textFormat != "function" ? e.multiple ? d.value.map((r) => r[e.keyMap.label]).join(",") : d.value[e.keyMap.label] : e.textFormat(d.value) : ""
|
|
487
|
-
),
|
|
488
|
-
let u,
|
|
489
|
-
async function
|
|
494
|
+
), v = E(!1);
|
|
495
|
+
let u, x, s, b;
|
|
496
|
+
async function C() {
|
|
490
497
|
let r;
|
|
491
498
|
if (typeof e.loader != "function") {
|
|
492
499
|
if (typeof e.method != "function") {
|
|
493
500
|
console.warn("typeof method isn't function");
|
|
494
501
|
return;
|
|
495
502
|
}
|
|
496
|
-
if (
|
|
503
|
+
if (g.value = !0, r = await e.method(typeof e.param != "function" ? e.param : e.param()), g.value = !1, r && typeof e.process == "function") {
|
|
497
504
|
const B = e.process(r);
|
|
498
505
|
B != null && (r = B);
|
|
499
506
|
}
|
|
500
507
|
} else
|
|
501
|
-
|
|
502
|
-
r && (
|
|
508
|
+
g.value = !0, r = await e.loader(), g.value = !1;
|
|
509
|
+
r && (v.value = !0, i.value = r, l("update:list", r), S() && T(n.value), u = !0, q(() => {
|
|
503
510
|
u = null;
|
|
504
511
|
}), l("load", r));
|
|
505
512
|
}
|
|
506
|
-
function
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
}),
|
|
513
|
+
function T(r) {
|
|
514
|
+
x = !0, q(() => {
|
|
515
|
+
x = null;
|
|
516
|
+
}), s && (e.multiple ? !r.toString().length : r === void 0) && (n.value = r = s), d.value = e.getSelected({
|
|
510
517
|
multiple: e.multiple,
|
|
511
518
|
keyMap: e.keyMap,
|
|
512
519
|
list: i.value,
|
|
@@ -514,76 +521,76 @@ const A = {
|
|
|
514
521
|
}), l("update:modelValue", r ?? ""), l("update:chosen", d.value);
|
|
515
522
|
}
|
|
516
523
|
function c(r) {
|
|
517
|
-
r && !e.autoGet && !
|
|
524
|
+
r && !e.autoGet && !g.value && !v.value && (!e.check || e.check()) && (!e.strict || e.parentCode) && C();
|
|
518
525
|
}
|
|
519
|
-
function
|
|
526
|
+
function S() {
|
|
520
527
|
return n.value != null && n.value.toString().length > 0;
|
|
521
528
|
}
|
|
522
|
-
return l("update:refresh",
|
|
523
|
-
e.autoGet ?
|
|
524
|
-
}),
|
|
529
|
+
return l("update:refresh", C), me(() => {
|
|
530
|
+
e.autoGet ? C() : S() && !i.value.length && c(!0);
|
|
531
|
+
}), k({
|
|
525
532
|
code: n,
|
|
526
|
-
changeCode:
|
|
527
|
-
loaded:
|
|
533
|
+
changeCode: T,
|
|
534
|
+
loaded: v,
|
|
528
535
|
codes: i,
|
|
529
|
-
search:
|
|
530
|
-
}),
|
|
536
|
+
search: C
|
|
537
|
+
}), F(
|
|
531
538
|
() => e.list,
|
|
532
539
|
(r) => {
|
|
533
|
-
u || (r && r.length ? (i.value = r,
|
|
540
|
+
u || (r && r.length ? (i.value = r, v.value = !!e.cache) : (i.value = [], v.value = !1));
|
|
534
541
|
},
|
|
535
542
|
{ immediate: !0 }
|
|
536
|
-
),
|
|
543
|
+
), F(
|
|
537
544
|
() => e.modelValue,
|
|
538
545
|
(r) => {
|
|
539
|
-
if (!
|
|
540
|
-
|
|
541
|
-
}), n.value = r ?? "",
|
|
546
|
+
if (!x && (b = !0, q(() => {
|
|
547
|
+
b = null;
|
|
548
|
+
}), n.value = r ?? "", T(n.value), e.refresh !== C)) {
|
|
542
549
|
for (const B in d.value)
|
|
543
550
|
return;
|
|
544
|
-
c(
|
|
551
|
+
c(S());
|
|
545
552
|
}
|
|
546
553
|
}
|
|
547
|
-
),
|
|
554
|
+
), F(
|
|
548
555
|
() => e.parentCode,
|
|
549
556
|
(r) => {
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
})) : n.value = e.multiple ? [] : "", i.value = [],
|
|
557
|
+
b ? (s = e.modelValue, setTimeout(() => {
|
|
558
|
+
s = null;
|
|
559
|
+
})) : n.value = e.multiple ? [] : "", i.value = [], v.value = !1, l("update:list", i.value), S() && r && /* !this.opening && */
|
|
553
560
|
c(!0);
|
|
554
561
|
}
|
|
555
562
|
), (r, B) => {
|
|
556
|
-
const
|
|
557
|
-
return t.textMode ? (
|
|
558
|
-
|
|
559
|
-
j(
|
|
563
|
+
const h = A("Option"), o = A("Select");
|
|
564
|
+
return t.textMode ? ($(), N("span", st, [
|
|
565
|
+
z(r.$slots, "text", { text: p.value }, () => [
|
|
566
|
+
j(H(p.value), 1)
|
|
560
567
|
])
|
|
561
|
-
])) :
|
|
568
|
+
])) : ae(($(), U(o, G({
|
|
562
569
|
key: 0,
|
|
563
570
|
modelValue: n.value,
|
|
564
|
-
"onUpdate:modelValue": B[0] || (B[0] = (
|
|
571
|
+
"onUpdate:modelValue": B[0] || (B[0] = (V) => n.value = V),
|
|
565
572
|
onOnOpenChange: c,
|
|
566
|
-
onOnChange:
|
|
573
|
+
onOnChange: T
|
|
567
574
|
}, r.$attrs, {
|
|
568
575
|
multiple: t.multiple,
|
|
569
|
-
loading:
|
|
570
|
-
"not-found-text":
|
|
576
|
+
loading: g.value,
|
|
577
|
+
"not-found-text": g.value ? null : void 0
|
|
571
578
|
}), {
|
|
572
|
-
default:
|
|
573
|
-
|
|
574
|
-
(
|
|
575
|
-
key: e.valueAsKey ?
|
|
576
|
-
value:
|
|
577
|
-
label: t.formatLabel && t.formatLabel(
|
|
578
|
-
disabled: t.optionDisabled && t.optionDisabled(
|
|
579
|
-
tag: t.optionTag && t.optionTag(
|
|
579
|
+
default: D(() => [
|
|
580
|
+
z(r.$slots, "dropdown", { list: i.value }, () => [
|
|
581
|
+
($(!0), N(Q, null, ee(i.value, (V, K) => ($(), U(h, {
|
|
582
|
+
key: e.valueAsKey ? V[t.keyMap.value] : K,
|
|
583
|
+
value: V[t.keyMap.value],
|
|
584
|
+
label: t.formatLabel && t.formatLabel(V, K),
|
|
585
|
+
disabled: t.optionDisabled && t.optionDisabled(V, K),
|
|
586
|
+
tag: t.optionTag && t.optionTag(V, K)
|
|
580
587
|
}, {
|
|
581
|
-
default:
|
|
582
|
-
|
|
583
|
-
item:
|
|
584
|
-
index:
|
|
588
|
+
default: D(() => [
|
|
589
|
+
z(r.$slots, "default", {
|
|
590
|
+
item: V,
|
|
591
|
+
index: K
|
|
585
592
|
}, () => [
|
|
586
|
-
j(
|
|
593
|
+
j(H(V[t.keyMap.label]), 1)
|
|
587
594
|
])
|
|
588
595
|
]),
|
|
589
596
|
_: 2
|
|
@@ -592,21 +599,21 @@ const A = {
|
|
|
592
599
|
]),
|
|
593
600
|
_: 3
|
|
594
601
|
}, 16, ["modelValue", "multiple", "loading", "not-found-text"])), [
|
|
595
|
-
[
|
|
602
|
+
[y(Re), t.all, "all"]
|
|
596
603
|
]);
|
|
597
604
|
};
|
|
598
605
|
}
|
|
599
|
-
}),
|
|
606
|
+
}), ke = {
|
|
600
607
|
list: null
|
|
601
|
-
},
|
|
608
|
+
}, ne = Te({}), oe = {
|
|
602
609
|
list: []
|
|
603
|
-
},
|
|
610
|
+
}, ie = {
|
|
604
611
|
list: []
|
|
605
|
-
},
|
|
612
|
+
}, Ce = {}, ct = {
|
|
606
613
|
name: "CacheSelect",
|
|
607
614
|
inheritAttrs: !1
|
|
608
|
-
},
|
|
609
|
-
...
|
|
615
|
+
}, rt = /* @__PURE__ */ _({
|
|
616
|
+
...ct,
|
|
610
617
|
props: {
|
|
611
618
|
modelValue: [String, Array, Number],
|
|
612
619
|
/**
|
|
@@ -618,65 +625,65 @@ const A = {
|
|
|
618
625
|
}
|
|
619
626
|
},
|
|
620
627
|
emits: ["update:modelValue", "update:chosen", "update:list", "load", "change"],
|
|
621
|
-
setup(t, { emit:
|
|
622
|
-
const a = t, e =
|
|
623
|
-
e("update:modelValue",
|
|
624
|
-
},
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
}),
|
|
629
|
-
|
|
630
|
-
}),
|
|
631
|
-
}), e("load",
|
|
628
|
+
setup(t, { emit: k }) {
|
|
629
|
+
const a = t, e = k, l = E(""), n = he("sel"), i = (p) => {
|
|
630
|
+
e("update:modelValue", p), e("change", p);
|
|
631
|
+
}, g = (p) => {
|
|
632
|
+
q(() => {
|
|
633
|
+
oe[a.cacheId] && (oe[a.cacheId].forEach((v) => {
|
|
634
|
+
v.changeCode(v.code);
|
|
635
|
+
}), oe[a.cacheId] = []), ie[a.cacheId] && (ie[a.cacheId].forEach((v) => {
|
|
636
|
+
v !== n.value && v.$emit("update:list", v.codes);
|
|
637
|
+
}), ie[a.cacheId] = []);
|
|
638
|
+
}), e("load", p);
|
|
632
639
|
}, d = () => l.value != null && l.value.toString().length > 0;
|
|
633
|
-
return
|
|
640
|
+
return F(
|
|
634
641
|
() => a.modelValue,
|
|
635
|
-
(
|
|
636
|
-
l.value !==
|
|
642
|
+
(p) => {
|
|
643
|
+
l.value !== p && (l.value = p ?? "");
|
|
637
644
|
}
|
|
638
|
-
),
|
|
639
|
-
|
|
640
|
-
() =>
|
|
641
|
-
(
|
|
642
|
-
|
|
645
|
+
), ne[a.cacheId] || (ne[a.cacheId] = [], ke[a.cacheId] = null), me(() => {
|
|
646
|
+
ne[a.cacheId].length && (n.value.loaded = !0), a.modelValue && (l.value = a.modelValue), ke[a.cacheId] ? (d() && (oe[a.cacheId] || (oe[a.cacheId] = []), oe[a.cacheId].push(n.value)), n.value.loaded = Ce[a.cacheId]) : ke[a.cacheId] = !0, ie[a.cacheId] || (ie[a.cacheId] = []), ie[a.cacheId].push(n.value), Ce[a.cacheId] || (Ce[a.cacheId] = d()), F(
|
|
647
|
+
() => ne[a.cacheId],
|
|
648
|
+
(p) => {
|
|
649
|
+
p.length && (n.value.loaded = !0);
|
|
643
650
|
},
|
|
644
651
|
{
|
|
645
652
|
immediate: !0
|
|
646
653
|
}
|
|
647
654
|
);
|
|
648
|
-
}), (
|
|
655
|
+
}), (p, v) => ($(), U(Me, G({
|
|
649
656
|
ref: "sel",
|
|
650
657
|
modelValue: l.value,
|
|
651
|
-
"onUpdate:modelValue":
|
|
652
|
-
list:
|
|
658
|
+
"onUpdate:modelValue": v[0] || (v[0] = (u) => l.value = u),
|
|
659
|
+
list: y(ne)[t.cacheId],
|
|
653
660
|
"onUpdate:list": [
|
|
654
|
-
|
|
655
|
-
|
|
661
|
+
v[1] || (v[1] = (u) => y(ne)[t.cacheId] = u),
|
|
662
|
+
v[3] || (v[3] = (u) => p.$emit("update:list", u))
|
|
656
663
|
],
|
|
657
|
-
onLoad:
|
|
664
|
+
onLoad: g,
|
|
658
665
|
onOnChange: i,
|
|
659
|
-
"onUpdate:chosen":
|
|
660
|
-
},
|
|
661
|
-
default:
|
|
662
|
-
|
|
666
|
+
"onUpdate:chosen": v[2] || (v[2] = (u) => p.$emit("update:chosen", u))
|
|
667
|
+
}, p.$attrs, { cache: "" }), {
|
|
668
|
+
default: D(({ item: u, index: x }) => [
|
|
669
|
+
z(p.$slots, "default", {
|
|
663
670
|
item: u,
|
|
664
|
-
index:
|
|
671
|
+
index: x
|
|
665
672
|
})
|
|
666
673
|
]),
|
|
667
|
-
dropdown:
|
|
668
|
-
|
|
674
|
+
dropdown: D(({ list: u }) => [
|
|
675
|
+
z(p.$slots, "dropdown", { list: u })
|
|
669
676
|
]),
|
|
670
|
-
text:
|
|
671
|
-
|
|
677
|
+
text: D((u) => [
|
|
678
|
+
z(p.$slots, "text", Be(De(u)))
|
|
672
679
|
]),
|
|
673
680
|
_: 3
|
|
674
681
|
}, 16, ["modelValue", "list"]));
|
|
675
682
|
}
|
|
676
|
-
}),
|
|
683
|
+
}), mt = {
|
|
677
684
|
name: "CurdTable"
|
|
678
|
-
},
|
|
679
|
-
...
|
|
685
|
+
}, ft = /* @__PURE__ */ _({
|
|
686
|
+
...mt,
|
|
680
687
|
props: {
|
|
681
688
|
modelValue: {
|
|
682
689
|
type: Array,
|
|
@@ -805,86 +812,86 @@ const A = {
|
|
|
805
812
|
}
|
|
806
813
|
},
|
|
807
814
|
emits: ["update:modelValue", "add", "remove", "change"],
|
|
808
|
-
setup(t, { emit:
|
|
809
|
-
const a = t, e =
|
|
815
|
+
setup(t, { emit: k }) {
|
|
816
|
+
const a = t, e = k, l = E(a.modelValue), n = L(
|
|
810
817
|
() => a.disabled ? a.columns : a.columns.concat(
|
|
811
818
|
Object.assign(
|
|
812
819
|
{
|
|
813
|
-
title: a.actionText ??
|
|
820
|
+
title: a.actionText ?? M.t("curdTable.actionText")
|
|
814
821
|
},
|
|
815
822
|
a.actionCol
|
|
816
823
|
)
|
|
817
824
|
)
|
|
818
|
-
), i =
|
|
819
|
-
const u = [],
|
|
820
|
-
|
|
821
|
-
|
|
825
|
+
), i = L(() => {
|
|
826
|
+
const u = [], x = (s) => {
|
|
827
|
+
s.slot && u.push(s), s.children && s.children.forEach((b) => {
|
|
828
|
+
x(b);
|
|
822
829
|
});
|
|
823
830
|
};
|
|
824
|
-
return a.columns.forEach((
|
|
825
|
-
|
|
831
|
+
return a.columns.forEach((s) => {
|
|
832
|
+
x(s);
|
|
826
833
|
}), u;
|
|
827
834
|
});
|
|
828
|
-
function
|
|
835
|
+
function g() {
|
|
829
836
|
typeof a.beforeAdd != "function" ? d() : a.beforeAdd().then(d).catch();
|
|
830
837
|
}
|
|
831
838
|
function d(u) {
|
|
832
839
|
l.value.push(...a.addRow(u)), e("update:modelValue", l.value), e("add", l.value[l.value.length - 1]), e("change", !0);
|
|
833
840
|
}
|
|
834
|
-
function
|
|
835
|
-
typeof a.beforeRemove != "function" ?
|
|
836
|
-
|
|
841
|
+
function p(u) {
|
|
842
|
+
typeof a.beforeRemove != "function" ? v(u) : a.beforeRemove(l.value[u], u).then(() => {
|
|
843
|
+
v(u);
|
|
837
844
|
});
|
|
838
845
|
}
|
|
839
|
-
function
|
|
840
|
-
const [
|
|
841
|
-
e("update:modelValue", l.value), e("remove",
|
|
846
|
+
function v(u) {
|
|
847
|
+
const [x] = l.value.splice(u, 1);
|
|
848
|
+
e("update:modelValue", l.value), e("remove", x), e("change", !1);
|
|
842
849
|
}
|
|
843
|
-
return
|
|
850
|
+
return F(
|
|
844
851
|
() => a.modelValue,
|
|
845
852
|
(u) => {
|
|
846
853
|
l.value = u;
|
|
847
854
|
}
|
|
848
|
-
), (u,
|
|
849
|
-
const
|
|
850
|
-
return
|
|
851
|
-
|
|
855
|
+
), (u, x) => {
|
|
856
|
+
const s = A("Button"), b = A("Table");
|
|
857
|
+
return $(), N("div", null, [
|
|
858
|
+
O(b, {
|
|
852
859
|
border: t.border,
|
|
853
860
|
columns: n.value,
|
|
854
861
|
data: l.value,
|
|
855
862
|
size: t.size,
|
|
856
863
|
style: { "z-index": "0" }
|
|
857
|
-
},
|
|
858
|
-
action:
|
|
859
|
-
|
|
860
|
-
row:
|
|
861
|
-
index:
|
|
864
|
+
}, we({
|
|
865
|
+
action: D(({ row: C, index: T }) => [
|
|
866
|
+
z(u.$slots, "moreAction", {
|
|
867
|
+
row: C,
|
|
868
|
+
index: T
|
|
862
869
|
}),
|
|
863
|
-
!t.hideDelBtn || !t.hideDelBtn(
|
|
870
|
+
!t.hideDelBtn || !t.hideDelBtn(C, T) ? ($(), U(s, G({
|
|
864
871
|
key: 0,
|
|
865
872
|
type: t.delBtnType,
|
|
866
873
|
size: t.delBtnSize,
|
|
867
874
|
ghost: t.delBtnGhost
|
|
868
875
|
}, t.delBtn, {
|
|
869
|
-
disabled: t.delBtnDisabled(
|
|
870
|
-
onClick: (c) =>
|
|
876
|
+
disabled: t.delBtnDisabled(C, T),
|
|
877
|
+
onClick: (c) => p(T)
|
|
871
878
|
}), {
|
|
872
|
-
default:
|
|
873
|
-
j(
|
|
879
|
+
default: D(() => [
|
|
880
|
+
j(H(y(M).t("curdTable.del")), 1)
|
|
874
881
|
]),
|
|
875
882
|
_: 1
|
|
876
883
|
}, 16, ["type", "size", "ghost", "disabled", "onClick"])) : W("", !0)
|
|
877
884
|
]),
|
|
878
885
|
_: 2
|
|
879
886
|
}, [
|
|
880
|
-
ee(i.value, (
|
|
881
|
-
name:
|
|
882
|
-
fn:
|
|
883
|
-
|
|
887
|
+
ee(i.value, (C) => ({
|
|
888
|
+
name: C.slot,
|
|
889
|
+
fn: D((T) => [
|
|
890
|
+
z(u.$slots, C.slot, Be(De(T)))
|
|
884
891
|
])
|
|
885
892
|
}))
|
|
886
893
|
]), 1032, ["border", "columns", "data", "size"]),
|
|
887
|
-
t.disabled ? W("", !0) :
|
|
894
|
+
t.disabled ? W("", !0) : ae(($(), U(s, G({
|
|
888
895
|
key: 0,
|
|
889
896
|
type: t.addBtnType,
|
|
890
897
|
size: t.addBtnSize,
|
|
@@ -894,22 +901,22 @@ const A = {
|
|
|
894
901
|
long: "",
|
|
895
902
|
icon: "md-add",
|
|
896
903
|
style: { display: "block", position: "relative", "margin-top": "-1px" },
|
|
897
|
-
onClick:
|
|
904
|
+
onClick: g
|
|
898
905
|
}), {
|
|
899
|
-
default:
|
|
900
|
-
j(
|
|
906
|
+
default: D(() => [
|
|
907
|
+
j(H(t.addText ?? y(M).t("curdTable.addText")), 1)
|
|
901
908
|
]),
|
|
902
909
|
_: 1
|
|
903
910
|
}, 16, ["type", "size", "ghost", "disabled"])), [
|
|
904
|
-
[
|
|
911
|
+
[ue, t.addable]
|
|
905
912
|
])
|
|
906
913
|
]);
|
|
907
914
|
};
|
|
908
915
|
}
|
|
909
|
-
}),
|
|
916
|
+
}), gt = {
|
|
910
917
|
name: "DateRange"
|
|
911
|
-
},
|
|
912
|
-
...
|
|
918
|
+
}, ht = /* @__PURE__ */ _({
|
|
919
|
+
...gt,
|
|
913
920
|
props: {
|
|
914
921
|
/**
|
|
915
922
|
* 双向绑定开始时间
|
|
@@ -993,71 +1000,73 @@ const A = {
|
|
|
993
1000
|
format: String
|
|
994
1001
|
},
|
|
995
1002
|
emits: ["update:begin", "update:end", "change-begin", "change-end", "change"],
|
|
996
|
-
setup(t, { emit:
|
|
997
|
-
const a =
|
|
1003
|
+
setup(t, { emit: k }) {
|
|
1004
|
+
const a = ve().appContext.config.globalProperties.$Date, e = {
|
|
998
1005
|
date: "day",
|
|
999
1006
|
month: "month",
|
|
1000
1007
|
year: "year",
|
|
1001
1008
|
datetime: "day"
|
|
1002
|
-
}, l = t, n =
|
|
1009
|
+
}, l = t, n = k, i = E(l.begin), g = E(l.end), d = L(() => ({
|
|
1003
1010
|
options: l.limitBegin ? {
|
|
1004
|
-
disabledDate: (
|
|
1011
|
+
disabledDate: (C) => C && a(C).isBefore(Date.now(), e[l.type])
|
|
1005
1012
|
// date.valueOf() < Date.now() - (props.disableToday ? 0 : 86400000)
|
|
1006
1013
|
} : void 0,
|
|
1007
1014
|
disabled: l.disabled || l.beginDisabled,
|
|
1008
|
-
placeholder: l.beginHolder ??
|
|
1015
|
+
placeholder: l.beginHolder ?? M.t("dateRange.beginHolder"),
|
|
1009
1016
|
class: l.beginClass,
|
|
1010
1017
|
clearable: l.clearable,
|
|
1011
1018
|
transfer: l.transfer,
|
|
1012
1019
|
format: l.format,
|
|
1013
1020
|
...l.beginAttr
|
|
1014
|
-
})),
|
|
1021
|
+
})), p = L(() => ({
|
|
1015
1022
|
options: {
|
|
1016
|
-
disabledDate: (
|
|
1023
|
+
disabledDate: (C) => i.value && C && a(C).isBefore(i.value, e[l.type])
|
|
1017
1024
|
},
|
|
1018
1025
|
disabled: l.disabled || l.endDisabled,
|
|
1019
|
-
placeholder: l.endHolder ??
|
|
1026
|
+
placeholder: l.endHolder ?? M.t("dateRange.endHolder"),
|
|
1020
1027
|
class: l.endClass,
|
|
1021
1028
|
clearable: l.clearable,
|
|
1022
1029
|
transfer: l.transfer,
|
|
1023
1030
|
format: l.format,
|
|
1024
1031
|
...l.endAttr
|
|
1025
|
-
})),
|
|
1026
|
-
n("update:begin", i.value), n("update:end",
|
|
1027
|
-
}, u = (
|
|
1028
|
-
i.value >
|
|
1029
|
-
},
|
|
1030
|
-
l.type === "datetime" &&
|
|
1031
|
-
},
|
|
1032
|
-
i.value !==
|
|
1033
|
-
},
|
|
1034
|
-
|
|
1032
|
+
})), v = () => {
|
|
1033
|
+
n("update:begin", i.value), n("update:end", g.value);
|
|
1034
|
+
}, u = (C) => {
|
|
1035
|
+
i.value > g.value && (g.value = l.autoNext ? a(i.value).add(1, e[l.type]).toDate() : ""), v(), n("change-begin", C), n("change", i.value, g.value, !1);
|
|
1036
|
+
}, x = (C) => {
|
|
1037
|
+
l.type === "datetime" && C && a(C).isBefore(i.value) && (g.value = a(i.value).add(1, "hour").toDate(), C = a(g.value).format("YYYY-MM-DD HH:mm:ss")), v(), n("change-end", C), n("change", i.value, g.value, !0);
|
|
1038
|
+
}, s = (C) => {
|
|
1039
|
+
i.value !== C && (i.value = C || "");
|
|
1040
|
+
}, b = (C) => {
|
|
1041
|
+
g.value !== C && (g.value = C || "");
|
|
1035
1042
|
};
|
|
1036
|
-
return
|
|
1037
|
-
const c =
|
|
1038
|
-
return
|
|
1039
|
-
|
|
1043
|
+
return F(() => l.begin, s), F(() => l.end, b), (C, T) => {
|
|
1044
|
+
const c = A("DatePicker");
|
|
1045
|
+
return $(), N("div", {
|
|
1046
|
+
class: P(y(I)("date-range"))
|
|
1047
|
+
}, [
|
|
1048
|
+
O(c, G({
|
|
1040
1049
|
modelValue: i.value,
|
|
1041
|
-
"onUpdate:modelValue":
|
|
1050
|
+
"onUpdate:modelValue": T[0] || (T[0] = (S) => i.value = S),
|
|
1042
1051
|
onOnChange: u
|
|
1043
1052
|
}, d.value, { type: t.type }), null, 16, ["modelValue", "type"]),
|
|
1044
|
-
|
|
1045
|
-
class:
|
|
1053
|
+
ae(te("span", {
|
|
1054
|
+
class: P([y(I)("date-range-joiner"), t.joinerClass])
|
|
1046
1055
|
}, null, 2), [
|
|
1047
|
-
[
|
|
1056
|
+
[ue, !t.hideJoiner]
|
|
1048
1057
|
]),
|
|
1049
|
-
|
|
1050
|
-
modelValue:
|
|
1051
|
-
"onUpdate:modelValue":
|
|
1052
|
-
onOnChange:
|
|
1053
|
-
},
|
|
1054
|
-
]);
|
|
1058
|
+
O(c, G({
|
|
1059
|
+
modelValue: g.value,
|
|
1060
|
+
"onUpdate:modelValue": T[1] || (T[1] = (S) => g.value = S),
|
|
1061
|
+
onOnChange: x
|
|
1062
|
+
}, p.value, { type: t.type }), null, 16, ["modelValue", "type"])
|
|
1063
|
+
], 2);
|
|
1055
1064
|
};
|
|
1056
1065
|
}
|
|
1057
|
-
}),
|
|
1066
|
+
}), pt = {
|
|
1058
1067
|
name: "DateRangePicker"
|
|
1059
|
-
},
|
|
1060
|
-
...
|
|
1068
|
+
}, vt = /* @__PURE__ */ _({
|
|
1069
|
+
...pt,
|
|
1061
1070
|
props: {
|
|
1062
1071
|
/**
|
|
1063
1072
|
* 双向绑定开始时间
|
|
@@ -1113,28 +1122,28 @@ const A = {
|
|
|
1113
1122
|
}
|
|
1114
1123
|
},
|
|
1115
1124
|
emits: ["update:begin", "update:end", "change"],
|
|
1116
|
-
setup(t, { emit:
|
|
1117
|
-
const a =
|
|
1125
|
+
setup(t, { emit: k }) {
|
|
1126
|
+
const a = ve().appContext.config.globalProperties.$Date, e = t, l = k, n = L(
|
|
1118
1127
|
() => e.options || (e.limitBegin ? {
|
|
1119
1128
|
disabledDate: (d) => d && d.valueOf() < Date.now() - (e.disableToday ? 0 : 864e5)
|
|
1120
1129
|
} : null)
|
|
1121
|
-
), i =
|
|
1130
|
+
), i = L({
|
|
1122
1131
|
get() {
|
|
1123
|
-
const d = e.begin,
|
|
1124
|
-
return d &&
|
|
1132
|
+
const d = e.begin, p = e.end;
|
|
1133
|
+
return d && p ? [a(d).toDate(), a(p).toDate()] : [];
|
|
1125
1134
|
},
|
|
1126
1135
|
set(d) {
|
|
1127
|
-
let
|
|
1128
|
-
d[0] && d[1] ? (
|
|
1136
|
+
let p, v;
|
|
1137
|
+
d[0] && d[1] ? (p = a(d[0]).format(e.valueFormat), v = a(d[1]).format(e.valueFormat)) : p = v = "", l("update:begin", p), l("update:end", v);
|
|
1129
1138
|
}
|
|
1130
|
-
}),
|
|
1131
|
-
l("change", d,
|
|
1139
|
+
}), g = (d, p) => {
|
|
1140
|
+
l("change", d, p);
|
|
1132
1141
|
};
|
|
1133
|
-
return (d,
|
|
1134
|
-
const
|
|
1135
|
-
return
|
|
1142
|
+
return (d, p) => {
|
|
1143
|
+
const v = A("DatePicker");
|
|
1144
|
+
return $(), U(v, {
|
|
1136
1145
|
modelValue: i.value,
|
|
1137
|
-
"onUpdate:modelValue":
|
|
1146
|
+
"onUpdate:modelValue": p[0] || (p[0] = (u) => i.value = u),
|
|
1138
1147
|
type: t.type,
|
|
1139
1148
|
clearable: t.clearable,
|
|
1140
1149
|
"split-panels": t.splitPanels,
|
|
@@ -1143,14 +1152,14 @@ const A = {
|
|
|
1143
1152
|
placeholder: t.placeholder,
|
|
1144
1153
|
disabled: t.disabled,
|
|
1145
1154
|
placement: t.placement,
|
|
1146
|
-
onOnChange:
|
|
1155
|
+
onOnChange: g
|
|
1147
1156
|
}, null, 8, ["modelValue", "type", "clearable", "split-panels", "options", "transfer", "placeholder", "disabled", "placement"]);
|
|
1148
1157
|
};
|
|
1149
1158
|
}
|
|
1150
|
-
}),
|
|
1159
|
+
}), bt = {
|
|
1151
1160
|
name: "MCalendar"
|
|
1152
|
-
},
|
|
1153
|
-
...
|
|
1161
|
+
}, yt = /* @__PURE__ */ _({
|
|
1162
|
+
...bt,
|
|
1154
1163
|
props: {
|
|
1155
1164
|
/**
|
|
1156
1165
|
* 指定日期,默认显示该日期所在月份
|
|
@@ -1256,55 +1265,55 @@ const A = {
|
|
|
1256
1265
|
}
|
|
1257
1266
|
},
|
|
1258
1267
|
emits: ["update:range", "select-range", "click-day", "dblclick-day"],
|
|
1259
|
-
setup(t, { emit:
|
|
1260
|
-
const a =
|
|
1268
|
+
setup(t, { emit: k }) {
|
|
1269
|
+
const a = ve().appContext.config.globalProperties.$Date, e = t, l = k, n = E(), i = E(null), g = E(null), d = L(() => {
|
|
1261
1270
|
let c = Math.floor(e.startDay);
|
|
1262
1271
|
return (isNaN(c) || c < 0 || c > 6) && (c = 0), c;
|
|
1263
|
-
}),
|
|
1272
|
+
}), p = L(() => {
|
|
1264
1273
|
let c;
|
|
1265
|
-
const
|
|
1274
|
+
const S = [], r = d.value + 7;
|
|
1266
1275
|
for (let B = d.value; B < r; B++)
|
|
1267
|
-
c = B % 7,
|
|
1268
|
-
title: e.weekMap?.[c] ||
|
|
1276
|
+
c = B % 7, S.push({
|
|
1277
|
+
title: e.weekMap?.[c] || M.t(`mCalendar.${e.weekType}.${c}`),
|
|
1269
1278
|
order: c
|
|
1270
1279
|
});
|
|
1271
|
-
return
|
|
1272
|
-
}),
|
|
1273
|
-
let
|
|
1280
|
+
return S;
|
|
1281
|
+
}), v = (c) => {
|
|
1282
|
+
let S = a(
|
|
1274
1283
|
e.date || e.dates && e.dates[0] && e.dates[0][e.dateKey]
|
|
1275
|
-
), r, B,
|
|
1276
|
-
return e.isOnFirstLine ? r =
|
|
1277
|
-
beginDate:
|
|
1284
|
+
), r, B, h;
|
|
1285
|
+
return e.isOnFirstLine ? r = S : (r = S.startOf("month"), B = S.endOf("month")), h = r.day(), d.value !== 0 && h === 0 && (h = 7), S = r.subtract(h - d.value, "day"), e.isOnFirstLine && (B = S.add(41, "day")), {
|
|
1286
|
+
beginDate: S.format("YYYY-MM-DD"),
|
|
1278
1287
|
endDate: B?.format("YYYY-MM-DD"),
|
|
1279
|
-
extra: [
|
|
1288
|
+
extra: [S, e.isOnFirstLine ? S : r, B]
|
|
1280
1289
|
};
|
|
1281
1290
|
}, u = () => {
|
|
1282
|
-
e.hasRange && (i.value =
|
|
1291
|
+
e.hasRange && (i.value = g.value = null);
|
|
1283
1292
|
const {
|
|
1284
|
-
extra: [c,
|
|
1285
|
-
} =
|
|
1286
|
-
let o,
|
|
1293
|
+
extra: [c, S, r]
|
|
1294
|
+
} = v(), B = e.dates?.[0] ? e.dates.slice() : [], h = /* @__PURE__ */ new Date();
|
|
1295
|
+
let o, V, K;
|
|
1287
1296
|
for (n.value = [], o = 0; o < 42; o++)
|
|
1288
|
-
|
|
1289
|
-
_date:
|
|
1290
|
-
_text:
|
|
1291
|
-
_isOuter:
|
|
1297
|
+
V = c.add(o, "day"), K = B.find((le) => V.isSame(le[e.dateKey], "day")), n.value.push({
|
|
1298
|
+
_date: V.toDate(),
|
|
1299
|
+
_text: V.format(e.textFormat),
|
|
1300
|
+
_isOuter: V.isBefore(S, "day") || V.isAfter(r, "day"),
|
|
1292
1301
|
//!eachDay.isBetween(start, end, 'day', '[]'),
|
|
1293
|
-
_isToday:
|
|
1302
|
+
_isToday: V.isSame(h, "day"),
|
|
1294
1303
|
// _rangeStart: undefined,
|
|
1295
1304
|
// _rangeEnd: undefined,
|
|
1296
1305
|
_inRange: void 0,
|
|
1297
|
-
...
|
|
1306
|
+
...K
|
|
1298
1307
|
});
|
|
1299
1308
|
};
|
|
1300
|
-
let
|
|
1301
|
-
const
|
|
1309
|
+
let x;
|
|
1310
|
+
const s = (c, S) => {
|
|
1302
1311
|
const r = e.hasRange && (!c._isOuter || e.outerInRange);
|
|
1303
1312
|
if (r)
|
|
1304
1313
|
if (!i.value)
|
|
1305
1314
|
i.value = c, c._inRange = !0;
|
|
1306
|
-
else if (
|
|
1307
|
-
i.value =
|
|
1315
|
+
else if (g.value)
|
|
1316
|
+
i.value = g.value = null, n.value.forEach((B) => {
|
|
1308
1317
|
B._inRange = !1;
|
|
1309
1318
|
}), e.clearable || (i.value = c);
|
|
1310
1319
|
else {
|
|
@@ -1312,35 +1321,35 @@ const A = {
|
|
|
1312
1321
|
const B = i.value;
|
|
1313
1322
|
i.value = c, c = B;
|
|
1314
1323
|
}
|
|
1315
|
-
|
|
1324
|
+
g.value = c, c._inRange = !0;
|
|
1316
1325
|
}
|
|
1317
|
-
l("click-day", c,
|
|
1318
|
-
|
|
1319
|
-
}), l("update:range", [i.value,
|
|
1326
|
+
l("click-day", c, S), r && (x = !0, q(() => {
|
|
1327
|
+
x = null;
|
|
1328
|
+
}), l("update:range", [i.value, g.value]), l(
|
|
1320
1329
|
"select-range",
|
|
1321
|
-
[i.value,
|
|
1330
|
+
[i.value, g.value],
|
|
1322
1331
|
n.value.slice(
|
|
1323
1332
|
n.value.indexOf(i.value),
|
|
1324
|
-
n.value.indexOf(
|
|
1333
|
+
n.value.indexOf(g.value) + 1
|
|
1325
1334
|
)
|
|
1326
1335
|
));
|
|
1327
|
-
},
|
|
1328
|
-
l("dblclick-day", c,
|
|
1329
|
-
},
|
|
1330
|
-
if (!e.hasRange || !i.value ||
|
|
1336
|
+
}, b = (c, S) => {
|
|
1337
|
+
l("dblclick-day", c, S);
|
|
1338
|
+
}, C = (c, S) => {
|
|
1339
|
+
if (!e.hasRange || !i.value || g.value || c._isOuter && !e.outerInRange)
|
|
1331
1340
|
return;
|
|
1332
1341
|
let r = n.value.indexOf(i.value);
|
|
1333
|
-
if (
|
|
1342
|
+
if (S < r) {
|
|
1334
1343
|
const B = r;
|
|
1335
|
-
r =
|
|
1344
|
+
r = S, S = B;
|
|
1336
1345
|
}
|
|
1337
|
-
n.value.forEach((B,
|
|
1338
|
-
B._inRange =
|
|
1346
|
+
n.value.forEach((B, h) => {
|
|
1347
|
+
B._inRange = h >= r && h <= S;
|
|
1339
1348
|
});
|
|
1340
|
-
},
|
|
1341
|
-
if (!e.hasRange ||
|
|
1349
|
+
}, T = (c) => {
|
|
1350
|
+
if (!e.hasRange || x) return;
|
|
1342
1351
|
if (!c || !c.length) {
|
|
1343
|
-
i.value =
|
|
1352
|
+
i.value = g.value = null, n.value.forEach((o) => {
|
|
1344
1353
|
o._inRange = !1;
|
|
1345
1354
|
});
|
|
1346
1355
|
return;
|
|
@@ -1350,79 +1359,81 @@ const A = {
|
|
|
1350
1359
|
const o = c[1];
|
|
1351
1360
|
c[1] = c[0], c[0] = o;
|
|
1352
1361
|
}
|
|
1353
|
-
const
|
|
1354
|
-
let r, B = -1,
|
|
1355
|
-
for (let o = 0; o <
|
|
1362
|
+
const S = n.value.length;
|
|
1363
|
+
let r, B = -1, h = S;
|
|
1364
|
+
for (let o = 0; o < S; o++)
|
|
1356
1365
|
if (r = a(n.value[o]._date), B < 0 && r.isSame(c[0]._date, "day") && (i.value = n.value[o], B = o), r.isSame(c[1]._date, "day")) {
|
|
1357
|
-
|
|
1366
|
+
g.value = n.value[o], h = o;
|
|
1358
1367
|
break;
|
|
1359
1368
|
}
|
|
1360
|
-
n.value.forEach((o,
|
|
1361
|
-
o._inRange =
|
|
1369
|
+
n.value.forEach((o, V) => {
|
|
1370
|
+
o._inRange = V >= B && V <= h;
|
|
1362
1371
|
});
|
|
1363
1372
|
};
|
|
1364
|
-
return u(), e.range && (i.value = e.range[0],
|
|
1373
|
+
return u(), e.range && (i.value = e.range[0], g.value = e.range[1], T(e.range)), F(
|
|
1365
1374
|
() => e.date,
|
|
1366
1375
|
(c) => {
|
|
1367
1376
|
!e.dates && c instanceof Date && u();
|
|
1368
1377
|
}
|
|
1369
|
-
),
|
|
1378
|
+
), F(
|
|
1370
1379
|
() => e.dates,
|
|
1371
1380
|
(c) => {
|
|
1372
1381
|
c && u();
|
|
1373
1382
|
}
|
|
1374
|
-
),
|
|
1383
|
+
), F(
|
|
1375
1384
|
() => e.startDay,
|
|
1376
1385
|
() => {
|
|
1377
1386
|
u();
|
|
1378
1387
|
}
|
|
1379
|
-
),
|
|
1380
|
-
const r =
|
|
1381
|
-
return
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1388
|
+
), F(() => e.range, T), (c, S) => {
|
|
1389
|
+
const r = A("Col"), B = A("Row"), h = A("Spin");
|
|
1390
|
+
return $(), N("div", {
|
|
1391
|
+
class: P(y(I)("mcalendar"))
|
|
1392
|
+
}, [
|
|
1393
|
+
O(B, null, {
|
|
1394
|
+
default: D(() => [
|
|
1395
|
+
($(!0), N(Q, null, ee(p.value, (o, V) => ($(), U(r, {
|
|
1396
|
+
key: V,
|
|
1386
1397
|
span: "4",
|
|
1387
|
-
class:
|
|
1388
|
-
"mcalendar-title",
|
|
1398
|
+
class: P([
|
|
1399
|
+
y(I)("mcalendar-title"),
|
|
1389
1400
|
{ weekend: t.offDay.includes(o.order) },
|
|
1390
|
-
t.titleClass && t.titleClass(o,
|
|
1401
|
+
t.titleClass && t.titleClass(o, V)
|
|
1391
1402
|
])
|
|
1392
1403
|
}, {
|
|
1393
|
-
default:
|
|
1394
|
-
j(
|
|
1404
|
+
default: D(() => [
|
|
1405
|
+
j(H(o.title), 1)
|
|
1395
1406
|
]),
|
|
1396
1407
|
_: 2
|
|
1397
1408
|
}, 1032, ["class"]))), 128))
|
|
1398
1409
|
]),
|
|
1399
1410
|
_: 1
|
|
1400
1411
|
}),
|
|
1401
|
-
|
|
1402
|
-
default:
|
|
1403
|
-
(
|
|
1404
|
-
key:
|
|
1412
|
+
O(B, null, {
|
|
1413
|
+
default: D(() => [
|
|
1414
|
+
($(!0), N(Q, null, ee(n.value, (o, V) => ($(), U(r, {
|
|
1415
|
+
key: V,
|
|
1405
1416
|
span: "4",
|
|
1406
|
-
class:
|
|
1407
|
-
"mcalendar-cell",
|
|
1408
|
-
|
|
1417
|
+
class: P([
|
|
1418
|
+
y(I)("mcalendar-cell"),
|
|
1419
|
+
o._isToday && y(I)("mcalendar-cell_today"),
|
|
1409
1420
|
{ outer: o._isOuter },
|
|
1410
1421
|
{ "range-start": o === i.value },
|
|
1411
1422
|
{ "in-range": o._inRange },
|
|
1412
|
-
{ "range-end": o ===
|
|
1413
|
-
t.dateClass && t.dateClass(o,
|
|
1423
|
+
{ "range-end": o === g.value },
|
|
1424
|
+
t.dateClass && t.dateClass(o, V),
|
|
1414
1425
|
o.className
|
|
1415
1426
|
]),
|
|
1416
|
-
onClick: (
|
|
1417
|
-
onDblclick: (
|
|
1418
|
-
onMouseenter: (
|
|
1427
|
+
onClick: (K) => s(o, V),
|
|
1428
|
+
onDblclick: (K) => b(o, V),
|
|
1429
|
+
onMouseenter: (K) => C(o, V)
|
|
1419
1430
|
}, {
|
|
1420
|
-
default:
|
|
1421
|
-
|
|
1431
|
+
default: D(() => [
|
|
1432
|
+
z(c.$slots, "cell", {
|
|
1422
1433
|
day: o,
|
|
1423
|
-
index:
|
|
1434
|
+
index: V
|
|
1424
1435
|
}, () => [
|
|
1425
|
-
j(
|
|
1436
|
+
j(H(o._text), 1)
|
|
1426
1437
|
])
|
|
1427
1438
|
]),
|
|
1428
1439
|
_: 2
|
|
@@ -1430,17 +1441,17 @@ const A = {
|
|
|
1430
1441
|
]),
|
|
1431
1442
|
_: 3
|
|
1432
1443
|
}),
|
|
1433
|
-
|
|
1434
|
-
[
|
|
1444
|
+
ae(O(h, { fix: "" }, null, 512), [
|
|
1445
|
+
[ue, t.loading]
|
|
1435
1446
|
])
|
|
1436
|
-
]);
|
|
1447
|
+
], 2);
|
|
1437
1448
|
};
|
|
1438
1449
|
}
|
|
1439
|
-
}),
|
|
1450
|
+
}), kt = {
|
|
1440
1451
|
name: "ModalFooter",
|
|
1441
1452
|
inheritAttrs: !1
|
|
1442
|
-
},
|
|
1443
|
-
...
|
|
1453
|
+
}, Ct = /* @__PURE__ */ _({
|
|
1454
|
+
...kt,
|
|
1444
1455
|
props: {
|
|
1445
1456
|
modelValue: Boolean,
|
|
1446
1457
|
/**
|
|
@@ -1495,75 +1506,75 @@ const A = {
|
|
|
1495
1506
|
}
|
|
1496
1507
|
},
|
|
1497
1508
|
emits: ["update:modelValue", "ok", "cancel"],
|
|
1498
|
-
setup(t, { emit:
|
|
1499
|
-
const a =
|
|
1509
|
+
setup(t, { emit: k }) {
|
|
1510
|
+
const a = k, e = ve(), l = () => {
|
|
1500
1511
|
e.vnode.props.onCancel ? a("cancel") : a("update:modelValue", !1);
|
|
1501
1512
|
};
|
|
1502
1513
|
return (n, i) => {
|
|
1503
|
-
const
|
|
1504
|
-
return
|
|
1514
|
+
const g = A("Col"), d = A("Button"), p = A("Row");
|
|
1515
|
+
return $(), U(p, {
|
|
1505
1516
|
justify: "space-between",
|
|
1506
1517
|
align: "middle"
|
|
1507
1518
|
}, {
|
|
1508
|
-
default:
|
|
1509
|
-
|
|
1510
|
-
default:
|
|
1511
|
-
|
|
1519
|
+
default: D(() => [
|
|
1520
|
+
O(g, null, {
|
|
1521
|
+
default: D(() => [
|
|
1522
|
+
z(n.$slots, "other")
|
|
1512
1523
|
]),
|
|
1513
1524
|
_: 3
|
|
1514
1525
|
}),
|
|
1515
|
-
|
|
1516
|
-
default:
|
|
1517
|
-
t.rightCancel ? (
|
|
1518
|
-
t.hasOk ? (
|
|
1526
|
+
O(g, { class: "flex" }, {
|
|
1527
|
+
default: D(() => [
|
|
1528
|
+
t.rightCancel ? ($(), N(Q, { key: 1 }, [
|
|
1529
|
+
t.hasOk ? ($(), U(d, G({
|
|
1519
1530
|
key: 0,
|
|
1520
1531
|
disabled: t.okDisabled,
|
|
1521
1532
|
loading: t.okLoading
|
|
1522
1533
|
}, t.ok, {
|
|
1523
1534
|
type: "primary",
|
|
1524
|
-
onClick: i[1] || (i[1] = (
|
|
1535
|
+
onClick: i[1] || (i[1] = (v) => n.$emit("ok"))
|
|
1525
1536
|
}), {
|
|
1526
|
-
default:
|
|
1527
|
-
j(
|
|
1537
|
+
default: D(() => [
|
|
1538
|
+
j(H(t.okText ?? y(M).t("modalFooter.ok")), 1)
|
|
1528
1539
|
]),
|
|
1529
1540
|
_: 1
|
|
1530
1541
|
}, 16, ["disabled", "loading"])) : W("", !0),
|
|
1531
|
-
|
|
1542
|
+
O(d, G({
|
|
1532
1543
|
disabled: t.cancelDisabled,
|
|
1533
1544
|
loading: t.cancelLoading,
|
|
1534
1545
|
type: t.cancelType
|
|
1535
1546
|
}, t.cancel, { onClick: l }), {
|
|
1536
|
-
default:
|
|
1537
|
-
j(
|
|
1547
|
+
default: D(() => [
|
|
1548
|
+
j(H(t.cancelText ?? y(M).t("modalFooter.cancel")), 1)
|
|
1538
1549
|
]),
|
|
1539
1550
|
_: 1
|
|
1540
1551
|
}, 16, ["disabled", "loading", "type"])
|
|
1541
|
-
], 64)) : (
|
|
1542
|
-
|
|
1552
|
+
], 64)) : ($(), N(Q, { key: 0 }, [
|
|
1553
|
+
O(d, G({
|
|
1543
1554
|
disabled: t.cancelDisabled,
|
|
1544
1555
|
loading: t.cancelLoading,
|
|
1545
1556
|
type: t.cancelType
|
|
1546
1557
|
}, t.cancel, { onClick: l }), {
|
|
1547
|
-
default:
|
|
1548
|
-
j(
|
|
1558
|
+
default: D(() => [
|
|
1559
|
+
j(H(t.cancelText ?? y(M).t("modalFooter.cancel")), 1)
|
|
1549
1560
|
]),
|
|
1550
1561
|
_: 1
|
|
1551
1562
|
}, 16, ["disabled", "loading", "type"]),
|
|
1552
|
-
t.hasOk ? (
|
|
1563
|
+
t.hasOk ? ($(), U(d, G({
|
|
1553
1564
|
key: 0,
|
|
1554
1565
|
disabled: t.okDisabled,
|
|
1555
1566
|
loading: t.okLoading
|
|
1556
1567
|
}, t.ok, {
|
|
1557
1568
|
type: "primary",
|
|
1558
|
-
onClick: i[0] || (i[0] = (
|
|
1569
|
+
onClick: i[0] || (i[0] = (v) => n.$emit("ok"))
|
|
1559
1570
|
}), {
|
|
1560
|
-
default:
|
|
1561
|
-
j(
|
|
1571
|
+
default: D(() => [
|
|
1572
|
+
j(H(t.okText ?? y(M).t("modalFooter.ok")), 1)
|
|
1562
1573
|
]),
|
|
1563
1574
|
_: 1
|
|
1564
1575
|
}, 16, ["disabled", "loading"])) : W("", !0)
|
|
1565
1576
|
], 64)),
|
|
1566
|
-
|
|
1577
|
+
z(n.$slots, "action")
|
|
1567
1578
|
]),
|
|
1568
1579
|
_: 3
|
|
1569
1580
|
})
|
|
@@ -1572,13 +1583,13 @@ const A = {
|
|
|
1572
1583
|
});
|
|
1573
1584
|
};
|
|
1574
1585
|
}
|
|
1575
|
-
}),
|
|
1586
|
+
}), St = {
|
|
1576
1587
|
key: 0,
|
|
1577
1588
|
class: "ivu-dropdown-item"
|
|
1578
|
-
},
|
|
1589
|
+
}, J = {}, Bt = {
|
|
1579
1590
|
name: "ToggleColumn"
|
|
1580
|
-
},
|
|
1581
|
-
...
|
|
1591
|
+
}, ze = /* @__PURE__ */ _({
|
|
1592
|
+
...Bt,
|
|
1582
1593
|
props: {
|
|
1583
1594
|
modelValue: {
|
|
1584
1595
|
type: Array
|
|
@@ -1610,126 +1621,128 @@ const A = {
|
|
|
1610
1621
|
storeAt: String
|
|
1611
1622
|
},
|
|
1612
1623
|
emits: ["update:modelValue", "change"],
|
|
1613
|
-
setup(t, { emit:
|
|
1614
|
-
const a = t, e =
|
|
1624
|
+
setup(t, { emit: k }) {
|
|
1625
|
+
const a = t, e = k;
|
|
1615
1626
|
let l, n, i;
|
|
1616
|
-
const
|
|
1627
|
+
const g = (h) => {
|
|
1617
1628
|
clearTimeout(l);
|
|
1618
1629
|
let o = localStorage.getItem(n);
|
|
1619
|
-
o = o ? JSON.parse(o) : {},
|
|
1630
|
+
o = o ? JSON.parse(o) : {}, h ? Je(o, qe(i, d)) : _e(o, i, d), l = setTimeout(() => {
|
|
1620
1631
|
l = null, localStorage.setItem(n, JSON.stringify(o));
|
|
1621
1632
|
});
|
|
1622
1633
|
};
|
|
1623
1634
|
let d;
|
|
1624
|
-
a.storeAt && (n = a.storeAt.split(".")[0], i = a.storeAt.slice(n.length + 1), d = localStorage.getItem(n) &&
|
|
1625
|
-
const
|
|
1626
|
-
const
|
|
1627
|
-
return
|
|
1628
|
-
}),
|
|
1635
|
+
a.storeAt && (n = a.storeAt.split(".")[0], i = a.storeAt.slice(n.length + 1), d = localStorage.getItem(n) && pe(JSON.parse(localStorage[n]), i), d || (d = {}, g(!0)));
|
|
1636
|
+
const p = E(!1), v = Se([]), u = E([]), x = L(() => {
|
|
1637
|
+
const h = u.value.filter((o) => o._switchable);
|
|
1638
|
+
return h.some((o) => o._visible) && h.some((o) => !o._visible);
|
|
1639
|
+
}), s = L({
|
|
1629
1640
|
get() {
|
|
1630
|
-
const
|
|
1631
|
-
return
|
|
1641
|
+
const h = u.value.filter((o) => o._switchable);
|
|
1642
|
+
return h.length > 0 && h.every((o) => o._visible);
|
|
1632
1643
|
},
|
|
1633
|
-
set(
|
|
1634
|
-
u.value.forEach((o,
|
|
1635
|
-
o._switchable && (
|
|
1636
|
-
}), a.storeAt && (u.value.forEach((o,
|
|
1644
|
+
set(h) {
|
|
1645
|
+
u.value.forEach((o, V) => {
|
|
1646
|
+
o._switchable && (v.value[V]._visible = o._visible = h);
|
|
1647
|
+
}), a.storeAt && (u.value.forEach((o, V) => {
|
|
1637
1648
|
d[o.key] = o._visible;
|
|
1638
|
-
}),
|
|
1649
|
+
}), g()), B(), e("change", v.value);
|
|
1639
1650
|
}
|
|
1640
1651
|
});
|
|
1641
|
-
function
|
|
1642
|
-
const
|
|
1643
|
-
if (!a.all &&
|
|
1644
|
-
|
|
1652
|
+
function b() {
|
|
1653
|
+
const h = u.value.filter((o) => o._visible);
|
|
1654
|
+
if (!a.all && h.length === 1) {
|
|
1655
|
+
h[0]._switchable = !1;
|
|
1645
1656
|
return;
|
|
1646
1657
|
}
|
|
1647
|
-
|
|
1658
|
+
h.forEach((o) => {
|
|
1648
1659
|
o.initSwitchable && !o._switchable && (o._switchable = !0);
|
|
1649
1660
|
});
|
|
1650
1661
|
}
|
|
1651
|
-
function
|
|
1652
|
-
|
|
1662
|
+
function C(h, o) {
|
|
1663
|
+
v.value[o]._visible = h._visible, a.storeAt && (d[h.key] = h._visible, g()), B(), b(), e("change", v.value[o]);
|
|
1653
1664
|
}
|
|
1654
|
-
let
|
|
1655
|
-
function c(
|
|
1656
|
-
clearTimeout(
|
|
1657
|
-
|
|
1665
|
+
let T;
|
|
1666
|
+
function c(h) {
|
|
1667
|
+
clearTimeout(T), T = setTimeout(() => {
|
|
1668
|
+
p.value = h, T = null;
|
|
1658
1669
|
}, 200);
|
|
1659
1670
|
}
|
|
1660
|
-
function
|
|
1661
|
-
(
|
|
1662
|
-
|
|
1663
|
-
title:
|
|
1664
|
-
key:
|
|
1665
|
-
initSwitchable:
|
|
1666
|
-
_switchable:
|
|
1667
|
-
_visible:
|
|
1671
|
+
function S() {
|
|
1672
|
+
(J[a.cacheId]?.cols || a.modelValue).forEach((h) => {
|
|
1673
|
+
h.hasOwnProperty("_visible") || (a.storeAt ? h._visible = d[h.key] === void 0 || d[h.key] : h._visible = !0), h.hasOwnProperty("_switchable") || (h._switchable = !0), v.value.push(h), u.value.push({
|
|
1674
|
+
title: h.title || "",
|
|
1675
|
+
key: h.key,
|
|
1676
|
+
initSwitchable: h._switchable,
|
|
1677
|
+
_switchable: h._switchable,
|
|
1678
|
+
_visible: h._visible
|
|
1668
1679
|
});
|
|
1669
|
-
}),
|
|
1680
|
+
}), b(), B();
|
|
1670
1681
|
}
|
|
1671
1682
|
let r;
|
|
1672
1683
|
function B() {
|
|
1673
|
-
a.cacheId != null && (
|
|
1674
|
-
|
|
1684
|
+
a.cacheId != null && (J[a.cacheId].flag = !0, setTimeout(() => {
|
|
1685
|
+
J[a.cacheId].flag = null;
|
|
1675
1686
|
})), r = !0, setTimeout(() => {
|
|
1676
1687
|
r = null;
|
|
1677
1688
|
}), e(
|
|
1678
1689
|
"update:modelValue",
|
|
1679
|
-
|
|
1690
|
+
v.value.filter((h) => h._visible)
|
|
1680
1691
|
);
|
|
1681
1692
|
}
|
|
1682
|
-
return
|
|
1683
|
-
a.cacheId != null && (
|
|
1684
|
-
|
|
1685
|
-
})),
|
|
1686
|
-
}),
|
|
1693
|
+
return me(() => {
|
|
1694
|
+
a.cacheId != null && (J[a.cacheId] ? J[a.cacheId].all++ : J[a.cacheId] = { cols: a.modelValue, all: 1 }, Ae(() => {
|
|
1695
|
+
J[a.cacheId] && --J[a.cacheId].all < 1 && delete J[a.cacheId];
|
|
1696
|
+
})), S();
|
|
1697
|
+
}), F(
|
|
1687
1698
|
() => a.modelValue,
|
|
1688
|
-
(
|
|
1689
|
-
r || (
|
|
1699
|
+
(h) => {
|
|
1700
|
+
r || (J[a.cacheId] && !J[a.cacheId].flag && (J[a.cacheId].cols = h), v.value = [], u.value = [], S());
|
|
1690
1701
|
}
|
|
1691
|
-
), (
|
|
1692
|
-
const
|
|
1693
|
-
return
|
|
1702
|
+
), (h, o) => {
|
|
1703
|
+
const V = A("Icon"), K = A("Button"), le = A("Checkbox"), be = A("DropdownItem"), fe = A("DropdownMenu"), se = A("Dropdown");
|
|
1704
|
+
return $(), U(se, {
|
|
1694
1705
|
trigger: "custom",
|
|
1695
|
-
visible:
|
|
1706
|
+
visible: p.value,
|
|
1696
1707
|
placement: "bottom-end",
|
|
1697
1708
|
transfer: t.transfer,
|
|
1698
|
-
"transfer-class-name": "toggle-column-pop",
|
|
1699
|
-
class: "toggle-column"
|
|
1709
|
+
"transfer-class-name": y(I)("toggle-column-pop"),
|
|
1710
|
+
class: P(y(I)("toggle-column"))
|
|
1700
1711
|
}, {
|
|
1701
|
-
list:
|
|
1712
|
+
list: D(() => [
|
|
1702
1713
|
te("div", {
|
|
1703
|
-
onMouseenter: o[3] || (o[3] = (
|
|
1704
|
-
onMouseleave: o[4] || (o[4] = (
|
|
1714
|
+
onMouseenter: o[3] || (o[3] = (Y) => c(!0)),
|
|
1715
|
+
onMouseleave: o[4] || (o[4] = (Y) => c(!1))
|
|
1705
1716
|
}, [
|
|
1706
|
-
t.all ? (
|
|
1707
|
-
|
|
1708
|
-
modelValue:
|
|
1709
|
-
"onUpdate:modelValue": o[2] || (o[2] = (
|
|
1710
|
-
indeterminate:
|
|
1717
|
+
t.all ? ($(), N("div", St, [
|
|
1718
|
+
O(le, {
|
|
1719
|
+
modelValue: s.value,
|
|
1720
|
+
"onUpdate:modelValue": o[2] || (o[2] = (Y) => s.value = Y),
|
|
1721
|
+
indeterminate: x.value
|
|
1711
1722
|
}, {
|
|
1712
|
-
default:
|
|
1713
|
-
j(
|
|
1723
|
+
default: D(() => [
|
|
1724
|
+
j(H(y(M).t("toggleColumn.checkAll")), 1)
|
|
1714
1725
|
]),
|
|
1715
1726
|
_: 1
|
|
1716
1727
|
}, 8, ["modelValue", "indeterminate"])
|
|
1717
1728
|
])) : W("", !0),
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1729
|
+
O(fe, {
|
|
1730
|
+
class: P(y(I)("toggle-column-list"))
|
|
1731
|
+
}, {
|
|
1732
|
+
default: D(() => [
|
|
1733
|
+
($(!0), N(Q, null, ee(u.value, (Y, de) => ($(), U(be, {
|
|
1734
|
+
key: de,
|
|
1735
|
+
disabled: !Y._switchable
|
|
1723
1736
|
}, {
|
|
1724
|
-
default:
|
|
1725
|
-
|
|
1726
|
-
modelValue:
|
|
1727
|
-
"onUpdate:modelValue": (
|
|
1728
|
-
disabled: !
|
|
1729
|
-
onOnChange: (
|
|
1737
|
+
default: D(() => [
|
|
1738
|
+
O(le, {
|
|
1739
|
+
modelValue: Y._visible,
|
|
1740
|
+
"onUpdate:modelValue": (ce) => Y._visible = ce,
|
|
1741
|
+
disabled: !Y._switchable,
|
|
1742
|
+
onOnChange: (ce) => C(Y, de)
|
|
1730
1743
|
}, {
|
|
1731
|
-
default:
|
|
1732
|
-
j(
|
|
1744
|
+
default: D(() => [
|
|
1745
|
+
j(H(Y.title), 1)
|
|
1733
1746
|
]),
|
|
1734
1747
|
_: 2
|
|
1735
1748
|
}, 1032, ["modelValue", "onUpdate:modelValue", "disabled", "onOnChange"])
|
|
@@ -1738,45 +1751,41 @@ const A = {
|
|
|
1738
1751
|
}, 1032, ["disabled"]))), 128))
|
|
1739
1752
|
]),
|
|
1740
1753
|
_: 1
|
|
1741
|
-
})
|
|
1754
|
+
}, 8, ["class"])
|
|
1742
1755
|
], 32)
|
|
1743
1756
|
]),
|
|
1744
|
-
default:
|
|
1757
|
+
default: D(() => [
|
|
1745
1758
|
te("span", {
|
|
1746
|
-
onMouseover: o[0] || (o[0] = (
|
|
1747
|
-
onMouseout: o[1] || (o[1] = (
|
|
1748
|
-
class: "toggle-column-btn"
|
|
1759
|
+
onMouseover: o[0] || (o[0] = (Y) => c(!0)),
|
|
1760
|
+
onMouseout: o[1] || (o[1] = (Y) => c(!1)),
|
|
1761
|
+
class: P(y(I)("toggle-column-btn"))
|
|
1749
1762
|
}, [
|
|
1750
|
-
|
|
1751
|
-
|
|
1763
|
+
z(h.$slots, "default", {}, () => [
|
|
1764
|
+
O(K, {
|
|
1752
1765
|
type: "default",
|
|
1753
1766
|
icon: t.icon
|
|
1754
1767
|
}, {
|
|
1755
|
-
default:
|
|
1756
|
-
t.icon ? W("", !0) : (
|
|
1757
|
-
j(
|
|
1758
|
-
|
|
1768
|
+
default: D(() => [
|
|
1769
|
+
t.icon ? W("", !0) : ($(), N(Q, { key: 0 }, [
|
|
1770
|
+
j(H(t.title ?? y(M).t("toggleColumn.title")) + " ", 1),
|
|
1771
|
+
O(V, { type: "ios-arrow-down" })
|
|
1759
1772
|
], 64))
|
|
1760
1773
|
]),
|
|
1761
1774
|
_: 1
|
|
1762
1775
|
}, 8, ["icon"])
|
|
1763
1776
|
])
|
|
1764
|
-
],
|
|
1777
|
+
], 34)
|
|
1765
1778
|
]),
|
|
1766
1779
|
_: 3
|
|
1767
|
-
}, 8, ["visible", "transfer"]);
|
|
1780
|
+
}, 8, ["visible", "transfer", "transfer-class-name", "class"]);
|
|
1768
1781
|
};
|
|
1769
1782
|
}
|
|
1770
|
-
}),
|
|
1771
|
-
class: "page-table-header-title"
|
|
1772
|
-
}, yt = {
|
|
1773
|
-
class: "page-table-list"
|
|
1774
|
-
}, kt = {
|
|
1783
|
+
}), Dt = {
|
|
1775
1784
|
name: "PageTable"
|
|
1776
1785
|
// inheritAttrs: false
|
|
1777
|
-
},
|
|
1778
|
-
...
|
|
1779
|
-
props: /* @__PURE__ */
|
|
1786
|
+
}, Vt = /* @__PURE__ */ _({
|
|
1787
|
+
...Dt,
|
|
1788
|
+
props: /* @__PURE__ */ xe({
|
|
1780
1789
|
columns: {
|
|
1781
1790
|
type: Array,
|
|
1782
1791
|
default: () => []
|
|
@@ -1845,13 +1854,6 @@ const A = {
|
|
|
1845
1854
|
*/
|
|
1846
1855
|
process: Function,
|
|
1847
1856
|
// loading: Boolean,
|
|
1848
|
-
/**
|
|
1849
|
-
* 自动设置Table的maxHeight
|
|
1850
|
-
*/
|
|
1851
|
-
autoMaxHeight: {
|
|
1852
|
-
type: Boolean,
|
|
1853
|
-
default: !0
|
|
1854
|
-
},
|
|
1855
1857
|
/**
|
|
1856
1858
|
* 是否本地分页
|
|
1857
1859
|
*/
|
|
@@ -1869,16 +1871,12 @@ const A = {
|
|
|
1869
1871
|
autoRemain: Boolean,
|
|
1870
1872
|
/**
|
|
1871
1873
|
* 计算Table的maxHeight时,Table距离视口底部的距离
|
|
1872
|
-
* @default
|
|
1874
|
+
* @default 45
|
|
1873
1875
|
*/
|
|
1874
1876
|
bottomDis: {
|
|
1875
1877
|
type: [Number, String],
|
|
1876
|
-
default:
|
|
1878
|
+
default: 45
|
|
1877
1879
|
},
|
|
1878
|
-
/**
|
|
1879
|
-
* Table的maxHeight
|
|
1880
|
-
*/
|
|
1881
|
-
maxHeight: [Number, String],
|
|
1882
1880
|
/**
|
|
1883
1881
|
* 勾选项
|
|
1884
1882
|
*/
|
|
@@ -1922,257 +1920,311 @@ const A = {
|
|
|
1922
1920
|
/**
|
|
1923
1921
|
* 传至ToggleColumn组件的storeAt
|
|
1924
1922
|
*/
|
|
1925
|
-
storeAt: String
|
|
1923
|
+
storeAt: String,
|
|
1924
|
+
/**
|
|
1925
|
+
* 隐藏分页
|
|
1926
|
+
*/
|
|
1927
|
+
hidePage: Boolean,
|
|
1928
|
+
/**
|
|
1929
|
+
* 自动设置Table的maxHeight
|
|
1930
|
+
*/
|
|
1931
|
+
autoMaxHeight: {
|
|
1932
|
+
type: Boolean,
|
|
1933
|
+
default: !0
|
|
1934
|
+
},
|
|
1935
|
+
/**
|
|
1936
|
+
* Table的maxHeight
|
|
1937
|
+
*/
|
|
1938
|
+
maxHeight: [Number, String],
|
|
1939
|
+
/**
|
|
1940
|
+
* Table的height
|
|
1941
|
+
*/
|
|
1942
|
+
height: [Number, String],
|
|
1943
|
+
/**
|
|
1944
|
+
* 自动设置Table的height
|
|
1945
|
+
*/
|
|
1946
|
+
autoHeight: Boolean,
|
|
1947
|
+
/**
|
|
1948
|
+
* 最大化时自动计算哪种高度
|
|
1949
|
+
*/
|
|
1950
|
+
maximizeHeightType: {
|
|
1951
|
+
type: String,
|
|
1952
|
+
default: "maxHeight"
|
|
1953
|
+
}
|
|
1926
1954
|
}, {
|
|
1927
1955
|
loading: {
|
|
1928
1956
|
type: Boolean
|
|
1929
1957
|
},
|
|
1930
1958
|
loadingModifiers: {}
|
|
1931
1959
|
}),
|
|
1932
|
-
emits: /* @__PURE__ */
|
|
1960
|
+
emits: /* @__PURE__ */ xe(["update:modelValue", "update:selection", "load", "select-all", "selection-change", "select", "reload", "change-col", "maximize-change"], ["update:loading"]),
|
|
1933
1961
|
setup(t, {
|
|
1934
|
-
expose:
|
|
1962
|
+
expose: k,
|
|
1935
1963
|
emit: a
|
|
1936
1964
|
}) {
|
|
1937
1965
|
const e = t, l = a;
|
|
1938
|
-
let n;
|
|
1939
|
-
const
|
|
1966
|
+
let n, i;
|
|
1967
|
+
const g = Ye(t, "loading"), d = he("tableRef"), p = he("elRef"), v = he("pageRef"), u = E(!1), x = Se(), s = Ge({
|
|
1940
1968
|
data: [],
|
|
1941
1969
|
// rows: [] as Obj[],
|
|
1942
1970
|
// selections: [],
|
|
1943
1971
|
// loading: false,
|
|
1972
|
+
height: e.height,
|
|
1944
1973
|
maxHeight: e.maxHeight,
|
|
1945
1974
|
selectType: {
|
|
1946
1975
|
align: "center",
|
|
1947
|
-
className: "page-table-mr0",
|
|
1976
|
+
className: I("page-table-mr0"),
|
|
1948
1977
|
renderHeader: (m) => {
|
|
1949
|
-
const
|
|
1978
|
+
const f = s.data.filter((w) => w._checkable && !w._disabled), R = f.length;
|
|
1950
1979
|
return (
|
|
1951
1980
|
// table.rows.some((e) => e._checkable) && (
|
|
1952
|
-
|
|
1953
|
-
"model-value": !!
|
|
1954
|
-
disabled: !
|
|
1981
|
+
s.data.some((w) => w._checkable) && O($e, {
|
|
1982
|
+
"model-value": !!R && f.every((w) => w._checked),
|
|
1983
|
+
disabled: !R,
|
|
1955
1984
|
"onUpdate:model-value": (w) => {
|
|
1956
|
-
|
|
1957
|
-
|
|
1985
|
+
f.forEach((X) => {
|
|
1986
|
+
X._checked = w;
|
|
1958
1987
|
});
|
|
1959
1988
|
},
|
|
1960
1989
|
onOnChange: (w) => {
|
|
1961
|
-
|
|
1990
|
+
se(), l("select-all", e.pure ? f.map((X) => ge(X)) : f, w);
|
|
1962
1991
|
}
|
|
1963
1992
|
}, null)
|
|
1964
1993
|
);
|
|
1965
1994
|
},
|
|
1966
1995
|
render: (m, {
|
|
1967
|
-
row:
|
|
1968
|
-
index:
|
|
1969
|
-
}) =>
|
|
1970
|
-
"model-value":
|
|
1971
|
-
disabled:
|
|
1996
|
+
row: f,
|
|
1997
|
+
index: R
|
|
1998
|
+
}) => f._checkable && O($e, {
|
|
1999
|
+
"model-value": f._checked,
|
|
2000
|
+
disabled: f._disabled,
|
|
1972
2001
|
"onUpdate:model-value": (w) => {
|
|
1973
|
-
|
|
2002
|
+
He(s.data[R], w);
|
|
1974
2003
|
}
|
|
1975
2004
|
}, null)
|
|
1976
2005
|
}
|
|
1977
|
-
}),
|
|
2006
|
+
}), b = Te({
|
|
1978
2007
|
curr: 1,
|
|
1979
|
-
size:
|
|
2008
|
+
size: e.initSize || e.pageSizeOpts[0],
|
|
1980
2009
|
total: 0
|
|
1981
|
-
}),
|
|
1982
|
-
const m = [],
|
|
1983
|
-
|
|
1984
|
-
|
|
2010
|
+
}), C = L(() => u.value ? !1 : e.transfer), T = L(() => {
|
|
2011
|
+
const m = [], f = (R) => {
|
|
2012
|
+
R.slot && m.push(R), R.children && R.children.forEach((w) => {
|
|
2013
|
+
f(w);
|
|
1985
2014
|
});
|
|
1986
2015
|
};
|
|
1987
|
-
return e.columns.forEach((
|
|
1988
|
-
|
|
2016
|
+
return e.columns.forEach((R) => {
|
|
2017
|
+
f(R);
|
|
1989
2018
|
}), m;
|
|
1990
2019
|
});
|
|
1991
|
-
function
|
|
1992
|
-
const m = e.columns.find((
|
|
2020
|
+
function c() {
|
|
2021
|
+
const m = e.columns.find((f) => f.type === "selection");
|
|
1993
2022
|
if (m) {
|
|
1994
|
-
const
|
|
2023
|
+
const f = {
|
|
1995
2024
|
// fixed: selectType.fixed,
|
|
1996
2025
|
// key: selectType.key,
|
|
1997
2026
|
...m,
|
|
1998
2027
|
width: m.width || 54,
|
|
1999
2028
|
type: void 0,
|
|
2000
|
-
...
|
|
2029
|
+
...s.selectType
|
|
2001
2030
|
};
|
|
2002
|
-
|
|
2031
|
+
x.value = [f].concat(e.columns.slice(1));
|
|
2003
2032
|
} else
|
|
2004
|
-
|
|
2033
|
+
x.value = e.columns;
|
|
2005
2034
|
}
|
|
2006
|
-
let
|
|
2007
|
-
async function
|
|
2035
|
+
let S, r, B = 0;
|
|
2036
|
+
async function h() {
|
|
2008
2037
|
if (typeof e.method != "function") return console.warn("typeof method isn't function");
|
|
2009
|
-
|
|
2010
|
-
const m =
|
|
2011
|
-
|
|
2012
|
-
|
|
2038
|
+
r && (B = (B + 1) % Number.MAX_SAFE_INTEGER);
|
|
2039
|
+
const m = B;
|
|
2040
|
+
r = !0, g.value = !0, l("update:selection", []);
|
|
2041
|
+
const f = await e.method(Object.assign(Ve(), typeof e.param != "function" ? e.param : e.param()));
|
|
2042
|
+
if (B !== m) return;
|
|
2043
|
+
if (g.value = !1, r = null, !f) {
|
|
2044
|
+
e.autoRemain || (b.total = 0, l("update:modelValue", []));
|
|
2013
2045
|
return;
|
|
2014
2046
|
}
|
|
2015
|
-
let
|
|
2016
|
-
if (
|
|
2017
|
-
const
|
|
2018
|
-
Array.isArray(
|
|
2047
|
+
let R = pe(f, e.dataKey) || [];
|
|
2048
|
+
if (o(R), typeof e.process == "function") {
|
|
2049
|
+
const w = e.process(R);
|
|
2050
|
+
Array.isArray(w) && (R = w);
|
|
2019
2051
|
}
|
|
2020
|
-
|
|
2021
|
-
|
|
2052
|
+
s.data = R, b.total = pe(f, e.totalKey) || 0, S = !0, l("update:modelValue", s.data), l("load", f), setTimeout(() => {
|
|
2053
|
+
S = null;
|
|
2022
2054
|
});
|
|
2023
2055
|
}
|
|
2024
|
-
function
|
|
2025
|
-
e.columns.some((
|
|
2026
|
-
|
|
2056
|
+
function o(m) {
|
|
2057
|
+
e.columns.some((f) => f.type === "selection") && m.forEach((f) => {
|
|
2058
|
+
f._checkable = !0, f._checked = f._disabled = !1;
|
|
2027
2059
|
});
|
|
2028
2060
|
}
|
|
2029
|
-
function
|
|
2030
|
-
typeof e.check == "function" && !e.check() || (e.isLocal ?
|
|
2061
|
+
function V(m) {
|
|
2062
|
+
typeof e.check == "function" && !e.check() || (e.isLocal ? K(m) : h());
|
|
2031
2063
|
}
|
|
2032
|
-
function
|
|
2033
|
-
let
|
|
2034
|
-
const
|
|
2035
|
-
for (;
|
|
2036
|
-
|
|
2037
|
-
|
|
2064
|
+
function K(m) {
|
|
2065
|
+
let f = m ? b.size * (b.curr - 1) : 0;
|
|
2066
|
+
const R = [], w = f + b.size, X = w > b.total ? b.total : w, re = e.modelValue;
|
|
2067
|
+
for (; f < X; f++)
|
|
2068
|
+
re[f]._checked = re[f]._disabled = !1, R.push(re[f]);
|
|
2069
|
+
s.data = R, l("update:selection", []);
|
|
2038
2070
|
}
|
|
2039
|
-
function
|
|
2040
|
-
|
|
2071
|
+
function le() {
|
|
2072
|
+
V(!0);
|
|
2041
2073
|
}
|
|
2042
|
-
function
|
|
2043
|
-
|
|
2074
|
+
function be(m) {
|
|
2075
|
+
b.size = m, b.curr === 1 && V();
|
|
2044
2076
|
}
|
|
2045
|
-
function
|
|
2046
|
-
m !== !0 && (
|
|
2077
|
+
function fe(m) {
|
|
2078
|
+
m !== !0 && (b.curr = 1), q(h);
|
|
2047
2079
|
}
|
|
2048
|
-
function
|
|
2049
|
-
m && (m._checked =
|
|
2050
|
-
let
|
|
2051
|
-
e.pure && (
|
|
2080
|
+
function se(m, f) {
|
|
2081
|
+
m && (m._checked = f);
|
|
2082
|
+
let R = s.data.filter((w) => w._checked);
|
|
2083
|
+
e.pure && (R = R.map((w) => ge(w))), l("update:selection", R), l("selection-change", R);
|
|
2052
2084
|
}
|
|
2053
|
-
function
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2085
|
+
function Y() {
|
|
2086
|
+
return window.innerHeight - +e.bottomDis - d.value.$el.getBoundingClientRect().top - v.value.$el.offsetHeight;
|
|
2087
|
+
}
|
|
2088
|
+
function de(m) {
|
|
2089
|
+
q(() => {
|
|
2090
|
+
const f = Y();
|
|
2091
|
+
s[m ? "height" : "maxHeight"] = f > 0 ? f : 0;
|
|
2092
|
+
});
|
|
2093
|
+
}
|
|
2094
|
+
function ce() {
|
|
2095
|
+
(e.maximizeHeightType === "height" || e.maximizeHeightType === "maxHeight") && q(() => {
|
|
2096
|
+
const m = Y();
|
|
2097
|
+
s[e.maximizeHeightType] = m > 0 ? m : 0;
|
|
2057
2098
|
});
|
|
2058
2099
|
}
|
|
2059
|
-
function
|
|
2100
|
+
function Ve() {
|
|
2060
2101
|
return {
|
|
2061
|
-
[e.pageMap.first]: e.usePageNum ?
|
|
2062
|
-
[e.pageMap.pageSize]:
|
|
2102
|
+
[e.pageMap.first]: e.usePageNum ? b.curr : b.size * (b.curr - 1),
|
|
2103
|
+
[e.pageMap.pageSize]: b.size
|
|
2063
2104
|
};
|
|
2064
2105
|
}
|
|
2065
|
-
let
|
|
2066
|
-
function
|
|
2067
|
-
!e.clickToCheck || !m._checkable || m._disabled || (
|
|
2068
|
-
|
|
2106
|
+
let ye;
|
|
2107
|
+
function Fe(m, f) {
|
|
2108
|
+
!e.clickToCheck || !m._checkable || m._disabled || (ye = !0, m = s.data[f], m._checked = !m._checked, se(m, m._checked), l("select", e.pure ? ge(m) : m, m._checked), setTimeout(() => {
|
|
2109
|
+
ye = null;
|
|
2069
2110
|
}));
|
|
2070
2111
|
}
|
|
2071
|
-
function
|
|
2072
|
-
|
|
2112
|
+
function He(m, f) {
|
|
2113
|
+
ye || (se(m, f), l("select", e.pure ? ge(m) : m, f));
|
|
2073
2114
|
}
|
|
2074
|
-
function
|
|
2075
|
-
const
|
|
2115
|
+
function ge(m) {
|
|
2116
|
+
const f = {
|
|
2076
2117
|
...m
|
|
2077
2118
|
};
|
|
2078
|
-
return delete
|
|
2119
|
+
return delete f._checkable, delete f._checked, delete f._disabled, f;
|
|
2079
2120
|
}
|
|
2080
|
-
function
|
|
2121
|
+
function Pe() {
|
|
2081
2122
|
if (e.fullscreen) {
|
|
2082
|
-
|
|
2123
|
+
u.value ? document.exitFullscreen() : p.value.requestFullscreen();
|
|
2083
2124
|
return;
|
|
2084
2125
|
}
|
|
2085
|
-
|
|
2086
|
-
l("maximize-change",
|
|
2126
|
+
u.value = !u.value, u.value ? (ce(), document.body.classList.add("clip")) : (s.height = e.height ?? n, s.maxHeight = e.maxHeight ?? i, document.body.classList.remove("clip")), q(() => {
|
|
2127
|
+
l("maximize-change", u.value);
|
|
2087
2128
|
});
|
|
2088
2129
|
}
|
|
2089
|
-
function
|
|
2090
|
-
|
|
2130
|
+
function je() {
|
|
2131
|
+
g.value || (e.isLocal ? l("reload") : fe());
|
|
2091
2132
|
}
|
|
2092
|
-
return
|
|
2093
|
-
search:
|
|
2094
|
-
setMaxHeight:
|
|
2095
|
-
table:
|
|
2133
|
+
return k({
|
|
2134
|
+
search: fe,
|
|
2135
|
+
setMaxHeight: de,
|
|
2136
|
+
table: s,
|
|
2137
|
+
sizer: b,
|
|
2096
2138
|
getPage: () => ({
|
|
2097
|
-
...
|
|
2098
|
-
curr:
|
|
2099
|
-
total:
|
|
2139
|
+
...Ve(),
|
|
2140
|
+
curr: b.curr,
|
|
2141
|
+
total: b.total
|
|
2100
2142
|
})
|
|
2101
|
-
}),
|
|
2102
|
-
!e.maxHeight && e.autoMaxHeight && (
|
|
2103
|
-
n =
|
|
2104
|
-
})), e.fullscreen && (
|
|
2105
|
-
|
|
2106
|
-
l("maximize-change",
|
|
2143
|
+
}), c(), me(() => {
|
|
2144
|
+
!e.maxHeight && !e.height && (e.autoMaxHeight || e.autoHeight) && (de(e.autoHeight), q(() => {
|
|
2145
|
+
i = s.maxHeight, n = s.height;
|
|
2146
|
+
})), e.fullscreen && (p.value.onfullscreenchange = () => {
|
|
2147
|
+
u.value = !!document.fullscreenElement, u.value ? setTimeout(ce) : (s.height = e.height ?? n, s.maxHeight = e.maxHeight ?? i), setTimeout(() => {
|
|
2148
|
+
l("maximize-change", u.value);
|
|
2107
2149
|
});
|
|
2108
2150
|
});
|
|
2109
|
-
}),
|
|
2110
|
-
|
|
2111
|
-
}),
|
|
2112
|
-
const
|
|
2151
|
+
}), Ae(() => {
|
|
2152
|
+
p.value.onfullscreenchange = null;
|
|
2153
|
+
}), F(() => e.modelValue, (m) => {
|
|
2154
|
+
const f = Array.isArray(m) ? m : [];
|
|
2113
2155
|
if (e.isLocal) {
|
|
2114
|
-
|
|
2156
|
+
b.curr = 1, b.total = f.length, o(f), K();
|
|
2115
2157
|
return;
|
|
2116
2158
|
}
|
|
2117
|
-
|
|
2159
|
+
S || (b.curr = 1, b.total = f.length, s.data = f);
|
|
2118
2160
|
}, {
|
|
2119
2161
|
immediate: !0
|
|
2120
|
-
}),
|
|
2121
|
-
|
|
2122
|
-
}),
|
|
2123
|
-
|
|
2124
|
-
}), (
|
|
2125
|
-
|
|
2126
|
-
|
|
2162
|
+
}), F(() => e.maxHeight, (m) => {
|
|
2163
|
+
s.maxHeight = m;
|
|
2164
|
+
}), F(() => e.height, (m) => {
|
|
2165
|
+
s.height = m;
|
|
2166
|
+
}), F(() => e.columns, () => {
|
|
2167
|
+
c();
|
|
2168
|
+
}), (m, f) => {
|
|
2169
|
+
const R = A("Col"), w = A("Icon"), X = A("Tooltip"), re = A("Row"), Ne = A("Table"), Le = A("Page");
|
|
2170
|
+
return $(), N("div", {
|
|
2127
2171
|
ref: "elRef",
|
|
2128
|
-
class:
|
|
2129
|
-
"page-table-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2172
|
+
class: P([
|
|
2173
|
+
y(I)("page-table-container"),
|
|
2174
|
+
// {
|
|
2175
|
+
// 'page-table-bordered': border && showHeader,
|
|
2176
|
+
// 'page-table-maximized': maximized,
|
|
2177
|
+
// 'page-table-fullscreen': maximized && fullscreen
|
|
2178
|
+
// }
|
|
2179
|
+
t.border && t.showHeader && y(I)("page-table-bordered"),
|
|
2180
|
+
u.value && y(I)("page-table-maximized"),
|
|
2181
|
+
u.value && t.fullscreen && y(I)("page-table-fullscreen")
|
|
2182
|
+
])
|
|
2183
|
+
}, [t.showHeader ? ($(), U(re, {
|
|
2134
2184
|
key: 0,
|
|
2135
2185
|
justify: "space-between",
|
|
2136
2186
|
align: "middle",
|
|
2137
|
-
class: "page-table-header"
|
|
2187
|
+
class: P(y(I)("page-table-header"))
|
|
2138
2188
|
}, {
|
|
2139
|
-
default:
|
|
2140
|
-
default:
|
|
2189
|
+
default: D(() => [O(R, null, {
|
|
2190
|
+
default: D(() => [z(m.$slots, "title", {}, () => [te("h1", {
|
|
2191
|
+
class: P(y(I)("page-table-header-title"))
|
|
2192
|
+
}, H(t.title ?? y(M).t("pageTable.title")), 3)])]),
|
|
2141
2193
|
_: 3
|
|
2142
|
-
}),
|
|
2143
|
-
default:
|
|
2194
|
+
}), O(R, null, {
|
|
2195
|
+
default: D(() => [z(m.$slots, "headerAction"), O(X, {
|
|
2144
2196
|
placement: "top",
|
|
2145
|
-
content: M
|
|
2146
|
-
transfer:
|
|
2147
|
-
class: "page-table-action"
|
|
2197
|
+
content: y(M).t("pageTable.reload"),
|
|
2198
|
+
transfer: C.value,
|
|
2199
|
+
class: P(y(I)("page-table-action"))
|
|
2148
2200
|
}, {
|
|
2149
|
-
default:
|
|
2201
|
+
default: D(() => [O(w, {
|
|
2150
2202
|
type: "md-refresh",
|
|
2151
2203
|
size: "20",
|
|
2152
|
-
onClick:
|
|
2204
|
+
onClick: je
|
|
2153
2205
|
})]),
|
|
2154
2206
|
_: 1
|
|
2155
|
-
}, 8, ["content", "transfer"]),
|
|
2207
|
+
}, 8, ["content", "transfer", "class"]), O(X, {
|
|
2156
2208
|
placement: "top",
|
|
2157
|
-
content: M
|
|
2158
|
-
transfer:
|
|
2159
|
-
class: "page-table-action"
|
|
2209
|
+
content: y(M).t(`pageTable.${u.value ? "restore" : "maxmize"}`),
|
|
2210
|
+
transfer: C.value,
|
|
2211
|
+
class: P(y(I)("page-table-action"))
|
|
2160
2212
|
}, {
|
|
2161
|
-
default:
|
|
2162
|
-
type:
|
|
2213
|
+
default: D(() => [O(w, {
|
|
2214
|
+
type: u.value ? "md-contract" : "md-expand",
|
|
2163
2215
|
size: "20",
|
|
2164
|
-
onClick:
|
|
2216
|
+
onClick: Pe
|
|
2165
2217
|
}, null, 8, ["type"])]),
|
|
2166
2218
|
_: 1
|
|
2167
|
-
}, 8, ["content", "transfer"]),
|
|
2168
|
-
modelValue:
|
|
2169
|
-
"onUpdate:modelValue":
|
|
2219
|
+
}, 8, ["content", "transfer", "class"]), O(ze, {
|
|
2220
|
+
modelValue: x.value,
|
|
2221
|
+
"onUpdate:modelValue": f[0] || (f[0] = (Z) => x.value = Z),
|
|
2170
2222
|
size: "20",
|
|
2171
|
-
transfer:
|
|
2223
|
+
transfer: C.value,
|
|
2172
2224
|
"store-at": t.storeAt,
|
|
2173
|
-
onChange:
|
|
2225
|
+
onChange: f[1] || (f[1] = (Z) => m.$emit("change-col", Z))
|
|
2174
2226
|
}, {
|
|
2175
|
-
default:
|
|
2227
|
+
default: D(() => [O(w, {
|
|
2176
2228
|
type: "md-settings",
|
|
2177
2229
|
size: "20"
|
|
2178
2230
|
})]),
|
|
@@ -2181,88 +2233,92 @@ const A = {
|
|
|
2181
2233
|
_: 3
|
|
2182
2234
|
})]),
|
|
2183
2235
|
_: 3
|
|
2184
|
-
})) : W("", !0), te("div",
|
|
2236
|
+
}, 8, ["class"])) : W("", !0), te("div", {
|
|
2237
|
+
class: P([y(I)("page-table-list"), !y(b).total && !s.data.length && y(I)("page-table-list-empty")])
|
|
2238
|
+
}, [O(Ne, G({
|
|
2185
2239
|
ref: "tableRef"
|
|
2186
|
-
},
|
|
2240
|
+
}, y(We)(m.$attrs, ["id", "class", "style"]), {
|
|
2187
2241
|
border: t.border,
|
|
2188
|
-
columns:
|
|
2189
|
-
data:
|
|
2190
|
-
loading:
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2242
|
+
columns: x.value,
|
|
2243
|
+
data: s.data,
|
|
2244
|
+
loading: g.value,
|
|
2245
|
+
height: s.height,
|
|
2246
|
+
"max-height": s.maxHeight,
|
|
2247
|
+
onOnRowClick: Fe
|
|
2248
|
+
}), we({
|
|
2194
2249
|
_: 2
|
|
2195
2250
|
}, [m.$slots.header ? {
|
|
2196
2251
|
name: "header",
|
|
2197
|
-
fn:
|
|
2252
|
+
fn: D(() => [z(m.$slots, "header")]),
|
|
2198
2253
|
key: "0"
|
|
2199
|
-
} : void 0, ee(
|
|
2200
|
-
name:
|
|
2201
|
-
fn:
|
|
2254
|
+
} : void 0, ee(T.value, (Z) => ({
|
|
2255
|
+
name: Z.slot,
|
|
2256
|
+
fn: D((Ee) => [z(m.$slots, Z.slot, Be(De(Ee)))])
|
|
2202
2257
|
})), m.$slots.footer ? {
|
|
2203
2258
|
name: "footer",
|
|
2204
|
-
fn:
|
|
2259
|
+
fn: D(() => [z(m.$slots, "footer")]),
|
|
2205
2260
|
key: "1"
|
|
2206
|
-
} : void 0]), 1040, ["border", "columns", "data", "loading", "max-height"]),
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2261
|
+
} : void 0]), 1040, ["border", "columns", "data", "loading", "height", "max-height"]), ae(O(Le, {
|
|
2262
|
+
ref: "pageRef",
|
|
2263
|
+
modelValue: y(b).curr,
|
|
2264
|
+
"onUpdate:modelValue": f[2] || (f[2] = (Z) => y(b).curr = Z),
|
|
2265
|
+
total: y(b).total,
|
|
2266
|
+
"page-size": y(b).size,
|
|
2211
2267
|
"show-total": "",
|
|
2212
2268
|
"show-sizer": "",
|
|
2213
2269
|
"show-elevator": "",
|
|
2214
|
-
transfer:
|
|
2270
|
+
transfer: C.value,
|
|
2215
2271
|
"page-size-opts": t.pageSizeOpts,
|
|
2216
|
-
class: "page-table-
|
|
2217
|
-
onOnChange:
|
|
2218
|
-
onOnPageSizeChange:
|
|
2219
|
-
}, null, 8, ["modelValue", "total", "page-size", "transfer", "page-size-opts"])])], 2);
|
|
2272
|
+
class: P(y(I)("page-table-paginator")),
|
|
2273
|
+
onOnChange: le,
|
|
2274
|
+
onOnPageSizeChange: be
|
|
2275
|
+
}, null, 8, ["modelValue", "total", "page-size", "transfer", "page-size-opts", "class"]), [[ue, !t.hidePage]])], 2)], 2);
|
|
2220
2276
|
};
|
|
2221
2277
|
}
|
|
2222
|
-
}),
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
qe,
|
|
2226
|
-
Ze,
|
|
2227
|
-
lt,
|
|
2228
|
-
Oe,
|
|
2278
|
+
}), Oe = [
|
|
2279
|
+
Qe,
|
|
2280
|
+
tt,
|
|
2229
2281
|
ot,
|
|
2230
|
-
|
|
2231
|
-
|
|
2282
|
+
ut,
|
|
2283
|
+
rt,
|
|
2284
|
+
Me,
|
|
2232
2285
|
ft,
|
|
2233
|
-
|
|
2286
|
+
ht,
|
|
2287
|
+
vt,
|
|
2288
|
+
yt,
|
|
2234
2289
|
Ct,
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2290
|
+
Vt,
|
|
2291
|
+
ze
|
|
2292
|
+
], xt = { iviewSelect: Re };
|
|
2293
|
+
function $t(t, k = {}) {
|
|
2294
|
+
if (k.prefix && (t.provide(Ie, k.prefix), Oe.forEach((a) => a.name = k.prefix + a.name)), Oe.forEach((a) => {
|
|
2239
2295
|
t.component(a.name, a);
|
|
2240
|
-
}), Object.entries(
|
|
2296
|
+
}), Object.entries(xt).forEach((a) => {
|
|
2241
2297
|
t.directive(a[0], a[1]);
|
|
2242
|
-
}),
|
|
2243
|
-
|
|
2298
|
+
}), k.i18n) {
|
|
2299
|
+
M.i18n = k.i18n, k.msgPrefix && k.msgPrefix !== "d" && (M.prefix = k.msgPrefix);
|
|
2244
2300
|
return;
|
|
2245
2301
|
}
|
|
2246
|
-
|
|
2302
|
+
k.msg && (M.msg = k.msg);
|
|
2247
2303
|
}
|
|
2248
|
-
const
|
|
2249
|
-
install:
|
|
2304
|
+
const jt = {
|
|
2305
|
+
install: $t
|
|
2250
2306
|
};
|
|
2251
2307
|
export {
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2308
|
+
Qe as AllCheckbox,
|
|
2309
|
+
tt as BaseSwitch,
|
|
2310
|
+
rt as CacheSelect,
|
|
2311
|
+
ot as Combi,
|
|
2312
|
+
ut as CountRange,
|
|
2313
|
+
ft as CurdTable,
|
|
2314
|
+
ht as DateRange,
|
|
2315
|
+
vt as DateRangePicker,
|
|
2316
|
+
yt as MCalendar,
|
|
2317
|
+
Ct as ModalFooter,
|
|
2318
|
+
Vt as PageTable,
|
|
2319
|
+
Me as RemoteSelect,
|
|
2320
|
+
ze as ToggleColumn,
|
|
2321
|
+
jt as default,
|
|
2322
|
+
$t as install,
|
|
2323
|
+
Re as iviewSelect
|
|
2268
2324
|
};
|