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