yahee-components 0.0.14 → 0.0.15
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,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as oe, toRefs as re, ref as c, reactive as se, openBlock as s, createBlock as p, unref as e, withCtx as a, createElementVNode as C, createVNode as o, withKeys as ne, createElementBlock as _, Fragment as P, renderList as I, createCommentVNode as E, createTextVNode as g, toDisplayString as v } from "vue";
|
|
2
2
|
import y from "../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/lodash.js";
|
|
3
|
-
import { ElConfigProvider as
|
|
3
|
+
import { ElConfigProvider as ue, ElInput as K, ElSelect as U, ElOption as L, ElIcon as ie, ElCheckbox as ce, ElLink as de, ElDialog as pe, ElButton as N, ElForm as me, ElRow as b, 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,9 +18,9 @@ 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 { Search as
|
|
22
|
-
import
|
|
23
|
-
const
|
|
21
|
+
import { Search as he } from "@element-plus/icons-vue";
|
|
22
|
+
import fe 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 ve = { class: "yahee-comporehensive-search" }, ye = { class: "search-type-checkbox" }, Ce = { class: "dialog-footer" }, De = /* @__PURE__ */ oe({
|
|
24
24
|
name: "YaheeComprehensiveSearch",
|
|
25
25
|
__name: "comprehensive-search",
|
|
26
26
|
props: {
|
|
@@ -32,99 +32,102 @@ const fe = { class: "yahee-comporehensive-search" }, ve = { class: "search-type-
|
|
|
32
32
|
showPatchSearch: { type: Boolean, default: !1 },
|
|
33
33
|
showWithinFilterCheckbox: { type: Boolean, default: !1 },
|
|
34
34
|
specialOptions: { default: () => [] },
|
|
35
|
-
normalOptions: { default: () => [] }
|
|
35
|
+
normalOptions: { default: () => [] },
|
|
36
|
+
showSelect: { type: Boolean, default: !1 }
|
|
36
37
|
},
|
|
37
38
|
emits: ["filterChange"],
|
|
38
39
|
setup(W, { emit: z }) {
|
|
39
|
-
const D =
|
|
40
|
+
const D = fe, m = z, q = W, {
|
|
40
41
|
dealSearch: H,
|
|
41
42
|
defaultSearch: A,
|
|
42
|
-
pasteFormat:
|
|
43
|
-
options:
|
|
43
|
+
pasteFormat: w,
|
|
44
|
+
options: F,
|
|
44
45
|
showPatchSearch: J,
|
|
45
|
-
specialOptions:
|
|
46
|
+
specialOptions: x,
|
|
46
47
|
showWithinFilterCheckbox: X,
|
|
47
48
|
placeholderText: Y,
|
|
48
|
-
normalOptions:
|
|
49
|
-
|
|
49
|
+
normalOptions: $,
|
|
50
|
+
showSelect: j
|
|
51
|
+
} = re(q), S = c(A.value), d = c(""), h = c(!1), V = c(!1), f = c(!1), B = c(null), n = c({ searchType: "WHOLE_SEARCH", searchContent: "" }), r = se({}), G = {
|
|
50
52
|
selectedSearchType: [{ required: !0, message: "请输入查询类型", trigger: "blur" }],
|
|
51
53
|
searchContent: [{ required: !0, message: "请输入查询内容", trigger: "blur" }]
|
|
52
|
-
}, G = () => {
|
|
53
|
-
h.value = !0;
|
|
54
|
-
}, B = () => {
|
|
55
|
-
h.value = !1;
|
|
56
54
|
}, M = () => {
|
|
57
|
-
|
|
58
|
-
},
|
|
59
|
-
|
|
60
|
-
},
|
|
61
|
-
|
|
62
|
-
|
|
55
|
+
f.value = !0;
|
|
56
|
+
}, O = () => {
|
|
57
|
+
f.value = !1;
|
|
58
|
+
}, Q = () => {
|
|
59
|
+
h.value || (delete r.putSearch, m("filterChange", r));
|
|
60
|
+
}, Z = () => r, k = () => {
|
|
61
|
+
d.value ? le() : m("filterChange", Z());
|
|
62
|
+
}, ee = (u, l) => {
|
|
63
|
+
const t = { ...u };
|
|
64
|
+
return y.map(x.value, (i) => i.key).includes(l.filterKey) ? x.value.forEach((i) => delete t[i.key]) : delete t[l.filterKey], t;
|
|
63
65
|
};
|
|
64
|
-
function
|
|
65
|
-
console.log("displayFilter filterChange start",
|
|
66
|
-
|
|
67
|
-
const { checkedValues: t, filterKey:
|
|
68
|
-
y.isEmpty(t) || ($.value.includes(
|
|
69
|
-
}),
|
|
66
|
+
function T(u) {
|
|
67
|
+
console.log("displayFilter filterChange start", u, r), y.forEach(u, (l) => {
|
|
68
|
+
ee(r, l);
|
|
69
|
+
const { checkedValues: t, filterKey: i } = l;
|
|
70
|
+
y.isEmpty(t) || ($.value.includes(i) ? r[i] = t[0] : r[i] = t);
|
|
71
|
+
}), m("filterChange", r), console.log(`searchItem - ${JSON.stringify(r)}`), console.log("displayFilter filterChange end");
|
|
70
72
|
}
|
|
71
|
-
const
|
|
72
|
-
|
|
73
|
+
const le = () => {
|
|
74
|
+
h.value ? T([
|
|
73
75
|
{
|
|
74
76
|
filterKey: "simpleSearch",
|
|
75
77
|
checkedValues: d.value
|
|
76
78
|
}
|
|
77
|
-
]) :
|
|
79
|
+
]) : m("filterChange", {
|
|
78
80
|
simpleSearch: d.value
|
|
79
81
|
});
|
|
80
|
-
}, le = () => {
|
|
81
|
-
H.value(S.value, d.value);
|
|
82
82
|
}, te = () => {
|
|
83
|
-
|
|
84
|
-
|
|
83
|
+
H.value(S.value, d.value);
|
|
84
|
+
}, ae = () => {
|
|
85
|
+
B.value.validate((u) => {
|
|
86
|
+
u && (V.value = !0, h.value ? T([
|
|
85
87
|
{
|
|
86
88
|
filterKey: "putSearch",
|
|
87
|
-
checkedValues:
|
|
89
|
+
checkedValues: n.value.searchContent
|
|
88
90
|
}
|
|
89
|
-
]) :
|
|
90
|
-
putSearch:
|
|
91
|
-
}),
|
|
91
|
+
]) : m("filterChange", {
|
|
92
|
+
putSearch: n.value.searchContent
|
|
93
|
+
}), f.value = !1, V.value = !1);
|
|
92
94
|
});
|
|
93
95
|
};
|
|
94
|
-
return (
|
|
96
|
+
return (u, l) => (s(), p(e(ue), { locale: e(D) }, {
|
|
95
97
|
default: a(() => [
|
|
96
|
-
C("div",
|
|
97
|
-
o(
|
|
98
|
+
C("div", ve, [
|
|
99
|
+
o(e(K), {
|
|
98
100
|
modelValue: d.value,
|
|
99
|
-
"onUpdate:modelValue":
|
|
100
|
-
placeholder:
|
|
101
|
+
"onUpdate:modelValue": l[1] || (l[1] = (t) => d.value = t),
|
|
102
|
+
placeholder: e(Y),
|
|
101
103
|
class: "input-with-select",
|
|
102
104
|
clearable: "",
|
|
103
105
|
maxlength: "30",
|
|
104
106
|
onChange: k,
|
|
105
|
-
onKeyup:
|
|
106
|
-
onPaste:
|
|
107
|
-
onClear:
|
|
107
|
+
onKeyup: ne(k, ["enter"]),
|
|
108
|
+
onPaste: e(w),
|
|
109
|
+
onClear: te
|
|
108
110
|
}, {
|
|
109
111
|
prepend: a(() => [
|
|
110
|
-
|
|
112
|
+
e(j) ? (s(), p(e(U), {
|
|
113
|
+
key: 0,
|
|
111
114
|
modelValue: S.value,
|
|
112
|
-
"onUpdate:modelValue":
|
|
115
|
+
"onUpdate:modelValue": l[0] || (l[0] = (t) => S.value = t),
|
|
113
116
|
size: "small",
|
|
114
117
|
class: "custom-select"
|
|
115
118
|
}, {
|
|
116
119
|
default: a(() => [
|
|
117
|
-
(
|
|
120
|
+
(s(!0), _(P, null, I(e(F), (t) => (s(), p(e(L), {
|
|
118
121
|
key: t.label,
|
|
119
122
|
label: t.label,
|
|
120
123
|
value: t.value
|
|
121
124
|
}, null, 8, ["label", "value"]))), 128))
|
|
122
125
|
]),
|
|
123
126
|
_: 1
|
|
124
|
-
}, 8, ["modelValue"])
|
|
127
|
+
}, 8, ["modelValue"])) : E("", !0)
|
|
125
128
|
]),
|
|
126
129
|
append: a(() => [
|
|
127
|
-
o(
|
|
130
|
+
o(e(ie), {
|
|
128
131
|
size: "12",
|
|
129
132
|
color: "#3366cc",
|
|
130
133
|
style: { cursor: "pointer" },
|
|
@@ -132,60 +135,60 @@ const fe = { class: "yahee-comporehensive-search" }, ve = { class: "search-type-
|
|
|
132
135
|
onClick: k
|
|
133
136
|
}, {
|
|
134
137
|
default: a(() => [
|
|
135
|
-
o(
|
|
138
|
+
o(e(he))
|
|
136
139
|
]),
|
|
137
140
|
_: 1
|
|
138
141
|
})
|
|
139
142
|
]),
|
|
140
143
|
_: 1
|
|
141
144
|
}, 8, ["modelValue", "placeholder", "onPaste"]),
|
|
142
|
-
C("div",
|
|
143
|
-
|
|
145
|
+
C("div", ye, [
|
|
146
|
+
e(X) ? (s(), p(e(ce), {
|
|
144
147
|
key: 0,
|
|
145
|
-
modelValue:
|
|
146
|
-
"onUpdate:modelValue":
|
|
147
|
-
onChange:
|
|
148
|
+
modelValue: h.value,
|
|
149
|
+
"onUpdate:modelValue": l[2] || (l[2] = (t) => h.value = t),
|
|
150
|
+
onChange: Q
|
|
148
151
|
}, {
|
|
149
|
-
default: a(() =>
|
|
152
|
+
default: a(() => l[6] || (l[6] = [
|
|
150
153
|
g(v("在筛选条件内查询"))
|
|
151
154
|
])),
|
|
152
155
|
_: 1
|
|
153
|
-
}, 8, ["modelValue"])) :
|
|
154
|
-
|
|
156
|
+
}, 8, ["modelValue"])) : E("", !0),
|
|
157
|
+
e(J) ? (s(), p(e(de), {
|
|
155
158
|
key: 1,
|
|
156
159
|
type: "primary",
|
|
157
|
-
onClick:
|
|
160
|
+
onClick: M
|
|
158
161
|
}, {
|
|
159
|
-
default: a(() =>
|
|
162
|
+
default: a(() => l[7] || (l[7] = [
|
|
160
163
|
g(v("批量查询"))
|
|
161
164
|
])),
|
|
162
165
|
_: 1
|
|
163
|
-
})) :
|
|
166
|
+
})) : E("", !0)
|
|
164
167
|
])
|
|
165
168
|
]),
|
|
166
|
-
o(
|
|
167
|
-
modelValue:
|
|
168
|
-
"onUpdate:modelValue":
|
|
169
|
+
o(e(pe), {
|
|
170
|
+
modelValue: f.value,
|
|
171
|
+
"onUpdate:modelValue": l[5] || (l[5] = (t) => f.value = t),
|
|
169
172
|
title: "批量查询",
|
|
170
173
|
width: "30%",
|
|
171
|
-
"before-close":
|
|
174
|
+
"before-close": O,
|
|
172
175
|
"append-to-body": !0,
|
|
173
176
|
draggable: ""
|
|
174
177
|
}, {
|
|
175
178
|
footer: a(() => [
|
|
176
|
-
C("div",
|
|
177
|
-
o(
|
|
179
|
+
C("div", Ce, [
|
|
180
|
+
o(e(N), {
|
|
178
181
|
type: "primary",
|
|
179
182
|
loading: V.value,
|
|
180
|
-
onClick:
|
|
183
|
+
onClick: ae
|
|
181
184
|
}, {
|
|
182
|
-
default: a(() =>
|
|
185
|
+
default: a(() => l[9] || (l[9] = [
|
|
183
186
|
g(v("确认"))
|
|
184
187
|
])),
|
|
185
188
|
_: 1
|
|
186
189
|
}, 8, ["loading"]),
|
|
187
|
-
o(
|
|
188
|
-
default: a(() =>
|
|
190
|
+
o(e(N), { onClick: O }, {
|
|
191
|
+
default: a(() => l[10] || (l[10] = [
|
|
189
192
|
g(v("关闭"))
|
|
190
193
|
])),
|
|
191
194
|
_: 1
|
|
@@ -193,31 +196,31 @@ const fe = { class: "yahee-comporehensive-search" }, ve = { class: "search-type-
|
|
|
193
196
|
])
|
|
194
197
|
]),
|
|
195
198
|
default: a(() => [
|
|
196
|
-
o(
|
|
199
|
+
o(e(me), {
|
|
197
200
|
ref_key: "batchSearchFormRef",
|
|
198
|
-
ref:
|
|
199
|
-
model:
|
|
200
|
-
rules:
|
|
201
|
+
ref: B,
|
|
202
|
+
model: n.value,
|
|
203
|
+
rules: G
|
|
201
204
|
}, {
|
|
202
205
|
default: a(() => [
|
|
203
|
-
o(
|
|
204
|
-
default: a(() =>
|
|
206
|
+
o(e(b), { class: "row-class" }, {
|
|
207
|
+
default: a(() => l[8] || (l[8] = [
|
|
205
208
|
C("span", null, v("综合搜索"), -1)
|
|
206
209
|
])),
|
|
207
210
|
_: 1
|
|
208
211
|
}),
|
|
209
|
-
o(
|
|
212
|
+
o(e(b), { class: "row-class" }, {
|
|
210
213
|
default: a(() => [
|
|
211
|
-
o(
|
|
214
|
+
o(e(R), { prop: "searchType" }, {
|
|
212
215
|
default: a(() => [
|
|
213
|
-
o(
|
|
214
|
-
modelValue:
|
|
215
|
-
"onUpdate:modelValue":
|
|
216
|
+
o(e(U), {
|
|
217
|
+
modelValue: n.value.searchType,
|
|
218
|
+
"onUpdate:modelValue": l[3] || (l[3] = (t) => n.value.searchType = t),
|
|
216
219
|
size: "small",
|
|
217
220
|
class: "custom-select"
|
|
218
221
|
}, {
|
|
219
222
|
default: a(() => [
|
|
220
|
-
(
|
|
223
|
+
(s(!0), _(P, null, I(e(F), (t) => (s(), p(e(L), {
|
|
221
224
|
key: t.label,
|
|
222
225
|
label: t.label,
|
|
223
226
|
value: t.value
|
|
@@ -231,20 +234,20 @@ const fe = { class: "yahee-comporehensive-search" }, ve = { class: "search-type-
|
|
|
231
234
|
]),
|
|
232
235
|
_: 1
|
|
233
236
|
}),
|
|
234
|
-
o(
|
|
237
|
+
o(e(b), { class: "row-class" }, {
|
|
235
238
|
default: a(() => [
|
|
236
|
-
o(
|
|
239
|
+
o(e(R), {
|
|
237
240
|
prop: "searchContent",
|
|
238
241
|
style: { width: "100%" }
|
|
239
242
|
}, {
|
|
240
243
|
default: a(() => [
|
|
241
|
-
o(
|
|
242
|
-
modelValue:
|
|
243
|
-
"onUpdate:modelValue":
|
|
244
|
+
o(e(K), {
|
|
245
|
+
modelValue: n.value.searchContent,
|
|
246
|
+
"onUpdate:modelValue": l[4] || (l[4] = (t) => n.value.searchContent = t),
|
|
244
247
|
placeholder: "请输入批量查询内容,从EXCEL复制可自动替换为`,`",
|
|
245
248
|
type: "textarea",
|
|
246
249
|
rows: 5,
|
|
247
|
-
onPaste:
|
|
250
|
+
onPaste: e(w)
|
|
248
251
|
}, null, 8, ["modelValue", "onPaste"])
|
|
249
252
|
]),
|
|
250
253
|
_: 1
|
|
@@ -264,5 +267,5 @@ const fe = { class: "yahee-comporehensive-search" }, ve = { class: "search-type-
|
|
|
264
267
|
}
|
|
265
268
|
});
|
|
266
269
|
export {
|
|
267
|
-
|
|
270
|
+
De as default
|
|
268
271
|
};
|
package/package.json
CHANGED
|
@@ -14,6 +14,7 @@ declare const _default: DefineComponent<{
|
|
|
14
14
|
showWithinFilterCheckbox?: boolean;
|
|
15
15
|
specialOptions?: SearchDataOptions[];
|
|
16
16
|
normalOptions?: string[];
|
|
17
|
+
showSelect?: boolean;
|
|
17
18
|
}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
18
19
|
filterChange: (...args: any[]) => void;
|
|
19
20
|
}, string, PublicProps, Readonly<{
|
|
@@ -26,6 +27,7 @@ declare const _default: DefineComponent<{
|
|
|
26
27
|
showWithinFilterCheckbox?: boolean;
|
|
27
28
|
specialOptions?: SearchDataOptions[];
|
|
28
29
|
normalOptions?: string[];
|
|
30
|
+
showSelect?: boolean;
|
|
29
31
|
}> & Readonly<{
|
|
30
32
|
onFilterChange?: (...args: any[]) => any;
|
|
31
33
|
}>, {
|
|
@@ -38,5 +40,6 @@ declare const _default: DefineComponent<{
|
|
|
38
40
|
showWithinFilterCheckbox: boolean;
|
|
39
41
|
specialOptions: SearchDataOptions[];
|
|
40
42
|
normalOptions: string[];
|
|
43
|
+
showSelect: boolean;
|
|
41
44
|
}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
42
45
|
export default _default;
|