yahee-components 0.0.17 → 0.0.19

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