yahee-components 0.0.58 → 0.0.60
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,13 +1,13 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { stylesUtils as
|
|
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 V, openBlock as p, createVNode as b, 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 t from "../_virtual/lodash.js";
|
|
3
|
+
import ye from "./left-condition-sub.vue.js";
|
|
4
|
+
import { stylesUtils as he } from "../utils/style.js";
|
|
5
5
|
import { M2 as J } from "../utils/translate.js";
|
|
6
|
-
const
|
|
6
|
+
const ke = { class: "yahee-left-condition" }, Ne = {
|
|
7
7
|
key: 1,
|
|
8
8
|
class: "el-button custom-button el-button--small",
|
|
9
9
|
style: { "margin-left": "5px", display: "inline-flex" }
|
|
10
|
-
},
|
|
10
|
+
}, _e = /* @__PURE__ */ re({
|
|
11
11
|
name: "YaheeLeftCondition",
|
|
12
12
|
__name: "left-condition",
|
|
13
13
|
props: {
|
|
@@ -36,31 +36,31 @@ const he = { class: "yahee-left-condition" }, ke = {
|
|
|
36
36
|
const G = O, {
|
|
37
37
|
multiSelectList: w,
|
|
38
38
|
displayRangeInput: C,
|
|
39
|
-
selectList:
|
|
39
|
+
selectList: g,
|
|
40
40
|
hasNum: H,
|
|
41
41
|
allIsEmpty: Q,
|
|
42
42
|
translateUserId: W,
|
|
43
43
|
label: X,
|
|
44
|
-
filterKey:
|
|
44
|
+
filterKey: y,
|
|
45
45
|
rangeStartKey: r,
|
|
46
46
|
rangeEndKey: i,
|
|
47
47
|
noNeedRefreshNumFilterName: $,
|
|
48
|
-
defaultValues:
|
|
48
|
+
defaultValues: h,
|
|
49
49
|
totalCount: R,
|
|
50
50
|
countList: _,
|
|
51
51
|
showTotal: Z
|
|
52
|
-
} =
|
|
53
|
-
console.log("left condition notifyParent start"),
|
|
52
|
+
} = ie(G), x = j, E = v(R.value), f = v(), d = v(), T = v(_.value), u = /* @__PURE__ */ new Map(), c = v(!1), m = v([]), k = () => {
|
|
53
|
+
console.log("left condition notifyParent start"), L(() => {
|
|
54
54
|
var o, S;
|
|
55
|
-
const e =
|
|
56
|
-
if (
|
|
55
|
+
const e = N(), l = ue();
|
|
56
|
+
if (t.isEmpty(e) && t.isEmpty(l)) {
|
|
57
57
|
I();
|
|
58
58
|
return;
|
|
59
59
|
}
|
|
60
60
|
const a = [
|
|
61
61
|
{
|
|
62
|
-
filterKey:
|
|
63
|
-
checkedValues:
|
|
62
|
+
filterKey: y.value,
|
|
63
|
+
checkedValues: t.map(e, (n) => n.value)
|
|
64
64
|
}
|
|
65
65
|
];
|
|
66
66
|
C.value && (a.push({
|
|
@@ -70,139 +70,145 @@ const he = { class: "yahee-left-condition" }, ke = {
|
|
|
70
70
|
filterKey: i.value,
|
|
71
71
|
checkedValues: [(S = u.get(i.value)) == null ? void 0 : S.value]
|
|
72
72
|
})), x("filterChange", a), console.log(
|
|
73
|
-
`left condition notifyParent nextTick after emit, filterKey: ${
|
|
73
|
+
`left condition notifyParent nextTick after emit, filterKey: ${y.value}, checkedValues: ${JSON.stringify(t.map(e, (n) => n.value))}`
|
|
74
74
|
);
|
|
75
75
|
});
|
|
76
76
|
}, ee = () => {
|
|
77
77
|
x("setNoNeedRefreshNumFilterName");
|
|
78
78
|
}, U = () => {
|
|
79
|
-
|
|
80
|
-
}, te = () => {
|
|
81
|
-
const e = u.get(r.value);
|
|
82
|
-
l.isEmpty(e) && !c.value || l.get(e, "value") === c.value || (U(), k());
|
|
79
|
+
B(), A({ label: r.value, selected: !0, value: f.value }), A({ label: i.value, selected: !0, value: d.value });
|
|
83
80
|
}, le = () => {
|
|
81
|
+
const e = u.get(r.value);
|
|
82
|
+
t.isEmpty(e) && !f.value || t.get(e, "value") === f.value || (U(), k());
|
|
83
|
+
}, te = () => {
|
|
84
84
|
const e = u.get(i.value);
|
|
85
|
-
|
|
85
|
+
t.isEmpty(e) && !d.value || t.get(e, "value") === d.value || (U(), k());
|
|
86
86
|
};
|
|
87
|
-
function
|
|
87
|
+
function A(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
|
-
}),
|
|
91
|
+
}), c.value = t.eq(N().length, g.value.length);
|
|
92
92
|
}
|
|
93
93
|
function P(e) {
|
|
94
|
-
return
|
|
94
|
+
return t.includes(w.value, e.value);
|
|
95
95
|
}
|
|
96
|
-
function
|
|
97
|
-
const e =
|
|
98
|
-
u.clear(),
|
|
99
|
-
|
|
100
|
-
}),
|
|
96
|
+
function B() {
|
|
97
|
+
const e = t.map(N(), (l) => l.value);
|
|
98
|
+
u.clear(), t.forEach(m.value, (l) => {
|
|
99
|
+
t.includes(e, l.getValue().value) && l.resetValue();
|
|
100
|
+
}), c.value = !1;
|
|
101
101
|
}
|
|
102
|
-
|
|
103
|
-
const e = l.
|
|
102
|
+
function ae() {
|
|
103
|
+
const e = t.map(N(), (l) => l.value);
|
|
104
|
+
u.clear(), t.forEach(m.value, (l) => {
|
|
105
|
+
t.includes(e, l.getValue().value) && l.resetValue();
|
|
106
|
+
}), c.value = !0;
|
|
107
|
+
}
|
|
108
|
+
const N = () => {
|
|
109
|
+
const e = t.filter(
|
|
104
110
|
Array.from(u.values()),
|
|
105
|
-
(
|
|
111
|
+
(l) => l.selected
|
|
106
112
|
);
|
|
107
|
-
return
|
|
108
|
-
const a = Array.from(u.keys()).find((o) => u.get(o) ===
|
|
113
|
+
return t.filter(e, (l) => {
|
|
114
|
+
const a = Array.from(u.keys()).find((o) => u.get(o) === l);
|
|
109
115
|
return ![r.value, i.value].includes(a);
|
|
110
116
|
});
|
|
111
|
-
},
|
|
112
|
-
const
|
|
113
|
-
return [r.value, i.value].includes(
|
|
114
|
-
}),
|
|
115
|
-
|
|
116
|
-
},
|
|
117
|
-
|
|
117
|
+
}, ue = () => t.filter(Array.from(u.values()), (e) => {
|
|
118
|
+
const l = Array.from(u.keys()).find((a) => u.get(a) === e);
|
|
119
|
+
return [r.value, i.value].includes(l);
|
|
120
|
+
}), ne = () => {
|
|
121
|
+
c.value = !1;
|
|
122
|
+
}, se = ce(() => t.sortBy(g.value, (e) => P(e))), D = () => {
|
|
123
|
+
f.value = void 0, d.value = void 0, u.delete(r.value), u.delete(i.value);
|
|
118
124
|
};
|
|
119
125
|
function I() {
|
|
120
|
-
|
|
121
|
-
console.log("selectList.value:",
|
|
122
|
-
const e =
|
|
126
|
+
B(), L(() => {
|
|
127
|
+
console.log("selectList.value:", g.value), c.value = !0;
|
|
128
|
+
const e = g.value.filter((a) => !P(a)), l = t.map(e, (a) => a.value);
|
|
123
129
|
x("filterChange", [
|
|
124
130
|
{
|
|
125
|
-
filterKey:
|
|
126
|
-
checkedValues: Q.value ? [] :
|
|
131
|
+
filterKey: y.value,
|
|
132
|
+
checkedValues: Q.value ? [] : l
|
|
127
133
|
}
|
|
128
134
|
]);
|
|
129
135
|
}), C.value && D();
|
|
130
136
|
}
|
|
131
|
-
return
|
|
137
|
+
return fe(
|
|
132
138
|
[() => R.value, () => _.value],
|
|
133
|
-
([e,
|
|
134
|
-
console.log(e,
|
|
139
|
+
([e, l], [a, o]) => {
|
|
140
|
+
console.log(e, l), console.log(a, o), (!$.value || !t.eq($.value, y.value)) && (E.value = R.value, T.value = _.value);
|
|
135
141
|
}
|
|
136
142
|
), Y({
|
|
137
143
|
clickAllSelected: I,
|
|
138
|
-
|
|
139
|
-
}),
|
|
140
|
-
if (!Array.isArray(
|
|
141
|
-
|
|
144
|
+
resetAllCheckedValueAndSelectAll: ae
|
|
145
|
+
}), de(() => {
|
|
146
|
+
if (!Array.isArray(h.value) || t.isEmpty(h.value)) {
|
|
147
|
+
c.value = !0;
|
|
142
148
|
return;
|
|
143
149
|
}
|
|
144
|
-
console.log("defaultValues.value",
|
|
145
|
-
|
|
150
|
+
console.log("defaultValues.value", h.value), console.log("itemRefs:", m.value), L(() => {
|
|
151
|
+
t.filter(m.value, (e) => e != null && e.getValue ? t.includes(h.value, e.getValue().value) : !1).forEach((e) => {
|
|
146
152
|
e.setCurrentValue(!0), e.setCheckboxValue(!0);
|
|
147
153
|
}), k();
|
|
148
154
|
});
|
|
149
|
-
}), (e,
|
|
155
|
+
}), (e, l) => {
|
|
150
156
|
const a = K("el-input-number"), o = K("el-form-item"), S = K("el-form");
|
|
151
|
-
return
|
|
157
|
+
return p(), V("div", ke, [
|
|
152
158
|
b(S, null, {
|
|
153
159
|
default: q(() => [
|
|
154
160
|
b(o, { label: s(X) }, {
|
|
155
161
|
default: q(() => [
|
|
156
|
-
s(Z) ? (
|
|
162
|
+
s(Z) ? (p(), V("span", {
|
|
157
163
|
key: 0,
|
|
158
164
|
class: "el-button custom-button el-button--small",
|
|
159
|
-
style:
|
|
165
|
+
style: ve(s(he).getBackgroundColor(c.value)),
|
|
160
166
|
onClick: I
|
|
161
|
-
}, F(
|
|
162
|
-
(
|
|
163
|
-
key:
|
|
167
|
+
}, F(E.value ? `${s(J)("全部")}(${E.value})` : s(J)("全部")), 5)) : z("", !0),
|
|
168
|
+
(p(!0), V(me, null, pe(se.value, (n, oe) => (p(), ge(ye, {
|
|
169
|
+
key: oe,
|
|
164
170
|
ref_for: !0,
|
|
165
171
|
ref_key: "itemRefs",
|
|
166
|
-
ref:
|
|
172
|
+
ref: m,
|
|
167
173
|
"all-is-checkbox": e.allIsCheckbox,
|
|
168
174
|
"multi-select-list": s(w),
|
|
169
175
|
"translate-user-id": s(W),
|
|
170
176
|
"count-list": T.value,
|
|
171
177
|
item: n,
|
|
172
178
|
"has-num": s(H),
|
|
173
|
-
onResetAllCheckedValue:
|
|
174
|
-
onSetSelectedStatusMap:
|
|
179
|
+
onResetAllCheckedValue: B,
|
|
180
|
+
onSetSelectedStatusMap: A,
|
|
175
181
|
onResetRange: D,
|
|
176
182
|
onSetNoNeedRefreshNumFilterName: ee,
|
|
177
183
|
onNotifyParent: k,
|
|
178
|
-
onResetIsSelectAll:
|
|
184
|
+
onResetIsSelectAll: ne
|
|
179
185
|
}, null, 8, ["all-is-checkbox", "multi-select-list", "translate-user-id", "count-list", "item", "has-num"]))), 128)),
|
|
180
|
-
s(C) ? (
|
|
186
|
+
s(C) ? (p(), V("div", Ne, [
|
|
181
187
|
M(F(e.rangeLabel) + " ", 1),
|
|
182
188
|
b(a, {
|
|
183
|
-
modelValue:
|
|
184
|
-
"onUpdate:modelValue":
|
|
189
|
+
modelValue: f.value,
|
|
190
|
+
"onUpdate:modelValue": l[0] || (l[0] = (n) => f.value = n),
|
|
185
191
|
style: { "margin-left": "2px", width: "60px", height: "22px" },
|
|
186
192
|
precision: 2,
|
|
187
193
|
step: 0.01,
|
|
188
194
|
min: 1,
|
|
189
195
|
max: 100,
|
|
190
196
|
controls: !1,
|
|
191
|
-
onBlur:
|
|
197
|
+
onBlur: le
|
|
192
198
|
}, null, 8, ["modelValue"]),
|
|
193
199
|
M(" % " + F(e.rangeDelimiter) + " ", 1),
|
|
194
200
|
b(a, {
|
|
195
|
-
modelValue:
|
|
196
|
-
"onUpdate:modelValue":
|
|
201
|
+
modelValue: d.value,
|
|
202
|
+
"onUpdate:modelValue": l[1] || (l[1] = (n) => d.value = n),
|
|
197
203
|
style: { width: "60px", height: "22px" },
|
|
198
204
|
precision: 2,
|
|
199
205
|
step: 0.01,
|
|
200
206
|
size: "small",
|
|
201
207
|
max: 100,
|
|
202
208
|
controls: !1,
|
|
203
|
-
onChange:
|
|
209
|
+
onChange: te
|
|
204
210
|
}, null, 8, ["modelValue"]),
|
|
205
|
-
|
|
211
|
+
l[2] || (l[2] = M(" % "))
|
|
206
212
|
])) : z("", !0)
|
|
207
213
|
]),
|
|
208
214
|
_: 1
|
|
@@ -215,5 +221,5 @@ const he = { class: "yahee-left-condition" }, ke = {
|
|
|
215
221
|
}
|
|
216
222
|
});
|
|
217
223
|
export {
|
|
218
|
-
|
|
224
|
+
_e as default
|
|
219
225
|
};
|
package/package.json
CHANGED
package/types/src/installs.d.ts
CHANGED
|
@@ -1455,7 +1455,7 @@ declare const _default: (( SFCWithInstall<DefineComponent<InputProps, {
|
|
|
1455
1455
|
showTotal?: boolean;
|
|
1456
1456
|
}, {
|
|
1457
1457
|
clickAllSelected: () => void;
|
|
1458
|
-
|
|
1458
|
+
resetAllCheckedValueAndSelectAll: () => void;
|
|
1459
1459
|
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
1460
1460
|
filterChange: (...args: any[]) => void;
|
|
1461
1461
|
setNoNeedRefreshNumFilterName: (...args: any[]) => void;
|
|
@@ -23,7 +23,7 @@ export declare const YaheeLeftCondition: SFCWithInstall<DefineComponent<{
|
|
|
23
23
|
showTotal?: boolean;
|
|
24
24
|
}, {
|
|
25
25
|
clickAllSelected: () => void;
|
|
26
|
-
|
|
26
|
+
resetAllCheckedValueAndSelectAll: () => void;
|
|
27
27
|
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
28
28
|
filterChange: (...args: any[]) => void;
|
|
29
29
|
setNoNeedRefreshNumFilterName: (...args: any[]) => void;
|
|
@@ -21,11 +21,11 @@ type __VLS_Props = {
|
|
|
21
21
|
defaultValues?: Array<string | number | boolean>;
|
|
22
22
|
showTotal?: boolean;
|
|
23
23
|
};
|
|
24
|
-
declare function
|
|
24
|
+
declare function resetAllCheckedValueAndSelectAll(): void;
|
|
25
25
|
declare function clickAllSelected(): void;
|
|
26
26
|
declare const _default: DefineComponent<__VLS_Props, {
|
|
27
27
|
clickAllSelected: typeof clickAllSelected;
|
|
28
|
-
|
|
28
|
+
resetAllCheckedValueAndSelectAll: typeof resetAllCheckedValueAndSelectAll;
|
|
29
29
|
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
30
30
|
filterChange: (...args: any[]) => void;
|
|
31
31
|
setNoNeedRefreshNumFilterName: (...args: any[]) => void;
|