yahee-components 0.0.60 → 0.0.62
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as re, toRefs as ie, ref as v, computed as ce, watch as fe, onMounted as de, nextTick as L, resolveComponent as K, createElementBlock as
|
|
2
|
-
import
|
|
1
|
+
import { defineComponent as re, toRefs as ie, ref as v, computed as ce, watch as fe, onMounted as de, nextTick as L, resolveComponent as K, createElementBlock as b, openBlock as p, createVNode as C, withCtx as q, unref as s, createCommentVNode as z, normalizeStyle as ve, toDisplayString as F, Fragment as me, renderList as pe, createBlock as ge, createTextVNode as M } from "vue";
|
|
2
|
+
import l from "../_virtual/lodash.js";
|
|
3
3
|
import ye from "./left-condition-sub.vue.js";
|
|
4
4
|
import { stylesUtils as he } from "../utils/style.js";
|
|
5
5
|
import { M2 as J } from "../utils/translate.js";
|
|
@@ -35,7 +35,7 @@ const ke = { class: "yahee-left-condition" }, Ne = {
|
|
|
35
35
|
setup(O, { expose: Y, emit: j }) {
|
|
36
36
|
const G = O, {
|
|
37
37
|
multiSelectList: w,
|
|
38
|
-
displayRangeInput:
|
|
38
|
+
displayRangeInput: R,
|
|
39
39
|
selectList: g,
|
|
40
40
|
hasNum: H,
|
|
41
41
|
allIsEmpty: Q,
|
|
@@ -46,126 +46,126 @@ const ke = { class: "yahee-left-condition" }, Ne = {
|
|
|
46
46
|
rangeEndKey: i,
|
|
47
47
|
noNeedRefreshNumFilterName: $,
|
|
48
48
|
defaultValues: h,
|
|
49
|
-
totalCount:
|
|
50
|
-
countList:
|
|
49
|
+
totalCount: _,
|
|
50
|
+
countList: x,
|
|
51
51
|
showTotal: Z
|
|
52
|
-
} = ie(G),
|
|
52
|
+
} = ie(G), E = j, A = v(_.value), f = v(), d = v(), T = v(x.value), u = /* @__PURE__ */ new Map(), c = v(!0), m = v([]), k = () => {
|
|
53
53
|
console.log("left condition notifyParent start"), L(() => {
|
|
54
|
-
var o,
|
|
55
|
-
const e = N(),
|
|
56
|
-
if (
|
|
57
|
-
|
|
54
|
+
var o, V;
|
|
55
|
+
const e = N(), t = ue();
|
|
56
|
+
if (l.isEmpty(e) && l.isEmpty(t)) {
|
|
57
|
+
S();
|
|
58
58
|
return;
|
|
59
59
|
}
|
|
60
60
|
const a = [
|
|
61
61
|
{
|
|
62
62
|
filterKey: y.value,
|
|
63
|
-
checkedValues:
|
|
63
|
+
checkedValues: l.map(e, (n) => n.value)
|
|
64
64
|
}
|
|
65
65
|
];
|
|
66
|
-
|
|
66
|
+
R.value && (a.push({
|
|
67
67
|
filterKey: r.value,
|
|
68
68
|
checkedValues: [(o = u.get(r.value)) == null ? void 0 : o.value]
|
|
69
69
|
}), a.push({
|
|
70
70
|
filterKey: i.value,
|
|
71
|
-
checkedValues: [(
|
|
72
|
-
})),
|
|
73
|
-
`left condition notifyParent nextTick after emit, filterKey: ${y.value}, checkedValues: ${JSON.stringify(
|
|
71
|
+
checkedValues: [(V = u.get(i.value)) == null ? void 0 : V.value]
|
|
72
|
+
})), E("filterChange", a), console.log(
|
|
73
|
+
`left condition notifyParent nextTick after emit, filterKey: ${y.value}, checkedValues: ${JSON.stringify(l.map(e, (n) => n.value))}`
|
|
74
74
|
);
|
|
75
75
|
});
|
|
76
76
|
}, ee = () => {
|
|
77
|
-
|
|
77
|
+
E("setNoNeedRefreshNumFilterName");
|
|
78
78
|
}, U = () => {
|
|
79
|
-
|
|
80
|
-
}, le = () => {
|
|
81
|
-
const e = u.get(r.value);
|
|
82
|
-
t.isEmpty(e) && !f.value || t.get(e, "value") === f.value || (U(), k());
|
|
79
|
+
I(), B({ label: r.value, selected: !0, value: f.value }), B({ label: i.value, selected: !0, value: d.value });
|
|
83
80
|
}, te = () => {
|
|
81
|
+
const e = u.get(r.value);
|
|
82
|
+
l.isEmpty(e) && !f.value || l.get(e, "value") === f.value || (U(), k());
|
|
83
|
+
}, le = () => {
|
|
84
84
|
const e = u.get(i.value);
|
|
85
|
-
|
|
85
|
+
l.isEmpty(e) && !d.value || l.get(e, "value") === d.value || (U(), k());
|
|
86
86
|
};
|
|
87
|
-
function
|
|
87
|
+
function B(e) {
|
|
88
88
|
console.log(`left condition setSelectedStatusMap start, item: ${JSON.stringify(e)}`), u.set(e.label, {
|
|
89
89
|
selected: e.selected,
|
|
90
90
|
value: e.value
|
|
91
|
-
}), c.value =
|
|
91
|
+
}), c.value = l.eq(N().length, g.value.length);
|
|
92
92
|
}
|
|
93
93
|
function P(e) {
|
|
94
|
-
return
|
|
94
|
+
return l.includes(w.value, e.value);
|
|
95
95
|
}
|
|
96
|
-
function
|
|
97
|
-
const e =
|
|
98
|
-
u.clear(),
|
|
99
|
-
|
|
96
|
+
function I() {
|
|
97
|
+
const e = l.map(N(), (t) => t.value);
|
|
98
|
+
u.clear(), l.forEach(m.value, (t) => {
|
|
99
|
+
l.includes(e, t.getValue().value) && t.resetValue();
|
|
100
100
|
}), c.value = !1;
|
|
101
101
|
}
|
|
102
102
|
function ae() {
|
|
103
|
-
const e =
|
|
104
|
-
u.clear(),
|
|
105
|
-
|
|
106
|
-
}), c.value = !0;
|
|
103
|
+
const e = l.map(N(), (t) => t.value);
|
|
104
|
+
u.clear(), l.forEach(m.value, (t) => {
|
|
105
|
+
l.includes(e, t.getValue().value) && t.resetValue();
|
|
106
|
+
}), c.value = !0, S();
|
|
107
107
|
}
|
|
108
108
|
const N = () => {
|
|
109
|
-
const e =
|
|
109
|
+
const e = l.filter(
|
|
110
110
|
Array.from(u.values()),
|
|
111
|
-
(
|
|
111
|
+
(t) => t.selected
|
|
112
112
|
);
|
|
113
|
-
return
|
|
114
|
-
const a = Array.from(u.keys()).find((o) => u.get(o) ===
|
|
113
|
+
return l.filter(e, (t) => {
|
|
114
|
+
const a = Array.from(u.keys()).find((o) => u.get(o) === t);
|
|
115
115
|
return ![r.value, i.value].includes(a);
|
|
116
116
|
});
|
|
117
|
-
}, ue = () =>
|
|
118
|
-
const
|
|
119
|
-
return [r.value, i.value].includes(
|
|
117
|
+
}, ue = () => l.filter(Array.from(u.values()), (e) => {
|
|
118
|
+
const t = Array.from(u.keys()).find((a) => u.get(a) === e);
|
|
119
|
+
return [r.value, i.value].includes(t);
|
|
120
120
|
}), ne = () => {
|
|
121
121
|
c.value = !1;
|
|
122
|
-
}, se = ce(() =>
|
|
122
|
+
}, se = ce(() => l.sortBy(g.value, (e) => P(e))), D = () => {
|
|
123
123
|
f.value = void 0, d.value = void 0, u.delete(r.value), u.delete(i.value);
|
|
124
124
|
};
|
|
125
|
-
function
|
|
126
|
-
|
|
125
|
+
function S() {
|
|
126
|
+
I(), L(() => {
|
|
127
127
|
console.log("selectList.value:", g.value), c.value = !0;
|
|
128
|
-
const e = g.value.filter((a) => !P(a)),
|
|
129
|
-
|
|
128
|
+
const e = g.value.filter((a) => !P(a)), t = l.map(e, (a) => a.value);
|
|
129
|
+
E("filterChange", [
|
|
130
130
|
{
|
|
131
131
|
filterKey: y.value,
|
|
132
|
-
checkedValues: Q.value ? [] :
|
|
132
|
+
checkedValues: Q.value ? [] : t
|
|
133
133
|
}
|
|
134
134
|
]);
|
|
135
|
-
}),
|
|
135
|
+
}), R.value && D();
|
|
136
136
|
}
|
|
137
137
|
return fe(
|
|
138
|
-
[() =>
|
|
139
|
-
([e,
|
|
140
|
-
console.log(e,
|
|
138
|
+
[() => _.value, () => x.value],
|
|
139
|
+
([e, t], [a, o]) => {
|
|
140
|
+
console.log(e, t), console.log(a, o), (!$.value || !l.eq($.value, y.value)) && (A.value = _.value, T.value = x.value);
|
|
141
141
|
}
|
|
142
142
|
), Y({
|
|
143
|
-
clickAllSelected:
|
|
143
|
+
clickAllSelected: S,
|
|
144
144
|
resetAllCheckedValueAndSelectAll: ae
|
|
145
145
|
}), de(() => {
|
|
146
|
-
if (!Array.isArray(h.value) ||
|
|
146
|
+
if (!Array.isArray(h.value) || l.isEmpty(h.value)) {
|
|
147
147
|
c.value = !0;
|
|
148
148
|
return;
|
|
149
149
|
}
|
|
150
150
|
console.log("defaultValues.value", h.value), console.log("itemRefs:", m.value), L(() => {
|
|
151
|
-
|
|
151
|
+
l.filter(m.value, (e) => e != null && e.getValue ? l.includes(h.value, e.getValue().value) : !1).forEach((e) => {
|
|
152
152
|
e.setCurrentValue(!0), e.setCheckboxValue(!0);
|
|
153
153
|
}), k();
|
|
154
154
|
});
|
|
155
|
-
}), (e,
|
|
156
|
-
const a = K("el-input-number"), o = K("el-form-item"),
|
|
157
|
-
return p(),
|
|
158
|
-
|
|
155
|
+
}), (e, t) => {
|
|
156
|
+
const a = K("el-input-number"), o = K("el-form-item"), V = K("el-form");
|
|
157
|
+
return p(), b("div", ke, [
|
|
158
|
+
C(V, null, {
|
|
159
159
|
default: q(() => [
|
|
160
|
-
|
|
160
|
+
C(o, { label: s(X) }, {
|
|
161
161
|
default: q(() => [
|
|
162
|
-
s(Z) ? (p(),
|
|
162
|
+
s(Z) ? (p(), b("span", {
|
|
163
163
|
key: 0,
|
|
164
164
|
class: "el-button custom-button el-button--small",
|
|
165
165
|
style: ve(s(he).getBackgroundColor(c.value)),
|
|
166
|
-
onClick:
|
|
167
|
-
}, F(
|
|
168
|
-
(p(!0),
|
|
166
|
+
onClick: S
|
|
167
|
+
}, F(A.value ? `${s(J)("全部")}(${A.value})` : s(J)("全部")), 5)) : z("", !0),
|
|
168
|
+
(p(!0), b(me, null, pe(se.value, (n, oe) => (p(), ge(ye, {
|
|
169
169
|
key: oe,
|
|
170
170
|
ref_for: !0,
|
|
171
171
|
ref_key: "itemRefs",
|
|
@@ -176,39 +176,39 @@ const ke = { class: "yahee-left-condition" }, Ne = {
|
|
|
176
176
|
"count-list": T.value,
|
|
177
177
|
item: n,
|
|
178
178
|
"has-num": s(H),
|
|
179
|
-
onResetAllCheckedValue:
|
|
180
|
-
onSetSelectedStatusMap:
|
|
179
|
+
onResetAllCheckedValue: I,
|
|
180
|
+
onSetSelectedStatusMap: B,
|
|
181
181
|
onResetRange: D,
|
|
182
182
|
onSetNoNeedRefreshNumFilterName: ee,
|
|
183
183
|
onNotifyParent: k,
|
|
184
184
|
onResetIsSelectAll: ne
|
|
185
185
|
}, null, 8, ["all-is-checkbox", "multi-select-list", "translate-user-id", "count-list", "item", "has-num"]))), 128)),
|
|
186
|
-
s(
|
|
186
|
+
s(R) ? (p(), b("div", Ne, [
|
|
187
187
|
M(F(e.rangeLabel) + " ", 1),
|
|
188
|
-
|
|
188
|
+
C(a, {
|
|
189
189
|
modelValue: f.value,
|
|
190
|
-
"onUpdate:modelValue":
|
|
190
|
+
"onUpdate:modelValue": t[0] || (t[0] = (n) => f.value = n),
|
|
191
191
|
style: { "margin-left": "2px", width: "60px", height: "22px" },
|
|
192
192
|
precision: 2,
|
|
193
193
|
step: 0.01,
|
|
194
194
|
min: 1,
|
|
195
195
|
max: 100,
|
|
196
196
|
controls: !1,
|
|
197
|
-
onBlur:
|
|
197
|
+
onBlur: te
|
|
198
198
|
}, null, 8, ["modelValue"]),
|
|
199
199
|
M(" % " + F(e.rangeDelimiter) + " ", 1),
|
|
200
|
-
|
|
200
|
+
C(a, {
|
|
201
201
|
modelValue: d.value,
|
|
202
|
-
"onUpdate:modelValue":
|
|
202
|
+
"onUpdate:modelValue": t[1] || (t[1] = (n) => d.value = n),
|
|
203
203
|
style: { width: "60px", height: "22px" },
|
|
204
204
|
precision: 2,
|
|
205
205
|
step: 0.01,
|
|
206
206
|
size: "small",
|
|
207
207
|
max: 100,
|
|
208
208
|
controls: !1,
|
|
209
|
-
onChange:
|
|
209
|
+
onChange: le
|
|
210
210
|
}, null, 8, ["modelValue"]),
|
|
211
|
-
|
|
211
|
+
t[2] || (t[2] = M(" % "))
|
|
212
212
|
])) : z("", !0)
|
|
213
213
|
]),
|
|
214
214
|
_: 1
|