yahee-components 0.0.28 → 0.0.29

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.
@@ -128,7 +128,6 @@ const ae = { class: "yahee-country-platform-shop-condition" }, re = { class: "po
128
128
  key: e,
129
129
  style: b(m.value[e.xGroupValue]),
130
130
  class: "custom-button",
131
- size: "small",
132
131
  onClick: (l) => F(e)
133
132
  }, {
134
133
  default: V(() => [
@@ -147,7 +146,7 @@ const ae = { class: "yahee-country-platform-shop-condition" }, re = { class: "po
147
146
  i("th", ne, [
148
147
  i("span", {
149
148
  style: b(T(y.value)),
150
- class: "el-button custom-button",
149
+ class: "el-button el-button--small custom-button",
151
150
  onClick: j
152
151
  }, " 全部 ", 4)
153
152
  ]),
@@ -157,7 +156,7 @@ const ae = { class: "yahee-country-platform-shop-condition" }, re = { class: "po
157
156
  }, [
158
157
  i("span", {
159
158
  style: b({ ...m.value[t.xGroupValue], width: "100%" }),
160
- class: "el-button custom-button",
159
+ class: "el-button--small el-button custom-button",
161
160
  onClick: (h) => F(t)
162
161
  }, g(t.xGroupText), 13, se)
163
162
  ]))), 128))
@@ -172,7 +171,7 @@ const ae = { class: "yahee-country-platform-shop-condition" }, re = { class: "po
172
171
  i("th", ce, [
173
172
  i("span", {
174
173
  style: b({ ..._.value[t.yGroupValue], width: "100%" }),
175
- class: "el-button custom-button",
174
+ class: "el-button--small el-button custom-button",
176
175
  onClick: (v) => Z(t)
177
176
  }, g(t.yGroupText), 13, ie)
178
177
  ]),
@@ -190,9 +189,10 @@ const ae = { class: "yahee-country-platform-shop-condition" }, re = { class: "po
190
189
  ), (p) => (s(), D(c(ue), {
191
190
  key: p.value,
192
191
  border: "",
193
- class: "el-button custom-button",
192
+ class: "el-button el-button-small custom-button",
194
193
  label: p.text,
195
- value: p.value
194
+ value: p.value,
195
+ size: "small"
196
196
  }, {
197
197
  default: V(() => [
198
198
  L(g(p.text), 1)
@@ -1,3 +1,11 @@
1
+ .custom-popover .checkbox-group {
2
+ margin: 5px;
3
+ width: 100%;
4
+ }
5
+ .custom-popover .hover-trigger {
6
+ cursor: pointer;
7
+ color: blue;
8
+ }
1
9
  .custom-popover .popover-table {
2
10
  width: auto;
3
11
  border: 1px solid transparent;
@@ -17,9 +25,13 @@
17
25
  }
18
26
  .custom-popover .popover-table td span {
19
27
  display: block;
20
- margin-bottom: 4px;
21
28
  border: 1px solid transparent;
22
29
  }
30
+ .custom-popover .custom-total-button {
31
+ margin-right: 0;
32
+ padding: 1px 4px;
33
+ height: 22px;
34
+ }
23
35
 
24
36
  .yahee-country-platform-shop-condition .checkbox-group {
25
37
  margin: 5px;
@@ -35,7 +47,6 @@
35
47
  height: 22px;
36
48
  }
37
49
  .yahee-country-platform-shop-condition .custom-button {
38
- width: 100%;
39
50
  min-height: 22px;
40
51
  min-width: 50px;
41
52
  height: 22px;
@@ -1,9 +1,18 @@
1
- import { defineComponent as ce, ref as y, reactive as V, toRefs as re, watch as ie, onMounted as de, resolveComponent as w, openBlock as a, createElementBlock as v, createVNode as G, normalizeStyle as K, withCtx as f, createTextVNode as b, toDisplayString as p, unref as i, createCommentVNode as F, createElementVNode as S, Fragment as C, renderList as $, createBlock as x } from "vue";
2
- import u from "../_virtual/lodash.js";
3
- import { stylesUtils as M } from "../utils/style.js";
4
- import { storage as H } from "../utils/storage.js";
5
- import { M2 as k } from "../utils/translate.js";
6
- const ve = { class: "yahee-drop-down-condition" }, fe = { key: 0 }, pe = { style: { display: "flex", "align-items": "center", outline: "none" } }, he = { key: 0 }, ge = { style: { display: "flex", width: "auto", padding: "10px" } }, me = ["onClick"], ye = { class: "scrollable-container" }, xe = { key: 0 }, Ee = /* @__PURE__ */ ce({
1
+ import { defineComponent as se, ref as m, reactive as _, toRefs as ae, watch as ce, onMounted as re, openBlock as a, createElementBlock as i, createVNode as W, unref as u, normalizeStyle as R, withCtx as d, createTextVNode as k, toDisplayString as v, createCommentVNode as N, 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({
7
16
  name: "YaheeDropDownCondition",
8
17
  __name: "drop-down-condition",
9
18
  props: {
@@ -17,203 +26,200 @@ const ve = { class: "yahee-drop-down-condition" }, fe = { key: 0 }, pe = { style
17
26
  initFilters: { type: Function }
18
27
  },
19
28
  emits: ["filterChange", "setNoNeedRefreshNumFilterName"],
20
- setup(J, { emit: Q }) {
21
- const X = y(), o = V({});
22
- let O = V({});
23
- const d = V({}), h = V({}), g = y(!0), _ = J, T = Q, { filterKey: L, filterList: q, totalCount: N, level1Count: B, level2Count: A, noNeedRefreshNumFilterName: I } = re(_), W = y(u.get(N, "value", 0)), D = y(u.get(B, "value", [])), R = y(u.get(A, "value", [])), r = y();
24
- q.value && (r.value = [...q.value]);
25
- function P(e) {
26
- const { text: l, value: s } = e, n = o[l];
27
- u.isNil(n) || u.isEmpty(n) ? o[l] = [s] : o[l] = [], h[l] = !h[l], h[l] ? (ne(l), d[l] = M.getBackgroundColor(!0), g.value = !1) : (se(l), d[e.text] = {}, g.value = !0), g.value = z(), U();
29
+ setup(H, { emit: J }) {
30
+ const Q = m(), n = _({});
31
+ let K = _({});
32
+ const r = _({}), p = _({}), h = m(!0), x = H, $ = J, { filterKey: V, filterList: M, totalCount: C, level1Count: w, level2Count: F, noNeedRefreshNumFilterName: O } = ae(x), T = m(s.get(C, "value", 0)), S = m(s.get(w, "value", [])), B = m(s.get(F, "value", [])), c = m();
33
+ M.value && (c.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), r[o] = U.getBackgroundColor(!0), h.value = !1) : (ne(o), r[t.text] = {}, h.value = !0), h.value = L(), D();
28
37
  }
29
- function z() {
30
- const e = r.value.filter((n) => !u.isEmpty(n.subs)).flatMap((n) => n.subs).length, l = r.value.filter((n) => u.isEmpty(n.subs)).length;
31
- return Object.values(o).map((n) => n.length).reduce((n, m) => n + m, 0) === e + l || u.isEmpty(Object.values(o).flat());
38
+ function L() {
39
+ 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;
40
+ return Object.values(n).map((l) => l.length).reduce((l, f) => l + f, 0) === t + o || s.isEmpty(Object.values(n).flat());
32
41
  }
33
- function Z(e) {
34
- u.isEmpty(o[e.text]) ? (d[e.text] = {}, h[e.text] = !1) : o[e.text].length === u.get(e, "subs.length", 1) ? (d[e.text] = M.getBackgroundColor(!0), h[e.text] = !0) : d[e.text] = {
42
+ function X(t) {
43
+ 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] = {
35
44
  backgroundColor: "#0F7535",
36
45
  color: "#fff",
37
46
  borderColor: "#0F7535"
38
- }, g.value = z(), U();
47
+ }, h.value = L(), D();
39
48
  }
40
- function ee() {
41
- g.value = z(), U();
49
+ function Z() {
50
+ h.value = L(), D();
42
51
  }
43
- function U() {
44
- T("setNoNeedRefreshNumFilterName", L.value);
52
+ function D() {
53
+ $("setNoNeedRefreshNumFilterName", V.value);
45
54
  }
46
- function te() {
47
- g.value = !0;
48
- for (const e in d)
49
- d[e] = {};
50
- for (const e in o)
51
- delete o[e];
52
- for (const e in h)
53
- delete h[e];
54
- Y();
55
+ function ee() {
56
+ h.value = !0;
57
+ for (const t in r)
58
+ r[t] = {};
59
+ for (const t in n)
60
+ delete n[t];
61
+ for (const t in p)
62
+ delete p[t];
63
+ I();
55
64
  }
56
- const le = (e) => M.getBackgroundColor(e);
57
- function oe(e) {
58
- if (e)
59
- O = u.cloneDeep(o);
65
+ const te = (t) => U.getBackgroundColor(t);
66
+ function le(t) {
67
+ if (t)
68
+ K = s.cloneDeep(n);
60
69
  else {
61
- if (u.isEqual(O, o))
70
+ if (s.isEqual(K, n))
62
71
  return;
63
- Y();
72
+ I();
64
73
  }
65
74
  }
66
- function Y() {
67
- T("filterChange", [
75
+ function I() {
76
+ $("filterChange", [
68
77
  {
69
- filterKey: L.value,
70
- checkedValues: Object.values(o).flat()
78
+ filterKey: V.value,
79
+ checkedValues: Object.values(n).flat()
71
80
  }
72
81
  ]);
73
82
  }
74
- function ne(e) {
75
- const l = r.value.find((s) => s.text === e);
76
- l && l.subs && (o[e] = l.subs.map((s) => s.value));
83
+ function oe(t) {
84
+ const o = c.value.find((e) => e.text === t);
85
+ o && o.subs && (n[t] = o.subs.map((e) => e.value));
77
86
  }
78
- function se(e) {
79
- o[e] = [];
87
+ function ne(t) {
88
+ n[t] = [];
80
89
  }
81
90
  function ue() {
82
- const e = `filter-key-${_.enumEntity}`, l = H.getWithExpireTime(e);
83
- l ? r.value = l : (console.log(_.enumEntity), _.initFilters(_.enumEntity).then((s) => {
84
- console.log(s), r.value = s.data, H.setWithExpireTime(e, r.value, 1200 * 1e3), console.log(r.value);
85
- }).catch((s) => {
86
- console.log(s);
91
+ const t = `filter-key-${x.enumEntity}`, o = G.getWithExpireTime(t);
92
+ o ? c.value = o : (console.log(x.enumEntity), x.initFilters(x.enumEntity).then((e) => {
93
+ console.log(e), c.value = e.data, G.setWithExpireTime(t, c.value, 1200 * 1e3), console.log(c.value);
94
+ }).catch((e) => {
95
+ console.log(e);
87
96
  }));
88
97
  }
89
- return ie(
90
- [() => N.value, () => B.value, () => A.value],
91
- ([e, l, s], [n, m, j]) => {
92
- console.log(e, l, s), console.log(n, m, j), (!I.value || !u.eq(I.value, L.value)) && (W.value = N.value, D.value = B.value, R.value = A.value);
98
+ return ce(
99
+ [() => C.value, () => w.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, V.value)) && (T.value = C.value, S.value = w.value, B.value = F.value);
93
102
  }
94
- ), de(() => {
103
+ ), re(() => {
95
104
  ue();
96
- }), (e, l) => {
97
- const s = w("el-button"), n = w("el-checkbox"), m = w("el-checkbox-group"), j = w("el-dropdown");
98
- return a(), v("div", ve, [
99
- G(s, {
100
- size: "small",
101
- class: "el-button custom-total-button",
102
- style: K(le(g.value)),
103
- onClick: te
104
- }, {
105
- default: f(() => [
106
- b(p(i(k)("全部")) + " ", 1),
107
- i(N) ? (a(), v("span", fe, "(" + p(W.value) + ")", 1)) : F("", !0)
108
- ]),
109
- _: 1
110
- }, 8, ["style"]),
111
- G(j, {
112
- ref_key: "dropdown1",
113
- ref: X,
114
- "popper-class": "custom-dropdown",
115
- onVisibleChange: oe
116
- }, {
117
- dropdown: f(() => [
118
- S("div", ge, [
119
- (a(!0), v(C, null, $(r.value, (t) => (a(), x(m, {
120
- key: t.value,
121
- modelValue: o[t.text],
122
- "onUpdate:modelValue": (c) => o[t.text] = c,
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(c.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",
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-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-button el-button--small inner-el-button",
148
+ style: R(r[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-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(c.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",
123
182
  size: "small",
124
- class: "checkbox-group inner-checkbox-group",
125
- onChange: (c) => Z(t)
183
+ onChange: Z
126
184
  }, {
127
- default: f(() => [
128
- i(u).isNil(t.subs) ? (a(), x(n, {
129
- key: 1,
130
- value: t.value,
131
- class: "checkbox custom-button",
185
+ default: d(() => [
186
+ e.isCheckbox ? (a(), g(u(j), {
187
+ key: 0,
188
+ class: "custom-button",
189
+ value: e.value,
132
190
  border: ""
133
191
  }, {
134
- default: f(() => [
135
- b(p(i(k)(t.text)), 1)
192
+ default: d(() => [
193
+ k(v(u(y)(e.text)), 1)
136
194
  ]),
137
195
  _: 2
138
- }, 1032, ["value"])) : (a(), v(C, { key: 0 }, [
139
- S("span", {
140
- class: "el-button custom-button el-button--small inner-el-button",
141
- style: K(d[t.text]),
142
- onClick: (c) => P(t)
143
- }, p(i(k)(t.text)), 13, me),
144
- S("div", ye, [
145
- (a(!0), v(C, null, $(t.subs, (c) => (a(), x(n, {
146
- key: c.value,
147
- class: "checkbox custom-button",
148
- value: c.value,
149
- border: ""
150
- }, {
151
- default: f(() => {
152
- var E;
153
- return [
154
- b(p(i(k)(c.text)), 1),
155
- i(u).isEmpty(R.value) ? F("", !0) : (a(), v("span", xe, "(" + p((E = R.value.filter((ae) => ae.value == c.value)[0]) == null ? void 0 : E.count) + ")", 1))
156
- ];
157
- }),
158
- _: 2
159
- }, 1032, ["value"]))), 128))
160
- ])
161
- ], 64))
196
+ }, 1032, ["value"])) : N("", !0)
162
197
  ]),
163
198
  _: 2
164
- }, 1032, ["modelValue", "onUpdate:modelValue", "onChange"]))), 128))
165
- ])
166
- ]),
167
- default: f(() => [
168
- S("div", pe, [
169
- (a(!0), v(C, null, $(r.value, (t) => (a(), v(C, null, [
170
- t.isCheckbox ? (a(), x(m, {
171
- key: t.value,
172
- modelValue: o[t.text],
173
- "onUpdate:modelValue": (c) => o[t.text] = c,
174
- class: "checkbox-group",
175
- size: "small",
176
- onChange: ee
177
- }, {
178
- default: f(() => [
179
- t.isCheckbox ? (a(), x(n, {
180
- key: 0,
181
- class: "custom-button",
182
- value: t.value,
183
- border: ""
184
- }, {
185
- default: f(() => [
186
- b(p(i(k)(t.text)), 1)
187
- ]),
188
- _: 2
189
- }, 1032, ["value"])) : F("", !0)
190
- ]),
191
- _: 2
192
- }, 1032, ["modelValue", "onUpdate:modelValue"])) : (a(), x(s, {
193
- key: t.text,
194
- style: K(d[t.text]),
195
- class: "custom-button",
196
- size: "small",
197
- onClick: (c) => P(t)
198
- }, {
199
- default: f(() => {
200
- var c;
201
- return [
202
- b(p(i(k)(t.text)), 1),
203
- i(u).isEmpty(D.value) ? F("", !0) : (a(), v("span", he, "(" + p((c = D.value.filter((E) => E.value == t.value)[0]) == null ? void 0 : c.count) + ")", 1))
204
- ];
205
- }),
206
- _: 2
207
- }, 1032, ["style", "onClick"]))
208
- ], 64))), 256))
209
- ])
210
- ]),
211
- _: 1
212
- }, 512)
213
- ]);
214
- };
199
+ }, 1032, ["modelValue", "onUpdate:modelValue"])) : (a(), g(u(P), {
200
+ key: e.text,
201
+ style: R(r[e.text]),
202
+ class: "custom-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
+ ]));
215
221
  }
216
222
  });
217
223
  export {
218
- Ee as default
224
+ Ae as default
219
225
  };
@@ -11,16 +11,6 @@
11
11
  padding: 1px 4px;
12
12
  height: 22px;
13
13
  }
14
- .yahee-drop-down-condition .custom-button {
15
- margin-right: 0;
16
- padding: 1px 4px;
17
- min-height: 22px;
18
- height: 22px;
19
- margin-left: 5px;
20
- }
21
- .yahee-drop-down-condition .custom-button.inner-el-button {
22
- margin-top: 5px;
23
- }
24
14
  .yahee-drop-down-condition .checkbox-group {
25
15
  display: flex;
26
16
  flex-direction: column;
@@ -42,4 +32,18 @@
42
32
  border-radius: 10px;
43
33
  background: rgba(0, 0, 0, 0.1);
44
34
  -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.5);
35
+ }
36
+
37
+ .custom-dropdown .checkbox {
38
+ margin-top: 5px;
39
+ }
40
+ .custom-dropdown .custom-button {
41
+ margin-right: 0;
42
+ padding: 1px 4px;
43
+ min-height: 22px;
44
+ height: 22px;
45
+ margin-left: 5px;
46
+ }
47
+ .custom-dropdown .custom-button.inner-el-button {
48
+ margin-top: 5px;
45
49
  }
package/es/style.css CHANGED
@@ -115,16 +115,6 @@
115
115
  padding: 1px 4px;
116
116
  height: 22px;
117
117
  }
118
- .yahee-drop-down-condition .custom-button {
119
- margin-right: 0;
120
- padding: 1px 4px;
121
- min-height: 22px;
122
- height: 22px;
123
- margin-left: 5px;
124
- }
125
- .yahee-drop-down-condition .custom-button.inner-el-button {
126
- margin-top: 5px;
127
- }
128
118
  .yahee-drop-down-condition .checkbox-group {
129
119
  display: flex;
130
120
  flex-direction: column;
@@ -148,6 +138,28 @@
148
138
  -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.5);
149
139
  }
150
140
 
141
+ .custom-dropdown .checkbox {
142
+ margin-top: 5px;
143
+ }
144
+ .custom-dropdown .custom-button {
145
+ margin-right: 0;
146
+ padding: 1px 4px;
147
+ min-height: 22px;
148
+ height: 22px;
149
+ margin-left: 5px;
150
+ }
151
+ .custom-dropdown .custom-button.inner-el-button {
152
+ margin-top: 5px;
153
+ }
154
+
155
+ .custom-popover .checkbox-group {
156
+ margin: 5px;
157
+ width: 100%;
158
+ }
159
+ .custom-popover .hover-trigger {
160
+ cursor: pointer;
161
+ color: blue;
162
+ }
151
163
  .custom-popover .popover-table {
152
164
  width: auto;
153
165
  border: 1px solid transparent;
@@ -167,9 +179,13 @@
167
179
  }
168
180
  .custom-popover .popover-table td span {
169
181
  display: block;
170
- margin-bottom: 4px;
171
182
  border: 1px solid transparent;
172
183
  }
184
+ .custom-popover .custom-total-button {
185
+ margin-right: 0;
186
+ padding: 1px 4px;
187
+ height: 22px;
188
+ }
173
189
 
174
190
  .yahee-country-platform-shop-condition .checkbox-group {
175
191
  margin: 5px;
@@ -185,7 +201,6 @@
185
201
  height: 22px;
186
202
  }
187
203
  .yahee-country-platform-shop-condition .custom-button {
188
- width: 100%;
189
204
  min-height: 22px;
190
205
  min-width: 50px;
191
206
  height: 22px;
@@ -895,39 +910,6 @@
895
910
  margin-right: 45px;
896
911
  }
897
912
 
898
- :root {
899
- --el-color-primary: #3366cc;
900
- --el-text-color-regular: #000;
901
- --primary-color: #3d7eff;
902
- --success-color: #28c445;
903
- --error-color: #ff1e1e;
904
- --warning-color: #ff8746;
905
- --white-color: #fff;
906
- --black-color: #000;
907
- --text-color-primary: #252628;
908
- --text-color-regular: #1c1c1c;
909
- --text-color-secondary: #555;
910
- --text-color-list: #323233;
911
- --text-color-a4: #a4a4a4;
912
- --text-color-tag: #737373;
913
- --text-color-disabled: #eeeef5;
914
- --border-color-base: #e8ecf2;
915
- --border-color-light: #e4e7ed;
916
- --border-color-lighter: #ebeef5;
917
- --border-color-extra-light: #f2f6fc;
918
- --bg-color: #f0f3f9;
919
- --font-size-large: 18px;
920
- --font-size-medium: 16px;
921
- --font-size-base: 14px;
922
- --font-size-small: 12px;
923
- --font-size-extra-small: 10px;
924
- --font-family: "Hiragino Sans GB", "Microsoft YaHei","WenQuanYi Micro Hei",Verdana, arial,"Open Sans", sans-serif;
925
- --integer-font-family: avenir-heavy, pingfang sc, helvetica neue, arial, sans-serif;
926
- --box-shadow-base: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
927
- --el-menu-item-height: 40px;
928
- --el-card-padding: 10px;
929
- }
930
-
931
913
  :root {
932
914
  --el-color-primary: var(--primary-color);
933
915
  --el-color-primary-light-2: rgba(61, 126, 255, 0.8);
@@ -696,39 +696,6 @@
696
696
  margin-right: 45px;
697
697
  }
698
698
 
699
- :root {
700
- --el-color-primary: #3366cc;
701
- --el-text-color-regular: #000;
702
- --primary-color: #3d7eff;
703
- --success-color: #28c445;
704
- --error-color: #ff1e1e;
705
- --warning-color: #ff8746;
706
- --white-color: #fff;
707
- --black-color: #000;
708
- --text-color-primary: #252628;
709
- --text-color-regular: #1c1c1c;
710
- --text-color-secondary: #555;
711
- --text-color-list: #323233;
712
- --text-color-a4: #a4a4a4;
713
- --text-color-tag: #737373;
714
- --text-color-disabled: #eeeef5;
715
- --border-color-base: #e8ecf2;
716
- --border-color-light: #e4e7ed;
717
- --border-color-lighter: #ebeef5;
718
- --border-color-extra-light: #f2f6fc;
719
- --bg-color: #f0f3f9;
720
- --font-size-large: 18px;
721
- --font-size-medium: 16px;
722
- --font-size-base: 14px;
723
- --font-size-small: 12px;
724
- --font-size-extra-small: 10px;
725
- --font-family: "Hiragino Sans GB", "Microsoft YaHei","WenQuanYi Micro Hei",Verdana, arial,"Open Sans", sans-serif;
726
- --integer-font-family: avenir-heavy, pingfang sc, helvetica neue, arial, sans-serif;
727
- --box-shadow-base: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
728
- --el-menu-item-height: 40px;
729
- --el-card-padding: 10px;
730
- }
731
-
732
699
  :root {
733
700
  --el-color-primary: var(--primary-color);
734
701
  --el-color-primary-light-2: rgba(61, 126, 255, 0.8);
@@ -1 +1 @@
1
- "use strict";const e=require("vue"),j=require("../utils/style.js"),_=require("../utils/translate.js"),N=require("../_virtual/lodash.js"),y=require("element-plus");require("element-plus/theme-chalk/src/base.scss");require("element-plus/theme-chalk/src/button.scss");require("element-plus/theme-chalk/src/checkbox.scss");require("element-plus/theme-chalk/src/checkbox-group.scss");require("element-plus/theme-chalk/src/popper.scss");require("element-plus/theme-chalk/src/popover.scss");const O={class:"yahee-country-platform-shop-condition"},W={class:"popover-table"},P={id:"all"},R=["onClick"],U={id:"y"},H=["onClick"],M={style:{display:"flex","align-items":"center",outline:"none"}},Y=e.defineComponent({name:"YaheeCountryPlatformShopCondition",__name:"country-platform-shop-condition",props:{xyFilters:{},filterKey:{}},emits:["filterChange"],setup($,{emit:w}){const L=$,{filterKey:q,xyFilters:n}=e.toRefs(L),F=w,r=e.reactive({});let m=e.reactive({});const v=e.ref({}),h=e.ref({}),f=e.ref(!0),V=e.ref({}),G=e.ref({}),g=e.ref();n.value&&(g.value=[...n.value.xGroup]);function T(o,a){var l;return(l=n.value)==null?void 0:l.items.filter(t=>t.xGroupValue===o&&t.yGroupValue===a)}function C(o){var l;const a=o.xGroupValue;if(V.value[a]){for(const t in r)t.startsWith(a)&&delete r[t];V.value[a]=!1}else{for(const t of(l=n.value)==null?void 0:l.items)if(t.xGroupValue===a){let u=r[`${t.xGroupValue}-${t.yGroupValue}`];u?(u.push(t.value),u=[...new Set(u)]):u=[t.value],r[`${t.xGroupValue}-${t.yGroupValue}`]=u}V.value[a]=!0}}const b=o=>j.stylesUtils.getBackgroundColor(o),z=()=>{N.isEqual(m,r)||F("filterChange",[{filterKey:q.value,checkedValues:Object.values(Object.values(r)).flat()}])},D=()=>{m=N.cloneDeep(r)};function x(){if(f.value)f.value=!1,Object.keys(r).forEach(o=>{delete r[o]});else{f.value=!0;for(const o of n.value.items){let a=r[`${o.xGroupValue}-${o.yGroupValue}`];a?a.push(o.value):a=[o.value],r[`${o.xGroupValue}-${o.yGroupValue}`]=a}}console.log(r)}function K(o){const a=o.yGroupValue;if(G.value[a]){for(const l in r)l.endsWith(a)&&delete r[l];G.value[a]=!1}else{for(const l of n.value.items)if(l.yGroupValue===a){let t=r[`${l.xGroupValue}-${l.yGroupValue}`];t?(t.push(l.value),t=[...new Set(t)]):t=[l.value],r[`${l.xGroupValue}-${l.yGroupValue}`]=t}G.value[a]=!0}}return e.watch(r,(o,a)=>{var s,E,S,B;Object.keys(o).forEach(c=>{Array.isArray(o[c])&&o[c].length===0&&delete o[c]}),console.log("新的数组:",o),console.log("旧的数组:",a);const l={backgroundColor:"#3366CC",color:"#fff",borderColor:"#3366CC"},t={backgroundColor:"#00bfff",borderColor:"#00bfff"},u={},d=(s=n.value)==null?void 0:s.xGroup.length,i=(E=n.value)==null?void 0:E.yGroup.length;(S=n.value)==null||S.xGroup.forEach(c=>{let p=0;for(const k in r)k.startsWith(c.xGroupValue)&&p++;p===0?v.value[c.xGroupValue]=u:p===i?v.value[c.xGroupValue]=l:v.value[c.xGroupValue]=t}),(B=n.value)==null||B.yGroup.forEach(c=>{let p=0;for(const k in r)k.endsWith(c.yGroupValue)&&p++;p===0?h.value[c.yGroupValue]=u:p===d?h.value[c.yGroupValue]=l:h.value[c.yGroupValue]=t}),f.value=Object.keys(o).length===d*i},{deep:!0}),(o,a)=>(e.openBlock(),e.createElementBlock("div",O,[e.createVNode(e.unref(y.ElPopover),{placement:"bottom",trigger:"hover",width:"'auto'","popper-class":"custom-popover",onHide:z,onShow:D},{reference:e.withCtx(()=>[e.createElementVNode("div",M,[e.createVNode(e.unref(y.ElButton),{size:"small",class:"el-button custom-total-button",style:e.normalizeStyle(b(f.value)),onClick:x},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(_.M2)("全部")),1)]),_:1},8,["style"]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,l=>(e.openBlock(),e.createBlock(e.unref(y.ElButton),{key:l,style:e.normalizeStyle(v.value[l.xGroupValue]),class:"custom-button",size:"small",onClick:t=>C(l)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(_.M2)(l.xGroupText)),1)]),_:2},1032,["style","onClick"]))),128))])]),default:e.withCtx(()=>{var l,t;return[e.createElementVNode("table",W,[e.createElementVNode("thead",null,[e.createElementVNode("tr",null,[e.createElementVNode("th",P,[e.createElementVNode("span",{style:e.normalizeStyle(b(f.value)),class:"el-button custom-button",onClick:x}," 全部 ",4)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList((l=e.unref(n))==null?void 0:l.xGroup,u=>(e.openBlock(),e.createElementBlock("th",{id:"x",key:u.xGroupValue},[e.createElementVNode("span",{style:e.normalizeStyle({...v.value[u.xGroupValue],width:"100%"}),class:"el-button custom-button",onClick:d=>C(u)},e.toDisplayString(u.xGroupText),13,R)]))),128))])]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList((t=e.unref(n))==null?void 0:t.yGroup,u=>{var d;return e.openBlock(),e.createElementBlock("tr",{key:u.yGroupValue},[e.createElementVNode("th",U,[e.createElementVNode("span",{style:e.normalizeStyle({...h.value[u.yGroupValue],width:"100%"}),class:"el-button custom-button",onClick:i=>K(u)},e.toDisplayString(u.yGroupText),13,H)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList((d=e.unref(n))==null?void 0:d.xGroup,i=>(e.openBlock(),e.createElementBlock("td",{key:i.xGroupValue},[e.createVNode(e.unref(y.ElCheckboxGroup),{modelValue:r[i.xGroupValue+"-"+u.yGroupValue],"onUpdate:modelValue":s=>r[i.xGroupValue+"-"+u.yGroupValue]=s},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T(i.xGroupValue,u.yGroupValue),s=>(e.openBlock(),e.createBlock(e.unref(y.ElCheckbox),{key:s.value,border:"",class:"el-button custom-button",label:s.text,value:s.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(s.text),1)]),_:2},1032,["label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue"])]))),128))])}),128))])])]}),_:1})]))}});module.exports=Y;
1
+ "use strict";const e=require("vue"),j=require("../utils/style.js"),_=require("../utils/translate.js"),N=require("../_virtual/lodash.js"),y=require("element-plus");require("element-plus/theme-chalk/src/base.scss");require("element-plus/theme-chalk/src/button.scss");require("element-plus/theme-chalk/src/checkbox.scss");require("element-plus/theme-chalk/src/checkbox-group.scss");require("element-plus/theme-chalk/src/popper.scss");require("element-plus/theme-chalk/src/popover.scss");const O={class:"yahee-country-platform-shop-condition"},W={class:"popover-table"},P={id:"all"},R=["onClick"],U={id:"y"},H=["onClick"],M={style:{display:"flex","align-items":"center",outline:"none"}},Y=e.defineComponent({name:"YaheeCountryPlatformShopCondition",__name:"country-platform-shop-condition",props:{xyFilters:{},filterKey:{}},emits:["filterChange"],setup($,{emit:w}){const L=$,{filterKey:q,xyFilters:n}=e.toRefs(L),F=w,r=e.reactive({});let k=e.reactive({});const v=e.ref({}),h=e.ref({}),f=e.ref(!0),V=e.ref({}),G=e.ref({}),g=e.ref();n.value&&(g.value=[...n.value.xGroup]);function T(o,a){var l;return(l=n.value)==null?void 0:l.items.filter(t=>t.xGroupValue===o&&t.yGroupValue===a)}function b(o){var l;const a=o.xGroupValue;if(V.value[a]){for(const t in r)t.startsWith(a)&&delete r[t];V.value[a]=!1}else{for(const t of(l=n.value)==null?void 0:l.items)if(t.xGroupValue===a){let u=r[`${t.xGroupValue}-${t.yGroupValue}`];u?(u.push(t.value),u=[...new Set(u)]):u=[t.value],r[`${t.xGroupValue}-${t.yGroupValue}`]=u}V.value[a]=!0}}const C=o=>j.stylesUtils.getBackgroundColor(o),z=()=>{N.isEqual(k,r)||F("filterChange",[{filterKey:q.value,checkedValues:Object.values(Object.values(r)).flat()}])},D=()=>{k=N.cloneDeep(r)};function x(){if(f.value)f.value=!1,Object.keys(r).forEach(o=>{delete r[o]});else{f.value=!0;for(const o of n.value.items){let a=r[`${o.xGroupValue}-${o.yGroupValue}`];a?a.push(o.value):a=[o.value],r[`${o.xGroupValue}-${o.yGroupValue}`]=a}}console.log(r)}function K(o){const a=o.yGroupValue;if(G.value[a]){for(const l in r)l.endsWith(a)&&delete r[l];G.value[a]=!1}else{for(const l of n.value.items)if(l.yGroupValue===a){let t=r[`${l.xGroupValue}-${l.yGroupValue}`];t?(t.push(l.value),t=[...new Set(t)]):t=[l.value],r[`${l.xGroupValue}-${l.yGroupValue}`]=t}G.value[a]=!0}}return e.watch(r,(o,a)=>{var s,E,S,B;Object.keys(o).forEach(c=>{Array.isArray(o[c])&&o[c].length===0&&delete o[c]}),console.log("新的数组:",o),console.log("旧的数组:",a);const l={backgroundColor:"#3366CC",color:"#fff",borderColor:"#3366CC"},t={backgroundColor:"#00bfff",borderColor:"#00bfff"},u={},d=(s=n.value)==null?void 0:s.xGroup.length,i=(E=n.value)==null?void 0:E.yGroup.length;(S=n.value)==null||S.xGroup.forEach(c=>{let p=0;for(const m in r)m.startsWith(c.xGroupValue)&&p++;p===0?v.value[c.xGroupValue]=u:p===i?v.value[c.xGroupValue]=l:v.value[c.xGroupValue]=t}),(B=n.value)==null||B.yGroup.forEach(c=>{let p=0;for(const m in r)m.endsWith(c.yGroupValue)&&p++;p===0?h.value[c.yGroupValue]=u:p===d?h.value[c.yGroupValue]=l:h.value[c.yGroupValue]=t}),f.value=Object.keys(o).length===d*i},{deep:!0}),(o,a)=>(e.openBlock(),e.createElementBlock("div",O,[e.createVNode(e.unref(y.ElPopover),{placement:"bottom",trigger:"hover",width:"'auto'","popper-class":"custom-popover",onHide:z,onShow:D},{reference:e.withCtx(()=>[e.createElementVNode("div",M,[e.createVNode(e.unref(y.ElButton),{size:"small",class:"el-button custom-total-button",style:e.normalizeStyle(C(f.value)),onClick:x},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(_.M2)("全部")),1)]),_:1},8,["style"]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,l=>(e.openBlock(),e.createBlock(e.unref(y.ElButton),{key:l,style:e.normalizeStyle(v.value[l.xGroupValue]),class:"custom-button",onClick:t=>b(l)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(_.M2)(l.xGroupText)),1)]),_:2},1032,["style","onClick"]))),128))])]),default:e.withCtx(()=>{var l,t;return[e.createElementVNode("table",W,[e.createElementVNode("thead",null,[e.createElementVNode("tr",null,[e.createElementVNode("th",P,[e.createElementVNode("span",{style:e.normalizeStyle(C(f.value)),class:"el-button el-button--small custom-button",onClick:x}," 全部 ",4)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList((l=e.unref(n))==null?void 0:l.xGroup,u=>(e.openBlock(),e.createElementBlock("th",{id:"x",key:u.xGroupValue},[e.createElementVNode("span",{style:e.normalizeStyle({...v.value[u.xGroupValue],width:"100%"}),class:"el-button--small el-button custom-button",onClick:d=>b(u)},e.toDisplayString(u.xGroupText),13,R)]))),128))])]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList((t=e.unref(n))==null?void 0:t.yGroup,u=>{var d;return e.openBlock(),e.createElementBlock("tr",{key:u.yGroupValue},[e.createElementVNode("th",U,[e.createElementVNode("span",{style:e.normalizeStyle({...h.value[u.yGroupValue],width:"100%"}),class:"el-button--small el-button custom-button",onClick:i=>K(u)},e.toDisplayString(u.yGroupText),13,H)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList((d=e.unref(n))==null?void 0:d.xGroup,i=>(e.openBlock(),e.createElementBlock("td",{key:i.xGroupValue},[e.createVNode(e.unref(y.ElCheckboxGroup),{modelValue:r[i.xGroupValue+"-"+u.yGroupValue],"onUpdate:modelValue":s=>r[i.xGroupValue+"-"+u.yGroupValue]=s},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T(i.xGroupValue,u.yGroupValue),s=>(e.openBlock(),e.createBlock(e.unref(y.ElCheckbox),{key:s.value,border:"",class:"el-button el-button-small custom-button",label:s.text,value:s.value,size:"small"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(s.text),1)]),_:2},1032,["label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue"])]))),128))])}),128))])])]}),_:1})]))}});module.exports=Y;
@@ -1,3 +1,11 @@
1
+ .custom-popover .checkbox-group {
2
+ margin: 5px;
3
+ width: 100%;
4
+ }
5
+ .custom-popover .hover-trigger {
6
+ cursor: pointer;
7
+ color: blue;
8
+ }
1
9
  .custom-popover .popover-table {
2
10
  width: auto;
3
11
  border: 1px solid transparent;
@@ -17,9 +25,13 @@
17
25
  }
18
26
  .custom-popover .popover-table td span {
19
27
  display: block;
20
- margin-bottom: 4px;
21
28
  border: 1px solid transparent;
22
29
  }
30
+ .custom-popover .custom-total-button {
31
+ margin-right: 0;
32
+ padding: 1px 4px;
33
+ height: 22px;
34
+ }
23
35
 
24
36
  .yahee-country-platform-shop-condition .checkbox-group {
25
37
  margin: 5px;
@@ -35,7 +47,6 @@
35
47
  height: 22px;
36
48
  }
37
49
  .yahee-country-platform-shop-condition .custom-button {
38
- width: 100%;
39
50
  min-height: 22px;
40
51
  min-width: 50px;
41
52
  height: 22px;
@@ -1 +1 @@
1
- "use strict";const e=require("vue"),c=require("../_virtual/lodash.js"),E=require("../utils/style.js"),q=require("../utils/storage.js"),f=require("../utils/translate.js"),Y={class:"yahee-drop-down-condition"},G={key:0},H={style:{display:"flex","align-items":"center",outline:"none"}},J={key:0},Q={style:{display:"flex",width:"auto",padding:"10px"}},X=["onClick"],Z={class:"scrollable-container"},ee={key:0},te=e.defineComponent({name:"YaheeDropDownCondition",__name:"drop-down-condition",props:{filterList:{},totalCount:{},level1Count:{},level2Count:{},filterKey:{},enumEntity:{},noNeedRefreshNumFilterName:{},initFilters:{type:Function}},emits:["filterChange","setNoNeedRefreshNumFilterName"],setup(z,{emit:T}){const U=e.ref(),n=e.reactive({});let V=e.reactive({});const i=e.reactive({}),d=e.reactive({}),v=e.ref(!0),k=z,w=T,{filterKey:g,filterList:S,totalCount:h,level1Count:y,level2Count:x,noNeedRefreshNumFilterName:F}=e.toRefs(k),D=e.ref(c.get(h,"value",0)),C=e.ref(c.get(y,"value",[])),_=e.ref(c.get(x,"value",[])),r=e.ref();S.value&&(r.value=[...S.value]);function L(t){const{text:o,value:s}=t,a=n[o];c.isNil(a)||c.isEmpty(a)?n[o]=[s]:n[o]=[],d[o]=!d[o],d[o]?(O(o),i[o]=E.stylesUtils.getBackgroundColor(!0),v.value=!1):(I(o),i[t.text]={},v.value=!0),v.value=b(),N()}function b(){const t=r.value.filter(a=>!c.isEmpty(a.subs)).flatMap(a=>a.subs).length,o=r.value.filter(a=>c.isEmpty(a.subs)).length;return Object.values(n).map(a=>a.length).reduce((a,p)=>a+p,0)===t+o||c.isEmpty(Object.values(n).flat())}function A(t){c.isEmpty(n[t.text])?(i[t.text]={},d[t.text]=!1):n[t.text].length===c.get(t,"subs.length",1)?(i[t.text]=E.stylesUtils.getBackgroundColor(!0),d[t.text]=!0):i[t.text]={backgroundColor:"#0F7535",color:"#fff",borderColor:"#0F7535"},v.value=b(),N()}function R(){v.value=b(),N()}function N(){w("setNoNeedRefreshNumFilterName",g.value)}function j(){v.value=!0;for(const t in i)i[t]={};for(const t in n)delete n[t];for(const t in d)delete d[t];M()}const K=t=>E.stylesUtils.getBackgroundColor(t);function $(t){if(t)V=c.cloneDeep(n);else{if(c.isEqual(V,n))return;M()}}function M(){w("filterChange",[{filterKey:g.value,checkedValues:Object.values(n).flat()}])}function O(t){const o=r.value.find(s=>s.text===t);o&&o.subs&&(n[t]=o.subs.map(s=>s.value))}function I(t){n[t]=[]}function W(){const t=`filter-key-${k.enumEntity}`,o=q.storage.getWithExpireTime(t);o?r.value=o:(console.log(k.enumEntity),k.initFilters(k.enumEntity).then(s=>{console.log(s),r.value=s.data,q.storage.setWithExpireTime(t,r.value,1200*1e3),console.log(r.value)}).catch(s=>{console.log(s)}))}return e.watch([()=>h.value,()=>y.value,()=>x.value],([t,o,s],[a,p,B])=>{console.log(t,o,s),console.log(a,p,B),(!F.value||!c.eq(F.value,g.value))&&(D.value=h.value,C.value=y.value,_.value=x.value)}),e.onMounted(()=>{W()}),(t,o)=>{const s=e.resolveComponent("el-button"),a=e.resolveComponent("el-checkbox"),p=e.resolveComponent("el-checkbox-group"),B=e.resolveComponent("el-dropdown");return e.openBlock(),e.createElementBlock("div",Y,[e.createVNode(s,{size:"small",class:"el-button custom-total-button",style:e.normalizeStyle(K(v.value)),onClick:j},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(f.M2)("全部"))+" ",1),e.unref(h)?(e.openBlock(),e.createElementBlock("span",G,"("+e.toDisplayString(D.value)+")",1)):e.createCommentVNode("",!0)]),_:1},8,["style"]),e.createVNode(B,{ref_key:"dropdown1",ref:U,"popper-class":"custom-dropdown",onVisibleChange:$},{dropdown:e.withCtx(()=>[e.createElementVNode("div",Q,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,l=>(e.openBlock(),e.createBlock(p,{key:l.value,modelValue:n[l.text],"onUpdate:modelValue":u=>n[l.text]=u,size:"small",class:"checkbox-group inner-checkbox-group",onChange:u=>A(l)},{default:e.withCtx(()=>[e.unref(c).isNil(l.subs)?(e.openBlock(),e.createBlock(a,{key:1,value:l.value,class:"checkbox custom-button",border:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(f.M2)(l.text)),1)]),_:2},1032,["value"])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("span",{class:"el-button custom-button el-button--small inner-el-button",style:e.normalizeStyle(i[l.text]),onClick:u=>L(l)},e.toDisplayString(e.unref(f.M2)(l.text)),13,X),e.createElementVNode("div",Z,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.subs,u=>(e.openBlock(),e.createBlock(a,{key:u.value,class:"checkbox custom-button",value:u.value,border:""},{default:e.withCtx(()=>{var m;return[e.createTextVNode(e.toDisplayString(e.unref(f.M2)(u.text)),1),e.unref(c).isEmpty(_.value)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",ee,"("+e.toDisplayString((m=_.value.filter(P=>P.value==u.value)[0])==null?void 0:m.count)+")",1))]}),_:2},1032,["value"]))),128))])],64))]),_:2},1032,["modelValue","onUpdate:modelValue","onChange"]))),128))])]),default:e.withCtx(()=>[e.createElementVNode("div",H,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,l=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[l.isCheckbox?(e.openBlock(),e.createBlock(p,{key:l.value,modelValue:n[l.text],"onUpdate:modelValue":u=>n[l.text]=u,class:"checkbox-group",size:"small",onChange:R},{default:e.withCtx(()=>[l.isCheckbox?(e.openBlock(),e.createBlock(a,{key:0,class:"custom-button",value:l.value,border:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(f.M2)(l.text)),1)]),_:2},1032,["value"])):e.createCommentVNode("",!0)]),_:2},1032,["modelValue","onUpdate:modelValue"])):(e.openBlock(),e.createBlock(s,{key:l.text,style:e.normalizeStyle(i[l.text]),class:"custom-button",size:"small",onClick:u=>L(l)},{default:e.withCtx(()=>{var u;return[e.createTextVNode(e.toDisplayString(e.unref(f.M2)(l.text)),1),e.unref(c).isEmpty(C.value)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",J,"("+e.toDisplayString((u=C.value.filter(m=>m.value==l.value)[0])==null?void 0:u.count)+")",1))]}),_:2},1032,["style","onClick"]))],64))),256))])]),_:1},512)])}}});module.exports=te;
1
+ "use strict";const e=require("vue"),r=require("../_virtual/lodash.js"),B=require("../utils/style.js"),D=require("../utils/storage.js"),v=require("../utils/translate.js"),i=require("element-plus");require("element-plus/theme-chalk/src/base.scss");require("element-plus/theme-chalk/src/button.scss");require("element-plus/theme-chalk/src/checkbox.scss");require("element-plus/theme-chalk/src/checkbox-group.scss");require("element-plus/theme-chalk/src/button-group.scss");require("element-plus/theme-chalk/src/popper.scss");require("element-plus/theme-chalk/src/scrollbar.scss");require("element-plus/theme-chalk/src/dropdown.scss");const G={class:"yahee-drop-down-condition"},I={key:0},P={style:{display:"flex","align-items":"center",outline:"none"}},W={key:0},Y={style:{display:"flex",width:"auto",padding:"10px"}},H=["onClick"],J={class:"scrollable-container"},Q={key:0},X=e.defineComponent({name:"YaheeDropDownCondition",__name:"drop-down-condition",props:{filterList:{},totalCount:{},level1Count:{},level2Count:{},filterKey:{},enumEntity:{},noNeedRefreshNumFilterName:{},initFilters:{type:Function}},emits:["filterChange","setNoNeedRefreshNumFilterName"],setup(L,{emit:M}){const z=e.ref(),a=e.reactive({});let E=e.reactive({});const s=e.reactive({}),d=e.reactive({}),f=e.ref(!0),p=L,_=M,{filterKey:h,filterList:V,totalCount:k,level1Count:g,level2Count:m,noNeedRefreshNumFilterName:S}=e.toRefs(p),w=e.ref(r.get(k,"value",0)),y=e.ref(r.get(g,"value",[])),x=e.ref(r.get(m,"value",[])),u=e.ref();V.value&&(u.value=[...V.value]);function q(l){const{text:n,value:t}=l,o=a[n];r.isNil(o)||r.isEmpty(o)?a[n]=[t]:a[n]=[],d[n]=!d[n],d[n]?(K(n),s[n]=B.stylesUtils.getBackgroundColor(!0),f.value=!1):($(n),s[l.text]={},f.value=!0),f.value=C(),b()}function C(){const l=u.value.filter(o=>!r.isEmpty(o.subs)).flatMap(o=>o.subs).length,n=u.value.filter(o=>r.isEmpty(o.subs)).length;return Object.values(a).map(o=>o.length).reduce((o,c)=>o+c,0)===l+n||r.isEmpty(Object.values(a).flat())}function T(l){r.isEmpty(a[l.text])?(s[l.text]={},d[l.text]=!1):a[l.text].length===r.get(l,"subs.length",1)?(s[l.text]=B.stylesUtils.getBackgroundColor(!0),d[l.text]=!0):s[l.text]={backgroundColor:"#0F7535",color:"#fff",borderColor:"#0F7535"},f.value=C(),b()}function U(){f.value=C(),b()}function b(){_("setNoNeedRefreshNumFilterName",h.value)}function A(){f.value=!0;for(const l in s)s[l]={};for(const l in a)delete a[l];for(const l in d)delete d[l];F()}const R=l=>B.stylesUtils.getBackgroundColor(l);function j(l){if(l)E=r.cloneDeep(a);else{if(r.isEqual(E,a))return;F()}}function F(){_("filterChange",[{filterKey:h.value,checkedValues:Object.values(a).flat()}])}function K(l){const n=u.value.find(t=>t.text===l);n&&n.subs&&(a[l]=n.subs.map(t=>t.value))}function $(l){a[l]=[]}function O(){const l=`filter-key-${p.enumEntity}`,n=D.storage.getWithExpireTime(l);n?u.value=n:(console.log(p.enumEntity),p.initFilters(p.enumEntity).then(t=>{console.log(t),u.value=t.data,D.storage.setWithExpireTime(l,u.value,1200*1e3),console.log(u.value)}).catch(t=>{console.log(t)}))}return e.watch([()=>k.value,()=>g.value,()=>m.value],([l,n,t],[o,c,N])=>{console.log(l,n,t),console.log(o,c,N),(!S.value||!r.eq(S.value,h.value))&&(w.value=k.value,y.value=g.value,x.value=m.value)}),e.onMounted(()=>{O()}),(l,n)=>(e.openBlock(),e.createElementBlock("div",G,[e.createVNode(e.unref(i.ElButton),{size:"small",class:"el-button el-button--small custom-total-button",style:e.normalizeStyle(R(f.value)),onClick:A},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(v.M2)("全部"))+" ",1),e.unref(k)?(e.openBlock(),e.createElementBlock("span",I,"("+e.toDisplayString(w.value)+")",1)):e.createCommentVNode("",!0)]),_:1},8,["style"]),e.createVNode(e.unref(i.ElDropdown),{ref_key:"dropdown1",ref:z,"popper-class":"custom-dropdown",onVisibleChange:j},{dropdown:e.withCtx(()=>[e.createElementVNode("div",Y,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,t=>(e.openBlock(),e.createBlock(e.unref(i.ElCheckboxGroup),{key:t.value,modelValue:a[t.text],"onUpdate:modelValue":o=>a[t.text]=o,size:"small",class:"checkbox-group inner-checkbox-group",onChange:o=>T(t)},{default:e.withCtx(()=>[e.unref(r).isNil(t.subs)?(e.openBlock(),e.createBlock(e.unref(i.ElCheckbox),{key:1,value:t.value,class:"checkbox custom-button",border:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(v.M2)(t.text)),1)]),_:2},1032,["value"])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("span",{class:"el-button custom-button el-button--small inner-el-button",style:e.normalizeStyle(s[t.text]),onClick:o=>q(t)},e.toDisplayString(e.unref(v.M2)(t.text)),13,H),e.createElementVNode("div",J,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.subs,o=>(e.openBlock(),e.createBlock(e.unref(i.ElCheckbox),{key:o.value,class:"checkbox custom-button",value:o.value,border:""},{default:e.withCtx(()=>{var c;return[e.createTextVNode(e.toDisplayString(e.unref(v.M2)(o.text)),1),e.unref(r).isEmpty(x.value)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",Q,"("+e.toDisplayString((c=x.value.filter(N=>N.value==o.value)[0])==null?void 0:c.count)+")",1))]}),_:2},1032,["value"]))),128))])],64))]),_:2},1032,["modelValue","onUpdate:modelValue","onChange"]))),128))])]),default:e.withCtx(()=>[e.createElementVNode("div",P,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,t=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[t.isCheckbox?(e.openBlock(),e.createBlock(e.unref(i.ElCheckboxGroup),{key:t.value,modelValue:a[t.text],"onUpdate:modelValue":o=>a[t.text]=o,class:"checkbox-group",size:"small",onChange:U},{default:e.withCtx(()=>[t.isCheckbox?(e.openBlock(),e.createBlock(e.unref(i.ElCheckbox),{key:0,class:"custom-button",value:t.value,border:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(v.M2)(t.text)),1)]),_:2},1032,["value"])):e.createCommentVNode("",!0)]),_:2},1032,["modelValue","onUpdate:modelValue"])):(e.openBlock(),e.createBlock(e.unref(i.ElButton),{key:t.text,style:e.normalizeStyle(s[t.text]),class:"custom-button",size:"small",onClick:o=>q(t)},{default:e.withCtx(()=>{var o;return[e.createTextVNode(e.toDisplayString(e.unref(v.M2)(t.text)),1),e.unref(r).isEmpty(y.value)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",W,"("+e.toDisplayString((o=y.value.filter(c=>c.value==t.value)[0])==null?void 0:o.count)+")",1))]}),_:2},1032,["style","onClick"]))],64))),256))])]),_:1},512)]))}});module.exports=X;
@@ -11,16 +11,6 @@
11
11
  padding: 1px 4px;
12
12
  height: 22px;
13
13
  }
14
- .yahee-drop-down-condition .custom-button {
15
- margin-right: 0;
16
- padding: 1px 4px;
17
- min-height: 22px;
18
- height: 22px;
19
- margin-left: 5px;
20
- }
21
- .yahee-drop-down-condition .custom-button.inner-el-button {
22
- margin-top: 5px;
23
- }
24
14
  .yahee-drop-down-condition .checkbox-group {
25
15
  display: flex;
26
16
  flex-direction: column;
@@ -42,4 +32,18 @@
42
32
  border-radius: 10px;
43
33
  background: rgba(0, 0, 0, 0.1);
44
34
  -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.5);
35
+ }
36
+
37
+ .custom-dropdown .checkbox {
38
+ margin-top: 5px;
39
+ }
40
+ .custom-dropdown .custom-button {
41
+ margin-right: 0;
42
+ padding: 1px 4px;
43
+ min-height: 22px;
44
+ height: 22px;
45
+ margin-left: 5px;
46
+ }
47
+ .custom-dropdown .custom-button.inner-el-button {
48
+ margin-top: 5px;
45
49
  }
package/lib/style.css CHANGED
@@ -115,16 +115,6 @@
115
115
  padding: 1px 4px;
116
116
  height: 22px;
117
117
  }
118
- .yahee-drop-down-condition .custom-button {
119
- margin-right: 0;
120
- padding: 1px 4px;
121
- min-height: 22px;
122
- height: 22px;
123
- margin-left: 5px;
124
- }
125
- .yahee-drop-down-condition .custom-button.inner-el-button {
126
- margin-top: 5px;
127
- }
128
118
  .yahee-drop-down-condition .checkbox-group {
129
119
  display: flex;
130
120
  flex-direction: column;
@@ -148,6 +138,28 @@
148
138
  -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.5);
149
139
  }
150
140
 
141
+ .custom-dropdown .checkbox {
142
+ margin-top: 5px;
143
+ }
144
+ .custom-dropdown .custom-button {
145
+ margin-right: 0;
146
+ padding: 1px 4px;
147
+ min-height: 22px;
148
+ height: 22px;
149
+ margin-left: 5px;
150
+ }
151
+ .custom-dropdown .custom-button.inner-el-button {
152
+ margin-top: 5px;
153
+ }
154
+
155
+ .custom-popover .checkbox-group {
156
+ margin: 5px;
157
+ width: 100%;
158
+ }
159
+ .custom-popover .hover-trigger {
160
+ cursor: pointer;
161
+ color: blue;
162
+ }
151
163
  .custom-popover .popover-table {
152
164
  width: auto;
153
165
  border: 1px solid transparent;
@@ -167,9 +179,13 @@
167
179
  }
168
180
  .custom-popover .popover-table td span {
169
181
  display: block;
170
- margin-bottom: 4px;
171
182
  border: 1px solid transparent;
172
183
  }
184
+ .custom-popover .custom-total-button {
185
+ margin-right: 0;
186
+ padding: 1px 4px;
187
+ height: 22px;
188
+ }
173
189
 
174
190
  .yahee-country-platform-shop-condition .checkbox-group {
175
191
  margin: 5px;
@@ -185,7 +201,6 @@
185
201
  height: 22px;
186
202
  }
187
203
  .yahee-country-platform-shop-condition .custom-button {
188
- width: 100%;
189
204
  min-height: 22px;
190
205
  min-width: 50px;
191
206
  height: 22px;
@@ -895,39 +910,6 @@
895
910
  margin-right: 45px;
896
911
  }
897
912
 
898
- :root {
899
- --el-color-primary: #3366cc;
900
- --el-text-color-regular: #000;
901
- --primary-color: #3d7eff;
902
- --success-color: #28c445;
903
- --error-color: #ff1e1e;
904
- --warning-color: #ff8746;
905
- --white-color: #fff;
906
- --black-color: #000;
907
- --text-color-primary: #252628;
908
- --text-color-regular: #1c1c1c;
909
- --text-color-secondary: #555;
910
- --text-color-list: #323233;
911
- --text-color-a4: #a4a4a4;
912
- --text-color-tag: #737373;
913
- --text-color-disabled: #eeeef5;
914
- --border-color-base: #e8ecf2;
915
- --border-color-light: #e4e7ed;
916
- --border-color-lighter: #ebeef5;
917
- --border-color-extra-light: #f2f6fc;
918
- --bg-color: #f0f3f9;
919
- --font-size-large: 18px;
920
- --font-size-medium: 16px;
921
- --font-size-base: 14px;
922
- --font-size-small: 12px;
923
- --font-size-extra-small: 10px;
924
- --font-family: "Hiragino Sans GB", "Microsoft YaHei","WenQuanYi Micro Hei",Verdana, arial,"Open Sans", sans-serif;
925
- --integer-font-family: avenir-heavy, pingfang sc, helvetica neue, arial, sans-serif;
926
- --box-shadow-base: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
927
- --el-menu-item-height: 40px;
928
- --el-card-padding: 10px;
929
- }
930
-
931
913
  :root {
932
914
  --el-color-primary: var(--primary-color);
933
915
  --el-color-primary-light-2: rgba(61, 126, 255, 0.8);
@@ -696,39 +696,6 @@
696
696
  margin-right: 45px;
697
697
  }
698
698
 
699
- :root {
700
- --el-color-primary: #3366cc;
701
- --el-text-color-regular: #000;
702
- --primary-color: #3d7eff;
703
- --success-color: #28c445;
704
- --error-color: #ff1e1e;
705
- --warning-color: #ff8746;
706
- --white-color: #fff;
707
- --black-color: #000;
708
- --text-color-primary: #252628;
709
- --text-color-regular: #1c1c1c;
710
- --text-color-secondary: #555;
711
- --text-color-list: #323233;
712
- --text-color-a4: #a4a4a4;
713
- --text-color-tag: #737373;
714
- --text-color-disabled: #eeeef5;
715
- --border-color-base: #e8ecf2;
716
- --border-color-light: #e4e7ed;
717
- --border-color-lighter: #ebeef5;
718
- --border-color-extra-light: #f2f6fc;
719
- --bg-color: #f0f3f9;
720
- --font-size-large: 18px;
721
- --font-size-medium: 16px;
722
- --font-size-base: 14px;
723
- --font-size-small: 12px;
724
- --font-size-extra-small: 10px;
725
- --font-family: "Hiragino Sans GB", "Microsoft YaHei","WenQuanYi Micro Hei",Verdana, arial,"Open Sans", sans-serif;
726
- --integer-font-family: avenir-heavy, pingfang sc, helvetica neue, arial, sans-serif;
727
- --box-shadow-base: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
728
- --el-menu-item-height: 40px;
729
- --el-card-padding: 10px;
730
- }
731
-
732
699
  :root {
733
700
  --el-color-primary: var(--primary-color);
734
701
  --el-color-primary-light-2: rgba(61, 126, 255, 0.8);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "yahee-components",
3
3
  "private": false,
4
- "version": "0.0.28",
4
+ "version": "0.0.29",
5
5
  "description": "深圳前海亚讯前端组件库",
6
6
  "main": "lib",
7
7
  "module": "es",
package/types/index.d.ts CHANGED
@@ -991,7 +991,7 @@ export declare const YaheeDropDownCondition: SFCWithInstall<DefineComponent<{
991
991
  filterKey: string;
992
992
  enumEntity: string;
993
993
  noNeedRefreshNumFilterName?: string;
994
- initFilters: Function;
994
+ initFilters?: Function;
995
995
  }, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
996
996
  filterChange: (...args: any[]) => void;
997
997
  setNoNeedRefreshNumFilterName: (...args: any[]) => void;
@@ -1009,7 +1009,7 @@ export declare const YaheeDropDownCondition: SFCWithInstall<DefineComponent<{
1009
1009
  filterKey: string;
1010
1010
  enumEntity: string;
1011
1011
  noNeedRefreshNumFilterName?: string;
1012
- initFilters: Function;
1012
+ initFilters?: Function;
1013
1013
  }> & Readonly<{
1014
1014
  onFilterChange?: (...args: any[]) => any;
1015
1015
  onSetNoNeedRefreshNumFilterName?: (...args: any[]) => any;