yahee-components 0.0.62 → 0.0.63
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,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as ue, mergeDefaults as ne, toRefs as ce, ref as p, createBlock as d, openBlock as n, unref as a, withCtx as t, createElementVNode as x, createVNode as o, withKeys as ie, createSlots as pe, createElementBlock as y, Fragment as b, renderList as S, createCommentVNode as P, createTextVNode as C, toDisplayString as g } from "vue";
|
|
2
2
|
import T from "../_virtual/lodash.js";
|
|
3
|
-
import { defaultComplexSearchProps as
|
|
4
|
-
import { ElConfigProvider as
|
|
3
|
+
import { defaultComplexSearchProps as de } from "./props.js";
|
|
4
|
+
import { ElConfigProvider as me, ElInput as U, ElIcon as he, ElSelect as V, ElOption as k, ElCheckbox as fe, ElLink as ve, ElDialog as ye, ElForm as be, ElRow as L, ElFormItem as R, ElButton as z } from "element-plus";
|
|
5
5
|
import "element-plus/theme-chalk/src/base.scss";
|
|
6
6
|
import "element-plus/theme-chalk/src/input.scss";
|
|
7
7
|
import "element-plus/theme-chalk/src/checkbox.scss";
|
|
@@ -19,12 +19,12 @@ import "element-plus/theme-chalk/src/row.scss";
|
|
|
19
19
|
import "element-plus/theme-chalk/src/button.scss";
|
|
20
20
|
import "element-plus/theme-chalk/src/link.scss";
|
|
21
21
|
import "element-plus/theme-chalk/src/config-provider.scss";
|
|
22
|
-
import { Search as
|
|
22
|
+
import { Search as Se } from "@element-plus/icons-vue";
|
|
23
23
|
import Ce from "../node_modules/.pnpm/element-plus@2.9.7_vue@3.5.13_typescript@5.8.3_/node_modules/element-plus/es/locale/lang/zh-cn.js";
|
|
24
|
-
const
|
|
24
|
+
const ge = { class: "yahee-complex-search" }, Ve = { class: "search-type-checkbox" }, ke = { class: "dialog-footer" }, Ye = /* @__PURE__ */ ue({
|
|
25
25
|
name: "YaheeComplexSearch",
|
|
26
26
|
__name: "complex-search",
|
|
27
|
-
props: /* @__PURE__ */
|
|
27
|
+
props: /* @__PURE__ */ ne({
|
|
28
28
|
pasteFormat: { type: Function },
|
|
29
29
|
defaultSearch: {},
|
|
30
30
|
options: {},
|
|
@@ -34,58 +34,62 @@ const be = { class: "yahee-complex-search" }, ge = { class: "search-type-checkbo
|
|
|
34
34
|
specialOptions: {},
|
|
35
35
|
normalOptions: {},
|
|
36
36
|
showSelect: { type: Boolean },
|
|
37
|
-
searchItem: {}
|
|
38
|
-
|
|
37
|
+
searchItem: {},
|
|
38
|
+
isBatchSelectOptionsSameWithInput: { type: Boolean },
|
|
39
|
+
batchOptions: {}
|
|
40
|
+
}, de()),
|
|
39
41
|
emits: ["filterChangeGrandson"],
|
|
40
42
|
setup(G, { emit: H }) {
|
|
41
43
|
const N = Ce, h = H, A = G, {
|
|
42
44
|
defaultSearch: q,
|
|
43
|
-
options:
|
|
45
|
+
options: O,
|
|
44
46
|
showPatchSearch: X,
|
|
45
|
-
specialOptions:
|
|
47
|
+
specialOptions: F,
|
|
46
48
|
showWithinFilterCheckbox: Y,
|
|
47
49
|
placeholderText: j,
|
|
48
50
|
normalOptions: J,
|
|
49
51
|
showSelect: B,
|
|
50
|
-
searchItem: c
|
|
51
|
-
|
|
52
|
+
searchItem: c,
|
|
53
|
+
isBatchSelectOptionsSameWithInput: M,
|
|
54
|
+
batchOptions: Q
|
|
55
|
+
} = ce(A), u = p(q.value || "WHOLE_SEARCH"), m = p(""), f = p(!1), E = p(!1), v = p(!1), I = p(null), s = p({ searchType: "WHOLE_SEARCH", searchContent: "" }), Z = {
|
|
52
56
|
selectedSearchType: [{ required: !0, message: "请输入查询类型", trigger: "blur" }],
|
|
53
57
|
searchContent: [{ required: !0, message: "请输入查询内容", trigger: "blur" }]
|
|
54
|
-
},
|
|
58
|
+
}, _ = [
|
|
55
59
|
{
|
|
56
60
|
value: "WHOLE_SEARCH",
|
|
57
61
|
label: "综合搜索"
|
|
58
62
|
}
|
|
59
|
-
],
|
|
63
|
+
], $ = () => {
|
|
60
64
|
v.value = !0;
|
|
61
|
-
},
|
|
65
|
+
}, K = () => {
|
|
62
66
|
v.value = !1;
|
|
63
|
-
},
|
|
67
|
+
}, ee = () => {
|
|
64
68
|
f.value || (delete c.value.putSearch, h("filterChangeGrandson", c.value, u.value));
|
|
65
|
-
},
|
|
66
|
-
m.value ?
|
|
67
|
-
},
|
|
69
|
+
}, le = () => c.value, w = () => {
|
|
70
|
+
m.value ? re() : h("filterChangeGrandson", le(), u.value);
|
|
71
|
+
}, ae = (r, l) => {
|
|
68
72
|
const e = { ...r };
|
|
69
|
-
return T.map(
|
|
73
|
+
return T.map(F.value, (i) => i.key).includes(l.filterKey) ? F.value.forEach((i) => delete e[i.key]) : delete e[l.filterKey], e;
|
|
70
74
|
};
|
|
71
|
-
function
|
|
75
|
+
function W(r) {
|
|
72
76
|
T.forEach(r, (l) => {
|
|
73
|
-
|
|
77
|
+
ae(c.value, l);
|
|
74
78
|
const { checkedValues: e, filterKey: i } = l;
|
|
75
79
|
T.isEmpty(e) || (J.value.includes(i) ? c.value[i] = e[0] : c.value[i] = e);
|
|
76
80
|
}), h("filterChangeGrandson", c.value, u.value);
|
|
77
81
|
}
|
|
78
|
-
const
|
|
79
|
-
m.value =
|
|
80
|
-
},
|
|
81
|
-
s.value.searchContent =
|
|
82
|
-
},
|
|
82
|
+
const te = (r) => {
|
|
83
|
+
m.value = D(r) || "";
|
|
84
|
+
}, oe = (r) => {
|
|
85
|
+
s.value.searchContent = D(r) || "";
|
|
86
|
+
}, D = (r) => {
|
|
83
87
|
var e;
|
|
84
88
|
r.preventDefault();
|
|
85
89
|
const l = (e = r.clipboardData) == null ? void 0 : e.getData("text/plain");
|
|
86
90
|
return l == null ? void 0 : l.replace(/[\n\r\t]+/g, ",");
|
|
87
|
-
},
|
|
88
|
-
f.value ?
|
|
91
|
+
}, re = () => {
|
|
92
|
+
f.value ? W([
|
|
89
93
|
{
|
|
90
94
|
filterKey: "putSearch",
|
|
91
95
|
checkedValues: m.value
|
|
@@ -102,9 +106,9 @@ const be = { class: "yahee-complex-search" }, ge = { class: "search-type-checkbo
|
|
|
102
106
|
},
|
|
103
107
|
u.value
|
|
104
108
|
);
|
|
105
|
-
},
|
|
106
|
-
|
|
107
|
-
r && (E.value = !0, f.value ?
|
|
109
|
+
}, se = () => {
|
|
110
|
+
I.value.validate((r) => {
|
|
111
|
+
r && (E.value = !0, f.value ? W([
|
|
108
112
|
{
|
|
109
113
|
filterKey: "putSearch",
|
|
110
114
|
checkedValues: s.value.searchContent
|
|
@@ -123,10 +127,10 @@ const be = { class: "yahee-complex-search" }, ge = { class: "search-type-checkbo
|
|
|
123
127
|
), v.value = !1, E.value = !1);
|
|
124
128
|
});
|
|
125
129
|
};
|
|
126
|
-
return (r, l) => (n(),
|
|
130
|
+
return (r, l) => (n(), d(a(me), { locale: a(N) }, {
|
|
127
131
|
default: t(() => [
|
|
128
|
-
x("div",
|
|
129
|
-
o(a(
|
|
132
|
+
x("div", ge, [
|
|
133
|
+
o(a(U), {
|
|
130
134
|
modelValue: m.value,
|
|
131
135
|
"onUpdate:modelValue": l[2] || (l[2] = (e) => m.value = e),
|
|
132
136
|
placeholder: a(j),
|
|
@@ -134,11 +138,11 @@ const be = { class: "yahee-complex-search" }, ge = { class: "search-type-checkbo
|
|
|
134
138
|
clearable: "",
|
|
135
139
|
maxlength: "30",
|
|
136
140
|
onChange: w,
|
|
137
|
-
onKeyup:
|
|
138
|
-
onPaste:
|
|
139
|
-
},
|
|
141
|
+
onKeyup: ie(w, ["enter"]),
|
|
142
|
+
onPaste: te
|
|
143
|
+
}, pe({
|
|
140
144
|
append: t(() => [
|
|
141
|
-
o(a(
|
|
145
|
+
o(a(he), {
|
|
142
146
|
size: "12",
|
|
143
147
|
color: "#3366cc",
|
|
144
148
|
style: { cursor: "pointer" },
|
|
@@ -146,7 +150,7 @@ const be = { class: "yahee-complex-search" }, ge = { class: "search-type-checkbo
|
|
|
146
150
|
onClick: w
|
|
147
151
|
}, {
|
|
148
152
|
default: t(() => [
|
|
149
|
-
o(a(
|
|
153
|
+
o(a(Se))
|
|
150
154
|
]),
|
|
151
155
|
_: 1
|
|
152
156
|
})
|
|
@@ -163,7 +167,7 @@ const be = { class: "yahee-complex-search" }, ge = { class: "search-type-checkbo
|
|
|
163
167
|
class: "custom-select"
|
|
164
168
|
}, {
|
|
165
169
|
default: t(() => [
|
|
166
|
-
(n(!0), y(
|
|
170
|
+
(n(!0), y(b, null, S(a(O), (e) => (n(), d(a(k), {
|
|
167
171
|
key: e.label,
|
|
168
172
|
label: e.label,
|
|
169
173
|
value: e.value
|
|
@@ -184,7 +188,7 @@ const be = { class: "yahee-complex-search" }, ge = { class: "search-type-checkbo
|
|
|
184
188
|
disabled: ""
|
|
185
189
|
}, {
|
|
186
190
|
default: t(() => [
|
|
187
|
-
(n(), y(
|
|
191
|
+
(n(), y(b, null, S(_, (e) => o(a(k), {
|
|
188
192
|
key: e.label,
|
|
189
193
|
label: e.label,
|
|
190
194
|
value: e.value
|
|
@@ -196,72 +200,72 @@ const be = { class: "yahee-complex-search" }, ge = { class: "search-type-checkbo
|
|
|
196
200
|
key: "1"
|
|
197
201
|
}
|
|
198
202
|
]), 1032, ["modelValue", "placeholder"]),
|
|
199
|
-
x("div",
|
|
200
|
-
a(Y) ? (n(),
|
|
203
|
+
x("div", Ve, [
|
|
204
|
+
a(Y) ? (n(), d(a(fe), {
|
|
201
205
|
key: 0,
|
|
202
206
|
modelValue: f.value,
|
|
203
207
|
"onUpdate:modelValue": l[3] || (l[3] = (e) => f.value = e),
|
|
204
|
-
onChange:
|
|
208
|
+
onChange: ee
|
|
205
209
|
}, {
|
|
206
210
|
default: t(() => l[8] || (l[8] = [
|
|
207
|
-
g(
|
|
211
|
+
C(g("在筛选条件内查询"))
|
|
208
212
|
])),
|
|
209
213
|
_: 1
|
|
210
|
-
}, 8, ["modelValue"])) :
|
|
211
|
-
a(X) ? (n(),
|
|
214
|
+
}, 8, ["modelValue"])) : P("", !0),
|
|
215
|
+
a(X) ? (n(), d(a(ve), {
|
|
212
216
|
key: 1,
|
|
213
217
|
type: "primary",
|
|
214
|
-
onClick:
|
|
218
|
+
onClick: $
|
|
215
219
|
}, {
|
|
216
220
|
default: t(() => l[9] || (l[9] = [
|
|
217
|
-
g(
|
|
221
|
+
C(g("批量查询"))
|
|
218
222
|
])),
|
|
219
223
|
_: 1
|
|
220
|
-
})) :
|
|
224
|
+
})) : P("", !0)
|
|
221
225
|
])
|
|
222
226
|
]),
|
|
223
|
-
o(a(
|
|
227
|
+
o(a(ye), {
|
|
224
228
|
modelValue: v.value,
|
|
225
229
|
"onUpdate:modelValue": l[7] || (l[7] = (e) => v.value = e),
|
|
226
230
|
title: "批量查询",
|
|
227
231
|
width: "30%",
|
|
228
|
-
"before-close":
|
|
232
|
+
"before-close": K,
|
|
229
233
|
"append-to-body": !0,
|
|
230
234
|
draggable: ""
|
|
231
235
|
}, {
|
|
232
236
|
footer: t(() => [
|
|
233
|
-
x("div",
|
|
237
|
+
x("div", ke, [
|
|
234
238
|
o(a(z), {
|
|
235
239
|
type: "primary",
|
|
236
240
|
loading: E.value,
|
|
237
|
-
onClick:
|
|
241
|
+
onClick: se
|
|
238
242
|
}, {
|
|
239
243
|
default: t(() => l[10] || (l[10] = [
|
|
240
|
-
g(
|
|
244
|
+
C(g("确认"))
|
|
241
245
|
])),
|
|
242
246
|
_: 1
|
|
243
247
|
}, 8, ["loading"]),
|
|
244
|
-
o(a(z), { onClick:
|
|
248
|
+
o(a(z), { onClick: K }, {
|
|
245
249
|
default: t(() => l[11] || (l[11] = [
|
|
246
|
-
g(
|
|
250
|
+
C(g("关闭"))
|
|
247
251
|
])),
|
|
248
252
|
_: 1
|
|
249
253
|
})
|
|
250
254
|
])
|
|
251
255
|
]),
|
|
252
256
|
default: t(() => [
|
|
253
|
-
o(a(
|
|
257
|
+
o(a(be), {
|
|
254
258
|
ref_key: "batchSearchFormRef",
|
|
255
|
-
ref:
|
|
259
|
+
ref: I,
|
|
256
260
|
model: s.value,
|
|
257
|
-
rules:
|
|
261
|
+
rules: Z
|
|
258
262
|
}, {
|
|
259
263
|
default: t(() => [
|
|
260
|
-
o(a(
|
|
264
|
+
o(a(L), { class: "row-class" }, {
|
|
261
265
|
default: t(() => [
|
|
262
|
-
o(a(
|
|
266
|
+
o(a(R), { prop: "searchType" }, {
|
|
263
267
|
default: t(() => [
|
|
264
|
-
a(B) ? (n(),
|
|
268
|
+
a(B) ? (n(), d(a(V), {
|
|
265
269
|
key: 0,
|
|
266
270
|
modelValue: s.value.searchType,
|
|
267
271
|
"onUpdate:modelValue": l[4] || (l[4] = (e) => s.value.searchType = e),
|
|
@@ -269,14 +273,14 @@ const be = { class: "yahee-complex-search" }, ge = { class: "search-type-checkbo
|
|
|
269
273
|
style: { width: "100px", "background-color": "white" }
|
|
270
274
|
}, {
|
|
271
275
|
default: t(() => [
|
|
272
|
-
(n(!0), y(
|
|
276
|
+
(n(!0), y(b, null, S(a(M) ? a(O) : a(Q), (e) => (n(), d(a(k), {
|
|
273
277
|
key: e.label,
|
|
274
278
|
label: e.label,
|
|
275
279
|
value: e.value
|
|
276
280
|
}, null, 8, ["label", "value"]))), 128))
|
|
277
281
|
]),
|
|
278
282
|
_: 1
|
|
279
|
-
}, 8, ["modelValue"])) : (n(),
|
|
283
|
+
}, 8, ["modelValue"])) : (n(), d(a(V), {
|
|
280
284
|
key: 1,
|
|
281
285
|
modelValue: s.value.searchType,
|
|
282
286
|
"onUpdate:modelValue": l[5] || (l[5] = (e) => s.value.searchType = e),
|
|
@@ -285,7 +289,7 @@ const be = { class: "yahee-complex-search" }, ge = { class: "search-type-checkbo
|
|
|
285
289
|
disabled: ""
|
|
286
290
|
}, {
|
|
287
291
|
default: t(() => [
|
|
288
|
-
(n(), y(
|
|
292
|
+
(n(), y(b, null, S(_, (e) => o(a(k), {
|
|
289
293
|
key: e.label,
|
|
290
294
|
label: e.label,
|
|
291
295
|
value: e.value
|
|
@@ -299,20 +303,20 @@ const be = { class: "yahee-complex-search" }, ge = { class: "search-type-checkbo
|
|
|
299
303
|
]),
|
|
300
304
|
_: 1
|
|
301
305
|
}),
|
|
302
|
-
o(a(
|
|
306
|
+
o(a(L), { class: "row-class" }, {
|
|
303
307
|
default: t(() => [
|
|
304
|
-
o(a(
|
|
308
|
+
o(a(R), {
|
|
305
309
|
prop: "searchContent",
|
|
306
310
|
style: { width: "100%" }
|
|
307
311
|
}, {
|
|
308
312
|
default: t(() => [
|
|
309
|
-
o(a(
|
|
313
|
+
o(a(U), {
|
|
310
314
|
modelValue: s.value.searchContent,
|
|
311
315
|
"onUpdate:modelValue": l[6] || (l[6] = (e) => s.value.searchContent = e),
|
|
312
316
|
placeholder: "请输入批量查询内容,从EXCEL复制可自动替换为`,`",
|
|
313
317
|
type: "textarea",
|
|
314
318
|
rows: 5,
|
|
315
|
-
onPaste:
|
|
319
|
+
onPaste: oe
|
|
316
320
|
}, null, 8, ["modelValue"])
|
|
317
321
|
]),
|
|
318
322
|
_: 1
|
|
@@ -332,5 +336,5 @@ const be = { class: "yahee-complex-search" }, ge = { class: "search-type-checkbo
|
|
|
332
336
|
}
|
|
333
337
|
});
|
|
334
338
|
export {
|
|
335
|
-
|
|
339
|
+
Ye as default
|
|
336
340
|
};
|
package/package.json
CHANGED
|
@@ -50,6 +50,8 @@ export interface ComplexSearchProps {
|
|
|
50
50
|
* default: {}
|
|
51
51
|
*/
|
|
52
52
|
searchItem?: SearchItem;
|
|
53
|
+
isBatchSelectOptionsSameWithInput?: boolean;
|
|
54
|
+
batchOptions?: SearchOptions[];
|
|
53
55
|
}
|
|
54
56
|
export declare function defaultComplexSearchProps(): {
|
|
55
57
|
defaultSearch: string;
|