view-ui-plus-derive 0.1.3 → 0.2.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 +64 -1612
- package/dist/index.d.ts +97 -324
- package/dist/index.js +1247 -1238
- package/dist/iview-mod.js +1 -0
- package/dist/iview-mods/index.d.ts +4 -0
- package/dist/iview-mods/table-cache-cols.js +48 -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 +25 -17
package/dist/index.js
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
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";
|
|
4
5
|
/* empty css */
|
|
5
6
|
/* empty css */
|
|
6
|
-
import { i as
|
|
7
|
+
import { i as Pe } from "./directives/v-iview-select.js";
|
|
7
8
|
/* empty css */
|
|
8
9
|
/* empty css */
|
|
9
|
-
import { Checkbox as $e } from "view-ui-plus";
|
|
10
10
|
/* empty css */
|
|
11
11
|
/* empty css */
|
|
12
|
-
const
|
|
12
|
+
const w = {
|
|
13
13
|
i18n: null,
|
|
14
14
|
prefix: "d",
|
|
15
|
-
msg:
|
|
16
|
-
t(t, ...
|
|
17
|
-
return
|
|
15
|
+
msg: dt,
|
|
16
|
+
t(t, ...S) {
|
|
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
|
/**
|
|
@@ -69,71 +69,68 @@ const M = {
|
|
|
69
69
|
all: Boolean
|
|
70
70
|
},
|
|
71
71
|
emits: ["update:modelValue", "update:all", "change"],
|
|
72
|
-
setup(t, { emit:
|
|
73
|
-
const a = t, e =
|
|
72
|
+
setup(t, { emit: S }) {
|
|
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",
|
|
88
|
-
}),
|
|
86
|
+
return de(() => {
|
|
87
|
+
e("update:all", i.value);
|
|
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
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
default: D(() => [
|
|
103
|
-
j(H(t.title ?? y(M).t("allCheckbox.title")), 1)
|
|
104
|
-
]),
|
|
105
|
-
_: 1
|
|
106
|
-
}, 8, ["modelValue", "indeterminate"]), [
|
|
107
|
-
[ue, !t.hideAll]
|
|
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
|
+
}, {
|
|
100
|
+
default: C(() => [
|
|
101
|
+
H(z(t.title ?? o(w).t("allCheckbox.title")), 1)
|
|
108
102
|
]),
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
103
|
+
_: 1
|
|
104
|
+
}, 8, ["modelValue", "indeterminate"]), [
|
|
105
|
+
[ue, !t.hideAll]
|
|
106
|
+
]),
|
|
107
|
+
$(o(Ze), {
|
|
108
|
+
modelValue: l.value,
|
|
109
|
+
"onUpdate:modelValue": v[1] || (v[1] = (b) => l.value = b),
|
|
110
|
+
class: "ivu-inline-block",
|
|
111
|
+
onOnChange: p
|
|
112
|
+
}, {
|
|
113
|
+
default: C(() => [
|
|
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
|
+
}, {
|
|
118
|
+
default: C(() => [
|
|
119
|
+
M(c.$slots, "default", { item: b }, () => [
|
|
120
|
+
H(z(b[t.keyMap.label]), 1)
|
|
121
|
+
])
|
|
122
|
+
]),
|
|
123
|
+
_: 2
|
|
124
|
+
}, 1032, ["label"]))), 128))
|
|
125
|
+
]),
|
|
126
|
+
_: 3
|
|
127
|
+
}, 8, ["modelValue"])
|
|
128
|
+
]));
|
|
132
129
|
}
|
|
133
|
-
}),
|
|
130
|
+
}), ft = {
|
|
134
131
|
name: "BaseSwitch"
|
|
135
|
-
},
|
|
136
|
-
...
|
|
132
|
+
}, gt = /* @__PURE__ */ Y({
|
|
133
|
+
...ft,
|
|
137
134
|
props: {
|
|
138
135
|
modelValue: [String, Number, Boolean],
|
|
139
136
|
/**
|
|
@@ -160,52 +157,49 @@ const M = {
|
|
|
160
157
|
falseLabel: String
|
|
161
158
|
},
|
|
162
159
|
emits: ["update:modelValue", "change"],
|
|
163
|
-
setup(t, { emit:
|
|
164
|
-
const a = t, e =
|
|
165
|
-
e("update:modelValue",
|
|
160
|
+
setup(t, { emit: S }) {
|
|
161
|
+
const a = t, e = S, l = E(a.modelValue), i = (u) => {
|
|
162
|
+
e("update:modelValue", u), e("change", u);
|
|
166
163
|
};
|
|
167
|
-
return
|
|
164
|
+
return I(
|
|
168
165
|
() => a.modelValue,
|
|
169
|
-
(
|
|
170
|
-
l.value !==
|
|
166
|
+
(u) => {
|
|
167
|
+
l.value !== u && (l.value = u);
|
|
171
168
|
}
|
|
172
|
-
), (
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
_: 3
|
|
193
|
-
}, 16, ["modelValue", "trueValue", "falseValue"]);
|
|
194
|
-
};
|
|
169
|
+
), (u, p) => (D(), L(o(Qe), U({
|
|
170
|
+
modelValue: l.value,
|
|
171
|
+
"onUpdate:modelValue": p[0] || (p[0] = (c) => l.value = c),
|
|
172
|
+
onOnChange: i
|
|
173
|
+
}, u.$attrs, {
|
|
174
|
+
trueValue: t.trueValue,
|
|
175
|
+
falseValue: t.falseValue
|
|
176
|
+
}), {
|
|
177
|
+
open: C(() => [
|
|
178
|
+
M(u.$slots, "open", {}, () => [
|
|
179
|
+
H(z(t.trueLabel), 1)
|
|
180
|
+
])
|
|
181
|
+
]),
|
|
182
|
+
close: C(() => [
|
|
183
|
+
M(u.$slots, "close", {}, () => [
|
|
184
|
+
H(z(t.falseLabel), 1)
|
|
185
|
+
])
|
|
186
|
+
]),
|
|
187
|
+
_: 3
|
|
188
|
+
}, 16, ["modelValue", "trueValue", "falseValue"]));
|
|
195
189
|
}
|
|
196
|
-
}),
|
|
197
|
-
const
|
|
198
|
-
|
|
199
|
-
|
|
190
|
+
}), Se = [], R = (t) => (
|
|
191
|
+
// const prefix = inject(classSymbol, '') as string
|
|
192
|
+
Se[0] ? Se[0].replace(/\B([A-Z])/g, "-$1").toLowerCase() + "-" + t : t
|
|
193
|
+
), mt = {
|
|
200
194
|
key: 0,
|
|
201
195
|
class: "ivu-input-group-prepend"
|
|
202
|
-
},
|
|
196
|
+
}, ht = {
|
|
203
197
|
key: 1,
|
|
204
198
|
class: "ivu-input-group-append"
|
|
205
|
-
},
|
|
199
|
+
}, pt = {
|
|
206
200
|
name: "Combi"
|
|
207
|
-
},
|
|
208
|
-
...
|
|
201
|
+
}, bt = /* @__PURE__ */ Y({
|
|
202
|
+
...pt,
|
|
209
203
|
props: {
|
|
210
204
|
/**
|
|
211
205
|
* 前置文本
|
|
@@ -217,31 +211,31 @@ const M = {
|
|
|
217
211
|
append: String
|
|
218
212
|
},
|
|
219
213
|
setup(t) {
|
|
220
|
-
const
|
|
221
|
-
return (
|
|
222
|
-
class:
|
|
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"])
|
|
223
217
|
}, [
|
|
224
|
-
e.value ? (
|
|
225
|
-
|
|
226
|
-
|
|
218
|
+
e.value ? (D(), j("div", mt, [
|
|
219
|
+
M(i.$slots, "prepend", {}, () => [
|
|
220
|
+
H(z(t.prepend), 1)
|
|
227
221
|
])
|
|
228
|
-
])) :
|
|
229
|
-
|
|
230
|
-
class:
|
|
222
|
+
])) : q("", !0),
|
|
223
|
+
ee("div", {
|
|
224
|
+
class: F([o(R)("combi-cell"), { "with-append": l.value, "with-prepend": e.value }])
|
|
231
225
|
}, [
|
|
232
|
-
|
|
226
|
+
M(i.$slots, "default")
|
|
233
227
|
], 2),
|
|
234
|
-
l.value ? (
|
|
235
|
-
|
|
236
|
-
|
|
228
|
+
l.value ? (D(), j("div", ht, [
|
|
229
|
+
M(i.$slots, "append", {}, () => [
|
|
230
|
+
H(z(t.append), 1)
|
|
237
231
|
])
|
|
238
|
-
])) :
|
|
232
|
+
])) : q("", !0)
|
|
239
233
|
], 2));
|
|
240
234
|
}
|
|
241
|
-
}),
|
|
235
|
+
}), vt = {
|
|
242
236
|
name: "CountRange"
|
|
243
|
-
},
|
|
244
|
-
...
|
|
237
|
+
}, yt = /* @__PURE__ */ Y({
|
|
238
|
+
...vt,
|
|
245
239
|
props: {
|
|
246
240
|
/**
|
|
247
241
|
* 双向绑定最小值
|
|
@@ -331,11 +325,11 @@ const M = {
|
|
|
331
325
|
hideJoiner: Boolean
|
|
332
326
|
},
|
|
333
327
|
emits: ["update:begin", "update:end", "change-min", "change-max", "change"],
|
|
334
|
-
setup(t, { emit:
|
|
335
|
-
const a = t, e =
|
|
328
|
+
setup(t, { emit: S }) {
|
|
329
|
+
const a = t, e = S, l = E(a.begin), i = E(a.end), u = N(() => ({
|
|
336
330
|
min: a.min,
|
|
337
331
|
max: a.max,
|
|
338
|
-
placeholder: a.minHolder ??
|
|
332
|
+
placeholder: a.minHolder ?? w.t("countRange.minHolder"),
|
|
339
333
|
disabled: a.disabled || a.minDisabled,
|
|
340
334
|
class: a.minClass,
|
|
341
335
|
controlsOutside: a.controlsOutside,
|
|
@@ -347,10 +341,10 @@ const M = {
|
|
|
347
341
|
parser: a.parser,
|
|
348
342
|
activeChange: a.activeChange,
|
|
349
343
|
...a.minAttr
|
|
350
|
-
})),
|
|
344
|
+
})), p = N(() => ({
|
|
351
345
|
min: l.value,
|
|
352
346
|
max: a.max,
|
|
353
|
-
placeholder: a.maxHolder ??
|
|
347
|
+
placeholder: a.maxHolder ?? w.t("countRange.maxHolder"),
|
|
354
348
|
disabled: a.disabled || a.maxDisabled,
|
|
355
349
|
class: a.maxClass,
|
|
356
350
|
controlsOutside: a.controlsOutside,
|
|
@@ -362,43 +356,40 @@ const M = {
|
|
|
362
356
|
parser: a.parser,
|
|
363
357
|
activeChange: l.value ? !1 : a.activeChange,
|
|
364
358
|
...a.maxAttr
|
|
365
|
-
})),
|
|
366
|
-
e("update:begin", l.value), e("update:end",
|
|
367
|
-
},
|
|
368
|
-
|
|
369
|
-
},
|
|
370
|
-
|
|
371
|
-
},
|
|
372
|
-
l.value !==
|
|
373
|
-
},
|
|
374
|
-
|
|
375
|
-
};
|
|
376
|
-
return F(() => a.begin, u), F(() => a.end, x), (s, b) => {
|
|
377
|
-
const C = A("InputNumber");
|
|
378
|
-
return $(), N("div", {
|
|
379
|
-
class: P(y(I)("count-range"))
|
|
380
|
-
}, [
|
|
381
|
-
O(C, G({
|
|
382
|
-
modelValue: l.value,
|
|
383
|
-
"onUpdate:modelValue": b[0] || (b[0] = (T) => l.value = T)
|
|
384
|
-
}, i.value, { onOnChange: p }), null, 16, ["modelValue"]),
|
|
385
|
-
ae(te("span", {
|
|
386
|
-
class: P([y(I)("count-range-joiner"), t.joinerClass])
|
|
387
|
-
}, null, 2), [
|
|
388
|
-
[ue, !t.hideJoiner]
|
|
389
|
-
]),
|
|
390
|
-
O(C, G({
|
|
391
|
-
modelValue: n.value,
|
|
392
|
-
"onUpdate:modelValue": b[1] || (b[1] = (T) => n.value = T)
|
|
393
|
-
}, g.value, { onOnChange: v }), null, 16, ["modelValue"])
|
|
394
|
-
], 2);
|
|
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);
|
|
395
369
|
};
|
|
370
|
+
return I(() => a.begin, d), I(() => a.end, T), (r, y) => (D(), j("div", {
|
|
371
|
+
class: F(o(R)("count-range"))
|
|
372
|
+
}, [
|
|
373
|
+
$(o(Re), U({
|
|
374
|
+
modelValue: l.value,
|
|
375
|
+
"onUpdate:modelValue": y[0] || (y[0] = (B) => l.value = B)
|
|
376
|
+
}, u.value, { onOnChange: v }), null, 16, ["modelValue"]),
|
|
377
|
+
te(ee("span", {
|
|
378
|
+
class: F([o(R)("count-range-joiner"), t.joinerClass])
|
|
379
|
+
}, null, 2), [
|
|
380
|
+
[ue, !t.hideJoiner]
|
|
381
|
+
]),
|
|
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
|
+
], 2));
|
|
396
387
|
}
|
|
397
|
-
}),
|
|
388
|
+
}), kt = { key: 1 }, St = {
|
|
398
389
|
name: "RemoteSelect",
|
|
399
390
|
inheritAttrs: !1
|
|
400
|
-
},
|
|
401
|
-
...
|
|
391
|
+
}, Ee = /* @__PURE__ */ Y({
|
|
392
|
+
...St,
|
|
402
393
|
props: {
|
|
403
394
|
modelValue: [String, Array, Number],
|
|
404
395
|
list: Array,
|
|
@@ -466,11 +457,11 @@ const M = {
|
|
|
466
457
|
type: Function,
|
|
467
458
|
default({
|
|
468
459
|
multiple: t,
|
|
469
|
-
keyMap:
|
|
460
|
+
keyMap: S,
|
|
470
461
|
list: a,
|
|
471
462
|
value: e
|
|
472
463
|
}) {
|
|
473
|
-
return t ? a.filter((l) => e.includes(l[
|
|
464
|
+
return t ? a.filter((l) => e.includes(l[S.value])) : a.find((l) => l[S.value] === e) || {};
|
|
474
465
|
}
|
|
475
466
|
},
|
|
476
467
|
/**
|
|
@@ -488,132 +479,129 @@ const M = {
|
|
|
488
479
|
}
|
|
489
480
|
},
|
|
490
481
|
emits: ["update:modelValue", "update:chosen", "update:list", "update:refresh", "load"],
|
|
491
|
-
setup(t, { expose:
|
|
492
|
-
const e = t, l = a,
|
|
493
|
-
() =>
|
|
494
|
-
),
|
|
495
|
-
let
|
|
496
|
-
async function
|
|
497
|
-
let
|
|
482
|
+
setup(t, { expose: S, emit: a }) {
|
|
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
|
+
async function B() {
|
|
488
|
+
let s;
|
|
498
489
|
if (typeof e.loader != "function") {
|
|
499
490
|
if (typeof e.method != "function") {
|
|
500
491
|
console.warn("typeof method isn't function");
|
|
501
492
|
return;
|
|
502
493
|
}
|
|
503
|
-
if (
|
|
504
|
-
const
|
|
505
|
-
|
|
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);
|
|
506
497
|
}
|
|
507
498
|
} else
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
}), 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));
|
|
512
503
|
}
|
|
513
|
-
function
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
}),
|
|
504
|
+
function P(s) {
|
|
505
|
+
T = !0, G(() => {
|
|
506
|
+
T = null;
|
|
507
|
+
}), r && (e.multiple ? !s.toString().length : s === void 0) && (i.value = s = r), c.value = e.getSelected({
|
|
517
508
|
multiple: e.multiple,
|
|
518
509
|
keyMap: e.keyMap,
|
|
519
|
-
list:
|
|
520
|
-
value:
|
|
521
|
-
}), l("update:modelValue",
|
|
510
|
+
list: u.value,
|
|
511
|
+
value: i.value
|
|
512
|
+
}), l("update:modelValue", s ?? ""), l("update:chosen", c.value);
|
|
522
513
|
}
|
|
523
|
-
function
|
|
524
|
-
|
|
514
|
+
function f(s) {
|
|
515
|
+
s && !e.autoGet && !p.value && !b.value && (!e.check || e.check()) && (!e.strict || e.parentCode) && B();
|
|
525
516
|
}
|
|
526
|
-
function
|
|
527
|
-
return
|
|
517
|
+
function V() {
|
|
518
|
+
return i.value != null && i.value.toString().length > 0;
|
|
528
519
|
}
|
|
529
|
-
return l("update:refresh",
|
|
530
|
-
e.autoGet ?
|
|
531
|
-
}),
|
|
532
|
-
code:
|
|
533
|
-
changeCode:
|
|
534
|
-
loaded:
|
|
535
|
-
codes:
|
|
536
|
-
search:
|
|
537
|
-
}),
|
|
520
|
+
return l("update:refresh", B), de(() => {
|
|
521
|
+
e.autoGet ? B() : V() && !u.value.length && f(!0);
|
|
522
|
+
}), S({
|
|
523
|
+
code: i,
|
|
524
|
+
changeCode: P,
|
|
525
|
+
loaded: b,
|
|
526
|
+
codes: u,
|
|
527
|
+
search: B
|
|
528
|
+
}), I(
|
|
538
529
|
() => e.list,
|
|
539
|
-
(
|
|
540
|
-
|
|
530
|
+
(s) => {
|
|
531
|
+
d || (s && s.length ? (u.value = s, b.value = !!e.cache) : (u.value = [], b.value = !1));
|
|
541
532
|
},
|
|
542
533
|
{ immediate: !0 }
|
|
543
|
-
),
|
|
534
|
+
), I(
|
|
544
535
|
() => e.modelValue,
|
|
545
|
-
(
|
|
546
|
-
if (!
|
|
547
|
-
|
|
548
|
-
}),
|
|
549
|
-
for (const
|
|
536
|
+
(s) => {
|
|
537
|
+
if (!T && (y = !0, G(() => {
|
|
538
|
+
y = null;
|
|
539
|
+
}), i.value = s ?? "", P(i.value), e.refresh !== B)) {
|
|
540
|
+
for (const k in c.value)
|
|
550
541
|
return;
|
|
551
|
-
|
|
542
|
+
f(V());
|
|
552
543
|
}
|
|
553
544
|
}
|
|
554
|
-
),
|
|
545
|
+
), I(
|
|
555
546
|
() => e.parentCode,
|
|
556
|
-
(
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
})) :
|
|
560
|
-
|
|
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
|
+
f(!0);
|
|
561
552
|
}
|
|
562
|
-
), (
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
553
|
+
), (s, k) => t.textMode ? (D(), j("span", kt, [
|
|
554
|
+
M(s.$slots, "text", { text: v.value }, () => [
|
|
555
|
+
H(z(v.value), 1)
|
|
556
|
+
])
|
|
557
|
+
])) : te((D(), L(o(_e), U({
|
|
558
|
+
key: 0,
|
|
559
|
+
modelValue: i.value,
|
|
560
|
+
"onUpdate:modelValue": k[0] || (k[0] = (h) => i.value = h),
|
|
561
|
+
onOnOpenChange: f,
|
|
562
|
+
onOnChange: P
|
|
563
|
+
}, s.$attrs, {
|
|
564
|
+
multiple: t.multiple,
|
|
565
|
+
loading: p.value,
|
|
566
|
+
"not-found-text": p.value ? null : void 0
|
|
567
|
+
}), {
|
|
568
|
+
default: C(() => [
|
|
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
|
+
}, {
|
|
577
|
+
default: C(() => [
|
|
578
|
+
M(s.$slots, "default", {
|
|
579
|
+
item: h,
|
|
580
|
+
index: n
|
|
581
|
+
}, () => [
|
|
582
|
+
H(z(h[t.keyMap.label]), 1)
|
|
583
|
+
])
|
|
584
|
+
]),
|
|
585
|
+
_: 2
|
|
586
|
+
}, 1032, ["value", "label", "disabled", "tag"]))), 128))
|
|
567
587
|
])
|
|
568
|
-
])
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
onOnChange: T
|
|
574
|
-
}, r.$attrs, {
|
|
575
|
-
multiple: t.multiple,
|
|
576
|
-
loading: g.value,
|
|
577
|
-
"not-found-text": g.value ? null : void 0
|
|
578
|
-
}), {
|
|
579
|
-
default: D(() => [
|
|
580
|
-
z(r.$slots, "dropdown", { list: i.value }, () => [
|
|
581
|
-
($(!0), N(Q, null, ee(i.value, (V, K) => ($(), U(h, {
|
|
582
|
-
key: e.valueAsKey ? V[t.keyMap.value] : K,
|
|
583
|
-
value: V[t.keyMap.value],
|
|
584
|
-
label: t.formatLabel && t.formatLabel(V, K),
|
|
585
|
-
disabled: t.optionDisabled && t.optionDisabled(V, K),
|
|
586
|
-
tag: t.optionTag && t.optionTag(V, K)
|
|
587
|
-
}, {
|
|
588
|
-
default: D(() => [
|
|
589
|
-
z(r.$slots, "default", {
|
|
590
|
-
item: V,
|
|
591
|
-
index: K
|
|
592
|
-
}, () => [
|
|
593
|
-
j(H(V[t.keyMap.label]), 1)
|
|
594
|
-
])
|
|
595
|
-
]),
|
|
596
|
-
_: 2
|
|
597
|
-
}, 1032, ["value", "label", "disabled", "tag"]))), 128))
|
|
598
|
-
])
|
|
599
|
-
]),
|
|
600
|
-
_: 3
|
|
601
|
-
}, 16, ["modelValue", "multiple", "loading", "not-found-text"])), [
|
|
602
|
-
[y(Re), t.all, "all"]
|
|
603
|
-
]);
|
|
604
|
-
};
|
|
588
|
+
]),
|
|
589
|
+
_: 3
|
|
590
|
+
}, 16, ["modelValue", "multiple", "loading", "not-found-text"])), [
|
|
591
|
+
[o(Pe), t.all, "all"]
|
|
592
|
+
]);
|
|
605
593
|
}
|
|
606
|
-
}),
|
|
594
|
+
}), ve = {
|
|
607
595
|
list: null
|
|
608
|
-
},
|
|
596
|
+
}, ae = ze({}), le = {
|
|
609
597
|
list: []
|
|
610
|
-
},
|
|
598
|
+
}, ne = {
|
|
611
599
|
list: []
|
|
612
|
-
},
|
|
600
|
+
}, ye = {}, Ct = {
|
|
613
601
|
name: "CacheSelect",
|
|
614
602
|
inheritAttrs: !1
|
|
615
|
-
},
|
|
616
|
-
...
|
|
603
|
+
}, Bt = /* @__PURE__ */ Y({
|
|
604
|
+
...Ct,
|
|
617
605
|
props: {
|
|
618
606
|
modelValue: [String, Array, Number],
|
|
619
607
|
/**
|
|
@@ -625,298 +613,65 @@ const M = {
|
|
|
625
613
|
}
|
|
626
614
|
},
|
|
627
615
|
emits: ["update:modelValue", "update:chosen", "update:list", "load", "change"],
|
|
628
|
-
setup(t, { emit:
|
|
629
|
-
const a = t, e =
|
|
630
|
-
e("update:modelValue",
|
|
631
|
-
},
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
}),
|
|
636
|
-
|
|
637
|
-
}),
|
|
638
|
-
}), e("load",
|
|
639
|
-
},
|
|
640
|
-
return
|
|
616
|
+
setup(t, { emit: S }) {
|
|
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
|
+
G(() => {
|
|
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
|
+
return I(
|
|
641
629
|
() => a.modelValue,
|
|
642
|
-
(
|
|
643
|
-
l.value !==
|
|
630
|
+
(v) => {
|
|
631
|
+
l.value !== v && (l.value = v ?? "");
|
|
644
632
|
}
|
|
645
|
-
),
|
|
646
|
-
|
|
647
|
-
() =>
|
|
648
|
-
(
|
|
649
|
-
|
|
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);
|
|
650
638
|
},
|
|
651
639
|
{
|
|
652
640
|
immediate: !0
|
|
653
641
|
}
|
|
654
642
|
);
|
|
655
|
-
}), (
|
|
643
|
+
}), (v, b) => (D(), L(Ee, U({
|
|
656
644
|
ref: "sel",
|
|
657
645
|
modelValue: l.value,
|
|
658
|
-
"onUpdate:modelValue":
|
|
659
|
-
list:
|
|
646
|
+
"onUpdate:modelValue": b[0] || (b[0] = (d) => l.value = d),
|
|
647
|
+
list: o(ae)[t.cacheId],
|
|
660
648
|
"onUpdate:list": [
|
|
661
|
-
|
|
662
|
-
|
|
649
|
+
b[1] || (b[1] = (d) => o(ae)[t.cacheId] = d),
|
|
650
|
+
b[3] || (b[3] = (d) => v.$emit("update:list", d))
|
|
663
651
|
],
|
|
664
|
-
onLoad:
|
|
665
|
-
onOnChange:
|
|
666
|
-
"onUpdate:chosen":
|
|
667
|
-
},
|
|
668
|
-
default:
|
|
669
|
-
|
|
670
|
-
item:
|
|
671
|
-
index:
|
|
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
|
+
index: T
|
|
672
660
|
})
|
|
673
661
|
]),
|
|
674
|
-
dropdown:
|
|
675
|
-
|
|
662
|
+
dropdown: C(({ list: d }) => [
|
|
663
|
+
M(v.$slots, "dropdown", { list: d })
|
|
676
664
|
]),
|
|
677
|
-
text:
|
|
678
|
-
|
|
665
|
+
text: C((d) => [
|
|
666
|
+
M(v.$slots, "text", Be(Ve(d)))
|
|
679
667
|
]),
|
|
680
668
|
_: 3
|
|
681
669
|
}, 16, ["modelValue", "list"]));
|
|
682
670
|
}
|
|
683
|
-
}),
|
|
684
|
-
name: "CurdTable"
|
|
685
|
-
}, ft = /* @__PURE__ */ _({
|
|
686
|
-
...mt,
|
|
687
|
-
props: {
|
|
688
|
-
modelValue: {
|
|
689
|
-
type: Array,
|
|
690
|
-
default: () => []
|
|
691
|
-
},
|
|
692
|
-
/**
|
|
693
|
-
* iview Table columns
|
|
694
|
-
*/
|
|
695
|
-
columns: {
|
|
696
|
-
type: Array,
|
|
697
|
-
default: () => []
|
|
698
|
-
},
|
|
699
|
-
/**
|
|
700
|
-
* 是否隐藏控制列
|
|
701
|
-
*/
|
|
702
|
-
disabled: Boolean,
|
|
703
|
-
/**
|
|
704
|
-
* 可否增加数据,默认true
|
|
705
|
-
*/
|
|
706
|
-
addable: {
|
|
707
|
-
type: Boolean,
|
|
708
|
-
default: !0
|
|
709
|
-
},
|
|
710
|
-
/**
|
|
711
|
-
* 控制列宽度,默认90px
|
|
712
|
-
*/
|
|
713
|
-
actionWidth: {
|
|
714
|
-
type: Number,
|
|
715
|
-
default: 90
|
|
716
|
-
},
|
|
717
|
-
/**
|
|
718
|
-
* 控制列水平对齐,默认居中
|
|
719
|
-
*/
|
|
720
|
-
actionAlign: {
|
|
721
|
-
type: String,
|
|
722
|
-
default: "center"
|
|
723
|
-
},
|
|
724
|
-
/**
|
|
725
|
-
* 控制列是否固定
|
|
726
|
-
*/
|
|
727
|
-
actionFixed: String,
|
|
728
|
-
/**
|
|
729
|
-
* 控制列表头文本
|
|
730
|
-
*/
|
|
731
|
-
actionText: String,
|
|
732
|
-
/**
|
|
733
|
-
* 右侧控制列
|
|
734
|
-
*/
|
|
735
|
-
actionCol: {
|
|
736
|
-
type: Object,
|
|
737
|
-
default(t) {
|
|
738
|
-
return {
|
|
739
|
-
// title: props.actionText,
|
|
740
|
-
slot: "action",
|
|
741
|
-
width: t.actionWidth,
|
|
742
|
-
align: t.actionAlign,
|
|
743
|
-
fixed: t.actionFixed
|
|
744
|
-
};
|
|
745
|
-
}
|
|
746
|
-
},
|
|
747
|
-
/**
|
|
748
|
-
* 新增行时需要添加的数据
|
|
749
|
-
*/
|
|
750
|
-
addRow: {
|
|
751
|
-
type: Function,
|
|
752
|
-
default: () => []
|
|
753
|
-
},
|
|
754
|
-
border: Boolean,
|
|
755
|
-
size: String,
|
|
756
|
-
/**
|
|
757
|
-
* 返回Promise以决定何时新增数据
|
|
758
|
-
*/
|
|
759
|
-
beforeAdd: Function,
|
|
760
|
-
/**
|
|
761
|
-
* 返回Promise以决定何时删除数据
|
|
762
|
-
*/
|
|
763
|
-
beforeRemove: Function,
|
|
764
|
-
addBtnType: {
|
|
765
|
-
type: String,
|
|
766
|
-
default: "dashed"
|
|
767
|
-
},
|
|
768
|
-
addBtnSize: String,
|
|
769
|
-
addBtnGhost: {
|
|
770
|
-
type: Boolean,
|
|
771
|
-
default: !1
|
|
772
|
-
},
|
|
773
|
-
addBtnDisabled: {
|
|
774
|
-
type: Boolean,
|
|
775
|
-
default(t) {
|
|
776
|
-
return !t.addable;
|
|
777
|
-
}
|
|
778
|
-
},
|
|
779
|
-
addBtn: {
|
|
780
|
-
type: Object,
|
|
781
|
-
default: () => ({})
|
|
782
|
-
},
|
|
783
|
-
delBtnType: {
|
|
784
|
-
type: String,
|
|
785
|
-
default: "warning"
|
|
786
|
-
},
|
|
787
|
-
delBtnSize: {
|
|
788
|
-
type: String,
|
|
789
|
-
default: "small"
|
|
790
|
-
},
|
|
791
|
-
delBtnGhost: {
|
|
792
|
-
type: Boolean,
|
|
793
|
-
default: !0
|
|
794
|
-
},
|
|
795
|
-
delBtn: {
|
|
796
|
-
type: Object,
|
|
797
|
-
default: () => ({})
|
|
798
|
-
},
|
|
799
|
-
addText: String,
|
|
800
|
-
/**
|
|
801
|
-
* 是否隐藏每行的删除按钮,通过函数返回值决定
|
|
802
|
-
*/
|
|
803
|
-
hideDelBtn: Function,
|
|
804
|
-
/**
|
|
805
|
-
* 是否禁用每行删除按钮,通过函数返回值决定
|
|
806
|
-
*/
|
|
807
|
-
delBtnDisabled: {
|
|
808
|
-
type: Function,
|
|
809
|
-
default() {
|
|
810
|
-
return !1;
|
|
811
|
-
}
|
|
812
|
-
}
|
|
813
|
-
},
|
|
814
|
-
emits: ["update:modelValue", "add", "remove", "change"],
|
|
815
|
-
setup(t, { emit: k }) {
|
|
816
|
-
const a = t, e = k, l = E(a.modelValue), n = L(
|
|
817
|
-
() => a.disabled ? a.columns : a.columns.concat(
|
|
818
|
-
Object.assign(
|
|
819
|
-
{
|
|
820
|
-
title: a.actionText ?? M.t("curdTable.actionText")
|
|
821
|
-
},
|
|
822
|
-
a.actionCol
|
|
823
|
-
)
|
|
824
|
-
)
|
|
825
|
-
), i = L(() => {
|
|
826
|
-
const u = [], x = (s) => {
|
|
827
|
-
s.slot && u.push(s), s.children && s.children.forEach((b) => {
|
|
828
|
-
x(b);
|
|
829
|
-
});
|
|
830
|
-
};
|
|
831
|
-
return a.columns.forEach((s) => {
|
|
832
|
-
x(s);
|
|
833
|
-
}), u;
|
|
834
|
-
});
|
|
835
|
-
function g() {
|
|
836
|
-
typeof a.beforeAdd != "function" ? d() : a.beforeAdd().then(d).catch();
|
|
837
|
-
}
|
|
838
|
-
function d(u) {
|
|
839
|
-
l.value.push(...a.addRow(u)), e("update:modelValue", l.value), e("add", l.value[l.value.length - 1]), e("change", !0);
|
|
840
|
-
}
|
|
841
|
-
function p(u) {
|
|
842
|
-
typeof a.beforeRemove != "function" ? v(u) : a.beforeRemove(l.value[u], u).then(() => {
|
|
843
|
-
v(u);
|
|
844
|
-
});
|
|
845
|
-
}
|
|
846
|
-
function v(u) {
|
|
847
|
-
const [x] = l.value.splice(u, 1);
|
|
848
|
-
e("update:modelValue", l.value), e("remove", x), e("change", !1);
|
|
849
|
-
}
|
|
850
|
-
return F(
|
|
851
|
-
() => a.modelValue,
|
|
852
|
-
(u) => {
|
|
853
|
-
l.value = u;
|
|
854
|
-
}
|
|
855
|
-
), (u, x) => {
|
|
856
|
-
const s = A("Button"), b = A("Table");
|
|
857
|
-
return $(), N("div", null, [
|
|
858
|
-
O(b, {
|
|
859
|
-
border: t.border,
|
|
860
|
-
columns: n.value,
|
|
861
|
-
data: l.value,
|
|
862
|
-
size: t.size,
|
|
863
|
-
style: { "z-index": "0" }
|
|
864
|
-
}, we({
|
|
865
|
-
action: D(({ row: C, index: T }) => [
|
|
866
|
-
z(u.$slots, "moreAction", {
|
|
867
|
-
row: C,
|
|
868
|
-
index: T
|
|
869
|
-
}),
|
|
870
|
-
!t.hideDelBtn || !t.hideDelBtn(C, T) ? ($(), U(s, G({
|
|
871
|
-
key: 0,
|
|
872
|
-
type: t.delBtnType,
|
|
873
|
-
size: t.delBtnSize,
|
|
874
|
-
ghost: t.delBtnGhost
|
|
875
|
-
}, t.delBtn, {
|
|
876
|
-
disabled: t.delBtnDisabled(C, T),
|
|
877
|
-
onClick: (c) => p(T)
|
|
878
|
-
}), {
|
|
879
|
-
default: D(() => [
|
|
880
|
-
j(H(y(M).t("curdTable.del")), 1)
|
|
881
|
-
]),
|
|
882
|
-
_: 1
|
|
883
|
-
}, 16, ["type", "size", "ghost", "disabled", "onClick"])) : W("", !0)
|
|
884
|
-
]),
|
|
885
|
-
_: 2
|
|
886
|
-
}, [
|
|
887
|
-
ee(i.value, (C) => ({
|
|
888
|
-
name: C.slot,
|
|
889
|
-
fn: D((T) => [
|
|
890
|
-
z(u.$slots, C.slot, Be(De(T)))
|
|
891
|
-
])
|
|
892
|
-
}))
|
|
893
|
-
]), 1032, ["border", "columns", "data", "size"]),
|
|
894
|
-
t.disabled ? W("", !0) : ae(($(), U(s, G({
|
|
895
|
-
key: 0,
|
|
896
|
-
type: t.addBtnType,
|
|
897
|
-
size: t.addBtnSize,
|
|
898
|
-
ghost: t.addBtnGhost,
|
|
899
|
-
disabled: t.addBtnDisabled
|
|
900
|
-
}, t.addBtn, {
|
|
901
|
-
long: "",
|
|
902
|
-
icon: "md-add",
|
|
903
|
-
style: { display: "block", position: "relative", "margin-top": "-1px" },
|
|
904
|
-
onClick: g
|
|
905
|
-
}), {
|
|
906
|
-
default: D(() => [
|
|
907
|
-
j(H(t.addText ?? y(M).t("curdTable.addText")), 1)
|
|
908
|
-
]),
|
|
909
|
-
_: 1
|
|
910
|
-
}, 16, ["type", "size", "ghost", "disabled"])), [
|
|
911
|
-
[ue, t.addable]
|
|
912
|
-
])
|
|
913
|
-
]);
|
|
914
|
-
};
|
|
915
|
-
}
|
|
916
|
-
}), gt = {
|
|
671
|
+
}), Vt = {
|
|
917
672
|
name: "DateRange"
|
|
918
|
-
},
|
|
919
|
-
...
|
|
673
|
+
}, Dt = /* @__PURE__ */ Y({
|
|
674
|
+
...Vt,
|
|
920
675
|
props: {
|
|
921
676
|
/**
|
|
922
677
|
* 双向绑定开始时间
|
|
@@ -1000,73 +755,70 @@ const M = {
|
|
|
1000
755
|
format: String
|
|
1001
756
|
},
|
|
1002
757
|
emits: ["update:begin", "update:end", "change-begin", "change-end", "change"],
|
|
1003
|
-
setup(t, { emit:
|
|
1004
|
-
const a =
|
|
758
|
+
setup(t, { emit: S }) {
|
|
759
|
+
const a = me().appContext.config.globalProperties.$Date, e = {
|
|
1005
760
|
date: "day",
|
|
1006
761
|
month: "month",
|
|
1007
762
|
year: "year",
|
|
1008
763
|
datetime: "day"
|
|
1009
|
-
}, l = t,
|
|
764
|
+
}, l = t, i = S, u = E(l.begin), p = E(l.end), c = N(() => ({
|
|
1010
765
|
options: l.limitBegin ? {
|
|
1011
|
-
disabledDate: (
|
|
766
|
+
disabledDate: (B) => B && a(B).isBefore(Date.now(), e[l.type])
|
|
1012
767
|
// date.valueOf() < Date.now() - (props.disableToday ? 0 : 86400000)
|
|
1013
768
|
} : void 0,
|
|
1014
769
|
disabled: l.disabled || l.beginDisabled,
|
|
1015
|
-
placeholder: l.beginHolder ??
|
|
770
|
+
placeholder: l.beginHolder ?? w.t("dateRange.beginHolder"),
|
|
1016
771
|
class: l.beginClass,
|
|
1017
772
|
clearable: l.clearable,
|
|
1018
773
|
transfer: l.transfer,
|
|
1019
774
|
format: l.format,
|
|
1020
775
|
...l.beginAttr
|
|
1021
|
-
})),
|
|
776
|
+
})), v = N(() => ({
|
|
1022
777
|
options: {
|
|
1023
|
-
disabledDate: (
|
|
778
|
+
disabledDate: (B) => u.value && B && a(B).isBefore(u.value, e[l.type])
|
|
1024
779
|
},
|
|
1025
780
|
disabled: l.disabled || l.endDisabled,
|
|
1026
|
-
placeholder: l.endHolder ??
|
|
781
|
+
placeholder: l.endHolder ?? w.t("dateRange.endHolder"),
|
|
1027
782
|
class: l.endClass,
|
|
1028
783
|
clearable: l.clearable,
|
|
1029
784
|
transfer: l.transfer,
|
|
1030
785
|
format: l.format,
|
|
1031
786
|
...l.endAttr
|
|
1032
|
-
})),
|
|
1033
|
-
|
|
1034
|
-
},
|
|
1035
|
-
|
|
1036
|
-
},
|
|
1037
|
-
l.type === "datetime" &&
|
|
1038
|
-
},
|
|
1039
|
-
|
|
1040
|
-
},
|
|
1041
|
-
|
|
1042
|
-
};
|
|
1043
|
-
return F(() => l.begin, s), F(() => l.end, b), (C, T) => {
|
|
1044
|
-
const c = A("DatePicker");
|
|
1045
|
-
return $(), N("div", {
|
|
1046
|
-
class: P(y(I)("date-range"))
|
|
1047
|
-
}, [
|
|
1048
|
-
O(c, G({
|
|
1049
|
-
modelValue: i.value,
|
|
1050
|
-
"onUpdate:modelValue": T[0] || (T[0] = (S) => i.value = S),
|
|
1051
|
-
onOnChange: u
|
|
1052
|
-
}, d.value, { type: t.type }), null, 16, ["modelValue", "type"]),
|
|
1053
|
-
ae(te("span", {
|
|
1054
|
-
class: P([y(I)("date-range-joiner"), t.joinerClass])
|
|
1055
|
-
}, null, 2), [
|
|
1056
|
-
[ue, !t.hideJoiner]
|
|
1057
|
-
]),
|
|
1058
|
-
O(c, G({
|
|
1059
|
-
modelValue: g.value,
|
|
1060
|
-
"onUpdate:modelValue": T[1] || (T[1] = (S) => g.value = S),
|
|
1061
|
-
onOnChange: x
|
|
1062
|
-
}, p.value, { type: t.type }), null, 16, ["modelValue", "type"])
|
|
1063
|
-
], 2);
|
|
787
|
+
})), b = () => {
|
|
788
|
+
i("update:begin", u.value), i("update:end", p.value);
|
|
789
|
+
}, d = (B) => {
|
|
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
|
+
}, y = (B) => {
|
|
796
|
+
p.value !== B && (p.value = B || "");
|
|
1064
797
|
};
|
|
798
|
+
return I(() => l.begin, r), I(() => l.end, y), (B, P) => (D(), j("div", {
|
|
799
|
+
class: F(o(R)("date-range"))
|
|
800
|
+
}, [
|
|
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
|
+
}, null, 2), [
|
|
809
|
+
[ue, !t.hideJoiner]
|
|
810
|
+
]),
|
|
811
|
+
$(o(ke), U({
|
|
812
|
+
modelValue: p.value,
|
|
813
|
+
"onUpdate:modelValue": P[1] || (P[1] = (f) => p.value = f),
|
|
814
|
+
onOnChange: T
|
|
815
|
+
}, v.value, { type: t.type }), null, 16, ["modelValue", "type"])
|
|
816
|
+
], 2));
|
|
1065
817
|
}
|
|
1066
|
-
}),
|
|
818
|
+
}), Ot = {
|
|
1067
819
|
name: "DateRangePicker"
|
|
1068
|
-
},
|
|
1069
|
-
...
|
|
820
|
+
}, xt = /* @__PURE__ */ Y({
|
|
821
|
+
...Ot,
|
|
1070
822
|
props: {
|
|
1071
823
|
/**
|
|
1072
824
|
* 双向绑定开始时间
|
|
@@ -1122,44 +874,272 @@ const M = {
|
|
|
1122
874
|
}
|
|
1123
875
|
},
|
|
1124
876
|
emits: ["update:begin", "update:end", "change"],
|
|
1125
|
-
setup(t, { emit:
|
|
1126
|
-
const a =
|
|
877
|
+
setup(t, { emit: S }) {
|
|
878
|
+
const a = me().appContext.config.globalProperties.$Date, e = t, l = S, i = N(
|
|
1127
879
|
() => e.options || (e.limitBegin ? {
|
|
1128
|
-
disabledDate: (
|
|
1129
|
-
} :
|
|
1130
|
-
),
|
|
880
|
+
disabledDate: (c) => c && c.valueOf() < Date.now() - (e.disableToday ? 0 : 864e5)
|
|
881
|
+
} : void 0)
|
|
882
|
+
), u = N({
|
|
1131
883
|
get() {
|
|
1132
|
-
const
|
|
1133
|
-
return
|
|
884
|
+
const c = e.begin, v = e.end;
|
|
885
|
+
return c && v ? [a(c).toDate(), a(v).toDate()] : [];
|
|
1134
886
|
},
|
|
1135
|
-
set(
|
|
1136
|
-
let
|
|
1137
|
-
|
|
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);
|
|
1138
890
|
}
|
|
1139
|
-
}),
|
|
1140
|
-
l("change",
|
|
1141
|
-
};
|
|
1142
|
-
return (d, p) => {
|
|
1143
|
-
const v = A("DatePicker");
|
|
1144
|
-
return $(), U(v, {
|
|
1145
|
-
modelValue: i.value,
|
|
1146
|
-
"onUpdate:modelValue": p[0] || (p[0] = (u) => i.value = u),
|
|
1147
|
-
type: t.type,
|
|
1148
|
-
clearable: t.clearable,
|
|
1149
|
-
"split-panels": t.splitPanels,
|
|
1150
|
-
options: n.value,
|
|
1151
|
-
transfer: t.transfer,
|
|
1152
|
-
placeholder: t.placeholder,
|
|
1153
|
-
disabled: t.disabled,
|
|
1154
|
-
placement: t.placement,
|
|
1155
|
-
onOnChange: g
|
|
1156
|
-
}, null, 8, ["modelValue", "type", "clearable", "split-panels", "options", "transfer", "placeholder", "disabled", "placement"]);
|
|
891
|
+
}), p = (c, v) => {
|
|
892
|
+
l("change", c, v);
|
|
1157
893
|
};
|
|
894
|
+
return (c, v) => (D(), L(o(ke), {
|
|
895
|
+
modelValue: u.value,
|
|
896
|
+
"onUpdate:modelValue": v[0] || (v[0] = (b) => u.value = b),
|
|
897
|
+
type: t.type,
|
|
898
|
+
clearable: t.clearable,
|
|
899
|
+
"split-panels": t.splitPanels,
|
|
900
|
+
options: i.value,
|
|
901
|
+
transfer: t.transfer,
|
|
902
|
+
placeholder: t.placeholder,
|
|
903
|
+
disabled: t.disabled,
|
|
904
|
+
placement: t.placement,
|
|
905
|
+
onOnChange: p
|
|
906
|
+
}, null, 8, ["modelValue", "type", "clearable", "split-panels", "options", "transfer", "placeholder", "disabled", "placement", "onOnChange"]));
|
|
907
|
+
}
|
|
908
|
+
}), $t = {
|
|
909
|
+
name: "CurdTable"
|
|
910
|
+
}, Tt = /* @__PURE__ */ Y({
|
|
911
|
+
...$t,
|
|
912
|
+
props: {
|
|
913
|
+
modelValue: {
|
|
914
|
+
type: Array,
|
|
915
|
+
default: () => []
|
|
916
|
+
},
|
|
917
|
+
/**
|
|
918
|
+
* iview Table columns
|
|
919
|
+
*/
|
|
920
|
+
columns: {
|
|
921
|
+
type: Array,
|
|
922
|
+
default: () => []
|
|
923
|
+
},
|
|
924
|
+
/**
|
|
925
|
+
* 是否隐藏控制列
|
|
926
|
+
*/
|
|
927
|
+
disabled: Boolean,
|
|
928
|
+
/**
|
|
929
|
+
* 可否增加数据,默认true
|
|
930
|
+
*/
|
|
931
|
+
addable: {
|
|
932
|
+
type: Boolean,
|
|
933
|
+
default: !0
|
|
934
|
+
},
|
|
935
|
+
/**
|
|
936
|
+
* 控制列宽度,默认90px
|
|
937
|
+
*/
|
|
938
|
+
actionWidth: {
|
|
939
|
+
type: Number,
|
|
940
|
+
default: 90
|
|
941
|
+
},
|
|
942
|
+
/**
|
|
943
|
+
* 控制列水平对齐,默认居中
|
|
944
|
+
*/
|
|
945
|
+
actionAlign: {
|
|
946
|
+
type: String,
|
|
947
|
+
default: "center"
|
|
948
|
+
},
|
|
949
|
+
/**
|
|
950
|
+
* 控制列是否固定
|
|
951
|
+
*/
|
|
952
|
+
actionFixed: String,
|
|
953
|
+
/**
|
|
954
|
+
* 控制列表头文本
|
|
955
|
+
*/
|
|
956
|
+
actionText: String,
|
|
957
|
+
/**
|
|
958
|
+
* 右侧控制列
|
|
959
|
+
*/
|
|
960
|
+
actionCol: {
|
|
961
|
+
type: Object,
|
|
962
|
+
default(t) {
|
|
963
|
+
return {
|
|
964
|
+
// title: props.actionText,
|
|
965
|
+
key: "_action",
|
|
966
|
+
slot: "action",
|
|
967
|
+
width: t.actionWidth,
|
|
968
|
+
align: t.actionAlign,
|
|
969
|
+
fixed: t.actionFixed
|
|
970
|
+
};
|
|
971
|
+
}
|
|
972
|
+
},
|
|
973
|
+
/**
|
|
974
|
+
* 新增行时需要添加的数据
|
|
975
|
+
*/
|
|
976
|
+
addRow: {
|
|
977
|
+
type: Function,
|
|
978
|
+
default: () => []
|
|
979
|
+
},
|
|
980
|
+
border: Boolean,
|
|
981
|
+
size: String,
|
|
982
|
+
/**
|
|
983
|
+
* 返回Promise以决定何时新增数据
|
|
984
|
+
*/
|
|
985
|
+
beforeAdd: Function,
|
|
986
|
+
/**
|
|
987
|
+
* 返回Promise以决定何时删除数据
|
|
988
|
+
*/
|
|
989
|
+
beforeRemove: Function,
|
|
990
|
+
addBtnType: {
|
|
991
|
+
type: String,
|
|
992
|
+
default: "dashed"
|
|
993
|
+
},
|
|
994
|
+
addBtnSize: String,
|
|
995
|
+
addBtnGhost: {
|
|
996
|
+
type: Boolean,
|
|
997
|
+
default: !1
|
|
998
|
+
},
|
|
999
|
+
addBtnDisabled: {
|
|
1000
|
+
type: Boolean,
|
|
1001
|
+
default(t) {
|
|
1002
|
+
return !t.addable;
|
|
1003
|
+
}
|
|
1004
|
+
},
|
|
1005
|
+
addBtn: {
|
|
1006
|
+
type: Object,
|
|
1007
|
+
default: () => ({})
|
|
1008
|
+
},
|
|
1009
|
+
delBtnType: {
|
|
1010
|
+
type: String,
|
|
1011
|
+
default: "warning"
|
|
1012
|
+
},
|
|
1013
|
+
delBtnSize: {
|
|
1014
|
+
type: String,
|
|
1015
|
+
default: "small"
|
|
1016
|
+
},
|
|
1017
|
+
delBtnGhost: {
|
|
1018
|
+
type: Boolean,
|
|
1019
|
+
default: !0
|
|
1020
|
+
},
|
|
1021
|
+
delBtn: {
|
|
1022
|
+
type: Object,
|
|
1023
|
+
default: () => ({})
|
|
1024
|
+
},
|
|
1025
|
+
addText: String,
|
|
1026
|
+
/**
|
|
1027
|
+
* 是否隐藏每行的删除按钮,通过函数返回值决定
|
|
1028
|
+
*/
|
|
1029
|
+
hideDelBtn: Function,
|
|
1030
|
+
/**
|
|
1031
|
+
* 是否禁用每行删除按钮,通过函数返回值决定
|
|
1032
|
+
*/
|
|
1033
|
+
delBtnDisabled: {
|
|
1034
|
+
type: Function,
|
|
1035
|
+
default() {
|
|
1036
|
+
return !1;
|
|
1037
|
+
}
|
|
1038
|
+
}
|
|
1039
|
+
},
|
|
1040
|
+
emits: ["update:modelValue", "add", "remove", "change"],
|
|
1041
|
+
setup(t, { emit: S }) {
|
|
1042
|
+
const a = t, e = S, l = E(a.modelValue), i = N(
|
|
1043
|
+
() => a.disabled ? a.columns : a.columns.concat(
|
|
1044
|
+
Object.assign(
|
|
1045
|
+
{
|
|
1046
|
+
title: a.actionText ?? w.t("curdTable.actionText")
|
|
1047
|
+
},
|
|
1048
|
+
a.actionCol
|
|
1049
|
+
)
|
|
1050
|
+
)
|
|
1051
|
+
), u = N(() => {
|
|
1052
|
+
const d = [], T = (r) => {
|
|
1053
|
+
r.slot && d.push(r), r.children && r.children.forEach((y) => {
|
|
1054
|
+
T(y);
|
|
1055
|
+
});
|
|
1056
|
+
};
|
|
1057
|
+
return a.columns.forEach((r) => {
|
|
1058
|
+
T(r);
|
|
1059
|
+
}), d;
|
|
1060
|
+
});
|
|
1061
|
+
function p() {
|
|
1062
|
+
typeof a.beforeAdd != "function" ? c() : a.beforeAdd().then(c).catch();
|
|
1063
|
+
}
|
|
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);
|
|
1066
|
+
}
|
|
1067
|
+
function v(d) {
|
|
1068
|
+
typeof a.beforeRemove != "function" ? b(d) : a.beforeRemove(l.value[d], d).then(() => {
|
|
1069
|
+
b(d);
|
|
1070
|
+
});
|
|
1071
|
+
}
|
|
1072
|
+
function b(d) {
|
|
1073
|
+
const [T] = l.value.splice(d, 1);
|
|
1074
|
+
e("update:modelValue", l.value), e("remove", T), e("change", !1);
|
|
1075
|
+
}
|
|
1076
|
+
return I(
|
|
1077
|
+
() => a.modelValue,
|
|
1078
|
+
(d) => {
|
|
1079
|
+
l.value = d;
|
|
1080
|
+
}
|
|
1081
|
+
), (d, T) => (D(), j("div", null, [
|
|
1082
|
+
$(o(je), U(o(Ne)(d.$attrs, ["id", "class", "style"]), {
|
|
1083
|
+
border: t.border,
|
|
1084
|
+
columns: i.value,
|
|
1085
|
+
data: l.value,
|
|
1086
|
+
size: t.size,
|
|
1087
|
+
style: { "z-index": "0" }
|
|
1088
|
+
}), Fe({
|
|
1089
|
+
action: C(({ row: r, index: y }) => [
|
|
1090
|
+
M(d.$slots, "moreAction", {
|
|
1091
|
+
row: r,
|
|
1092
|
+
index: y
|
|
1093
|
+
}),
|
|
1094
|
+
!t.hideDelBtn || !t.hideDelBtn(r, y) ? (D(), L(o(Z), U({
|
|
1095
|
+
key: 0,
|
|
1096
|
+
type: t.delBtnType,
|
|
1097
|
+
size: t.delBtnSize,
|
|
1098
|
+
ghost: t.delBtnGhost
|
|
1099
|
+
}, t.delBtn, {
|
|
1100
|
+
disabled: t.delBtnDisabled(r, y),
|
|
1101
|
+
onClick: (B) => v(y)
|
|
1102
|
+
}), {
|
|
1103
|
+
default: C(() => [
|
|
1104
|
+
H(z(o(w).t("curdTable.del")), 1)
|
|
1105
|
+
]),
|
|
1106
|
+
_: 1
|
|
1107
|
+
}, 16, ["type", "size", "ghost", "disabled", "onClick"])) : q("", !0)
|
|
1108
|
+
]),
|
|
1109
|
+
_: 2
|
|
1110
|
+
}, [
|
|
1111
|
+
_(u.value, (r) => ({
|
|
1112
|
+
name: r.slot,
|
|
1113
|
+
fn: C((y) => [
|
|
1114
|
+
M(d.$slots, r.slot, Be(Ve(y)))
|
|
1115
|
+
])
|
|
1116
|
+
}))
|
|
1117
|
+
]), 1040, ["border", "columns", "data", "size"]),
|
|
1118
|
+
t.disabled ? q("", !0) : te((D(), L(o(Z), U({
|
|
1119
|
+
key: 0,
|
|
1120
|
+
type: t.addBtnType,
|
|
1121
|
+
size: t.addBtnSize,
|
|
1122
|
+
ghost: t.addBtnGhost,
|
|
1123
|
+
disabled: t.addBtnDisabled
|
|
1124
|
+
}, t.addBtn, {
|
|
1125
|
+
long: "",
|
|
1126
|
+
icon: "md-add",
|
|
1127
|
+
style: { display: "block", position: "relative", "margin-top": "-1px" },
|
|
1128
|
+
onClick: p
|
|
1129
|
+
}), {
|
|
1130
|
+
default: C(() => [
|
|
1131
|
+
H(z(t.addText ?? o(w).t("curdTable.addText")), 1)
|
|
1132
|
+
]),
|
|
1133
|
+
_: 1
|
|
1134
|
+
}, 16, ["type", "size", "ghost", "disabled"])), [
|
|
1135
|
+
[ue, t.addable]
|
|
1136
|
+
])
|
|
1137
|
+
]));
|
|
1158
1138
|
}
|
|
1159
|
-
}),
|
|
1139
|
+
}), At = {
|
|
1160
1140
|
name: "MCalendar"
|
|
1161
|
-
},
|
|
1162
|
-
...
|
|
1141
|
+
}, Rt = /* @__PURE__ */ Y({
|
|
1142
|
+
...At,
|
|
1163
1143
|
props: {
|
|
1164
1144
|
/**
|
|
1165
1145
|
* 指定日期,默认显示该日期所在月份
|
|
@@ -1265,193 +1245,190 @@ const M = {
|
|
|
1265
1245
|
}
|
|
1266
1246
|
},
|
|
1267
1247
|
emits: ["update:range", "select-range", "click-day", "dblclick-day"],
|
|
1268
|
-
setup(t, { emit:
|
|
1269
|
-
const a =
|
|
1270
|
-
let
|
|
1271
|
-
return (isNaN(
|
|
1272
|
-
}),
|
|
1273
|
-
let
|
|
1274
|
-
const
|
|
1275
|
-
for (let
|
|
1276
|
-
|
|
1277
|
-
title: e.weekMap?.[
|
|
1278
|
-
order:
|
|
1248
|
+
setup(t, { emit: S }) {
|
|
1249
|
+
const a = me().appContext.config.globalProperties.$Date, e = t, l = S, i = E(), u = E(null), p = E(null), c = N(() => {
|
|
1250
|
+
let f = Math.floor(e.startDay);
|
|
1251
|
+
return (isNaN(f) || f < 0 || f > 6) && (f = 0), f;
|
|
1252
|
+
}), v = N(() => {
|
|
1253
|
+
let f;
|
|
1254
|
+
const V = [], s = c.value + 7;
|
|
1255
|
+
for (let k = c.value; k < s; k++)
|
|
1256
|
+
f = k % 7, V.push({
|
|
1257
|
+
title: e.weekMap?.[f] || w.t(`mCalendar.${e.weekType}.${f}`),
|
|
1258
|
+
order: f
|
|
1279
1259
|
});
|
|
1280
|
-
return
|
|
1281
|
-
}),
|
|
1282
|
-
let
|
|
1260
|
+
return V;
|
|
1261
|
+
}), b = (f) => {
|
|
1262
|
+
let V = a(
|
|
1283
1263
|
e.date || e.dates && e.dates[0] && e.dates[0][e.dateKey]
|
|
1284
|
-
),
|
|
1285
|
-
return e.isOnFirstLine ?
|
|
1286
|
-
beginDate:
|
|
1287
|
-
endDate:
|
|
1288
|
-
extra: [
|
|
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")), {
|
|
1266
|
+
beginDate: V.format("YYYY-MM-DD"),
|
|
1267
|
+
endDate: k?.format("YYYY-MM-DD"),
|
|
1268
|
+
extra: [V, e.isOnFirstLine ? V : s, k]
|
|
1289
1269
|
};
|
|
1290
|
-
},
|
|
1291
|
-
e.hasRange && (
|
|
1270
|
+
}, d = () => {
|
|
1271
|
+
e.hasRange && (u.value = p.value = null);
|
|
1292
1272
|
const {
|
|
1293
|
-
extra: [
|
|
1294
|
-
} =
|
|
1295
|
-
let
|
|
1296
|
-
for (
|
|
1297
|
-
|
|
1298
|
-
_date:
|
|
1299
|
-
_text:
|
|
1300
|
-
_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"),
|
|
1301
1281
|
//!eachDay.isBetween(start, end, 'day', '[]'),
|
|
1302
|
-
_isToday:
|
|
1282
|
+
_isToday: x.isSame(h, "day"),
|
|
1303
1283
|
// _rangeStart: undefined,
|
|
1304
1284
|
// _rangeEnd: undefined,
|
|
1305
1285
|
_inRange: void 0,
|
|
1306
1286
|
...K
|
|
1307
1287
|
});
|
|
1308
1288
|
};
|
|
1309
|
-
let
|
|
1310
|
-
const
|
|
1311
|
-
const
|
|
1312
|
-
if (
|
|
1313
|
-
if (!
|
|
1314
|
-
|
|
1315
|
-
else if (
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
}), e.clearable || (
|
|
1289
|
+
let T;
|
|
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) => {
|
|
1297
|
+
k._inRange = !1;
|
|
1298
|
+
}), e.clearable || (u.value = f);
|
|
1319
1299
|
else {
|
|
1320
|
-
if (
|
|
1321
|
-
const
|
|
1322
|
-
|
|
1300
|
+
if (f._date < u.value._date) {
|
|
1301
|
+
const k = u.value;
|
|
1302
|
+
u.value = f, f = k;
|
|
1323
1303
|
}
|
|
1324
|
-
|
|
1304
|
+
p.value = f, f._inRange = !0;
|
|
1325
1305
|
}
|
|
1326
|
-
l("click-day",
|
|
1327
|
-
|
|
1328
|
-
}), l("update:range", [
|
|
1306
|
+
l("click-day", f, V), s && (T = !0, G(() => {
|
|
1307
|
+
T = null;
|
|
1308
|
+
}), l("update:range", [u.value, p.value]), l(
|
|
1329
1309
|
"select-range",
|
|
1330
|
-
[
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1310
|
+
[u.value, p.value],
|
|
1311
|
+
i.value.slice(
|
|
1312
|
+
i.value.indexOf(u.value),
|
|
1313
|
+
i.value.indexOf(p.value) + 1
|
|
1334
1314
|
)
|
|
1335
1315
|
));
|
|
1336
|
-
},
|
|
1337
|
-
l("dblclick-day",
|
|
1338
|
-
},
|
|
1339
|
-
if (!e.hasRange || !
|
|
1316
|
+
}, y = (f, V) => {
|
|
1317
|
+
l("dblclick-day", f, V);
|
|
1318
|
+
}, B = (f, V) => {
|
|
1319
|
+
if (!e.hasRange || !u.value || p.value || f._isOuter && !e.outerInRange)
|
|
1340
1320
|
return;
|
|
1341
|
-
let
|
|
1342
|
-
if (
|
|
1343
|
-
const
|
|
1344
|
-
|
|
1321
|
+
let s = i.value.indexOf(u.value);
|
|
1322
|
+
if (V < s) {
|
|
1323
|
+
const k = s;
|
|
1324
|
+
s = V, V = k;
|
|
1345
1325
|
}
|
|
1346
|
-
|
|
1347
|
-
|
|
1326
|
+
i.value.forEach((k, h) => {
|
|
1327
|
+
k._inRange = h >= s && h <= V;
|
|
1348
1328
|
});
|
|
1349
|
-
},
|
|
1350
|
-
if (!e.hasRange ||
|
|
1351
|
-
if (!
|
|
1352
|
-
|
|
1353
|
-
|
|
1329
|
+
}, P = (f) => {
|
|
1330
|
+
if (!e.hasRange || T) return;
|
|
1331
|
+
if (!f || !f.length) {
|
|
1332
|
+
u.value = p.value = null, i.value.forEach((n) => {
|
|
1333
|
+
n._inRange = !1;
|
|
1354
1334
|
});
|
|
1355
1335
|
return;
|
|
1356
1336
|
}
|
|
1357
|
-
if (!
|
|
1358
|
-
if (a(
|
|
1359
|
-
const
|
|
1360
|
-
|
|
1337
|
+
if (!f[0] || !f[1]) return;
|
|
1338
|
+
if (a(f[0]._date).isAfter(f[1]._date)) {
|
|
1339
|
+
const n = f[1];
|
|
1340
|
+
f[1] = f[0], f[0] = n;
|
|
1361
1341
|
}
|
|
1362
|
-
const
|
|
1363
|
-
let
|
|
1364
|
-
for (let
|
|
1365
|
-
if (
|
|
1366
|
-
|
|
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;
|
|
1367
1347
|
break;
|
|
1368
1348
|
}
|
|
1369
|
-
|
|
1370
|
-
|
|
1349
|
+
i.value.forEach((n, x) => {
|
|
1350
|
+
n._inRange = x >= k && x <= h;
|
|
1371
1351
|
});
|
|
1372
1352
|
};
|
|
1373
|
-
return
|
|
1353
|
+
return d(), e.range && (u.value = e.range[0], p.value = e.range[1], P(e.range)), I(
|
|
1374
1354
|
() => e.date,
|
|
1375
|
-
(
|
|
1376
|
-
!e.dates &&
|
|
1355
|
+
(f) => {
|
|
1356
|
+
!e.dates && f instanceof Date && d();
|
|
1377
1357
|
}
|
|
1378
|
-
),
|
|
1358
|
+
), I(
|
|
1379
1359
|
() => e.dates,
|
|
1380
|
-
(
|
|
1381
|
-
|
|
1360
|
+
(f) => {
|
|
1361
|
+
f && d();
|
|
1382
1362
|
}
|
|
1383
|
-
),
|
|
1363
|
+
), I(
|
|
1384
1364
|
() => e.startDay,
|
|
1385
1365
|
() => {
|
|
1386
|
-
|
|
1366
|
+
d();
|
|
1387
1367
|
}
|
|
1388
|
-
),
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1368
|
+
), I(() => e.range, P), (f, V) => (D(), j("div", {
|
|
1369
|
+
class: F(o(R)("mcalendar"))
|
|
1370
|
+
}, [
|
|
1371
|
+
$(o(ge), null, {
|
|
1372
|
+
default: C(() => [
|
|
1373
|
+
(D(!0), j(X, null, _(v.value, (s, k) => (D(), L(o(ie), {
|
|
1374
|
+
key: k,
|
|
1375
|
+
span: "4",
|
|
1376
|
+
class: F([
|
|
1377
|
+
o(R)("mcalendar-title"),
|
|
1378
|
+
{ weekend: t.offDay.includes(s.order) },
|
|
1379
|
+
t.titleClass && t.titleClass(s, k)
|
|
1380
|
+
])
|
|
1381
|
+
}, {
|
|
1382
|
+
default: C(() => [
|
|
1383
|
+
H(z(s.title), 1)
|
|
1384
|
+
]),
|
|
1385
|
+
_: 2
|
|
1386
|
+
}, 1032, ["class"]))), 128))
|
|
1387
|
+
]),
|
|
1388
|
+
_: 1
|
|
1389
|
+
}),
|
|
1390
|
+
$(o(ge), null, {
|
|
1391
|
+
default: C(() => [
|
|
1392
|
+
(D(!0), j(X, null, _(i.value, (s, k) => (D(), L(o(ie), {
|
|
1393
|
+
key: k,
|
|
1394
|
+
span: "4",
|
|
1395
|
+
class: F([
|
|
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
|
|
1404
|
+
]),
|
|
1405
|
+
onClick: (h) => r(s, k),
|
|
1406
|
+
onDblclick: (h) => y(s, k),
|
|
1407
|
+
onMouseenter: (h) => B(s, k)
|
|
1408
|
+
}, {
|
|
1409
|
+
default: C(() => [
|
|
1410
|
+
M(f.$slots, "cell", {
|
|
1411
|
+
day: s,
|
|
1412
|
+
index: k
|
|
1413
|
+
}, () => [
|
|
1414
|
+
H(z(s._text), 1)
|
|
1402
1415
|
])
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
default: D(() => [
|
|
1414
|
-
($(!0), N(Q, null, ee(n.value, (o, V) => ($(), U(r, {
|
|
1415
|
-
key: V,
|
|
1416
|
-
span: "4",
|
|
1417
|
-
class: P([
|
|
1418
|
-
y(I)("mcalendar-cell"),
|
|
1419
|
-
o._isToday && y(I)("mcalendar-cell_today"),
|
|
1420
|
-
{ outer: o._isOuter },
|
|
1421
|
-
{ "range-start": o === i.value },
|
|
1422
|
-
{ "in-range": o._inRange },
|
|
1423
|
-
{ "range-end": o === g.value },
|
|
1424
|
-
t.dateClass && t.dateClass(o, V),
|
|
1425
|
-
o.className
|
|
1426
|
-
]),
|
|
1427
|
-
onClick: (K) => s(o, V),
|
|
1428
|
-
onDblclick: (K) => b(o, V),
|
|
1429
|
-
onMouseenter: (K) => C(o, V)
|
|
1430
|
-
}, {
|
|
1431
|
-
default: D(() => [
|
|
1432
|
-
z(c.$slots, "cell", {
|
|
1433
|
-
day: o,
|
|
1434
|
-
index: V
|
|
1435
|
-
}, () => [
|
|
1436
|
-
j(H(o._text), 1)
|
|
1437
|
-
])
|
|
1438
|
-
]),
|
|
1439
|
-
_: 2
|
|
1440
|
-
}, 1032, ["class", "onClick", "onDblclick", "onMouseenter"]))), 128))
|
|
1441
|
-
]),
|
|
1442
|
-
_: 3
|
|
1443
|
-
}),
|
|
1444
|
-
ae(O(h, { fix: "" }, null, 512), [
|
|
1445
|
-
[ue, t.loading]
|
|
1446
|
-
])
|
|
1447
|
-
], 2);
|
|
1448
|
-
};
|
|
1416
|
+
]),
|
|
1417
|
+
_: 2
|
|
1418
|
+
}, 1032, ["class", "onClick", "onDblclick", "onMouseenter"]))), 128))
|
|
1419
|
+
]),
|
|
1420
|
+
_: 3
|
|
1421
|
+
}),
|
|
1422
|
+
te($(o(tt), { fix: "" }, null, 512), [
|
|
1423
|
+
[ue, t.loading]
|
|
1424
|
+
])
|
|
1425
|
+
], 2));
|
|
1449
1426
|
}
|
|
1450
|
-
}),
|
|
1451
|
-
name: "ModalFooter"
|
|
1452
|
-
inheritAttrs:
|
|
1453
|
-
},
|
|
1454
|
-
...
|
|
1427
|
+
}), wt = {
|
|
1428
|
+
name: "ModalFooter"
|
|
1429
|
+
// inheritAttrs: false
|
|
1430
|
+
}, Mt = /* @__PURE__ */ Y({
|
|
1431
|
+
...wt,
|
|
1455
1432
|
props: {
|
|
1456
1433
|
modelValue: Boolean,
|
|
1457
1434
|
/**
|
|
@@ -1506,90 +1483,87 @@ const M = {
|
|
|
1506
1483
|
}
|
|
1507
1484
|
},
|
|
1508
1485
|
emits: ["update:modelValue", "ok", "cancel"],
|
|
1509
|
-
setup(t, { emit:
|
|
1510
|
-
const a =
|
|
1486
|
+
setup(t, { emit: S }) {
|
|
1487
|
+
const a = S, e = me(), l = () => {
|
|
1511
1488
|
e.vnode.props.onCancel ? a("cancel") : a("update:modelValue", !1);
|
|
1512
1489
|
};
|
|
1513
|
-
return (
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
t.
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
t.
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
_: 3
|
|
1583
|
-
});
|
|
1584
|
-
};
|
|
1490
|
+
return (i, u) => (D(), L(o(ge), {
|
|
1491
|
+
justify: "space-between",
|
|
1492
|
+
align: "middle"
|
|
1493
|
+
}, {
|
|
1494
|
+
default: C(() => [
|
|
1495
|
+
$(o(ie), null, {
|
|
1496
|
+
default: C(() => [
|
|
1497
|
+
M(i.$slots, "other")
|
|
1498
|
+
]),
|
|
1499
|
+
_: 3
|
|
1500
|
+
}),
|
|
1501
|
+
$(o(ie), null, {
|
|
1502
|
+
default: C(() => [
|
|
1503
|
+
t.rightCancel ? (D(), j(X, { key: 1 }, [
|
|
1504
|
+
t.hasOk ? (D(), L(o(Z), U({
|
|
1505
|
+
key: 0,
|
|
1506
|
+
disabled: t.okDisabled,
|
|
1507
|
+
loading: t.okLoading
|
|
1508
|
+
}, t.ok, {
|
|
1509
|
+
type: "primary",
|
|
1510
|
+
onClick: u[1] || (u[1] = (p) => i.$emit("ok"))
|
|
1511
|
+
}), {
|
|
1512
|
+
default: C(() => [
|
|
1513
|
+
H(z(t.okText ?? o(w).t("modalFooter.ok")), 1)
|
|
1514
|
+
]),
|
|
1515
|
+
_: 1
|
|
1516
|
+
}, 16, ["disabled", "loading"])) : q("", !0),
|
|
1517
|
+
$(o(Z), U({
|
|
1518
|
+
disabled: t.cancelDisabled,
|
|
1519
|
+
loading: t.cancelLoading,
|
|
1520
|
+
type: t.cancelType
|
|
1521
|
+
}, t.cancel, { onClick: l }), {
|
|
1522
|
+
default: C(() => [
|
|
1523
|
+
H(z(t.cancelText ?? o(w).t("modalFooter.cancel")), 1)
|
|
1524
|
+
]),
|
|
1525
|
+
_: 1
|
|
1526
|
+
}, 16, ["disabled", "loading", "type"])
|
|
1527
|
+
], 64)) : (D(), j(X, { key: 0 }, [
|
|
1528
|
+
$(o(Z), U({
|
|
1529
|
+
disabled: t.cancelDisabled,
|
|
1530
|
+
loading: t.cancelLoading,
|
|
1531
|
+
type: t.cancelType
|
|
1532
|
+
}, t.cancel, { onClick: l }), {
|
|
1533
|
+
default: C(() => [
|
|
1534
|
+
H(z(t.cancelText ?? o(w).t("modalFooter.cancel")), 1)
|
|
1535
|
+
]),
|
|
1536
|
+
_: 1
|
|
1537
|
+
}, 16, ["disabled", "loading", "type"]),
|
|
1538
|
+
t.hasOk ? (D(), L(o(Z), U({
|
|
1539
|
+
key: 0,
|
|
1540
|
+
disabled: t.okDisabled,
|
|
1541
|
+
loading: t.okLoading
|
|
1542
|
+
}, t.ok, {
|
|
1543
|
+
type: "primary",
|
|
1544
|
+
onClick: u[0] || (u[0] = (p) => i.$emit("ok"))
|
|
1545
|
+
}), {
|
|
1546
|
+
default: C(() => [
|
|
1547
|
+
H(z(t.okText ?? o(w).t("modalFooter.ok")), 1)
|
|
1548
|
+
]),
|
|
1549
|
+
_: 1
|
|
1550
|
+
}, 16, ["disabled", "loading"])) : q("", !0)
|
|
1551
|
+
], 64)),
|
|
1552
|
+
M(i.$slots, "action")
|
|
1553
|
+
]),
|
|
1554
|
+
_: 3
|
|
1555
|
+
})
|
|
1556
|
+
]),
|
|
1557
|
+
_: 3
|
|
1558
|
+
}));
|
|
1585
1559
|
}
|
|
1586
|
-
}),
|
|
1560
|
+
}), It = {
|
|
1587
1561
|
key: 0,
|
|
1588
1562
|
class: "ivu-dropdown-item"
|
|
1589
|
-
}, J = {},
|
|
1563
|
+
}, J = {}, zt = {
|
|
1590
1564
|
name: "ToggleColumn"
|
|
1591
|
-
},
|
|
1592
|
-
...
|
|
1565
|
+
}, Le = /* @__PURE__ */ Y({
|
|
1566
|
+
...zt,
|
|
1593
1567
|
props: {
|
|
1594
1568
|
modelValue: {
|
|
1595
1569
|
type: Array
|
|
@@ -1617,175 +1591,212 @@ const M = {
|
|
|
1617
1591
|
* @example
|
|
1618
1592
|
* // 组件会尝试将显示状态读写至 localStorage.app.main.cols
|
|
1619
1593
|
* storeAt='app.main.cols'
|
|
1594
|
+
*
|
|
1595
|
+
* 特殊情况:如读写至 localStorage.app.page1['part1.list'].cols
|
|
1596
|
+
* storeAt='app.page1.[part1.list].cols'
|
|
1620
1597
|
*/
|
|
1621
|
-
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
|
+
}
|
|
1622
1621
|
},
|
|
1623
1622
|
emits: ["update:modelValue", "change"],
|
|
1624
|
-
setup(t, { emit:
|
|
1625
|
-
const a = t, e =
|
|
1626
|
-
let l,
|
|
1627
|
-
const
|
|
1623
|
+
setup(t, { emit: S }) {
|
|
1624
|
+
const a = t, e = S;
|
|
1625
|
+
let l, i, u;
|
|
1626
|
+
const p = (h) => {
|
|
1628
1627
|
clearTimeout(l);
|
|
1629
|
-
let
|
|
1630
|
-
|
|
1631
|
-
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));
|
|
1632
1631
|
});
|
|
1633
1632
|
};
|
|
1634
|
-
let
|
|
1635
|
-
a.storeAt && (
|
|
1636
|
-
const
|
|
1637
|
-
const h =
|
|
1638
|
-
return h.some((
|
|
1639
|
-
}),
|
|
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({
|
|
1640
1639
|
get() {
|
|
1641
|
-
const h =
|
|
1642
|
-
return h.length > 0 && h.every((
|
|
1640
|
+
const h = d.value.filter((n) => n._switchable);
|
|
1641
|
+
return h.length > 0 && h.every((n) => n._visible);
|
|
1643
1642
|
},
|
|
1644
1643
|
set(h) {
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
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);
|
|
1650
1662
|
}
|
|
1651
1663
|
});
|
|
1652
|
-
function
|
|
1653
|
-
const h =
|
|
1654
|
-
if (
|
|
1655
|
-
h
|
|
1664
|
+
function y() {
|
|
1665
|
+
const h = d.value.filter((n) => n._visible);
|
|
1666
|
+
if (h.length <= a.minVisible) {
|
|
1667
|
+
h.forEach((n) => {
|
|
1668
|
+
n._switchable = !1;
|
|
1669
|
+
});
|
|
1656
1670
|
return;
|
|
1657
1671
|
}
|
|
1658
|
-
h.forEach((
|
|
1659
|
-
|
|
1672
|
+
h.forEach((n) => {
|
|
1673
|
+
n.initSwitchable && !n._switchable && (n._switchable = !0);
|
|
1660
1674
|
});
|
|
1661
1675
|
}
|
|
1662
|
-
function
|
|
1663
|
-
|
|
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]);
|
|
1664
1678
|
}
|
|
1665
|
-
let
|
|
1666
|
-
function
|
|
1667
|
-
clearTimeout(
|
|
1668
|
-
|
|
1679
|
+
let P;
|
|
1680
|
+
function f(h) {
|
|
1681
|
+
clearTimeout(P), P = setTimeout(() => {
|
|
1682
|
+
v.value = h, P = null;
|
|
1669
1683
|
}, 200);
|
|
1670
1684
|
}
|
|
1671
|
-
function
|
|
1672
|
-
(J[a.cacheId]?.cols || a.modelValue).forEach((
|
|
1673
|
-
|
|
1674
|
-
title:
|
|
1675
|
-
key:
|
|
1676
|
-
initSwitchable:
|
|
1677
|
-
_switchable:
|
|
1678
|
-
_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
|
|
1679
1693
|
});
|
|
1680
|
-
}),
|
|
1694
|
+
}), y(), k();
|
|
1681
1695
|
}
|
|
1682
|
-
let
|
|
1683
|
-
function
|
|
1696
|
+
let s;
|
|
1697
|
+
function k() {
|
|
1684
1698
|
a.cacheId != null && (J[a.cacheId].flag = !0, setTimeout(() => {
|
|
1685
1699
|
J[a.cacheId].flag = null;
|
|
1686
|
-
})),
|
|
1687
|
-
|
|
1700
|
+
})), s = !0, setTimeout(() => {
|
|
1701
|
+
s = null;
|
|
1688
1702
|
}), e(
|
|
1689
1703
|
"update:modelValue",
|
|
1690
|
-
|
|
1704
|
+
b.value.filter((h) => h._visible)
|
|
1691
1705
|
);
|
|
1692
1706
|
}
|
|
1693
|
-
return
|
|
1694
|
-
a.cacheId != null && (J[a.cacheId] ? J[a.cacheId].all++ : J[a.cacheId] = { cols: a.modelValue, all: 1 },
|
|
1707
|
+
return de(() => {
|
|
1708
|
+
a.cacheId != null && (J[a.cacheId] ? J[a.cacheId].all++ : J[a.cacheId] = { cols: a.modelValue, all: 1 }, He(() => {
|
|
1695
1709
|
J[a.cacheId] && --J[a.cacheId].all < 1 && delete J[a.cacheId];
|
|
1696
|
-
})),
|
|
1697
|
-
}),
|
|
1710
|
+
})), V(!0);
|
|
1711
|
+
}), I(
|
|
1698
1712
|
() => a.modelValue,
|
|
1699
1713
|
(h) => {
|
|
1700
|
-
|
|
1714
|
+
s || (J[a.cacheId] && !J[a.cacheId].flag && (J[a.cacheId].cols = h), b.value = [], d.value = [], V());
|
|
1701
1715
|
}
|
|
1702
|
-
), (h,
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
"onUpdate:modelValue": o[2] || (o[2] = (Y) => s.value = Y),
|
|
1721
|
-
indeterminate: x.value
|
|
1722
|
-
}, {
|
|
1723
|
-
default: D(() => [
|
|
1724
|
-
j(H(y(M).t("toggleColumn.checkAll")), 1)
|
|
1725
|
-
]),
|
|
1726
|
-
_: 1
|
|
1727
|
-
}, 8, ["modelValue", "indeterminate"])
|
|
1728
|
-
])) : W("", !0),
|
|
1729
|
-
O(fe, {
|
|
1730
|
-
class: P(y(I)("toggle-column-list"))
|
|
1716
|
+
), (h, n) => (D(), L(o(at), {
|
|
1717
|
+
trigger: "custom",
|
|
1718
|
+
visible: v.value,
|
|
1719
|
+
placement: "bottom-end",
|
|
1720
|
+
transfer: t.transfer,
|
|
1721
|
+
"transfer-class-name": o(R)("toggle-column-pop"),
|
|
1722
|
+
class: F(o(R)("toggle-column"))
|
|
1723
|
+
}, {
|
|
1724
|
+
list: C(() => [
|
|
1725
|
+
ee("div", {
|
|
1726
|
+
onMouseenter: n[3] || (n[3] = (x) => f(!0)),
|
|
1727
|
+
onMouseleave: n[4] || (n[4] = (x) => f(!1))
|
|
1728
|
+
}, [
|
|
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),
|
|
1733
|
+
indeterminate: T.value
|
|
1731
1734
|
}, {
|
|
1732
|
-
default:
|
|
1733
|
-
(
|
|
1734
|
-
key: de,
|
|
1735
|
-
disabled: !Y._switchable
|
|
1736
|
-
}, {
|
|
1737
|
-
default: D(() => [
|
|
1738
|
-
O(le, {
|
|
1739
|
-
modelValue: Y._visible,
|
|
1740
|
-
"onUpdate:modelValue": (ce) => Y._visible = ce,
|
|
1741
|
-
disabled: !Y._switchable,
|
|
1742
|
-
onOnChange: (ce) => C(Y, de)
|
|
1743
|
-
}, {
|
|
1744
|
-
default: D(() => [
|
|
1745
|
-
j(H(Y.title), 1)
|
|
1746
|
-
]),
|
|
1747
|
-
_: 2
|
|
1748
|
-
}, 1032, ["modelValue", "onUpdate:modelValue", "disabled", "onOnChange"])
|
|
1749
|
-
]),
|
|
1750
|
-
_: 2
|
|
1751
|
-
}, 1032, ["disabled"]))), 128))
|
|
1735
|
+
default: C(() => [
|
|
1736
|
+
H(z(o(w).t("toggleColumn.checkAll")), 1)
|
|
1752
1737
|
]),
|
|
1753
1738
|
_: 1
|
|
1754
|
-
}, 8, ["
|
|
1755
|
-
],
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
z(h.$slots, "default", {}, () => [
|
|
1764
|
-
O(K, {
|
|
1765
|
-
type: "default",
|
|
1766
|
-
icon: t.icon
|
|
1739
|
+
}, 8, ["modelValue", "indeterminate"])
|
|
1740
|
+
])) : q("", !0),
|
|
1741
|
+
$(o(lt), {
|
|
1742
|
+
class: F(o(R)("toggle-column-list"))
|
|
1743
|
+
}, {
|
|
1744
|
+
default: C(() => [
|
|
1745
|
+
(D(!0), j(X, null, _(d.value, (x, K) => (D(), L(o(nt), {
|
|
1746
|
+
key: K,
|
|
1747
|
+
disabled: !x._switchable
|
|
1767
1748
|
}, {
|
|
1768
|
-
default:
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1749
|
+
default: C(() => [
|
|
1750
|
+
$(o(oe), {
|
|
1751
|
+
modelValue: x._visible,
|
|
1752
|
+
"onUpdate:modelValue": (W) => x._visible = W,
|
|
1753
|
+
disabled: !x._switchable,
|
|
1754
|
+
onOnChange: (W) => B(x, K)
|
|
1755
|
+
}, {
|
|
1756
|
+
default: C(() => [
|
|
1757
|
+
H(z(x.title), 1)
|
|
1758
|
+
]),
|
|
1759
|
+
_: 2
|
|
1760
|
+
}, 1032, ["modelValue", "onUpdate:modelValue", "disabled", "onOnChange"])
|
|
1773
1761
|
]),
|
|
1774
|
-
_:
|
|
1775
|
-
},
|
|
1776
|
-
])
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1762
|
+
_: 2
|
|
1763
|
+
}, 1032, ["disabled"]))), 128))
|
|
1764
|
+
]),
|
|
1765
|
+
_: 1
|
|
1766
|
+
}, 8, ["class"])
|
|
1767
|
+
], 32)
|
|
1768
|
+
]),
|
|
1769
|
+
default: C(() => [
|
|
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"))
|
|
1774
|
+
}, [
|
|
1775
|
+
M(h.$slots, "default", {}, () => [
|
|
1776
|
+
$(o(Z), {
|
|
1777
|
+
type: "default",
|
|
1778
|
+
icon: t.icon
|
|
1779
|
+
}, {
|
|
1780
|
+
default: C(() => [
|
|
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" })
|
|
1784
|
+
], 64))
|
|
1785
|
+
]),
|
|
1786
|
+
_: 1
|
|
1787
|
+
}, 8, ["icon"])
|
|
1788
|
+
])
|
|
1789
|
+
], 34)
|
|
1790
|
+
]),
|
|
1791
|
+
_: 3
|
|
1792
|
+
}, 8, ["visible", "transfer", "transfer-class-name", "class"]));
|
|
1782
1793
|
}
|
|
1783
|
-
}),
|
|
1794
|
+
}), Ft = {
|
|
1784
1795
|
name: "PageTable"
|
|
1785
1796
|
// inheritAttrs: false
|
|
1786
|
-
},
|
|
1787
|
-
...
|
|
1788
|
-
props: /* @__PURE__ */
|
|
1797
|
+
}, Ht = /* @__PURE__ */ Y({
|
|
1798
|
+
...Ft,
|
|
1799
|
+
props: /* @__PURE__ */ Ae({
|
|
1789
1800
|
columns: {
|
|
1790
1801
|
type: Array,
|
|
1791
1802
|
default: () => []
|
|
@@ -1957,14 +1968,14 @@ const M = {
|
|
|
1957
1968
|
},
|
|
1958
1969
|
loadingModifiers: {}
|
|
1959
1970
|
}),
|
|
1960
|
-
emits: /* @__PURE__ */
|
|
1971
|
+
emits: /* @__PURE__ */ Ae(["update:modelValue", "update:selection", "load", "select-all", "selection-change", "select", "reload", "change-col", "maximize-change"], ["update:loading"]),
|
|
1961
1972
|
setup(t, {
|
|
1962
|
-
expose:
|
|
1973
|
+
expose: S,
|
|
1963
1974
|
emit: a
|
|
1964
1975
|
}) {
|
|
1965
1976
|
const e = t, l = a;
|
|
1966
|
-
let
|
|
1967
|
-
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({
|
|
1968
1979
|
data: [],
|
|
1969
1980
|
// rows: [] as Obj[],
|
|
1970
1981
|
// selections: [],
|
|
@@ -1973,352 +1984,350 @@ const M = {
|
|
|
1973
1984
|
maxHeight: e.maxHeight,
|
|
1974
1985
|
selectType: {
|
|
1975
1986
|
align: "center",
|
|
1976
|
-
className:
|
|
1977
|
-
renderHeader: (
|
|
1978
|
-
const
|
|
1987
|
+
className: R("page-table-mr0"),
|
|
1988
|
+
renderHeader: (g) => {
|
|
1989
|
+
const m = r.data.filter((A) => A._checkable && !A._disabled), O = m.length;
|
|
1979
1990
|
return (
|
|
1980
1991
|
// table.rows.some((e) => e._checkable) && (
|
|
1981
|
-
|
|
1982
|
-
"model-value": !!
|
|
1983
|
-
disabled: !
|
|
1984
|
-
"onUpdate:model-value": (
|
|
1985
|
-
|
|
1986
|
-
|
|
1992
|
+
r.data.some((A) => A._checkable) && $(oe, {
|
|
1993
|
+
"model-value": !!O && m.every((A) => A._checked),
|
|
1994
|
+
disabled: !O,
|
|
1995
|
+
"onUpdate:model-value": (A) => {
|
|
1996
|
+
m.forEach((se) => {
|
|
1997
|
+
se._checked = A;
|
|
1987
1998
|
});
|
|
1988
1999
|
},
|
|
1989
|
-
onOnChange: (
|
|
1990
|
-
|
|
2000
|
+
onOnChange: (A) => {
|
|
2001
|
+
he(), l("select-all", e.pure ? m.map((se) => re(se)) : m, A);
|
|
1991
2002
|
}
|
|
1992
2003
|
}, null)
|
|
1993
2004
|
);
|
|
1994
2005
|
},
|
|
1995
|
-
render: (
|
|
1996
|
-
row:
|
|
1997
|
-
index:
|
|
1998
|
-
}) =>
|
|
1999
|
-
"model-value":
|
|
2000
|
-
disabled:
|
|
2001
|
-
"onUpdate:model-value": (
|
|
2002
|
-
|
|
2006
|
+
render: (g, {
|
|
2007
|
+
row: m,
|
|
2008
|
+
index: O
|
|
2009
|
+
}) => m._checkable && $(oe, {
|
|
2010
|
+
"model-value": m._checked,
|
|
2011
|
+
disabled: m._disabled,
|
|
2012
|
+
"onUpdate:model-value": (A) => {
|
|
2013
|
+
Ye(r.data[O], A);
|
|
2003
2014
|
}
|
|
2004
2015
|
}, null)
|
|
2005
2016
|
}
|
|
2006
|
-
}),
|
|
2017
|
+
}), y = ze({
|
|
2007
2018
|
curr: 1,
|
|
2008
2019
|
size: e.initSize || e.pageSizeOpts[0],
|
|
2009
2020
|
total: 0
|
|
2010
|
-
}),
|
|
2011
|
-
const
|
|
2012
|
-
|
|
2013
|
-
|
|
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) => {
|
|
2024
|
+
m(A);
|
|
2014
2025
|
});
|
|
2015
2026
|
};
|
|
2016
|
-
return e.columns.forEach((
|
|
2017
|
-
|
|
2018
|
-
}),
|
|
2027
|
+
return e.columns.forEach((O) => {
|
|
2028
|
+
m(O);
|
|
2029
|
+
}), g;
|
|
2019
2030
|
});
|
|
2020
|
-
function
|
|
2021
|
-
const
|
|
2022
|
-
if (
|
|
2023
|
-
const
|
|
2031
|
+
function f() {
|
|
2032
|
+
const g = e.columns.find((m) => m.type === "selection");
|
|
2033
|
+
if (g) {
|
|
2034
|
+
const m = {
|
|
2024
2035
|
// fixed: selectType.fixed,
|
|
2025
2036
|
// key: selectType.key,
|
|
2026
|
-
...
|
|
2027
|
-
width:
|
|
2037
|
+
...g,
|
|
2038
|
+
width: g.width || 54,
|
|
2028
2039
|
type: void 0,
|
|
2029
|
-
...
|
|
2040
|
+
...r.selectType
|
|
2030
2041
|
};
|
|
2031
|
-
|
|
2042
|
+
T.value = [m].concat(e.columns.slice(1));
|
|
2032
2043
|
} else
|
|
2033
|
-
|
|
2044
|
+
T.value = e.columns;
|
|
2034
2045
|
}
|
|
2035
|
-
let
|
|
2046
|
+
let V, s, k = 0;
|
|
2036
2047
|
async function h() {
|
|
2037
2048
|
if (typeof e.method != "function") return console.warn("typeof method isn't function");
|
|
2038
|
-
|
|
2039
|
-
const
|
|
2040
|
-
|
|
2041
|
-
const
|
|
2042
|
-
if (
|
|
2043
|
-
if (
|
|
2044
|
-
e.autoRemain || (
|
|
2049
|
+
s && (k = (k + 1) % Number.MAX_SAFE_INTEGER);
|
|
2050
|
+
const g = k;
|
|
2051
|
+
s = !0, p.value = !0, l("update:selection", []);
|
|
2052
|
+
const m = await e.method(Object.assign(Te(), typeof e.param != "function" ? e.param : e.param()));
|
|
2053
|
+
if (k !== g) return;
|
|
2054
|
+
if (p.value = !1, s = null, !m) {
|
|
2055
|
+
e.autoRemain || (y.total = 0, l("update:modelValue", []));
|
|
2045
2056
|
return;
|
|
2046
2057
|
}
|
|
2047
|
-
let
|
|
2048
|
-
if (
|
|
2049
|
-
const
|
|
2050
|
-
Array.isArray(
|
|
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);
|
|
2051
2062
|
}
|
|
2052
|
-
|
|
2053
|
-
|
|
2063
|
+
r.data = O, y.total = Q(m, e.totalKey) || 0, V = !0, l("update:modelValue", r.data), l("load", m), setTimeout(() => {
|
|
2064
|
+
V = null;
|
|
2054
2065
|
});
|
|
2055
2066
|
}
|
|
2056
|
-
function
|
|
2057
|
-
e.columns.some((
|
|
2058
|
-
|
|
2067
|
+
function n(g) {
|
|
2068
|
+
e.columns.some((m) => m.type === "selection") && g.forEach((m) => {
|
|
2069
|
+
m._checkable = !0, m._checked = m._disabled = !1;
|
|
2059
2070
|
});
|
|
2060
2071
|
}
|
|
2061
|
-
function
|
|
2062
|
-
typeof e.check == "function" && !e.check() || (e.isLocal ? K(
|
|
2072
|
+
function x(g) {
|
|
2073
|
+
typeof e.check == "function" && !e.check() || (e.isLocal ? K(g) : h());
|
|
2063
2074
|
}
|
|
2064
|
-
function K(
|
|
2065
|
-
let
|
|
2066
|
-
const
|
|
2067
|
-
for (;
|
|
2068
|
-
|
|
2069
|
-
|
|
2075
|
+
function K(g) {
|
|
2076
|
+
let m = g ? y.size * (y.curr - 1) : 0;
|
|
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", []);
|
|
2070
2081
|
}
|
|
2071
|
-
function
|
|
2072
|
-
|
|
2082
|
+
function W() {
|
|
2083
|
+
x(!0);
|
|
2073
2084
|
}
|
|
2074
|
-
function
|
|
2075
|
-
|
|
2085
|
+
function Ke(g) {
|
|
2086
|
+
y.size = g, y.curr === 1 && x();
|
|
2076
2087
|
}
|
|
2077
|
-
function
|
|
2078
|
-
|
|
2088
|
+
function De(g) {
|
|
2089
|
+
g !== !0 && (y.curr = 1), G(h);
|
|
2079
2090
|
}
|
|
2080
|
-
function
|
|
2081
|
-
|
|
2082
|
-
let
|
|
2083
|
-
e.pure && (
|
|
2091
|
+
function he(g, m) {
|
|
2092
|
+
g && (g._checked = m);
|
|
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);
|
|
2084
2095
|
}
|
|
2085
|
-
function
|
|
2086
|
-
return window.innerHeight - +e.bottomDis -
|
|
2096
|
+
function Oe() {
|
|
2097
|
+
return window.innerHeight - +e.bottomDis - c.value.$el.getBoundingClientRect().top - b.value.$el.offsetHeight;
|
|
2087
2098
|
}
|
|
2088
|
-
function
|
|
2089
|
-
|
|
2090
|
-
const
|
|
2091
|
-
|
|
2099
|
+
function xe(g) {
|
|
2100
|
+
G(() => {
|
|
2101
|
+
const m = Oe();
|
|
2102
|
+
r[g ? "height" : "maxHeight"] = m > 0 ? m : 0;
|
|
2092
2103
|
});
|
|
2093
2104
|
}
|
|
2094
|
-
function
|
|
2095
|
-
(e.maximizeHeightType === "height" || e.maximizeHeightType === "maxHeight") &&
|
|
2096
|
-
const
|
|
2097
|
-
|
|
2105
|
+
function $e() {
|
|
2106
|
+
(e.maximizeHeightType === "height" || e.maximizeHeightType === "maxHeight") && G(() => {
|
|
2107
|
+
const g = Oe();
|
|
2108
|
+
r[e.maximizeHeightType] = g > 0 ? g : 0;
|
|
2098
2109
|
});
|
|
2099
2110
|
}
|
|
2100
|
-
function
|
|
2111
|
+
function Te() {
|
|
2101
2112
|
return {
|
|
2102
|
-
[e.pageMap.first]: e.usePageNum ?
|
|
2103
|
-
[e.pageMap.pageSize]:
|
|
2113
|
+
[e.pageMap.first]: e.usePageNum ? y.curr : y.size * (y.curr - 1),
|
|
2114
|
+
[e.pageMap.pageSize]: y.size
|
|
2104
2115
|
};
|
|
2105
2116
|
}
|
|
2106
|
-
let
|
|
2107
|
-
function
|
|
2108
|
-
!e.clickToCheck || !
|
|
2109
|
-
|
|
2117
|
+
let pe;
|
|
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(() => {
|
|
2120
|
+
pe = null;
|
|
2110
2121
|
}));
|
|
2111
2122
|
}
|
|
2112
|
-
function
|
|
2113
|
-
|
|
2123
|
+
function Ye(g, m) {
|
|
2124
|
+
pe || (he(g, m), l("select", e.pure ? re(g) : g, m));
|
|
2114
2125
|
}
|
|
2115
|
-
function
|
|
2116
|
-
const
|
|
2117
|
-
...
|
|
2126
|
+
function re(g) {
|
|
2127
|
+
const m = {
|
|
2128
|
+
...g
|
|
2118
2129
|
};
|
|
2119
|
-
return delete
|
|
2130
|
+
return delete m._checkable, delete m._checked, delete m._disabled, m;
|
|
2120
2131
|
}
|
|
2121
|
-
function
|
|
2132
|
+
function Je() {
|
|
2122
2133
|
if (e.fullscreen) {
|
|
2123
|
-
|
|
2134
|
+
d.value ? document.exitFullscreen() : v.value.requestFullscreen();
|
|
2124
2135
|
return;
|
|
2125
2136
|
}
|
|
2126
|
-
|
|
2127
|
-
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);
|
|
2128
2139
|
});
|
|
2129
2140
|
}
|
|
2130
|
-
function
|
|
2131
|
-
|
|
2141
|
+
function Ge() {
|
|
2142
|
+
p.value || (e.isLocal ? l("reload") : De());
|
|
2132
2143
|
}
|
|
2133
|
-
return
|
|
2134
|
-
search:
|
|
2135
|
-
setMaxHeight:
|
|
2136
|
-
table:
|
|
2137
|
-
sizer:
|
|
2144
|
+
return S({
|
|
2145
|
+
search: De,
|
|
2146
|
+
setMaxHeight: xe,
|
|
2147
|
+
table: r,
|
|
2148
|
+
sizer: y,
|
|
2138
2149
|
getPage: () => ({
|
|
2139
|
-
...
|
|
2140
|
-
curr:
|
|
2141
|
-
total:
|
|
2150
|
+
...Te(),
|
|
2151
|
+
curr: y.curr,
|
|
2152
|
+
total: y.total
|
|
2142
2153
|
})
|
|
2143
|
-
}),
|
|
2144
|
-
!e.maxHeight && !e.height && (e.autoMaxHeight || e.autoHeight) && (
|
|
2145
|
-
|
|
2146
|
-
})), e.fullscreen && (
|
|
2147
|
-
|
|
2148
|
-
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);
|
|
2149
2160
|
});
|
|
2150
2161
|
});
|
|
2151
|
-
}),
|
|
2152
|
-
|
|
2153
|
-
}),
|
|
2154
|
-
const
|
|
2162
|
+
}), He(() => {
|
|
2163
|
+
v.value.onfullscreenchange = null;
|
|
2164
|
+
}), I(() => e.modelValue, (g) => {
|
|
2165
|
+
const m = Array.isArray(g) ? g : [];
|
|
2155
2166
|
if (e.isLocal) {
|
|
2156
|
-
|
|
2167
|
+
y.curr = 1, y.total = m.length, n(m), K();
|
|
2157
2168
|
return;
|
|
2158
2169
|
}
|
|
2159
|
-
|
|
2170
|
+
V || (y.curr = 1, y.total = m.length, r.data = m);
|
|
2160
2171
|
}, {
|
|
2161
2172
|
immediate: !0
|
|
2162
|
-
}),
|
|
2163
|
-
|
|
2164
|
-
}),
|
|
2165
|
-
|
|
2166
|
-
}),
|
|
2167
|
-
|
|
2168
|
-
}), (
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
default: D(() => [O(w, {
|
|
2202
|
-
type: "md-refresh",
|
|
2203
|
-
size: "20",
|
|
2204
|
-
onClick: je
|
|
2205
|
-
})]),
|
|
2206
|
-
_: 1
|
|
2207
|
-
}, 8, ["content", "transfer", "class"]), O(X, {
|
|
2208
|
-
placement: "top",
|
|
2209
|
-
content: y(M).t(`pageTable.${u.value ? "restore" : "maxmize"}`),
|
|
2210
|
-
transfer: C.value,
|
|
2211
|
-
class: P(y(I)("page-table-action"))
|
|
2212
|
-
}, {
|
|
2213
|
-
default: D(() => [O(w, {
|
|
2214
|
-
type: u.value ? "md-contract" : "md-expand",
|
|
2215
|
-
size: "20",
|
|
2216
|
-
onClick: Pe
|
|
2217
|
-
}, null, 8, ["type"])]),
|
|
2218
|
-
_: 1
|
|
2219
|
-
}, 8, ["content", "transfer", "class"]), O(ze, {
|
|
2220
|
-
modelValue: x.value,
|
|
2221
|
-
"onUpdate:modelValue": f[0] || (f[0] = (Z) => x.value = Z),
|
|
2173
|
+
}), I(() => e.maxHeight, (g) => {
|
|
2174
|
+
r.maxHeight = g;
|
|
2175
|
+
}), I(() => e.height, (g) => {
|
|
2176
|
+
r.height = g;
|
|
2177
|
+
}), I(() => e.columns, () => {
|
|
2178
|
+
f();
|
|
2179
|
+
}), (g, m) => (D(), j("div", {
|
|
2180
|
+
ref: "elRef",
|
|
2181
|
+
class: F([
|
|
2182
|
+
o(R)("page-table-container"),
|
|
2183
|
+
// {
|
|
2184
|
+
// 'page-table-bordered': border && showHeader,
|
|
2185
|
+
// 'page-table-maximized': maximized,
|
|
2186
|
+
// 'page-table-fullscreen': maximized && fullscreen
|
|
2187
|
+
// }
|
|
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")
|
|
2191
|
+
])
|
|
2192
|
+
}, [t.showHeader ? (D(), L(o(ge), {
|
|
2193
|
+
key: 0,
|
|
2194
|
+
justify: "space-between",
|
|
2195
|
+
align: "middle",
|
|
2196
|
+
class: F(o(R)("page-table-header"))
|
|
2197
|
+
}, {
|
|
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)])]),
|
|
2202
|
+
_: 3
|
|
2203
|
+
}), $(o(ie), null, {
|
|
2204
|
+
default: C(() => [M(g.$slots, "headerAction"), $(o(we), {
|
|
2205
|
+
placement: "top",
|
|
2206
|
+
content: o(w).t("pageTable.reload"),
|
|
2207
|
+
transfer: B.value,
|
|
2208
|
+
class: F(o(R)("page-table-action"))
|
|
2209
|
+
}, {
|
|
2210
|
+
default: C(() => [$(o(fe), {
|
|
2211
|
+
type: "md-refresh",
|
|
2222
2212
|
size: "20",
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2213
|
+
onClick: Ge
|
|
2214
|
+
})]),
|
|
2215
|
+
_: 1
|
|
2216
|
+
}, 8, ["content", "transfer", "class"]), $(o(we), {
|
|
2217
|
+
placement: "top",
|
|
2218
|
+
content: o(w).t(`pageTable.${d.value ? "restore" : "maxmize"}`),
|
|
2219
|
+
transfer: B.value,
|
|
2220
|
+
class: F(o(R)("page-table-action"))
|
|
2221
|
+
}, {
|
|
2222
|
+
default: C(() => [$(o(fe), {
|
|
2223
|
+
type: d.value ? "md-contract" : "md-expand",
|
|
2224
|
+
size: "20",
|
|
2225
|
+
onClick: Je
|
|
2226
|
+
}, null, 8, ["type"])]),
|
|
2227
|
+
_: 1
|
|
2228
|
+
}, 8, ["content", "transfer", "class"]), $(Le, {
|
|
2229
|
+
modelValue: T.value,
|
|
2230
|
+
"onUpdate:modelValue": m[0] || (m[0] = (O) => T.value = O),
|
|
2231
|
+
size: "20",
|
|
2232
|
+
transfer: B.value,
|
|
2233
|
+
"store-at": t.storeAt,
|
|
2234
|
+
onChange: m[1] || (m[1] = (O) => g.$emit("change-col", O))
|
|
2235
|
+
}, {
|
|
2236
|
+
default: C(() => [$(o(fe), {
|
|
2237
|
+
type: "md-settings",
|
|
2238
|
+
size: "20"
|
|
2239
|
+
})]),
|
|
2240
|
+
_: 1
|
|
2241
|
+
}, 8, ["modelValue", "transfer", "store-at"])]),
|
|
2235
2242
|
_: 3
|
|
2236
|
-
}
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2243
|
+
})]),
|
|
2244
|
+
_: 3
|
|
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({
|
|
2248
|
+
ref: "tableRef"
|
|
2249
|
+
}, o(Ne)(g.$attrs, ["id", "class", "style"]), {
|
|
2250
|
+
border: t.border,
|
|
2251
|
+
columns: T.value,
|
|
2252
|
+
data: r.data,
|
|
2253
|
+
loading: p.value,
|
|
2254
|
+
height: r.height,
|
|
2255
|
+
"max-height": r.maxHeight,
|
|
2256
|
+
onOnRowClick: Ue
|
|
2257
|
+
}), Fe({
|
|
2258
|
+
_: 2
|
|
2259
|
+
}, [g.$slots.header ? {
|
|
2260
|
+
name: "header",
|
|
2261
|
+
fn: C(() => [M(g.$slots, "header")]),
|
|
2262
|
+
key: "0"
|
|
2263
|
+
} : void 0, _(P.value, (O) => ({
|
|
2264
|
+
name: O.slot,
|
|
2265
|
+
fn: C((A) => [M(g.$slots, O.slot, Be(Ve(A)))])
|
|
2266
|
+
})), g.$slots.footer ? {
|
|
2267
|
+
name: "footer",
|
|
2268
|
+
fn: C(() => [M(g.$slots, "footer")]),
|
|
2269
|
+
key: "1"
|
|
2270
|
+
} : void 0]), 1040, ["border", "columns", "data", "loading", "height", "max-height", "onOnRowClick"]), te($(o(ot), {
|
|
2271
|
+
ref: "pageRef",
|
|
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,
|
|
2276
|
+
"show-total": "",
|
|
2277
|
+
"show-sizer": "",
|
|
2278
|
+
"show-elevator": "",
|
|
2279
|
+
transfer: B.value,
|
|
2280
|
+
"page-size-opts": t.pageSizeOpts,
|
|
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));
|
|
2277
2285
|
}
|
|
2278
|
-
}),
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2286
|
+
}), jt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2287
|
+
__proto__: null,
|
|
2288
|
+
AllCheckbox: ct,
|
|
2289
|
+
BaseSwitch: gt,
|
|
2290
|
+
CacheSelect: Bt,
|
|
2291
|
+
Combi: bt,
|
|
2292
|
+
CountRange: yt,
|
|
2293
|
+
CurdTable: Tt,
|
|
2294
|
+
DateRange: Dt,
|
|
2295
|
+
DateRangePicker: xt,
|
|
2296
|
+
MCalendar: Rt,
|
|
2297
|
+
ModalFooter: Mt,
|
|
2298
|
+
PageTable: Ht,
|
|
2299
|
+
RemoteSelect: Ee,
|
|
2300
|
+
ToggleColumn: Le
|
|
2301
|
+
}, Symbol.toStringTag, { value: "Module" })), Ie = Object.values(jt), Nt = Object.entries({ iviewSelect: Pe });
|
|
2302
|
+
function Pt(t, S = {}) {
|
|
2303
|
+
if (S.prefix && (Se[0] = S.prefix, Ie.forEach((a) => a.name = S.prefix + a.name)), Ie.forEach((a) => {
|
|
2295
2304
|
t.component(a.name, a);
|
|
2296
|
-
}),
|
|
2305
|
+
}), Nt.forEach((a) => {
|
|
2297
2306
|
t.directive(a[0], a[1]);
|
|
2298
|
-
}),
|
|
2299
|
-
|
|
2307
|
+
}), S.i18n) {
|
|
2308
|
+
w.i18n = S.i18n, S.msgPrefix && S.msgPrefix !== "d" && (w.prefix = S.msgPrefix);
|
|
2300
2309
|
return;
|
|
2301
2310
|
}
|
|
2302
|
-
|
|
2311
|
+
S.msg && (w.msg = S.msg);
|
|
2303
2312
|
}
|
|
2304
|
-
const
|
|
2305
|
-
install:
|
|
2313
|
+
const Qt = {
|
|
2314
|
+
install: Pt
|
|
2306
2315
|
};
|
|
2307
2316
|
export {
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
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,
|
|
2324
|
+
xt as DateRangePicker,
|
|
2325
|
+
Rt as MCalendar,
|
|
2326
|
+
Mt as ModalFooter,
|
|
2327
|
+
Ht as PageTable,
|
|
2328
|
+
Ee as RemoteSelect,
|
|
2329
|
+
Le as ToggleColumn,
|
|
2330
|
+
Qt as default,
|
|
2331
|
+
Pt as install,
|
|
2332
|
+
Pe as iviewSelect
|
|
2324
2333
|
};
|