yahee-components 0.0.51 → 0.0.52
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/complex-search/complex-search.vue.js +100 -100
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as te, mergeDefaults as oe, toRefs as re, ref as i, createBlock as d, openBlock as u, unref as l, withCtx as t, createElementVNode as x, createVNode as o, withKeys as se, createSlots as ue, createElementBlock as y, Fragment as C, renderList as b, createCommentVNode as L, createTextVNode as S, toDisplayString as V } from "vue";
|
|
2
2
|
import T from "../_virtual/lodash.js";
|
|
3
|
-
import { defaultComplexSearchProps as
|
|
4
|
-
import { ElConfigProvider as
|
|
3
|
+
import { defaultComplexSearchProps as ne } from "./props.js";
|
|
4
|
+
import { ElConfigProvider as ce, ElInput as R, ElIcon as ie, ElSelect as k, ElOption as g, ElCheckbox as de, ElLink as pe, ElDialog as me, ElForm as he, ElRow as W, ElFormItem as z, ElButton as G } 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
|
|
23
|
-
import
|
|
24
|
-
const
|
|
22
|
+
import { Search as fe } from "@element-plus/icons-vue";
|
|
23
|
+
import ve 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 ye = { class: "yahee-complex-search" }, Ce = { class: "search-type-checkbox" }, be = { class: "dialog-footer" }, Ne = /* @__PURE__ */ te({
|
|
25
25
|
name: "YaheeComplexSearch",
|
|
26
26
|
__name: "complex-search",
|
|
27
|
-
props: /* @__PURE__ */
|
|
27
|
+
props: /* @__PURE__ */ oe({
|
|
28
28
|
pasteFormat: { type: Function },
|
|
29
29
|
defaultSearch: {},
|
|
30
30
|
options: {},
|
|
@@ -35,102 +35,102 @@ const be = { class: "yahee-complex-search" }, ge = { class: "search-type-checkbo
|
|
|
35
35
|
normalOptions: {},
|
|
36
36
|
showSelect: { type: Boolean },
|
|
37
37
|
searchItem: {}
|
|
38
|
-
},
|
|
38
|
+
}, ne()),
|
|
39
39
|
emits: ["filterChangeGrandson"],
|
|
40
|
-
setup(
|
|
41
|
-
const
|
|
42
|
-
defaultSearch:
|
|
40
|
+
setup(H, { emit: D }) {
|
|
41
|
+
const N = ve, m = D, A = H, {
|
|
42
|
+
defaultSearch: q,
|
|
43
43
|
pasteFormat: F,
|
|
44
|
-
options:
|
|
45
|
-
showPatchSearch:
|
|
46
|
-
specialOptions:
|
|
47
|
-
showWithinFilterCheckbox:
|
|
48
|
-
placeholderText:
|
|
49
|
-
normalOptions:
|
|
50
|
-
showSelect:
|
|
51
|
-
searchItem:
|
|
52
|
-
} =
|
|
44
|
+
options: O,
|
|
45
|
+
showPatchSearch: X,
|
|
46
|
+
specialOptions: B,
|
|
47
|
+
showWithinFilterCheckbox: Y,
|
|
48
|
+
placeholderText: j,
|
|
49
|
+
normalOptions: J,
|
|
50
|
+
showSelect: P,
|
|
51
|
+
searchItem: n
|
|
52
|
+
} = re(A), r = i(q.value || "WHOLE_SEARCH"), h = i(""), f = i(!1), E = i(!1), v = i(!1), _ = i(null), s = i({ searchType: "WHOLE_SEARCH", searchContent: "" }), M = {
|
|
53
53
|
selectedSearchType: [{ required: !0, message: "请输入查询类型", trigger: "blur" }],
|
|
54
54
|
searchContent: [{ required: !0, message: "请输入查询内容", trigger: "blur" }]
|
|
55
|
-
},
|
|
55
|
+
}, K = [
|
|
56
56
|
{
|
|
57
|
-
value: "
|
|
57
|
+
value: "WHOLE_SEARCH",
|
|
58
58
|
label: "综合搜索"
|
|
59
59
|
}
|
|
60
|
-
],
|
|
60
|
+
], Q = () => {
|
|
61
61
|
v.value = !0;
|
|
62
|
-
},
|
|
62
|
+
}, U = () => {
|
|
63
63
|
v.value = !1;
|
|
64
|
-
},
|
|
65
|
-
f.value || (delete
|
|
66
|
-
},
|
|
67
|
-
h.value ?
|
|
68
|
-
},
|
|
64
|
+
}, Z = () => {
|
|
65
|
+
f.value || (delete n.value.putSearch, m("filterChangeGrandson", n.value, r.value));
|
|
66
|
+
}, $ = () => n.value, w = () => {
|
|
67
|
+
h.value ? le() : m("filterChangeGrandson", $(), r.value);
|
|
68
|
+
}, ee = (p, a) => {
|
|
69
69
|
const e = { ...p };
|
|
70
|
-
return T.map(
|
|
70
|
+
return T.map(B.value, (c) => c.key).includes(a.filterKey) ? B.value.forEach((c) => delete e[c.key]) : delete e[a.filterKey], e;
|
|
71
71
|
};
|
|
72
|
-
function
|
|
72
|
+
function I(p) {
|
|
73
73
|
T.forEach(p, (a) => {
|
|
74
|
-
|
|
75
|
-
const { checkedValues: e, filterKey:
|
|
76
|
-
T.isEmpty(e) || (
|
|
77
|
-
}), m("filterChangeGrandson",
|
|
74
|
+
ee(n.value, a);
|
|
75
|
+
const { checkedValues: e, filterKey: c } = a;
|
|
76
|
+
T.isEmpty(e) || (J.value.includes(c) ? n.value[c] = e[0] : n.value[c] = e);
|
|
77
|
+
}), m("filterChangeGrandson", n.value, r.value);
|
|
78
78
|
}
|
|
79
|
-
const
|
|
80
|
-
f.value ?
|
|
79
|
+
const le = () => {
|
|
80
|
+
f.value ? I([
|
|
81
81
|
{
|
|
82
82
|
filterKey: "putSearch",
|
|
83
83
|
checkedValues: h.value
|
|
84
84
|
},
|
|
85
85
|
{
|
|
86
86
|
filterKey: "searchType",
|
|
87
|
-
checkedValues:
|
|
87
|
+
checkedValues: r.value
|
|
88
88
|
}
|
|
89
89
|
]) : m(
|
|
90
90
|
"filterChangeGrandson",
|
|
91
91
|
{
|
|
92
92
|
putSearch: h.value,
|
|
93
|
-
searchType:
|
|
93
|
+
searchType: r.value
|
|
94
94
|
},
|
|
95
|
-
|
|
95
|
+
r.value
|
|
96
96
|
);
|
|
97
|
-
},
|
|
98
|
-
|
|
99
|
-
p && (E.value = !0, f.value ?
|
|
97
|
+
}, ae = () => {
|
|
98
|
+
_.value.validate((p) => {
|
|
99
|
+
p && (E.value = !0, f.value ? I([
|
|
100
100
|
{
|
|
101
101
|
filterKey: "putSearch",
|
|
102
|
-
checkedValues:
|
|
102
|
+
checkedValues: s.value.searchContent
|
|
103
103
|
},
|
|
104
104
|
{
|
|
105
105
|
filterKey: "searchType",
|
|
106
|
-
checkedValues:
|
|
106
|
+
checkedValues: s.value.searchType
|
|
107
107
|
}
|
|
108
108
|
]) : m(
|
|
109
109
|
"filterChangeGrandson",
|
|
110
110
|
{
|
|
111
|
-
putSearch:
|
|
112
|
-
searchType:
|
|
111
|
+
putSearch: s.value.searchContent,
|
|
112
|
+
searchType: s.value.searchType
|
|
113
113
|
},
|
|
114
|
-
|
|
114
|
+
r.value
|
|
115
115
|
), v.value = !1, E.value = !1);
|
|
116
116
|
});
|
|
117
117
|
};
|
|
118
|
-
return (p, a) => (
|
|
118
|
+
return (p, a) => (u(), d(l(ce), { locale: l(N) }, {
|
|
119
119
|
default: t(() => [
|
|
120
|
-
x("div",
|
|
121
|
-
o(l(
|
|
120
|
+
x("div", ye, [
|
|
121
|
+
o(l(R), {
|
|
122
122
|
modelValue: h.value,
|
|
123
123
|
"onUpdate:modelValue": a[2] || (a[2] = (e) => h.value = e),
|
|
124
|
-
placeholder: l(
|
|
124
|
+
placeholder: l(j),
|
|
125
125
|
class: "input-with-select",
|
|
126
126
|
clearable: "",
|
|
127
127
|
maxlength: "30",
|
|
128
128
|
onChange: w,
|
|
129
|
-
onKeyup:
|
|
129
|
+
onKeyup: se(w, ["enter"]),
|
|
130
130
|
onPaste: l(F)
|
|
131
|
-
},
|
|
131
|
+
}, ue({
|
|
132
132
|
append: t(() => [
|
|
133
|
-
o(l(
|
|
133
|
+
o(l(ie), {
|
|
134
134
|
size: "12",
|
|
135
135
|
color: "#3366cc",
|
|
136
136
|
style: { cursor: "pointer" },
|
|
@@ -138,24 +138,24 @@ const be = { class: "yahee-complex-search" }, ge = { class: "search-type-checkbo
|
|
|
138
138
|
onClick: w
|
|
139
139
|
}, {
|
|
140
140
|
default: t(() => [
|
|
141
|
-
o(l(
|
|
141
|
+
o(l(fe))
|
|
142
142
|
]),
|
|
143
143
|
_: 1
|
|
144
144
|
})
|
|
145
145
|
]),
|
|
146
146
|
_: 2
|
|
147
147
|
}, [
|
|
148
|
-
l(
|
|
148
|
+
l(P) ? {
|
|
149
149
|
name: "prepend",
|
|
150
150
|
fn: t(() => [
|
|
151
151
|
o(l(k), {
|
|
152
|
-
modelValue:
|
|
153
|
-
"onUpdate:modelValue": a[0] || (a[0] = (e) =>
|
|
152
|
+
modelValue: r.value,
|
|
153
|
+
"onUpdate:modelValue": a[0] || (a[0] = (e) => r.value = e),
|
|
154
154
|
size: "small",
|
|
155
155
|
class: "custom-select"
|
|
156
156
|
}, {
|
|
157
157
|
default: t(() => [
|
|
158
|
-
(
|
|
158
|
+
(u(!0), y(C, null, b(l(O), (e) => (u(), d(l(g), {
|
|
159
159
|
key: e.label,
|
|
160
160
|
label: e.label,
|
|
161
161
|
value: e.value
|
|
@@ -169,14 +169,14 @@ const be = { class: "yahee-complex-search" }, ge = { class: "search-type-checkbo
|
|
|
169
169
|
name: "prepend",
|
|
170
170
|
fn: t(() => [
|
|
171
171
|
o(l(k), {
|
|
172
|
-
modelValue:
|
|
173
|
-
"onUpdate:modelValue": a[1] || (a[1] = (e) =>
|
|
172
|
+
modelValue: r.value,
|
|
173
|
+
"onUpdate:modelValue": a[1] || (a[1] = (e) => r.value = e),
|
|
174
174
|
size: "small",
|
|
175
175
|
class: "custom-select",
|
|
176
176
|
disabled: ""
|
|
177
177
|
}, {
|
|
178
178
|
default: t(() => [
|
|
179
|
-
(
|
|
179
|
+
(u(), y(C, null, b(K, (e) => o(l(g), {
|
|
180
180
|
key: e.label,
|
|
181
181
|
label: e.label,
|
|
182
182
|
value: e.value
|
|
@@ -188,96 +188,96 @@ const be = { class: "yahee-complex-search" }, ge = { class: "search-type-checkbo
|
|
|
188
188
|
key: "1"
|
|
189
189
|
}
|
|
190
190
|
]), 1032, ["modelValue", "placeholder", "onPaste"]),
|
|
191
|
-
x("div",
|
|
192
|
-
l(
|
|
191
|
+
x("div", Ce, [
|
|
192
|
+
l(Y) ? (u(), d(l(de), {
|
|
193
193
|
key: 0,
|
|
194
194
|
modelValue: f.value,
|
|
195
195
|
"onUpdate:modelValue": a[3] || (a[3] = (e) => f.value = e),
|
|
196
|
-
onChange:
|
|
196
|
+
onChange: Z
|
|
197
197
|
}, {
|
|
198
198
|
default: t(() => a[8] || (a[8] = [
|
|
199
|
-
|
|
199
|
+
S(V("在筛选条件内查询"))
|
|
200
200
|
])),
|
|
201
201
|
_: 1
|
|
202
|
-
}, 8, ["modelValue"])) :
|
|
203
|
-
l(
|
|
202
|
+
}, 8, ["modelValue"])) : L("", !0),
|
|
203
|
+
l(X) ? (u(), d(l(pe), {
|
|
204
204
|
key: 1,
|
|
205
205
|
type: "primary",
|
|
206
|
-
onClick:
|
|
206
|
+
onClick: Q
|
|
207
207
|
}, {
|
|
208
208
|
default: t(() => a[9] || (a[9] = [
|
|
209
|
-
|
|
209
|
+
S(V("批量查询"))
|
|
210
210
|
])),
|
|
211
211
|
_: 1
|
|
212
|
-
})) :
|
|
212
|
+
})) : L("", !0)
|
|
213
213
|
])
|
|
214
214
|
]),
|
|
215
|
-
o(l(
|
|
215
|
+
o(l(me), {
|
|
216
216
|
modelValue: v.value,
|
|
217
217
|
"onUpdate:modelValue": a[7] || (a[7] = (e) => v.value = e),
|
|
218
218
|
title: "批量查询",
|
|
219
219
|
width: "30%",
|
|
220
|
-
"before-close":
|
|
220
|
+
"before-close": U,
|
|
221
221
|
"append-to-body": !0,
|
|
222
222
|
draggable: ""
|
|
223
223
|
}, {
|
|
224
224
|
footer: t(() => [
|
|
225
|
-
x("div",
|
|
226
|
-
o(l(
|
|
225
|
+
x("div", be, [
|
|
226
|
+
o(l(G), {
|
|
227
227
|
type: "primary",
|
|
228
228
|
loading: E.value,
|
|
229
|
-
onClick:
|
|
229
|
+
onClick: ae
|
|
230
230
|
}, {
|
|
231
231
|
default: t(() => a[10] || (a[10] = [
|
|
232
|
-
|
|
232
|
+
S(V("确认"))
|
|
233
233
|
])),
|
|
234
234
|
_: 1
|
|
235
235
|
}, 8, ["loading"]),
|
|
236
|
-
o(l(
|
|
236
|
+
o(l(G), { onClick: U }, {
|
|
237
237
|
default: t(() => a[11] || (a[11] = [
|
|
238
|
-
|
|
238
|
+
S(V("关闭"))
|
|
239
239
|
])),
|
|
240
240
|
_: 1
|
|
241
241
|
})
|
|
242
242
|
])
|
|
243
243
|
]),
|
|
244
244
|
default: t(() => [
|
|
245
|
-
o(l(
|
|
245
|
+
o(l(he), {
|
|
246
246
|
ref_key: "batchSearchFormRef",
|
|
247
|
-
ref:
|
|
248
|
-
model:
|
|
249
|
-
rules:
|
|
247
|
+
ref: _,
|
|
248
|
+
model: s.value,
|
|
249
|
+
rules: M
|
|
250
250
|
}, {
|
|
251
251
|
default: t(() => [
|
|
252
|
-
o(l(
|
|
252
|
+
o(l(W), { class: "row-class" }, {
|
|
253
253
|
default: t(() => [
|
|
254
|
-
o(l(
|
|
254
|
+
o(l(z), { prop: "searchType" }, {
|
|
255
255
|
default: t(() => [
|
|
256
|
-
l(
|
|
256
|
+
l(P) ? (u(), d(l(k), {
|
|
257
257
|
key: 0,
|
|
258
|
-
modelValue:
|
|
259
|
-
"onUpdate:modelValue": a[4] || (a[4] = (e) =>
|
|
258
|
+
modelValue: s.value.searchType,
|
|
259
|
+
"onUpdate:modelValue": a[4] || (a[4] = (e) => s.value.searchType = e),
|
|
260
260
|
size: "small",
|
|
261
261
|
style: { width: "95px", "background-color": "white" }
|
|
262
262
|
}, {
|
|
263
263
|
default: t(() => [
|
|
264
|
-
(
|
|
264
|
+
(u(!0), y(C, null, b(l(O), (e) => (u(), d(l(g), {
|
|
265
265
|
key: e.label,
|
|
266
266
|
label: e.label,
|
|
267
267
|
value: e.value
|
|
268
268
|
}, null, 8, ["label", "value"]))), 128))
|
|
269
269
|
]),
|
|
270
270
|
_: 1
|
|
271
|
-
}, 8, ["modelValue"])) : (
|
|
271
|
+
}, 8, ["modelValue"])) : (u(), d(l(k), {
|
|
272
272
|
key: 1,
|
|
273
|
-
modelValue:
|
|
274
|
-
"onUpdate:modelValue": a[5] || (a[5] = (e) =>
|
|
273
|
+
modelValue: s.value.searchType,
|
|
274
|
+
"onUpdate:modelValue": a[5] || (a[5] = (e) => s.value.searchType = e),
|
|
275
275
|
size: "small",
|
|
276
276
|
style: { width: "95px", "background-color": "white" },
|
|
277
277
|
disabled: ""
|
|
278
278
|
}, {
|
|
279
279
|
default: t(() => [
|
|
280
|
-
(
|
|
280
|
+
(u(), y(C, null, b(K, (e) => o(l(g), {
|
|
281
281
|
key: e.label,
|
|
282
282
|
label: e.label,
|
|
283
283
|
value: e.value
|
|
@@ -291,16 +291,16 @@ const be = { class: "yahee-complex-search" }, ge = { class: "search-type-checkbo
|
|
|
291
291
|
]),
|
|
292
292
|
_: 1
|
|
293
293
|
}),
|
|
294
|
-
o(l(
|
|
294
|
+
o(l(W), { class: "row-class" }, {
|
|
295
295
|
default: t(() => [
|
|
296
|
-
o(l(
|
|
296
|
+
o(l(z), {
|
|
297
297
|
prop: "searchContent",
|
|
298
298
|
style: { width: "100%" }
|
|
299
299
|
}, {
|
|
300
300
|
default: t(() => [
|
|
301
|
-
o(l(
|
|
302
|
-
modelValue:
|
|
303
|
-
"onUpdate:modelValue": a[6] || (a[6] = (e) =>
|
|
301
|
+
o(l(R), {
|
|
302
|
+
modelValue: s.value.searchContent,
|
|
303
|
+
"onUpdate:modelValue": a[6] || (a[6] = (e) => s.value.searchContent = e),
|
|
304
304
|
placeholder: "请输入批量查询内容,从EXCEL复制可自动替换为`,`",
|
|
305
305
|
type: "textarea",
|
|
306
306
|
rows: 5,
|
|
@@ -324,5 +324,5 @@ const be = { class: "yahee-complex-search" }, ge = { class: "search-type-checkbo
|
|
|
324
324
|
}
|
|
325
325
|
});
|
|
326
326
|
export {
|
|
327
|
-
|
|
327
|
+
Ne as default
|
|
328
328
|
};
|