view-ui-plus-derive 0.2.0 → 0.2.2
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 +46 -12
- package/dist/index.d.ts +73 -477
- package/dist/index.js +686 -645
- package/dist/iview-mod.js +1 -0
- package/dist/iview-mods/index.d.ts +4 -0
- package/dist/iview-mods/table-cache-cols.js +50 -0
- package/dist/umd/en-US.js +1 -1
- package/dist/umd/index.js +1 -1
- package/dist/umd/iview-mod.js +1 -1
- package/dist/umd/zh-CN.js +1 -1
- package/package.json +20 -16
package/dist/index.js
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Checkbox as
|
|
3
|
-
import { getPathValue as
|
|
4
|
-
import
|
|
1
|
+
import { defineComponent as Y, shallowRef as Ce, computed as N, onMounted as de, watch as I, createElementBlock as j, openBlock as D, withDirectives as te, createVNode as $, unref as o, withCtx as C, createTextVNode as H, toDisplayString as z, vShow as ue, Fragment as X, renderList as _, createBlock as L, renderSlot as M, ref as E, mergeProps as U, useSlots as qe, normalizeClass as F, createCommentVNode as q, createElementVNode as ee, nextTick as G, shallowReactive as ze, useTemplateRef as ce, normalizeProps as Be, guardReactiveProps as Ve, getCurrentInstance as me, createSlots as Fe, onBeforeUnmount as He, mergeModels as Ae, useModel as We, reactive as Xe } from "vue";
|
|
2
|
+
import { Checkbox as oe, CheckboxGroup as Ze, Switch as Qe, InputNumber as Re, Select as _e, Option as et, DatePicker as ke, Table as je, Button as Z, Row as ge, Col as ie, Spin as tt, Dropdown as at, Icon as fe, DropdownMenu as lt, DropdownItem as nt, Tooltip as we, Page as ot } from "view-ui-plus";
|
|
3
|
+
import { getPathValue as Q, omitOwnKeys as Ne, isObject as Me, setPathValue as it, deepMerge as ut, makeObjectByPath as st } from "utils-where";
|
|
4
|
+
import dt from "./locale/zh-CN.js";
|
|
5
5
|
/* empty css */
|
|
6
6
|
/* empty css */
|
|
7
|
-
import { i as
|
|
7
|
+
import { i as Pe } from "./directives/v-iview-select.js";
|
|
8
8
|
/* empty css */
|
|
9
9
|
/* empty css */
|
|
10
10
|
/* empty css */
|
|
11
11
|
/* empty css */
|
|
12
|
-
const
|
|
12
|
+
const w = {
|
|
13
13
|
i18n: null,
|
|
14
14
|
prefix: "d",
|
|
15
|
-
msg:
|
|
15
|
+
msg: dt,
|
|
16
16
|
t(t, ...S) {
|
|
17
|
-
return
|
|
17
|
+
return w.i18n?.global.t(w.prefix + "." + t, ...S) ?? Q(w.msg, w.prefix + "." + t) ?? t;
|
|
18
18
|
}
|
|
19
|
-
},
|
|
19
|
+
}, rt = {
|
|
20
20
|
name: "AllCheckbox"
|
|
21
|
-
},
|
|
22
|
-
...
|
|
21
|
+
}, ct = /* @__PURE__ */ Y({
|
|
22
|
+
...rt,
|
|
23
23
|
props: {
|
|
24
24
|
modelValue: Array,
|
|
25
25
|
/**
|
|
@@ -70,54 +70,54 @@ const M = {
|
|
|
70
70
|
},
|
|
71
71
|
emits: ["update:modelValue", "update:all", "change"],
|
|
72
72
|
setup(t, { emit: S }) {
|
|
73
|
-
const a = t, e = S, l = Ce(a.modelValue || []),
|
|
73
|
+
const a = t, e = S, l = Ce(a.modelValue || []), i = N({
|
|
74
74
|
get() {
|
|
75
75
|
return l.value.length === a.list.length;
|
|
76
76
|
},
|
|
77
|
-
set(
|
|
78
|
-
l.value =
|
|
77
|
+
set(c) {
|
|
78
|
+
l.value = c ? a.list.map((v) => v[a.keyMap.value]) : [];
|
|
79
79
|
}
|
|
80
|
-
}),
|
|
80
|
+
}), u = N(
|
|
81
81
|
() => l.value.length > 0 && l.value.length < a.list.length
|
|
82
82
|
);
|
|
83
|
-
function
|
|
84
|
-
e("update:modelValue", l.value), e("update:all",
|
|
83
|
+
function p() {
|
|
84
|
+
e("update:modelValue", l.value), e("update:all", i.value), e("change", l.value, i.value);
|
|
85
85
|
}
|
|
86
|
-
return
|
|
87
|
-
e("update:all",
|
|
86
|
+
return de(() => {
|
|
87
|
+
e("update:all", i.value);
|
|
88
88
|
}), I(
|
|
89
89
|
() => a.modelValue,
|
|
90
|
-
(
|
|
91
|
-
l.value !==
|
|
90
|
+
(c) => {
|
|
91
|
+
l.value !== c && (l.value = c || [], e("update:all", i.value));
|
|
92
92
|
}
|
|
93
|
-
), (
|
|
94
|
-
|
|
95
|
-
modelValue:
|
|
96
|
-
"onUpdate:modelValue":
|
|
97
|
-
indeterminate:
|
|
98
|
-
onOnChange:
|
|
93
|
+
), (c, v) => (D(), j("div", null, [
|
|
94
|
+
te($(o(oe), {
|
|
95
|
+
modelValue: i.value,
|
|
96
|
+
"onUpdate:modelValue": v[0] || (v[0] = (b) => i.value = b),
|
|
97
|
+
indeterminate: u.value,
|
|
98
|
+
onOnChange: p
|
|
99
99
|
}, {
|
|
100
100
|
default: C(() => [
|
|
101
|
-
H(z(t.title ??
|
|
101
|
+
H(z(t.title ?? o(w).t("allCheckbox.title")), 1)
|
|
102
102
|
]),
|
|
103
103
|
_: 1
|
|
104
104
|
}, 8, ["modelValue", "indeterminate"]), [
|
|
105
|
-
[
|
|
105
|
+
[ue, !t.hideAll]
|
|
106
106
|
]),
|
|
107
|
-
|
|
107
|
+
$(o(Ze), {
|
|
108
108
|
modelValue: l.value,
|
|
109
|
-
"onUpdate:modelValue":
|
|
109
|
+
"onUpdate:modelValue": v[1] || (v[1] = (b) => l.value = b),
|
|
110
110
|
class: "ivu-inline-block",
|
|
111
|
-
onOnChange:
|
|
111
|
+
onOnChange: p
|
|
112
112
|
}, {
|
|
113
113
|
default: C(() => [
|
|
114
|
-
(D(!0), j(
|
|
115
|
-
key:
|
|
116
|
-
label:
|
|
114
|
+
(D(!0), j(X, null, _(t.list, (b) => (D(), L(o(oe), {
|
|
115
|
+
key: b[t.keyMap.value],
|
|
116
|
+
label: b[t.keyMap.value]
|
|
117
117
|
}, {
|
|
118
118
|
default: C(() => [
|
|
119
|
-
|
|
120
|
-
H(z(
|
|
119
|
+
M(c.$slots, "default", { item: b }, () => [
|
|
120
|
+
H(z(b[t.keyMap.label]), 1)
|
|
121
121
|
])
|
|
122
122
|
]),
|
|
123
123
|
_: 2
|
|
@@ -127,10 +127,10 @@ const M = {
|
|
|
127
127
|
}, 8, ["modelValue"])
|
|
128
128
|
]));
|
|
129
129
|
}
|
|
130
|
-
}),
|
|
130
|
+
}), ft = {
|
|
131
131
|
name: "BaseSwitch"
|
|
132
|
-
},
|
|
133
|
-
...
|
|
132
|
+
}, gt = /* @__PURE__ */ Y({
|
|
133
|
+
...ft,
|
|
134
134
|
props: {
|
|
135
135
|
modelValue: [String, Number, Boolean],
|
|
136
136
|
/**
|
|
@@ -158,29 +158,29 @@ const M = {
|
|
|
158
158
|
},
|
|
159
159
|
emits: ["update:modelValue", "change"],
|
|
160
160
|
setup(t, { emit: S }) {
|
|
161
|
-
const a = t, e = S, l =
|
|
162
|
-
e("update:modelValue",
|
|
161
|
+
const a = t, e = S, l = E(a.modelValue), i = (u) => {
|
|
162
|
+
e("update:modelValue", u), e("change", u);
|
|
163
163
|
};
|
|
164
164
|
return I(
|
|
165
165
|
() => a.modelValue,
|
|
166
|
-
(
|
|
167
|
-
l.value !==
|
|
166
|
+
(u) => {
|
|
167
|
+
l.value !== u && (l.value = u);
|
|
168
168
|
}
|
|
169
|
-
), (
|
|
169
|
+
), (u, p) => (D(), L(o(Qe), U({
|
|
170
170
|
modelValue: l.value,
|
|
171
|
-
"onUpdate:modelValue":
|
|
172
|
-
onOnChange:
|
|
173
|
-
},
|
|
171
|
+
"onUpdate:modelValue": p[0] || (p[0] = (c) => l.value = c),
|
|
172
|
+
onOnChange: i
|
|
173
|
+
}, u.$attrs, {
|
|
174
174
|
trueValue: t.trueValue,
|
|
175
175
|
falseValue: t.falseValue
|
|
176
176
|
}), {
|
|
177
177
|
open: C(() => [
|
|
178
|
-
|
|
178
|
+
M(u.$slots, "open", {}, () => [
|
|
179
179
|
H(z(t.trueLabel), 1)
|
|
180
180
|
])
|
|
181
181
|
]),
|
|
182
182
|
close: C(() => [
|
|
183
|
-
|
|
183
|
+
M(u.$slots, "close", {}, () => [
|
|
184
184
|
H(z(t.falseLabel), 1)
|
|
185
185
|
])
|
|
186
186
|
]),
|
|
@@ -190,16 +190,16 @@ const M = {
|
|
|
190
190
|
}), Se = [], R = (t) => (
|
|
191
191
|
// const prefix = inject(classSymbol, '') as string
|
|
192
192
|
Se[0] ? Se[0].replace(/\B([A-Z])/g, "-$1").toLowerCase() + "-" + t : t
|
|
193
|
-
),
|
|
193
|
+
), mt = {
|
|
194
194
|
key: 0,
|
|
195
195
|
class: "ivu-input-group-prepend"
|
|
196
|
-
},
|
|
196
|
+
}, ht = {
|
|
197
197
|
key: 1,
|
|
198
198
|
class: "ivu-input-group-append"
|
|
199
|
-
},
|
|
199
|
+
}, pt = {
|
|
200
200
|
name: "Combi"
|
|
201
|
-
},
|
|
202
|
-
...
|
|
201
|
+
}, bt = /* @__PURE__ */ Y({
|
|
202
|
+
...pt,
|
|
203
203
|
props: {
|
|
204
204
|
/**
|
|
205
205
|
* 前置文本
|
|
@@ -211,30 +211,30 @@ const M = {
|
|
|
211
211
|
append: String
|
|
212
212
|
},
|
|
213
213
|
setup(t) {
|
|
214
|
-
const S =
|
|
215
|
-
return (
|
|
216
|
-
class: F([
|
|
214
|
+
const S = qe(), a = t, e = N(() => !!a.prepend || !!S.prepend?.().length), l = N(() => !!a.append || !!S.append?.().length);
|
|
215
|
+
return (i, u) => (D(), j("div", {
|
|
216
|
+
class: F([o(R)("combi"), "ivu-input-group"])
|
|
217
217
|
}, [
|
|
218
|
-
e.value ? (D(), j("div",
|
|
219
|
-
|
|
218
|
+
e.value ? (D(), j("div", mt, [
|
|
219
|
+
M(i.$slots, "prepend", {}, () => [
|
|
220
220
|
H(z(t.prepend), 1)
|
|
221
221
|
])
|
|
222
|
-
])) :
|
|
223
|
-
|
|
224
|
-
class: F([
|
|
222
|
+
])) : q("", !0),
|
|
223
|
+
ee("div", {
|
|
224
|
+
class: F([o(R)("combi-cell"), { "with-append": l.value, "with-prepend": e.value }])
|
|
225
225
|
}, [
|
|
226
|
-
|
|
226
|
+
M(i.$slots, "default")
|
|
227
227
|
], 2),
|
|
228
|
-
l.value ? (D(), j("div",
|
|
229
|
-
|
|
228
|
+
l.value ? (D(), j("div", ht, [
|
|
229
|
+
M(i.$slots, "append", {}, () => [
|
|
230
230
|
H(z(t.append), 1)
|
|
231
231
|
])
|
|
232
|
-
])) :
|
|
232
|
+
])) : q("", !0)
|
|
233
233
|
], 2));
|
|
234
234
|
}
|
|
235
235
|
}), vt = {
|
|
236
236
|
name: "CountRange"
|
|
237
|
-
},
|
|
237
|
+
}, yt = /* @__PURE__ */ Y({
|
|
238
238
|
...vt,
|
|
239
239
|
props: {
|
|
240
240
|
/**
|
|
@@ -326,10 +326,10 @@ const M = {
|
|
|
326
326
|
},
|
|
327
327
|
emits: ["update:begin", "update:end", "change-min", "change-max", "change"],
|
|
328
328
|
setup(t, { emit: S }) {
|
|
329
|
-
const a = t, e = S, l =
|
|
329
|
+
const a = t, e = S, l = E(a.begin), i = E(a.end), u = N(() => ({
|
|
330
330
|
min: a.min,
|
|
331
331
|
max: a.max,
|
|
332
|
-
placeholder: a.minHolder ??
|
|
332
|
+
placeholder: a.minHolder ?? w.t("countRange.minHolder"),
|
|
333
333
|
disabled: a.disabled || a.minDisabled,
|
|
334
334
|
class: a.minClass,
|
|
335
335
|
controlsOutside: a.controlsOutside,
|
|
@@ -341,10 +341,10 @@ const M = {
|
|
|
341
341
|
parser: a.parser,
|
|
342
342
|
activeChange: a.activeChange,
|
|
343
343
|
...a.minAttr
|
|
344
|
-
})),
|
|
344
|
+
})), p = N(() => ({
|
|
345
345
|
min: l.value,
|
|
346
346
|
max: a.max,
|
|
347
|
-
placeholder: a.maxHolder ??
|
|
347
|
+
placeholder: a.maxHolder ?? w.t("countRange.maxHolder"),
|
|
348
348
|
disabled: a.disabled || a.maxDisabled,
|
|
349
349
|
class: a.maxClass,
|
|
350
350
|
controlsOutside: a.controlsOutside,
|
|
@@ -356,40 +356,40 @@ const M = {
|
|
|
356
356
|
parser: a.parser,
|
|
357
357
|
activeChange: l.value ? !1 : a.activeChange,
|
|
358
358
|
...a.maxAttr
|
|
359
|
-
})),
|
|
360
|
-
e("update:begin", l.value), e("update:end",
|
|
361
|
-
},
|
|
362
|
-
|
|
363
|
-
},
|
|
364
|
-
|
|
365
|
-
},
|
|
366
|
-
l.value !==
|
|
367
|
-
}, T = (
|
|
368
|
-
|
|
359
|
+
})), c = () => {
|
|
360
|
+
e("update:begin", l.value), e("update:end", i.value);
|
|
361
|
+
}, v = (r) => {
|
|
362
|
+
i.value != null && r > i.value && (i.value = r + 1 > p.value.max ? p.value.max : r + 1), c(), e("change-min", r), e("change", r, i.value, !1);
|
|
363
|
+
}, b = (r) => {
|
|
364
|
+
c(), e("change-max", r), e("change", l.value, r, !0);
|
|
365
|
+
}, d = (r) => {
|
|
366
|
+
l.value !== r && (l.value = r !== void 0 ? r : null);
|
|
367
|
+
}, T = (r) => {
|
|
368
|
+
i.value !== r && (i.value = r !== void 0 ? r : null);
|
|
369
369
|
};
|
|
370
|
-
return I(() => a.begin,
|
|
371
|
-
class: F(
|
|
370
|
+
return I(() => a.begin, d), I(() => a.end, T), (r, y) => (D(), j("div", {
|
|
371
|
+
class: F(o(R)("count-range"))
|
|
372
372
|
}, [
|
|
373
|
-
|
|
373
|
+
$(o(Re), U({
|
|
374
374
|
modelValue: l.value,
|
|
375
375
|
"onUpdate:modelValue": y[0] || (y[0] = (B) => l.value = B)
|
|
376
|
-
},
|
|
377
|
-
|
|
378
|
-
class: F([
|
|
376
|
+
}, u.value, { onOnChange: v }), null, 16, ["modelValue"]),
|
|
377
|
+
te(ee("span", {
|
|
378
|
+
class: F([o(R)("count-range-joiner"), t.joinerClass])
|
|
379
379
|
}, null, 2), [
|
|
380
|
-
[
|
|
380
|
+
[ue, !t.hideJoiner]
|
|
381
381
|
]),
|
|
382
|
-
|
|
383
|
-
modelValue:
|
|
384
|
-
"onUpdate:modelValue": y[1] || (y[1] = (B) =>
|
|
385
|
-
},
|
|
382
|
+
$(o(Re), U({
|
|
383
|
+
modelValue: i.value,
|
|
384
|
+
"onUpdate:modelValue": y[1] || (y[1] = (B) => i.value = B)
|
|
385
|
+
}, p.value, { onOnChange: b }), null, 16, ["modelValue"])
|
|
386
386
|
], 2));
|
|
387
387
|
}
|
|
388
|
-
}),
|
|
388
|
+
}), kt = { key: 1 }, St = {
|
|
389
389
|
name: "RemoteSelect",
|
|
390
390
|
inheritAttrs: !1
|
|
391
|
-
},
|
|
392
|
-
...
|
|
391
|
+
}, Ee = /* @__PURE__ */ Y({
|
|
392
|
+
...St,
|
|
393
393
|
props: {
|
|
394
394
|
modelValue: [String, Array, Number],
|
|
395
395
|
list: Array,
|
|
@@ -480,106 +480,106 @@ const M = {
|
|
|
480
480
|
},
|
|
481
481
|
emits: ["update:modelValue", "update:chosen", "update:list", "update:refresh", "load"],
|
|
482
482
|
setup(t, { expose: S, emit: a }) {
|
|
483
|
-
const e = t, l = a,
|
|
484
|
-
() =>
|
|
485
|
-
),
|
|
486
|
-
let
|
|
483
|
+
const e = t, l = a, i = E(e.modelValue ?? ""), u = E([]), p = E(!1), c = E({}), v = N(
|
|
484
|
+
() => c.value && Object.keys(c.value).length > 0 ? typeof e.textFormat != "function" ? e.multiple ? c.value.map((s) => s[e.keyMap.label]).join(",") : c.value[e.keyMap.label] : e.textFormat(c.value) : ""
|
|
485
|
+
), b = E(!1);
|
|
486
|
+
let d, T, r, y;
|
|
487
487
|
async function B() {
|
|
488
|
-
let
|
|
488
|
+
let s;
|
|
489
489
|
if (typeof e.loader != "function") {
|
|
490
490
|
if (typeof e.method != "function") {
|
|
491
491
|
console.warn("typeof method isn't function");
|
|
492
492
|
return;
|
|
493
493
|
}
|
|
494
|
-
if (
|
|
495
|
-
const k = e.process(
|
|
496
|
-
k != null && (
|
|
494
|
+
if (p.value = !0, s = await e.method(typeof e.param != "function" ? e.param : e.param()), p.value = !1, s && typeof e.process == "function") {
|
|
495
|
+
const k = e.process(s);
|
|
496
|
+
k != null && (s = k);
|
|
497
497
|
}
|
|
498
498
|
} else
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
}), l("load",
|
|
499
|
+
p.value = !0, s = await e.loader(), p.value = !1;
|
|
500
|
+
s && (b.value = !0, u.value = s, l("update:list", s), V() && P(i.value), d = !0, G(() => {
|
|
501
|
+
d = null;
|
|
502
|
+
}), l("load", s));
|
|
503
503
|
}
|
|
504
|
-
function
|
|
504
|
+
function P(s) {
|
|
505
505
|
T = !0, G(() => {
|
|
506
506
|
T = null;
|
|
507
|
-
}),
|
|
507
|
+
}), r && (e.multiple ? !s.toString().length : s === void 0) && (i.value = s = r), c.value = e.getSelected({
|
|
508
508
|
multiple: e.multiple,
|
|
509
509
|
keyMap: e.keyMap,
|
|
510
|
-
list:
|
|
511
|
-
value:
|
|
512
|
-
}), l("update:modelValue",
|
|
510
|
+
list: u.value,
|
|
511
|
+
value: i.value
|
|
512
|
+
}), l("update:modelValue", s ?? ""), l("update:chosen", c.value);
|
|
513
513
|
}
|
|
514
|
-
function f(
|
|
515
|
-
|
|
514
|
+
function f(s) {
|
|
515
|
+
s && !e.autoGet && !p.value && !b.value && (!e.check || e.check()) && (!e.strict || e.parentCode) && B();
|
|
516
516
|
}
|
|
517
517
|
function V() {
|
|
518
|
-
return
|
|
518
|
+
return i.value != null && i.value.toString().length > 0;
|
|
519
519
|
}
|
|
520
|
-
return l("update:refresh", B),
|
|
521
|
-
e.autoGet ? B() : V() && !
|
|
520
|
+
return l("update:refresh", B), de(() => {
|
|
521
|
+
e.autoGet ? B() : V() && !u.value.length && f(!0);
|
|
522
522
|
}), S({
|
|
523
|
-
code:
|
|
524
|
-
changeCode:
|
|
525
|
-
loaded:
|
|
526
|
-
codes:
|
|
523
|
+
code: i,
|
|
524
|
+
changeCode: P,
|
|
525
|
+
loaded: b,
|
|
526
|
+
codes: u,
|
|
527
527
|
search: B
|
|
528
528
|
}), I(
|
|
529
529
|
() => e.list,
|
|
530
|
-
(
|
|
531
|
-
|
|
530
|
+
(s) => {
|
|
531
|
+
d || (s && s.length ? (u.value = s, b.value = !!e.cache) : (u.value = [], b.value = !1));
|
|
532
532
|
},
|
|
533
533
|
{ immediate: !0 }
|
|
534
534
|
), I(
|
|
535
535
|
() => e.modelValue,
|
|
536
|
-
(
|
|
536
|
+
(s) => {
|
|
537
537
|
if (!T && (y = !0, G(() => {
|
|
538
538
|
y = null;
|
|
539
|
-
}),
|
|
540
|
-
for (const k in
|
|
539
|
+
}), i.value = s ?? "", P(i.value), e.refresh !== B)) {
|
|
540
|
+
for (const k in c.value)
|
|
541
541
|
return;
|
|
542
542
|
f(V());
|
|
543
543
|
}
|
|
544
544
|
}
|
|
545
545
|
), I(
|
|
546
546
|
() => e.parentCode,
|
|
547
|
-
(
|
|
548
|
-
y ? (
|
|
549
|
-
|
|
550
|
-
})) :
|
|
547
|
+
(s) => {
|
|
548
|
+
y ? (r = e.modelValue, setTimeout(() => {
|
|
549
|
+
r = null;
|
|
550
|
+
})) : i.value = e.multiple ? [] : "", u.value = [], b.value = !1, l("update:list", u.value), V() && s && /* !this.opening && */
|
|
551
551
|
f(!0);
|
|
552
552
|
}
|
|
553
|
-
), (
|
|
554
|
-
|
|
555
|
-
H(z(
|
|
553
|
+
), (s, k) => t.textMode ? (D(), j("span", kt, [
|
|
554
|
+
M(s.$slots, "text", { text: v.value }, () => [
|
|
555
|
+
H(z(v.value), 1)
|
|
556
556
|
])
|
|
557
|
-
])) :
|
|
557
|
+
])) : te((D(), L(o(_e), U({
|
|
558
558
|
key: 0,
|
|
559
|
-
modelValue:
|
|
560
|
-
"onUpdate:modelValue": k[0] || (k[0] = (
|
|
559
|
+
modelValue: i.value,
|
|
560
|
+
"onUpdate:modelValue": k[0] || (k[0] = (h) => i.value = h),
|
|
561
561
|
onOnOpenChange: f,
|
|
562
|
-
onOnChange:
|
|
563
|
-
},
|
|
562
|
+
onOnChange: P
|
|
563
|
+
}, s.$attrs, {
|
|
564
564
|
multiple: t.multiple,
|
|
565
|
-
loading:
|
|
566
|
-
"not-found-text":
|
|
565
|
+
loading: p.value,
|
|
566
|
+
"not-found-text": p.value ? null : void 0
|
|
567
567
|
}), {
|
|
568
568
|
default: C(() => [
|
|
569
|
-
|
|
570
|
-
(D(!0), j(
|
|
571
|
-
key: e.valueAsKey ?
|
|
572
|
-
value:
|
|
573
|
-
label: t.formatLabel && t.formatLabel(
|
|
574
|
-
disabled: t.optionDisabled && t.optionDisabled(
|
|
575
|
-
tag: t.optionTag && t.optionTag(
|
|
569
|
+
M(s.$slots, "dropdown", { list: u.value }, () => [
|
|
570
|
+
(D(!0), j(X, null, _(u.value, (h, n) => (D(), L(o(et), {
|
|
571
|
+
key: e.valueAsKey ? h[t.keyMap.value] : n,
|
|
572
|
+
value: h[t.keyMap.value],
|
|
573
|
+
label: t.formatLabel && t.formatLabel(h, n),
|
|
574
|
+
disabled: t.optionDisabled && t.optionDisabled(h, n),
|
|
575
|
+
tag: t.optionTag && t.optionTag(h, n)
|
|
576
576
|
}, {
|
|
577
577
|
default: C(() => [
|
|
578
|
-
|
|
579
|
-
item:
|
|
580
|
-
index:
|
|
578
|
+
M(s.$slots, "default", {
|
|
579
|
+
item: h,
|
|
580
|
+
index: n
|
|
581
581
|
}, () => [
|
|
582
|
-
H(z(
|
|
582
|
+
H(z(h[t.keyMap.label]), 1)
|
|
583
583
|
])
|
|
584
584
|
]),
|
|
585
585
|
_: 2
|
|
@@ -588,20 +588,20 @@ const M = {
|
|
|
588
588
|
]),
|
|
589
589
|
_: 3
|
|
590
590
|
}, 16, ["modelValue", "multiple", "loading", "not-found-text"])), [
|
|
591
|
-
[
|
|
591
|
+
[o(Pe), t.all, "all"]
|
|
592
592
|
]);
|
|
593
593
|
}
|
|
594
|
-
}),
|
|
594
|
+
}), ve = {
|
|
595
595
|
list: null
|
|
596
|
-
},
|
|
596
|
+
}, ae = ze({}), le = {
|
|
597
597
|
list: []
|
|
598
|
-
},
|
|
598
|
+
}, ne = {
|
|
599
599
|
list: []
|
|
600
|
-
}, ye = {},
|
|
600
|
+
}, ye = {}, Ct = {
|
|
601
601
|
name: "CacheSelect",
|
|
602
602
|
inheritAttrs: !1
|
|
603
|
-
},
|
|
604
|
-
...
|
|
603
|
+
}, Bt = /* @__PURE__ */ Y({
|
|
604
|
+
...Ct,
|
|
605
605
|
props: {
|
|
606
606
|
modelValue: [String, Array, Number],
|
|
607
607
|
/**
|
|
@@ -614,64 +614,64 @@ const M = {
|
|
|
614
614
|
},
|
|
615
615
|
emits: ["update:modelValue", "update:chosen", "update:list", "load", "change"],
|
|
616
616
|
setup(t, { emit: S }) {
|
|
617
|
-
const a = t, e = S, l =
|
|
618
|
-
e("update:modelValue",
|
|
619
|
-
},
|
|
617
|
+
const a = t, e = S, l = E(""), i = ce("sel"), u = (v) => {
|
|
618
|
+
e("update:modelValue", v), e("change", v);
|
|
619
|
+
}, p = (v) => {
|
|
620
620
|
G(() => {
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
}),
|
|
624
|
-
|
|
625
|
-
}),
|
|
626
|
-
}), e("load",
|
|
627
|
-
},
|
|
621
|
+
le[a.cacheId] && (le[a.cacheId].forEach((b) => {
|
|
622
|
+
b.changeCode(b.code);
|
|
623
|
+
}), le[a.cacheId] = []), ne[a.cacheId] && (ne[a.cacheId].forEach((b) => {
|
|
624
|
+
b !== i.value && b.$emit("update:list", b.codes);
|
|
625
|
+
}), ne[a.cacheId] = []);
|
|
626
|
+
}), e("load", v);
|
|
627
|
+
}, c = () => l.value != null && l.value.toString().length > 0;
|
|
628
628
|
return I(
|
|
629
629
|
() => a.modelValue,
|
|
630
|
-
(
|
|
631
|
-
l.value !==
|
|
630
|
+
(v) => {
|
|
631
|
+
l.value !== v && (l.value = v ?? "");
|
|
632
632
|
}
|
|
633
|
-
),
|
|
634
|
-
|
|
635
|
-
() =>
|
|
636
|
-
(
|
|
637
|
-
|
|
633
|
+
), ae[a.cacheId] || (ae[a.cacheId] = [], ve[a.cacheId] = null), de(() => {
|
|
634
|
+
ae[a.cacheId].length && (i.value.loaded = !0), a.modelValue && (l.value = a.modelValue), ve[a.cacheId] ? (c() && (le[a.cacheId] || (le[a.cacheId] = []), le[a.cacheId].push(i.value)), i.value.loaded = ye[a.cacheId]) : ve[a.cacheId] = !0, ne[a.cacheId] || (ne[a.cacheId] = []), ne[a.cacheId].push(i.value), ye[a.cacheId] || (ye[a.cacheId] = c()), I(
|
|
635
|
+
() => ae[a.cacheId],
|
|
636
|
+
(v) => {
|
|
637
|
+
v.length && (i.value.loaded = !0);
|
|
638
638
|
},
|
|
639
639
|
{
|
|
640
640
|
immediate: !0
|
|
641
641
|
}
|
|
642
642
|
);
|
|
643
|
-
}), (
|
|
643
|
+
}), (v, b) => (D(), L(Ee, U({
|
|
644
644
|
ref: "sel",
|
|
645
645
|
modelValue: l.value,
|
|
646
|
-
"onUpdate:modelValue":
|
|
647
|
-
list:
|
|
646
|
+
"onUpdate:modelValue": b[0] || (b[0] = (d) => l.value = d),
|
|
647
|
+
list: o(ae)[t.cacheId],
|
|
648
648
|
"onUpdate:list": [
|
|
649
|
-
|
|
650
|
-
|
|
649
|
+
b[1] || (b[1] = (d) => o(ae)[t.cacheId] = d),
|
|
650
|
+
b[3] || (b[3] = (d) => v.$emit("update:list", d))
|
|
651
651
|
],
|
|
652
|
-
onLoad:
|
|
653
|
-
onOnChange:
|
|
654
|
-
"onUpdate:chosen":
|
|
655
|
-
},
|
|
656
|
-
default: C(({ item:
|
|
657
|
-
|
|
658
|
-
item:
|
|
652
|
+
onLoad: p,
|
|
653
|
+
onOnChange: u,
|
|
654
|
+
"onUpdate:chosen": b[2] || (b[2] = (d) => v.$emit("update:chosen", d))
|
|
655
|
+
}, v.$attrs, { cache: "" }), {
|
|
656
|
+
default: C(({ item: d, index: T }) => [
|
|
657
|
+
M(v.$slots, "default", {
|
|
658
|
+
item: d,
|
|
659
659
|
index: T
|
|
660
660
|
})
|
|
661
661
|
]),
|
|
662
|
-
dropdown: C(({ list:
|
|
663
|
-
|
|
662
|
+
dropdown: C(({ list: d }) => [
|
|
663
|
+
M(v.$slots, "dropdown", { list: d })
|
|
664
664
|
]),
|
|
665
|
-
text: C((
|
|
666
|
-
|
|
665
|
+
text: C((d) => [
|
|
666
|
+
M(v.$slots, "text", Be(Ve(d)))
|
|
667
667
|
]),
|
|
668
668
|
_: 3
|
|
669
669
|
}, 16, ["modelValue", "list"]));
|
|
670
670
|
}
|
|
671
|
-
}),
|
|
671
|
+
}), Vt = {
|
|
672
672
|
name: "DateRange"
|
|
673
|
-
},
|
|
674
|
-
...
|
|
673
|
+
}, Dt = /* @__PURE__ */ Y({
|
|
674
|
+
...Vt,
|
|
675
675
|
props: {
|
|
676
676
|
/**
|
|
677
677
|
* 双向绑定开始时间
|
|
@@ -761,64 +761,64 @@ const M = {
|
|
|
761
761
|
month: "month",
|
|
762
762
|
year: "year",
|
|
763
763
|
datetime: "day"
|
|
764
|
-
}, l = t,
|
|
764
|
+
}, l = t, i = S, u = E(l.begin), p = E(l.end), c = N(() => ({
|
|
765
765
|
options: l.limitBegin ? {
|
|
766
766
|
disabledDate: (B) => B && a(B).isBefore(Date.now(), e[l.type])
|
|
767
767
|
// date.valueOf() < Date.now() - (props.disableToday ? 0 : 86400000)
|
|
768
768
|
} : void 0,
|
|
769
769
|
disabled: l.disabled || l.beginDisabled,
|
|
770
|
-
placeholder: l.beginHolder ??
|
|
770
|
+
placeholder: l.beginHolder ?? w.t("dateRange.beginHolder"),
|
|
771
771
|
class: l.beginClass,
|
|
772
772
|
clearable: l.clearable,
|
|
773
773
|
transfer: l.transfer,
|
|
774
774
|
format: l.format,
|
|
775
775
|
...l.beginAttr
|
|
776
|
-
})),
|
|
776
|
+
})), v = N(() => ({
|
|
777
777
|
options: {
|
|
778
|
-
disabledDate: (B) =>
|
|
778
|
+
disabledDate: (B) => u.value && B && a(B).isBefore(u.value, e[l.type])
|
|
779
779
|
},
|
|
780
780
|
disabled: l.disabled || l.endDisabled,
|
|
781
|
-
placeholder: l.endHolder ??
|
|
781
|
+
placeholder: l.endHolder ?? w.t("dateRange.endHolder"),
|
|
782
782
|
class: l.endClass,
|
|
783
783
|
clearable: l.clearable,
|
|
784
784
|
transfer: l.transfer,
|
|
785
785
|
format: l.format,
|
|
786
786
|
...l.endAttr
|
|
787
|
-
})),
|
|
788
|
-
|
|
789
|
-
}, c = (B) => {
|
|
790
|
-
i.value > h.value && (h.value = l.autoNext ? a(i.value).add(1, e[l.type]).toDate() : ""), v(), o("change-begin", B), o("change", i.value, h.value, !1);
|
|
791
|
-
}, T = (B) => {
|
|
792
|
-
l.type === "datetime" && B && a(B).isBefore(i.value) && (h.value = a(i.value).add(1, "hour").toDate(), B = a(h.value).format("YYYY-MM-DD HH:mm:ss")), v(), o("change-end", B), o("change", i.value, h.value, !0);
|
|
787
|
+
})), b = () => {
|
|
788
|
+
i("update:begin", u.value), i("update:end", p.value);
|
|
793
789
|
}, d = (B) => {
|
|
794
|
-
|
|
790
|
+
u.value > p.value && (p.value = l.autoNext ? a(u.value).add(1, e[l.type]).toDate() : ""), b(), i("change-begin", B), i("change", u.value, p.value, !1);
|
|
791
|
+
}, T = (B) => {
|
|
792
|
+
l.type === "datetime" && B && a(B).isBefore(u.value) && (p.value = a(u.value).add(1, "hour").toDate(), B = a(p.value).format("YYYY-MM-DD HH:mm:ss")), b(), i("change-end", B), i("change", u.value, p.value, !0);
|
|
793
|
+
}, r = (B) => {
|
|
794
|
+
u.value !== B && (u.value = B || "");
|
|
795
795
|
}, y = (B) => {
|
|
796
|
-
|
|
796
|
+
p.value !== B && (p.value = B || "");
|
|
797
797
|
};
|
|
798
|
-
return I(() => l.begin,
|
|
799
|
-
class: F(
|
|
798
|
+
return I(() => l.begin, r), I(() => l.end, y), (B, P) => (D(), j("div", {
|
|
799
|
+
class: F(o(R)("date-range"))
|
|
800
800
|
}, [
|
|
801
|
-
|
|
802
|
-
modelValue:
|
|
803
|
-
"onUpdate:modelValue":
|
|
804
|
-
onOnChange:
|
|
805
|
-
},
|
|
806
|
-
|
|
807
|
-
class: F([
|
|
801
|
+
$(o(ke), U({
|
|
802
|
+
modelValue: u.value,
|
|
803
|
+
"onUpdate:modelValue": P[0] || (P[0] = (f) => u.value = f),
|
|
804
|
+
onOnChange: d
|
|
805
|
+
}, c.value, { type: t.type }), null, 16, ["modelValue", "type"]),
|
|
806
|
+
te(ee("span", {
|
|
807
|
+
class: F([o(R)("date-range-joiner"), t.joinerClass])
|
|
808
808
|
}, null, 2), [
|
|
809
|
-
[
|
|
809
|
+
[ue, !t.hideJoiner]
|
|
810
810
|
]),
|
|
811
|
-
|
|
812
|
-
modelValue:
|
|
813
|
-
"onUpdate:modelValue":
|
|
811
|
+
$(o(ke), U({
|
|
812
|
+
modelValue: p.value,
|
|
813
|
+
"onUpdate:modelValue": P[1] || (P[1] = (f) => p.value = f),
|
|
814
814
|
onOnChange: T
|
|
815
|
-
},
|
|
815
|
+
}, v.value, { type: t.type }), null, 16, ["modelValue", "type"])
|
|
816
816
|
], 2));
|
|
817
817
|
}
|
|
818
|
-
}),
|
|
818
|
+
}), Ot = {
|
|
819
819
|
name: "DateRangePicker"
|
|
820
|
-
}, xt = /* @__PURE__ */
|
|
821
|
-
...
|
|
820
|
+
}, xt = /* @__PURE__ */ Y({
|
|
821
|
+
...Ot,
|
|
822
822
|
props: {
|
|
823
823
|
/**
|
|
824
824
|
* 双向绑定开始时间
|
|
@@ -875,40 +875,40 @@ const M = {
|
|
|
875
875
|
},
|
|
876
876
|
emits: ["update:begin", "update:end", "change"],
|
|
877
877
|
setup(t, { emit: S }) {
|
|
878
|
-
const a = me().appContext.config.globalProperties.$Date, e = t, l = S,
|
|
878
|
+
const a = me().appContext.config.globalProperties.$Date, e = t, l = S, i = N(
|
|
879
879
|
() => e.options || (e.limitBegin ? {
|
|
880
|
-
disabledDate: (
|
|
880
|
+
disabledDate: (c) => c && c.valueOf() < Date.now() - (e.disableToday ? 0 : 864e5)
|
|
881
881
|
} : void 0)
|
|
882
|
-
),
|
|
882
|
+
), u = N({
|
|
883
883
|
get() {
|
|
884
|
-
const
|
|
885
|
-
return
|
|
884
|
+
const c = e.begin, v = e.end;
|
|
885
|
+
return c && v ? [a(c).toDate(), a(v).toDate()] : [];
|
|
886
886
|
},
|
|
887
|
-
set(
|
|
888
|
-
let
|
|
889
|
-
|
|
887
|
+
set(c) {
|
|
888
|
+
let v, b;
|
|
889
|
+
c[0] && c[1] ? (v = a(c[0]).format(e.valueFormat), b = a(c[1]).format(e.valueFormat)) : v = b = "", l("update:begin", v), l("update:end", b);
|
|
890
890
|
}
|
|
891
|
-
}),
|
|
892
|
-
l("change",
|
|
891
|
+
}), p = (c, v) => {
|
|
892
|
+
l("change", c, v);
|
|
893
893
|
};
|
|
894
|
-
return (
|
|
895
|
-
modelValue:
|
|
896
|
-
"onUpdate:modelValue":
|
|
894
|
+
return (c, v) => (D(), L(o(ke), {
|
|
895
|
+
modelValue: u.value,
|
|
896
|
+
"onUpdate:modelValue": v[0] || (v[0] = (b) => u.value = b),
|
|
897
897
|
type: t.type,
|
|
898
898
|
clearable: t.clearable,
|
|
899
899
|
"split-panels": t.splitPanels,
|
|
900
|
-
options:
|
|
900
|
+
options: i.value,
|
|
901
901
|
transfer: t.transfer,
|
|
902
902
|
placeholder: t.placeholder,
|
|
903
903
|
disabled: t.disabled,
|
|
904
904
|
placement: t.placement,
|
|
905
|
-
onOnChange:
|
|
905
|
+
onOnChange: p
|
|
906
906
|
}, null, 8, ["modelValue", "type", "clearable", "split-panels", "options", "transfer", "placeholder", "disabled", "placement", "onOnChange"]));
|
|
907
907
|
}
|
|
908
|
-
}),
|
|
908
|
+
}), $t = {
|
|
909
909
|
name: "CurdTable"
|
|
910
|
-
},
|
|
911
|
-
|
|
910
|
+
}, Tt = /* @__PURE__ */ Y({
|
|
911
|
+
...$t,
|
|
912
912
|
props: {
|
|
913
913
|
modelValue: {
|
|
914
914
|
type: Array,
|
|
@@ -962,6 +962,7 @@ const M = {
|
|
|
962
962
|
default(t) {
|
|
963
963
|
return {
|
|
964
964
|
// title: props.actionText,
|
|
965
|
+
key: "_action",
|
|
965
966
|
slot: "action",
|
|
966
967
|
width: t.actionWidth,
|
|
967
968
|
align: t.actionAlign,
|
|
@@ -1038,83 +1039,83 @@ const M = {
|
|
|
1038
1039
|
},
|
|
1039
1040
|
emits: ["update:modelValue", "add", "remove", "change"],
|
|
1040
1041
|
setup(t, { emit: S }) {
|
|
1041
|
-
const a = t, e = S, l =
|
|
1042
|
+
const a = t, e = S, l = E(a.modelValue), i = N(
|
|
1042
1043
|
() => a.disabled ? a.columns : a.columns.concat(
|
|
1043
1044
|
Object.assign(
|
|
1044
1045
|
{
|
|
1045
|
-
title: a.actionText ??
|
|
1046
|
+
title: a.actionText ?? w.t("curdTable.actionText")
|
|
1046
1047
|
},
|
|
1047
1048
|
a.actionCol
|
|
1048
1049
|
)
|
|
1049
1050
|
)
|
|
1050
|
-
),
|
|
1051
|
-
const
|
|
1052
|
-
|
|
1051
|
+
), u = N(() => {
|
|
1052
|
+
const d = [], T = (r) => {
|
|
1053
|
+
r.slot && d.push(r), r.children && r.children.forEach((y) => {
|
|
1053
1054
|
T(y);
|
|
1054
1055
|
});
|
|
1055
1056
|
};
|
|
1056
|
-
return a.columns.forEach((
|
|
1057
|
-
T(
|
|
1058
|
-
}),
|
|
1057
|
+
return a.columns.forEach((r) => {
|
|
1058
|
+
T(r);
|
|
1059
|
+
}), d;
|
|
1059
1060
|
});
|
|
1060
|
-
function
|
|
1061
|
-
typeof a.beforeAdd != "function" ?
|
|
1061
|
+
function p() {
|
|
1062
|
+
typeof a.beforeAdd != "function" ? c() : a.beforeAdd().then(c).catch();
|
|
1062
1063
|
}
|
|
1063
|
-
function
|
|
1064
|
-
l.value.push(...a.addRow(
|
|
1064
|
+
function c(d) {
|
|
1065
|
+
l.value.push(...a.addRow(d)), e("update:modelValue", l.value), e("add", l.value[l.value.length - 1]), e("change", !0);
|
|
1065
1066
|
}
|
|
1066
|
-
function
|
|
1067
|
-
typeof a.beforeRemove != "function" ?
|
|
1068
|
-
|
|
1067
|
+
function v(d) {
|
|
1068
|
+
typeof a.beforeRemove != "function" ? b(d) : a.beforeRemove(l.value[d], d).then(() => {
|
|
1069
|
+
b(d);
|
|
1069
1070
|
});
|
|
1070
1071
|
}
|
|
1071
|
-
function
|
|
1072
|
-
const [T] = l.value.splice(
|
|
1072
|
+
function b(d) {
|
|
1073
|
+
const [T] = l.value.splice(d, 1);
|
|
1073
1074
|
e("update:modelValue", l.value), e("remove", T), e("change", !1);
|
|
1074
1075
|
}
|
|
1075
1076
|
return I(
|
|
1076
1077
|
() => a.modelValue,
|
|
1077
|
-
(
|
|
1078
|
-
l.value =
|
|
1078
|
+
(d) => {
|
|
1079
|
+
l.value = d;
|
|
1079
1080
|
}
|
|
1080
|
-
), (
|
|
1081
|
-
|
|
1081
|
+
), (d, T) => (D(), j("div", null, [
|
|
1082
|
+
$(o(je), U(o(Ne)(d.$attrs, ["id", "class", "style"]), {
|
|
1082
1083
|
border: t.border,
|
|
1083
|
-
columns:
|
|
1084
|
+
columns: i.value,
|
|
1084
1085
|
data: l.value,
|
|
1085
1086
|
size: t.size,
|
|
1086
1087
|
style: { "z-index": "0" }
|
|
1087
|
-
},
|
|
1088
|
-
action: C(({ row:
|
|
1089
|
-
|
|
1090
|
-
row:
|
|
1088
|
+
}), Fe({
|
|
1089
|
+
action: C(({ row: r, index: y }) => [
|
|
1090
|
+
M(d.$slots, "moreAction", {
|
|
1091
|
+
row: r,
|
|
1091
1092
|
index: y
|
|
1092
1093
|
}),
|
|
1093
|
-
!t.hideDelBtn || !t.hideDelBtn(
|
|
1094
|
+
!t.hideDelBtn || !t.hideDelBtn(r, y) ? (D(), L(o(Z), U({
|
|
1094
1095
|
key: 0,
|
|
1095
1096
|
type: t.delBtnType,
|
|
1096
1097
|
size: t.delBtnSize,
|
|
1097
1098
|
ghost: t.delBtnGhost
|
|
1098
1099
|
}, t.delBtn, {
|
|
1099
|
-
disabled: t.delBtnDisabled(
|
|
1100
|
-
onClick: (B) =>
|
|
1100
|
+
disabled: t.delBtnDisabled(r, y),
|
|
1101
|
+
onClick: (B) => v(y)
|
|
1101
1102
|
}), {
|
|
1102
1103
|
default: C(() => [
|
|
1103
|
-
H(z(
|
|
1104
|
+
H(z(o(w).t("curdTable.del")), 1)
|
|
1104
1105
|
]),
|
|
1105
1106
|
_: 1
|
|
1106
|
-
}, 16, ["type", "size", "ghost", "disabled", "onClick"])) :
|
|
1107
|
+
}, 16, ["type", "size", "ghost", "disabled", "onClick"])) : q("", !0)
|
|
1107
1108
|
]),
|
|
1108
1109
|
_: 2
|
|
1109
1110
|
}, [
|
|
1110
|
-
|
|
1111
|
-
name:
|
|
1111
|
+
_(u.value, (r) => ({
|
|
1112
|
+
name: r.slot,
|
|
1112
1113
|
fn: C((y) => [
|
|
1113
|
-
|
|
1114
|
+
M(d.$slots, r.slot, Be(Ve(y)))
|
|
1114
1115
|
])
|
|
1115
1116
|
}))
|
|
1116
|
-
]),
|
|
1117
|
-
t.disabled ?
|
|
1117
|
+
]), 1040, ["border", "columns", "data", "size"]),
|
|
1118
|
+
t.disabled ? q("", !0) : te((D(), L(o(Z), U({
|
|
1118
1119
|
key: 0,
|
|
1119
1120
|
type: t.addBtnType,
|
|
1120
1121
|
size: t.addBtnSize,
|
|
@@ -1124,21 +1125,21 @@ const M = {
|
|
|
1124
1125
|
long: "",
|
|
1125
1126
|
icon: "md-add",
|
|
1126
1127
|
style: { display: "block", position: "relative", "margin-top": "-1px" },
|
|
1127
|
-
onClick:
|
|
1128
|
+
onClick: p
|
|
1128
1129
|
}), {
|
|
1129
1130
|
default: C(() => [
|
|
1130
|
-
H(z(t.addText ??
|
|
1131
|
+
H(z(t.addText ?? o(w).t("curdTable.addText")), 1)
|
|
1131
1132
|
]),
|
|
1132
1133
|
_: 1
|
|
1133
1134
|
}, 16, ["type", "size", "ghost", "disabled"])), [
|
|
1134
|
-
[
|
|
1135
|
+
[ue, t.addable]
|
|
1135
1136
|
])
|
|
1136
1137
|
]));
|
|
1137
1138
|
}
|
|
1138
|
-
}),
|
|
1139
|
+
}), At = {
|
|
1139
1140
|
name: "MCalendar"
|
|
1140
|
-
},
|
|
1141
|
-
...
|
|
1141
|
+
}, Rt = /* @__PURE__ */ Y({
|
|
1142
|
+
...At,
|
|
1142
1143
|
props: {
|
|
1143
1144
|
/**
|
|
1144
1145
|
* 指定日期,默认显示该日期所在月份
|
|
@@ -1245,172 +1246,172 @@ const M = {
|
|
|
1245
1246
|
},
|
|
1246
1247
|
emits: ["update:range", "select-range", "click-day", "dblclick-day"],
|
|
1247
1248
|
setup(t, { emit: S }) {
|
|
1248
|
-
const a = me().appContext.config.globalProperties.$Date, e = t, l = S,
|
|
1249
|
+
const a = me().appContext.config.globalProperties.$Date, e = t, l = S, i = E(), u = E(null), p = E(null), c = N(() => {
|
|
1249
1250
|
let f = Math.floor(e.startDay);
|
|
1250
1251
|
return (isNaN(f) || f < 0 || f > 6) && (f = 0), f;
|
|
1251
|
-
}),
|
|
1252
|
+
}), v = N(() => {
|
|
1252
1253
|
let f;
|
|
1253
|
-
const V = [],
|
|
1254
|
-
for (let k =
|
|
1254
|
+
const V = [], s = c.value + 7;
|
|
1255
|
+
for (let k = c.value; k < s; k++)
|
|
1255
1256
|
f = k % 7, V.push({
|
|
1256
|
-
title: e.weekMap?.[f] ||
|
|
1257
|
+
title: e.weekMap?.[f] || w.t(`mCalendar.${e.weekType}.${f}`),
|
|
1257
1258
|
order: f
|
|
1258
1259
|
});
|
|
1259
1260
|
return V;
|
|
1260
|
-
}),
|
|
1261
|
+
}), b = (f) => {
|
|
1261
1262
|
let V = a(
|
|
1262
1263
|
e.date || e.dates && e.dates[0] && e.dates[0][e.dateKey]
|
|
1263
|
-
),
|
|
1264
|
-
return e.isOnFirstLine ?
|
|
1264
|
+
), s, k, h;
|
|
1265
|
+
return e.isOnFirstLine ? s = V : (s = V.startOf("month"), k = V.endOf("month")), h = s.day(), c.value !== 0 && h === 0 && (h = 7), V = s.subtract(h - c.value, "day"), e.isOnFirstLine && (k = V.add(41, "day")), {
|
|
1265
1266
|
beginDate: V.format("YYYY-MM-DD"),
|
|
1266
1267
|
endDate: k?.format("YYYY-MM-DD"),
|
|
1267
|
-
extra: [V, e.isOnFirstLine ? V :
|
|
1268
|
+
extra: [V, e.isOnFirstLine ? V : s, k]
|
|
1268
1269
|
};
|
|
1269
|
-
},
|
|
1270
|
-
e.hasRange && (
|
|
1270
|
+
}, d = () => {
|
|
1271
|
+
e.hasRange && (u.value = p.value = null);
|
|
1271
1272
|
const {
|
|
1272
|
-
extra: [f, V,
|
|
1273
|
-
} =
|
|
1274
|
-
let
|
|
1275
|
-
for (
|
|
1276
|
-
|
|
1277
|
-
_date:
|
|
1278
|
-
_text:
|
|
1279
|
-
_isOuter:
|
|
1273
|
+
extra: [f, V, s]
|
|
1274
|
+
} = b(), k = e.dates?.[0] ? e.dates.slice() : [], h = /* @__PURE__ */ new Date();
|
|
1275
|
+
let n, x, K;
|
|
1276
|
+
for (i.value = [], n = 0; n < 42; n++)
|
|
1277
|
+
x = f.add(n, "day"), K = k.find((W) => x.isSame(W[e.dateKey], "day")), i.value.push({
|
|
1278
|
+
_date: x.toDate(),
|
|
1279
|
+
_text: x.format(e.textFormat),
|
|
1280
|
+
_isOuter: x.isBefore(V, "day") || x.isAfter(s, "day"),
|
|
1280
1281
|
//!eachDay.isBetween(start, end, 'day', '[]'),
|
|
1281
|
-
_isToday:
|
|
1282
|
+
_isToday: x.isSame(h, "day"),
|
|
1282
1283
|
// _rangeStart: undefined,
|
|
1283
1284
|
// _rangeEnd: undefined,
|
|
1284
1285
|
_inRange: void 0,
|
|
1285
|
-
...
|
|
1286
|
+
...K
|
|
1286
1287
|
});
|
|
1287
1288
|
};
|
|
1288
1289
|
let T;
|
|
1289
|
-
const
|
|
1290
|
-
const
|
|
1291
|
-
if (
|
|
1292
|
-
if (!
|
|
1293
|
-
|
|
1294
|
-
else if (
|
|
1295
|
-
|
|
1290
|
+
const r = (f, V) => {
|
|
1291
|
+
const s = e.hasRange && (!f._isOuter || e.outerInRange);
|
|
1292
|
+
if (s)
|
|
1293
|
+
if (!u.value)
|
|
1294
|
+
u.value = f, f._inRange = !0;
|
|
1295
|
+
else if (p.value)
|
|
1296
|
+
u.value = p.value = null, i.value.forEach((k) => {
|
|
1296
1297
|
k._inRange = !1;
|
|
1297
|
-
}), e.clearable || (
|
|
1298
|
+
}), e.clearable || (u.value = f);
|
|
1298
1299
|
else {
|
|
1299
|
-
if (f._date <
|
|
1300
|
-
const k =
|
|
1301
|
-
|
|
1300
|
+
if (f._date < u.value._date) {
|
|
1301
|
+
const k = u.value;
|
|
1302
|
+
u.value = f, f = k;
|
|
1302
1303
|
}
|
|
1303
|
-
|
|
1304
|
+
p.value = f, f._inRange = !0;
|
|
1304
1305
|
}
|
|
1305
|
-
l("click-day", f, V),
|
|
1306
|
+
l("click-day", f, V), s && (T = !0, G(() => {
|
|
1306
1307
|
T = null;
|
|
1307
|
-
}), l("update:range", [
|
|
1308
|
+
}), l("update:range", [u.value, p.value]), l(
|
|
1308
1309
|
"select-range",
|
|
1309
|
-
[
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1310
|
+
[u.value, p.value],
|
|
1311
|
+
i.value.slice(
|
|
1312
|
+
i.value.indexOf(u.value),
|
|
1313
|
+
i.value.indexOf(p.value) + 1
|
|
1313
1314
|
)
|
|
1314
1315
|
));
|
|
1315
1316
|
}, y = (f, V) => {
|
|
1316
1317
|
l("dblclick-day", f, V);
|
|
1317
1318
|
}, B = (f, V) => {
|
|
1318
|
-
if (!e.hasRange || !
|
|
1319
|
+
if (!e.hasRange || !u.value || p.value || f._isOuter && !e.outerInRange)
|
|
1319
1320
|
return;
|
|
1320
|
-
let
|
|
1321
|
-
if (V <
|
|
1322
|
-
const k =
|
|
1323
|
-
|
|
1321
|
+
let s = i.value.indexOf(u.value);
|
|
1322
|
+
if (V < s) {
|
|
1323
|
+
const k = s;
|
|
1324
|
+
s = V, V = k;
|
|
1324
1325
|
}
|
|
1325
|
-
|
|
1326
|
-
k._inRange =
|
|
1326
|
+
i.value.forEach((k, h) => {
|
|
1327
|
+
k._inRange = h >= s && h <= V;
|
|
1327
1328
|
});
|
|
1328
|
-
},
|
|
1329
|
+
}, P = (f) => {
|
|
1329
1330
|
if (!e.hasRange || T) return;
|
|
1330
1331
|
if (!f || !f.length) {
|
|
1331
|
-
|
|
1332
|
-
|
|
1332
|
+
u.value = p.value = null, i.value.forEach((n) => {
|
|
1333
|
+
n._inRange = !1;
|
|
1333
1334
|
});
|
|
1334
1335
|
return;
|
|
1335
1336
|
}
|
|
1336
1337
|
if (!f[0] || !f[1]) return;
|
|
1337
1338
|
if (a(f[0]._date).isAfter(f[1]._date)) {
|
|
1338
|
-
const
|
|
1339
|
-
f[1] = f[0], f[0] =
|
|
1339
|
+
const n = f[1];
|
|
1340
|
+
f[1] = f[0], f[0] = n;
|
|
1340
1341
|
}
|
|
1341
|
-
const V =
|
|
1342
|
-
let
|
|
1343
|
-
for (let
|
|
1344
|
-
if (
|
|
1345
|
-
|
|
1342
|
+
const V = i.value.length;
|
|
1343
|
+
let s, k = -1, h = V;
|
|
1344
|
+
for (let n = 0; n < V; n++)
|
|
1345
|
+
if (s = a(i.value[n]._date), k < 0 && s.isSame(f[0]._date, "day") && (u.value = i.value[n], k = n), s.isSame(f[1]._date, "day")) {
|
|
1346
|
+
p.value = i.value[n], h = n;
|
|
1346
1347
|
break;
|
|
1347
1348
|
}
|
|
1348
|
-
|
|
1349
|
-
|
|
1349
|
+
i.value.forEach((n, x) => {
|
|
1350
|
+
n._inRange = x >= k && x <= h;
|
|
1350
1351
|
});
|
|
1351
1352
|
};
|
|
1352
|
-
return
|
|
1353
|
+
return d(), e.range && (u.value = e.range[0], p.value = e.range[1], P(e.range)), I(
|
|
1353
1354
|
() => e.date,
|
|
1354
1355
|
(f) => {
|
|
1355
|
-
!e.dates && f instanceof Date &&
|
|
1356
|
+
!e.dates && f instanceof Date && d();
|
|
1356
1357
|
}
|
|
1357
1358
|
), I(
|
|
1358
1359
|
() => e.dates,
|
|
1359
1360
|
(f) => {
|
|
1360
|
-
f &&
|
|
1361
|
+
f && d();
|
|
1361
1362
|
}
|
|
1362
1363
|
), I(
|
|
1363
1364
|
() => e.startDay,
|
|
1364
1365
|
() => {
|
|
1365
|
-
|
|
1366
|
+
d();
|
|
1366
1367
|
}
|
|
1367
|
-
), I(() => e.range,
|
|
1368
|
-
class: F(
|
|
1368
|
+
), I(() => e.range, P), (f, V) => (D(), j("div", {
|
|
1369
|
+
class: F(o(R)("mcalendar"))
|
|
1369
1370
|
}, [
|
|
1370
|
-
|
|
1371
|
+
$(o(ge), null, {
|
|
1371
1372
|
default: C(() => [
|
|
1372
|
-
(D(!0), j(
|
|
1373
|
+
(D(!0), j(X, null, _(v.value, (s, k) => (D(), L(o(ie), {
|
|
1373
1374
|
key: k,
|
|
1374
1375
|
span: "4",
|
|
1375
1376
|
class: F([
|
|
1376
|
-
|
|
1377
|
-
{ weekend: t.offDay.includes(
|
|
1378
|
-
t.titleClass && t.titleClass(
|
|
1377
|
+
o(R)("mcalendar-title"),
|
|
1378
|
+
{ weekend: t.offDay.includes(s.order) },
|
|
1379
|
+
t.titleClass && t.titleClass(s, k)
|
|
1379
1380
|
])
|
|
1380
1381
|
}, {
|
|
1381
1382
|
default: C(() => [
|
|
1382
|
-
H(z(
|
|
1383
|
+
H(z(s.title), 1)
|
|
1383
1384
|
]),
|
|
1384
1385
|
_: 2
|
|
1385
1386
|
}, 1032, ["class"]))), 128))
|
|
1386
1387
|
]),
|
|
1387
1388
|
_: 1
|
|
1388
1389
|
}),
|
|
1389
|
-
|
|
1390
|
+
$(o(ge), null, {
|
|
1390
1391
|
default: C(() => [
|
|
1391
|
-
(D(!0), j(
|
|
1392
|
+
(D(!0), j(X, null, _(i.value, (s, k) => (D(), L(o(ie), {
|
|
1392
1393
|
key: k,
|
|
1393
1394
|
span: "4",
|
|
1394
1395
|
class: F([
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
{ outer:
|
|
1398
|
-
{ "range-start":
|
|
1399
|
-
{ "in-range":
|
|
1400
|
-
{ "range-end":
|
|
1401
|
-
t.dateClass && t.dateClass(
|
|
1402
|
-
|
|
1396
|
+
o(R)("mcalendar-cell"),
|
|
1397
|
+
s._isToday && o(R)("mcalendar-cell_today"),
|
|
1398
|
+
{ outer: s._isOuter },
|
|
1399
|
+
{ "range-start": s === u.value },
|
|
1400
|
+
{ "in-range": s._inRange },
|
|
1401
|
+
{ "range-end": s === p.value },
|
|
1402
|
+
t.dateClass && t.dateClass(s, k),
|
|
1403
|
+
s.className
|
|
1403
1404
|
]),
|
|
1404
|
-
onClick: (
|
|
1405
|
-
onDblclick: (
|
|
1406
|
-
onMouseenter: (
|
|
1405
|
+
onClick: (h) => r(s, k),
|
|
1406
|
+
onDblclick: (h) => y(s, k),
|
|
1407
|
+
onMouseenter: (h) => B(s, k)
|
|
1407
1408
|
}, {
|
|
1408
1409
|
default: C(() => [
|
|
1409
|
-
|
|
1410
|
-
day:
|
|
1410
|
+
M(f.$slots, "cell", {
|
|
1411
|
+
day: s,
|
|
1411
1412
|
index: k
|
|
1412
1413
|
}, () => [
|
|
1413
|
-
H(z(
|
|
1414
|
+
H(z(s._text), 1)
|
|
1414
1415
|
])
|
|
1415
1416
|
]),
|
|
1416
1417
|
_: 2
|
|
@@ -1418,16 +1419,16 @@ const M = {
|
|
|
1418
1419
|
]),
|
|
1419
1420
|
_: 3
|
|
1420
1421
|
}),
|
|
1421
|
-
|
|
1422
|
-
[
|
|
1422
|
+
te($(o(tt), { fix: "" }, null, 512), [
|
|
1423
|
+
[ue, t.loading]
|
|
1423
1424
|
])
|
|
1424
1425
|
], 2));
|
|
1425
1426
|
}
|
|
1426
|
-
}),
|
|
1427
|
-
name: "ModalFooter"
|
|
1428
|
-
inheritAttrs:
|
|
1429
|
-
}, Mt = /* @__PURE__ */
|
|
1430
|
-
...
|
|
1427
|
+
}), wt = {
|
|
1428
|
+
name: "ModalFooter"
|
|
1429
|
+
// inheritAttrs: false
|
|
1430
|
+
}, Mt = /* @__PURE__ */ Y({
|
|
1431
|
+
...wt,
|
|
1431
1432
|
props: {
|
|
1432
1433
|
modelValue: Boolean,
|
|
1433
1434
|
/**
|
|
@@ -1486,69 +1487,69 @@ const M = {
|
|
|
1486
1487
|
const a = S, e = me(), l = () => {
|
|
1487
1488
|
e.vnode.props.onCancel ? a("cancel") : a("update:modelValue", !1);
|
|
1488
1489
|
};
|
|
1489
|
-
return (
|
|
1490
|
+
return (i, u) => (D(), L(o(ge), {
|
|
1490
1491
|
justify: "space-between",
|
|
1491
1492
|
align: "middle"
|
|
1492
1493
|
}, {
|
|
1493
1494
|
default: C(() => [
|
|
1494
|
-
|
|
1495
|
+
$(o(ie), null, {
|
|
1495
1496
|
default: C(() => [
|
|
1496
|
-
|
|
1497
|
+
M(i.$slots, "other")
|
|
1497
1498
|
]),
|
|
1498
1499
|
_: 3
|
|
1499
1500
|
}),
|
|
1500
|
-
|
|
1501
|
+
$(o(ie), null, {
|
|
1501
1502
|
default: C(() => [
|
|
1502
|
-
t.rightCancel ? (D(), j(
|
|
1503
|
-
t.hasOk ? (D(),
|
|
1503
|
+
t.rightCancel ? (D(), j(X, { key: 1 }, [
|
|
1504
|
+
t.hasOk ? (D(), L(o(Z), U({
|
|
1504
1505
|
key: 0,
|
|
1505
1506
|
disabled: t.okDisabled,
|
|
1506
1507
|
loading: t.okLoading
|
|
1507
1508
|
}, t.ok, {
|
|
1508
1509
|
type: "primary",
|
|
1509
|
-
onClick:
|
|
1510
|
+
onClick: u[1] || (u[1] = (p) => i.$emit("ok"))
|
|
1510
1511
|
}), {
|
|
1511
1512
|
default: C(() => [
|
|
1512
|
-
H(z(t.okText ??
|
|
1513
|
+
H(z(t.okText ?? o(w).t("modalFooter.ok")), 1)
|
|
1513
1514
|
]),
|
|
1514
1515
|
_: 1
|
|
1515
|
-
}, 16, ["disabled", "loading"])) :
|
|
1516
|
-
|
|
1516
|
+
}, 16, ["disabled", "loading"])) : q("", !0),
|
|
1517
|
+
$(o(Z), U({
|
|
1517
1518
|
disabled: t.cancelDisabled,
|
|
1518
1519
|
loading: t.cancelLoading,
|
|
1519
1520
|
type: t.cancelType
|
|
1520
1521
|
}, t.cancel, { onClick: l }), {
|
|
1521
1522
|
default: C(() => [
|
|
1522
|
-
H(z(t.cancelText ??
|
|
1523
|
+
H(z(t.cancelText ?? o(w).t("modalFooter.cancel")), 1)
|
|
1523
1524
|
]),
|
|
1524
1525
|
_: 1
|
|
1525
1526
|
}, 16, ["disabled", "loading", "type"])
|
|
1526
|
-
], 64)) : (D(), j(
|
|
1527
|
-
|
|
1527
|
+
], 64)) : (D(), j(X, { key: 0 }, [
|
|
1528
|
+
$(o(Z), U({
|
|
1528
1529
|
disabled: t.cancelDisabled,
|
|
1529
1530
|
loading: t.cancelLoading,
|
|
1530
1531
|
type: t.cancelType
|
|
1531
1532
|
}, t.cancel, { onClick: l }), {
|
|
1532
1533
|
default: C(() => [
|
|
1533
|
-
H(z(t.cancelText ??
|
|
1534
|
+
H(z(t.cancelText ?? o(w).t("modalFooter.cancel")), 1)
|
|
1534
1535
|
]),
|
|
1535
1536
|
_: 1
|
|
1536
1537
|
}, 16, ["disabled", "loading", "type"]),
|
|
1537
|
-
t.hasOk ? (D(),
|
|
1538
|
+
t.hasOk ? (D(), L(o(Z), U({
|
|
1538
1539
|
key: 0,
|
|
1539
1540
|
disabled: t.okDisabled,
|
|
1540
1541
|
loading: t.okLoading
|
|
1541
1542
|
}, t.ok, {
|
|
1542
1543
|
type: "primary",
|
|
1543
|
-
onClick:
|
|
1544
|
+
onClick: u[0] || (u[0] = (p) => i.$emit("ok"))
|
|
1544
1545
|
}), {
|
|
1545
1546
|
default: C(() => [
|
|
1546
|
-
H(z(t.okText ??
|
|
1547
|
+
H(z(t.okText ?? o(w).t("modalFooter.ok")), 1)
|
|
1547
1548
|
]),
|
|
1548
1549
|
_: 1
|
|
1549
|
-
}, 16, ["disabled", "loading"])) :
|
|
1550
|
+
}, 16, ["disabled", "loading"])) : q("", !0)
|
|
1550
1551
|
], 64)),
|
|
1551
|
-
|
|
1552
|
+
M(i.$slots, "action")
|
|
1552
1553
|
]),
|
|
1553
1554
|
_: 3
|
|
1554
1555
|
})
|
|
@@ -1556,13 +1557,13 @@ const M = {
|
|
|
1556
1557
|
_: 3
|
|
1557
1558
|
}));
|
|
1558
1559
|
}
|
|
1559
|
-
}),
|
|
1560
|
+
}), It = {
|
|
1560
1561
|
key: 0,
|
|
1561
1562
|
class: "ivu-dropdown-item"
|
|
1562
|
-
},
|
|
1563
|
+
}, J = {}, zt = {
|
|
1563
1564
|
name: "ToggleColumn"
|
|
1564
|
-
},
|
|
1565
|
-
...
|
|
1565
|
+
}, Le = /* @__PURE__ */ Y({
|
|
1566
|
+
...zt,
|
|
1566
1567
|
props: {
|
|
1567
1568
|
modelValue: {
|
|
1568
1569
|
type: Array
|
|
@@ -1590,130 +1591,170 @@ const M = {
|
|
|
1590
1591
|
* @example
|
|
1591
1592
|
* // 组件会尝试将显示状态读写至 localStorage.app.main.cols
|
|
1592
1593
|
* storeAt='app.main.cols'
|
|
1594
|
+
*
|
|
1595
|
+
* 特殊情况:如读写至 localStorage.app.page1['part1.list'].cols
|
|
1596
|
+
* storeAt='app.page1.[part1.list].cols'
|
|
1593
1597
|
*/
|
|
1594
|
-
storeAt: String
|
|
1598
|
+
storeAt: String,
|
|
1599
|
+
/**
|
|
1600
|
+
* 最小可见列数
|
|
1601
|
+
*/
|
|
1602
|
+
minVisible: {
|
|
1603
|
+
type: Number,
|
|
1604
|
+
default: 1
|
|
1605
|
+
},
|
|
1606
|
+
/**
|
|
1607
|
+
* 切换列时是否实时读取本地存储
|
|
1608
|
+
*
|
|
1609
|
+
* 在启用storeAt时,默认只在初始化时从本地读取一次之前保存的状态 \
|
|
1610
|
+
* 若需要每次切换列时都实时从本地获取最新的数据,则可以开启此项 \
|
|
1611
|
+
* 一般在搭配其它逻辑共享同一数据结构时适用,如拖拽列宽后需要将列宽存至同一对象中以节省存储空间 \
|
|
1612
|
+
* 当在循环中使用(即存在cacheId)时,建议开启此项,否则可能会出现列显示异常的情况
|
|
1613
|
+
*
|
|
1614
|
+
* @default
|
|
1615
|
+
* !!props.storeAt && !!props.cacheId
|
|
1616
|
+
*/
|
|
1617
|
+
realtime: {
|
|
1618
|
+
type: Boolean,
|
|
1619
|
+
default: (t) => !!t.storeAt && !!t.cacheId
|
|
1620
|
+
}
|
|
1595
1621
|
},
|
|
1596
1622
|
emits: ["update:modelValue", "change"],
|
|
1597
1623
|
setup(t, { emit: S }) {
|
|
1598
1624
|
const a = t, e = S;
|
|
1599
|
-
let l,
|
|
1600
|
-
const
|
|
1625
|
+
let l, i, u;
|
|
1626
|
+
const p = (h) => {
|
|
1601
1627
|
clearTimeout(l);
|
|
1602
|
-
let
|
|
1603
|
-
|
|
1604
|
-
l = null, localStorage.setItem(
|
|
1628
|
+
let n = localStorage.getItem(i);
|
|
1629
|
+
n = n ? JSON.parse(n) : {}, h ? ut(n, st(u, c)) : it(n, u, c), l = setTimeout(() => {
|
|
1630
|
+
l = null, localStorage.setItem(i, JSON.stringify(n));
|
|
1605
1631
|
});
|
|
1606
1632
|
};
|
|
1607
|
-
let
|
|
1608
|
-
a.storeAt && (
|
|
1609
|
-
const
|
|
1610
|
-
const
|
|
1611
|
-
return
|
|
1612
|
-
}),
|
|
1633
|
+
let c;
|
|
1634
|
+
a.storeAt && (i = a.storeAt.split(".")[0], u = a.storeAt.slice(i.length + 1), c = localStorage.getItem(i) && Q(JSON.parse(localStorage[i]), u), c || (c = {}, p(!0)));
|
|
1635
|
+
const v = E(!1), b = Ce([]), d = E([]), T = N(() => {
|
|
1636
|
+
const h = d.value.filter((n) => n._switchable);
|
|
1637
|
+
return h.some((n) => n._visible) && h.some((n) => !n._visible);
|
|
1638
|
+
}), r = N({
|
|
1613
1639
|
get() {
|
|
1614
|
-
const
|
|
1615
|
-
return
|
|
1640
|
+
const h = d.value.filter((n) => n._switchable);
|
|
1641
|
+
return h.length > 0 && h.every((n) => n._visible);
|
|
1616
1642
|
},
|
|
1617
|
-
set(
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1643
|
+
set(h) {
|
|
1644
|
+
if (h)
|
|
1645
|
+
d.value.forEach((n, x) => {
|
|
1646
|
+
if (n._switchable) {
|
|
1647
|
+
b.value[x]._visible = n._visible = h;
|
|
1648
|
+
return;
|
|
1649
|
+
}
|
|
1650
|
+
n._switchable = n.initSwitchable;
|
|
1651
|
+
});
|
|
1652
|
+
else {
|
|
1653
|
+
const n = a.minVisible - d.value.filter((K) => !K._switchable).length;
|
|
1654
|
+
let x = 0;
|
|
1655
|
+
d.value.forEach((K, W) => {
|
|
1656
|
+
K._switchable && (b.value[W]._visible = K._visible = x < n, K._visible && (K._switchable = !1, x++));
|
|
1657
|
+
});
|
|
1658
|
+
}
|
|
1659
|
+
a.storeAt && (a.realtime && (c = Q(JSON.parse(localStorage[i]), u)), d.value.forEach((n, x) => {
|
|
1660
|
+
Me(c[n.key]) ? c[n.key].visible = n._visible : c[n.key] = { visible: n._visible };
|
|
1661
|
+
}), p()), k(), e("change", b.value);
|
|
1623
1662
|
}
|
|
1624
1663
|
});
|
|
1625
1664
|
function y() {
|
|
1626
|
-
const
|
|
1627
|
-
if (
|
|
1628
|
-
|
|
1665
|
+
const h = d.value.filter((n) => n._visible);
|
|
1666
|
+
if (h.length <= a.minVisible) {
|
|
1667
|
+
h.forEach((n) => {
|
|
1668
|
+
n._switchable = !1;
|
|
1669
|
+
});
|
|
1629
1670
|
return;
|
|
1630
1671
|
}
|
|
1631
|
-
|
|
1632
|
-
|
|
1672
|
+
h.forEach((n) => {
|
|
1673
|
+
n.initSwitchable && !n._switchable && (n._switchable = !0);
|
|
1633
1674
|
});
|
|
1634
1675
|
}
|
|
1635
|
-
function B(
|
|
1636
|
-
|
|
1676
|
+
function B(h, n) {
|
|
1677
|
+
b.value[n]._visible = h._visible, a.storeAt && (a.realtime && (c = Q(JSON.parse(localStorage[i]), u)), Me(c[h.key]) ? c[h.key].visible = h._visible : c[h.key] = { visible: h._visible }, p()), k(), y(), e("change", b.value[n]);
|
|
1637
1678
|
}
|
|
1638
|
-
let
|
|
1639
|
-
function f(
|
|
1640
|
-
clearTimeout(
|
|
1641
|
-
|
|
1679
|
+
let P;
|
|
1680
|
+
function f(h) {
|
|
1681
|
+
clearTimeout(P), P = setTimeout(() => {
|
|
1682
|
+
v.value = h, P = null;
|
|
1642
1683
|
}, 200);
|
|
1643
1684
|
}
|
|
1644
|
-
function V() {
|
|
1645
|
-
(
|
|
1646
|
-
|
|
1647
|
-
title:
|
|
1648
|
-
key:
|
|
1649
|
-
initSwitchable:
|
|
1650
|
-
_switchable:
|
|
1651
|
-
_visible:
|
|
1685
|
+
function V(h) {
|
|
1686
|
+
!h && a.storeAt && a.realtime && (c = Q(JSON.parse(localStorage[i]), u)), (J[a.cacheId]?.cols || a.modelValue).forEach((n) => {
|
|
1687
|
+
n.hasOwnProperty("_visible") || (n._visible = a.storeAt ? c[n.key] == null || (c[n.key].visible ?? !0) : !0), n.hasOwnProperty("_switchable") || (n._switchable = !0), b.value.push(n), d.value.push({
|
|
1688
|
+
title: n.title || "",
|
|
1689
|
+
key: n.key,
|
|
1690
|
+
initSwitchable: n._switchable,
|
|
1691
|
+
_switchable: n._switchable,
|
|
1692
|
+
_visible: n._visible
|
|
1652
1693
|
});
|
|
1653
1694
|
}), y(), k();
|
|
1654
1695
|
}
|
|
1655
|
-
let
|
|
1696
|
+
let s;
|
|
1656
1697
|
function k() {
|
|
1657
|
-
a.cacheId != null && (
|
|
1658
|
-
|
|
1659
|
-
})),
|
|
1660
|
-
|
|
1698
|
+
a.cacheId != null && (J[a.cacheId].flag = !0, setTimeout(() => {
|
|
1699
|
+
J[a.cacheId].flag = null;
|
|
1700
|
+
})), s = !0, setTimeout(() => {
|
|
1701
|
+
s = null;
|
|
1661
1702
|
}), e(
|
|
1662
1703
|
"update:modelValue",
|
|
1663
|
-
|
|
1704
|
+
b.value.filter((h) => h._visible)
|
|
1664
1705
|
);
|
|
1665
1706
|
}
|
|
1666
|
-
return
|
|
1667
|
-
a.cacheId != null && (
|
|
1668
|
-
|
|
1669
|
-
})), V();
|
|
1707
|
+
return de(() => {
|
|
1708
|
+
a.cacheId != null && (J[a.cacheId] ? J[a.cacheId].all++ : J[a.cacheId] = { cols: a.modelValue, all: 1 }, He(() => {
|
|
1709
|
+
J[a.cacheId] && --J[a.cacheId].all < 1 && delete J[a.cacheId];
|
|
1710
|
+
})), V(!0);
|
|
1670
1711
|
}), I(
|
|
1671
1712
|
() => a.modelValue,
|
|
1672
|
-
(
|
|
1673
|
-
|
|
1713
|
+
(h) => {
|
|
1714
|
+
s || (J[a.cacheId] && !J[a.cacheId].flag && (J[a.cacheId].cols = h), b.value = [], d.value = [], V());
|
|
1674
1715
|
}
|
|
1675
|
-
), (
|
|
1716
|
+
), (h, n) => (D(), L(o(at), {
|
|
1676
1717
|
trigger: "custom",
|
|
1677
|
-
visible:
|
|
1718
|
+
visible: v.value,
|
|
1678
1719
|
placement: "bottom-end",
|
|
1679
1720
|
transfer: t.transfer,
|
|
1680
|
-
"transfer-class-name":
|
|
1681
|
-
class: F(
|
|
1721
|
+
"transfer-class-name": o(R)("toggle-column-pop"),
|
|
1722
|
+
class: F(o(R)("toggle-column"))
|
|
1682
1723
|
}, {
|
|
1683
1724
|
list: C(() => [
|
|
1684
|
-
|
|
1685
|
-
onMouseenter:
|
|
1686
|
-
onMouseleave:
|
|
1725
|
+
ee("div", {
|
|
1726
|
+
onMouseenter: n[3] || (n[3] = (x) => f(!0)),
|
|
1727
|
+
onMouseleave: n[4] || (n[4] = (x) => f(!1))
|
|
1687
1728
|
}, [
|
|
1688
|
-
t.all ? (D(), j("div",
|
|
1689
|
-
|
|
1690
|
-
modelValue:
|
|
1691
|
-
"onUpdate:modelValue":
|
|
1729
|
+
t.all ? (D(), j("div", It, [
|
|
1730
|
+
$(o(oe), {
|
|
1731
|
+
modelValue: r.value,
|
|
1732
|
+
"onUpdate:modelValue": n[2] || (n[2] = (x) => r.value = x),
|
|
1692
1733
|
indeterminate: T.value
|
|
1693
1734
|
}, {
|
|
1694
1735
|
default: C(() => [
|
|
1695
|
-
H(z(
|
|
1736
|
+
H(z(o(w).t("toggleColumn.checkAll")), 1)
|
|
1696
1737
|
]),
|
|
1697
1738
|
_: 1
|
|
1698
1739
|
}, 8, ["modelValue", "indeterminate"])
|
|
1699
|
-
])) :
|
|
1700
|
-
|
|
1701
|
-
class: F(
|
|
1740
|
+
])) : q("", !0),
|
|
1741
|
+
$(o(lt), {
|
|
1742
|
+
class: F(o(R)("toggle-column-list"))
|
|
1702
1743
|
}, {
|
|
1703
1744
|
default: C(() => [
|
|
1704
|
-
(D(!0), j(
|
|
1705
|
-
key:
|
|
1706
|
-
disabled:
|
|
1745
|
+
(D(!0), j(X, null, _(d.value, (x, K) => (D(), L(o(nt), {
|
|
1746
|
+
key: K,
|
|
1747
|
+
disabled: !x._switchable
|
|
1707
1748
|
}, {
|
|
1708
1749
|
default: C(() => [
|
|
1709
|
-
|
|
1710
|
-
modelValue:
|
|
1711
|
-
"onUpdate:modelValue": (
|
|
1712
|
-
disabled:
|
|
1713
|
-
onOnChange: (
|
|
1750
|
+
$(o(oe), {
|
|
1751
|
+
modelValue: x._visible,
|
|
1752
|
+
"onUpdate:modelValue": (W) => x._visible = W,
|
|
1753
|
+
disabled: !x._switchable,
|
|
1754
|
+
onOnChange: (W) => B(x, K)
|
|
1714
1755
|
}, {
|
|
1715
1756
|
default: C(() => [
|
|
1716
|
-
H(z(
|
|
1757
|
+
H(z(x.title), 1)
|
|
1717
1758
|
]),
|
|
1718
1759
|
_: 2
|
|
1719
1760
|
}, 1032, ["modelValue", "onUpdate:modelValue", "disabled", "onOnChange"])
|
|
@@ -1726,20 +1767,20 @@ const M = {
|
|
|
1726
1767
|
], 32)
|
|
1727
1768
|
]),
|
|
1728
1769
|
default: C(() => [
|
|
1729
|
-
|
|
1730
|
-
onMouseover:
|
|
1731
|
-
onMouseout:
|
|
1732
|
-
class: F(
|
|
1770
|
+
ee("span", {
|
|
1771
|
+
onMouseover: n[0] || (n[0] = (x) => f(!0)),
|
|
1772
|
+
onMouseout: n[1] || (n[1] = (x) => f(!1)),
|
|
1773
|
+
class: F(o(R)("toggle-column-btn"))
|
|
1733
1774
|
}, [
|
|
1734
|
-
|
|
1735
|
-
|
|
1775
|
+
M(h.$slots, "default", {}, () => [
|
|
1776
|
+
$(o(Z), {
|
|
1736
1777
|
type: "default",
|
|
1737
1778
|
icon: t.icon
|
|
1738
1779
|
}, {
|
|
1739
1780
|
default: C(() => [
|
|
1740
|
-
t.icon ?
|
|
1741
|
-
H(z(t.title ??
|
|
1742
|
-
|
|
1781
|
+
t.icon ? q("", !0) : (D(), j(X, { key: 0 }, [
|
|
1782
|
+
H(z(t.title ?? o(w).t("toggleColumn.title")) + " ", 1),
|
|
1783
|
+
$(o(fe), { type: "ios-arrow-down" })
|
|
1743
1784
|
], 64))
|
|
1744
1785
|
]),
|
|
1745
1786
|
_: 1
|
|
@@ -1750,11 +1791,11 @@ const M = {
|
|
|
1750
1791
|
_: 3
|
|
1751
1792
|
}, 8, ["visible", "transfer", "transfer-class-name", "class"]));
|
|
1752
1793
|
}
|
|
1753
|
-
}),
|
|
1794
|
+
}), Ft = {
|
|
1754
1795
|
name: "PageTable"
|
|
1755
1796
|
// inheritAttrs: false
|
|
1756
|
-
},
|
|
1757
|
-
...
|
|
1797
|
+
}, Ht = /* @__PURE__ */ Y({
|
|
1798
|
+
...Ft,
|
|
1758
1799
|
props: /* @__PURE__ */ Ae({
|
|
1759
1800
|
columns: {
|
|
1760
1801
|
type: Array,
|
|
@@ -1933,8 +1974,8 @@ const M = {
|
|
|
1933
1974
|
emit: a
|
|
1934
1975
|
}) {
|
|
1935
1976
|
const e = t, l = a;
|
|
1936
|
-
let
|
|
1937
|
-
const
|
|
1977
|
+
let i, u;
|
|
1978
|
+
const p = We(t, "loading"), c = ce("tableRef"), v = ce("elRef"), b = ce("pageRef"), d = E(!1), T = Ce(), r = Xe({
|
|
1938
1979
|
data: [],
|
|
1939
1980
|
// rows: [] as Obj[],
|
|
1940
1981
|
// selections: [],
|
|
@@ -1945,46 +1986,46 @@ const M = {
|
|
|
1945
1986
|
align: "center",
|
|
1946
1987
|
className: R("page-table-mr0"),
|
|
1947
1988
|
renderHeader: (g) => {
|
|
1948
|
-
const m =
|
|
1989
|
+
const m = r.data.filter((A) => A._checkable && !A._disabled), O = m.length;
|
|
1949
1990
|
return (
|
|
1950
1991
|
// table.rows.some((e) => e._checkable) && (
|
|
1951
|
-
|
|
1952
|
-
"model-value": !!
|
|
1953
|
-
disabled: !
|
|
1992
|
+
r.data.some((A) => A._checkable) && $(oe, {
|
|
1993
|
+
"model-value": !!O && m.every((A) => A._checked),
|
|
1994
|
+
disabled: !O,
|
|
1954
1995
|
"onUpdate:model-value": (A) => {
|
|
1955
|
-
m.forEach((
|
|
1956
|
-
|
|
1996
|
+
m.forEach((se) => {
|
|
1997
|
+
se._checked = A;
|
|
1957
1998
|
});
|
|
1958
1999
|
},
|
|
1959
2000
|
onOnChange: (A) => {
|
|
1960
|
-
he(), l("select-all", e.pure ? m.map((
|
|
2001
|
+
he(), l("select-all", e.pure ? m.map((se) => re(se)) : m, A);
|
|
1961
2002
|
}
|
|
1962
2003
|
}, null)
|
|
1963
2004
|
);
|
|
1964
2005
|
},
|
|
1965
2006
|
render: (g, {
|
|
1966
2007
|
row: m,
|
|
1967
|
-
index:
|
|
1968
|
-
}) => m._checkable &&
|
|
2008
|
+
index: O
|
|
2009
|
+
}) => m._checkable && $(oe, {
|
|
1969
2010
|
"model-value": m._checked,
|
|
1970
2011
|
disabled: m._disabled,
|
|
1971
2012
|
"onUpdate:model-value": (A) => {
|
|
1972
|
-
|
|
2013
|
+
Ye(r.data[O], A);
|
|
1973
2014
|
}
|
|
1974
2015
|
}, null)
|
|
1975
2016
|
}
|
|
1976
|
-
}), y =
|
|
2017
|
+
}), y = ze({
|
|
1977
2018
|
curr: 1,
|
|
1978
2019
|
size: e.initSize || e.pageSizeOpts[0],
|
|
1979
2020
|
total: 0
|
|
1980
|
-
}), B =
|
|
1981
|
-
const g = [], m = (
|
|
1982
|
-
|
|
2021
|
+
}), B = N(() => d.value ? !1 : e.transfer), P = N(() => {
|
|
2022
|
+
const g = [], m = (O) => {
|
|
2023
|
+
O.slot && g.push(O), O.children && O.children.forEach((A) => {
|
|
1983
2024
|
m(A);
|
|
1984
2025
|
});
|
|
1985
2026
|
};
|
|
1986
|
-
return e.columns.forEach((
|
|
1987
|
-
m(
|
|
2027
|
+
return e.columns.forEach((O) => {
|
|
2028
|
+
m(O);
|
|
1988
2029
|
}), g;
|
|
1989
2030
|
});
|
|
1990
2031
|
function f() {
|
|
@@ -1996,75 +2037,75 @@ const M = {
|
|
|
1996
2037
|
...g,
|
|
1997
2038
|
width: g.width || 54,
|
|
1998
2039
|
type: void 0,
|
|
1999
|
-
...
|
|
2040
|
+
...r.selectType
|
|
2000
2041
|
};
|
|
2001
2042
|
T.value = [m].concat(e.columns.slice(1));
|
|
2002
2043
|
} else
|
|
2003
2044
|
T.value = e.columns;
|
|
2004
2045
|
}
|
|
2005
|
-
let V,
|
|
2006
|
-
async function
|
|
2046
|
+
let V, s, k = 0;
|
|
2047
|
+
async function h() {
|
|
2007
2048
|
if (typeof e.method != "function") return console.warn("typeof method isn't function");
|
|
2008
|
-
|
|
2049
|
+
s && (k = (k + 1) % Number.MAX_SAFE_INTEGER);
|
|
2009
2050
|
const g = k;
|
|
2010
|
-
|
|
2051
|
+
s = !0, p.value = !0, l("update:selection", []);
|
|
2011
2052
|
const m = await e.method(Object.assign(Te(), typeof e.param != "function" ? e.param : e.param()));
|
|
2012
2053
|
if (k !== g) return;
|
|
2013
|
-
if (
|
|
2054
|
+
if (p.value = !1, s = null, !m) {
|
|
2014
2055
|
e.autoRemain || (y.total = 0, l("update:modelValue", []));
|
|
2015
2056
|
return;
|
|
2016
2057
|
}
|
|
2017
|
-
let
|
|
2018
|
-
if (
|
|
2019
|
-
const A = e.process(
|
|
2020
|
-
Array.isArray(A) && (
|
|
2058
|
+
let O = Q(m, e.dataKey) || [];
|
|
2059
|
+
if (n(O), typeof e.process == "function") {
|
|
2060
|
+
const A = e.process(O);
|
|
2061
|
+
Array.isArray(A) && (O = A);
|
|
2021
2062
|
}
|
|
2022
|
-
|
|
2063
|
+
r.data = O, y.total = Q(m, e.totalKey) || 0, V = !0, l("update:modelValue", r.data), l("load", m), setTimeout(() => {
|
|
2023
2064
|
V = null;
|
|
2024
2065
|
});
|
|
2025
2066
|
}
|
|
2026
|
-
function
|
|
2067
|
+
function n(g) {
|
|
2027
2068
|
e.columns.some((m) => m.type === "selection") && g.forEach((m) => {
|
|
2028
2069
|
m._checkable = !0, m._checked = m._disabled = !1;
|
|
2029
2070
|
});
|
|
2030
2071
|
}
|
|
2031
|
-
function
|
|
2032
|
-
typeof e.check == "function" && !e.check() || (e.isLocal ?
|
|
2072
|
+
function x(g) {
|
|
2073
|
+
typeof e.check == "function" && !e.check() || (e.isLocal ? K(g) : h());
|
|
2033
2074
|
}
|
|
2034
|
-
function
|
|
2075
|
+
function K(g) {
|
|
2035
2076
|
let m = g ? y.size * (y.curr - 1) : 0;
|
|
2036
|
-
const
|
|
2037
|
-
for (; m <
|
|
2038
|
-
|
|
2039
|
-
|
|
2077
|
+
const O = [], A = m + y.size, se = A > y.total ? y.total : A, be = e.modelValue;
|
|
2078
|
+
for (; m < se; m++)
|
|
2079
|
+
be[m]._checked = be[m]._disabled = !1, O.push(be[m]);
|
|
2080
|
+
r.data = O, l("update:selection", []);
|
|
2040
2081
|
}
|
|
2041
|
-
function
|
|
2042
|
-
|
|
2082
|
+
function W() {
|
|
2083
|
+
x(!0);
|
|
2043
2084
|
}
|
|
2044
|
-
function
|
|
2045
|
-
y.size = g, y.curr === 1 &&
|
|
2085
|
+
function Ke(g) {
|
|
2086
|
+
y.size = g, y.curr === 1 && x();
|
|
2046
2087
|
}
|
|
2047
2088
|
function De(g) {
|
|
2048
|
-
g !== !0 && (y.curr = 1), G(
|
|
2089
|
+
g !== !0 && (y.curr = 1), G(h);
|
|
2049
2090
|
}
|
|
2050
2091
|
function he(g, m) {
|
|
2051
2092
|
g && (g._checked = m);
|
|
2052
|
-
let
|
|
2053
|
-
e.pure && (
|
|
2093
|
+
let O = r.data.filter((A) => A._checked);
|
|
2094
|
+
e.pure && (O = O.map((A) => re(A))), l("update:selection", O), l("selection-change", O);
|
|
2054
2095
|
}
|
|
2055
|
-
function
|
|
2056
|
-
return window.innerHeight - +e.bottomDis -
|
|
2096
|
+
function Oe() {
|
|
2097
|
+
return window.innerHeight - +e.bottomDis - c.value.$el.getBoundingClientRect().top - b.value.$el.offsetHeight;
|
|
2057
2098
|
}
|
|
2058
|
-
function
|
|
2099
|
+
function xe(g) {
|
|
2059
2100
|
G(() => {
|
|
2060
|
-
const m =
|
|
2061
|
-
|
|
2101
|
+
const m = Oe();
|
|
2102
|
+
r[g ? "height" : "maxHeight"] = m > 0 ? m : 0;
|
|
2062
2103
|
});
|
|
2063
2104
|
}
|
|
2064
2105
|
function $e() {
|
|
2065
2106
|
(e.maximizeHeightType === "height" || e.maximizeHeightType === "maxHeight") && G(() => {
|
|
2066
|
-
const g =
|
|
2067
|
-
|
|
2107
|
+
const g = Oe();
|
|
2108
|
+
r[e.maximizeHeightType] = g > 0 ? g : 0;
|
|
2068
2109
|
});
|
|
2069
2110
|
}
|
|
2070
2111
|
function Te() {
|
|
@@ -2074,125 +2115,125 @@ const M = {
|
|
|
2074
2115
|
};
|
|
2075
2116
|
}
|
|
2076
2117
|
let pe;
|
|
2077
|
-
function
|
|
2078
|
-
!e.clickToCheck || !g._checkable || g._disabled || (pe = !0, g =
|
|
2118
|
+
function Ue(g, m) {
|
|
2119
|
+
!e.clickToCheck || !g._checkable || g._disabled || (pe = !0, g = r.data[m], g._checked = !g._checked, he(g, g._checked), l("select", e.pure ? re(g) : g, g._checked), setTimeout(() => {
|
|
2079
2120
|
pe = null;
|
|
2080
2121
|
}));
|
|
2081
2122
|
}
|
|
2082
|
-
function
|
|
2083
|
-
pe || (he(g, m), l("select", e.pure ?
|
|
2123
|
+
function Ye(g, m) {
|
|
2124
|
+
pe || (he(g, m), l("select", e.pure ? re(g) : g, m));
|
|
2084
2125
|
}
|
|
2085
|
-
function
|
|
2126
|
+
function re(g) {
|
|
2086
2127
|
const m = {
|
|
2087
2128
|
...g
|
|
2088
2129
|
};
|
|
2089
2130
|
return delete m._checkable, delete m._checked, delete m._disabled, m;
|
|
2090
2131
|
}
|
|
2091
|
-
function
|
|
2132
|
+
function Je() {
|
|
2092
2133
|
if (e.fullscreen) {
|
|
2093
|
-
|
|
2134
|
+
d.value ? document.exitFullscreen() : v.value.requestFullscreen();
|
|
2094
2135
|
return;
|
|
2095
2136
|
}
|
|
2096
|
-
|
|
2097
|
-
l("maximize-change",
|
|
2137
|
+
d.value = !d.value, d.value ? ($e(), document.body.classList.add("clip")) : (r.height = e.height ?? i, r.maxHeight = e.maxHeight ?? u, document.body.classList.remove("clip")), G(() => {
|
|
2138
|
+
l("maximize-change", d.value);
|
|
2098
2139
|
});
|
|
2099
2140
|
}
|
|
2100
|
-
function
|
|
2101
|
-
|
|
2141
|
+
function Ge() {
|
|
2142
|
+
p.value || (e.isLocal ? l("reload") : De());
|
|
2102
2143
|
}
|
|
2103
2144
|
return S({
|
|
2104
2145
|
search: De,
|
|
2105
|
-
setMaxHeight:
|
|
2106
|
-
table:
|
|
2146
|
+
setMaxHeight: xe,
|
|
2147
|
+
table: r,
|
|
2107
2148
|
sizer: y,
|
|
2108
2149
|
getPage: () => ({
|
|
2109
2150
|
...Te(),
|
|
2110
2151
|
curr: y.curr,
|
|
2111
2152
|
total: y.total
|
|
2112
2153
|
})
|
|
2113
|
-
}), f(),
|
|
2114
|
-
!e.maxHeight && !e.height && (e.autoMaxHeight || e.autoHeight) && (
|
|
2115
|
-
|
|
2116
|
-
})), e.fullscreen && (
|
|
2117
|
-
|
|
2118
|
-
l("maximize-change",
|
|
2154
|
+
}), f(), de(() => {
|
|
2155
|
+
!e.maxHeight && !e.height && (e.autoMaxHeight || e.autoHeight) && (xe(e.autoHeight), G(() => {
|
|
2156
|
+
u = r.maxHeight, i = r.height;
|
|
2157
|
+
})), e.fullscreen && (v.value.onfullscreenchange = () => {
|
|
2158
|
+
d.value = !!document.fullscreenElement, d.value ? setTimeout($e) : (r.height = e.height ?? i, r.maxHeight = e.maxHeight ?? u), setTimeout(() => {
|
|
2159
|
+
l("maximize-change", d.value);
|
|
2119
2160
|
});
|
|
2120
2161
|
});
|
|
2121
|
-
}),
|
|
2122
|
-
|
|
2162
|
+
}), He(() => {
|
|
2163
|
+
v.value.onfullscreenchange = null;
|
|
2123
2164
|
}), I(() => e.modelValue, (g) => {
|
|
2124
2165
|
const m = Array.isArray(g) ? g : [];
|
|
2125
2166
|
if (e.isLocal) {
|
|
2126
|
-
y.curr = 1, y.total = m.length,
|
|
2167
|
+
y.curr = 1, y.total = m.length, n(m), K();
|
|
2127
2168
|
return;
|
|
2128
2169
|
}
|
|
2129
|
-
V || (y.curr = 1, y.total = m.length,
|
|
2170
|
+
V || (y.curr = 1, y.total = m.length, r.data = m);
|
|
2130
2171
|
}, {
|
|
2131
2172
|
immediate: !0
|
|
2132
2173
|
}), I(() => e.maxHeight, (g) => {
|
|
2133
|
-
|
|
2174
|
+
r.maxHeight = g;
|
|
2134
2175
|
}), I(() => e.height, (g) => {
|
|
2135
|
-
|
|
2176
|
+
r.height = g;
|
|
2136
2177
|
}), I(() => e.columns, () => {
|
|
2137
2178
|
f();
|
|
2138
2179
|
}), (g, m) => (D(), j("div", {
|
|
2139
2180
|
ref: "elRef",
|
|
2140
2181
|
class: F([
|
|
2141
|
-
|
|
2182
|
+
o(R)("page-table-container"),
|
|
2142
2183
|
// {
|
|
2143
2184
|
// 'page-table-bordered': border && showHeader,
|
|
2144
2185
|
// 'page-table-maximized': maximized,
|
|
2145
2186
|
// 'page-table-fullscreen': maximized && fullscreen
|
|
2146
2187
|
// }
|
|
2147
|
-
t.border && t.showHeader &&
|
|
2148
|
-
|
|
2149
|
-
|
|
2188
|
+
t.border && t.showHeader && o(R)("page-table-bordered"),
|
|
2189
|
+
d.value && o(R)("page-table-maximized"),
|
|
2190
|
+
d.value && t.fullscreen && o(R)("page-table-fullscreen")
|
|
2150
2191
|
])
|
|
2151
|
-
}, [t.showHeader ? (D(),
|
|
2192
|
+
}, [t.showHeader ? (D(), L(o(ge), {
|
|
2152
2193
|
key: 0,
|
|
2153
2194
|
justify: "space-between",
|
|
2154
2195
|
align: "middle",
|
|
2155
|
-
class: F(
|
|
2196
|
+
class: F(o(R)("page-table-header"))
|
|
2156
2197
|
}, {
|
|
2157
|
-
default: C(() => [
|
|
2158
|
-
default: C(() => [
|
|
2159
|
-
class: F(
|
|
2160
|
-
}, z(t.title ??
|
|
2198
|
+
default: C(() => [$(o(ie), null, {
|
|
2199
|
+
default: C(() => [M(g.$slots, "title", {}, () => [ee("h1", {
|
|
2200
|
+
class: F(o(R)("page-table-header-title"))
|
|
2201
|
+
}, z(t.title ?? o(w).t("pageTable.title")), 3)])]),
|
|
2161
2202
|
_: 3
|
|
2162
|
-
}),
|
|
2163
|
-
default: C(() => [
|
|
2203
|
+
}), $(o(ie), null, {
|
|
2204
|
+
default: C(() => [M(g.$slots, "headerAction"), $(o(we), {
|
|
2164
2205
|
placement: "top",
|
|
2165
|
-
content:
|
|
2206
|
+
content: o(w).t("pageTable.reload"),
|
|
2166
2207
|
transfer: B.value,
|
|
2167
|
-
class: F(
|
|
2208
|
+
class: F(o(R)("page-table-action"))
|
|
2168
2209
|
}, {
|
|
2169
|
-
default: C(() => [
|
|
2210
|
+
default: C(() => [$(o(fe), {
|
|
2170
2211
|
type: "md-refresh",
|
|
2171
2212
|
size: "20",
|
|
2172
|
-
onClick:
|
|
2213
|
+
onClick: Ge
|
|
2173
2214
|
})]),
|
|
2174
2215
|
_: 1
|
|
2175
|
-
}, 8, ["content", "transfer", "class"]),
|
|
2216
|
+
}, 8, ["content", "transfer", "class"]), $(o(we), {
|
|
2176
2217
|
placement: "top",
|
|
2177
|
-
content:
|
|
2218
|
+
content: o(w).t(`pageTable.${d.value ? "restore" : "maxmize"}`),
|
|
2178
2219
|
transfer: B.value,
|
|
2179
|
-
class: F(
|
|
2220
|
+
class: F(o(R)("page-table-action"))
|
|
2180
2221
|
}, {
|
|
2181
|
-
default: C(() => [
|
|
2182
|
-
type:
|
|
2222
|
+
default: C(() => [$(o(fe), {
|
|
2223
|
+
type: d.value ? "md-contract" : "md-expand",
|
|
2183
2224
|
size: "20",
|
|
2184
|
-
onClick:
|
|
2225
|
+
onClick: Je
|
|
2185
2226
|
}, null, 8, ["type"])]),
|
|
2186
2227
|
_: 1
|
|
2187
|
-
}, 8, ["content", "transfer", "class"]),
|
|
2228
|
+
}, 8, ["content", "transfer", "class"]), $(Le, {
|
|
2188
2229
|
modelValue: T.value,
|
|
2189
|
-
"onUpdate:modelValue": m[0] || (m[0] = (
|
|
2230
|
+
"onUpdate:modelValue": m[0] || (m[0] = (O) => T.value = O),
|
|
2190
2231
|
size: "20",
|
|
2191
2232
|
transfer: B.value,
|
|
2192
2233
|
"store-at": t.storeAt,
|
|
2193
|
-
onChange: m[1] || (m[1] = (
|
|
2234
|
+
onChange: m[1] || (m[1] = (O) => g.$emit("change-col", O))
|
|
2194
2235
|
}, {
|
|
2195
|
-
default: C(() => [
|
|
2236
|
+
default: C(() => [$(o(fe), {
|
|
2196
2237
|
type: "md-settings",
|
|
2197
2238
|
size: "20"
|
|
2198
2239
|
})]),
|
|
@@ -2201,92 +2242,92 @@ const M = {
|
|
|
2201
2242
|
_: 3
|
|
2202
2243
|
})]),
|
|
2203
2244
|
_: 3
|
|
2204
|
-
}, 8, ["class"])) :
|
|
2205
|
-
class: F([
|
|
2206
|
-
}, [
|
|
2245
|
+
}, 8, ["class"])) : q("", !0), ee("div", {
|
|
2246
|
+
class: F([o(R)("page-table-list"), !o(y).total && !r.data.length && o(R)("page-table-list-empty")])
|
|
2247
|
+
}, [$(o(je), U({
|
|
2207
2248
|
ref: "tableRef"
|
|
2208
|
-
},
|
|
2249
|
+
}, o(Ne)(g.$attrs, ["id", "class", "style"]), {
|
|
2209
2250
|
border: t.border,
|
|
2210
2251
|
columns: T.value,
|
|
2211
|
-
data:
|
|
2212
|
-
loading:
|
|
2213
|
-
height:
|
|
2214
|
-
"max-height":
|
|
2215
|
-
onOnRowClick:
|
|
2216
|
-
}),
|
|
2252
|
+
data: r.data,
|
|
2253
|
+
loading: p.value,
|
|
2254
|
+
height: r.height,
|
|
2255
|
+
"max-height": r.maxHeight,
|
|
2256
|
+
onOnRowClick: Ue
|
|
2257
|
+
}), Fe({
|
|
2217
2258
|
_: 2
|
|
2218
2259
|
}, [g.$slots.header ? {
|
|
2219
2260
|
name: "header",
|
|
2220
|
-
fn: C(() => [
|
|
2261
|
+
fn: C(() => [M(g.$slots, "header")]),
|
|
2221
2262
|
key: "0"
|
|
2222
|
-
} : void 0,
|
|
2223
|
-
name:
|
|
2224
|
-
fn: C((A) => [
|
|
2263
|
+
} : void 0, _(P.value, (O) => ({
|
|
2264
|
+
name: O.slot,
|
|
2265
|
+
fn: C((A) => [M(g.$slots, O.slot, Be(Ve(A)))])
|
|
2225
2266
|
})), g.$slots.footer ? {
|
|
2226
2267
|
name: "footer",
|
|
2227
|
-
fn: C(() => [
|
|
2268
|
+
fn: C(() => [M(g.$slots, "footer")]),
|
|
2228
2269
|
key: "1"
|
|
2229
|
-
} : void 0]), 1040, ["border", "columns", "data", "loading", "height", "max-height", "onOnRowClick"]),
|
|
2270
|
+
} : void 0]), 1040, ["border", "columns", "data", "loading", "height", "max-height", "onOnRowClick"]), te($(o(ot), {
|
|
2230
2271
|
ref: "pageRef",
|
|
2231
|
-
modelValue:
|
|
2232
|
-
"onUpdate:modelValue": m[2] || (m[2] = (
|
|
2233
|
-
total:
|
|
2234
|
-
"page-size":
|
|
2272
|
+
modelValue: o(y).curr,
|
|
2273
|
+
"onUpdate:modelValue": m[2] || (m[2] = (O) => o(y).curr = O),
|
|
2274
|
+
total: o(y).total,
|
|
2275
|
+
"page-size": o(y).size,
|
|
2235
2276
|
"show-total": "",
|
|
2236
2277
|
"show-sizer": "",
|
|
2237
2278
|
"show-elevator": "",
|
|
2238
2279
|
transfer: B.value,
|
|
2239
2280
|
"page-size-opts": t.pageSizeOpts,
|
|
2240
|
-
class: F(
|
|
2241
|
-
onOnChange:
|
|
2242
|
-
onOnPageSizeChange:
|
|
2243
|
-
}, null, 8, ["modelValue", "total", "page-size", "transfer", "page-size-opts", "class"]), [[
|
|
2281
|
+
class: F(o(R)("page-table-paginator")),
|
|
2282
|
+
onOnChange: W,
|
|
2283
|
+
onOnPageSizeChange: Ke
|
|
2284
|
+
}, null, 8, ["modelValue", "total", "page-size", "transfer", "page-size-opts", "class"]), [[ue, !t.hidePage]])], 2)], 2));
|
|
2244
2285
|
}
|
|
2245
|
-
}),
|
|
2286
|
+
}), jt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2246
2287
|
__proto__: null,
|
|
2247
|
-
AllCheckbox:
|
|
2248
|
-
BaseSwitch:
|
|
2249
|
-
CacheSelect:
|
|
2250
|
-
Combi:
|
|
2251
|
-
CountRange:
|
|
2252
|
-
CurdTable:
|
|
2253
|
-
DateRange:
|
|
2288
|
+
AllCheckbox: ct,
|
|
2289
|
+
BaseSwitch: gt,
|
|
2290
|
+
CacheSelect: Bt,
|
|
2291
|
+
Combi: bt,
|
|
2292
|
+
CountRange: yt,
|
|
2293
|
+
CurdTable: Tt,
|
|
2294
|
+
DateRange: Dt,
|
|
2254
2295
|
DateRangePicker: xt,
|
|
2255
|
-
MCalendar:
|
|
2296
|
+
MCalendar: Rt,
|
|
2256
2297
|
ModalFooter: Mt,
|
|
2257
|
-
PageTable:
|
|
2258
|
-
RemoteSelect:
|
|
2259
|
-
ToggleColumn:
|
|
2260
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
2298
|
+
PageTable: Ht,
|
|
2299
|
+
RemoteSelect: Ee,
|
|
2300
|
+
ToggleColumn: Le
|
|
2301
|
+
}, Symbol.toStringTag, { value: "Module" })), Ie = Object.values(jt), Nt = Object.entries({ iviewSelect: Pe });
|
|
2261
2302
|
function Pt(t, S = {}) {
|
|
2262
|
-
if (S.prefix && (Se[0] = S.prefix,
|
|
2303
|
+
if (S.prefix && (Se[0] = S.prefix, Ie.forEach((a) => a.name = S.prefix + a.name)), Ie.forEach((a) => {
|
|
2263
2304
|
t.component(a.name, a);
|
|
2264
|
-
}),
|
|
2305
|
+
}), Nt.forEach((a) => {
|
|
2265
2306
|
t.directive(a[0], a[1]);
|
|
2266
2307
|
}), S.i18n) {
|
|
2267
|
-
|
|
2308
|
+
w.i18n = S.i18n, S.msgPrefix && S.msgPrefix !== "d" && (w.prefix = S.msgPrefix);
|
|
2268
2309
|
return;
|
|
2269
2310
|
}
|
|
2270
|
-
S.msg && (
|
|
2311
|
+
S.msg && (w.msg = S.msg);
|
|
2271
2312
|
}
|
|
2272
|
-
const
|
|
2313
|
+
const Qt = {
|
|
2273
2314
|
install: Pt
|
|
2274
2315
|
};
|
|
2275
2316
|
export {
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2317
|
+
ct as AllCheckbox,
|
|
2318
|
+
gt as BaseSwitch,
|
|
2319
|
+
Bt as CacheSelect,
|
|
2320
|
+
bt as Combi,
|
|
2321
|
+
yt as CountRange,
|
|
2322
|
+
Tt as CurdTable,
|
|
2323
|
+
Dt as DateRange,
|
|
2283
2324
|
xt as DateRangePicker,
|
|
2284
|
-
|
|
2325
|
+
Rt as MCalendar,
|
|
2285
2326
|
Mt as ModalFooter,
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2327
|
+
Ht as PageTable,
|
|
2328
|
+
Ee as RemoteSelect,
|
|
2329
|
+
Le as ToggleColumn,
|
|
2330
|
+
Qt as default,
|
|
2290
2331
|
Pt as install,
|
|
2291
|
-
|
|
2332
|
+
Pe as iviewSelect
|
|
2292
2333
|
};
|