yahee-components 0.0.50 → 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.
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as te, mergeDefaults as oe, toRefs as re, ref 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
3
|
import { defaultComplexSearchProps as ne } from "./props.js";
|
|
4
|
-
import { ElConfigProvider as
|
|
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";
|
|
@@ -21,7 +21,7 @@ import "element-plus/theme-chalk/src/link.scss";
|
|
|
21
21
|
import "element-plus/theme-chalk/src/config-provider.scss";
|
|
22
22
|
import { Search as fe } from "@element-plus/icons-vue";
|
|
23
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" },
|
|
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
27
|
props: /* @__PURE__ */ oe({
|
|
@@ -37,100 +37,105 @@ const ye = { class: "yahee-complex-search" }, be = { class: "search-type-checkbo
|
|
|
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:
|
|
44
|
+
options: O,
|
|
45
|
+
showPatchSearch: X,
|
|
46
|
+
specialOptions: B,
|
|
47
|
+
showWithinFilterCheckbox: Y,
|
|
48
|
+
placeholderText: j,
|
|
49
49
|
normalOptions: J,
|
|
50
|
-
showSelect:
|
|
50
|
+
showSelect: P,
|
|
51
51
|
searchItem: n
|
|
52
|
-
} = re(
|
|
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
64
|
}, Z = () => {
|
|
65
|
-
f.value || (delete n.value.putSearch, m("filterChangeGrandson", n.value,
|
|
66
|
-
}, $ = () => n.value,
|
|
67
|
-
h.value ? le() : m("filterChangeGrandson", $(),
|
|
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
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
74
|
ee(n.value, a);
|
|
75
|
-
const { checkedValues: e, filterKey:
|
|
76
|
-
T.isEmpty(e) || (J.value.includes(
|
|
77
|
-
}), m("filterChangeGrandson", n.value,
|
|
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
79
|
const le = () => {
|
|
80
|
-
f.value ?
|
|
80
|
+
f.value ? I([
|
|
81
81
|
{
|
|
82
82
|
filterKey: "putSearch",
|
|
83
83
|
checkedValues: h.value
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
filterKey: "searchType",
|
|
87
|
+
checkedValues: r.value
|
|
84
88
|
}
|
|
85
89
|
]) : m(
|
|
86
90
|
"filterChangeGrandson",
|
|
87
91
|
{
|
|
88
|
-
putSearch: h.value
|
|
92
|
+
putSearch: h.value,
|
|
93
|
+
searchType: r.value
|
|
89
94
|
},
|
|
90
|
-
|
|
95
|
+
r.value
|
|
91
96
|
);
|
|
92
97
|
}, ae = () => {
|
|
93
|
-
|
|
94
|
-
p && (
|
|
98
|
+
_.value.validate((p) => {
|
|
99
|
+
p && (E.value = !0, f.value ? I([
|
|
95
100
|
{
|
|
96
101
|
filterKey: "putSearch",
|
|
97
|
-
checkedValues:
|
|
102
|
+
checkedValues: s.value.searchContent
|
|
98
103
|
},
|
|
99
104
|
{
|
|
100
105
|
filterKey: "searchType",
|
|
101
|
-
checkedValues:
|
|
106
|
+
checkedValues: s.value.searchType
|
|
102
107
|
}
|
|
103
108
|
]) : m(
|
|
104
109
|
"filterChangeGrandson",
|
|
105
110
|
{
|
|
106
|
-
putSearch:
|
|
107
|
-
searchType:
|
|
111
|
+
putSearch: s.value.searchContent,
|
|
112
|
+
searchType: s.value.searchType
|
|
108
113
|
},
|
|
109
|
-
|
|
110
|
-
), v.value = !1,
|
|
114
|
+
r.value
|
|
115
|
+
), v.value = !1, E.value = !1);
|
|
111
116
|
});
|
|
112
117
|
};
|
|
113
|
-
return (p, a) => (
|
|
118
|
+
return (p, a) => (u(), d(l(ce), { locale: l(N) }, {
|
|
114
119
|
default: t(() => [
|
|
115
120
|
x("div", ye, [
|
|
116
|
-
o(l(
|
|
121
|
+
o(l(R), {
|
|
117
122
|
modelValue: h.value,
|
|
118
123
|
"onUpdate:modelValue": a[2] || (a[2] = (e) => h.value = e),
|
|
119
|
-
placeholder: l(
|
|
124
|
+
placeholder: l(j),
|
|
120
125
|
class: "input-with-select",
|
|
121
126
|
clearable: "",
|
|
122
127
|
maxlength: "30",
|
|
123
|
-
onChange:
|
|
124
|
-
onKeyup: se(
|
|
128
|
+
onChange: w,
|
|
129
|
+
onKeyup: se(w, ["enter"]),
|
|
125
130
|
onPaste: l(F)
|
|
126
131
|
}, ue({
|
|
127
132
|
append: t(() => [
|
|
128
|
-
o(l(
|
|
133
|
+
o(l(ie), {
|
|
129
134
|
size: "12",
|
|
130
135
|
color: "#3366cc",
|
|
131
136
|
style: { cursor: "pointer" },
|
|
132
137
|
class: "icon-cusor",
|
|
133
|
-
onClick:
|
|
138
|
+
onClick: w
|
|
134
139
|
}, {
|
|
135
140
|
default: t(() => [
|
|
136
141
|
o(l(fe))
|
|
@@ -140,17 +145,17 @@ const ye = { class: "yahee-complex-search" }, be = { class: "search-type-checkbo
|
|
|
140
145
|
]),
|
|
141
146
|
_: 2
|
|
142
147
|
}, [
|
|
143
|
-
l(
|
|
148
|
+
l(P) ? {
|
|
144
149
|
name: "prepend",
|
|
145
150
|
fn: t(() => [
|
|
146
151
|
o(l(k), {
|
|
147
|
-
modelValue:
|
|
148
|
-
"onUpdate:modelValue": a[0] || (a[0] = (e) =>
|
|
152
|
+
modelValue: r.value,
|
|
153
|
+
"onUpdate:modelValue": a[0] || (a[0] = (e) => r.value = e),
|
|
149
154
|
size: "small",
|
|
150
155
|
class: "custom-select"
|
|
151
156
|
}, {
|
|
152
157
|
default: t(() => [
|
|
153
|
-
(
|
|
158
|
+
(u(!0), y(C, null, b(l(O), (e) => (u(), d(l(g), {
|
|
154
159
|
key: e.label,
|
|
155
160
|
label: e.label,
|
|
156
161
|
value: e.value
|
|
@@ -164,14 +169,14 @@ const ye = { class: "yahee-complex-search" }, be = { class: "search-type-checkbo
|
|
|
164
169
|
name: "prepend",
|
|
165
170
|
fn: t(() => [
|
|
166
171
|
o(l(k), {
|
|
167
|
-
modelValue:
|
|
168
|
-
"onUpdate:modelValue": a[1] || (a[1] = (e) =>
|
|
172
|
+
modelValue: r.value,
|
|
173
|
+
"onUpdate:modelValue": a[1] || (a[1] = (e) => r.value = e),
|
|
169
174
|
size: "small",
|
|
170
175
|
class: "custom-select",
|
|
171
176
|
disabled: ""
|
|
172
177
|
}, {
|
|
173
178
|
default: t(() => [
|
|
174
|
-
(
|
|
179
|
+
(u(), y(C, null, b(K, (e) => o(l(g), {
|
|
175
180
|
key: e.label,
|
|
176
181
|
label: e.label,
|
|
177
182
|
value: e.value
|
|
@@ -183,28 +188,28 @@ const ye = { class: "yahee-complex-search" }, be = { class: "search-type-checkbo
|
|
|
183
188
|
key: "1"
|
|
184
189
|
}
|
|
185
190
|
]), 1032, ["modelValue", "placeholder", "onPaste"]),
|
|
186
|
-
x("div",
|
|
187
|
-
l(
|
|
191
|
+
x("div", Ce, [
|
|
192
|
+
l(Y) ? (u(), d(l(de), {
|
|
188
193
|
key: 0,
|
|
189
194
|
modelValue: f.value,
|
|
190
195
|
"onUpdate:modelValue": a[3] || (a[3] = (e) => f.value = e),
|
|
191
196
|
onChange: Z
|
|
192
197
|
}, {
|
|
193
198
|
default: t(() => a[8] || (a[8] = [
|
|
194
|
-
|
|
199
|
+
S(V("在筛选条件内查询"))
|
|
195
200
|
])),
|
|
196
201
|
_: 1
|
|
197
|
-
}, 8, ["modelValue"])) :
|
|
198
|
-
l(
|
|
202
|
+
}, 8, ["modelValue"])) : L("", !0),
|
|
203
|
+
l(X) ? (u(), d(l(pe), {
|
|
199
204
|
key: 1,
|
|
200
205
|
type: "primary",
|
|
201
206
|
onClick: Q
|
|
202
207
|
}, {
|
|
203
208
|
default: t(() => a[9] || (a[9] = [
|
|
204
|
-
|
|
209
|
+
S(V("批量查询"))
|
|
205
210
|
])),
|
|
206
211
|
_: 1
|
|
207
|
-
})) :
|
|
212
|
+
})) : L("", !0)
|
|
208
213
|
])
|
|
209
214
|
]),
|
|
210
215
|
o(l(me), {
|
|
@@ -212,25 +217,25 @@ const ye = { class: "yahee-complex-search" }, be = { class: "search-type-checkbo
|
|
|
212
217
|
"onUpdate:modelValue": a[7] || (a[7] = (e) => v.value = e),
|
|
213
218
|
title: "批量查询",
|
|
214
219
|
width: "30%",
|
|
215
|
-
"before-close":
|
|
220
|
+
"before-close": U,
|
|
216
221
|
"append-to-body": !0,
|
|
217
222
|
draggable: ""
|
|
218
223
|
}, {
|
|
219
224
|
footer: t(() => [
|
|
220
|
-
x("div",
|
|
221
|
-
o(l(
|
|
225
|
+
x("div", be, [
|
|
226
|
+
o(l(G), {
|
|
222
227
|
type: "primary",
|
|
223
|
-
loading:
|
|
228
|
+
loading: E.value,
|
|
224
229
|
onClick: ae
|
|
225
230
|
}, {
|
|
226
231
|
default: t(() => a[10] || (a[10] = [
|
|
227
|
-
|
|
232
|
+
S(V("确认"))
|
|
228
233
|
])),
|
|
229
234
|
_: 1
|
|
230
235
|
}, 8, ["loading"]),
|
|
231
|
-
o(l(
|
|
236
|
+
o(l(G), { onClick: U }, {
|
|
232
237
|
default: t(() => a[11] || (a[11] = [
|
|
233
|
-
|
|
238
|
+
S(V("关闭"))
|
|
234
239
|
])),
|
|
235
240
|
_: 1
|
|
236
241
|
})
|
|
@@ -239,40 +244,40 @@ const ye = { class: "yahee-complex-search" }, be = { class: "search-type-checkbo
|
|
|
239
244
|
default: t(() => [
|
|
240
245
|
o(l(he), {
|
|
241
246
|
ref_key: "batchSearchFormRef",
|
|
242
|
-
ref:
|
|
243
|
-
model:
|
|
247
|
+
ref: _,
|
|
248
|
+
model: s.value,
|
|
244
249
|
rules: M
|
|
245
250
|
}, {
|
|
246
251
|
default: t(() => [
|
|
247
|
-
o(l(
|
|
252
|
+
o(l(W), { class: "row-class" }, {
|
|
248
253
|
default: t(() => [
|
|
249
|
-
o(l(
|
|
254
|
+
o(l(z), { prop: "searchType" }, {
|
|
250
255
|
default: t(() => [
|
|
251
|
-
l(
|
|
256
|
+
l(P) ? (u(), d(l(k), {
|
|
252
257
|
key: 0,
|
|
253
|
-
modelValue:
|
|
254
|
-
"onUpdate:modelValue": a[4] || (a[4] = (e) =>
|
|
258
|
+
modelValue: s.value.searchType,
|
|
259
|
+
"onUpdate:modelValue": a[4] || (a[4] = (e) => s.value.searchType = e),
|
|
255
260
|
size: "small",
|
|
256
261
|
style: { width: "95px", "background-color": "white" }
|
|
257
262
|
}, {
|
|
258
263
|
default: t(() => [
|
|
259
|
-
(
|
|
264
|
+
(u(!0), y(C, null, b(l(O), (e) => (u(), d(l(g), {
|
|
260
265
|
key: e.label,
|
|
261
266
|
label: e.label,
|
|
262
267
|
value: e.value
|
|
263
268
|
}, null, 8, ["label", "value"]))), 128))
|
|
264
269
|
]),
|
|
265
270
|
_: 1
|
|
266
|
-
}, 8, ["modelValue"])) : (
|
|
271
|
+
}, 8, ["modelValue"])) : (u(), d(l(k), {
|
|
267
272
|
key: 1,
|
|
268
|
-
modelValue:
|
|
269
|
-
"onUpdate:modelValue": a[5] || (a[5] = (e) =>
|
|
273
|
+
modelValue: s.value.searchType,
|
|
274
|
+
"onUpdate:modelValue": a[5] || (a[5] = (e) => s.value.searchType = e),
|
|
270
275
|
size: "small",
|
|
271
276
|
style: { width: "95px", "background-color": "white" },
|
|
272
277
|
disabled: ""
|
|
273
278
|
}, {
|
|
274
279
|
default: t(() => [
|
|
275
|
-
(
|
|
280
|
+
(u(), y(C, null, b(K, (e) => o(l(g), {
|
|
276
281
|
key: e.label,
|
|
277
282
|
label: e.label,
|
|
278
283
|
value: e.value
|
|
@@ -286,16 +291,16 @@ const ye = { class: "yahee-complex-search" }, be = { class: "search-type-checkbo
|
|
|
286
291
|
]),
|
|
287
292
|
_: 1
|
|
288
293
|
}),
|
|
289
|
-
o(l(
|
|
294
|
+
o(l(W), { class: "row-class" }, {
|
|
290
295
|
default: t(() => [
|
|
291
|
-
o(l(
|
|
296
|
+
o(l(z), {
|
|
292
297
|
prop: "searchContent",
|
|
293
298
|
style: { width: "100%" }
|
|
294
299
|
}, {
|
|
295
300
|
default: t(() => [
|
|
296
|
-
o(l(
|
|
297
|
-
modelValue:
|
|
298
|
-
"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),
|
|
299
304
|
placeholder: "请输入批量查询内容,从EXCEL复制可自动替换为`,`",
|
|
300
305
|
type: "textarea",
|
|
301
306
|
rows: 5,
|
|
@@ -319,5 +324,5 @@ const ye = { class: "yahee-complex-search" }, be = { class: "search-type-checkbo
|
|
|
319
324
|
}
|
|
320
325
|
});
|
|
321
326
|
export {
|
|
322
|
-
|
|
327
|
+
Ne as default
|
|
323
328
|
};
|