yahee-components 0.0.12 → 0.0.14
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/api/tool.js +10 -11
- package/es/comprehensive-search/comprehensive-search.vue.js +153 -122
- package/es/drop-down-condition/drop-down-condition.vue.js +42 -41
- package/es/left-condition/left-condition.vue.js +118 -116
- package/es/left-condition/style/index.css +2 -3
- package/es/left-condition-enum/left-condition-enum.vue.js +18 -14
- package/es/left-condition-enum/style/index.css +10 -0
- package/es/operation-log/operation-log-form.vue.js +179 -5
- package/es/operation-log/operation-log-form.vue2.js +2 -179
- package/es/operation-log/operation-log.vue.js +30 -30
- package/es/packages/components/api/server.js +26 -13
- package/es/packages/components/api/tool.js +9 -10
- package/es/style.css +12 -2
- package/lib/left-condition/style/index.css +2 -3
- package/lib/left-condition-enum/style/index.css +10 -0
- package/lib/style.css +12 -2
- package/package.json +1 -1
- package/types/src/comprehensive-search/comprehensive-search.vue.d.ts +19 -10
- package/types/src/drop-down-condition/drop-down-condition.vue.d.ts +2 -0
- package/types/src/drop-down-condition/index.d.ts +2 -0
- package/types/src/left-condition/index.d.ts +1 -1
- package/types/src/left-condition/left-condition.vue.d.ts +1 -1
- package/types/src/left-condition-enum/index.d.ts +10 -1
- package/types/src/left-condition-enum/left-condition-enum.vue.d.ts +10 -1
- package/es/_virtual/_plugin-vue_export-helper.js +0 -9
- package/types/src/comprehensive-search/index.d.ts +0 -36
- package/types/src/installs.d.ts +0 -535
package/es/api/tool.js
CHANGED
|
@@ -7,11 +7,10 @@ import "element-plus/theme-chalk/src/button.scss";
|
|
|
7
7
|
import "element-plus/theme-chalk/src/input.scss";
|
|
8
8
|
import "element-plus/theme-chalk/src/overlay.scss";
|
|
9
9
|
import { AxiosHeaders as l } from "../node_modules/.pnpm/axios@1.7.7/node_modules/axios/index.js";
|
|
10
|
-
const
|
|
10
|
+
const w = (e) => ({
|
|
11
11
|
...e,
|
|
12
|
-
baseURL: i,
|
|
13
12
|
timeout: 2e4
|
|
14
|
-
}),
|
|
13
|
+
}), N = (e) => {
|
|
15
14
|
const o = new l(e.headers);
|
|
16
15
|
return {
|
|
17
16
|
...e,
|
|
@@ -19,7 +18,7 @@ const i = "https://plmerp.yaheecloud.com/api/plm/product-dev/", N = (e) => ({
|
|
|
19
18
|
};
|
|
20
19
|
};
|
|
21
20
|
let t = !1;
|
|
22
|
-
const
|
|
21
|
+
const R = (e) => {
|
|
23
22
|
const o = {
|
|
24
23
|
400: "错误的请求",
|
|
25
24
|
// token 失效
|
|
@@ -48,7 +47,7 @@ const U = (e) => {
|
|
|
48
47
|
}
|
|
49
48
|
};
|
|
50
49
|
var a = /* @__PURE__ */ ((e) => (e[e.AuthInvalid = 10031] = "AuthInvalid", e[e.AuthTooLong = 10032] = "AuthTooLong", e[e.UserHasNoRole = 10033] = "UserHasNoRole", e[e.UserNotRegistered = 10034] = "UserNotRegistered", e[e.ThirdPlatformUser = 10035] = "ThirdPlatformUser", e[e.NoRelatedEmployee = 10036] = "NoRelatedEmployee", e[e.CountInvalid = 10037] = "CountInvalid", e[e.CountNotFound = 10038] = "CountNotFound", e))(a || {});
|
|
51
|
-
const
|
|
50
|
+
const U = (e) => e in {
|
|
52
51
|
10031: "登录失效,需要重新登录",
|
|
53
52
|
// token 失效
|
|
54
53
|
10032: "您太久没登录,请重新登录~",
|
|
@@ -59,11 +58,11 @@ const C = (e) => e in {
|
|
|
59
58
|
10036: "该账户未关联员工,请联系管理员做关联",
|
|
60
59
|
10037: "账号已无效",
|
|
61
60
|
10038: "账号未找到"
|
|
62
|
-
} ? (n.error(a[e]), !1) : !0,
|
|
61
|
+
} ? (n.error(a[e]), !1) : !0, C = (e, o) => e !== 0 && o !== "OK" ? (n.error(o), !1) : !0;
|
|
63
62
|
export {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
63
|
+
U as handleAuthError,
|
|
64
|
+
w as handleChangeRequestHeader,
|
|
65
|
+
N as handleConfigureAuth,
|
|
66
|
+
C as handleGeneralError,
|
|
67
|
+
R as handleNetworkError
|
|
69
68
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import { ElConfigProvider as
|
|
1
|
+
import { defineComponent as ae, toRefs as oe, ref as i, reactive as re, openBlock as c, createBlock as f, unref as l, withCtx as a, createElementVNode as C, createVNode as o, withKeys as se, createElementBlock as T, Fragment as _, renderList as P, createTextVNode as g, toDisplayString as v, createCommentVNode as I } from "vue";
|
|
2
|
+
import y from "../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/lodash.js";
|
|
3
|
+
import { ElConfigProvider as ne, ElInput as K, ElSelect as U, ElOption as L, ElIcon as ue, ElCheckbox as ie, ElLink as ce, ElDialog as de, ElButton as N, ElForm as pe, ElRow as E, ElFormItem as R } from "element-plus";
|
|
4
4
|
import "element-plus/theme-chalk/src/base.scss";
|
|
5
5
|
import "element-plus/theme-chalk/src/input.scss";
|
|
6
6
|
import "element-plus/theme-chalk/src/checkbox.scss";
|
|
@@ -18,178 +18,209 @@ import "element-plus/theme-chalk/src/row.scss";
|
|
|
18
18
|
import "element-plus/theme-chalk/src/button.scss";
|
|
19
19
|
import "element-plus/theme-chalk/src/link.scss";
|
|
20
20
|
import "element-plus/theme-chalk/src/config-provider.scss";
|
|
21
|
-
import "element-plus/
|
|
22
|
-
import "element-plus/
|
|
23
|
-
|
|
24
|
-
import ae from "../node_modules/.pnpm/element-plus@2.8.3_vue@3.5.12_typescript@5.6.2_/node_modules/element-plus/es/locale/lang/zh-cn.js";
|
|
25
|
-
const oe = { class: "yahee-comporehensive-search" }, te = {
|
|
26
|
-
key: 0,
|
|
27
|
-
class: "search-type-checkbox"
|
|
28
|
-
}, re = { class: "dialog-footer" }, Te = /* @__PURE__ */ Q({
|
|
21
|
+
import { Search as me } from "@element-plus/icons-vue";
|
|
22
|
+
import he from "../node_modules/.pnpm/element-plus@2.8.3_vue@3.5.12_typescript@5.6.2_/node_modules/element-plus/es/locale/lang/zh-cn.js";
|
|
23
|
+
const fe = { class: "yahee-comporehensive-search" }, ve = { class: "search-type-checkbox" }, ye = { class: "dialog-footer" }, ze = /* @__PURE__ */ ae({
|
|
29
24
|
name: "YaheeComprehensiveSearch",
|
|
30
25
|
__name: "comprehensive-search",
|
|
31
26
|
props: {
|
|
32
|
-
dealSearch: { type: Function, default:
|
|
33
|
-
|
|
34
|
-
pasteFormat: { type: Function, default: h.noop },
|
|
35
|
-
isInSearchChange: { type: Function, default: h.noop },
|
|
27
|
+
dealSearch: { type: Function, default: y.noop },
|
|
28
|
+
pasteFormat: { type: Function, default: y.noop },
|
|
36
29
|
defaultSearch: { default: "" },
|
|
37
30
|
options: { default: () => [] },
|
|
38
31
|
placeholderText: { default: "" },
|
|
39
32
|
showPatchSearch: { type: Boolean, default: !1 },
|
|
40
|
-
|
|
33
|
+
showWithinFilterCheckbox: { type: Boolean, default: !1 },
|
|
34
|
+
specialOptions: { default: () => [] },
|
|
35
|
+
normalOptions: { default: () => [] }
|
|
41
36
|
},
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
37
|
+
emits: ["filterChange"],
|
|
38
|
+
setup(W, { emit: z }) {
|
|
39
|
+
const D = he, p = z, q = W, {
|
|
40
|
+
dealSearch: H,
|
|
41
|
+
defaultSearch: A,
|
|
42
|
+
pasteFormat: b,
|
|
43
|
+
options: w,
|
|
44
|
+
showPatchSearch: J,
|
|
45
|
+
specialOptions: F,
|
|
46
|
+
showWithinFilterCheckbox: X,
|
|
47
|
+
placeholderText: Y,
|
|
48
|
+
normalOptions: $
|
|
49
|
+
} = oe(q), S = i(A.value), d = i(""), m = i(!1), V = i(!1), h = i(!1), x = i(null), s = i({ searchType: "WHOLE_SEARCH", searchContent: "" }), r = re({}), j = {
|
|
53
50
|
selectedSearchType: [{ required: !0, message: "请输入查询类型", trigger: "blur" }],
|
|
54
51
|
searchContent: [{ required: !0, message: "请输入查询内容", trigger: "blur" }]
|
|
52
|
+
}, G = () => {
|
|
53
|
+
h.value = !0;
|
|
54
|
+
}, B = () => {
|
|
55
|
+
h.value = !1;
|
|
56
|
+
}, M = () => {
|
|
57
|
+
m.value || (delete r.putSearch, p("filterChange", r));
|
|
58
|
+
}, Q = () => r, k = () => {
|
|
59
|
+
d.value ? ee() : p("filterChange", Q());
|
|
60
|
+
}, Z = (n, e) => {
|
|
61
|
+
const t = { ...n };
|
|
62
|
+
return y.map(F.value, (u) => u.key).includes(e.filterKey) ? F.value.forEach((u) => delete t[u.key]) : delete t[e.filterKey], t;
|
|
55
63
|
};
|
|
56
|
-
function O() {
|
|
57
|
-
|
|
64
|
+
function O(n) {
|
|
65
|
+
console.log("displayFilter filterChange start", n, r), y.forEach(n, (e) => {
|
|
66
|
+
Z(r, e);
|
|
67
|
+
const { checkedValues: t, filterKey: u } = e;
|
|
68
|
+
y.isEmpty(t) || ($.value.includes(u) ? r[u] = t[0] : r[u] = t);
|
|
69
|
+
}), p("filterChange", r), console.log(`searchItem - ${JSON.stringify(r)}`), console.log("displayFilter filterChange end");
|
|
58
70
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
},
|
|
69
|
-
|
|
71
|
+
const ee = () => {
|
|
72
|
+
m.value ? O([
|
|
73
|
+
{
|
|
74
|
+
filterKey: "simpleSearch",
|
|
75
|
+
checkedValues: d.value
|
|
76
|
+
}
|
|
77
|
+
]) : p("filterChange", {
|
|
78
|
+
simpleSearch: d.value
|
|
79
|
+
});
|
|
80
|
+
}, le = () => {
|
|
81
|
+
H.value(S.value, d.value);
|
|
82
|
+
}, te = () => {
|
|
83
|
+
x.value.validate((n) => {
|
|
84
|
+
n && (V.value = !0, m.value ? O([
|
|
85
|
+
{
|
|
86
|
+
filterKey: "putSearch",
|
|
87
|
+
checkedValues: s.value.searchContent
|
|
88
|
+
}
|
|
89
|
+
]) : p("filterChange", {
|
|
90
|
+
putSearch: s.value.searchContent
|
|
91
|
+
}), h.value = !1, V.value = !1);
|
|
92
|
+
});
|
|
70
93
|
};
|
|
71
|
-
return (
|
|
72
|
-
default:
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
modelValue:
|
|
76
|
-
"onUpdate:modelValue":
|
|
77
|
-
placeholder:
|
|
94
|
+
return (n, e) => (c(), f(l(ne), { locale: l(D) }, {
|
|
95
|
+
default: a(() => [
|
|
96
|
+
C("div", fe, [
|
|
97
|
+
o(l(K), {
|
|
98
|
+
modelValue: d.value,
|
|
99
|
+
"onUpdate:modelValue": e[1] || (e[1] = (t) => d.value = t),
|
|
100
|
+
placeholder: l(Y),
|
|
78
101
|
class: "input-with-select",
|
|
79
102
|
clearable: "",
|
|
80
103
|
maxlength: "30",
|
|
81
|
-
onChange:
|
|
82
|
-
onKeyup:
|
|
83
|
-
onPaste:
|
|
84
|
-
onClear:
|
|
104
|
+
onChange: k,
|
|
105
|
+
onKeyup: se(k, ["enter"]),
|
|
106
|
+
onPaste: l(b),
|
|
107
|
+
onClear: le
|
|
85
108
|
}, {
|
|
86
|
-
prepend:
|
|
87
|
-
|
|
88
|
-
modelValue:
|
|
89
|
-
"onUpdate:modelValue":
|
|
109
|
+
prepend: a(() => [
|
|
110
|
+
o(l(U), {
|
|
111
|
+
modelValue: S.value,
|
|
112
|
+
"onUpdate:modelValue": e[0] || (e[0] = (t) => S.value = t),
|
|
90
113
|
size: "small",
|
|
91
114
|
class: "custom-select"
|
|
92
115
|
}, {
|
|
93
|
-
default:
|
|
94
|
-
(
|
|
95
|
-
key:
|
|
96
|
-
label:
|
|
97
|
-
value:
|
|
116
|
+
default: a(() => [
|
|
117
|
+
(c(!0), T(_, null, P(l(w), (t) => (c(), f(l(L), {
|
|
118
|
+
key: t.label,
|
|
119
|
+
label: t.label,
|
|
120
|
+
value: t.value
|
|
98
121
|
}, null, 8, ["label", "value"]))), 128))
|
|
99
122
|
]),
|
|
100
123
|
_: 1
|
|
101
124
|
}, 8, ["modelValue"])
|
|
102
125
|
]),
|
|
103
|
-
append:
|
|
104
|
-
|
|
126
|
+
append: a(() => [
|
|
127
|
+
o(l(ue), {
|
|
105
128
|
size: "12",
|
|
106
129
|
color: "#3366cc",
|
|
107
130
|
style: { cursor: "pointer" },
|
|
108
131
|
class: "icon-cusor",
|
|
109
|
-
onClick:
|
|
132
|
+
onClick: k
|
|
110
133
|
}, {
|
|
111
|
-
default:
|
|
112
|
-
|
|
134
|
+
default: a(() => [
|
|
135
|
+
o(l(me))
|
|
113
136
|
]),
|
|
114
137
|
_: 1
|
|
115
138
|
})
|
|
116
139
|
]),
|
|
117
140
|
_: 1
|
|
118
141
|
}, 8, ["modelValue", "placeholder", "onPaste"]),
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
142
|
+
C("div", ve, [
|
|
143
|
+
l(X) ? (c(), f(l(ie), {
|
|
144
|
+
key: 0,
|
|
145
|
+
modelValue: m.value,
|
|
146
|
+
"onUpdate:modelValue": e[2] || (e[2] = (t) => m.value = t),
|
|
147
|
+
onChange: M
|
|
124
148
|
}, {
|
|
125
|
-
default:
|
|
126
|
-
|
|
149
|
+
default: a(() => e[6] || (e[6] = [
|
|
150
|
+
g(v("在筛选条件内查询"))
|
|
127
151
|
])),
|
|
128
152
|
_: 1
|
|
129
|
-
}, 8, ["modelValue"
|
|
130
|
-
|
|
131
|
-
key:
|
|
153
|
+
}, 8, ["modelValue"])) : I("", !0),
|
|
154
|
+
l(J) ? (c(), f(l(ce), {
|
|
155
|
+
key: 1,
|
|
132
156
|
type: "primary",
|
|
133
|
-
onClick:
|
|
157
|
+
onClick: G
|
|
134
158
|
}, {
|
|
135
|
-
default:
|
|
136
|
-
|
|
159
|
+
default: a(() => e[7] || (e[7] = [
|
|
160
|
+
g(v("批量查询"))
|
|
137
161
|
])),
|
|
138
162
|
_: 1
|
|
139
|
-
})) :
|
|
140
|
-
])
|
|
163
|
+
})) : I("", !0)
|
|
164
|
+
])
|
|
141
165
|
]),
|
|
142
|
-
|
|
143
|
-
modelValue:
|
|
144
|
-
"onUpdate:modelValue":
|
|
166
|
+
o(l(de), {
|
|
167
|
+
modelValue: h.value,
|
|
168
|
+
"onUpdate:modelValue": e[5] || (e[5] = (t) => h.value = t),
|
|
145
169
|
title: "批量查询",
|
|
146
170
|
width: "30%",
|
|
147
|
-
"before-close":
|
|
171
|
+
"before-close": B,
|
|
148
172
|
"append-to-body": !0,
|
|
149
173
|
draggable: ""
|
|
150
174
|
}, {
|
|
151
|
-
footer:
|
|
152
|
-
|
|
153
|
-
|
|
175
|
+
footer: a(() => [
|
|
176
|
+
C("div", ye, [
|
|
177
|
+
o(l(N), {
|
|
154
178
|
type: "primary",
|
|
155
|
-
loading:
|
|
156
|
-
onClick:
|
|
179
|
+
loading: V.value,
|
|
180
|
+
onClick: te
|
|
157
181
|
}, {
|
|
158
|
-
default:
|
|
159
|
-
|
|
182
|
+
default: a(() => e[9] || (e[9] = [
|
|
183
|
+
g(v("确认"))
|
|
160
184
|
])),
|
|
161
185
|
_: 1
|
|
162
|
-
}, 8, ["loading"
|
|
163
|
-
|
|
164
|
-
default:
|
|
165
|
-
|
|
186
|
+
}, 8, ["loading"]),
|
|
187
|
+
o(l(N), { onClick: B }, {
|
|
188
|
+
default: a(() => e[10] || (e[10] = [
|
|
189
|
+
g(v("关闭"))
|
|
166
190
|
])),
|
|
167
191
|
_: 1
|
|
168
192
|
})
|
|
169
193
|
])
|
|
170
194
|
]),
|
|
171
|
-
default:
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
195
|
+
default: a(() => [
|
|
196
|
+
o(l(pe), {
|
|
197
|
+
ref_key: "batchSearchFormRef",
|
|
198
|
+
ref: x,
|
|
199
|
+
model: s.value,
|
|
200
|
+
rules: j
|
|
176
201
|
}, {
|
|
177
|
-
default:
|
|
178
|
-
|
|
179
|
-
default:
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
202
|
+
default: a(() => [
|
|
203
|
+
o(l(E), { class: "row-class" }, {
|
|
204
|
+
default: a(() => e[8] || (e[8] = [
|
|
205
|
+
C("span", null, v("综合搜索"), -1)
|
|
206
|
+
])),
|
|
207
|
+
_: 1
|
|
208
|
+
}),
|
|
209
|
+
o(l(E), { class: "row-class" }, {
|
|
210
|
+
default: a(() => [
|
|
211
|
+
o(l(R), { prop: "searchType" }, {
|
|
212
|
+
default: a(() => [
|
|
213
|
+
o(l(U), {
|
|
214
|
+
modelValue: s.value.searchType,
|
|
215
|
+
"onUpdate:modelValue": e[3] || (e[3] = (t) => s.value.searchType = t),
|
|
185
216
|
size: "small",
|
|
186
217
|
class: "custom-select"
|
|
187
218
|
}, {
|
|
188
|
-
default:
|
|
189
|
-
(
|
|
190
|
-
key:
|
|
191
|
-
label:
|
|
192
|
-
value:
|
|
219
|
+
default: a(() => [
|
|
220
|
+
(c(!0), T(_, null, P(l(w), (t) => (c(), f(l(L), {
|
|
221
|
+
key: t.label,
|
|
222
|
+
label: t.label,
|
|
223
|
+
value: t.value
|
|
193
224
|
}, null, 8, ["label", "value"]))), 128))
|
|
194
225
|
]),
|
|
195
226
|
_: 1
|
|
@@ -200,20 +231,20 @@ const oe = { class: "yahee-comporehensive-search" }, te = {
|
|
|
200
231
|
]),
|
|
201
232
|
_: 1
|
|
202
233
|
}),
|
|
203
|
-
|
|
204
|
-
default:
|
|
205
|
-
|
|
234
|
+
o(l(E), { class: "row-class" }, {
|
|
235
|
+
default: a(() => [
|
|
236
|
+
o(l(R), {
|
|
206
237
|
prop: "searchContent",
|
|
207
238
|
style: { width: "100%" }
|
|
208
239
|
}, {
|
|
209
|
-
default:
|
|
210
|
-
|
|
211
|
-
modelValue:
|
|
212
|
-
"onUpdate:modelValue":
|
|
240
|
+
default: a(() => [
|
|
241
|
+
o(l(K), {
|
|
242
|
+
modelValue: s.value.searchContent,
|
|
243
|
+
"onUpdate:modelValue": e[4] || (e[4] = (t) => s.value.searchContent = t),
|
|
213
244
|
placeholder: "请输入批量查询内容,从EXCEL复制可自动替换为`,`",
|
|
214
245
|
type: "textarea",
|
|
215
246
|
rows: 5,
|
|
216
|
-
onPaste:
|
|
247
|
+
onPaste: l(b)
|
|
217
248
|
}, null, 8, ["modelValue", "onPaste"])
|
|
218
249
|
]),
|
|
219
250
|
_: 1
|
|
@@ -233,5 +264,5 @@ const oe = { class: "yahee-comporehensive-search" }, te = {
|
|
|
233
264
|
}
|
|
234
265
|
});
|
|
235
266
|
export {
|
|
236
|
-
|
|
267
|
+
ze as default
|
|
237
268
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { defineComponent as ae, ref as x, reactive as
|
|
1
|
+
import { defineComponent as ae, ref as x, reactive as V, toRefs as ce, watch as re, onMounted as ie, resolveComponent as w, openBlock as a, createElementBlock as v, createVNode as Y, normalizeStyle as j, withCtx as f, createTextVNode as y, toDisplayString as p, unref as r, createCommentVNode as S, createElementVNode as F, Fragment as _, renderList as K, createBlock as b } from "vue";
|
|
2
2
|
import s from "../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/lodash.js";
|
|
3
3
|
import { Get as de } from "../api/server.js";
|
|
4
4
|
import { stylesUtils as M } from "../utils/style.js";
|
|
5
5
|
import { storage as H } from "../utils/storage.js";
|
|
6
|
-
import { M2 as
|
|
7
|
-
const ve = { class: "yahee-drop-down-condition" }, fe = { key: 0 }, pe = { style: { display: "flex", "align-items": "center", outline: "none" } }, he = { key: 0 }, me = { style: { display: "flex", width: "auto", padding: "10px" } }, ge = ["onClick"], xe = { class: "scrollable-container" },
|
|
6
|
+
import { M2 as k } from "../utils/translate.js";
|
|
7
|
+
const ve = { class: "yahee-drop-down-condition" }, fe = { key: 0 }, pe = { style: { display: "flex", "align-items": "center", outline: "none" } }, he = { key: 0 }, me = { style: { display: "flex", width: "auto", padding: "10px" } }, ge = ["onClick"], xe = { class: "scrollable-container" }, be = { key: 0 }, Ve = /* @__PURE__ */ ae({
|
|
8
8
|
name: "YaheeDropDownCondition",
|
|
9
9
|
__name: "drop-down-condition",
|
|
10
10
|
props: {
|
|
@@ -14,19 +14,20 @@ const ve = { class: "yahee-drop-down-condition" }, fe = { key: 0 }, pe = { style
|
|
|
14
14
|
level2Count: {},
|
|
15
15
|
filterKey: {},
|
|
16
16
|
enumEntity: {},
|
|
17
|
+
baseUrl: {},
|
|
17
18
|
noNeedRefreshNumFilterName: {}
|
|
18
19
|
},
|
|
19
20
|
emits: ["filterChange", "setNoNeedRefreshNumFilterName"],
|
|
20
21
|
setup(J, { emit: Q }) {
|
|
21
|
-
const X = x(), o =
|
|
22
|
-
let O =
|
|
23
|
-
const i =
|
|
22
|
+
const X = x(), o = V({});
|
|
23
|
+
let O = V({});
|
|
24
|
+
const i = V({}), h = V({}), m = x(!0), C = J, T = Q, { filterKey: L, filterList: q, totalCount: N, level1Count: B, level2Count: U, noNeedRefreshNumFilterName: I } = ce(C), W = x(s.get(N, "value", 0)), A = x(s.get(B, "value", [])), R = x(s.get(U, "value", [])), d = x();
|
|
24
25
|
q.value && (d.value = [...q.value]);
|
|
25
26
|
function G(e) {
|
|
26
27
|
const { text: l, value: u } = e, n = o[l];
|
|
27
|
-
s.isNil(n) || s.isEmpty(n) ? o[l] = [u] : o[l] = [], h[l] = !h[l], h[l] ? (ne(l), i[l] = M.getBackgroundColor(!0), m.value = !1) : (se(l), i[e.text] = {}, m.value = !0), m.value =
|
|
28
|
+
s.isNil(n) || s.isEmpty(n) ? o[l] = [u] : o[l] = [], h[l] = !h[l], h[l] ? (ne(l), i[l] = M.getBackgroundColor(!0), m.value = !1) : (se(l), i[e.text] = {}, m.value = !0), m.value = $(), z();
|
|
28
29
|
}
|
|
29
|
-
function
|
|
30
|
+
function $() {
|
|
30
31
|
const e = d.value.filter((n) => !s.isEmpty(n.subs)).flatMap((n) => n.subs).length, l = d.value.filter((n) => s.isEmpty(n.subs)).length;
|
|
31
32
|
return Object.values(o).map((n) => n.length).reduce((n, g) => n + g, 0) === e + l || s.isEmpty(Object.values(o).flat());
|
|
32
33
|
}
|
|
@@ -35,12 +36,12 @@ const ve = { class: "yahee-drop-down-condition" }, fe = { key: 0 }, pe = { style
|
|
|
35
36
|
backgroundColor: "#0F7535",
|
|
36
37
|
color: "#fff",
|
|
37
38
|
borderColor: "#0F7535"
|
|
38
|
-
}, m.value =
|
|
39
|
+
}, m.value = $(), z();
|
|
39
40
|
}
|
|
40
41
|
function ee() {
|
|
41
|
-
m.value =
|
|
42
|
+
m.value = $(), z();
|
|
42
43
|
}
|
|
43
|
-
function
|
|
44
|
+
function z() {
|
|
44
45
|
T("setNoNeedRefreshNumFilterName", L.value);
|
|
45
46
|
}
|
|
46
47
|
function te() {
|
|
@@ -79,19 +80,19 @@ const ve = { class: "yahee-drop-down-condition" }, fe = { key: 0 }, pe = { style
|
|
|
79
80
|
o[e] = [];
|
|
80
81
|
}
|
|
81
82
|
return re(
|
|
82
|
-
[() =>
|
|
83
|
-
([e, l, u], [n, g,
|
|
84
|
-
console.log(e, l, u), console.log(n, g,
|
|
83
|
+
[() => N.value, () => B.value, () => U.value],
|
|
84
|
+
([e, l, u], [n, g, D]) => {
|
|
85
|
+
console.log(e, l, u), console.log(n, g, D), (!I.value || !s.eq(I.value, L.value)) && (W.value = N.value, A.value = B.value, R.value = U.value);
|
|
85
86
|
}
|
|
86
87
|
), ie(() => {
|
|
87
|
-
const e = `filter-key-${
|
|
88
|
-
l ? d.value = l : de(
|
|
88
|
+
const e = `filter-key-${C.enumEntity}`, l = H.getWithExpireTime(e);
|
|
89
|
+
l ? d.value = l : de(`${C.baseUrl}/${C.enumEntity}`).then((u) => {
|
|
89
90
|
d.value = u.data, H.setWithExpireTime(e, d.value, 1200 * 1e3);
|
|
90
91
|
}).catch((u) => {
|
|
91
92
|
console.log(u);
|
|
92
93
|
});
|
|
93
94
|
}), (e, l) => {
|
|
94
|
-
const u =
|
|
95
|
+
const u = w("el-button"), n = w("el-checkbox"), g = w("el-checkbox-group"), D = w("el-dropdown");
|
|
95
96
|
return a(), v("div", ve, [
|
|
96
97
|
Y(u, {
|
|
97
98
|
size: "small",
|
|
@@ -100,19 +101,19 @@ const ve = { class: "yahee-drop-down-condition" }, fe = { key: 0 }, pe = { style
|
|
|
100
101
|
onClick: te
|
|
101
102
|
}, {
|
|
102
103
|
default: f(() => [
|
|
103
|
-
|
|
104
|
-
r(
|
|
104
|
+
y(p(r(k)("全部")) + " ", 1),
|
|
105
|
+
r(N) ? (a(), v("span", fe, "(" + p(W.value) + ")", 1)) : S("", !0)
|
|
105
106
|
]),
|
|
106
107
|
_: 1
|
|
107
108
|
}, 8, ["style"]),
|
|
108
|
-
Y(
|
|
109
|
+
Y(D, {
|
|
109
110
|
ref_key: "dropdown1",
|
|
110
111
|
ref: X,
|
|
111
112
|
onVisibleChange: oe
|
|
112
113
|
}, {
|
|
113
114
|
dropdown: f(() => [
|
|
114
|
-
|
|
115
|
-
(a(!0), v(
|
|
115
|
+
F("div", me, [
|
|
116
|
+
(a(!0), v(_, null, K(d.value, (t) => (a(), b(g, {
|
|
116
117
|
key: t.value,
|
|
117
118
|
modelValue: o[t.text],
|
|
118
119
|
"onUpdate:modelValue": (c) => o[t.text] = c,
|
|
@@ -121,34 +122,34 @@ const ve = { class: "yahee-drop-down-condition" }, fe = { key: 0 }, pe = { style
|
|
|
121
122
|
onChange: (c) => Z(t)
|
|
122
123
|
}, {
|
|
123
124
|
default: f(() => [
|
|
124
|
-
r(s).isNil(t.subs) ? (a(),
|
|
125
|
+
r(s).isNil(t.subs) ? (a(), b(n, {
|
|
125
126
|
key: 1,
|
|
126
127
|
value: t.value,
|
|
127
128
|
class: "checkbox custom-button",
|
|
128
129
|
border: ""
|
|
129
130
|
}, {
|
|
130
131
|
default: f(() => [
|
|
131
|
-
|
|
132
|
+
y(p(r(k)(t.text)), 1)
|
|
132
133
|
]),
|
|
133
134
|
_: 2
|
|
134
|
-
}, 1032, ["value"])) : (a(), v(
|
|
135
|
-
|
|
135
|
+
}, 1032, ["value"])) : (a(), v(_, { key: 0 }, [
|
|
136
|
+
F("span", {
|
|
136
137
|
class: "el-button custom-button el-button--small inner-el-button",
|
|
137
138
|
style: j(i[t.text]),
|
|
138
139
|
onClick: (c) => G(t)
|
|
139
|
-
}, p(r(
|
|
140
|
-
|
|
141
|
-
(a(!0), v(
|
|
140
|
+
}, p(r(k)(t.text)), 13, ge),
|
|
141
|
+
F("div", xe, [
|
|
142
|
+
(a(!0), v(_, null, K(t.subs, (c) => (a(), b(n, {
|
|
142
143
|
key: c.value,
|
|
143
144
|
class: "checkbox custom-button",
|
|
144
145
|
value: c.value,
|
|
145
146
|
border: ""
|
|
146
147
|
}, {
|
|
147
148
|
default: f(() => {
|
|
148
|
-
var
|
|
149
|
+
var E;
|
|
149
150
|
return [
|
|
150
|
-
|
|
151
|
-
r(s).isEmpty(
|
|
151
|
+
y(p(r(k)(c.text)), 1),
|
|
152
|
+
r(s).isEmpty(R.value) ? S("", !0) : (a(), v("span", be, "(" + p((E = R.value.filter((ue) => ue.value == c.value)[0]) == null ? void 0 : E.count) + ")", 1))
|
|
152
153
|
];
|
|
153
154
|
}),
|
|
154
155
|
_: 2
|
|
@@ -161,9 +162,9 @@ const ve = { class: "yahee-drop-down-condition" }, fe = { key: 0 }, pe = { style
|
|
|
161
162
|
])
|
|
162
163
|
]),
|
|
163
164
|
default: f(() => [
|
|
164
|
-
|
|
165
|
-
(a(!0), v(
|
|
166
|
-
t.isCheckbox ? (a(),
|
|
165
|
+
F("div", pe, [
|
|
166
|
+
(a(!0), v(_, null, K(d.value, (t) => (a(), v(_, null, [
|
|
167
|
+
t.isCheckbox ? (a(), b(g, {
|
|
167
168
|
key: t.value,
|
|
168
169
|
modelValue: o[t.text],
|
|
169
170
|
"onUpdate:modelValue": (c) => o[t.text] = c,
|
|
@@ -172,20 +173,20 @@ const ve = { class: "yahee-drop-down-condition" }, fe = { key: 0 }, pe = { style
|
|
|
172
173
|
onChange: ee
|
|
173
174
|
}, {
|
|
174
175
|
default: f(() => [
|
|
175
|
-
t.isCheckbox ? (a(),
|
|
176
|
+
t.isCheckbox ? (a(), b(n, {
|
|
176
177
|
key: 0,
|
|
177
178
|
class: "custom-button",
|
|
178
179
|
value: t.value,
|
|
179
180
|
border: ""
|
|
180
181
|
}, {
|
|
181
182
|
default: f(() => [
|
|
182
|
-
|
|
183
|
+
y(p(r(k)(t.text)), 1)
|
|
183
184
|
]),
|
|
184
185
|
_: 2
|
|
185
|
-
}, 1032, ["value"])) :
|
|
186
|
+
}, 1032, ["value"])) : S("", !0)
|
|
186
187
|
]),
|
|
187
188
|
_: 2
|
|
188
|
-
}, 1032, ["modelValue", "onUpdate:modelValue"])) : (a(),
|
|
189
|
+
}, 1032, ["modelValue", "onUpdate:modelValue"])) : (a(), b(u, {
|
|
189
190
|
key: t.text,
|
|
190
191
|
style: j(i[t.text]),
|
|
191
192
|
class: "custom-button",
|
|
@@ -195,8 +196,8 @@ const ve = { class: "yahee-drop-down-condition" }, fe = { key: 0 }, pe = { style
|
|
|
195
196
|
default: f(() => {
|
|
196
197
|
var c;
|
|
197
198
|
return [
|
|
198
|
-
|
|
199
|
-
r(s).isEmpty(
|
|
199
|
+
y(p(r(k)(t.text)), 1),
|
|
200
|
+
r(s).isEmpty(A.value) ? S("", !0) : (a(), v("span", he, "(" + p((c = A.value.filter((E) => E.value == t.value)[0]) == null ? void 0 : c.count) + ")", 1))
|
|
200
201
|
];
|
|
201
202
|
}),
|
|
202
203
|
_: 2
|