color-star-custom-components 0.0.7 → 0.0.8
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/es/SearchBar.mjs +87 -80
- package/es/TreeSelect.mjs +1 -1
- package/es/TreeShowSelect.mjs +1 -1
- package/es/assets/SearchBar.css +1 -1
- package/es/assets/layout2.css +1 -1
- package/es/chunks/layout.DQ1xjWEm.js +406 -0
- package/lib/SearchBar.js +1 -1
- package/lib/TreeSelect.js +1 -1
- package/lib/TreeShowSelect.js +1 -1
- package/lib/assets/SearchBar.css +1 -1
- package/lib/assets/layout2.css +1 -1
- package/lib/chunks/layout.BhOA_UzD.js +1 -0
- package/package.json +4 -4
package/es/SearchBar.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { w as ke } from "./chunks/index.bCzIhWFw.js";
|
|
2
|
-
import { renderSlot as k, createElementBlock as $, openBlock as i, Fragment as
|
|
3
|
-
import { ElButton as
|
|
2
|
+
import { renderSlot as k, createElementBlock as $, openBlock as i, Fragment as F, renderList as E, createBlock as c, unref as t, withCtx as r, createTextVNode as V, toDisplayString as M, useCssVars as le, ref as p, computed as W, withModifiers as be, normalizeClass as N, mergeProps as g, createCommentVNode as O, withKeys as ge, onMounted as we, watch as Ve, createElementVNode as w, createVNode as m, createSlots as x, normalizeProps as H, guardReactiveProps as K, normalizeStyle as Ce } from "vue";
|
|
3
|
+
import { ElButton as T, ElForm as De, ElFormItem as oe, ElInput as Z, ElDatePicker as $e, ElInputNumber as Ee, ElSwitch as xe, ElRadioGroup as We, ElRadio as Fe, ElCheckboxGroup as Me, ElCheckbox as Be, ElAutoResizer as _, ElPopover as Ue, ElIcon as ee, ElDrawer as Ie } from "element-plus";
|
|
4
4
|
import { IconMagnify as Le, IconCheck as Pe, IconUp as Se, IconDown as Ne, IconShrink as Oe } from "color-message-lingyun-vue";
|
|
5
5
|
import { operationConfigMap as D, emitsMap as f, labelPositionMap as P, componentType as v, dateParamsMap as Te, dateFormat as ae } from "color-star-custom-methods";
|
|
6
6
|
import { _ as ze } from "./chunks/layout.CR6q_HFP.js";
|
|
@@ -16,7 +16,8 @@ import './assets/SearchBar.css';const je = [
|
|
|
16
16
|
{
|
|
17
17
|
type: "default",
|
|
18
18
|
label: "重置",
|
|
19
|
-
value: D.reset
|
|
19
|
+
value: D.reset,
|
|
20
|
+
plain: !0
|
|
20
21
|
}
|
|
21
22
|
], re = 320, q = {
|
|
22
23
|
__name: "OperationButtons",
|
|
@@ -27,24 +28,25 @@ import './assets/SearchBar.css';const je = [
|
|
|
27
28
|
}
|
|
28
29
|
},
|
|
29
30
|
emits: [f.operation],
|
|
30
|
-
setup(a, { emit:
|
|
31
|
-
const C =
|
|
31
|
+
setup(a, { emit: B }) {
|
|
32
|
+
const C = B, u = (h) => {
|
|
32
33
|
C(f.operation, h);
|
|
33
34
|
};
|
|
34
35
|
return (h, n) => h.$slots.operation ? k(h.$slots, "operation", {
|
|
35
36
|
key: 0,
|
|
36
37
|
operationList: a.operationList
|
|
37
|
-
}) : (i(!0), $(
|
|
38
|
+
}) : (i(!0), $(F, { key: 1 }, E(a.operationList, (y) => (i(), c(t(T), {
|
|
38
39
|
key: y.value,
|
|
39
40
|
type: y.type,
|
|
40
41
|
icon: y.icon,
|
|
41
|
-
|
|
42
|
+
plain: y.plain,
|
|
43
|
+
onClick: (e) => u(y.value)
|
|
42
44
|
}, {
|
|
43
45
|
default: r(() => [
|
|
44
|
-
V(
|
|
46
|
+
V(M(y.label), 1)
|
|
45
47
|
]),
|
|
46
48
|
_: 2
|
|
47
|
-
}, 1032, ["type", "icon", "onClick"]))), 128));
|
|
49
|
+
}, 1032, ["type", "icon", "plain", "onClick"]))), 128));
|
|
48
50
|
}
|
|
49
51
|
}, Ae = /* @__PURE__ */ Object.assign({
|
|
50
52
|
name: "FormWrapper"
|
|
@@ -107,31 +109,31 @@ import './assets/SearchBar.css';const je = [
|
|
|
107
109
|
}
|
|
108
110
|
},
|
|
109
111
|
emits: [f.change, f.enter],
|
|
110
|
-
setup(a, { expose:
|
|
112
|
+
setup(a, { expose: B }) {
|
|
111
113
|
le((n) => ({
|
|
112
|
-
|
|
114
|
+
v38755745: a.minWidth + "px"
|
|
113
115
|
}));
|
|
114
|
-
const C = a,
|
|
115
|
-
return
|
|
116
|
-
validate: (n) =>
|
|
116
|
+
const C = a, u = p(null), h = W(() => C.isFilter ? "filter-form" : C.isFilterPreview ? "filter-preview-form" : C.fixedWidth ? "search-bar-form search-bar-form-fixed" : "search-bar-form");
|
|
117
|
+
return B({
|
|
118
|
+
validate: (n) => u.value ? u.value.validate(n) : Promise.resolve(!0),
|
|
117
119
|
resetFields: () => {
|
|
118
|
-
|
|
120
|
+
u.value && u.value.resetFields();
|
|
119
121
|
},
|
|
120
122
|
clearValidate: (n) => {
|
|
121
|
-
|
|
123
|
+
u.value && u.value.clearValidate(n);
|
|
122
124
|
},
|
|
123
125
|
scrollToField: (n) => {
|
|
124
|
-
|
|
126
|
+
u.value && u.value.scrollToField(n);
|
|
125
127
|
}
|
|
126
128
|
}), (n, y) => (i(), c(t(De), {
|
|
127
129
|
ref_key: "formRef",
|
|
128
|
-
ref:
|
|
130
|
+
ref: u,
|
|
129
131
|
model: a.formData,
|
|
130
132
|
"label-width": a.labelWidth,
|
|
131
133
|
"label-position": a.labelPosition,
|
|
132
134
|
inline: a.inline,
|
|
133
135
|
rules: a.rules,
|
|
134
|
-
class:
|
|
136
|
+
class: N({
|
|
135
137
|
[h.value]: !0,
|
|
136
138
|
"items-end display-grid": !a.isFilterPreview
|
|
137
139
|
}),
|
|
@@ -139,7 +141,7 @@ import './assets/SearchBar.css';const je = [
|
|
|
139
141
|
}, ["prevent", "stop"]))
|
|
140
142
|
}, {
|
|
141
143
|
default: r(() => [
|
|
142
|
-
(i(!0), $(
|
|
144
|
+
(i(!0), $(F, null, E(a.items, (e) => (i(), c(t(oe), g({
|
|
143
145
|
key: e.key,
|
|
144
146
|
label: a.showLabel ? e.label : "",
|
|
145
147
|
prop: e.key,
|
|
@@ -197,41 +199,41 @@ import './assets/SearchBar.css';const je = [
|
|
|
197
199
|
"onUpdate:modelValue": (l) => a.formData[e.key] = l
|
|
198
200
|
}, { ref_for: !0 }, e, {
|
|
199
201
|
onChange: (l) => n.$emit(t(f).change, e.key, a.formData[e.key])
|
|
200
|
-
}), null, 16, ["modelValue", "onUpdate:modelValue", "onChange"])) : e.type === t(v).radio ? (i(), c(t(
|
|
202
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "onChange"])) : e.type === t(v).radio ? (i(), c(t(We), {
|
|
201
203
|
key: 5,
|
|
202
204
|
modelValue: a.formData[e.key],
|
|
203
205
|
"onUpdate:modelValue": (l) => a.formData[e.key] = l,
|
|
204
206
|
onChange: (l) => n.$emit(t(f).change, e.key, a.formData[e.key])
|
|
205
207
|
}, {
|
|
206
208
|
default: r(() => [
|
|
207
|
-
(i(!0), $(
|
|
209
|
+
(i(!0), $(F, null, E(e.options, (l) => (i(), c(t(Fe), {
|
|
208
210
|
key: l.value,
|
|
209
211
|
label: l.value,
|
|
210
212
|
value: l.value,
|
|
211
213
|
disabled: l.disabled
|
|
212
214
|
}, {
|
|
213
215
|
default: r(() => [
|
|
214
|
-
V(
|
|
216
|
+
V(M(l.label), 1)
|
|
215
217
|
]),
|
|
216
218
|
_: 2
|
|
217
219
|
}, 1032, ["label", "value", "disabled"]))), 128))
|
|
218
220
|
]),
|
|
219
221
|
_: 2
|
|
220
|
-
}, 1032, ["modelValue", "onUpdate:modelValue", "onChange"])) : e.type === t(v).checkbox ? (i(), c(t(
|
|
222
|
+
}, 1032, ["modelValue", "onUpdate:modelValue", "onChange"])) : e.type === t(v).checkbox ? (i(), c(t(Me), {
|
|
221
223
|
key: 6,
|
|
222
224
|
modelValue: a.formData[e.key],
|
|
223
225
|
"onUpdate:modelValue": (l) => a.formData[e.key] = l,
|
|
224
226
|
onChange: (l) => n.$emit(t(f).change, e.key, a.formData[e.key])
|
|
225
227
|
}, {
|
|
226
228
|
default: r(() => [
|
|
227
|
-
(i(!0), $(
|
|
229
|
+
(i(!0), $(F, null, E(e.options, (l) => (i(), c(t(Be), {
|
|
228
230
|
key: l.value,
|
|
229
231
|
label: l.value,
|
|
230
232
|
value: l.value,
|
|
231
233
|
disabled: l.disabled
|
|
232
234
|
}, {
|
|
233
235
|
default: r(() => [
|
|
234
|
-
V(
|
|
236
|
+
V(M(l.label), 1)
|
|
235
237
|
]),
|
|
236
238
|
_: 2
|
|
237
239
|
}, 1032, ["label", "value", "disabled"]))), 128))
|
|
@@ -249,7 +251,7 @@ import './assets/SearchBar.css';const je = [
|
|
|
249
251
|
key: 8,
|
|
250
252
|
modelValue: a.formData[e.key],
|
|
251
253
|
"onUpdate:modelValue": (l) => a.formData[e.key] = l
|
|
252
|
-
}, { ref_for: !0 }, e), null, 16, ["modelValue", "onUpdate:modelValue"])) :
|
|
254
|
+
}, { ref_for: !0 }, e), null, 16, ["modelValue", "onUpdate:modelValue"])) : O("", !0)
|
|
253
255
|
], !0)
|
|
254
256
|
]),
|
|
255
257
|
_: 2
|
|
@@ -259,7 +261,7 @@ import './assets/SearchBar.css';const je = [
|
|
|
259
261
|
_: 3
|
|
260
262
|
}, 8, ["model", "label-width", "label-position", "inline", "rules", "class"]));
|
|
261
263
|
}
|
|
262
|
-
}), G = /* @__PURE__ */ ne(Ae, [["__scopeId", "data-v-
|
|
264
|
+
}), G = /* @__PURE__ */ ne(Ae, [["__scopeId", "data-v-8adcd08b"]]), He = { class: "h-32 w-full" }, Ke = { class: "flex items-center justify-between pd-b-20" }, qe = { class: "text-right" }, Ge = { class: "drawer-header" }, Je = { class: "flex-1 pd-l-16 pd-r-16 overflow-y-auto" }, Qe = { class: "text-right border-top pd-t-16 pd-l-16 pd-r-16" }, Xe = /* @__PURE__ */ Object.assign({
|
|
263
265
|
name: "SearchBar"
|
|
264
266
|
}, {
|
|
265
267
|
__name: "layout",
|
|
@@ -321,35 +323,39 @@ import './assets/SearchBar.css';const je = [
|
|
|
321
323
|
}
|
|
322
324
|
},
|
|
323
325
|
emits: [f.updateModelValue, f.operation, f.change],
|
|
324
|
-
setup(a, { expose:
|
|
326
|
+
setup(a, { expose: B, emit: C }) {
|
|
325
327
|
le((o) => ({
|
|
326
|
-
|
|
327
|
-
|
|
328
|
+
c43334b4: a.maxHeight + "px",
|
|
329
|
+
v002cf482: S.value ? S.value + "px" : "100%"
|
|
328
330
|
}));
|
|
329
|
-
const
|
|
331
|
+
const u = a, h = C, n = p({}), y = p(!u.isExpand), e = p(null), l = p(!1), U = p(!1), z = p(!1), ie = W(() => {
|
|
330
332
|
const o = {};
|
|
331
|
-
return
|
|
332
|
-
if (
|
|
333
|
-
const s = [{ required: !0, message: `${
|
|
334
|
-
typeof
|
|
333
|
+
return u.items.forEach((d) => {
|
|
334
|
+
if (d.required) {
|
|
335
|
+
const s = [{ required: !0, message: `${d.label}不能为空`, trigger: "blur" }];
|
|
336
|
+
typeof d.validator == "function" && s.push({ validator: d.validator, trigger: "blur" }), o[d.key] = s;
|
|
335
337
|
}
|
|
336
338
|
}), o;
|
|
337
|
-
}),
|
|
339
|
+
}), R = W(() => u.items?.filter((o) => !o.hidden) || []), J = W(() => u.filterMode ? R.value?.slice(0, 2) || [] : R.value), I = W(() => u.filterMode ? R.value.slice(2) : []), Q = (o) => {
|
|
338
340
|
n.value = { ...o };
|
|
339
341
|
}, ue = () => {
|
|
340
342
|
h(f.updateModelValue, { ...n.value });
|
|
341
|
-
}, de = (o,
|
|
342
|
-
n.value[o] =
|
|
343
|
-
|
|
344
|
-
}, 200),
|
|
345
|
-
},
|
|
346
|
-
o && h(f.change, o,
|
|
347
|
-
}, se = () => n.value,
|
|
348
|
-
|
|
343
|
+
}, de = (o, d) => {
|
|
344
|
+
n.value[o] = d, z.value = !0, L(D.search), setTimeout(() => {
|
|
345
|
+
z.value = !1;
|
|
346
|
+
}, 200), j(o, d);
|
|
347
|
+
}, j = (o, d) => {
|
|
348
|
+
o && h(f.change, o, d);
|
|
349
|
+
}, se = () => n.value, A = (o, d) => {
|
|
350
|
+
z.value || h(f.operation, D.search, n.value);
|
|
349
351
|
}, L = (o) => {
|
|
350
352
|
ue(), h(f.operation, o, n.value), (o === D.search || o === D.reset) && (l.value = !1, U.value = !1);
|
|
351
|
-
}, fe = (o) => e.value.validate(o),
|
|
352
|
-
|
|
353
|
+
}, fe = (o) => e.value.validate(o), S = p(0), me = (o) => {
|
|
354
|
+
if (u.fixedWidth) {
|
|
355
|
+
S.value = 132;
|
|
356
|
+
return;
|
|
357
|
+
}
|
|
358
|
+
S.value = o + 32;
|
|
353
359
|
}, ce = () => {
|
|
354
360
|
y.value = !y.value;
|
|
355
361
|
}, ye = () => {
|
|
@@ -357,34 +363,34 @@ import './assets/SearchBar.css';const je = [
|
|
|
357
363
|
}, he = () => {
|
|
358
364
|
U.value = !1, l.value = !0;
|
|
359
365
|
}, X = p(!1), Y = (o) => {
|
|
360
|
-
X.value = o >
|
|
361
|
-
}, ve =
|
|
366
|
+
X.value = o > u.maxHeight;
|
|
367
|
+
}, ve = W(() => u.filterMode || y.value ? "10px" : "0");
|
|
362
368
|
return we(() => {
|
|
363
|
-
Q(
|
|
369
|
+
Q(u.modelValue), Y();
|
|
364
370
|
}), Ve(
|
|
365
|
-
() =>
|
|
371
|
+
() => u.modelValue,
|
|
366
372
|
(o) => {
|
|
367
373
|
Q(o);
|
|
368
374
|
},
|
|
369
375
|
{ immediate: !0, deep: !0 }
|
|
370
|
-
),
|
|
376
|
+
), B({
|
|
371
377
|
validate: fe,
|
|
372
378
|
getFormData: se,
|
|
373
379
|
// clearValidate,
|
|
374
380
|
// resetFields,
|
|
375
381
|
// scrollToField,
|
|
376
382
|
formRef: e
|
|
377
|
-
}), (o,
|
|
378
|
-
class:
|
|
383
|
+
}), (o, d) => (i(), $("div", {
|
|
384
|
+
class: N(["relative overflow-hidden w-full", { flex: a.filterMode }])
|
|
379
385
|
}, [
|
|
380
386
|
w("div", {
|
|
381
|
-
class:
|
|
387
|
+
class: N({
|
|
382
388
|
"is-collapsed overflow-hidden": !y.value
|
|
383
389
|
})
|
|
384
390
|
}, [
|
|
385
391
|
m(t(_), null, {
|
|
386
392
|
default: r(({ height: s }) => [
|
|
387
|
-
V(
|
|
393
|
+
V(M(Y(s)) + " ", 1),
|
|
388
394
|
m(G, {
|
|
389
395
|
ref_key: "formRef",
|
|
390
396
|
ref: e,
|
|
@@ -399,7 +405,7 @@ import './assets/SearchBar.css';const je = [
|
|
|
399
405
|
"is-filter-preview": a.filterMode,
|
|
400
406
|
fixedWidth: a.fixedWidth,
|
|
401
407
|
onChange: de,
|
|
402
|
-
onEnter:
|
|
408
|
+
onEnter: A
|
|
403
409
|
}, x({
|
|
404
410
|
default: r(() => [
|
|
405
411
|
a.isExpand && !a.filterMode ? (i(), c(t(oe), {
|
|
@@ -410,14 +416,14 @@ import './assets/SearchBar.css';const je = [
|
|
|
410
416
|
w("div", He, [
|
|
411
417
|
m(t(_), null, {
|
|
412
418
|
default: r(({ width: b }) => [
|
|
413
|
-
V(
|
|
419
|
+
V(M(me(b)), 1)
|
|
414
420
|
]),
|
|
415
421
|
_: 1
|
|
416
422
|
})
|
|
417
423
|
])
|
|
418
424
|
]),
|
|
419
425
|
_: 1
|
|
420
|
-
})) :
|
|
426
|
+
})) : O("", !0)
|
|
421
427
|
]),
|
|
422
428
|
_: 2
|
|
423
429
|
}, [
|
|
@@ -433,18 +439,19 @@ import './assets/SearchBar.css';const je = [
|
|
|
433
439
|
})
|
|
434
440
|
], 2),
|
|
435
441
|
w("div", {
|
|
436
|
-
class:
|
|
437
|
-
"absolute right-0
|
|
438
|
-
"text-left": a.filterMode
|
|
442
|
+
class: N(["operation-buttons", {
|
|
443
|
+
"absolute right-0 text-right": a.isExpand && !a.filterMode,
|
|
444
|
+
"text-left": a.filterMode,
|
|
445
|
+
"bg-fff": a.isExpand && !a.filterMode && !a.fixedWidth
|
|
439
446
|
}]),
|
|
440
447
|
style: Ce({ bottom: ve.value })
|
|
441
448
|
}, [
|
|
442
|
-
a.filterMode ? (i(), $(
|
|
443
|
-
m(t(
|
|
444
|
-
onClick:
|
|
449
|
+
a.filterMode ? (i(), $(F, { key: 0 }, [
|
|
450
|
+
m(t(T), {
|
|
451
|
+
onClick: d[0] || (d[0] = (s) => L(t(D).reset)),
|
|
445
452
|
type: "default"
|
|
446
453
|
}, {
|
|
447
|
-
default: r(() => [...
|
|
454
|
+
default: r(() => [...d[3] || (d[3] = [
|
|
448
455
|
V("重置", -1)
|
|
449
456
|
])]),
|
|
450
457
|
_: 1
|
|
@@ -457,12 +464,12 @@ import './assets/SearchBar.css';const je = [
|
|
|
457
464
|
trigger: "click"
|
|
458
465
|
}, {
|
|
459
466
|
reference: r(() => [
|
|
460
|
-
m(t(
|
|
461
|
-
onClick:
|
|
467
|
+
m(t(T), {
|
|
468
|
+
onClick: d[1] || (d[1] = (s) => l.value = !l.value),
|
|
462
469
|
icon: t(Pe),
|
|
463
470
|
type: "default"
|
|
464
471
|
}, {
|
|
465
|
-
default: r(() => [...
|
|
472
|
+
default: r(() => [...d[4] || (d[4] = [
|
|
466
473
|
V(" 筛选器 ", -1)
|
|
467
474
|
])]),
|
|
468
475
|
_: 1
|
|
@@ -494,8 +501,8 @@ import './assets/SearchBar.css';const je = [
|
|
|
494
501
|
"is-filter": !0,
|
|
495
502
|
"min-width": a.minWidth,
|
|
496
503
|
class: "filter-form-popover overflow-y-auto",
|
|
497
|
-
onChange:
|
|
498
|
-
onEnter:
|
|
504
|
+
onChange: j,
|
|
505
|
+
onEnter: A
|
|
499
506
|
}, x({ _: 2 }, [
|
|
500
507
|
E(I.value, (s) => ({
|
|
501
508
|
name: s.key,
|
|
@@ -520,19 +527,19 @@ import './assets/SearchBar.css';const je = [
|
|
|
520
527
|
])
|
|
521
528
|
]),
|
|
522
529
|
_: 3
|
|
523
|
-
}, 8, ["visible"])) :
|
|
524
|
-
], 64)) : (i(), $(
|
|
525
|
-
X.value && a.isExpand && a.hideExpandButton ? (i(), c(t(
|
|
530
|
+
}, 8, ["visible"])) : O("", !0)
|
|
531
|
+
], 64)) : (i(), $(F, { key: 1 }, [
|
|
532
|
+
X.value && a.isExpand && a.hideExpandButton ? (i(), c(t(T), {
|
|
526
533
|
key: 0,
|
|
527
534
|
icon: y.value ? t(Se) : t(Ne),
|
|
528
535
|
text: "",
|
|
529
536
|
onClick: ce
|
|
530
537
|
}, {
|
|
531
538
|
default: r(() => [
|
|
532
|
-
V(
|
|
539
|
+
V(M(y.value ? "收起" : "展开"), 1)
|
|
533
540
|
]),
|
|
534
541
|
_: 1
|
|
535
|
-
}, 8, ["icon"])) :
|
|
542
|
+
}, 8, ["icon"])) : O("", !0),
|
|
536
543
|
m(q, {
|
|
537
544
|
"operation-list": a.operationList,
|
|
538
545
|
onOperation: L
|
|
@@ -549,7 +556,7 @@ import './assets/SearchBar.css';const je = [
|
|
|
549
556
|
], 6),
|
|
550
557
|
m(t(Ie), {
|
|
551
558
|
modelValue: U.value,
|
|
552
|
-
"onUpdate:modelValue":
|
|
559
|
+
"onUpdate:modelValue": d[2] || (d[2] = (s) => U.value = s),
|
|
553
560
|
size: "628",
|
|
554
561
|
"show-close": !1
|
|
555
562
|
}, {
|
|
@@ -582,8 +589,8 @@ import './assets/SearchBar.css';const je = [
|
|
|
582
589
|
"show-label": !0,
|
|
583
590
|
"is-filter": !0,
|
|
584
591
|
"min-width": a.minWidth,
|
|
585
|
-
onChange:
|
|
586
|
-
onEnter:
|
|
592
|
+
onChange: j,
|
|
593
|
+
onEnter: A
|
|
587
594
|
}, x({ _: 2 }, [
|
|
588
595
|
E(I.value, (s) => ({
|
|
589
596
|
name: s.key,
|
|
@@ -612,7 +619,7 @@ import './assets/SearchBar.css';const je = [
|
|
|
612
619
|
}, 8, ["modelValue"])
|
|
613
620
|
], 2));
|
|
614
621
|
}
|
|
615
|
-
}), Ye = /* @__PURE__ */ ne(Xe, [["__scopeId", "data-v-
|
|
622
|
+
}), Ye = /* @__PURE__ */ ne(Xe, [["__scopeId", "data-v-3877c183"]]), ia = ke(Ye);
|
|
616
623
|
export {
|
|
617
624
|
ia as SearchBar,
|
|
618
625
|
ia as default
|
package/es/TreeSelect.mjs
CHANGED
package/es/TreeShowSelect.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { w as g } from "./chunks/index.bCzIhWFw.js";
|
|
2
2
|
import { useAttrs as w, ref as u, computed as y, watch as k, createBlock as P, openBlock as C, unref as n, withCtx as T, createElementVNode as o, normalizeStyle as z, toDisplayString as p, createVNode as m, mergeProps as D } from "vue";
|
|
3
3
|
import { ElAutoResizer as L } from "element-plus";
|
|
4
|
-
import { T as f } from "./chunks/layout.
|
|
4
|
+
import { T as f } from "./chunks/layout.DQ1xjWEm.js";
|
|
5
5
|
import { _ as R } from "./chunks/_plugin-vue_export-helper.CHgC5LLL.js";
|
|
6
6
|
import './assets/TreeShowSelect.css';const j = { class: "left-box w-50-percent flex flex-col" }, A = { class: "head-box fz-14 pd-t-8 pd-b-8 pd-l-12 pd-r-12 mg-b-8 text-202434" }, B = { class: "pd-r-12 pd-l-12 flex-1" }, E = { class: "right-box w-50-percent flex flex-col" }, H = { class: "head-box fz-14 pd-t-8 pd-b-8 pd-l-12 pd-r-12 mg-b-8 text-202434" }, I = { class: "pd-r-12 pd-l-12 flex-1 selected-list overflow-y-auto pd-t-8" }, O = /* @__PURE__ */ Object.assign({
|
|
7
7
|
name: "TreeShowSelect"
|
package/es/assets/SearchBar.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.filter-form[data-v-
|
|
1
|
+
.filter-form[data-v-8adcd08b]{grid-template-columns:repeat(2,1fr);gap:10px}.filter-preview-form[data-v-8adcd08b]{display:flex}.filter-preview-form .el-form-item[data-v-8adcd08b]{width:var(--v38755745);margin-right:10px}.search-bar-form[data-v-8adcd08b]{grid-template-columns:repeat(auto-fit,minmax(var(--v38755745),1fr));gap:10px}.search-bar-form.search-bar-form-fixed[data-v-8adcd08b]{grid-template-columns:repeat(auto-fit,var(--v38755745))}.search-bar-form.search-bar-form-fixed.el-form--inline .el-form-item[data-v-8adcd08b]{margin-bottom:18px}.search-bar-form.el-form--inline .el-form-item[data-v-8adcd08b]{margin-right:0;margin-bottom:10px}.search-bar-form.el-form--inline .el-form-item.el-form-item--label-left[data-v-8adcd08b]{display:flex;padding:0 14px;background:var(--neutral-color-18);border-radius:8px;border:1px solid var(--parting-line)}.search-bar-form.el-form--inline .el-form-item.el-form-item--label-left[data-v-8adcd08b] .el-form-item__content{justify-content:end}.search-bar-form.el-form--inline.el-form--label-top[data-v-8adcd08b]{display:grid}.search-bar-item--wide[data-v-8adcd08b]{grid-column:span 2}.is-collapsed[data-v-3877c183]{max-height:var(--c43334b4)}.operation-buttons[data-v-3877c183]{width:var(--v002cf482);z-index:1}.h-32[data-v-3877c183]{height:32px}.drawer-header[data-v-3877c183]{display:flex;justify-content:space-between;align-items:center;width:100%}.drawer-header .shrink-button[data-v-3877c183]{margin-left:auto}.border-top[data-v-3877c183]{border-top:1px solid var(--parting-line)}[data-v-3877c183] .el-drawer__body{padding:16px 0;display:flex;flex-direction:column;overflow:hidden}.filter-form-popover[data-v-3877c183]{max-height:400px}[data-v-3877c183] .el-drawer__header{margin-bottom:0;padding:16px 16px 0}
|
package/es/assets/layout2.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.el-tree .el-tree-node__content{position:relative}.element-tree-node-label-wrapper{flex:1;display:flex;align-items:center}.element-tree-node-label{font-size:12px}.element-tree-node-line-ver{display:block;position:absolute;top:0;left:0;height:100%;border-left:1px dashed #dcdfe6}.element-tree-node-line-ver.last-node-isLeaf-line{height:50%}.element-tree-node-line-hor{display:block;position:absolute;top:50%;left:0;height:0;border-bottom:1px dashed #dcdfe6}.element-tree-node-label-line{flex:1;border-top:1px dashed #dcdfe6;align-self:center;margin:0 10px}[data-v-
|
|
1
|
+
.el-tree .el-tree-node__content{position:relative}.element-tree-node-label-wrapper{flex:1;display:flex;align-items:center}.element-tree-node-label{font-size:12px}.element-tree-node-line-ver{display:block;position:absolute;top:0;left:0;height:100%;border-left:1px dashed #dcdfe6}.element-tree-node-line-ver.last-node-isLeaf-line{height:50%}.element-tree-node-line-hor{display:block;position:absolute;top:50%;left:0;height:0;border-bottom:1px dashed #dcdfe6}.element-tree-node-label-line{flex:1;border-top:1px dashed #dcdfe6;align-self:center;margin:0 10px}[data-v-b82736b8] .el-tree-node__label{line-height:22px}[data-v-b82736b8] .el-tree-node:focus>.el-tree-node__content{background-color:transparent}[data-v-b82736b8] .el-tree-node__content{border-radius:8px}[data-v-b82736b8] .el-tree-node__content:hover{background-color:var(--primary-color-5)}[data-v-b82736b8] .element-tree-node-label{font-size:14px}.list-item[data-v-b82736b8]{height:32px}.list-item[data-v-b82736b8]:hover{background:var(--primary-color-5)}[data-v-b82736b8] .element-tree-node-line-ver,[data-v-b82736b8] .element-tree-node-line-hor{border-color:var(--neutral-color-19)}
|
|
@@ -0,0 +1,406 @@
|
|
|
1
|
+
import { useAttrs as ie, ref as x, computed as S, watch as K, nextTick as T, onMounted as re, createBlock as R, openBlock as b, unref as f, withCtx as N, createElementVNode as D, normalizeStyle as de, createElementBlock as P, createCommentVNode as ce, createVNode as g, normalizeClass as ue, mergeProps as he, toDisplayString as $, withModifiers as fe, Fragment as pe, h as H } from "vue";
|
|
2
|
+
import { ElAutoResizer as me, ElInput as ye, ElIcon as Q, ElTreeV2 as ve } from "element-plus";
|
|
3
|
+
import { IconSearch as ge, IconDelete as ke, IconRighttop as Se } from "color-message-lingyun-vue";
|
|
4
|
+
import { IconEmpty as be } from "../IconEmpty.mjs";
|
|
5
|
+
import { _ as Ne } from "./_plugin-vue_export-helper.CHgC5LLL.js";
|
|
6
|
+
import '../assets/layout2.css';function Ce(o) {
|
|
7
|
+
return {
|
|
8
|
+
name: "element-tree-line",
|
|
9
|
+
props: {
|
|
10
|
+
node: {
|
|
11
|
+
type: Object,
|
|
12
|
+
required: !0
|
|
13
|
+
},
|
|
14
|
+
data: {
|
|
15
|
+
type: Object
|
|
16
|
+
},
|
|
17
|
+
treeData: {
|
|
18
|
+
type: Array
|
|
19
|
+
},
|
|
20
|
+
indent: {
|
|
21
|
+
type: Number,
|
|
22
|
+
default() {
|
|
23
|
+
return 16;
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
showLabelLine: {
|
|
27
|
+
type: Boolean,
|
|
28
|
+
default: !0
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
render(r) {
|
|
32
|
+
const d = o || r, s = this.getScopedSlot("default"), t = this.getScopedSlot("node-label"), c = this.getScopedSlot("after-node-label"), p = s ? this.getScopedSlotValue(s, {
|
|
33
|
+
node: this.node,
|
|
34
|
+
data: this.data
|
|
35
|
+
}) : [
|
|
36
|
+
t ? this.getScopedSlotValue(t, {
|
|
37
|
+
node: this.node,
|
|
38
|
+
data: this.data
|
|
39
|
+
}) : d(
|
|
40
|
+
"span",
|
|
41
|
+
{ class: "element-tree-node-label" },
|
|
42
|
+
this.node.label
|
|
43
|
+
),
|
|
44
|
+
this.showLabelLine ? d("span", {
|
|
45
|
+
class: "element-tree-node-label-line"
|
|
46
|
+
}) : null,
|
|
47
|
+
this.getScopedSlotValue(c, {
|
|
48
|
+
node: this.node,
|
|
49
|
+
data: this.data
|
|
50
|
+
})
|
|
51
|
+
], y = [];
|
|
52
|
+
let u = this.node;
|
|
53
|
+
for (; u; ) {
|
|
54
|
+
let n = u.parent;
|
|
55
|
+
if (u.level === 1 && !u.parent) {
|
|
56
|
+
if (!this.treeData || !Array.isArray(this.treeData))
|
|
57
|
+
throw Error(
|
|
58
|
+
"if you using el-tree-v2 (Virtualized Tree) of element-plus,element-tree-line required data."
|
|
59
|
+
);
|
|
60
|
+
n = {
|
|
61
|
+
children: Array.isArray(this.treeData) ? this.treeData.map((m) => ({ ...m, key: m.id })) : [],
|
|
62
|
+
level: 0,
|
|
63
|
+
key: "node-0",
|
|
64
|
+
parent: null
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
if (n) {
|
|
68
|
+
const m = (n.children || n.childNodes).findIndex(
|
|
69
|
+
(C) => (C.key || C.id) === (u.key || u.id)
|
|
70
|
+
);
|
|
71
|
+
y.unshift(
|
|
72
|
+
m === (n.children || n.childNodes).length - 1
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
u = n;
|
|
76
|
+
}
|
|
77
|
+
const V = [];
|
|
78
|
+
for (let n = 0; n < this.node.level; n++)
|
|
79
|
+
y[n] && this.node.level - 1 !== n || V.push(
|
|
80
|
+
d("span", {
|
|
81
|
+
class: {
|
|
82
|
+
"element-tree-node-line-ver": !0,
|
|
83
|
+
"last-node-isLeaf-line": y[n] && this.node.level - 1 === n
|
|
84
|
+
},
|
|
85
|
+
style: { left: this.indent * n + "px" }
|
|
86
|
+
})
|
|
87
|
+
);
|
|
88
|
+
return d(
|
|
89
|
+
"span",
|
|
90
|
+
{
|
|
91
|
+
class: "element-tree-node-label-wrapper"
|
|
92
|
+
},
|
|
93
|
+
[p].concat(V).concat([
|
|
94
|
+
d("span", {
|
|
95
|
+
class: "element-tree-node-line-hor",
|
|
96
|
+
style: {
|
|
97
|
+
width: (this.node.isLeaf ? 24 : 8) + "px",
|
|
98
|
+
left: (this.node.level - 1) * this.indent + "px"
|
|
99
|
+
}
|
|
100
|
+
})
|
|
101
|
+
])
|
|
102
|
+
);
|
|
103
|
+
},
|
|
104
|
+
methods: {
|
|
105
|
+
getScopedSlot(r) {
|
|
106
|
+
if (!r)
|
|
107
|
+
return null;
|
|
108
|
+
const d = r.split("||");
|
|
109
|
+
let s = null;
|
|
110
|
+
for (let t = 0; t < d.length; t++) {
|
|
111
|
+
const c = d[t], p = (this.$slots || {})[c];
|
|
112
|
+
if (p) {
|
|
113
|
+
s = p;
|
|
114
|
+
break;
|
|
115
|
+
}
|
|
116
|
+
if (s = (this.$scopedSlots || {})[c], s)
|
|
117
|
+
break;
|
|
118
|
+
}
|
|
119
|
+
return s;
|
|
120
|
+
},
|
|
121
|
+
getScopedSlotValue(r, d, s = null) {
|
|
122
|
+
return typeof r == "function" ? r(d) || s : r || s;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
function U(o) {
|
|
128
|
+
const r = Ce(o);
|
|
129
|
+
return o && (r.methods.getScopedSlot = function(s) {
|
|
130
|
+
if (!s)
|
|
131
|
+
return null;
|
|
132
|
+
const t = s.split("||");
|
|
133
|
+
let c = null;
|
|
134
|
+
for (let p = 0; p < t.length; p++) {
|
|
135
|
+
const y = t[p], u = (this.$slots || {})[y];
|
|
136
|
+
if (u) {
|
|
137
|
+
c = u;
|
|
138
|
+
break;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
return c;
|
|
142
|
+
}), r;
|
|
143
|
+
}
|
|
144
|
+
U();
|
|
145
|
+
const Le = {
|
|
146
|
+
key: 0,
|
|
147
|
+
class: "mg-b-16"
|
|
148
|
+
}, xe = {
|
|
149
|
+
key: 0,
|
|
150
|
+
class: "list-item flex justify-between pd-l-6 pd-r-6 radius-8 items-center w-full"
|
|
151
|
+
}, Ve = ["onClick"], Me = { key: 1 }, De = /* @__PURE__ */ Object.assign({
|
|
152
|
+
name: "TreeSelect"
|
|
153
|
+
}, {
|
|
154
|
+
__name: "layout",
|
|
155
|
+
props: {
|
|
156
|
+
// 初始值
|
|
157
|
+
modelValue: {
|
|
158
|
+
type: Object,
|
|
159
|
+
default: () => []
|
|
160
|
+
},
|
|
161
|
+
// 树形节点对象结构
|
|
162
|
+
treeProps: {
|
|
163
|
+
type: Object,
|
|
164
|
+
default: () => ({
|
|
165
|
+
value: "id",
|
|
166
|
+
label: "label",
|
|
167
|
+
children: "children"
|
|
168
|
+
})
|
|
169
|
+
},
|
|
170
|
+
// 接口配置
|
|
171
|
+
apiConfig: {
|
|
172
|
+
type: Function
|
|
173
|
+
},
|
|
174
|
+
// 请求参数
|
|
175
|
+
reqParams: {
|
|
176
|
+
type: Object,
|
|
177
|
+
default: () => ({})
|
|
178
|
+
},
|
|
179
|
+
// 是否在组件挂载时自动加载数据
|
|
180
|
+
autoLoad: {
|
|
181
|
+
type: Boolean,
|
|
182
|
+
default: !0
|
|
183
|
+
},
|
|
184
|
+
// 是否多选
|
|
185
|
+
isMultiple: {
|
|
186
|
+
type: Boolean,
|
|
187
|
+
default: !0
|
|
188
|
+
},
|
|
189
|
+
// 是否有过滤
|
|
190
|
+
hasFilter: {
|
|
191
|
+
type: Boolean,
|
|
192
|
+
default: !1
|
|
193
|
+
},
|
|
194
|
+
// 是否是列表模式
|
|
195
|
+
isListMode: {
|
|
196
|
+
type: Boolean,
|
|
197
|
+
default: !1
|
|
198
|
+
},
|
|
199
|
+
treeList: {
|
|
200
|
+
type: Array,
|
|
201
|
+
default: () => []
|
|
202
|
+
},
|
|
203
|
+
// 是否有线条样式
|
|
204
|
+
hasTreeLine: {
|
|
205
|
+
type: Boolean,
|
|
206
|
+
default: !0
|
|
207
|
+
},
|
|
208
|
+
// 选中的节点是否包含父节点
|
|
209
|
+
includeParentSelected: {
|
|
210
|
+
type: Boolean,
|
|
211
|
+
default: !1
|
|
212
|
+
}
|
|
213
|
+
},
|
|
214
|
+
emits: ["handleCheck", "handleDeleteNode", "initFinish"],
|
|
215
|
+
setup(o, { expose: r, emit: d }) {
|
|
216
|
+
const s = U(H), t = o, c = d, p = ie(), y = () => H(Se, {
|
|
217
|
+
style: { color: "var(--text-color-2)", fontSize: "16px" }
|
|
218
|
+
}), u = t.isMultiple ? 20 : 10, V = t.isMultiple ? 15 : 11, n = x([]), m = x(null), C = x(null), w = S(() => t.treeProps.value), E = S(() => t.treeProps.label), v = S(() => t.treeProps.children), z = x(!1), G = S(() => !t.isMultiple && z.value), J = S(() => typeof t.apiConfig == "function"), F = (e) => String(e).includes("%") ? e : e + "px", W = () => {
|
|
219
|
+
let e = m.value?.getCheckedNodes(), l = e.map((i) => i[w.value]), a = [];
|
|
220
|
+
return e.length && !t.includeParentSelected && (e = e.filter((i) => !i[v.value]), l = e.map((i) => i[w.value])), t.includeParentSelected && (a = X(n.value, l)), {
|
|
221
|
+
selectedNodeValues: l,
|
|
222
|
+
// 选中节点的值的集合
|
|
223
|
+
selectedNodes: e,
|
|
224
|
+
// 选中节点的集合
|
|
225
|
+
selectedParentNodes: a
|
|
226
|
+
// 选中节点的所有父节点
|
|
227
|
+
};
|
|
228
|
+
};
|
|
229
|
+
function X(e, l) {
|
|
230
|
+
const a = /* @__PURE__ */ new Map();
|
|
231
|
+
function i(h, k = []) {
|
|
232
|
+
for (const L of h) {
|
|
233
|
+
const ae = [...k, L];
|
|
234
|
+
L.children && L.children.length > 0 ? i(L.children, ae) : l.includes(L.id) && k.forEach((B) => {
|
|
235
|
+
a.has(B.id) || a.set(B.id, { ...B });
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
return i(e), Array.from(a.values());
|
|
240
|
+
}
|
|
241
|
+
const Y = (e) => {
|
|
242
|
+
!t.isMultiple || t.isListMode || I();
|
|
243
|
+
}, Z = (e, l) => {
|
|
244
|
+
t.isMultiple || t.isListMode || (z.value = !0, C.value = l.key, c("handleCheck", {
|
|
245
|
+
selectedValue: [C.value],
|
|
246
|
+
// 选中节点的值
|
|
247
|
+
selectedNode: [l.data]
|
|
248
|
+
// // 选中节点
|
|
249
|
+
}));
|
|
250
|
+
}, _ = x(""), ee = (e) => {
|
|
251
|
+
m.value.filter(e);
|
|
252
|
+
}, te = (e, l) => l[E.value].includes(e), le = (e) => {
|
|
253
|
+
let l = 0;
|
|
254
|
+
function a(i) {
|
|
255
|
+
for (const h of i) {
|
|
256
|
+
const k = h[v.value] && h[v.value].length > 0;
|
|
257
|
+
t.includeParentSelected ? l++ : k || l++, k && a(h[v.value]);
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
return a(e), l;
|
|
261
|
+
}, ne = S(() => le(n.value));
|
|
262
|
+
function I() {
|
|
263
|
+
const { selectedNodeValues: e, selectedNodes: l, selectedParentNodes: a } = W();
|
|
264
|
+
c("handleCheck", {
|
|
265
|
+
selectedValue: e,
|
|
266
|
+
// 选中节点的值的集合
|
|
267
|
+
selectedNode: l,
|
|
268
|
+
// 选中节点的集合
|
|
269
|
+
selectedParentNodes: a
|
|
270
|
+
});
|
|
271
|
+
}
|
|
272
|
+
const oe = (e, l) => {
|
|
273
|
+
m.value?.setChecked(e, l), I();
|
|
274
|
+
}, j = () => {
|
|
275
|
+
p["default-checked-keys"] && T(() => {
|
|
276
|
+
I();
|
|
277
|
+
});
|
|
278
|
+
}, se = (e) => {
|
|
279
|
+
c("handleDeleteNode", e);
|
|
280
|
+
}, M = (e) => e?.map((l) => ({
|
|
281
|
+
...l,
|
|
282
|
+
[v.value]: l[v.value]?.length ? M(l[v.value]) : void 0
|
|
283
|
+
})), q = async () => {
|
|
284
|
+
J.value ? t.apiConfig(t.reqParams)?.then((e) => {
|
|
285
|
+
n.value = M(e?.data || []), j(), A(t.modelValue), c("initFinish", n.value);
|
|
286
|
+
}) : O();
|
|
287
|
+
}, O = () => {
|
|
288
|
+
t.isListMode ? n.value = M(t.treeList || []) : (n.value = M(t.treeList || []), n.value.length && (j(), A(t.modelValue)));
|
|
289
|
+
}, A = (e) => {
|
|
290
|
+
const l = e && e.length && e.map((a) => a[t.treeProps.value]);
|
|
291
|
+
T(() => {
|
|
292
|
+
m.value?.setCheckedKeys(l);
|
|
293
|
+
});
|
|
294
|
+
};
|
|
295
|
+
return K(
|
|
296
|
+
() => t.treeList,
|
|
297
|
+
() => {
|
|
298
|
+
O();
|
|
299
|
+
},
|
|
300
|
+
{ deep: !0 }
|
|
301
|
+
), K(
|
|
302
|
+
() => t.modelValue,
|
|
303
|
+
(e) => {
|
|
304
|
+
T(() => {
|
|
305
|
+
A(e);
|
|
306
|
+
});
|
|
307
|
+
},
|
|
308
|
+
{ deep: !0 }
|
|
309
|
+
), re(() => {
|
|
310
|
+
q();
|
|
311
|
+
}), r({
|
|
312
|
+
allNodeNumbers: ne,
|
|
313
|
+
loadData: q,
|
|
314
|
+
setNodeCheckStatus: oe
|
|
315
|
+
}), (e, l) => (b(), R(f(me), null, {
|
|
316
|
+
default: N(({ width: a, height: i }) => [
|
|
317
|
+
D("div", {
|
|
318
|
+
style: de({
|
|
319
|
+
width: F(a),
|
|
320
|
+
height: F(i)
|
|
321
|
+
})
|
|
322
|
+
}, [
|
|
323
|
+
o.hasFilter ? (b(), P("div", Le, [
|
|
324
|
+
g(f(ye), {
|
|
325
|
+
modelValue: _.value,
|
|
326
|
+
"onUpdate:modelValue": l[0] || (l[0] = (h) => _.value = h),
|
|
327
|
+
placeholder: "请输入",
|
|
328
|
+
onInput: ee
|
|
329
|
+
}, {
|
|
330
|
+
prefix: N(() => [
|
|
331
|
+
g(f(Q), {
|
|
332
|
+
size: 16,
|
|
333
|
+
color: "var(--neutral-color-12)",
|
|
334
|
+
class: "mg-r-4"
|
|
335
|
+
}, {
|
|
336
|
+
default: N(() => [
|
|
337
|
+
g(f(ge))
|
|
338
|
+
]),
|
|
339
|
+
_: 1
|
|
340
|
+
})
|
|
341
|
+
]),
|
|
342
|
+
_: 1
|
|
343
|
+
}, 8, ["modelValue"])
|
|
344
|
+
])) : ce("", !0),
|
|
345
|
+
D("div", {
|
|
346
|
+
class: ue(o.hasFilter ? "pd-l-8 pd-r-8" : "")
|
|
347
|
+
}, [
|
|
348
|
+
g(f(ve), he({
|
|
349
|
+
ref_key: "treeRef",
|
|
350
|
+
ref: m,
|
|
351
|
+
height: o.hasFilter ? i - 48 : i,
|
|
352
|
+
data: n.value,
|
|
353
|
+
props: o.treeProps,
|
|
354
|
+
"node-key": w.value,
|
|
355
|
+
"show-checkbox": o.isMultiple && !o.isListMode,
|
|
356
|
+
"item-size": 34,
|
|
357
|
+
indent: f(u),
|
|
358
|
+
"highlight-current": G.value,
|
|
359
|
+
icon: o.isListMode ? "" : y,
|
|
360
|
+
"filter-method": te
|
|
361
|
+
}, f(p), {
|
|
362
|
+
onNodeClick: Z,
|
|
363
|
+
onCheck: Y
|
|
364
|
+
}), {
|
|
365
|
+
default: N(({ node: h }) => [
|
|
366
|
+
o.isListMode ? (b(), P("div", xe, [
|
|
367
|
+
D("span", null, $(h.data[E.value]), 1),
|
|
368
|
+
D("div", {
|
|
369
|
+
class: "flex items-center",
|
|
370
|
+
onClick: fe((k) => se(h.data), ["stop"])
|
|
371
|
+
}, [
|
|
372
|
+
g(f(Q), {
|
|
373
|
+
size: 14,
|
|
374
|
+
color: "var(--neutral-color-5)"
|
|
375
|
+
}, {
|
|
376
|
+
default: N(() => [
|
|
377
|
+
g(f(ke))
|
|
378
|
+
]),
|
|
379
|
+
_: 1
|
|
380
|
+
})
|
|
381
|
+
], 8, Ve)
|
|
382
|
+
])) : (b(), P(pe, { key: 1 }, [
|
|
383
|
+
o.hasTreeLine ? (b(), R(f(s), {
|
|
384
|
+
key: 0,
|
|
385
|
+
node: h,
|
|
386
|
+
treeData: n.value,
|
|
387
|
+
showLabelLine: !1,
|
|
388
|
+
indent: f(V)
|
|
389
|
+
}, null, 8, ["node", "treeData", "indent"])) : (b(), P("span", Me, $(h.data[E.value]), 1))
|
|
390
|
+
], 64))
|
|
391
|
+
]),
|
|
392
|
+
empty: N(() => [
|
|
393
|
+
g(f(be))
|
|
394
|
+
]),
|
|
395
|
+
_: 1
|
|
396
|
+
}, 16, ["height", "data", "props", "node-key", "show-checkbox", "indent", "highlight-current", "icon"])
|
|
397
|
+
], 2)
|
|
398
|
+
], 4)
|
|
399
|
+
]),
|
|
400
|
+
_: 1
|
|
401
|
+
}));
|
|
402
|
+
}
|
|
403
|
+
}), Be = /* @__PURE__ */ Ne(De, [["__scopeId", "data-v-b82736b8"]]);
|
|
404
|
+
export {
|
|
405
|
+
Be as T
|
|
406
|
+
};
|
package/lib/SearchBar.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require('./assets/SearchBar.css');const K=require("./chunks/index.CkihWzK6.js"),e=require("vue"),u=require("element-plus"),g=require("color-message-lingyun-vue"),o=require("color-star-custom-methods"),G=require("./chunks/layout.Ch_1hhpJ.js"),J=require("./chunks/layout.whToBh0O.js"),P=require("./chunks/_plugin-vue_export-helper.BHFhmbuH.js"),S=require("./chunks/layout.DDB7i4jV.js"),Q=[{type:"primary",label:"查询",value:o.operationConfigMap.search},{type:"default",label:"重置",value:o.operationConfigMap.reset}],F=320,x={__name:"OperationButtons",props:{operationList:{type:Array,default:()=>[]}},emits:[o.emitsMap.operation],setup(a,{emit:h}){const p=h,d=c=>{p(o.emitsMap.operation,c)};return(c,n)=>c.$slots.operation?e.renderSlot(c.$slots,"operation",{key:0,operationList:a.operationList}):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(a.operationList,f=>(e.openBlock(),e.createBlock(e.unref(u.ElButton),{key:f.value,type:f.type,icon:f.icon,onClick:t=>d(f.value)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(f.label),1)]),_:2},1032,["type","icon","onClick"]))),128))}},X=Object.assign({name:"FormWrapper"},{__name:"FormWrapper",props:{items:{type:Array,default:()=>[]},formData:{type:Object,default:()=>({})},rules:{type:Object,default:()=>({})},labelWidth:{type:[String,Number],default:"auto"},labelPosition:{type:String,default:o.labelPositionMap.right},showLabel:{type:Boolean,default:!0},inline:{type:Boolean,default:!1},isFilter:{type:Boolean,default:!1},isFilterPreview:{type:Boolean,default:!1},minWidth:{type:Number,default:F},fixedWidth:{type:Boolean,default:!1}},emits:[o.emitsMap.change,o.emitsMap.enter],setup(a,{expose:h}){e.useCssVars(n=>({v8c0c795c:a.minWidth+"px"}));const p=a,d=e.ref(null),c=e.computed(()=>p.isFilter?"filter-form":p.isFilterPreview?"filter-preview-form":p.fixedWidth?"search-bar-form search-bar-form-fixed":"search-bar-form");return h({validate:n=>d.value?d.value.validate(n):Promise.resolve(!0),resetFields:()=>{d.value&&d.value.resetFields()},clearValidate:n=>{d.value&&d.value.clearValidate(n)},scrollToField:n=>{d.value&&d.value.scrollToField(n)}}),(n,f)=>(e.openBlock(),e.createBlock(e.unref(u.ElForm),{ref_key:"formRef",ref:d,model:a.formData,"label-width":a.labelWidth,"label-position":a.labelPosition,inline:a.inline,rules:a.rules,class:e.normalizeClass({[c.value]:!0,"items-end display-grid":!a.isFilterPreview}),onSubmit:f[0]||(f[0]=e.withModifiers(()=>{},["prevent","stop"]))},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.items,t=>(e.openBlock(),e.createBlock(e.unref(u.ElFormItem),e.mergeProps({key:t.key,label:a.showLabel?t.label:"",prop:t.key,"show-label":a.showLabel,class:[{"search-bar-item--wide":t.wide}]},{ref_for:!0},t),{default:e.withCtx(()=>[e.renderSlot(n.$slots,t.key,{item:t,formData:a.formData},()=>[t.type===e.unref(o.componentType).text?(e.openBlock(),e.createBlock(e.unref(u.ElInput),e.mergeProps({key:0,modelValue:a.formData[t.key],"onUpdate:modelValue":l=>a.formData[t.key]=l},{ref_for:!0},t,{class:"w-full",onChange:l=>n.$emit(e.unref(o.emitsMap).change,t.key,a.formData[t.key]),onKeyup:e.withKeys(l=>n.$emit(e.unref(o.emitsMap).enter,t.key,a.formData[t.key]),["enter"])}),null,16,["modelValue","onUpdate:modelValue","onChange","onKeyup"])):t.type===e.unref(o.componentType).select?(e.openBlock(),e.createBlock(G._sfc_main,e.mergeProps({key:1,modelValue:a.formData[t.key],"onUpdate:modelValue":l=>a.formData[t.key]=l,"static-options":t.options},{ref_for:!0},t,{onChange:l=>n.$emit(e.unref(o.emitsMap).change,t.key,a.formData[t.key]),class:"w-full"}),null,16,["modelValue","onUpdate:modelValue","static-options","onChange"])):t.type===e.unref(o.componentType).date?(e.openBlock(),e.createBlock(e.unref(u.ElDatePicker),e.mergeProps({key:2,modelValue:a.formData[t.key],"onUpdate:modelValue":l=>a.formData[t.key]=l},{ref_for:!0},{...t,...e.unref(o.dateParamsMap)[t.dateType]},{type:t.dateType,format:t.format||e.unref(o.dateFormat).date,"value-format":t.valueFormat||e.unref(o.dateFormat).dateTime,class:"w-full",onChange:l=>n.$emit(e.unref(o.emitsMap).change,t.key,a.formData[t.key])}),null,16,["modelValue","onUpdate:modelValue","type","format","value-format","onChange"])):t.type===e.unref(o.componentType).inputNumber?(e.openBlock(),e.createBlock(e.unref(u.ElInputNumber),e.mergeProps({key:3,modelValue:a.formData[t.key],"onUpdate:modelValue":l=>a.formData[t.key]=l},{ref_for:!0},t,{class:"w-full",onChange:l=>n.$emit(e.unref(o.emitsMap).change,t.key,a.formData[t.key])}),null,16,["modelValue","onUpdate:modelValue","onChange"])):t.type===e.unref(o.componentType).switch?(e.openBlock(),e.createBlock(e.unref(u.ElSwitch),e.mergeProps({key:4,modelValue:a.formData[t.key],"onUpdate:modelValue":l=>a.formData[t.key]=l},{ref_for:!0},t,{onChange:l=>n.$emit(e.unref(o.emitsMap).change,t.key,a.formData[t.key])}),null,16,["modelValue","onUpdate:modelValue","onChange"])):t.type===e.unref(o.componentType).radio?(e.openBlock(),e.createBlock(e.unref(u.ElRadioGroup),{key:5,modelValue:a.formData[t.key],"onUpdate:modelValue":l=>a.formData[t.key]=l,onChange:l=>n.$emit(e.unref(o.emitsMap).change,t.key,a.formData[t.key])},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options,l=>(e.openBlock(),e.createBlock(e.unref(u.ElRadio),{key:l.value,label:l.value,value:l.value,disabled:l.disabled},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.label),1)]),_:2},1032,["label","value","disabled"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue","onChange"])):t.type===e.unref(o.componentType).checkbox?(e.openBlock(),e.createBlock(e.unref(u.ElCheckboxGroup),{key:6,modelValue:a.formData[t.key],"onUpdate:modelValue":l=>a.formData[t.key]=l,onChange:l=>n.$emit(e.unref(o.emitsMap).change,t.key,a.formData[t.key])},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options,l=>(e.openBlock(),e.createBlock(e.unref(u.ElCheckbox),{key:l.value,label:l.value,value:l.value,disabled:l.disabled},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.label),1)]),_:2},1032,["label","value","disabled"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue","onChange"])):t.type===e.unref(o.componentType).textarea?(e.openBlock(),e.createBlock(e.unref(u.ElInput),e.mergeProps({key:7,modelValue:a.formData[t.key],"onUpdate:modelValue":l=>a.formData[t.key]=l},{ref_for:!0},t,{class:"w-full",type:"textarea",onChange:l=>n.$emit(e.unref(o.emitsMap).change,t.key,a.formData[t.key])}),null,16,["modelValue","onUpdate:modelValue","onChange"])):t.type===e.unref(o.componentType).upload?(e.openBlock(),e.createBlock(J._layout,e.mergeProps({key:8,modelValue:a.formData[t.key],"onUpdate:modelValue":l=>a.formData[t.key]=l},{ref_for:!0},t),null,16,["modelValue","onUpdate:modelValue"])):e.createCommentVNode("",!0)],!0)]),_:2},1040,["label","prop","show-label","class"]))),128)),e.renderSlot(n.$slots,"default",{},void 0,!0)]),_:3},8,["model","label-width","label-position","inline","rules","class"]))}}),E=P._export_sfc(X,[["__scopeId","data-v-d7e66fda"]]),Y={class:"h-32 w-full"},Z={class:"flex items-center justify-between pd-b-20"},_={class:"text-right"},ee={class:"drawer-header"},te={class:"flex-1 pd-l-16 pd-r-16 overflow-y-auto"},ae={class:"text-right border-top pd-t-16 pd-l-16 pd-r-16"},le=Object.assign({name:"SearchBar"},{__name:"layout",props:{items:{type:Array,default:()=>[]},modelValue:{type:Object,default:()=>({})},labelWidth:{type:[String,Number],default:"auto"},labelPosition:{type:String,default:o.labelPositionMap.right,validator:a=>[o.labelPositionMap.left,o.labelPositionMap.right,o.labelPositionMap.top].includes(a)},isExpand:{type:Boolean,default:!0},maxHeight:{type:Number,default:84},minWidth:{type:Number,default:F},operationList:{type:Array,default:Q},filterMode:{type:Boolean,default:!0},hideExpandButton:{type:Boolean,default:!0},fixedWidth:{type:Boolean,default:!1}},emits:[o.emitsMap.updateModelValue,o.emitsMap.operation,o.emitsMap.change],setup(a,{expose:h,emit:p}){e.useCssVars(r=>({v09197288:a.maxHeight+"px",v0d6970ac:B.value?B.value+"px":"100%"}));const d=a,c=p,n=e.ref({}),f=e.ref(!d.isExpand),t=e.ref(null),l=e.ref(!1),y=e.ref(!1),b=e.ref(!1),L=e.computed(()=>{const r={};return d.items.forEach(i=>{if(i.required){const s=[{required:!0,message:`${i.label}不能为空`,trigger:"blur"}];typeof i.validator=="function"&&s.push({validator:i.validator,trigger:"blur"}),r[i.key]=s}}),r}),V=e.computed(()=>d.items?.filter(r=>!r.hidden)||[]),M=e.computed(()=>d.filterMode?V.value?.slice(0,2)||[]:V.value),k=e.computed(()=>d.filterMode?V.value.slice(2):[]),D=r=>{n.value={...r}},W=()=>{c(o.emitsMap.updateModelValue,{...n.value})},U=(r,i)=>{n.value[r]=i,b.value=!0,v(o.operationConfigMap.search),setTimeout(()=>{b.value=!1},200),w(r,i)},w=(r,i)=>{r&&c(o.emitsMap.change,r,i)},I=()=>n.value,C=(r,i)=>{b.value||c(o.emitsMap.operation,o.operationConfigMap.search,n.value)},v=r=>{W(),c(o.emitsMap.operation,r,n.value),(r===o.operationConfigMap.search||r===o.operationConfigMap.reset)&&(l.value=!1,y.value=!1)},z=r=>t.value.validate(r),B=e.ref(0),O=r=>{B.value=r+32},R=()=>{f.value=!f.value},q=()=>{l.value=!1,y.value=!0},j=()=>{y.value=!1,l.value=!0},N=e.ref(!1),$=r=>{N.value=r>d.maxHeight},A=e.computed(()=>d.filterMode||f.value?"10px":"0");return e.onMounted(()=>{D(d.modelValue),$()}),e.watch(()=>d.modelValue,r=>{D(r)},{immediate:!0,deep:!0}),h({validate:z,getFormData:I,formRef:t}),(r,i)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["relative overflow-hidden w-full",{flex:a.filterMode}])},[e.createElementVNode("div",{class:e.normalizeClass({"is-collapsed overflow-hidden":!f.value})},[e.createVNode(e.unref(u.ElAutoResizer),null,{default:e.withCtx(({height:s})=>[e.createTextVNode(e.toDisplayString($(s))+" ",1),e.createVNode(E,{ref_key:"formRef",ref:t,items:M.value,"form-data":n.value,rules:L.value,"label-width":a.labelWidth,"label-position":a.labelPosition,inline:!0,"show-label":!a.filterMode,"min-width":a.minWidth,"is-filter-preview":a.filterMode,fixedWidth:a.fixedWidth,onChange:U,onEnter:C},e.createSlots({default:e.withCtx(()=>[a.isExpand&&!a.filterMode?(e.openBlock(),e.createBlock(e.unref(u.ElFormItem),{key:0,"label-width":"0"},{default:e.withCtx(()=>[e.createElementVNode("div",Y,[e.createVNode(e.unref(u.ElAutoResizer),null,{default:e.withCtx(({width:m})=>[e.createTextVNode(e.toDisplayString(O(m)),1)]),_:1})])]),_:1})):e.createCommentVNode("",!0)]),_:2},[e.renderList(M.value,m=>({name:m.key,fn:e.withCtx(H=>[e.renderSlot(r.$slots,m.key,e.normalizeProps(e.guardReactiveProps(H)),void 0,!0)])}))]),1032,["items","form-data","rules","label-width","label-position","show-label","min-width","is-filter-preview","fixedWidth"])]),_:3})],2),e.createElementVNode("div",{class:e.normalizeClass(["operation-buttons",{"absolute right-0 bg-fff text-right":a.isExpand&&!a.filterMode,"text-left":a.filterMode}]),style:e.normalizeStyle({bottom:A.value})},[a.filterMode?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(e.unref(u.ElButton),{onClick:i[0]||(i[0]=s=>v(e.unref(o.operationConfigMap).reset)),type:"default"},{default:e.withCtx(()=>[...i[3]||(i[3]=[e.createTextVNode("重置",-1)])]),_:1}),k.value?.length?(e.openBlock(),e.createBlock(e.unref(u.ElPopover),{key:0,visible:l.value,placement:"bottom-start",width:628,trigger:"click"},{reference:e.withCtx(()=>[e.createVNode(e.unref(u.ElButton),{onClick:i[1]||(i[1]=s=>l.value=!l.value),icon:e.unref(g.IconCheck),type:"default"},{default:e.withCtx(()=>[...i[4]||(i[4]=[e.createTextVNode(" 筛选器 ",-1)])]),_:1},8,["icon"])]),default:e.withCtx(()=>[e.createElementVNode("div",Z,[e.createVNode(S.CustomTitle,{content:"筛选器",fontSize:16}),e.createVNode(e.unref(u.ElIcon),{size:16,onClick:q},{default:e.withCtx(()=>[e.createVNode(e.unref(g.IconMagnify))]),_:1})]),e.createVNode(E,{items:k.value,"form-data":n.value,"label-width":"auto","label-position":"top",inline:!1,"show-label":!0,"is-filter":!0,"min-width":a.minWidth,class:"filter-form-popover overflow-y-auto",onChange:w,onEnter:C},e.createSlots({_:2},[e.renderList(k.value,s=>({name:s.key,fn:e.withCtx(m=>[e.renderSlot(r.$slots,s.key,e.normalizeProps(e.guardReactiveProps(m)),void 0,!0)])}))]),1032,["items","form-data","min-width"]),e.createElementVNode("div",_,[e.createVNode(x,{"operation-list":a.operationList,onOperation:v},e.createSlots({_:2},[r.$slots.operation?{name:"operation",fn:e.withCtx(({operationList:s})=>[e.renderSlot(r.$slots,"operation",{operationList:s},void 0,!0)]),key:"0"}:void 0]),1032,["operation-list"])])]),_:3},8,["visible"])):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[N.value&&a.isExpand&&a.hideExpandButton?(e.openBlock(),e.createBlock(e.unref(u.ElButton),{key:0,icon:f.value?e.unref(g.IconUp):e.unref(g.IconDown),text:"",onClick:R},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(f.value?"收起":"展开"),1)]),_:1},8,["icon"])):e.createCommentVNode("",!0),e.createVNode(x,{"operation-list":a.operationList,onOperation:v},e.createSlots({_:2},[r.$slots.operation?{name:"operation",fn:e.withCtx(({operationList:s})=>[e.renderSlot(r.$slots,"operation",{operationList:s},void 0,!0)]),key:"0"}:void 0]),1032,["operation-list"])],64))],6),e.createVNode(e.unref(u.ElDrawer),{modelValue:y.value,"onUpdate:modelValue":i[2]||(i[2]=s=>y.value=s),size:"628","show-close":!1},{header:e.withCtx(()=>[e.createElementVNode("div",ee,[e.createVNode(S.CustomTitle,{content:"筛选器",fontSize:16}),e.createVNode(e.unref(u.ElIcon),{size:16,onClick:j,class:"shrink-button"},{default:e.withCtx(()=>[e.createVNode(e.unref(g.IconShrink))]),_:1})])]),default:e.withCtx(()=>[e.createElementVNode("div",te,[e.createVNode(E,{items:k.value,"form-data":n.value,"label-width":"auto","label-position":"top",inline:!1,"show-label":!0,"is-filter":!0,"min-width":a.minWidth,onChange:w,onEnter:C},e.createSlots({_:2},[e.renderList(k.value,s=>({name:s.key,fn:e.withCtx(m=>[e.renderSlot(r.$slots,s.key,e.normalizeProps(e.guardReactiveProps(m)),void 0,!0)])}))]),1032,["items","form-data","min-width"])]),e.createElementVNode("div",ae,[e.createVNode(x,{"operation-list":a.operationList,onOperation:v},e.createSlots({_:2},[r.$slots.operation?{name:"operation",fn:e.withCtx(({operationList:s})=>[e.renderSlot(r.$slots,"operation",{operationList:s},void 0,!0)]),key:"0"}:void 0]),1032,["operation-list"])])]),_:3},8,["modelValue"])],2))}}),oe=P._export_sfc(le,[["__scopeId","data-v-275be469"]]),T=K.withInstall(oe);exports.SearchBar=T;exports.default=T;
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require('./assets/SearchBar.css');const K=require("./chunks/index.CkihWzK6.js"),e=require("vue"),d=require("element-plus"),g=require("color-message-lingyun-vue"),o=require("color-star-custom-methods"),G=require("./chunks/layout.Ch_1hhpJ.js"),J=require("./chunks/layout.whToBh0O.js"),P=require("./chunks/_plugin-vue_export-helper.BHFhmbuH.js"),S=require("./chunks/layout.DDB7i4jV.js"),Q=[{type:"primary",label:"查询",value:o.operationConfigMap.search},{type:"default",label:"重置",value:o.operationConfigMap.reset,plain:!0}],F=320,x={__name:"OperationButtons",props:{operationList:{type:Array,default:()=>[]}},emits:[o.emitsMap.operation],setup(a,{emit:h}){const p=h,i=c=>{p(o.emitsMap.operation,c)};return(c,n)=>c.$slots.operation?e.renderSlot(c.$slots,"operation",{key:0,operationList:a.operationList}):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(a.operationList,f=>(e.openBlock(),e.createBlock(e.unref(d.ElButton),{key:f.value,type:f.type,icon:f.icon,plain:f.plain,onClick:t=>i(f.value)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(f.label),1)]),_:2},1032,["type","icon","plain","onClick"]))),128))}},X=Object.assign({name:"FormWrapper"},{__name:"FormWrapper",props:{items:{type:Array,default:()=>[]},formData:{type:Object,default:()=>({})},rules:{type:Object,default:()=>({})},labelWidth:{type:[String,Number],default:"auto"},labelPosition:{type:String,default:o.labelPositionMap.right},showLabel:{type:Boolean,default:!0},inline:{type:Boolean,default:!1},isFilter:{type:Boolean,default:!1},isFilterPreview:{type:Boolean,default:!1},minWidth:{type:Number,default:F},fixedWidth:{type:Boolean,default:!1}},emits:[o.emitsMap.change,o.emitsMap.enter],setup(a,{expose:h}){e.useCssVars(n=>({v38755745:a.minWidth+"px"}));const p=a,i=e.ref(null),c=e.computed(()=>p.isFilter?"filter-form":p.isFilterPreview?"filter-preview-form":p.fixedWidth?"search-bar-form search-bar-form-fixed":"search-bar-form");return h({validate:n=>i.value?i.value.validate(n):Promise.resolve(!0),resetFields:()=>{i.value&&i.value.resetFields()},clearValidate:n=>{i.value&&i.value.clearValidate(n)},scrollToField:n=>{i.value&&i.value.scrollToField(n)}}),(n,f)=>(e.openBlock(),e.createBlock(e.unref(d.ElForm),{ref_key:"formRef",ref:i,model:a.formData,"label-width":a.labelWidth,"label-position":a.labelPosition,inline:a.inline,rules:a.rules,class:e.normalizeClass({[c.value]:!0,"items-end display-grid":!a.isFilterPreview}),onSubmit:f[0]||(f[0]=e.withModifiers(()=>{},["prevent","stop"]))},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.items,t=>(e.openBlock(),e.createBlock(e.unref(d.ElFormItem),e.mergeProps({key:t.key,label:a.showLabel?t.label:"",prop:t.key,"show-label":a.showLabel,class:[{"search-bar-item--wide":t.wide}]},{ref_for:!0},t),{default:e.withCtx(()=>[e.renderSlot(n.$slots,t.key,{item:t,formData:a.formData},()=>[t.type===e.unref(o.componentType).text?(e.openBlock(),e.createBlock(e.unref(d.ElInput),e.mergeProps({key:0,modelValue:a.formData[t.key],"onUpdate:modelValue":l=>a.formData[t.key]=l},{ref_for:!0},t,{class:"w-full",onChange:l=>n.$emit(e.unref(o.emitsMap).change,t.key,a.formData[t.key]),onKeyup:e.withKeys(l=>n.$emit(e.unref(o.emitsMap).enter,t.key,a.formData[t.key]),["enter"])}),null,16,["modelValue","onUpdate:modelValue","onChange","onKeyup"])):t.type===e.unref(o.componentType).select?(e.openBlock(),e.createBlock(G._sfc_main,e.mergeProps({key:1,modelValue:a.formData[t.key],"onUpdate:modelValue":l=>a.formData[t.key]=l,"static-options":t.options},{ref_for:!0},t,{onChange:l=>n.$emit(e.unref(o.emitsMap).change,t.key,a.formData[t.key]),class:"w-full"}),null,16,["modelValue","onUpdate:modelValue","static-options","onChange"])):t.type===e.unref(o.componentType).date?(e.openBlock(),e.createBlock(e.unref(d.ElDatePicker),e.mergeProps({key:2,modelValue:a.formData[t.key],"onUpdate:modelValue":l=>a.formData[t.key]=l},{ref_for:!0},{...t,...e.unref(o.dateParamsMap)[t.dateType]},{type:t.dateType,format:t.format||e.unref(o.dateFormat).date,"value-format":t.valueFormat||e.unref(o.dateFormat).dateTime,class:"w-full",onChange:l=>n.$emit(e.unref(o.emitsMap).change,t.key,a.formData[t.key])}),null,16,["modelValue","onUpdate:modelValue","type","format","value-format","onChange"])):t.type===e.unref(o.componentType).inputNumber?(e.openBlock(),e.createBlock(e.unref(d.ElInputNumber),e.mergeProps({key:3,modelValue:a.formData[t.key],"onUpdate:modelValue":l=>a.formData[t.key]=l},{ref_for:!0},t,{class:"w-full",onChange:l=>n.$emit(e.unref(o.emitsMap).change,t.key,a.formData[t.key])}),null,16,["modelValue","onUpdate:modelValue","onChange"])):t.type===e.unref(o.componentType).switch?(e.openBlock(),e.createBlock(e.unref(d.ElSwitch),e.mergeProps({key:4,modelValue:a.formData[t.key],"onUpdate:modelValue":l=>a.formData[t.key]=l},{ref_for:!0},t,{onChange:l=>n.$emit(e.unref(o.emitsMap).change,t.key,a.formData[t.key])}),null,16,["modelValue","onUpdate:modelValue","onChange"])):t.type===e.unref(o.componentType).radio?(e.openBlock(),e.createBlock(e.unref(d.ElRadioGroup),{key:5,modelValue:a.formData[t.key],"onUpdate:modelValue":l=>a.formData[t.key]=l,onChange:l=>n.$emit(e.unref(o.emitsMap).change,t.key,a.formData[t.key])},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options,l=>(e.openBlock(),e.createBlock(e.unref(d.ElRadio),{key:l.value,label:l.value,value:l.value,disabled:l.disabled},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.label),1)]),_:2},1032,["label","value","disabled"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue","onChange"])):t.type===e.unref(o.componentType).checkbox?(e.openBlock(),e.createBlock(e.unref(d.ElCheckboxGroup),{key:6,modelValue:a.formData[t.key],"onUpdate:modelValue":l=>a.formData[t.key]=l,onChange:l=>n.$emit(e.unref(o.emitsMap).change,t.key,a.formData[t.key])},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options,l=>(e.openBlock(),e.createBlock(e.unref(d.ElCheckbox),{key:l.value,label:l.value,value:l.value,disabled:l.disabled},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.label),1)]),_:2},1032,["label","value","disabled"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue","onChange"])):t.type===e.unref(o.componentType).textarea?(e.openBlock(),e.createBlock(e.unref(d.ElInput),e.mergeProps({key:7,modelValue:a.formData[t.key],"onUpdate:modelValue":l=>a.formData[t.key]=l},{ref_for:!0},t,{class:"w-full",type:"textarea",onChange:l=>n.$emit(e.unref(o.emitsMap).change,t.key,a.formData[t.key])}),null,16,["modelValue","onUpdate:modelValue","onChange"])):t.type===e.unref(o.componentType).upload?(e.openBlock(),e.createBlock(J._layout,e.mergeProps({key:8,modelValue:a.formData[t.key],"onUpdate:modelValue":l=>a.formData[t.key]=l},{ref_for:!0},t),null,16,["modelValue","onUpdate:modelValue"])):e.createCommentVNode("",!0)],!0)]),_:2},1040,["label","prop","show-label","class"]))),128)),e.renderSlot(n.$slots,"default",{},void 0,!0)]),_:3},8,["model","label-width","label-position","inline","rules","class"]))}}),E=P._export_sfc(X,[["__scopeId","data-v-8adcd08b"]]),Y={class:"h-32 w-full"},Z={class:"flex items-center justify-between pd-b-20"},_={class:"text-right"},ee={class:"drawer-header"},te={class:"flex-1 pd-l-16 pd-r-16 overflow-y-auto"},ae={class:"text-right border-top pd-t-16 pd-l-16 pd-r-16"},le=Object.assign({name:"SearchBar"},{__name:"layout",props:{items:{type:Array,default:()=>[]},modelValue:{type:Object,default:()=>({})},labelWidth:{type:[String,Number],default:"auto"},labelPosition:{type:String,default:o.labelPositionMap.right,validator:a=>[o.labelPositionMap.left,o.labelPositionMap.right,o.labelPositionMap.top].includes(a)},isExpand:{type:Boolean,default:!0},maxHeight:{type:Number,default:84},minWidth:{type:Number,default:F},operationList:{type:Array,default:Q},filterMode:{type:Boolean,default:!0},hideExpandButton:{type:Boolean,default:!0},fixedWidth:{type:Boolean,default:!1}},emits:[o.emitsMap.updateModelValue,o.emitsMap.operation,o.emitsMap.change],setup(a,{expose:h,emit:p}){e.useCssVars(r=>({c43334b4:a.maxHeight+"px",v002cf482:b.value?b.value+"px":"100%"}));const i=a,c=p,n=e.ref({}),f=e.ref(!i.isExpand),t=e.ref(null),l=e.ref(!1),y=e.ref(!1),V=e.ref(!1),W=e.computed(()=>{const r={};return i.items.forEach(u=>{if(u.required){const s=[{required:!0,message:`${u.label}不能为空`,trigger:"blur"}];typeof u.validator=="function"&&s.push({validator:u.validator,trigger:"blur"}),r[u.key]=s}}),r}),w=e.computed(()=>i.items?.filter(r=>!r.hidden)||[]),M=e.computed(()=>i.filterMode?w.value?.slice(0,2)||[]:w.value),k=e.computed(()=>i.filterMode?w.value.slice(2):[]),D=r=>{n.value={...r}},L=()=>{c(o.emitsMap.updateModelValue,{...n.value})},U=(r,u)=>{n.value[r]=u,V.value=!0,v(o.operationConfigMap.search),setTimeout(()=>{V.value=!1},200),C(r,u)},C=(r,u)=>{r&&c(o.emitsMap.change,r,u)},I=()=>n.value,B=(r,u)=>{V.value||c(o.emitsMap.operation,o.operationConfigMap.search,n.value)},v=r=>{L(),c(o.emitsMap.operation,r,n.value),(r===o.operationConfigMap.search||r===o.operationConfigMap.reset)&&(l.value=!1,y.value=!1)},z=r=>t.value.validate(r),b=e.ref(0),O=r=>{if(i.fixedWidth){b.value=132;return}b.value=r+32},R=()=>{f.value=!f.value},q=()=>{l.value=!1,y.value=!0},j=()=>{y.value=!1,l.value=!0},N=e.ref(!1),$=r=>{N.value=r>i.maxHeight},A=e.computed(()=>i.filterMode||f.value?"10px":"0");return e.onMounted(()=>{D(i.modelValue),$()}),e.watch(()=>i.modelValue,r=>{D(r)},{immediate:!0,deep:!0}),h({validate:z,getFormData:I,formRef:t}),(r,u)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["relative overflow-hidden w-full",{flex:a.filterMode}])},[e.createElementVNode("div",{class:e.normalizeClass({"is-collapsed overflow-hidden":!f.value})},[e.createVNode(e.unref(d.ElAutoResizer),null,{default:e.withCtx(({height:s})=>[e.createTextVNode(e.toDisplayString($(s))+" ",1),e.createVNode(E,{ref_key:"formRef",ref:t,items:M.value,"form-data":n.value,rules:W.value,"label-width":a.labelWidth,"label-position":a.labelPosition,inline:!0,"show-label":!a.filterMode,"min-width":a.minWidth,"is-filter-preview":a.filterMode,fixedWidth:a.fixedWidth,onChange:U,onEnter:B},e.createSlots({default:e.withCtx(()=>[a.isExpand&&!a.filterMode?(e.openBlock(),e.createBlock(e.unref(d.ElFormItem),{key:0,"label-width":"0"},{default:e.withCtx(()=>[e.createElementVNode("div",Y,[e.createVNode(e.unref(d.ElAutoResizer),null,{default:e.withCtx(({width:m})=>[e.createTextVNode(e.toDisplayString(O(m)),1)]),_:1})])]),_:1})):e.createCommentVNode("",!0)]),_:2},[e.renderList(M.value,m=>({name:m.key,fn:e.withCtx(H=>[e.renderSlot(r.$slots,m.key,e.normalizeProps(e.guardReactiveProps(H)),void 0,!0)])}))]),1032,["items","form-data","rules","label-width","label-position","show-label","min-width","is-filter-preview","fixedWidth"])]),_:3})],2),e.createElementVNode("div",{class:e.normalizeClass(["operation-buttons",{"absolute right-0 text-right":a.isExpand&&!a.filterMode,"text-left":a.filterMode,"bg-fff":a.isExpand&&!a.filterMode&&!a.fixedWidth}]),style:e.normalizeStyle({bottom:A.value})},[a.filterMode?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(e.unref(d.ElButton),{onClick:u[0]||(u[0]=s=>v(e.unref(o.operationConfigMap).reset)),type:"default"},{default:e.withCtx(()=>[...u[3]||(u[3]=[e.createTextVNode("重置",-1)])]),_:1}),k.value?.length?(e.openBlock(),e.createBlock(e.unref(d.ElPopover),{key:0,visible:l.value,placement:"bottom-start",width:628,trigger:"click"},{reference:e.withCtx(()=>[e.createVNode(e.unref(d.ElButton),{onClick:u[1]||(u[1]=s=>l.value=!l.value),icon:e.unref(g.IconCheck),type:"default"},{default:e.withCtx(()=>[...u[4]||(u[4]=[e.createTextVNode(" 筛选器 ",-1)])]),_:1},8,["icon"])]),default:e.withCtx(()=>[e.createElementVNode("div",Z,[e.createVNode(S.CustomTitle,{content:"筛选器",fontSize:16}),e.createVNode(e.unref(d.ElIcon),{size:16,onClick:q},{default:e.withCtx(()=>[e.createVNode(e.unref(g.IconMagnify))]),_:1})]),e.createVNode(E,{items:k.value,"form-data":n.value,"label-width":"auto","label-position":"top",inline:!1,"show-label":!0,"is-filter":!0,"min-width":a.minWidth,class:"filter-form-popover overflow-y-auto",onChange:C,onEnter:B},e.createSlots({_:2},[e.renderList(k.value,s=>({name:s.key,fn:e.withCtx(m=>[e.renderSlot(r.$slots,s.key,e.normalizeProps(e.guardReactiveProps(m)),void 0,!0)])}))]),1032,["items","form-data","min-width"]),e.createElementVNode("div",_,[e.createVNode(x,{"operation-list":a.operationList,onOperation:v},e.createSlots({_:2},[r.$slots.operation?{name:"operation",fn:e.withCtx(({operationList:s})=>[e.renderSlot(r.$slots,"operation",{operationList:s},void 0,!0)]),key:"0"}:void 0]),1032,["operation-list"])])]),_:3},8,["visible"])):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[N.value&&a.isExpand&&a.hideExpandButton?(e.openBlock(),e.createBlock(e.unref(d.ElButton),{key:0,icon:f.value?e.unref(g.IconUp):e.unref(g.IconDown),text:"",onClick:R},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(f.value?"收起":"展开"),1)]),_:1},8,["icon"])):e.createCommentVNode("",!0),e.createVNode(x,{"operation-list":a.operationList,onOperation:v},e.createSlots({_:2},[r.$slots.operation?{name:"operation",fn:e.withCtx(({operationList:s})=>[e.renderSlot(r.$slots,"operation",{operationList:s},void 0,!0)]),key:"0"}:void 0]),1032,["operation-list"])],64))],6),e.createVNode(e.unref(d.ElDrawer),{modelValue:y.value,"onUpdate:modelValue":u[2]||(u[2]=s=>y.value=s),size:"628","show-close":!1},{header:e.withCtx(()=>[e.createElementVNode("div",ee,[e.createVNode(S.CustomTitle,{content:"筛选器",fontSize:16}),e.createVNode(e.unref(d.ElIcon),{size:16,onClick:j,class:"shrink-button"},{default:e.withCtx(()=>[e.createVNode(e.unref(g.IconShrink))]),_:1})])]),default:e.withCtx(()=>[e.createElementVNode("div",te,[e.createVNode(E,{items:k.value,"form-data":n.value,"label-width":"auto","label-position":"top",inline:!1,"show-label":!0,"is-filter":!0,"min-width":a.minWidth,onChange:C,onEnter:B},e.createSlots({_:2},[e.renderList(k.value,s=>({name:s.key,fn:e.withCtx(m=>[e.renderSlot(r.$slots,s.key,e.normalizeProps(e.guardReactiveProps(m)),void 0,!0)])}))]),1032,["items","form-data","min-width"])]),e.createElementVNode("div",ae,[e.createVNode(x,{"operation-list":a.operationList,onOperation:v},e.createSlots({_:2},[r.$slots.operation?{name:"operation",fn:e.withCtx(({operationList:s})=>[e.renderSlot(r.$slots,"operation",{operationList:s},void 0,!0)]),key:"0"}:void 0]),1032,["operation-list"])])]),_:3},8,["modelValue"])],2))}}),oe=P._export_sfc(le,[["__scopeId","data-v-3877c183"]]),T=K.withInstall(oe);exports.SearchBar=T;exports.default=T;
|
package/lib/TreeSelect.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("./chunks/index.CkihWzK6.js"),l=require("./chunks/layout.
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("./chunks/index.CkihWzK6.js"),l=require("./chunks/layout.BhOA_UzD.js"),e=t.withInstall(l.TreeSelect);exports.TreeSelect=e;exports.default=e;
|
package/lib/TreeShowSelect.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require('./assets/TreeShowSelect.css');const V=require("./chunks/index.CkihWzK6.js"),e=require("vue"),S=require("element-plus"),u=require("./chunks/layout.
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require('./assets/TreeShowSelect.css');const V=require("./chunks/index.CkihWzK6.js"),e=require("vue"),S=require("element-plus"),u=require("./chunks/layout.BhOA_UzD.js"),b=require("./chunks/_plugin-vue_export-helper.BHFhmbuH.js"),g={class:"left-box w-50-percent flex flex-col"},y={class:"head-box fz-14 pd-t-8 pd-b-8 pd-l-12 pd-r-12 mg-b-8 text-202434"},w={class:"pd-r-12 pd-l-12 flex-1"},P={class:"right-box w-50-percent flex flex-col"},k={class:"head-box fz-14 pd-t-8 pd-b-8 pd-l-12 pd-r-12 mg-b-8 text-202434"},E={class:"pd-r-12 pd-l-12 flex-1 selected-list overflow-y-auto pd-t-8"},T=Object.assign({name:"TreeShowSelect"},{__name:"layout",props:{modelValue:{type:Object,default:()=>[]}},emits:["getCheckedNode"],setup(p,{emit:m}){const f=p,h=m,s=e.useAttrs(),r=e.ref(),_=e.computed(()=>s.treeProps?s.treeProps:{value:"id",label:"label",children:"children"}),n=t=>String(t).includes("%")?t:t+"px",l=e.ref([]),v=t=>{const{selectedNode:o,selectedValue:d,selectedParentNodes:c}=t;l.value=o,h("getCheckedNode",{selectedValue:d,selectedNode:o,selectedParentNodes:c})},x=t=>{r.value?.setNodeCheckStatus(t[_.value.value],!1)},N=t=>{l.value=t||[]};return e.watch(()=>f.modelValue,t=>{N(t)},{immediate:!0,deep:!0}),(t,o)=>(e.openBlock(),e.createBlock(e.unref(S.ElAutoResizer),null,{default:e.withCtx(({width:d,height:c})=>[e.createElementVNode("div",{class:"out-box flex radius-8 text-202434",style:e.normalizeStyle({width:n(d),height:n(c)})},[e.createElementVNode("div",g,[e.createElementVNode("div",y,e.toDisplayString(r.value&&r.value.allNodeNumbers||0)+"项 ",1),e.createElementVNode("div",w,[e.createVNode(u.TreeSelect,e.mergeProps({modelValue:l.value,"onUpdate:modelValue":o[0]||(o[0]=a=>l.value=a),ref_key:"treeRef",ref:r},e.unref(s),{onHandleCheck:v}),null,16,["modelValue"])])]),e.createElementVNode("div",P,[e.createElementVNode("div",k,e.toDisplayString(l.value.length)+"项 ",1),e.createElementVNode("div",E,[e.createVNode(u.TreeSelect,{modelValue:l.value,"onUpdate:modelValue":o[1]||(o[1]=a=>l.value=a),class:"tree-select-list",treeProps:e.unref(s).treeProps,treeList:l.value,isListMode:!0,onHandleDeleteNode:x},null,8,["modelValue","treeProps","treeList"])])])],4)]),_:1}))}}),C=b._export_sfc(T,[["__scopeId","data-v-c9c32c81"]]),i=V.withInstall(C);exports.TreeShowSelect=i;exports.default=i;
|
package/lib/assets/SearchBar.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.filter-form[data-v-
|
|
1
|
+
.filter-form[data-v-8adcd08b]{grid-template-columns:repeat(2,1fr);gap:10px}.filter-preview-form[data-v-8adcd08b]{display:flex}.filter-preview-form .el-form-item[data-v-8adcd08b]{width:var(--v38755745);margin-right:10px}.search-bar-form[data-v-8adcd08b]{grid-template-columns:repeat(auto-fit,minmax(var(--v38755745),1fr));gap:10px}.search-bar-form.search-bar-form-fixed[data-v-8adcd08b]{grid-template-columns:repeat(auto-fit,var(--v38755745))}.search-bar-form.search-bar-form-fixed.el-form--inline .el-form-item[data-v-8adcd08b]{margin-bottom:18px}.search-bar-form.el-form--inline .el-form-item[data-v-8adcd08b]{margin-right:0;margin-bottom:10px}.search-bar-form.el-form--inline .el-form-item.el-form-item--label-left[data-v-8adcd08b]{display:flex;padding:0 14px;background:var(--neutral-color-18);border-radius:8px;border:1px solid var(--parting-line)}.search-bar-form.el-form--inline .el-form-item.el-form-item--label-left[data-v-8adcd08b] .el-form-item__content{justify-content:end}.search-bar-form.el-form--inline.el-form--label-top[data-v-8adcd08b]{display:grid}.search-bar-item--wide[data-v-8adcd08b]{grid-column:span 2}.is-collapsed[data-v-3877c183]{max-height:var(--c43334b4)}.operation-buttons[data-v-3877c183]{width:var(--v002cf482);z-index:1}.h-32[data-v-3877c183]{height:32px}.drawer-header[data-v-3877c183]{display:flex;justify-content:space-between;align-items:center;width:100%}.drawer-header .shrink-button[data-v-3877c183]{margin-left:auto}.border-top[data-v-3877c183]{border-top:1px solid var(--parting-line)}[data-v-3877c183] .el-drawer__body{padding:16px 0;display:flex;flex-direction:column;overflow:hidden}.filter-form-popover[data-v-3877c183]{max-height:400px}[data-v-3877c183] .el-drawer__header{margin-bottom:0;padding:16px 16px 0}
|
package/lib/assets/layout2.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.el-tree .el-tree-node__content{position:relative}.element-tree-node-label-wrapper{flex:1;display:flex;align-items:center}.element-tree-node-label{font-size:12px}.element-tree-node-line-ver{display:block;position:absolute;top:0;left:0;height:100%;border-left:1px dashed #dcdfe6}.element-tree-node-line-ver.last-node-isLeaf-line{height:50%}.element-tree-node-line-hor{display:block;position:absolute;top:50%;left:0;height:0;border-bottom:1px dashed #dcdfe6}.element-tree-node-label-line{flex:1;border-top:1px dashed #dcdfe6;align-self:center;margin:0 10px}[data-v-
|
|
1
|
+
.el-tree .el-tree-node__content{position:relative}.element-tree-node-label-wrapper{flex:1;display:flex;align-items:center}.element-tree-node-label{font-size:12px}.element-tree-node-line-ver{display:block;position:absolute;top:0;left:0;height:100%;border-left:1px dashed #dcdfe6}.element-tree-node-line-ver.last-node-isLeaf-line{height:50%}.element-tree-node-line-hor{display:block;position:absolute;top:50%;left:0;height:0;border-bottom:1px dashed #dcdfe6}.element-tree-node-label-line{flex:1;border-top:1px dashed #dcdfe6;align-self:center;margin:0 10px}[data-v-b82736b8] .el-tree-node__label{line-height:22px}[data-v-b82736b8] .el-tree-node:focus>.el-tree-node__content{background-color:transparent}[data-v-b82736b8] .el-tree-node__content{border-radius:8px}[data-v-b82736b8] .el-tree-node__content:hover{background-color:var(--primary-color-5)}[data-v-b82736b8] .element-tree-node-label{font-size:14px}.list-item[data-v-b82736b8]{height:32px}.list-item[data-v-b82736b8]:hover{background:var(--primary-color-5)}[data-v-b82736b8] .element-tree-node-line-ver,[data-v-b82736b8] .element-tree-node-line-hor{border-color:var(--neutral-color-19)}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";require('../assets/layout2.css');const e=require("vue"),S=require("element-plus"),B=require("color-message-lingyun-vue"),W=require("../IconEmpty.js"),X=require("./_plugin-vue_export-helper.BHFhmbuH.js");function Y(s){return{name:"element-tree-line",props:{node:{type:Object,required:!0},data:{type:Object},treeData:{type:Array},indent:{type:Number,default(){return 16}},showLabelLine:{type:Boolean,default:!0}},render(c){const d=s||c,a=this.getScopedSlot("default"),l=this.getScopedSlot("node-label"),u=this.getScopedSlot("after-node-label"),p=a?this.getScopedSlotValue(a,{node:this.node,data:this.data}):[l?this.getScopedSlotValue(l,{node:this.node,data:this.data}):d("span",{class:"element-tree-node-label"},this.node.label),this.showLabelLine?d("span",{class:"element-tree-node-label-line"}):null,this.getScopedSlotValue(u,{node:this.node,data:this.data})],y=[];let h=this.node;for(;h;){let o=h.parent;if(h.level===1&&!h.parent){if(!this.treeData||!Array.isArray(this.treeData))throw Error("if you using el-tree-v2 (Virtualized Tree) of element-plus,element-tree-line required data.");o={children:Array.isArray(this.treeData)?this.treeData.map(m=>({...m,key:m.id})):[],level:0,key:"node-0",parent:null}}if(o){const m=(o.children||o.childNodes).findIndex(g=>(g.key||g.id)===(h.key||h.id));y.unshift(m===(o.children||o.childNodes).length-1)}h=o}const C=[];for(let o=0;o<this.node.level;o++)y[o]&&this.node.level-1!==o||C.push(d("span",{class:{"element-tree-node-line-ver":!0,"last-node-isLeaf-line":y[o]&&this.node.level-1===o},style:{left:this.indent*o+"px"}}));return d("span",{class:"element-tree-node-label-wrapper"},[p].concat(C).concat([d("span",{class:"element-tree-node-line-hor",style:{width:(this.node.isLeaf?24:8)+"px",left:(this.node.level-1)*this.indent+"px"}})]))},methods:{getScopedSlot(c){if(!c)return null;const d=c.split("||");let a=null;for(let l=0;l<d.length;l++){const u=d[l],p=(this.$slots||{})[u];if(p){a=p;break}if(a=(this.$scopedSlots||{})[u],a)break}return a},getScopedSlotValue(c,d,a=null){return typeof c=="function"?c(d)||a:c||a}}}}function q(s){const c=Y(s);return s&&(c.methods.getScopedSlot=function(a){if(!a)return null;const l=a.split("||");let u=null;for(let p=0;p<l.length;p++){const y=l[p],h=(this.$slots||{})[y];if(h){u=h;break}}return u}),c}q();const Z={key:0,class:"mg-b-16"},ee={key:0,class:"list-item flex justify-between pd-l-6 pd-r-6 radius-8 items-center w-full"},te=["onClick"],le={key:1},ne=Object.assign({name:"TreeSelect"},{__name:"layout",props:{modelValue:{type:Object,default:()=>[]},treeProps:{type:Object,default:()=>({value:"id",label:"label",children:"children"})},apiConfig:{type:Function},reqParams:{type:Object,default:()=>({})},autoLoad:{type:Boolean,default:!0},isMultiple:{type:Boolean,default:!0},hasFilter:{type:Boolean,default:!1},isListMode:{type:Boolean,default:!1},treeList:{type:Array,default:()=>[]},hasTreeLine:{type:Boolean,default:!0},includeParentSelected:{type:Boolean,default:!1}},emits:["handleCheck","handleDeleteNode","initFinish"],setup(s,{expose:c,emit:d}){const a=q(e.h),l=s,u=d,p=e.useAttrs(),y=()=>e.h(B.IconRighttop,{style:{color:"var(--text-color-2)",fontSize:"16px"}}),h=l.isMultiple?20:10,C=l.isMultiple?15:11,o=e.ref([]),m=e.ref(null),g=e.ref(null),V=e.computed(()=>l.treeProps.value),x=e.computed(()=>l.treeProps.label),v=e.computed(()=>l.treeProps.children),M=e.ref(!1),_=e.computed(()=>!l.isMultiple&&M.value),z=e.computed(()=>typeof l.apiConfig=="function"),D=t=>String(t).includes("%")?t:t+"px",F=()=>{let t=m.value?.getCheckedNodes(),n=t.map(i=>i[V.value]),r=[];return t.length&&!l.includeParentSelected&&(t=t.filter(i=>!i[v.value]),n=t.map(i=>i[V.value])),l.includeParentSelected&&(r=j(o.value,n)),{selectedNodeValues:n,selectedNodes:t,selectedParentNodes:r}};function j(t,n){const r=new Map;function i(f,k=[]){for(const N of f){const J=[...k,N];N.children&&N.children.length>0?i(N.children,J):n.includes(N.id)&&k.forEach(w=>{r.has(w.id)||r.set(w.id,{...w})})}}return i(t),Array.from(r.values())}const O=t=>{!l.isMultiple||l.isListMode||L()},K=(t,n)=>{l.isMultiple||l.isListMode||(M.value=!0,g.value=n.key,u("handleCheck",{selectedValue:[g.value],selectedNode:[n.data]}))},P=e.ref(""),R=t=>{m.value.filter(t)},$=(t,n)=>n[x.value].includes(t),H=t=>{let n=0;function r(i){for(const f of i){const k=f[v.value]&&f[v.value].length>0;l.includeParentSelected?n++:k||n++,k&&r(f[v.value])}}return r(t),n},Q=e.computed(()=>H(o.value));function L(){const{selectedNodeValues:t,selectedNodes:n,selectedParentNodes:r}=F();u("handleCheck",{selectedValue:t,selectedNode:n,selectedParentNodes:r})}const U=(t,n)=>{m.value?.setChecked(t,n),L()},I=()=>{p["default-checked-keys"]&&e.nextTick(()=>{L()})},G=t=>{u("handleDeleteNode",t)},b=t=>t?.map(n=>({...n,[v.value]:n[v.value]?.length?b(n[v.value]):void 0})),T=async()=>{z.value?l.apiConfig(l.reqParams)?.then(t=>{o.value=b(t?.data||[]),I(),E(l.modelValue),u("initFinish",o.value)}):A()},A=()=>{l.isListMode?o.value=b(l.treeList||[]):(o.value=b(l.treeList||[]),o.value.length&&(I(),E(l.modelValue)))},E=t=>{const n=t&&t.length&&t.map(r=>r[l.treeProps.value]);e.nextTick(()=>{m.value?.setCheckedKeys(n)})};return e.watch(()=>l.treeList,()=>{A()},{deep:!0}),e.watch(()=>l.modelValue,t=>{e.nextTick(()=>{E(t)})},{deep:!0}),e.onMounted(()=>{T()}),c({allNodeNumbers:Q,loadData:T,setNodeCheckStatus:U}),(t,n)=>(e.openBlock(),e.createBlock(e.unref(S.ElAutoResizer),null,{default:e.withCtx(({width:r,height:i})=>[e.createElementVNode("div",{style:e.normalizeStyle({width:D(r),height:D(i)})},[s.hasFilter?(e.openBlock(),e.createElementBlock("div",Z,[e.createVNode(e.unref(S.ElInput),{modelValue:P.value,"onUpdate:modelValue":n[0]||(n[0]=f=>P.value=f),placeholder:"请输入",onInput:R},{prefix:e.withCtx(()=>[e.createVNode(e.unref(S.ElIcon),{size:16,color:"var(--neutral-color-12)",class:"mg-r-4"},{default:e.withCtx(()=>[e.createVNode(e.unref(B.IconSearch))]),_:1})]),_:1},8,["modelValue"])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(s.hasFilter?"pd-l-8 pd-r-8":"")},[e.createVNode(e.unref(S.ElTreeV2),e.mergeProps({ref_key:"treeRef",ref:m,height:s.hasFilter?i-48:i,data:o.value,props:s.treeProps,"node-key":V.value,"show-checkbox":s.isMultiple&&!s.isListMode,"item-size":34,indent:e.unref(h),"highlight-current":_.value,icon:s.isListMode?"":y,"filter-method":$},e.unref(p),{onNodeClick:K,onCheck:O}),{default:e.withCtx(({node:f})=>[s.isListMode?(e.openBlock(),e.createElementBlock("div",ee,[e.createElementVNode("span",null,e.toDisplayString(f.data[x.value]),1),e.createElementVNode("div",{class:"flex items-center",onClick:e.withModifiers(k=>G(f.data),["stop"])},[e.createVNode(e.unref(S.ElIcon),{size:14,color:"var(--neutral-color-5)"},{default:e.withCtx(()=>[e.createVNode(e.unref(B.IconDelete))]),_:1})],8,te)])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[s.hasTreeLine?(e.openBlock(),e.createBlock(e.unref(a),{key:0,node:f,treeData:o.value,showLabelLine:!1,indent:e.unref(C)},null,8,["node","treeData","indent"])):(e.openBlock(),e.createElementBlock("span",le,e.toDisplayString(f.data[x.value]),1))],64))]),empty:e.withCtx(()=>[e.createVNode(e.unref(W.IconEmpty))]),_:1},16,["height","data","props","node-key","show-checkbox","indent","highlight-current","icon"])],2)],4)]),_:1}))}}),oe=X._export_sfc(ne,[["__scopeId","data-v-b82736b8"]]);exports.TreeSelect=oe;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "color-star-custom-components",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.8",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"color-star-custom-components",
|
|
6
6
|
"component library",
|
|
@@ -175,9 +175,9 @@
|
|
|
175
175
|
"axios": "^1.8.2",
|
|
176
176
|
"vue": "^3.5.25",
|
|
177
177
|
"color-message-aibox-vue": "0.0.70",
|
|
178
|
-
"color-
|
|
179
|
-
"color-star-custom-methods": "0.0.
|
|
180
|
-
"color-
|
|
178
|
+
"color-message-lingyun-vue": "0.0.30",
|
|
179
|
+
"color-star-custom-methods": "0.0.13",
|
|
180
|
+
"color-star-atom-style": "0.0.2"
|
|
181
181
|
},
|
|
182
182
|
"optionalDependencies": {
|
|
183
183
|
"@ast-grep/napi-linux-x64-musl": "^0.39.6",
|