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