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