@dazhicheng/ui 1.6.81 → 1.6.83
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/dist/components/tt-modal/src/RenderModal.vue.js +179 -171
- package/dist/components/tt-modal/src/utils/modal-z-index.d.ts +20 -0
- package/dist/components/tt-modal/src/utils/modal-z-index.js +26 -16
- package/dist/components/tt-modal/src/utils/resolve-modal-target.js +3 -3
- package/dist/components/tt-panel-select/src/index.vue.js +251 -242
- package/dist/components/tt-table/src/hooks/useTableFooter.js +34 -24
- package/dist/packages/utils/src/calc.js +1 -0
- package/dist/style.css +1 -1
- package/package.json +3 -3
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as gl, mergeModels as se, ref as m, computed as i, useModel as yl, watch as x, useTemplateRef as B, unref as s, onMounted as wl, createElementBlock as _, openBlock as y, normalizeClass as S, createVNode as ue, mergeProps as Al, withCtx as ce, withDirectives as Cl, normalizeStyle as kl, createBlock as de, createCommentVNode as T, createElementVNode as pe, toDisplayString as xl, nextTick as G } from "vue";
|
|
2
2
|
import "../../../node_modules/.pnpm/vue-types@5.1.3_vue@3.5.34_typescript@5.9.3_/node_modules/vue-types/shim/index.modern.js";
|
|
3
|
-
import { useDesign as
|
|
3
|
+
import { useDesign as Sl } from "../../../packages/hooks/src/useDesign.js";
|
|
4
4
|
import "axios";
|
|
5
|
-
import { ElSelect as
|
|
6
|
-
import { isString as
|
|
5
|
+
import { useZIndex as bl, ElSelect as Ol, vLoading as Ml } from "element-plus";
|
|
6
|
+
import { isString as Vl } from "../../../packages/utils/src/is.js";
|
|
7
7
|
import "dayjs";
|
|
8
8
|
import "numeral";
|
|
9
9
|
import "xe-utils";
|
|
@@ -17,20 +17,21 @@ import "../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-
|
|
|
17
17
|
import "../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-pkcs7.js";
|
|
18
18
|
import "lodash-es";
|
|
19
19
|
import "vue-router";
|
|
20
|
-
import { missingOptionsEchoVersion as
|
|
21
|
-
import { useDebounceFn as
|
|
22
|
-
import { useSelectCollapseOptions as
|
|
23
|
-
import {
|
|
24
|
-
import
|
|
25
|
-
import
|
|
26
|
-
import
|
|
27
|
-
import
|
|
28
|
-
import {
|
|
20
|
+
import { missingOptionsEchoVersion as El, getPanelMissingEchoOptions as Pl, expandJoinedOptionValues as Fl, diffPanelMissingCodes as $l, ensurePanelResolveMissingOptions as Nl, PANEL_MISSING_ECHO_DEFAULT_SCOPE as fe } from "../../../hooks/missingOptionsCache.js";
|
|
21
|
+
import { useDebounceFn as Ll, useResizeObserver as Rl } from "@vueuse/core";
|
|
22
|
+
import { useSelectCollapseOptions as Bl } from "../../tt-form/src/hooks/useSelectCollapse.js";
|
|
23
|
+
import { ensureElementPlusAboveOpenModals as _l } from "../../tt-modal/src/utils/modal-z-index.js";
|
|
24
|
+
import { splitPanelSelectText as D, ALL as Tl, DEFAULT_PANEL_SELECT_SEPARATORS as Gl } from "./common.js";
|
|
25
|
+
import Dl from "./components/PanelLeft.vue.js";
|
|
26
|
+
import Il from "./components/PanelMiddle.vue.js";
|
|
27
|
+
import Kl from "./components/PanelRight.vue.js";
|
|
28
|
+
import { usePanelSelectData as Wl } from "./hooks/usePanelData.js";
|
|
29
|
+
import { usePanelSelectSelection as Ul } from "./hooks/usePanelSelection.js";
|
|
29
30
|
/* empty css */
|
|
30
|
-
const
|
|
31
|
+
const v = 4, Ct = /* @__PURE__ */ gl({
|
|
31
32
|
name: "TtPanelSelect",
|
|
32
33
|
__name: "index",
|
|
33
|
-
props: /* @__PURE__ */
|
|
34
|
+
props: /* @__PURE__ */ se({
|
|
34
35
|
allowCreate: { type: Boolean, default: !1 },
|
|
35
36
|
disabled: { type: Boolean, default: !1 },
|
|
36
37
|
showNav: { type: Boolean, default: !0 },
|
|
@@ -41,7 +42,7 @@ const m = 4, ht = /* @__PURE__ */ fl({
|
|
|
41
42
|
resultField: { default: "" },
|
|
42
43
|
options: { default: () => [] },
|
|
43
44
|
resolveMissingOptions: { type: Function, default: void 0 },
|
|
44
|
-
missingEchoKey: { default:
|
|
45
|
+
missingEchoKey: { default: fe },
|
|
45
46
|
treeConfig: { default: () => ({
|
|
46
47
|
transform: !1,
|
|
47
48
|
labelField: "label",
|
|
@@ -54,11 +55,11 @@ const m = 4, ht = /* @__PURE__ */ fl({
|
|
|
54
55
|
immediate: { type: Boolean, default: !0 },
|
|
55
56
|
beforeFetch: { type: Function, default: void 0 },
|
|
56
57
|
afterFetch: { type: Function, default: void 0 },
|
|
57
|
-
separator: { default: () => [...
|
|
58
|
+
separator: { default: () => [...Gl] },
|
|
58
59
|
pasteSearch: { type: Boolean, default: !0 },
|
|
59
60
|
alwaysLoad: { type: Boolean, default: !1 },
|
|
60
61
|
showAll: { type: Boolean, default: !0 },
|
|
61
|
-
showAllField: { default:
|
|
62
|
+
showAllField: { default: Tl },
|
|
62
63
|
showPinyinMode: { type: Boolean, default: !1 },
|
|
63
64
|
showOriginMode: { type: Boolean, default: !0 },
|
|
64
65
|
leftPlaceholder: { default: "支持模糊搜索" },
|
|
@@ -68,10 +69,13 @@ const m = 4, ht = /* @__PURE__ */ fl({
|
|
|
68
69
|
modelValue: {},
|
|
69
70
|
modelModifiers: {}
|
|
70
71
|
}),
|
|
71
|
-
emits: /* @__PURE__ */
|
|
72
|
-
setup(c, { expose:
|
|
73
|
-
const
|
|
74
|
-
function
|
|
72
|
+
emits: /* @__PURE__ */ se(["visible-change", "change", "focus"], ["update:modelValue"]),
|
|
73
|
+
setup(c, { expose: he, emit: me }) {
|
|
74
|
+
const ve = Ml, ge = Ol, t = c, b = me, { prefixCls: d } = Sl("panel-select"), I = bl(), O = m();
|
|
75
|
+
function M() {
|
|
76
|
+
_l(I), O.value = I.nextZIndex();
|
|
77
|
+
}
|
|
78
|
+
function ye(e = []) {
|
|
75
79
|
const l = /* @__PURE__ */ new Set(), a = (o) => {
|
|
76
80
|
o.forEach((n) => {
|
|
77
81
|
var u;
|
|
@@ -84,115 +88,110 @@ const m = 4, ht = /* @__PURE__ */ fl({
|
|
|
84
88
|
};
|
|
85
89
|
return a(e), l;
|
|
86
90
|
}
|
|
87
|
-
function
|
|
91
|
+
function we(e) {
|
|
88
92
|
return Array.isArray(e) ? e : e == null || e === "" ? [] : [e];
|
|
89
93
|
}
|
|
90
|
-
function
|
|
91
|
-
return t.missingEchoKey ||
|
|
94
|
+
function K() {
|
|
95
|
+
return t.missingEchoKey || fe;
|
|
92
96
|
}
|
|
93
|
-
const
|
|
94
|
-
|
|
95
|
-
const e = t.options || [], l =
|
|
97
|
+
const Ae = i(() => {
|
|
98
|
+
El.value;
|
|
99
|
+
const e = t.options || [], l = Pl(K());
|
|
96
100
|
if (!l.length) return e;
|
|
97
|
-
const a =
|
|
101
|
+
const a = ye(e), o = l.filter(
|
|
98
102
|
(n) => n.value !== void 0 && n.value !== null && !a.has(n.value)
|
|
99
103
|
);
|
|
100
104
|
return o.length ? [...e, ...o] : e;
|
|
101
|
-
}),
|
|
105
|
+
}), Ce = new Proxy(t, {
|
|
102
106
|
get(e, l, a) {
|
|
103
|
-
return l === "options" ?
|
|
107
|
+
return l === "options" ? Ae.value : Reflect.get(e, l, a);
|
|
104
108
|
}
|
|
105
109
|
}), {
|
|
106
|
-
loading:
|
|
107
|
-
fetchApi:
|
|
108
|
-
treeOptions:
|
|
109
|
-
navTreeOptions:
|
|
110
|
-
navNodes:
|
|
110
|
+
loading: W,
|
|
111
|
+
fetchApi: g,
|
|
112
|
+
treeOptions: ke,
|
|
113
|
+
navTreeOptions: U,
|
|
114
|
+
navNodes: xe,
|
|
111
115
|
leafNodes: f,
|
|
112
|
-
isFirstLoaded:
|
|
113
|
-
filterNodes:
|
|
114
|
-
buildOptionGroups:
|
|
115
|
-
} =
|
|
116
|
-
let
|
|
117
|
-
const
|
|
116
|
+
isFirstLoaded: Z,
|
|
117
|
+
filterNodes: Se,
|
|
118
|
+
buildOptionGroups: z
|
|
119
|
+
} = Wl(Ce), r = yl(c, "modelValue");
|
|
120
|
+
let j;
|
|
121
|
+
const H = i(() => t.disabled), be = i(() => {
|
|
118
122
|
if (!t.multiple)
|
|
119
123
|
return t.allowCreate ? `${t.placeholder ? t.placeholder : "请选择"}(可创建)` : t.placeholder;
|
|
120
124
|
const e = t.showMultiple ? "支持多选和全选" : "支持多选", l = typeof t.placeholder == "string" && t.placeholder.trim() ? t.placeholder.trim().replace(/[,,]\s*$/, "") : "请选择", a = l.includes("支持多选和全选") || l.includes("支持多选") ? l : `${l},${e}`;
|
|
121
125
|
return t.allowCreate ? `${a}(可创建)` : a;
|
|
122
|
-
}),
|
|
126
|
+
}), Oe = i(() => {
|
|
123
127
|
const e = /* @__PURE__ */ new Map();
|
|
124
128
|
return f.value.forEach((l) => e.set(l.value, l.label)), e;
|
|
125
|
-
}),
|
|
129
|
+
}), J = i(() => {
|
|
126
130
|
const e = /* @__PURE__ */ new Map();
|
|
127
131
|
return f.value.forEach((l) => {
|
|
128
132
|
var a;
|
|
129
133
|
(l.deleted === !0 || ((a = l.raw) == null ? void 0 : a.deleted) === !0) && e.set(l.value, !0);
|
|
130
134
|
}), e;
|
|
131
135
|
});
|
|
132
|
-
function
|
|
136
|
+
function V(e) {
|
|
133
137
|
return e === t.showAllField ? { label: "全部", value: t.showAllField } : {
|
|
134
|
-
label:
|
|
138
|
+
label: Oe.value.get(e) ?? String(e),
|
|
135
139
|
value: e,
|
|
136
|
-
deleted:
|
|
140
|
+
deleted: J.value.get(e) === !0
|
|
137
141
|
};
|
|
138
142
|
}
|
|
139
|
-
function
|
|
140
|
-
return e == null ? !1 :
|
|
143
|
+
function Me(e) {
|
|
144
|
+
return e == null ? !1 : J.value.get(e) === !0;
|
|
141
145
|
}
|
|
142
|
-
const
|
|
146
|
+
const Ve = Ll(async () => {
|
|
143
147
|
const e = t.resolveMissingOptions;
|
|
144
148
|
if (!e) return;
|
|
145
|
-
const l =
|
|
146
|
-
|
|
149
|
+
const l = Fl(
|
|
150
|
+
we(r.value).filter((n) => n !== t.showAllField)
|
|
147
151
|
);
|
|
148
152
|
if (!l.length) return;
|
|
149
|
-
const a =
|
|
150
|
-
|
|
151
|
-
a,
|
|
152
|
-
l,
|
|
153
|
-
t.options || [],
|
|
154
|
-
(n) => e(n)
|
|
155
|
-
);
|
|
153
|
+
const a = K();
|
|
154
|
+
$l(a, l, t.options || []).length && await Nl(a, l, t.options || [], (n) => e(n));
|
|
156
155
|
}, 64);
|
|
157
|
-
|
|
156
|
+
x(
|
|
158
157
|
[r, () => t.options, () => t.showAllField, () => t.missingEchoKey],
|
|
159
158
|
() => {
|
|
160
|
-
t.resolveMissingOptions &&
|
|
159
|
+
t.resolveMissingOptions && Ve();
|
|
161
160
|
},
|
|
162
161
|
{ immediate: !0, deep: !0 }
|
|
163
162
|
);
|
|
164
|
-
function
|
|
163
|
+
function q(e) {
|
|
165
164
|
if (e != null)
|
|
166
165
|
return typeof e == "object" && "value" in e ? e.value : e;
|
|
167
166
|
}
|
|
168
|
-
const
|
|
167
|
+
const Q = i({
|
|
169
168
|
get() {
|
|
170
169
|
return Array.isArray(r.value) ? t.multiple ? r.value : r.value.slice(-1) : r.value === void 0 ? [] : [r.value];
|
|
171
170
|
},
|
|
172
171
|
set(e) {
|
|
173
172
|
r.value = t.multiple ? [...e] : e.at(-1);
|
|
174
173
|
}
|
|
175
|
-
}),
|
|
174
|
+
}), E = i(() => {
|
|
176
175
|
if (!t.allowCreate) return [];
|
|
177
176
|
const e = new Set(f.value.map((a) => a.value)), l = [];
|
|
178
|
-
return new Set(
|
|
179
|
-
!
|
|
177
|
+
return new Set(Q.value).forEach((a) => {
|
|
178
|
+
!Vl(a) || a === t.showAllField || e.has(a) || l.push({ label: a, value: a, level: 0, path: [], raw: { label: a, value: a } });
|
|
180
179
|
}), l;
|
|
181
|
-
}),
|
|
182
|
-
|
|
180
|
+
}), P = i(() => [...f.value, ...E.value]);
|
|
181
|
+
x([() => t.multiple, () => r.value], ([e, l]) => {
|
|
183
182
|
if (e) {
|
|
184
183
|
Array.isArray(l) || (r.value = l === void 0 ? [] : [l]);
|
|
185
184
|
return;
|
|
186
185
|
}
|
|
187
186
|
Array.isArray(l) && (r.value = l.at(-1));
|
|
188
187
|
});
|
|
189
|
-
const
|
|
190
|
-
function
|
|
188
|
+
const F = m(), w = m(""), p = m(""), $ = m(), N = B("middleRef"), A = B("selectWrapRef"), X = B("selectRef"), L = m(0);
|
|
189
|
+
function Y() {
|
|
191
190
|
const e = A.value;
|
|
192
|
-
e && (
|
|
191
|
+
e && (L.value = e.offsetWidth);
|
|
193
192
|
}
|
|
194
|
-
|
|
195
|
-
const
|
|
193
|
+
Rl(A, () => Y());
|
|
194
|
+
const Ee = i(() => ({
|
|
196
195
|
componentProps: {
|
|
197
196
|
multiple: t.multiple,
|
|
198
197
|
component: {
|
|
@@ -201,135 +200,144 @@ const m = 4, ht = /* @__PURE__ */ fl({
|
|
|
201
200
|
},
|
|
202
201
|
component: "TtPanelSelect",
|
|
203
202
|
selectWrapRef: A,
|
|
204
|
-
selectRef:
|
|
205
|
-
})), { selectComponentProps:
|
|
206
|
-
const e =
|
|
207
|
-
|
|
203
|
+
selectRef: X
|
|
204
|
+
})), { selectComponentProps: Pe } = Bl(Ee), Fe = i(() => {
|
|
205
|
+
const e = Pe.value || {}, l = e.popperStyle && typeof e.popperStyle == "object" && !Array.isArray(e.popperStyle) ? e.popperStyle : {};
|
|
206
|
+
return {
|
|
207
|
+
...e,
|
|
208
|
+
popperStyle: {
|
|
209
|
+
...l,
|
|
210
|
+
...O.value != null ? { zIndex: O.value } : {}
|
|
211
|
+
}
|
|
212
|
+
};
|
|
213
|
+
}), ee = i(() => {
|
|
214
|
+
const e = w.value.trim().toLowerCase();
|
|
215
|
+
if (!e) return U.value;
|
|
208
216
|
const l = (a) => {
|
|
209
217
|
const o = [];
|
|
210
218
|
return a.forEach((n) => {
|
|
211
|
-
var
|
|
212
|
-
const u = (
|
|
219
|
+
var ie;
|
|
220
|
+
const u = (ie = n.children) != null && ie.length ? l(n.children) : void 0;
|
|
213
221
|
(String(n.label).toLowerCase().includes(e) || u && u.length) && o.push({ ...n, children: u != null && u.length ? u : void 0 });
|
|
214
222
|
}), o;
|
|
215
223
|
};
|
|
216
|
-
return l(
|
|
217
|
-
}),
|
|
224
|
+
return l(U.value);
|
|
225
|
+
}), $e = i(() => {
|
|
218
226
|
const e = [], l = (a) => {
|
|
219
227
|
a.forEach((o) => {
|
|
220
228
|
var n;
|
|
221
229
|
e.push(o.value), (n = o.children) != null && n.length && l(o.children);
|
|
222
230
|
});
|
|
223
231
|
};
|
|
224
|
-
return l(
|
|
232
|
+
return l(ee.value), e;
|
|
225
233
|
}), C = i(
|
|
226
|
-
() =>
|
|
234
|
+
() => Le(p.value).map((e) => ({
|
|
227
235
|
label: e,
|
|
228
236
|
value: e,
|
|
229
237
|
level: 0,
|
|
230
238
|
path: [],
|
|
231
239
|
raw: { label: e, value: e }
|
|
232
240
|
}))
|
|
233
|
-
),
|
|
234
|
-
const e =
|
|
241
|
+
), Ne = i(() => [...P.value, ...C.value]), k = i(() => {
|
|
242
|
+
const e = z(f.value, p.value), l = Se([...E.value, ...C.value], p.value);
|
|
235
243
|
if (!l.length) return e;
|
|
236
244
|
const a = new Map(l.map((u) => [u.value, u])), o = [];
|
|
237
|
-
|
|
238
|
-
const
|
|
239
|
-
|
|
245
|
+
D(p.value, t.separator).forEach((u) => {
|
|
246
|
+
const R = a.get(u);
|
|
247
|
+
R && (o.push(R), a.delete(u));
|
|
240
248
|
}), o.push(...a.values());
|
|
241
249
|
let n = "__created__";
|
|
242
250
|
for (; e.some((u) => u.value === n); ) n += "_";
|
|
243
251
|
return [{ value: n, label: "自定义", options: o }, ...e];
|
|
244
252
|
});
|
|
245
|
-
function
|
|
246
|
-
if (!t.allowCreate || t.disabled ||
|
|
247
|
-
const l =
|
|
248
|
-
if (!l.length ||
|
|
249
|
-
const a = new Set(
|
|
253
|
+
function Le(e) {
|
|
254
|
+
if (!t.allowCreate || t.disabled || W.value || t.api && !Z.value) return [];
|
|
255
|
+
const l = D(e, t.separator);
|
|
256
|
+
if (!l.length || z(f.value, e).length) return [];
|
|
257
|
+
const a = new Set(P.value.map((o) => `${o.value}`));
|
|
250
258
|
return [...new Set(l)].filter((o) => o !== `${t.showAllField}` && !a.has(o));
|
|
251
259
|
}
|
|
252
|
-
function
|
|
260
|
+
function Re() {
|
|
253
261
|
if (!C.value.length) return;
|
|
254
262
|
const e = new Set(
|
|
255
|
-
[...
|
|
256
|
-
), l = [...new Set(
|
|
263
|
+
[...E.value, ...C.value].map((a) => a.value)
|
|
264
|
+
), l = [...new Set(D(p.value, t.separator))].filter(
|
|
257
265
|
(a) => e.has(a)
|
|
258
266
|
);
|
|
259
|
-
|
|
267
|
+
re(l, !0);
|
|
260
268
|
}
|
|
261
|
-
const
|
|
269
|
+
const Be = i(() => {
|
|
262
270
|
const e = "minmax(var(--tt-panel-select-middle-width, 450px), 1fr)";
|
|
263
271
|
return t.showNav && !t.multiple ? `200px ${e}` : !t.showNav && t.multiple ? `${e} 180px` : !t.showNav && !t.multiple ? e : `200px ${e} 180px`;
|
|
264
|
-
}),
|
|
272
|
+
}), _e = i(() => {
|
|
265
273
|
const e = "var(--tt-panel-select-middle-width, 450px)";
|
|
266
274
|
return t.showNav && !t.multiple ? `max(calc(200px + ${e}), 800px)` : !t.showNav && t.multiple ? `max(calc(${e} + 180px), 800px)` : !t.showNav && !t.multiple ? `max(${e}, 800px)` : `max(calc(200px + ${e} + 180px), 800px)`;
|
|
267
|
-
}),
|
|
275
|
+
}), Te = i(() => {
|
|
268
276
|
const e = [];
|
|
269
277
|
return k.value.forEach((l) => {
|
|
270
278
|
!(t.showOriginMode && l.value === "__origin__") && e.push({ key: `group-${String(l.value)}`, type: "group", group: l });
|
|
271
|
-
const o = Math.ceil(l.options.length /
|
|
272
|
-
for (let n = 0; n < l.options.length; n +=
|
|
273
|
-
const u = n /
|
|
279
|
+
const o = Math.ceil(l.options.length / v);
|
|
280
|
+
for (let n = 0; n < l.options.length; n += v) {
|
|
281
|
+
const u = n / v;
|
|
274
282
|
e.push({
|
|
275
|
-
key: `options-${String(l.value)}-${n /
|
|
283
|
+
key: `options-${String(l.value)}-${n / v}`,
|
|
276
284
|
type: "options",
|
|
277
285
|
group: l,
|
|
278
|
-
options: l.options.slice(n, n +
|
|
286
|
+
options: l.options.slice(n, n + v),
|
|
279
287
|
isLast: u === o - 1
|
|
280
288
|
});
|
|
281
289
|
}
|
|
282
290
|
}), e;
|
|
283
291
|
}), {
|
|
284
|
-
selectedOptions:
|
|
285
|
-
selectedValueSet:
|
|
286
|
-
isAllChecked:
|
|
287
|
-
isIndeterminate:
|
|
288
|
-
getGroupCheckCount:
|
|
289
|
-
handleGroupCheck:
|
|
290
|
-
handleAllOptionCheck:
|
|
291
|
-
handleOptionCheck:
|
|
292
|
-
handleOptionsCheck:
|
|
293
|
-
handleCheckAll:
|
|
294
|
-
clearSelected:
|
|
295
|
-
removeSelected:
|
|
296
|
-
withLockedSelectedValues:
|
|
297
|
-
} =
|
|
292
|
+
selectedOptions: Ge,
|
|
293
|
+
selectedValueSet: le,
|
|
294
|
+
isAllChecked: De,
|
|
295
|
+
isIndeterminate: Ie,
|
|
296
|
+
getGroupCheckCount: Ke,
|
|
297
|
+
handleGroupCheck: We,
|
|
298
|
+
handleAllOptionCheck: Ue,
|
|
299
|
+
handleOptionCheck: Ze,
|
|
300
|
+
handleOptionsCheck: ze,
|
|
301
|
+
handleCheckAll: je,
|
|
302
|
+
clearSelected: He,
|
|
303
|
+
removeSelected: Je,
|
|
304
|
+
withLockedSelectedValues: qe
|
|
305
|
+
} = Ul({
|
|
298
306
|
multiple: i(() => t.multiple),
|
|
299
307
|
modelValue: r,
|
|
300
|
-
selectedValues:
|
|
301
|
-
leafNodes:
|
|
308
|
+
selectedValues: Q,
|
|
309
|
+
leafNodes: Ne,
|
|
302
310
|
allValue: i(() => t.showAllField)
|
|
303
|
-
}),
|
|
311
|
+
}), te = i({
|
|
304
312
|
get() {
|
|
305
313
|
if (t.multiple)
|
|
306
|
-
return (Array.isArray(r.value) ? r.value : r.value === void 0 ? [] : [r.value]).map((l) =>
|
|
314
|
+
return (Array.isArray(r.value) ? r.value : r.value === void 0 ? [] : [r.value]).map((l) => V(l));
|
|
307
315
|
if (Array.isArray(r.value)) {
|
|
308
316
|
const e = r.value.at(-1);
|
|
309
|
-
return e === void 0 ? void 0 :
|
|
317
|
+
return e === void 0 ? void 0 : V(e);
|
|
310
318
|
}
|
|
311
|
-
return r.value === void 0 ? void 0 :
|
|
319
|
+
return r.value === void 0 ? void 0 : V(r.value);
|
|
312
320
|
},
|
|
313
321
|
set(e) {
|
|
314
322
|
const l = s(r);
|
|
315
|
-
if (
|
|
316
|
-
const o = (Array.isArray(e) ? e : []).map((n) =>
|
|
317
|
-
r.value =
|
|
323
|
+
if (j = Array.isArray(l) ? [...l] : l, t.multiple) {
|
|
324
|
+
const o = (Array.isArray(e) ? e : []).map((n) => q(n)).filter((n) => n !== void 0);
|
|
325
|
+
r.value = qe(o);
|
|
318
326
|
return;
|
|
319
327
|
}
|
|
320
|
-
r.value =
|
|
328
|
+
r.value = q(e);
|
|
321
329
|
}
|
|
322
|
-
}),
|
|
330
|
+
}), ae = i(
|
|
323
331
|
() => {
|
|
324
332
|
const e = {}, l = {};
|
|
325
333
|
return k.value.forEach((a) => {
|
|
326
|
-
const { enabledCount: o, checkedCount: n } =
|
|
334
|
+
const { enabledCount: o, checkedCount: n } = Ke(a), u = String(a.value);
|
|
327
335
|
e[u] = o > 0 && n === o, l[u] = o > 0 && n > 0 && n < o;
|
|
328
336
|
}), { checkedMap: e, indeterminateMap: l };
|
|
329
337
|
}
|
|
330
|
-
),
|
|
331
|
-
function
|
|
332
|
-
const l = s(
|
|
338
|
+
), Qe = i(() => ae.value.checkedMap), Xe = i(() => ae.value.indeterminateMap), Ye = i(() => le.value.has(t.showAllField)), oe = i(() => [...t.showAll ? [{ label: "全部", value: t.showAllField }] : [], ...P.value.map((l) => ({ ...l }))]);
|
|
339
|
+
function el(e) {
|
|
340
|
+
const l = s(oe);
|
|
333
341
|
if (Array.isArray(e)) {
|
|
334
342
|
const a = new Set(e);
|
|
335
343
|
return l.filter((o) => o.value !== void 0 && a.has(o.value));
|
|
@@ -337,215 +345,216 @@ const m = 4, ht = /* @__PURE__ */ fl({
|
|
|
337
345
|
if (e !== void 0)
|
|
338
346
|
return l.find((a) => a.value === e);
|
|
339
347
|
}
|
|
340
|
-
function
|
|
348
|
+
function ll(e) {
|
|
341
349
|
var a;
|
|
342
350
|
if (t.showPinyinMode || k.value.some((o) => o.value === e.value)) return e.value;
|
|
343
351
|
const l = f.value.find((o) => o.path.some((n) => n.value === e.value));
|
|
344
352
|
return (a = l == null ? void 0 : l.path.at(-2)) == null ? void 0 : a.value;
|
|
345
353
|
}
|
|
346
|
-
function
|
|
347
|
-
|
|
348
|
-
const l =
|
|
349
|
-
|
|
354
|
+
function tl(e) {
|
|
355
|
+
F.value = e.value;
|
|
356
|
+
const l = ll(e);
|
|
357
|
+
$.value = void 0, G(() => {
|
|
350
358
|
var a;
|
|
351
|
-
|
|
359
|
+
$.value = l, l !== void 0 && ((a = N.value) == null || a.scrollToGroup(l));
|
|
352
360
|
});
|
|
353
361
|
}
|
|
354
|
-
function
|
|
355
|
-
|
|
362
|
+
function al(e) {
|
|
363
|
+
w.value = e;
|
|
356
364
|
}
|
|
357
|
-
function
|
|
365
|
+
function ol(e) {
|
|
358
366
|
p.value = e;
|
|
359
367
|
}
|
|
360
|
-
function
|
|
368
|
+
function nl(e, l) {
|
|
361
369
|
const a = k.value.find((o) => o.value === e);
|
|
362
|
-
a &&
|
|
370
|
+
a && We(a, l);
|
|
363
371
|
}
|
|
364
|
-
async function
|
|
372
|
+
async function rl(e) {
|
|
365
373
|
var l;
|
|
366
|
-
|
|
374
|
+
b("visible-change", e), e && (M(), p.value = "", w.value = "", await G(), (l = N.value) == null || l.inputFocus(), Y(), t.alwaysLoad ? await g() : !t.immediate && !s(Z) && await g());
|
|
367
375
|
}
|
|
368
|
-
function
|
|
369
|
-
|
|
376
|
+
function il() {
|
|
377
|
+
ne(j);
|
|
370
378
|
}
|
|
371
|
-
function
|
|
372
|
-
|
|
379
|
+
function sl(e) {
|
|
380
|
+
b("change", e, [...s(oe)], el(e));
|
|
373
381
|
}
|
|
374
|
-
function
|
|
382
|
+
function ul(e, l) {
|
|
375
383
|
return Array.isArray(e) && Array.isArray(l) ? e.length === l.length && e.every((a, o) => a === l[o]) : e === l;
|
|
376
384
|
}
|
|
377
|
-
function
|
|
378
|
-
|
|
385
|
+
function ne(e) {
|
|
386
|
+
G(() => {
|
|
379
387
|
const l = s(r);
|
|
380
|
-
|
|
388
|
+
ul(l, e) || sl(l);
|
|
381
389
|
});
|
|
382
390
|
}
|
|
383
391
|
function h(e) {
|
|
384
392
|
const l = s(r), a = Array.isArray(l) ? [...l] : l;
|
|
385
|
-
e(),
|
|
393
|
+
e(), ne(a);
|
|
386
394
|
}
|
|
387
|
-
function
|
|
395
|
+
function cl(e) {
|
|
388
396
|
h(() => {
|
|
389
|
-
|
|
397
|
+
Ue(e);
|
|
390
398
|
});
|
|
391
399
|
}
|
|
392
|
-
function
|
|
400
|
+
function dl(e) {
|
|
393
401
|
h(() => {
|
|
394
|
-
|
|
402
|
+
je(e);
|
|
395
403
|
});
|
|
396
404
|
}
|
|
397
|
-
function
|
|
405
|
+
function pl(e, l) {
|
|
398
406
|
h(() => {
|
|
399
|
-
|
|
407
|
+
nl(e, l);
|
|
400
408
|
});
|
|
401
409
|
}
|
|
402
|
-
function
|
|
410
|
+
function fl(e, l) {
|
|
403
411
|
h(() => {
|
|
404
|
-
|
|
412
|
+
Ze(e, l);
|
|
405
413
|
});
|
|
406
414
|
}
|
|
407
|
-
function
|
|
415
|
+
function re(e, l) {
|
|
408
416
|
h(() => {
|
|
409
|
-
|
|
417
|
+
ze(e, l);
|
|
410
418
|
});
|
|
411
419
|
}
|
|
412
|
-
function
|
|
420
|
+
function hl(e) {
|
|
413
421
|
h(() => {
|
|
414
|
-
|
|
422
|
+
Je(e);
|
|
415
423
|
});
|
|
416
424
|
}
|
|
417
|
-
function
|
|
425
|
+
function ml() {
|
|
418
426
|
h(() => {
|
|
419
|
-
|
|
427
|
+
He();
|
|
420
428
|
});
|
|
421
429
|
}
|
|
422
|
-
function
|
|
423
|
-
|
|
430
|
+
function vl(e) {
|
|
431
|
+
M(), b("focus", e);
|
|
424
432
|
}
|
|
425
|
-
return
|
|
433
|
+
return x(
|
|
426
434
|
() => t.params,
|
|
427
435
|
() => {
|
|
428
|
-
|
|
436
|
+
g();
|
|
429
437
|
},
|
|
430
438
|
{ deep: !0 }
|
|
431
|
-
),
|
|
432
|
-
|
|
439
|
+
), x(
|
|
440
|
+
xe,
|
|
433
441
|
(e) => {
|
|
434
442
|
var l;
|
|
435
|
-
|
|
443
|
+
F.value !== void 0 || !e.length || (F.value = (l = e[0]) == null ? void 0 : l.value);
|
|
436
444
|
},
|
|
437
445
|
{ immediate: !0 }
|
|
438
|
-
),
|
|
439
|
-
t.immediate &&
|
|
440
|
-
}),
|
|
446
|
+
), wl(() => {
|
|
447
|
+
t.immediate && g();
|
|
448
|
+
}), he({
|
|
441
449
|
/** 重新加载数据源*/
|
|
442
|
-
reload:
|
|
450
|
+
reload: g,
|
|
443
451
|
/** 获取当前归一化后的树形选项数据 */
|
|
444
|
-
getOptions: () => s(
|
|
452
|
+
getOptions: () => s(ke),
|
|
445
453
|
/** 获取当前v-model值 */
|
|
446
454
|
getValue: () => s(r)
|
|
447
|
-
}), (e, l) => (
|
|
455
|
+
}), (e, l) => (y(), _("div", {
|
|
448
456
|
ref_key: "selectWrapRef",
|
|
449
457
|
ref: A,
|
|
450
|
-
class:
|
|
458
|
+
class: S(s(d)),
|
|
459
|
+
onPointerdownCapture: M
|
|
451
460
|
}, [
|
|
452
|
-
|
|
461
|
+
ue(s(ge), Al({
|
|
453
462
|
ref_key: "selectRef",
|
|
454
|
-
ref:
|
|
455
|
-
modelValue:
|
|
456
|
-
"onUpdate:modelValue": l[0] || (l[0] = (a) =>
|
|
457
|
-
},
|
|
463
|
+
ref: X,
|
|
464
|
+
modelValue: te.value,
|
|
465
|
+
"onUpdate:modelValue": l[0] || (l[0] = (a) => te.value = a)
|
|
466
|
+
}, Fe.value, {
|
|
458
467
|
multiple: c.multiple,
|
|
459
468
|
filterable: !1,
|
|
460
|
-
placeholder:
|
|
469
|
+
placeholder: be.value,
|
|
461
470
|
persistent: !1,
|
|
462
471
|
"fallback-placements": ["bottom-start", "bottom-end", "bottom", "top-start", "top-end", "top", "right", "left"],
|
|
463
472
|
disabled: c.disabled,
|
|
464
473
|
"popper-class": `${s(d)}__popper vxe-table--ignore-clear`,
|
|
465
|
-
onVisibleChange:
|
|
466
|
-
onChange:
|
|
467
|
-
onFocus:
|
|
474
|
+
onVisibleChange: rl,
|
|
475
|
+
onChange: il,
|
|
476
|
+
onFocus: vl
|
|
468
477
|
}), {
|
|
469
|
-
label:
|
|
470
|
-
|
|
471
|
-
class:
|
|
478
|
+
label: ce(({ label: a, value: o }) => [
|
|
479
|
+
pe("span", {
|
|
480
|
+
class: S(`${s(d)}__trigger-label`)
|
|
472
481
|
}, [
|
|
473
|
-
|
|
474
|
-
|
|
482
|
+
pe("span", null, xl(a), 1),
|
|
483
|
+
Me(o) ? (y(), _("span", {
|
|
475
484
|
key: 0,
|
|
476
|
-
class:
|
|
477
|
-
}, "删", 2)) :
|
|
485
|
+
class: S(`${s(d)}__deleted-mark`)
|
|
486
|
+
}, "删", 2)) : T("", !0)
|
|
478
487
|
], 2)
|
|
479
488
|
]),
|
|
480
|
-
empty:
|
|
481
|
-
|
|
489
|
+
empty: ce(() => [
|
|
490
|
+
Cl((y(), _("div", {
|
|
482
491
|
"element-loading-text": "加载中",
|
|
483
|
-
class:
|
|
484
|
-
style:
|
|
485
|
-
"--columns":
|
|
486
|
-
"--panel-min-width":
|
|
487
|
-
"--panel-width":
|
|
492
|
+
class: S(`${s(d)}__panel`),
|
|
493
|
+
style: kl({
|
|
494
|
+
"--columns": Be.value,
|
|
495
|
+
"--panel-min-width": _e.value,
|
|
496
|
+
"--panel-width": L.value ? `${L.value}px` : "100%"
|
|
488
497
|
})
|
|
489
498
|
}, [
|
|
490
|
-
t.showNav ? (
|
|
499
|
+
t.showNav ? (y(), de(Dl, {
|
|
491
500
|
key: 0,
|
|
492
501
|
"prefix-cls": s(d),
|
|
493
|
-
keyword:
|
|
494
|
-
"tree-data":
|
|
495
|
-
"expanded-keys":
|
|
502
|
+
keyword: w.value,
|
|
503
|
+
"tree-data": ee.value,
|
|
504
|
+
"expanded-keys": $e.value,
|
|
496
505
|
"left-placeholder": c.leftPlaceholder,
|
|
497
|
-
"onUpdate:keyword":
|
|
498
|
-
onSelect:
|
|
499
|
-
}, null, 8, ["prefix-cls", "keyword", "tree-data", "expanded-keys", "left-placeholder"])) :
|
|
500
|
-
|
|
506
|
+
"onUpdate:keyword": al,
|
|
507
|
+
onSelect: tl
|
|
508
|
+
}, null, 8, ["prefix-cls", "keyword", "tree-data", "expanded-keys", "left-placeholder"])) : T("", !0),
|
|
509
|
+
ue(Il, {
|
|
501
510
|
ref_key: "middleRef",
|
|
502
|
-
ref:
|
|
511
|
+
ref: N,
|
|
503
512
|
"allow-create": t.allowCreate,
|
|
504
513
|
"prefix-cls": s(d),
|
|
505
514
|
multiple: c.multiple,
|
|
506
515
|
keyword: p.value,
|
|
507
|
-
rows:
|
|
508
|
-
disabled:
|
|
516
|
+
rows: Te.value,
|
|
517
|
+
disabled: H.value,
|
|
509
518
|
"show-all": t.showAll,
|
|
510
|
-
"option-per-row":
|
|
519
|
+
"option-per-row": v,
|
|
511
520
|
"row-height": 40,
|
|
512
|
-
"selected-value-set": s(
|
|
513
|
-
"is-all-checked": s(
|
|
514
|
-
"is-indeterminate": s(
|
|
515
|
-
"all-checked":
|
|
516
|
-
"scroll-to-group-value":
|
|
517
|
-
"group-checked-map":
|
|
518
|
-
"group-indeterminate-map":
|
|
521
|
+
"selected-value-set": s(le),
|
|
522
|
+
"is-all-checked": s(De),
|
|
523
|
+
"is-indeterminate": s(Ie),
|
|
524
|
+
"all-checked": Ye.value,
|
|
525
|
+
"scroll-to-group-value": $.value,
|
|
526
|
+
"group-checked-map": Qe.value,
|
|
527
|
+
"group-indeterminate-map": Xe.value,
|
|
519
528
|
"paste-search": c.pasteSearch,
|
|
520
529
|
separator: c.separator,
|
|
521
530
|
"middle-placeholder": c.middlePlaceholder,
|
|
522
531
|
"show-multiple": c.showMultiple,
|
|
523
|
-
"onUpdate:keyword":
|
|
524
|
-
onAllCheck:
|
|
525
|
-
onCheckAll:
|
|
526
|
-
onGroupCheck:
|
|
527
|
-
onOptionCheck:
|
|
528
|
-
onOptionsCheck:
|
|
529
|
-
onSelectCreatedOptions:
|
|
532
|
+
"onUpdate:keyword": ol,
|
|
533
|
+
onAllCheck: cl,
|
|
534
|
+
onCheckAll: dl,
|
|
535
|
+
onGroupCheck: pl,
|
|
536
|
+
onOptionCheck: fl,
|
|
537
|
+
onOptionsCheck: re,
|
|
538
|
+
onSelectCreatedOptions: Re
|
|
530
539
|
}, null, 8, ["allow-create", "prefix-cls", "multiple", "keyword", "rows", "disabled", "show-all", "selected-value-set", "is-all-checked", "is-indeterminate", "all-checked", "scroll-to-group-value", "group-checked-map", "group-indeterminate-map", "paste-search", "separator", "middle-placeholder", "show-multiple"]),
|
|
531
|
-
t.multiple ? (
|
|
540
|
+
t.multiple ? (y(), de(Kl, {
|
|
532
541
|
key: 1,
|
|
533
542
|
"prefix-cls": s(d),
|
|
534
543
|
multiple: c.multiple,
|
|
535
|
-
disabled:
|
|
536
|
-
"selected-options": s(
|
|
537
|
-
onClearAll:
|
|
538
|
-
onRemove:
|
|
539
|
-
}, null, 8, ["prefix-cls", "multiple", "disabled", "selected-options"])) :
|
|
544
|
+
disabled: H.value,
|
|
545
|
+
"selected-options": s(Ge),
|
|
546
|
+
onClearAll: ml,
|
|
547
|
+
onRemove: hl
|
|
548
|
+
}, null, 8, ["prefix-cls", "multiple", "disabled", "selected-options"])) : T("", !0)
|
|
540
549
|
], 6)), [
|
|
541
|
-
[s(
|
|
550
|
+
[s(ve), s(W)]
|
|
542
551
|
])
|
|
543
552
|
]),
|
|
544
553
|
_: 1
|
|
545
554
|
}, 16, ["modelValue", "multiple", "placeholder", "disabled", "popper-class"])
|
|
546
|
-
],
|
|
555
|
+
], 34));
|
|
547
556
|
}
|
|
548
557
|
});
|
|
549
558
|
export {
|
|
550
|
-
|
|
559
|
+
Ct as default
|
|
551
560
|
};
|