yahee-components 0.0.105 → 0.0.107
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/drop-down-condition/drop-down-condition.vue.js +5 -226
- package/es/drop-down-condition/drop-down-condition.vue2.js +283 -2
- package/package.json +1 -1
- package/types/src/drop-down-condition/drop-down-condition.d.ts +4 -0
- package/types/src/drop-down-condition/drop-down-condition.vue.d.ts +27 -15
- package/types/src/drop-down-condition/index.d.ts +25 -25
- package/types/src/installs.d.ts +25 -25
|
@@ -1,228 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
import { M2 as x } from "../utils/translate.js";
|
|
6
|
-
import { ElButton as P, ElDropdown as ie, ElCheckboxGroup as Y, ElCheckbox as $ } from "element-plus";
|
|
7
|
-
import "element-plus/theme-chalk/src/base.scss";
|
|
8
|
-
import "element-plus/theme-chalk/src/button.scss";
|
|
9
|
-
import "element-plus/theme-chalk/src/checkbox.scss";
|
|
10
|
-
import "element-plus/theme-chalk/src/checkbox-group.scss";
|
|
11
|
-
import "element-plus/theme-chalk/src/button-group.scss";
|
|
12
|
-
import "element-plus/theme-chalk/src/popper.scss";
|
|
13
|
-
import "element-plus/theme-chalk/src/scrollbar.scss";
|
|
14
|
-
import "element-plus/theme-chalk/src/dropdown.scss";
|
|
15
|
-
const de = { class: "yahee-drop-down-condition" }, fe = { key: 0 }, ve = { style: { display: "flex", "align-items": "center", outline: "none" } }, pe = { key: 0 }, he = { style: { display: "flex", width: "auto", padding: "10px" } }, me = ["onClick"], ge = { class: "scrollable-container" }, ye = { key: 0 }, Ae = /* @__PURE__ */ se({
|
|
16
|
-
name: "YaheeDropDownCondition",
|
|
17
|
-
__name: "drop-down-condition",
|
|
18
|
-
props: {
|
|
19
|
-
filterList: {},
|
|
20
|
-
totalCount: {},
|
|
21
|
-
level1Count: {},
|
|
22
|
-
level2Count: {},
|
|
23
|
-
filterKey: {},
|
|
24
|
-
enumEntity: {},
|
|
25
|
-
noNeedRefreshNumFilterName: {},
|
|
26
|
-
initFilters: { type: Function }
|
|
27
|
-
},
|
|
28
|
-
emits: ["filterChange", "setNoNeedRefreshNumFilterName"],
|
|
29
|
-
setup(H, { emit: J }) {
|
|
30
|
-
const Q = g(), n = _({});
|
|
31
|
-
let j = _({});
|
|
32
|
-
const r = _({}), p = _({}), h = g(!0), m = H, M = J, { filterKey: w, filterList: V, totalCount: C, level1Count: F, level2Count: S, noNeedRefreshNumFilterName: O } = ae(m), T = g(s.get(C, "value", 0)), B = g(s.get(F, "value", [])), D = g(s.get(S, "value", [])), c = g();
|
|
33
|
-
function q(t) {
|
|
34
|
-
const { text: o, value: e } = t, l = n[o];
|
|
35
|
-
s.isNil(l) || s.isEmpty(l) ? n[o] = [e] : n[o] = [], p[o] = !p[o], p[o] ? (oe(o), r[o] = U.getBackgroundColor(!0), h.value = !1) : (ne(o), r[t.text] = {}, h.value = !0), h.value = L(), A();
|
|
36
|
-
}
|
|
37
|
-
function L() {
|
|
38
|
-
const t = c.value.filter((l) => !s.isEmpty(l.subs)).flatMap((l) => l.subs).length, o = c.value.filter((l) => s.isEmpty(l.subs)).length;
|
|
39
|
-
return Object.values(n).map((l) => l.length).reduce((l, v) => l + v, 0) === t + o || s.isEmpty(Object.values(n).flat());
|
|
40
|
-
}
|
|
41
|
-
function X(t) {
|
|
42
|
-
s.isEmpty(n[t.text]) ? (r[t.text] = {}, p[t.text] = !1) : n[t.text].length === s.get(t, "subs.length", 1) ? (r[t.text] = U.getBackgroundColor(!0), p[t.text] = !0) : r[t.text] = {
|
|
43
|
-
backgroundColor: "#0F7535",
|
|
44
|
-
color: "#fff",
|
|
45
|
-
borderColor: "#0F7535"
|
|
46
|
-
}, h.value = L(), A();
|
|
47
|
-
}
|
|
48
|
-
function Z() {
|
|
49
|
-
h.value = L(), A();
|
|
50
|
-
}
|
|
51
|
-
function A() {
|
|
52
|
-
M("setNoNeedRefreshNumFilterName", w.value);
|
|
53
|
-
}
|
|
54
|
-
function ee() {
|
|
55
|
-
h.value = !0;
|
|
56
|
-
for (const t in r)
|
|
57
|
-
r[t] = {};
|
|
58
|
-
for (const t in n)
|
|
59
|
-
delete n[t];
|
|
60
|
-
for (const t in p)
|
|
61
|
-
delete p[t];
|
|
62
|
-
I();
|
|
63
|
-
}
|
|
64
|
-
const te = (t) => U.getBackgroundColor(t);
|
|
65
|
-
function le(t) {
|
|
66
|
-
if (t)
|
|
67
|
-
j = s.cloneDeep(n);
|
|
68
|
-
else {
|
|
69
|
-
if (s.isEqual(j, n))
|
|
70
|
-
return;
|
|
71
|
-
I();
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
function I() {
|
|
75
|
-
M("filterChange", [
|
|
76
|
-
{
|
|
77
|
-
filterKey: w.value,
|
|
78
|
-
checkedValues: Object.values(n).flat()
|
|
79
|
-
}
|
|
80
|
-
]);
|
|
81
|
-
}
|
|
82
|
-
function oe(t) {
|
|
83
|
-
const o = c.value.find((e) => e.text === t);
|
|
84
|
-
o && o.subs && (n[t] = o.subs.map((e) => e.value));
|
|
85
|
-
}
|
|
86
|
-
function ne(t) {
|
|
87
|
-
n[t] = [];
|
|
88
|
-
}
|
|
89
|
-
function ue() {
|
|
90
|
-
if (V.value && V.value.length > 0) {
|
|
91
|
-
c.value = [...V.value];
|
|
92
|
-
return;
|
|
93
|
-
}
|
|
94
|
-
const t = `filter-key-${m.enumEntity}`, o = G.getWithExpireTime(t);
|
|
95
|
-
o ? c.value = o : m.initFilters && m.initFilters(m.enumEntity).then((e) => {
|
|
96
|
-
c.value = e.data, G.setWithExpireTime(t, c.value, 1200 * 1e3);
|
|
97
|
-
}).catch((e) => {
|
|
98
|
-
console.error(`获取${m.enumEntity}筛选列表失败:`, e);
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
return re(
|
|
102
|
-
[() => C.value, () => F.value, () => S.value],
|
|
103
|
-
([t, o, e], [l, v, R]) => {
|
|
104
|
-
console.log(t, o, e), console.log(l, v, R), (!O.value || !s.eq(O.value, w.value)) && (T.value = C.value, B.value = F.value, D.value = S.value);
|
|
105
|
-
}
|
|
106
|
-
), ce(() => {
|
|
107
|
-
ue();
|
|
108
|
-
}), (t, o) => (a(), i("div", de, [
|
|
109
|
-
W(u(P), {
|
|
110
|
-
size: "small",
|
|
111
|
-
class: "el-button el-button--small custom-total-button",
|
|
112
|
-
style: z(te(h.value)),
|
|
113
|
-
onClick: ee
|
|
114
|
-
}, {
|
|
115
|
-
default: d(() => [
|
|
116
|
-
k(f(u(x)("全部")) + " ", 1),
|
|
117
|
-
u(C) ? (a(), i("span", fe, "(" + f(T.value) + ")", 1)) : N("", !0)
|
|
118
|
-
]),
|
|
119
|
-
_: 1
|
|
120
|
-
}, 8, ["style"]),
|
|
121
|
-
W(u(ie), {
|
|
122
|
-
ref_key: "dropdown1",
|
|
123
|
-
ref: Q,
|
|
124
|
-
"popper-class": "custom-dropdown",
|
|
125
|
-
onVisibleChange: le
|
|
126
|
-
}, {
|
|
127
|
-
dropdown: d(() => [
|
|
128
|
-
E("div", he, [
|
|
129
|
-
(a(!0), i(b, null, K(c.value, (e) => (a(), y(u(Y), {
|
|
130
|
-
key: e.value,
|
|
131
|
-
modelValue: n[e.text],
|
|
132
|
-
"onUpdate:modelValue": (l) => n[e.text] = l,
|
|
133
|
-
size: "small",
|
|
134
|
-
class: "checkbox-group inner-checkbox-group custom-dropdown-checkbox-group",
|
|
135
|
-
onChange: (l) => X(e)
|
|
136
|
-
}, {
|
|
137
|
-
default: d(() => [
|
|
138
|
-
u(s).isNil(e.subs) ? (a(), y(u($), {
|
|
139
|
-
key: 1,
|
|
140
|
-
value: e.value,
|
|
141
|
-
class: "checkbox custom-dropdown-button",
|
|
142
|
-
border: ""
|
|
143
|
-
}, {
|
|
144
|
-
default: d(() => [
|
|
145
|
-
k(f(u(x)(e.text)), 1)
|
|
146
|
-
]),
|
|
147
|
-
_: 2
|
|
148
|
-
}, 1032, ["value"])) : (a(), i(b, { key: 0 }, [
|
|
149
|
-
E("span", {
|
|
150
|
-
class: "el-button custom-dropdown-button el-button--small inner-el-button",
|
|
151
|
-
style: z(r[e.text]),
|
|
152
|
-
onClick: (l) => q(e)
|
|
153
|
-
}, f(u(x)(e.text)), 13, me),
|
|
154
|
-
E("div", ge, [
|
|
155
|
-
(a(!0), i(b, null, K(e.subs, (l) => (a(), y(u($), {
|
|
156
|
-
key: l.value,
|
|
157
|
-
class: "checkbox custom-dropdown-button",
|
|
158
|
-
value: l.value,
|
|
159
|
-
border: ""
|
|
160
|
-
}, {
|
|
161
|
-
default: d(() => {
|
|
162
|
-
var v;
|
|
163
|
-
return [
|
|
164
|
-
k(f(u(x)(l.text)), 1),
|
|
165
|
-
u(s).isEmpty(D.value) ? N("", !0) : (a(), i("span", ye, "(" + f((v = D.value.filter((R) => R.value == l.value)[0]) == null ? void 0 : v.count) + ")", 1))
|
|
166
|
-
];
|
|
167
|
-
}),
|
|
168
|
-
_: 2
|
|
169
|
-
}, 1032, ["value"]))), 128))
|
|
170
|
-
])
|
|
171
|
-
], 64))
|
|
172
|
-
]),
|
|
173
|
-
_: 2
|
|
174
|
-
}, 1032, ["modelValue", "onUpdate:modelValue", "onChange"]))), 128))
|
|
175
|
-
])
|
|
176
|
-
]),
|
|
177
|
-
default: d(() => [
|
|
178
|
-
E("div", ve, [
|
|
179
|
-
(a(!0), i(b, null, K(c.value, (e) => (a(), i(b, null, [
|
|
180
|
-
e.isCheckbox ? (a(), y(u(Y), {
|
|
181
|
-
key: e.value,
|
|
182
|
-
modelValue: n[e.text],
|
|
183
|
-
"onUpdate:modelValue": (l) => n[e.text] = l,
|
|
184
|
-
class: "checkbox-group",
|
|
185
|
-
size: "small",
|
|
186
|
-
onChange: Z
|
|
187
|
-
}, {
|
|
188
|
-
default: d(() => [
|
|
189
|
-
e.isCheckbox ? (a(), y(u($), {
|
|
190
|
-
key: 0,
|
|
191
|
-
class: "custom-dropdown-button",
|
|
192
|
-
value: e.value,
|
|
193
|
-
border: ""
|
|
194
|
-
}, {
|
|
195
|
-
default: d(() => [
|
|
196
|
-
k(f(u(x)(e.text)), 1)
|
|
197
|
-
]),
|
|
198
|
-
_: 2
|
|
199
|
-
}, 1032, ["value"])) : N("", !0)
|
|
200
|
-
]),
|
|
201
|
-
_: 2
|
|
202
|
-
}, 1032, ["modelValue", "onUpdate:modelValue"])) : (a(), y(u(P), {
|
|
203
|
-
key: e.text,
|
|
204
|
-
style: z(r[e.text]),
|
|
205
|
-
class: "custom-dropdown-button",
|
|
206
|
-
size: "small",
|
|
207
|
-
onClick: (l) => q(e)
|
|
208
|
-
}, {
|
|
209
|
-
default: d(() => {
|
|
210
|
-
var l;
|
|
211
|
-
return [
|
|
212
|
-
k(f(u(x)(e.text)) + " ", 1),
|
|
213
|
-
u(s).isEmpty(B.value) ? N("", !0) : (a(), i("span", pe, "(" + f((l = B.value.filter((v) => v.value == e.value)[0]) == null ? void 0 : l.count) + ")", 1))
|
|
214
|
-
];
|
|
215
|
-
}),
|
|
216
|
-
_: 2
|
|
217
|
-
}, 1032, ["style", "onClick"]))
|
|
218
|
-
], 64))), 256))
|
|
219
|
-
])
|
|
220
|
-
]),
|
|
221
|
-
_: 1
|
|
222
|
-
}, 512)
|
|
223
|
-
]));
|
|
224
|
-
}
|
|
225
|
-
});
|
|
1
|
+
import o from "./drop-down-condition.vue2.js";
|
|
2
|
+
import "E:/工作/项目代码/common_componentsweb/packages/components/src/drop-down-condition/drop-down-condition.vue?vue&type=style&index=0&scoped=dfd23b62&lang.scss";
|
|
3
|
+
import t from "../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const f = /* @__PURE__ */ t(o, [["__scopeId", "data-v-dfd23b62"]]);
|
|
226
5
|
export {
|
|
227
|
-
|
|
6
|
+
f as default
|
|
228
7
|
};
|
|
@@ -1,4 +1,285 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { defineComponent as he, ref as k, reactive as j, toRefs as ee, watch as I, onMounted as pe, resolveComponent as F, createElementBlock as p, openBlock as i, createVNode as K, normalizeStyle as M, withCtx as b, createTextVNode as N, createCommentVNode as T, toDisplayString as g, unref as h, createElementVNode as B, Fragment as E, renderList as q, createBlock as V } from "vue";
|
|
2
|
+
import r from "../_virtual/lodash.js";
|
|
3
|
+
import { stylesUtils as w } from "../utils/style.js";
|
|
4
|
+
import { storage as te } from "../utils/storage.js";
|
|
5
|
+
import { M2 as m } from "../utils/translate.js";
|
|
6
|
+
const be = { class: "yahee-drop-down-condition" }, ge = { key: 0 }, xe = { style: { display: "flex", "align-items": "center", outline: "none" } }, ke = { key: 0 }, me = { style: { display: "flex", width: "auto", padding: "10px" } }, ye = ["onClick", "disabled"], _e = { class: "scrollable-container" }, Ce = { key: 0 }, Se = /* @__PURE__ */ he({
|
|
7
|
+
name: "YaheeDropDownCondition",
|
|
8
|
+
__name: "drop-down-condition",
|
|
9
|
+
props: {
|
|
10
|
+
max: {},
|
|
11
|
+
filterList: {},
|
|
12
|
+
totalCount: {},
|
|
13
|
+
level1Count: {},
|
|
14
|
+
level2Count: {},
|
|
15
|
+
filterKey: {},
|
|
16
|
+
enumEntity: {},
|
|
17
|
+
noNeedRefreshNumFilterName: {},
|
|
18
|
+
initFilters: { type: Function }
|
|
19
|
+
},
|
|
20
|
+
emits: ["filterChange", "setNoNeedRefreshNumFilterName"],
|
|
21
|
+
setup(le, { emit: oe }) {
|
|
22
|
+
const ne = k(), t = j({}), W = j({}), u = j({}), d = j({}), y = k(!0), f = k([]), x = le, { max: v = 1 / 0 } = ee(x), P = oe, { filterKey: D, filterList: O, totalCount: A, level1Count: Y, level2Count: G, noNeedRefreshNumFilterName: H } = ee(x), J = k(r.get(A, "value", 0)), R = k(r.get(Y, "value", [])), z = k(r.get(G, "value", []));
|
|
23
|
+
function ae() {
|
|
24
|
+
return Object.values(t).flat().length;
|
|
25
|
+
}
|
|
26
|
+
function _(e) {
|
|
27
|
+
return v.value === 1 / 0 || ae() < v.value ? !1 : !Object.values(t).flat().includes(e);
|
|
28
|
+
}
|
|
29
|
+
function Q() {
|
|
30
|
+
if (v.value === 1 / 0) return;
|
|
31
|
+
const e = Object.values(t).flat();
|
|
32
|
+
if (e.length > v.value) {
|
|
33
|
+
const l = e.slice(0, v.value);
|
|
34
|
+
Object.keys(t).forEach((o) => {
|
|
35
|
+
t[o] = [], u[o] = {}, d[o] = !1;
|
|
36
|
+
}), l.forEach((o) => {
|
|
37
|
+
var s;
|
|
38
|
+
for (const a of f.value)
|
|
39
|
+
if (a.value === o) {
|
|
40
|
+
t[a.text] = [o], u[a.text] = w.getBackgroundColor(!0), d[a.text] = !0;
|
|
41
|
+
break;
|
|
42
|
+
} else if ((s = a.subs) != null && s.some((C) => C.value === o)) {
|
|
43
|
+
t[a.text] || (t[a.text] = []), t[a.text].push(o);
|
|
44
|
+
const C = t[a.text].length, n = a.subs.length;
|
|
45
|
+
C === n ? (u[a.text] = w.getBackgroundColor(!0), d[a.text] = !0) : u[a.text] = {
|
|
46
|
+
backgroundColor: "#0F7535",
|
|
47
|
+
color: "#fff",
|
|
48
|
+
borderColor: "#0F7535"
|
|
49
|
+
};
|
|
50
|
+
break;
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
function se() {
|
|
56
|
+
if (O.value && O.value.length > 0) {
|
|
57
|
+
f.value = [...O.value];
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
const e = `filter-key-${x.enumEntity}`, l = te.getWithExpireTime(e);
|
|
61
|
+
l ? f.value = l : x.initFilters && x.initFilters(x.enumEntity).then((o) => {
|
|
62
|
+
f.value = o.data, te.setWithExpireTime(e, f.value, 1200 * 1e3);
|
|
63
|
+
}).catch((o) => {
|
|
64
|
+
console.error(`获取${x.enumEntity}筛选列表失败:`, o);
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
function X(e) {
|
|
68
|
+
const { text: l, value: o } = e, s = t[l];
|
|
69
|
+
v.value === 1 && Object.keys(t).forEach((a) => {
|
|
70
|
+
t[a] = [], u[a] = {}, d[a] = !1;
|
|
71
|
+
}), r.isNil(s) || r.isEmpty(s) ? t[l] = [o] : t[l] = [], d[l] = !d[l], d[l] ? (de(l), u[l] = w.getBackgroundColor(!0)) : (fe(l), u[e.text] = {}), y.value = L(), U();
|
|
72
|
+
}
|
|
73
|
+
function L() {
|
|
74
|
+
if (!f.value.length) return !0;
|
|
75
|
+
const e = f.value.filter((s) => !r.isEmpty(s.subs)).flatMap((s) => s.subs).length, l = f.value.filter((s) => r.isEmpty(s.subs)).length, o = Object.values(t).flat().length;
|
|
76
|
+
return o === e + l || o === 0;
|
|
77
|
+
}
|
|
78
|
+
function ue(e) {
|
|
79
|
+
if (v.value === 1) {
|
|
80
|
+
const s = t[e.text].slice(-1)[0];
|
|
81
|
+
Object.keys(t).forEach((a) => {
|
|
82
|
+
t[a] = [], u[a] = {}, d[a] = !1;
|
|
83
|
+
}), s && (t[e.text] = [s]);
|
|
84
|
+
}
|
|
85
|
+
Q();
|
|
86
|
+
const l = t[e.text] || [], o = r.get(e, "subs.length", 1);
|
|
87
|
+
r.isEmpty(l) ? (u[e.text] = {}, d[e.text] = !1) : l.length === o ? (u[e.text] = w.getBackgroundColor(!0), d[e.text] = !0) : u[e.text] = {
|
|
88
|
+
backgroundColor: "#0F7535",
|
|
89
|
+
color: "#fff",
|
|
90
|
+
borderColor: "#0F7535"
|
|
91
|
+
}, y.value = L(), U();
|
|
92
|
+
}
|
|
93
|
+
function ce() {
|
|
94
|
+
if (v.value === 1) {
|
|
95
|
+
let e;
|
|
96
|
+
for (const l in t)
|
|
97
|
+
if (t[l].length > 0) {
|
|
98
|
+
e = t[l][0];
|
|
99
|
+
break;
|
|
100
|
+
}
|
|
101
|
+
e && Object.keys(t).forEach((l) => {
|
|
102
|
+
t[l] = t[l].filter((o) => o === e);
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
Q(), y.value = L(), U();
|
|
106
|
+
}
|
|
107
|
+
function U() {
|
|
108
|
+
P("setNoNeedRefreshNumFilterName", D.value);
|
|
109
|
+
}
|
|
110
|
+
function $() {
|
|
111
|
+
y.value = !0, Object.keys(u).forEach((e) => {
|
|
112
|
+
u[e] = {};
|
|
113
|
+
}), Object.keys(t).forEach((e) => {
|
|
114
|
+
delete t[e];
|
|
115
|
+
}), Object.keys(d).forEach((e) => {
|
|
116
|
+
delete d[e];
|
|
117
|
+
}), Z();
|
|
118
|
+
}
|
|
119
|
+
const re = (e) => w.getBackgroundColor(e);
|
|
120
|
+
function ie(e) {
|
|
121
|
+
e ? Object.assign(W, r.cloneDeep(t)) : r.isEqual(W, t) || Z();
|
|
122
|
+
}
|
|
123
|
+
function Z() {
|
|
124
|
+
P("filterChange", [
|
|
125
|
+
{
|
|
126
|
+
filterKey: D.value,
|
|
127
|
+
checkedValues: Object.values(t).flat()
|
|
128
|
+
}
|
|
129
|
+
]);
|
|
130
|
+
}
|
|
131
|
+
function de(e) {
|
|
132
|
+
const l = f.value.find((o) => o.text === e);
|
|
133
|
+
l != null && l.subs && (v.value === 1 ? t[e] = [l.subs[0].value] : t[e] = l.subs.map((o) => o.value));
|
|
134
|
+
}
|
|
135
|
+
function fe(e) {
|
|
136
|
+
t[e] = [];
|
|
137
|
+
}
|
|
138
|
+
return I(
|
|
139
|
+
() => O.value,
|
|
140
|
+
(e) => {
|
|
141
|
+
e && e.length > 0 && (f.value = [...e], $());
|
|
142
|
+
},
|
|
143
|
+
{ deep: !0 }
|
|
144
|
+
), I(
|
|
145
|
+
() => v.value,
|
|
146
|
+
() => {
|
|
147
|
+
$();
|
|
148
|
+
}
|
|
149
|
+
), I(
|
|
150
|
+
[() => A.value, () => Y.value, () => G.value],
|
|
151
|
+
([e, l, o]) => {
|
|
152
|
+
(!H.value || !r.eq(H.value, D.value)) && (J.value = e, R.value = l, z.value = o);
|
|
153
|
+
}
|
|
154
|
+
), pe(() => {
|
|
155
|
+
se();
|
|
156
|
+
}), (e, l) => {
|
|
157
|
+
const o = F("el-button"), s = F("el-checkbox"), a = F("el-checkbox-group"), C = F("el-dropdown");
|
|
158
|
+
return i(), p("div", be, [
|
|
159
|
+
K(o, {
|
|
160
|
+
size: "small",
|
|
161
|
+
class: "el-button el-button--small custom-total-button",
|
|
162
|
+
style: M(re(y.value)),
|
|
163
|
+
onClick: $
|
|
164
|
+
}, {
|
|
165
|
+
default: b(() => [
|
|
166
|
+
N(g(h(m)("全部")) + " ", 1),
|
|
167
|
+
h(A) ? (i(), p("span", ge, "(" + g(J.value) + ")", 1)) : T("", !0)
|
|
168
|
+
]),
|
|
169
|
+
_: 1
|
|
170
|
+
}, 8, ["style"]),
|
|
171
|
+
K(C, {
|
|
172
|
+
ref_key: "dropdown1",
|
|
173
|
+
ref: ne,
|
|
174
|
+
"popper-class": "custom-dropdown",
|
|
175
|
+
onVisibleChange: ie
|
|
176
|
+
}, {
|
|
177
|
+
dropdown: b(() => [
|
|
178
|
+
B("div", me, [
|
|
179
|
+
(i(!0), p(E, null, q(f.value, (n) => (i(), V(a, {
|
|
180
|
+
key: n.value,
|
|
181
|
+
modelValue: t[n.text],
|
|
182
|
+
"onUpdate:modelValue": (c) => t[n.text] = c,
|
|
183
|
+
size: "small",
|
|
184
|
+
class: "checkbox-group inner-checkbox-group custom-dropdown-checkbox-group",
|
|
185
|
+
onChange: (c) => ue(n)
|
|
186
|
+
}, {
|
|
187
|
+
default: b(() => [
|
|
188
|
+
h(r).isNil(n.subs) ? (i(), V(s, {
|
|
189
|
+
key: 1,
|
|
190
|
+
value: n.value,
|
|
191
|
+
class: "checkbox custom-dropdown-button",
|
|
192
|
+
border: "",
|
|
193
|
+
disabled: _(n.value)
|
|
194
|
+
}, {
|
|
195
|
+
default: b(() => [
|
|
196
|
+
N(g(h(m)(n.text)), 1)
|
|
197
|
+
]),
|
|
198
|
+
_: 2
|
|
199
|
+
}, 1032, ["value", "disabled"])) : (i(), p(E, { key: 0 }, [
|
|
200
|
+
B("span", {
|
|
201
|
+
class: "el-button custom-dropdown-button el-button--small inner-el-button",
|
|
202
|
+
style: M(u[n.text]),
|
|
203
|
+
onClick: (c) => X(n),
|
|
204
|
+
disabled: _(n.value)
|
|
205
|
+
}, g(h(m)(n.text)), 13, ye),
|
|
206
|
+
B("div", _e, [
|
|
207
|
+
(i(!0), p(E, null, q(n.subs, (c) => (i(), V(s, {
|
|
208
|
+
key: c.value,
|
|
209
|
+
class: "checkbox custom-dropdown-button",
|
|
210
|
+
value: c.value,
|
|
211
|
+
border: "",
|
|
212
|
+
disabled: _(c.value)
|
|
213
|
+
}, {
|
|
214
|
+
default: b(() => {
|
|
215
|
+
var S;
|
|
216
|
+
return [
|
|
217
|
+
N(g(h(m)(c.text)), 1),
|
|
218
|
+
h(r).isEmpty(z.value) ? T("", !0) : (i(), p("span", Ce, "(" + g((S = z.value.filter((ve) => ve.value == c.value)[0]) == null ? void 0 : S.count) + ")", 1))
|
|
219
|
+
];
|
|
220
|
+
}),
|
|
221
|
+
_: 2
|
|
222
|
+
}, 1032, ["value", "disabled"]))), 128))
|
|
223
|
+
])
|
|
224
|
+
], 64))
|
|
225
|
+
]),
|
|
226
|
+
_: 2
|
|
227
|
+
}, 1032, ["modelValue", "onUpdate:modelValue", "onChange"]))), 128))
|
|
228
|
+
])
|
|
229
|
+
]),
|
|
230
|
+
default: b(() => [
|
|
231
|
+
B("div", xe, [
|
|
232
|
+
(i(!0), p(E, null, q(f.value, (n) => (i(), p(E, {
|
|
233
|
+
key: n.value
|
|
234
|
+
}, [
|
|
235
|
+
n.isCheckbox ? (i(), V(a, {
|
|
236
|
+
key: 0,
|
|
237
|
+
modelValue: t[n.text],
|
|
238
|
+
"onUpdate:modelValue": (c) => t[n.text] = c,
|
|
239
|
+
class: "checkbox-group",
|
|
240
|
+
size: "small",
|
|
241
|
+
onChange: ce
|
|
242
|
+
}, {
|
|
243
|
+
default: b(() => [
|
|
244
|
+
K(s, {
|
|
245
|
+
class: "custom-dropdown-button",
|
|
246
|
+
value: n.value,
|
|
247
|
+
border: "",
|
|
248
|
+
disabled: _(n.value)
|
|
249
|
+
}, {
|
|
250
|
+
default: b(() => [
|
|
251
|
+
N(g(h(m)(n.text)), 1)
|
|
252
|
+
]),
|
|
253
|
+
_: 2
|
|
254
|
+
}, 1032, ["value", "disabled"])
|
|
255
|
+
]),
|
|
256
|
+
_: 2
|
|
257
|
+
}, 1032, ["modelValue", "onUpdate:modelValue"])) : (i(), V(o, {
|
|
258
|
+
key: 1,
|
|
259
|
+
style: M(u[n.text]),
|
|
260
|
+
class: "custom-dropdown-button",
|
|
261
|
+
size: "small",
|
|
262
|
+
onClick: (c) => X(n),
|
|
263
|
+
disabled: _(n.value)
|
|
264
|
+
}, {
|
|
265
|
+
default: b(() => {
|
|
266
|
+
var c;
|
|
267
|
+
return [
|
|
268
|
+
N(g(h(m)(n.text)) + " ", 1),
|
|
269
|
+
h(r).isEmpty(R.value) ? T("", !0) : (i(), p("span", ke, "(" + g((c = R.value.filter((S) => S.value == n.value)[0]) == null ? void 0 : c.count) + ")", 1))
|
|
270
|
+
];
|
|
271
|
+
}),
|
|
272
|
+
_: 2
|
|
273
|
+
}, 1032, ["style", "onClick", "disabled"]))
|
|
274
|
+
], 64))), 128))
|
|
275
|
+
])
|
|
276
|
+
]),
|
|
277
|
+
_: 1
|
|
278
|
+
}, 512)
|
|
279
|
+
]);
|
|
280
|
+
};
|
|
281
|
+
}
|
|
282
|
+
});
|
|
2
283
|
export {
|
|
3
|
-
|
|
284
|
+
Se as default
|
|
4
285
|
};
|
package/package.json
CHANGED
|
@@ -1,28 +1,40 @@
|
|
|
1
|
-
import { DropdownEntity } from './drop-down-condition';
|
|
1
|
+
import { DropdownEntity, CountItem } from './drop-down-condition';
|
|
2
2
|
import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions, CreateComponentPublicInstanceWithMixins, ExtractPropTypes, PropType, ComputedRef, Ref, CSSProperties, VNodeProps, AllowedComponentProps, ComponentCustomProps, GlobalComponents, GlobalDirectives } from 'vue';
|
|
3
3
|
import { TooltipTriggerType, PopperEffect, Placement, Options, ButtonProps, Translator, TooltipInstance } from 'element-plus';
|
|
4
4
|
type __VLS_Props = {
|
|
5
|
-
|
|
5
|
+
/** 最大可选数量,默认不限制,传1即为单选 */
|
|
6
|
+
max?: number;
|
|
7
|
+
/** 父子层级渲染条件项(优先级最高,传入后跳过接口请求) */
|
|
8
|
+
filterList?: DropdownEntity[];
|
|
9
|
+
/** 当前条件下显示的条数 */
|
|
6
10
|
totalCount?: number;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
value: string;
|
|
13
|
-
count: number;
|
|
14
|
-
}>;
|
|
11
|
+
/** 父级显示条数 */
|
|
12
|
+
level1Count?: CountItem[];
|
|
13
|
+
/** 子级显示数量 */
|
|
14
|
+
level2Count?: CountItem[];
|
|
15
|
+
/** 发往后端的请求参数key */
|
|
15
16
|
filterKey: string;
|
|
17
|
+
/** 后端接口枚举标识(用于缓存key) */
|
|
16
18
|
enumEntity: string;
|
|
19
|
+
/** 是否需要刷新当前项 */
|
|
17
20
|
noNeedRefreshNumFilterName?: string;
|
|
18
|
-
|
|
21
|
+
/** 查询接口方法(仅当未传入filterList时调用) */
|
|
22
|
+
initFilters?: (enumEntity: string) => Promise<{
|
|
23
|
+
data: DropdownEntity[];
|
|
24
|
+
}>;
|
|
19
25
|
};
|
|
20
26
|
declare const _default: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
21
|
-
filterChange: (
|
|
22
|
-
|
|
27
|
+
filterChange: (payload: {
|
|
28
|
+
filterKey: string;
|
|
29
|
+
checkedValues: string[];
|
|
30
|
+
}[]) => any;
|
|
31
|
+
setNoNeedRefreshNumFilterName: (filterKey: string) => any;
|
|
23
32
|
}, string, PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
24
|
-
onFilterChange?: (
|
|
25
|
-
|
|
33
|
+
onFilterChange?: (payload: {
|
|
34
|
+
filterKey: string;
|
|
35
|
+
checkedValues: string[];
|
|
36
|
+
}[]) => any;
|
|
37
|
+
onSetNoNeedRefreshNumFilterName?: (filterKey: string) => any;
|
|
26
38
|
}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {
|
|
27
39
|
dropdown1: CreateComponentPublicInstanceWithMixins<Readonly< ExtractPropTypes<{
|
|
28
40
|
readonly trigger: {
|
|
@@ -1,43 +1,43 @@
|
|
|
1
1
|
import { SFCWithInstall } from '../utils/typescript';
|
|
2
2
|
import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions, CreateComponentPublicInstanceWithMixins, ExtractPropTypes, PropType, ComputedRef, Ref, CSSProperties, VNodeProps, AllowedComponentProps, ComponentCustomProps, GlobalComponents, GlobalDirectives } from 'vue';
|
|
3
|
-
import { DropdownEntity } from './drop-down-condition';
|
|
3
|
+
import { DropdownEntity, CountItem } from './drop-down-condition';
|
|
4
4
|
import { TooltipTriggerType, PopperEffect, Placement, Options, ButtonProps, Translator, TooltipInstance } from 'element-plus';
|
|
5
5
|
export declare const YaheeDropDownCondition: SFCWithInstall<DefineComponent<{
|
|
6
|
-
|
|
6
|
+
max?: number;
|
|
7
|
+
filterList?: DropdownEntity[];
|
|
7
8
|
totalCount?: number;
|
|
8
|
-
level1Count?:
|
|
9
|
-
|
|
10
|
-
count: number;
|
|
11
|
-
}>;
|
|
12
|
-
level2Count?: Array<{
|
|
13
|
-
value: string;
|
|
14
|
-
count: number;
|
|
15
|
-
}>;
|
|
9
|
+
level1Count?: CountItem[];
|
|
10
|
+
level2Count?: CountItem[];
|
|
16
11
|
filterKey: string;
|
|
17
12
|
enumEntity: string;
|
|
18
13
|
noNeedRefreshNumFilterName?: string;
|
|
19
|
-
initFilters?:
|
|
14
|
+
initFilters?: (enumEntity: string) => Promise<{
|
|
15
|
+
data: DropdownEntity[];
|
|
16
|
+
}>;
|
|
20
17
|
}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
21
|
-
filterChange: (
|
|
22
|
-
|
|
18
|
+
filterChange: (payload: {
|
|
19
|
+
filterKey: string;
|
|
20
|
+
checkedValues: string[];
|
|
21
|
+
}[]) => any;
|
|
22
|
+
setNoNeedRefreshNumFilterName: (filterKey: string) => any;
|
|
23
23
|
}, string, PublicProps, Readonly<{
|
|
24
|
-
|
|
24
|
+
max?: number;
|
|
25
|
+
filterList?: DropdownEntity[];
|
|
25
26
|
totalCount?: number;
|
|
26
|
-
level1Count?:
|
|
27
|
-
|
|
28
|
-
count: number;
|
|
29
|
-
}>;
|
|
30
|
-
level2Count?: Array<{
|
|
31
|
-
value: string;
|
|
32
|
-
count: number;
|
|
33
|
-
}>;
|
|
27
|
+
level1Count?: CountItem[];
|
|
28
|
+
level2Count?: CountItem[];
|
|
34
29
|
filterKey: string;
|
|
35
30
|
enumEntity: string;
|
|
36
31
|
noNeedRefreshNumFilterName?: string;
|
|
37
|
-
initFilters?:
|
|
32
|
+
initFilters?: (enumEntity: string) => Promise<{
|
|
33
|
+
data: DropdownEntity[];
|
|
34
|
+
}>;
|
|
38
35
|
}> & Readonly<{
|
|
39
|
-
onFilterChange?: (
|
|
40
|
-
|
|
36
|
+
onFilterChange?: (payload: {
|
|
37
|
+
filterKey: string;
|
|
38
|
+
checkedValues: string[];
|
|
39
|
+
}[]) => any;
|
|
40
|
+
onSetNoNeedRefreshNumFilterName?: (filterKey: string) => any;
|
|
41
41
|
}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {
|
|
42
42
|
dropdown1: CreateComponentPublicInstanceWithMixins<Readonly< ExtractPropTypes<{
|
|
43
43
|
readonly trigger: {
|
package/types/src/installs.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ import { ScrollbarDirection, UploadFile, UploadFiles, UploadProgressEvent, Uploa
|
|
|
8
8
|
import { OnCleanup } from '@vue/reactivity';
|
|
9
9
|
import { AnnexUploadProps } from './annex-upload';
|
|
10
10
|
import { Option } from './static/CommonObject';
|
|
11
|
-
import { DropdownEntity } from './drop-down-condition/drop-down-condition';
|
|
11
|
+
import { DropdownEntity, CountItem } from './drop-down-condition/drop-down-condition';
|
|
12
12
|
import { data } from './country-platform-shop-condition/country-platform-shop-condition';
|
|
13
13
|
import { CommonImportProps } from './common-import/props';
|
|
14
14
|
import { PageObj } from './common-import/common-import';
|
|
@@ -1419,41 +1419,41 @@ declare const _default: (( SFCWithInstall<DefineComponent<ExtractPropTypes<{
|
|
|
1419
1419
|
defaultValues: (string | boolean | number)[];
|
|
1420
1420
|
enumEntity: string;
|
|
1421
1421
|
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>> & Record<string, any>) | ( SFCWithInstall<DefineComponent<{
|
|
1422
|
-
|
|
1422
|
+
max?: number;
|
|
1423
|
+
filterList?: DropdownEntity[];
|
|
1423
1424
|
totalCount?: number;
|
|
1424
|
-
level1Count?:
|
|
1425
|
-
|
|
1426
|
-
count: number;
|
|
1427
|
-
}>;
|
|
1428
|
-
level2Count?: Array<{
|
|
1429
|
-
value: string;
|
|
1430
|
-
count: number;
|
|
1431
|
-
}>;
|
|
1425
|
+
level1Count?: CountItem[];
|
|
1426
|
+
level2Count?: CountItem[];
|
|
1432
1427
|
filterKey: string;
|
|
1433
1428
|
enumEntity: string;
|
|
1434
1429
|
noNeedRefreshNumFilterName?: string;
|
|
1435
|
-
initFilters?:
|
|
1430
|
+
initFilters?: (enumEntity: string) => Promise<{
|
|
1431
|
+
data: DropdownEntity[];
|
|
1432
|
+
}>;
|
|
1436
1433
|
}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
1437
|
-
filterChange: (
|
|
1438
|
-
|
|
1434
|
+
filterChange: (payload: {
|
|
1435
|
+
filterKey: string;
|
|
1436
|
+
checkedValues: string[];
|
|
1437
|
+
}[]) => any;
|
|
1438
|
+
setNoNeedRefreshNumFilterName: (filterKey: string) => any;
|
|
1439
1439
|
}, string, PublicProps, Readonly<{
|
|
1440
|
-
|
|
1440
|
+
max?: number;
|
|
1441
|
+
filterList?: DropdownEntity[];
|
|
1441
1442
|
totalCount?: number;
|
|
1442
|
-
level1Count?:
|
|
1443
|
-
|
|
1444
|
-
count: number;
|
|
1445
|
-
}>;
|
|
1446
|
-
level2Count?: Array<{
|
|
1447
|
-
value: string;
|
|
1448
|
-
count: number;
|
|
1449
|
-
}>;
|
|
1443
|
+
level1Count?: CountItem[];
|
|
1444
|
+
level2Count?: CountItem[];
|
|
1450
1445
|
filterKey: string;
|
|
1451
1446
|
enumEntity: string;
|
|
1452
1447
|
noNeedRefreshNumFilterName?: string;
|
|
1453
|
-
initFilters?:
|
|
1448
|
+
initFilters?: (enumEntity: string) => Promise<{
|
|
1449
|
+
data: DropdownEntity[];
|
|
1450
|
+
}>;
|
|
1454
1451
|
}> & Readonly<{
|
|
1455
|
-
onFilterChange?: (
|
|
1456
|
-
|
|
1452
|
+
onFilterChange?: (payload: {
|
|
1453
|
+
filterKey: string;
|
|
1454
|
+
checkedValues: string[];
|
|
1455
|
+
}[]) => any;
|
|
1456
|
+
onSetNoNeedRefreshNumFilterName?: (filterKey: string) => any;
|
|
1457
1457
|
}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {
|
|
1458
1458
|
dropdown1: CreateComponentPublicInstanceWithMixins<Readonly< ExtractPropTypes<{
|
|
1459
1459
|
readonly trigger: {
|