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