yahee-components 0.0.59 → 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
|
|
5
|
-
import { M2 as
|
|
6
|
-
const
|
|
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
|
+
import { M2 as J } from "../utils/translate.js";
|
|
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: {
|
|
@@ -32,35 +32,35 @@ const he = { class: "yahee-left-condition" }, ke = {
|
|
|
32
32
|
showTotal: { type: Boolean, default: !0 }
|
|
33
33
|
},
|
|
34
34
|
emits: ["filterChange", "setNoNeedRefreshNumFilterName"],
|
|
35
|
-
setup(
|
|
36
|
-
const
|
|
35
|
+
setup(O, { expose: Y, emit: j }) {
|
|
36
|
+
const G = O, {
|
|
37
37
|
multiSelectList: w,
|
|
38
38
|
displayRangeInput: C,
|
|
39
|
-
selectList:
|
|
40
|
-
hasNum:
|
|
41
|
-
allIsEmpty:
|
|
42
|
-
translateUserId:
|
|
43
|
-
label:
|
|
44
|
-
filterKey:
|
|
39
|
+
selectList: g,
|
|
40
|
+
hasNum: H,
|
|
41
|
+
allIsEmpty: Q,
|
|
42
|
+
translateUserId: W,
|
|
43
|
+
label: X,
|
|
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
|
-
showTotal:
|
|
52
|
-
} =
|
|
53
|
-
console.log("left condition notifyParent start"),
|
|
51
|
+
showTotal: Z
|
|
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,119 +70,124 @@ 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
|
-
|
|
79
|
+
B(), A({ label: r.value, selected: !0, value: f.value }), A({ label: i.value, selected: !0, value: d.value });
|
|
80
80
|
}, le = () => {
|
|
81
81
|
const e = u.get(r.value);
|
|
82
|
-
|
|
83
|
-
},
|
|
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
|
+
}
|
|
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;
|
|
95
101
|
}
|
|
96
|
-
function
|
|
97
|
-
const e =
|
|
98
|
-
u.clear(),
|
|
99
|
-
|
|
100
|
-
}),
|
|
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;
|
|
101
107
|
}
|
|
102
|
-
const
|
|
103
|
-
const e =
|
|
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
|
-
}, ue = () =>
|
|
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:
|
|
131
|
+
filterKey: y.value,
|
|
132
|
+
checkedValues: Q.value ? [] : l
|
|
127
133
|
}
|
|
128
134
|
]);
|
|
129
|
-
}), C.value &&
|
|
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
|
-
|
|
141
|
-
|
|
142
|
-
d.value = !0;
|
|
144
|
+
resetAllCheckedValueAndSelectAll: ae
|
|
145
|
+
}), de(() => {
|
|
146
|
+
if (!Array.isArray(h.value) || t.isEmpty(h.value)) {
|
|
147
|
+
c.value = !0;
|
|
143
148
|
return;
|
|
144
149
|
}
|
|
145
|
-
console.log("defaultValues.value",
|
|
146
|
-
|
|
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) => {
|
|
147
152
|
e.setCurrentValue(!0), e.setCheckboxValue(!0);
|
|
148
153
|
}), k();
|
|
149
154
|
});
|
|
150
|
-
}), (e,
|
|
155
|
+
}), (e, l) => {
|
|
151
156
|
const a = K("el-input-number"), o = K("el-form-item"), S = K("el-form");
|
|
152
|
-
return
|
|
157
|
+
return p(), V("div", ke, [
|
|
153
158
|
b(S, null, {
|
|
154
|
-
default:
|
|
155
|
-
b(o, { label: s(
|
|
156
|
-
default:
|
|
157
|
-
s(
|
|
159
|
+
default: q(() => [
|
|
160
|
+
b(o, { label: s(X) }, {
|
|
161
|
+
default: q(() => [
|
|
162
|
+
s(Z) ? (p(), V("span", {
|
|
158
163
|
key: 0,
|
|
159
164
|
class: "el-button custom-button el-button--small",
|
|
160
|
-
style:
|
|
165
|
+
style: ve(s(he).getBackgroundColor(c.value)),
|
|
161
166
|
onClick: I
|
|
162
|
-
}, F(
|
|
163
|
-
(
|
|
164
|
-
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,
|
|
165
170
|
ref_for: !0,
|
|
166
171
|
ref_key: "itemRefs",
|
|
167
|
-
ref:
|
|
172
|
+
ref: m,
|
|
168
173
|
"all-is-checkbox": e.allIsCheckbox,
|
|
169
174
|
"multi-select-list": s(w),
|
|
170
|
-
"translate-user-id": s(
|
|
175
|
+
"translate-user-id": s(W),
|
|
171
176
|
"count-list": T.value,
|
|
172
177
|
item: n,
|
|
173
|
-
"has-num": s(
|
|
174
|
-
onResetAllCheckedValue:
|
|
175
|
-
onSetSelectedStatusMap:
|
|
176
|
-
onResetRange:
|
|
177
|
-
onSetNoNeedRefreshNumFilterName:
|
|
178
|
+
"has-num": s(H),
|
|
179
|
+
onResetAllCheckedValue: B,
|
|
180
|
+
onSetSelectedStatusMap: A,
|
|
181
|
+
onResetRange: D,
|
|
182
|
+
onSetNoNeedRefreshNumFilterName: ee,
|
|
178
183
|
onNotifyParent: k,
|
|
179
|
-
onResetIsSelectAll:
|
|
184
|
+
onResetIsSelectAll: ne
|
|
180
185
|
}, null, 8, ["all-is-checkbox", "multi-select-list", "translate-user-id", "count-list", "item", "has-num"]))), 128)),
|
|
181
|
-
s(C) ? (
|
|
186
|
+
s(C) ? (p(), V("div", Ne, [
|
|
182
187
|
M(F(e.rangeLabel) + " ", 1),
|
|
183
188
|
b(a, {
|
|
184
|
-
modelValue:
|
|
185
|
-
"onUpdate:modelValue":
|
|
189
|
+
modelValue: f.value,
|
|
190
|
+
"onUpdate:modelValue": l[0] || (l[0] = (n) => f.value = n),
|
|
186
191
|
style: { "margin-left": "2px", width: "60px", height: "22px" },
|
|
187
192
|
precision: 2,
|
|
188
193
|
step: 0.01,
|
|
@@ -193,18 +198,18 @@ const he = { class: "yahee-left-condition" }, ke = {
|
|
|
193
198
|
}, null, 8, ["modelValue"]),
|
|
194
199
|
M(" % " + F(e.rangeDelimiter) + " ", 1),
|
|
195
200
|
b(a, {
|
|
196
|
-
modelValue:
|
|
197
|
-
"onUpdate:modelValue":
|
|
201
|
+
modelValue: d.value,
|
|
202
|
+
"onUpdate:modelValue": l[1] || (l[1] = (n) => d.value = n),
|
|
198
203
|
style: { width: "60px", height: "22px" },
|
|
199
204
|
precision: 2,
|
|
200
205
|
step: 0.01,
|
|
201
206
|
size: "small",
|
|
202
207
|
max: 100,
|
|
203
208
|
controls: !1,
|
|
204
|
-
onChange:
|
|
209
|
+
onChange: te
|
|
205
210
|
}, null, 8, ["modelValue"]),
|
|
206
|
-
|
|
207
|
-
])) :
|
|
211
|
+
l[2] || (l[2] = M(" % "))
|
|
212
|
+
])) : z("", !0)
|
|
208
213
|
]),
|
|
209
214
|
_: 1
|
|
210
215
|
}, 8, ["label"])
|
|
@@ -216,5 +221,5 @@ const he = { class: "yahee-left-condition" }, ke = {
|
|
|
216
221
|
}
|
|
217
222
|
});
|
|
218
223
|
export {
|
|
219
|
-
|
|
224
|
+
_e as default
|
|
220
225
|
};
|
package/package.json
CHANGED
package/types/src/installs.d.ts
CHANGED
|
@@ -1455,8 +1455,7 @@ declare const _default: (( SFCWithInstall<DefineComponent<InputProps, {
|
|
|
1455
1455
|
showTotal?: boolean;
|
|
1456
1456
|
}, {
|
|
1457
1457
|
clickAllSelected: () => void;
|
|
1458
|
-
|
|
1459
|
-
resetIsSelectAll: () => void;
|
|
1458
|
+
resetAllCheckedValueAndSelectAll: () => void;
|
|
1460
1459
|
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
1461
1460
|
filterChange: (...args: any[]) => void;
|
|
1462
1461
|
setNoNeedRefreshNumFilterName: (...args: any[]) => void;
|
|
@@ -23,8 +23,7 @@ export declare const YaheeLeftCondition: SFCWithInstall<DefineComponent<{
|
|
|
23
23
|
showTotal?: boolean;
|
|
24
24
|
}, {
|
|
25
25
|
clickAllSelected: () => void;
|
|
26
|
-
|
|
27
|
-
resetIsSelectAll: () => void;
|
|
26
|
+
resetAllCheckedValueAndSelectAll: () => void;
|
|
28
27
|
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
29
28
|
filterChange: (...args: any[]) => void;
|
|
30
29
|
setNoNeedRefreshNumFilterName: (...args: any[]) => void;
|
|
@@ -21,12 +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
|
-
|
|
29
|
-
resetIsSelectAll: () => void;
|
|
28
|
+
resetAllCheckedValueAndSelectAll: typeof resetAllCheckedValueAndSelectAll;
|
|
30
29
|
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
31
30
|
filterChange: (...args: any[]) => void;
|
|
32
31
|
setNoNeedRefreshNumFilterName: (...args: any[]) => void;
|