yahee-components 0.0.90 → 0.0.92

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.
Files changed (53) hide show
  1. package/es/annex-upload/annex-upload.vue.js +154 -51
  2. package/es/annex-upload/annex-upload.vue2.js +2 -119
  3. package/es/annex-upload/index.js +3 -3
  4. package/es/border-wrap/border-wrap.vue.js +95 -64
  5. package/es/border-wrap/border-wrap.vue2.js +2 -46
  6. package/es/common-import/common-import.vue.js +666 -369
  7. package/es/common-import/common-import.vue2.js +2 -337
  8. package/es/common-import/index.js +3 -3
  9. package/es/complex-search/complex-search.vue.js +36 -36
  10. package/es/complex-search/complex-search.vue2.js +25 -23
  11. package/es/copy/copy.vue.js +55 -37
  12. package/es/copy/copy.vue2.js +2 -34
  13. package/es/copy/index.js +3 -3
  14. package/es/country-platform-shop-condition/country-platform-shop-condition.vue.js +213 -114
  15. package/es/country-platform-shop-condition/country-platform-shop-condition.vue2.js +2 -125
  16. package/es/drop-down-condition/drop-down-condition.vue.js +215 -115
  17. package/es/drop-down-condition/drop-down-condition.vue2.js +2 -127
  18. package/es/echart-gauge/echart-gauge.vue.js +140 -12
  19. package/es/echart-gauge/echart-gauge.vue2.js +2 -147
  20. package/es/echart-gauge/index.js +3 -3
  21. package/es/image-upload/image-upload.vue.js +170 -109
  22. package/es/image-upload/image-upload.vue2.js +2 -91
  23. package/es/image-upload/index.js +3 -3
  24. package/es/input/index.js +3 -3
  25. package/es/input/input.vue.js +38 -17
  26. package/es/input/input.vue2.js +2 -33
  27. package/es/left-condition/index.js +3 -3
  28. package/es/left-condition/left-condition-sub.vue.js +91 -32
  29. package/es/left-condition/left-condition-sub.vue2.js +2 -76
  30. package/es/left-condition/left-condition.vue.js +218 -70
  31. package/es/left-condition/left-condition.vue2.js +2 -160
  32. package/es/left-condition-enum/index.js +3 -3
  33. package/es/left-condition-enum/left-condition-enum.vue.js +49 -20
  34. package/es/left-condition-enum/left-condition-enum.vue2.js +2 -40
  35. package/es/operation-log/operation-log-content.vue.js +92 -71
  36. package/es/operation-log/operation-log-content.vue2.js +2 -39
  37. package/es/operation-log/operation-log-dialog.vue.js +67 -45
  38. package/es/operation-log/operation-log-dialog.vue2.js +2 -38
  39. package/es/operation-log/operation-log-form.vue.js +183 -108
  40. package/es/operation-log/operation-log-form.vue2.js +2 -104
  41. package/es/operation-log/operation-log.vue.js +228 -119
  42. package/es/operation-log/operation-log.vue2.js +2 -135
  43. package/es/packages/components/api/log-server.js +6 -6
  44. package/es/packages/components/api/upload-server.js +1 -1
  45. package/es/packages/components/hooks/useEcharts.js +19 -19
  46. package/es/packages/components/hooks/useImg.js +8 -8
  47. package/es/scale-screen/index.js +4 -4
  48. package/es/scale-screen/scale-screen.vue.js +126 -19
  49. package/es/scale-screen/scale-screen.vue2.js +2 -125
  50. package/package.json +1 -1
  51. package/types/src/complex-search/complex-search.vue.d.ts +3 -0
  52. package/types/src/complex-search/index.d.ts +7 -0
  53. package/types/src/installs.d.ts +2649 -0
@@ -1,127 +1,4 @@
1
- import { defineComponent as R, toRefs as D, reactive as _, ref as c, watch as M } from "vue";
2
- import { stylesUtils as T } from "../utils/style.js";
3
- import { M2 as H } from "../utils/translate.js";
4
- import L from "../_virtual/lodash.js";
5
- import { ElPopover as U, ElCheckboxGroup as Y, ElCheckbox as z, ElButton as I } from "element-plus";
6
- import "element-plus/theme-chalk/src/base.scss";
7
- import "element-plus/theme-chalk/src/button.scss";
8
- import "element-plus/theme-chalk/src/checkbox.scss";
9
- import "element-plus/theme-chalk/src/checkbox-group.scss";
10
- import "element-plus/theme-chalk/src/popper.scss";
11
- import "element-plus/theme-chalk/src/popover.scss";
12
- const ae = /* @__PURE__ */ R({
13
- name: "YaheeCountryPlatformShopCondition",
14
- __name: "country-platform-shop-condition",
15
- props: {
16
- xyFilters: { type: Object, required: !1 },
17
- filterKey: { type: String, required: !0 }
18
- },
19
- emits: ["filterChange"],
20
- setup(j, { expose: K, emit: O }) {
21
- K();
22
- const G = j, { filterKey: m, xyFilters: a } = D(G), d = O, t = _({});
23
- let f = _({});
24
- const p = c({}), v = c({}), i = c(!0), y = c({}), h = c({}), x = c();
25
- a.value && (x.value = [...a.value.xGroup]);
26
- function A(e, o) {
27
- var u;
28
- return (u = a.value) == null ? void 0 : u.items.filter((l) => l.xGroupValue === e && l.yGroupValue === o);
29
- }
30
- function F(e) {
31
- var u;
32
- const o = e.xGroupValue;
33
- if (y.value[o]) {
34
- for (const l in t)
35
- l.startsWith(o) && delete t[l];
36
- y.value[o] = !1;
37
- } else {
38
- for (const l of (u = a.value) == null ? void 0 : u.items)
39
- if (l.xGroupValue === o) {
40
- let n = t[`${l.xGroupValue}-${l.yGroupValue}`];
41
- n ? (n.push(l.value), n = [...new Set(n)]) : n = [l.value], t[`${l.xGroupValue}-${l.yGroupValue}`] = n;
42
- }
43
- y.value[o] = !0;
44
- }
45
- }
46
- const P = (e) => T.getBackgroundColor(e), W = () => {
47
- L.isEqual(f, t) || d("filterChange", [
48
- {
49
- filterKey: m.value,
50
- checkedValues: Object.values(Object.values(t)).flat()
51
- }
52
- ]);
53
- }, q = () => {
54
- f = L.cloneDeep(t);
55
- };
56
- function w() {
57
- if (i.value)
58
- i.value = !1, Object.keys(t).forEach((e) => {
59
- delete t[e];
60
- });
61
- else {
62
- i.value = !0;
63
- for (const e of a.value.items) {
64
- let o = t[`${e.xGroupValue}-${e.yGroupValue}`];
65
- o ? o.push(e.value) : o = [e.value], t[`${e.xGroupValue}-${e.yGroupValue}`] = o;
66
- }
67
- }
68
- console.log(t);
69
- }
70
- function B(e) {
71
- const o = e.yGroupValue;
72
- if (h.value[o]) {
73
- for (const u in t)
74
- u.endsWith(o) && delete t[u];
75
- h.value[o] = !1;
76
- } else {
77
- for (const u of a.value.items)
78
- if (u.yGroupValue === o) {
79
- let l = t[`${u.xGroupValue}-${u.yGroupValue}`];
80
- l ? (l.push(u.value), l = [...new Set(l)]) : l = [u.value], t[`${u.xGroupValue}-${u.yGroupValue}`] = l;
81
- }
82
- h.value[o] = !0;
83
- }
84
- }
85
- M(
86
- t,
87
- (e, o) => {
88
- var S, k, E, $;
89
- Object.keys(e).forEach((r) => {
90
- Array.isArray(e[r]) && e[r].length === 0 && delete e[r];
91
- }), console.log("新的数组:", e), console.log("旧的数组:", o);
92
- const u = { backgroundColor: "#3366CC", color: "#fff", borderColor: "#3366CC" }, l = { backgroundColor: "#00bfff", borderColor: "#00bfff" }, n = {}, V = (S = a.value) == null ? void 0 : S.xGroup.length, b = (k = a.value) == null ? void 0 : k.yGroup.length;
93
- (E = a.value) == null || E.xGroup.forEach((r) => {
94
- let s = 0;
95
- for (const g in t)
96
- g.startsWith(r.xGroupValue) && s++;
97
- s === 0 ? p.value[r.xGroupValue] = n : s === b ? p.value[r.xGroupValue] = u : p.value[r.xGroupValue] = l;
98
- }), ($ = a.value) == null || $.yGroup.forEach((r) => {
99
- let s = 0;
100
- for (const g in t)
101
- g.endsWith(r.yGroupValue) && s++;
102
- s === 0 ? v.value[r.yGroupValue] = n : s === V ? v.value[r.yGroupValue] = u : v.value[r.yGroupValue] = l;
103
- }), i.value = Object.keys(e).length === V * b;
104
- },
105
- { deep: !0 }
106
- );
107
- const C = { props: G, filterKey: m, xyFilters: a, emit: d, checkList: t, get backupCheckList() {
108
- return f;
109
- }, set backupCheckList(e) {
110
- f = e;
111
- }, rowTitleStyle: p, columnTitleStyle: v, isSelectedAll: i, toggleRowSelectionFlags: y, toggleColumnSelectionFlags: h, selectList: x, getContentForCell: A, toggleRowSelection: F, getDefaultSelectedAllStyle: P, handleHide: W, handleShow: q, selectAll: w, toggleColumnSelection: B, get M2() {
112
- return H;
113
- }, get ElButton() {
114
- return I;
115
- }, get ElCheckbox() {
116
- return z;
117
- }, get ElCheckboxGroup() {
118
- return Y;
119
- }, get ElPopover() {
120
- return U;
121
- } };
122
- return Object.defineProperty(C, "__isScriptSetup", { enumerable: !1, value: !0 }), C;
123
- }
124
- });
1
+ import f from "./country-platform-shop-condition.vue.js";
125
2
  export {
126
- ae as default
3
+ f as default
127
4
  };
@@ -1,125 +1,225 @@
1
- import C from "./drop-down-condition.vue2.js";
2
- import { createElementBlock as n, openBlock as l, createVNode as _, normalizeStyle as x, withCtx as a, createTextVNode as r, createCommentVNode as i, toDisplayString as c, createElementVNode as k, Fragment as s, renderList as h, createBlock as d } from "vue";
3
- import v from "../_virtual/_plugin-vue_export-helper.js";
4
- const y = { class: "yahee-drop-down-condition" }, m = { key: 0 }, f = { style: { display: "flex", "align-items": "center", outline: "none" } }, g = { key: 0 }, w = { style: { display: "flex", width: "auto", padding: "10px" } }, V = ["onClick"], E = { class: "scrollable-container" }, p = { key: 0 };
5
- function S(N, B, M, e, z, D) {
6
- return l(), n("div", y, [
7
- _(e.ElButton, {
8
- size: "small",
9
- class: "el-button el-button--small custom-total-button",
10
- style: x(e.getDefaultSelectedAllStyle(e.isSelectedAll)),
11
- onClick: e.selectAll
12
- }, {
13
- default: a(() => [
14
- r(c(e.M2("全部")) + " ", 1),
15
- e.totalCount ? (l(), n("span", m, "(" + c(e.totalNum) + ")", 1)) : i("", !0)
16
- ]),
17
- _: 1
18
- }, 8, ["style"]),
19
- _(e.ElDropdown, {
20
- ref: "dropdown1",
21
- "popper-class": "custom-dropdown",
22
- onVisibleChange: e.handleVisible
23
- }, {
24
- dropdown: a(() => [
25
- k("div", w, [
26
- (l(!0), n(s, null, h(e.selectList, (o) => (l(), d(e.ElCheckboxGroup, {
27
- key: o.value,
28
- modelValue: e.totalCheckBoxStatus[o.text],
29
- "onUpdate:modelValue": (t) => e.totalCheckBoxStatus[o.text] = t,
30
- size: "small",
31
- class: "checkbox-group inner-checkbox-group custom-dropdown-checkbox-group",
32
- onChange: (t) => e.changeCheckbox(o)
33
- }, {
34
- default: a(() => [
35
- e._.isNil(o.subs) ? (l(), d(e.ElCheckbox, {
36
- key: 1,
37
- value: o.value,
38
- class: "checkbox custom-dropdown-button",
39
- border: ""
40
- }, {
41
- default: a(() => [
42
- r(c(e.M2(o.text)), 1)
43
- ]),
44
- _: 2
45
- }, 1032, ["value"])) : (l(), n(s, { key: 0 }, [
46
- k("span", {
47
- class: "el-button custom-dropdown-button el-button--small inner-el-button",
48
- style: x(e.selectedStyles[o.text]),
49
- onClick: (t) => e.onClick(o)
50
- }, c(e.M2(o.text)), 13, V),
51
- k("div", E, [
52
- (l(!0), n(s, null, h(o.subs, (t) => (l(), d(e.ElCheckbox, {
53
- key: t.value,
54
- class: "checkbox custom-dropdown-button",
55
- value: t.value,
56
- border: ""
57
- }, {
58
- default: a(() => {
59
- var u;
60
- return [
61
- r(c(e.M2(t.text)), 1),
62
- e._.isEmpty(e.level2Num) ? i("", !0) : (l(), n("span", p, "(" + c((u = e.level2Num.filter((b) => b.value == t.value)[0]) == null ? void 0 : u.count) + ")", 1))
63
- ];
64
- }),
65
- _: 2
66
- }, 1032, ["value"]))), 128))
67
- ])
68
- ], 64))
69
- ]),
70
- _: 2
71
- }, 1032, ["modelValue", "onUpdate:modelValue", "onChange"]))), 128))
72
- ])
73
- ]),
74
- default: a(() => [
75
- k("div", f, [
76
- (l(!0), n(s, null, h(e.selectList, (o) => (l(), n(s, null, [
77
- o.isCheckbox ? (l(), d(e.ElCheckboxGroup, {
78
- key: o.value,
79
- modelValue: e.totalCheckBoxStatus[o.text],
80
- "onUpdate:modelValue": (t) => e.totalCheckBoxStatus[o.text] = t,
81
- class: "checkbox-group",
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,
82
130
  size: "small",
83
- onChange: e.singleChangeCheckbox
131
+ class: "checkbox-group inner-checkbox-group custom-dropdown-checkbox-group",
132
+ onChange: (l) => X(e)
84
133
  }, {
85
- default: a(() => [
86
- o.isCheckbox ? (l(), d(e.ElCheckbox, {
87
- key: 0,
88
- class: "custom-dropdown-button",
89
- value: o.value,
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",
90
139
  border: ""
91
140
  }, {
92
- default: a(() => [
93
- r(c(e.M2(o.text)), 1)
141
+ default: d(() => [
142
+ k(v(u(y)(e.text)), 1)
94
143
  ]),
95
144
  _: 2
96
- }, 1032, ["value"])) : i("", !0)
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))
97
169
  ]),
98
170
  _: 2
99
- }, 1032, ["modelValue", "onUpdate:modelValue"])) : (l(), d(e.ElButton, {
100
- key: o.text,
101
- style: x(e.selectedStyles[o.text]),
102
- class: "custom-dropdown-button",
103
- size: "small",
104
- onClick: (t) => e.onClick(o)
105
- }, {
106
- default: a(() => {
107
- var t;
108
- return [
109
- r(c(e.M2(o.text)) + " ", 1),
110
- e._.isEmpty(e.level1Num) ? i("", !0) : (l(), n("span", g, "(" + c((t = e.level1Num.filter((u) => u.value == o.value)[0]) == null ? void 0 : t.count) + ")", 1))
111
- ];
112
- }),
113
- _: 2
114
- }, 1032, ["style", "onClick"]))
115
- ], 64))), 256))
116
- ])
117
- ]),
118
- _: 1
119
- }, 512)
120
- ]);
121
- }
122
- const G = /* @__PURE__ */ v(C, [["render", S], ["__file", "E:/工作/项目代码/common_componentsweb/packages/components/src/drop-down-condition/drop-down-condition.vue"]]);
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
+ });
123
223
  export {
124
- G as default
224
+ Ae as default
125
225
  };
@@ -1,129 +1,4 @@
1
- import { defineComponent as U, ref as f, reactive as C, toRefs as Y, watch as $, onMounted as z } from "vue";
2
- import n from "../_virtual/lodash.js";
3
- import { stylesUtils as S } from "../utils/style.js";
4
- import { storage as L } from "../utils/storage.js";
5
- import { M2 as H } from "../utils/translate.js";
6
- import { ElDropdown as J, ElCheckboxGroup as Q, ElCheckbox as X, ElButton as Z } 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 = /* @__PURE__ */ U({
16
- name: "YaheeDropDownCondition",
17
- __name: "drop-down-condition",
18
- props: {
19
- filterList: { type: Array, required: !1 },
20
- totalCount: { type: Number, required: !1 },
21
- level1Count: { type: Array, required: !1 },
22
- level2Count: { type: Array, required: !1 },
23
- filterKey: { type: String, required: !0 },
24
- enumEntity: { type: String, required: !0 },
25
- noNeedRefreshNumFilterName: { type: String, required: !1 },
26
- initFilters: { type: Function, required: !1 }
27
- },
28
- emits: ["filterChange", "setNoNeedRefreshNumFilterName"],
29
- setup(B, { expose: R, emit: K }) {
30
- R();
31
- const M = f(), l = C({});
32
- let g = C({});
33
- const s = C({}), i = C({}), a = f(!0), c = B, N = K, { filterKey: p, filterList: b, totalCount: d, level1Count: m, level2Count: v, noNeedRefreshNumFilterName: x } = Y(c), _ = f(n.get(d, "value", 0)), F = f(n.get(m, "value", [])), q = f(n.get(v, "value", [])), u = f();
34
- b.value && (u.value = [...b.value]);
35
- function O(e) {
36
- const { text: t, value: r } = e, o = l[t];
37
- n.isNil(o) || n.isEmpty(o) ? l[t] = [r] : l[t] = [], i[t] = !i[t], i[t] ? (A(t), s[t] = S.getBackgroundColor(!0), a.value = !1) : (j(t), s[e.text] = {}, a.value = !0), a.value = h(), y();
38
- }
39
- function h() {
40
- const e = u.value.filter((o) => !n.isEmpty(o.subs)).flatMap((o) => o.subs).length, t = u.value.filter((o) => n.isEmpty(o.subs)).length;
41
- return Object.values(l).map((o) => o.length).reduce((o, k) => o + k, 0) === e + t || n.isEmpty(Object.values(l).flat());
42
- }
43
- function G(e) {
44
- n.isEmpty(l[e.text]) ? (s[e.text] = {}, i[e.text] = !1) : l[e.text].length === n.get(e, "subs.length", 1) ? (s[e.text] = S.getBackgroundColor(!0), i[e.text] = !0) : s[e.text] = {
45
- backgroundColor: "#0F7535",
46
- color: "#fff",
47
- borderColor: "#0F7535"
48
- }, a.value = h(), y();
49
- }
50
- function I() {
51
- a.value = h(), y();
52
- }
53
- function y() {
54
- N("setNoNeedRefreshNumFilterName", p.value);
55
- }
56
- function P() {
57
- a.value = !0;
58
- for (const e in s)
59
- s[e] = {};
60
- for (const e in l)
61
- delete l[e];
62
- for (const e in i)
63
- delete i[e];
64
- E();
65
- }
66
- const T = (e) => S.getBackgroundColor(e);
67
- function V(e) {
68
- if (e)
69
- g = n.cloneDeep(l);
70
- else {
71
- if (n.isEqual(g, l))
72
- return;
73
- E();
74
- }
75
- }
76
- function E() {
77
- N("filterChange", [
78
- {
79
- filterKey: p.value,
80
- checkedValues: Object.values(l).flat()
81
- }
82
- ]);
83
- }
84
- function A(e) {
85
- const t = u.value.find((r) => r.text === e);
86
- t && t.subs && (l[e] = t.subs.map((r) => r.value));
87
- }
88
- function j(e) {
89
- l[e] = [];
90
- }
91
- function w() {
92
- const e = `filter-key-${c.enumEntity}`, t = L.getWithExpireTime(e);
93
- t ? u.value = t : (console.log(c.enumEntity), c.initFilters(c.enumEntity).then((r) => {
94
- console.log(r), u.value = r.data, L.setWithExpireTime(e, u.value, 1200 * 1e3), console.log(u.value);
95
- }).catch((r) => {
96
- console.log(r);
97
- }));
98
- }
99
- $(
100
- [() => d.value, () => m.value, () => v.value],
101
- ([e, t, r], [o, k, W]) => {
102
- console.log(e, t, r), console.log(o, k, W), (!x.value || !n.eq(x.value, p.value)) && (_.value = d.value, F.value = m.value, q.value = v.value);
103
- }
104
- ), z(() => {
105
- w();
106
- });
107
- const D = { dropdown1: M, totalCheckBoxStatus: l, get judgeChange() {
108
- return g;
109
- }, set judgeChange(e) {
110
- g = e;
111
- }, selectedStyles: s, selectedAllStatus: i, isSelectedAll: a, props: c, emit: N, filterKey: p, filterList: b, totalCount: d, level1Count: m, level2Count: v, noNeedRefreshNumFilterName: x, totalNum: _, level1Num: F, level2Num: q, selectList: u, onClick: O, getIsNeedSelectAll: h, changeCheckbox: G, singleChangeCheckbox: I, setNoNeedRefreshNumFilterName: y, selectAll: P, getDefaultSelectedAllStyle: T, handleVisible: V, updateParentForm: E, selectAllCheckboxes: A, deSelectCheckboxes: j, initData: w, get _() {
112
- return n;
113
- }, get M2() {
114
- return H;
115
- }, get ElButton() {
116
- return Z;
117
- }, get ElCheckbox() {
118
- return X;
119
- }, get ElCheckboxGroup() {
120
- return Q;
121
- }, get ElDropdown() {
122
- return J;
123
- } };
124
- return Object.defineProperty(D, "__isScriptSetup", { enumerable: !1, value: !0 }), D;
125
- }
126
- });
1
+ import f from "./drop-down-condition.vue.js";
127
2
  export {
128
- de as default
3
+ f as default
129
4
  };