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