yahee-components 0.0.106 → 0.0.108

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