yahee-components 0.0.52 → 0.0.54
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/_virtual/_plugin-vue_export-helper.js +9 -0
- package/es/annex-upload/annex-upload.vue.js +69 -154
- package/es/annex-upload/annex-upload.vue2.js +119 -2
- package/es/annex-upload/index.js +3 -3
- package/es/api/tool.js +1 -1
- package/es/complex-search/complex-search.vue.js +240 -312
- package/es/complex-search/complex-search.vue2.js +154 -2
- package/es/complex-search/index.js +5 -5
- package/es/copy/copy.vue.js +39 -55
- package/es/copy/copy.vue2.js +34 -2
- package/es/copy/index.js +3 -3
- package/es/country-platform-shop-condition/country-platform-shop-condition.vue.js +158 -204
- package/es/country-platform-shop-condition/country-platform-shop-condition.vue2.js +125 -2
- package/es/drop-down-condition/drop-down-condition.vue.js +193 -211
- package/es/drop-down-condition/drop-down-condition.vue2.js +127 -2
- package/es/image-upload/image-upload.vue.js +76 -113
- package/es/image-upload/image-upload.vue2.js +91 -2
- package/es/image-upload/index.js +3 -3
- package/es/input/index.js +3 -3
- package/es/input/input.vue.js +17 -38
- package/es/input/input.vue2.js +33 -2
- package/es/left-condition/index.js +5 -5
- package/es/left-condition/left-condition-sub.vue.js +55 -86
- package/es/left-condition/left-condition-sub.vue2.js +76 -2
- package/es/left-condition/left-condition.vue.js +93 -210
- package/es/left-condition/left-condition.vue2.js +153 -2
- package/es/left-condition-enum/index.js +3 -3
- package/es/left-condition-enum/left-condition-enum.vue.js +19 -77
- package/es/left-condition-enum/left-condition-enum.vue2.js +69 -2
- package/es/operation-log/operation-log-content.vue.js +78 -92
- package/es/operation-log/operation-log-content.vue2.js +39 -2
- package/es/operation-log/operation-log-dialog.vue.js +57 -68
- package/es/operation-log/operation-log-dialog.vue2.js +38 -2
- package/es/operation-log/operation-log-form.vue.js +132 -183
- package/es/operation-log/operation-log-form.vue2.js +104 -2
- package/es/operation-log/operation-log.vue.js +186 -227
- package/es/operation-log/operation-log.vue2.js +135 -2
- package/es/packages/components/api/log-server.js +5 -5
- package/es/packages/components/api/upload-server.js +1 -1
- package/es/packages/components/hooks/useImg.js +8 -8
- package/es/utils/translate.js +19 -19
- package/package.json +1 -1
- package/types/src/installs.d.ts +3 -0
- package/types/src/left-condition/index.d.ts +3 -0
- package/types/src/left-condition/left-condition.vue.d.ts +2 -0
|
@@ -1,225 +1,207 @@
|
|
|
1
|
-
import
|
|
2
|
-
import s from "
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
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,
|
|
1
|
+
import v 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 C from "../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const f = { class: "yahee-drop-down-condition" }, y = { key: 0 }, m = { style: { display: "flex", "align-items": "center", outline: "none" } }, E = { key: 0 }, g = { style: { display: "flex", width: "auto", padding: "10px" } }, w = ["onClick"], V = { class: "scrollable-container" }, p = { key: 0 };
|
|
5
|
+
function S(N, B, D, e, M, z) {
|
|
6
|
+
return l(), n("div", f, [
|
|
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(
|
|
15
|
+
c(e.M2("全部")) + " ",
|
|
16
|
+
1
|
|
17
|
+
/* TEXT */
|
|
18
|
+
),
|
|
19
|
+
e.totalCount ? (l(), n(
|
|
20
|
+
"span",
|
|
21
|
+
y,
|
|
22
|
+
"(" + c(e.totalNum) + ")",
|
|
23
|
+
1
|
|
24
|
+
/* TEXT */
|
|
25
|
+
)) : i("v-if", !0)
|
|
26
|
+
]),
|
|
27
|
+
_: 1
|
|
28
|
+
/* STABLE */
|
|
29
|
+
}, 8, ["style"]),
|
|
30
|
+
_(
|
|
31
|
+
e.ElDropdown,
|
|
32
|
+
{
|
|
33
|
+
ref: "dropdown1",
|
|
121
34
|
"popper-class": "custom-dropdown",
|
|
122
|
-
onVisibleChange:
|
|
123
|
-
},
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
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",
|
|
35
|
+
onVisibleChange: e.handleVisible
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
dropdown: a(() => [
|
|
39
|
+
k("div", g, [
|
|
40
|
+
(l(!0), n(
|
|
41
|
+
s,
|
|
42
|
+
null,
|
|
43
|
+
h(e.selectList, (o) => (l(), d(e.ElCheckboxGroup, {
|
|
44
|
+
key: o.value,
|
|
45
|
+
modelValue: e.totalCheckBoxStatus[o.text],
|
|
46
|
+
"onUpdate:modelValue": (t) => e.totalCheckBoxStatus[o.text] = t,
|
|
182
47
|
size: "small",
|
|
183
|
-
|
|
48
|
+
class: "checkbox-group inner-checkbox-group custom-dropdown-checkbox-group",
|
|
49
|
+
onChange: (t) => e.changeCheckbox(o)
|
|
184
50
|
}, {
|
|
185
|
-
default:
|
|
186
|
-
e.
|
|
187
|
-
key:
|
|
188
|
-
|
|
189
|
-
|
|
51
|
+
default: a(() => [
|
|
52
|
+
e._.isNil(o.subs) ? (l(), d(e.ElCheckbox, {
|
|
53
|
+
key: 1,
|
|
54
|
+
value: o.value,
|
|
55
|
+
class: "checkbox custom-dropdown-button",
|
|
190
56
|
border: ""
|
|
191
57
|
}, {
|
|
192
|
-
default:
|
|
193
|
-
|
|
58
|
+
default: a(() => [
|
|
59
|
+
r(
|
|
60
|
+
c(e.M2(o.text)),
|
|
61
|
+
1
|
|
62
|
+
/* TEXT */
|
|
63
|
+
)
|
|
194
64
|
]),
|
|
195
65
|
_: 2
|
|
196
|
-
|
|
66
|
+
/* DYNAMIC */
|
|
67
|
+
}, 1032, ["value"])) : (l(), n(
|
|
68
|
+
s,
|
|
69
|
+
{ key: 0 },
|
|
70
|
+
[
|
|
71
|
+
k("span", {
|
|
72
|
+
class: "el-button custom-dropdown-button el-button--small inner-el-button",
|
|
73
|
+
style: x(e.selectedStyles[o.text]),
|
|
74
|
+
onClick: (t) => e.onClick(o)
|
|
75
|
+
}, c(e.M2(o.text)), 13, w),
|
|
76
|
+
k("div", V, [
|
|
77
|
+
(l(!0), n(
|
|
78
|
+
s,
|
|
79
|
+
null,
|
|
80
|
+
h(o.subs, (t) => (l(), d(e.ElCheckbox, {
|
|
81
|
+
key: t.value,
|
|
82
|
+
class: "checkbox custom-dropdown-button",
|
|
83
|
+
value: t.value,
|
|
84
|
+
border: ""
|
|
85
|
+
}, {
|
|
86
|
+
default: a(() => {
|
|
87
|
+
var u;
|
|
88
|
+
return [
|
|
89
|
+
r(
|
|
90
|
+
c(e.M2(t.text)),
|
|
91
|
+
1
|
|
92
|
+
/* TEXT */
|
|
93
|
+
),
|
|
94
|
+
e._.isEmpty(e.level2Num) ? i("v-if", !0) : (l(), n(
|
|
95
|
+
"span",
|
|
96
|
+
p,
|
|
97
|
+
"(" + c((u = e.level2Num.filter((b) => b.value == t.value)[0]) == null ? void 0 : u.count) + ")",
|
|
98
|
+
1
|
|
99
|
+
/* TEXT */
|
|
100
|
+
))
|
|
101
|
+
];
|
|
102
|
+
}),
|
|
103
|
+
_: 2
|
|
104
|
+
/* DYNAMIC */
|
|
105
|
+
}, 1032, ["value"]))),
|
|
106
|
+
128
|
|
107
|
+
/* KEYED_FRAGMENT */
|
|
108
|
+
))
|
|
109
|
+
])
|
|
110
|
+
],
|
|
111
|
+
64
|
|
112
|
+
/* STABLE_FRAGMENT */
|
|
113
|
+
))
|
|
197
114
|
]),
|
|
198
115
|
_: 2
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
116
|
+
/* DYNAMIC */
|
|
117
|
+
}, 1032, ["modelValue", "onUpdate:modelValue", "onChange"]))),
|
|
118
|
+
128
|
|
119
|
+
/* KEYED_FRAGMENT */
|
|
120
|
+
))
|
|
121
|
+
])
|
|
122
|
+
]),
|
|
123
|
+
default: a(() => [
|
|
124
|
+
k("div", m, [
|
|
125
|
+
(l(!0), n(
|
|
126
|
+
s,
|
|
127
|
+
null,
|
|
128
|
+
h(e.selectList, (o) => (l(), n(
|
|
129
|
+
s,
|
|
130
|
+
null,
|
|
131
|
+
[
|
|
132
|
+
o.isCheckbox ? (l(), d(e.ElCheckboxGroup, {
|
|
133
|
+
key: o.value,
|
|
134
|
+
modelValue: e.totalCheckBoxStatus[o.text],
|
|
135
|
+
"onUpdate:modelValue": (t) => e.totalCheckBoxStatus[o.text] = t,
|
|
136
|
+
class: "checkbox-group",
|
|
137
|
+
size: "small",
|
|
138
|
+
onChange: e.singleChangeCheckbox
|
|
139
|
+
}, {
|
|
140
|
+
default: a(() => [
|
|
141
|
+
o.isCheckbox ? (l(), d(e.ElCheckbox, {
|
|
142
|
+
key: 0,
|
|
143
|
+
class: "custom-dropdown-button",
|
|
144
|
+
value: o.value,
|
|
145
|
+
border: ""
|
|
146
|
+
}, {
|
|
147
|
+
default: a(() => [
|
|
148
|
+
r(
|
|
149
|
+
c(e.M2(o.text)),
|
|
150
|
+
1
|
|
151
|
+
/* TEXT */
|
|
152
|
+
)
|
|
153
|
+
]),
|
|
154
|
+
_: 2
|
|
155
|
+
/* DYNAMIC */
|
|
156
|
+
}, 1032, ["value"])) : i("v-if", !0)
|
|
157
|
+
]),
|
|
158
|
+
_: 2
|
|
159
|
+
/* DYNAMIC */
|
|
160
|
+
}, 1032, ["modelValue", "onUpdate:modelValue"])) : (l(), d(e.ElButton, {
|
|
161
|
+
key: o.text,
|
|
162
|
+
style: x(e.selectedStyles[o.text]),
|
|
163
|
+
class: "custom-dropdown-button",
|
|
164
|
+
size: "small",
|
|
165
|
+
onClick: (t) => e.onClick(o)
|
|
166
|
+
}, {
|
|
167
|
+
default: a(() => {
|
|
168
|
+
var t;
|
|
169
|
+
return [
|
|
170
|
+
r(
|
|
171
|
+
c(e.M2(o.text)) + " ",
|
|
172
|
+
1
|
|
173
|
+
/* TEXT */
|
|
174
|
+
),
|
|
175
|
+
e._.isEmpty(e.level1Num) ? i("v-if", !0) : (l(), n(
|
|
176
|
+
"span",
|
|
177
|
+
E,
|
|
178
|
+
"(" + c((t = e.level1Num.filter((u) => u.value == o.value)[0]) == null ? void 0 : t.count) + ")",
|
|
179
|
+
1
|
|
180
|
+
/* TEXT */
|
|
181
|
+
))
|
|
182
|
+
];
|
|
183
|
+
}),
|
|
184
|
+
_: 2
|
|
185
|
+
/* DYNAMIC */
|
|
186
|
+
}, 1032, ["style", "onClick"]))
|
|
187
|
+
],
|
|
188
|
+
64
|
|
189
|
+
/* STABLE_FRAGMENT */
|
|
190
|
+
))),
|
|
191
|
+
256
|
|
192
|
+
/* UNKEYED_FRAGMENT */
|
|
193
|
+
))
|
|
216
194
|
])
|
|
217
195
|
]),
|
|
218
196
|
_: 1
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
197
|
+
/* STABLE */
|
|
198
|
+
},
|
|
199
|
+
512
|
|
200
|
+
/* NEED_PATCH */
|
|
201
|
+
)
|
|
202
|
+
]);
|
|
203
|
+
}
|
|
204
|
+
const F = /* @__PURE__ */ C(v, [["render", S], ["__file", "E:/工作/项目代码/common_componentsweb/packages/components/src/drop-down-condition/drop-down-condition.vue"]]);
|
|
223
205
|
export {
|
|
224
|
-
|
|
206
|
+
F as default
|
|
225
207
|
};
|
|
@@ -1,4 +1,129 @@
|
|
|
1
|
-
import f from "
|
|
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
|
+
});
|
|
2
127
|
export {
|
|
3
|
-
|
|
128
|
+
de as default
|
|
4
129
|
};
|