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