yahee-components 0.0.26 → 0.0.27

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