yahee-components 0.0.7 → 0.0.9
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
|
|
2
|
-
import
|
|
3
|
-
import { ElConfigProvider as
|
|
1
|
+
import { defineComponent as Q, toRefs as W, ref as n, openBlock as r, createBlock as p, unref as e, withCtx as o, createElementVNode as b, createVNode as t, withKeys as X, createElementBlock as v, Fragment as E, renderList as k, createTextVNode as i, toDisplayString as m, createCommentVNode as w } from "vue";
|
|
2
|
+
import h from "../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/lodash.js";
|
|
3
|
+
import { ElConfigProvider as Y, ElInput as x, ElSelect as F, ElOption as B, ElIcon as j, ElCheckbox as G, ElLink as J, ElDialog as Z, ElButton as P, ElForm as $, ElRow as T, ElFormItem as _, ElMessage as ee } 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";
|
|
@@ -20,75 +20,78 @@ import "element-plus/theme-chalk/src/link.scss";
|
|
|
20
20
|
import "element-plus/theme-chalk/src/config-provider.scss";
|
|
21
21
|
import "element-plus/theme-chalk/src/badge.scss";
|
|
22
22
|
import "element-plus/theme-chalk/src/message.scss";
|
|
23
|
-
import { Search as
|
|
24
|
-
import
|
|
25
|
-
const
|
|
23
|
+
import { Search as le } from "@element-plus/icons-vue";
|
|
24
|
+
import ae from "../node_modules/.pnpm/element-plus@2.8.3_vue@3.5.4_typescript@5.6.2_/node_modules/element-plus/es/locale/lang/zh-cn.js";
|
|
25
|
+
const oe = { class: "yahee-comporehensive-search" }, te = {
|
|
26
26
|
key: 0,
|
|
27
27
|
class: "search-type-checkbox"
|
|
28
|
-
},
|
|
28
|
+
}, re = { class: "dialog-footer" }, Te = /* @__PURE__ */ Q({
|
|
29
29
|
name: "YaheeComprehensiveSearch",
|
|
30
30
|
__name: "comprehensive-search",
|
|
31
31
|
props: {
|
|
32
|
-
dealSearch: { type: Function, default:
|
|
33
|
-
confirmSearch: { type: Function, default:
|
|
34
|
-
pasteFormat: { type: Function, default:
|
|
35
|
-
isInSearchChange: { type: Function, default:
|
|
32
|
+
dealSearch: { type: Function, default: h.noop },
|
|
33
|
+
confirmSearch: { type: Function, default: h.noop },
|
|
34
|
+
pasteFormat: { type: Function, default: h.noop },
|
|
35
|
+
isInSearchChange: { type: Function, default: h.noop },
|
|
36
36
|
defaultSearch: { default: "" },
|
|
37
37
|
options: { default: () => [] },
|
|
38
38
|
placeholderText: { default: "" },
|
|
39
39
|
showPatchSearch: { type: Boolean, default: !1 },
|
|
40
40
|
showPatchCheckbox: { type: Boolean }
|
|
41
41
|
},
|
|
42
|
-
setup(
|
|
43
|
-
const
|
|
44
|
-
dealSearch:
|
|
42
|
+
setup(I) {
|
|
43
|
+
const U = ae, L = I, {
|
|
44
|
+
dealSearch: y,
|
|
45
45
|
defaultSearch: z,
|
|
46
|
-
pasteFormat:
|
|
46
|
+
pasteFormat: C,
|
|
47
47
|
confirmSearch: N,
|
|
48
48
|
isInSearchChange: R,
|
|
49
|
-
options:
|
|
49
|
+
options: g,
|
|
50
50
|
showPatchSearch: D,
|
|
51
51
|
showPatchCheckbox: q
|
|
52
|
-
} =
|
|
52
|
+
} = W(L), c = n(z.value), s = n(""), S = n(!1), H = n(!1), d = n(!1), u = n({ searchType: "WHOLE_SEARCH", searchContent: "" }), K = {
|
|
53
53
|
selectedSearchType: [{ required: !0, message: "请输入查询类型", trigger: "blur" }],
|
|
54
54
|
searchContent: [{ required: !0, message: "请输入查询内容", trigger: "blur" }]
|
|
55
55
|
};
|
|
56
56
|
function O() {
|
|
57
57
|
d.value = !0;
|
|
58
58
|
}
|
|
59
|
-
function
|
|
59
|
+
function V() {
|
|
60
60
|
d.value = !1;
|
|
61
61
|
}
|
|
62
62
|
const f = () => {
|
|
63
|
-
if (!
|
|
64
|
-
|
|
63
|
+
if (!s.value) {
|
|
64
|
+
ee.warning("请输入搜索关键字");
|
|
65
65
|
return;
|
|
66
66
|
}
|
|
67
|
-
|
|
67
|
+
y.value(c.value, s.value);
|
|
68
|
+
}, A = () => {
|
|
69
|
+
console.log("继续处理"), y.value(c.value, s.value);
|
|
68
70
|
};
|
|
69
|
-
return (
|
|
71
|
+
return (M, l) => (r(), p(e(Y), { locale: e(U) }, {
|
|
70
72
|
default: o(() => [
|
|
71
|
-
|
|
72
|
-
t(e(
|
|
73
|
-
modelValue:
|
|
74
|
-
"onUpdate:modelValue": l[1] || (l[1] = (a) =>
|
|
75
|
-
placeholder:
|
|
73
|
+
b("div", oe, [
|
|
74
|
+
t(e(x), {
|
|
75
|
+
modelValue: s.value,
|
|
76
|
+
"onUpdate:modelValue": l[1] || (l[1] = (a) => s.value = a),
|
|
77
|
+
placeholder: M.placeholderText,
|
|
76
78
|
class: "input-with-select",
|
|
77
79
|
clearable: "",
|
|
78
80
|
maxlength: "30",
|
|
79
81
|
onChange: f,
|
|
80
|
-
onKeyup:
|
|
81
|
-
onPaste: e(
|
|
82
|
+
onKeyup: X(f, ["enter"]),
|
|
83
|
+
onPaste: e(C),
|
|
84
|
+
onClear: A
|
|
82
85
|
}, {
|
|
83
86
|
prepend: o(() => [
|
|
84
|
-
t(e(
|
|
85
|
-
modelValue:
|
|
86
|
-
"onUpdate:modelValue": l[0] || (l[0] = (a) =>
|
|
87
|
+
t(e(F), {
|
|
88
|
+
modelValue: c.value,
|
|
89
|
+
"onUpdate:modelValue": l[0] || (l[0] = (a) => c.value = a),
|
|
87
90
|
size: "small",
|
|
88
91
|
class: "custom-select"
|
|
89
92
|
}, {
|
|
90
93
|
default: o(() => [
|
|
91
|
-
(r(!0), v(
|
|
94
|
+
(r(!0), v(E, null, k(e(g), (a) => (r(), p(e(B), {
|
|
92
95
|
key: a.label,
|
|
93
96
|
label: a.label,
|
|
94
97
|
value: a.value
|
|
@@ -98,7 +101,7 @@ const ae = { class: "yahee-comporehensive-search" }, oe = {
|
|
|
98
101
|
}, 8, ["modelValue"])
|
|
99
102
|
]),
|
|
100
103
|
append: o(() => [
|
|
101
|
-
t(e(
|
|
104
|
+
t(e(j), {
|
|
102
105
|
size: "12",
|
|
103
106
|
color: "#3366cc",
|
|
104
107
|
style: { cursor: "pointer" },
|
|
@@ -106,84 +109,84 @@ const ae = { class: "yahee-comporehensive-search" }, oe = {
|
|
|
106
109
|
onClick: f
|
|
107
110
|
}, {
|
|
108
111
|
default: o(() => [
|
|
109
|
-
t(e(
|
|
112
|
+
t(e(le))
|
|
110
113
|
]),
|
|
111
114
|
_: 1
|
|
112
115
|
})
|
|
113
116
|
]),
|
|
114
117
|
_: 1
|
|
115
118
|
}, 8, ["modelValue", "placeholder", "onPaste"]),
|
|
116
|
-
e(q) ? (r(), v("div",
|
|
117
|
-
t(e(
|
|
118
|
-
modelValue:
|
|
119
|
-
"onUpdate:modelValue": l[2] || (l[2] = (a) =>
|
|
119
|
+
e(q) ? (r(), v("div", te, [
|
|
120
|
+
t(e(G), {
|
|
121
|
+
modelValue: S.value,
|
|
122
|
+
"onUpdate:modelValue": l[2] || (l[2] = (a) => S.value = a),
|
|
120
123
|
onChange: e(R)
|
|
121
124
|
}, {
|
|
122
125
|
default: o(() => l[6] || (l[6] = [
|
|
123
|
-
|
|
126
|
+
i(m("在筛选条件内查询"))
|
|
124
127
|
])),
|
|
125
128
|
_: 1
|
|
126
129
|
}, 8, ["modelValue", "onChange"]),
|
|
127
|
-
e(D) ? (r(),
|
|
130
|
+
e(D) ? (r(), p(e(J), {
|
|
128
131
|
key: 0,
|
|
129
132
|
type: "primary",
|
|
130
133
|
onClick: O
|
|
131
134
|
}, {
|
|
132
135
|
default: o(() => l[7] || (l[7] = [
|
|
133
|
-
|
|
136
|
+
i(m("批量查询"))
|
|
134
137
|
])),
|
|
135
138
|
_: 1
|
|
136
|
-
})) :
|
|
137
|
-
])) :
|
|
139
|
+
})) : w("", !0)
|
|
140
|
+
])) : w("", !0)
|
|
138
141
|
]),
|
|
139
|
-
t(e(
|
|
142
|
+
t(e(Z), {
|
|
140
143
|
modelValue: d.value,
|
|
141
144
|
"onUpdate:modelValue": l[5] || (l[5] = (a) => d.value = a),
|
|
142
145
|
title: "批量查询",
|
|
143
146
|
width: "30%",
|
|
144
|
-
"before-close":
|
|
147
|
+
"before-close": V,
|
|
145
148
|
"append-to-body": !0,
|
|
146
149
|
draggable: ""
|
|
147
150
|
}, {
|
|
148
151
|
footer: o(() => [
|
|
149
|
-
|
|
150
|
-
t(e(
|
|
152
|
+
b("div", re, [
|
|
153
|
+
t(e(P), {
|
|
151
154
|
type: "primary",
|
|
152
155
|
loading: H.value,
|
|
153
156
|
onClick: e(N)
|
|
154
157
|
}, {
|
|
155
158
|
default: o(() => l[8] || (l[8] = [
|
|
156
|
-
|
|
159
|
+
i(m("确认"))
|
|
157
160
|
])),
|
|
158
161
|
_: 1
|
|
159
162
|
}, 8, ["loading", "onClick"]),
|
|
160
|
-
t(e(
|
|
163
|
+
t(e(P), { onClick: V }, {
|
|
161
164
|
default: o(() => l[9] || (l[9] = [
|
|
162
|
-
|
|
165
|
+
i(m("关闭"))
|
|
163
166
|
])),
|
|
164
167
|
_: 1
|
|
165
168
|
})
|
|
166
169
|
])
|
|
167
170
|
]),
|
|
168
171
|
default: o(() => [
|
|
169
|
-
t(e(
|
|
172
|
+
t(e($), {
|
|
170
173
|
ref: "batchSearchFormRef",
|
|
171
|
-
model:
|
|
174
|
+
model: u.value,
|
|
172
175
|
rules: K
|
|
173
176
|
}, {
|
|
174
177
|
default: o(() => [
|
|
175
|
-
t(e(
|
|
178
|
+
t(e(T), { class: "row-class" }, {
|
|
176
179
|
default: o(() => [
|
|
177
|
-
t(e(
|
|
180
|
+
t(e(_), { prop: "searchType" }, {
|
|
178
181
|
default: o(() => [
|
|
179
|
-
t(e(
|
|
180
|
-
modelValue:
|
|
181
|
-
"onUpdate:modelValue": l[3] || (l[3] = (a) =>
|
|
182
|
+
t(e(F), {
|
|
183
|
+
modelValue: u.value.searchType,
|
|
184
|
+
"onUpdate:modelValue": l[3] || (l[3] = (a) => u.value.searchType = a),
|
|
182
185
|
size: "small",
|
|
183
186
|
class: "custom-select"
|
|
184
187
|
}, {
|
|
185
188
|
default: o(() => [
|
|
186
|
-
(r(!0), v(
|
|
189
|
+
(r(!0), v(E, null, k(e(g), (a) => (r(), p(e(B), {
|
|
187
190
|
key: a.label,
|
|
188
191
|
label: a.label,
|
|
189
192
|
value: a.value
|
|
@@ -197,20 +200,20 @@ const ae = { class: "yahee-comporehensive-search" }, oe = {
|
|
|
197
200
|
]),
|
|
198
201
|
_: 1
|
|
199
202
|
}),
|
|
200
|
-
t(e(
|
|
203
|
+
t(e(T), { class: "row-class" }, {
|
|
201
204
|
default: o(() => [
|
|
202
|
-
t(e(
|
|
205
|
+
t(e(_), {
|
|
203
206
|
prop: "searchContent",
|
|
204
207
|
style: { width: "100%" }
|
|
205
208
|
}, {
|
|
206
209
|
default: o(() => [
|
|
207
|
-
t(e(
|
|
208
|
-
modelValue:
|
|
209
|
-
"onUpdate:modelValue": l[4] || (l[4] = (a) =>
|
|
210
|
+
t(e(x), {
|
|
211
|
+
modelValue: u.value.searchContent,
|
|
212
|
+
"onUpdate:modelValue": l[4] || (l[4] = (a) => u.value.searchContent = a),
|
|
210
213
|
placeholder: "请输入批量查询内容,从EXCEL复制可自动替换为`,`",
|
|
211
214
|
type: "textarea",
|
|
212
215
|
rows: 5,
|
|
213
|
-
onPaste: e(
|
|
216
|
+
onPaste: e(C)
|
|
214
217
|
}, null, 8, ["modelValue", "onPaste"])
|
|
215
218
|
]),
|
|
216
219
|
_: 1
|
|
@@ -230,5 +233,5 @@ const ae = { class: "yahee-comporehensive-search" }, oe = {
|
|
|
230
233
|
}
|
|
231
234
|
});
|
|
232
235
|
export {
|
|
233
|
-
|
|
236
|
+
Te as default
|
|
234
237
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("vue"),
|
|
1
|
+
"use strict";const e=require("vue"),c=require("../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/lodash.js"),r=require("element-plus");require("element-plus/theme-chalk/src/base.scss");require("element-plus/theme-chalk/src/input.scss");require("element-plus/theme-chalk/src/checkbox.scss");require("element-plus/theme-chalk/src/tag.scss");require("element-plus/theme-chalk/src/option.scss");require("element-plus/theme-chalk/src/option-group.scss");require("element-plus/theme-chalk/src/scrollbar.scss");require("element-plus/theme-chalk/src/popper.scss");require("element-plus/theme-chalk/src/select.scss");require("element-plus/theme-chalk/src/dialog.scss");require("element-plus/theme-chalk/src/overlay.scss");require("element-plus/theme-chalk/src/form.scss");require("element-plus/theme-chalk/src/form-item.scss");require("element-plus/theme-chalk/src/row.scss");require("element-plus/theme-chalk/src/button.scss");require("element-plus/theme-chalk/src/link.scss");require("element-plus/theme-chalk/src/config-provider.scss");require("element-plus/theme-chalk/src/badge.scss");require("element-plus/theme-chalk/src/message.scss");const B=require("@element-plus/icons-vue"),b=require("../node_modules/.pnpm/element-plus@2.8.3_vue@3.5.4_typescript@5.6.2_/node_modules/element-plus/es/locale/lang/zh-cn.js"),F={class:"yahee-comporehensive-search"},T={key:0,class:"search-type-checkbox"},P={class:"dialog-footer"},I=e.defineComponent({name:"YaheeComprehensiveSearch",__name:"comprehensive-search",props:{dealSearch:{type:Function,default:c.noop},confirmSearch:{type:Function,default:c.noop},pasteFormat:{type:Function,default:c.noop},isInSearchChange:{type:Function,default:c.noop},defaultSearch:{default:""},options:{default:()=>[]},placeholderText:{default:""},showPatchSearch:{type:Boolean,default:!1},showPatchCheckbox:{type:Boolean}},setup(m){const C=b,V=m,{dealSearch:d,defaultSearch:v,pasteFormat:i,confirmSearch:w,isInSearchChange:y,options:h,showPatchSearch:g,showPatchCheckbox:x}=e.toRefs(V),n=e.ref(v.value),a=e.ref(""),f=e.ref(!1),k=e.ref(!1),u=e.ref(!1),o=e.ref({searchType:"WHOLE_SEARCH",searchContent:""}),E={selectedSearchType:[{required:!0,message:"请输入查询类型",trigger:"blur"}],searchContent:[{required:!0,message:"请输入查询内容",trigger:"blur"}]};function S(){u.value=!0}function p(){u.value=!1}const s=()=>{if(!a.value){r.ElMessage.warning("请输入搜索关键字");return}d.value(n.value,a.value)},q=()=>{console.log("继续处理"),d.value(n.value,a.value)};return(N,t)=>(e.openBlock(),e.createBlock(e.unref(r.ElConfigProvider),{locale:e.unref(C)},{default:e.withCtx(()=>[e.createElementVNode("div",F,[e.createVNode(e.unref(r.ElInput),{modelValue:a.value,"onUpdate:modelValue":t[1]||(t[1]=l=>a.value=l),placeholder:N.placeholderText,class:"input-with-select",clearable:"",maxlength:"30",onChange:s,onKeyup:e.withKeys(s,["enter"]),onPaste:e.unref(i),onClear:q},{prepend:e.withCtx(()=>[e.createVNode(e.unref(r.ElSelect),{modelValue:n.value,"onUpdate:modelValue":t[0]||(t[0]=l=>n.value=l),size:"small",class:"custom-select"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(h),l=>(e.openBlock(),e.createBlock(e.unref(r.ElOption),{key:l.label,label:l.label,value:l.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),append:e.withCtx(()=>[e.createVNode(e.unref(r.ElIcon),{size:"12",color:"#3366cc",style:{cursor:"pointer"},class:"icon-cusor",onClick:s},{default:e.withCtx(()=>[e.createVNode(e.unref(B.Search))]),_:1})]),_:1},8,["modelValue","placeholder","onPaste"]),e.unref(x)?(e.openBlock(),e.createElementBlock("div",T,[e.createVNode(e.unref(r.ElCheckbox),{modelValue:f.value,"onUpdate:modelValue":t[2]||(t[2]=l=>f.value=l),onChange:e.unref(y)},{default:e.withCtx(()=>t[6]||(t[6]=[e.createTextVNode(e.toDisplayString("在筛选条件内查询"))])),_:1},8,["modelValue","onChange"]),e.unref(g)?(e.openBlock(),e.createBlock(e.unref(r.ElLink),{key:0,type:"primary",onClick:S},{default:e.withCtx(()=>t[7]||(t[7]=[e.createTextVNode(e.toDisplayString("批量查询"))])),_:1})):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),e.createVNode(e.unref(r.ElDialog),{modelValue:u.value,"onUpdate:modelValue":t[5]||(t[5]=l=>u.value=l),title:"批量查询",width:"30%","before-close":p,"append-to-body":!0,draggable:""},{footer:e.withCtx(()=>[e.createElementVNode("div",P,[e.createVNode(e.unref(r.ElButton),{type:"primary",loading:k.value,onClick:e.unref(w)},{default:e.withCtx(()=>t[8]||(t[8]=[e.createTextVNode(e.toDisplayString("确认"))])),_:1},8,["loading","onClick"]),e.createVNode(e.unref(r.ElButton),{onClick:p},{default:e.withCtx(()=>t[9]||(t[9]=[e.createTextVNode(e.toDisplayString("关闭"))])),_:1})])]),default:e.withCtx(()=>[e.createVNode(e.unref(r.ElForm),{ref:"batchSearchFormRef",model:o.value,rules:E},{default:e.withCtx(()=>[e.createVNode(e.unref(r.ElRow),{class:"row-class"},{default:e.withCtx(()=>[e.createVNode(e.unref(r.ElFormItem),{prop:"searchType"},{default:e.withCtx(()=>[e.createVNode(e.unref(r.ElSelect),{modelValue:o.value.searchType,"onUpdate:modelValue":t[3]||(t[3]=l=>o.value.searchType=l),size:"small",class:"custom-select"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(h),l=>(e.openBlock(),e.createBlock(e.unref(r.ElOption),{key:l.label,label:l.label,value:l.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),e.createVNode(e.unref(r.ElRow),{class:"row-class"},{default:e.withCtx(()=>[e.createVNode(e.unref(r.ElFormItem),{prop:"searchContent",style:{width:"100%"}},{default:e.withCtx(()=>[e.createVNode(e.unref(r.ElInput),{modelValue:o.value.searchContent,"onUpdate:modelValue":t[4]||(t[4]=l=>o.value.searchContent=l),placeholder:"请输入批量查询内容,从EXCEL复制可自动替换为`,`",type:"textarea",rows:5,onPaste:e.unref(i)},null,8,["modelValue","onPaste"])]),_:1})]),_:1})]),_:1},8,["model"])]),_:1},8,["modelValue"])]),_:1},8,["locale"]))}});module.exports=I;
|