yahee-components 0.0.88 → 0.0.90

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,12 +1,12 @@
1
1
  import T from "./complex-search.vue2.js";
2
- import { resolveComponent as r, createElementBlock as d, openBlock as n, Fragment as u, createElementVNode as b, createVNode as t, withKeys as B, createSlots as U, withCtx as a, renderList as c, createBlock as s, createCommentVNode as V, createTextVNode as i, toDisplayString as h } from "vue";
2
+ import { resolveComponent as r, createElementBlock as d, openBlock as t, Fragment as u, createElementVNode as b, createVNode as n, withKeys as B, createSlots as U, withCtx as a, renderList as i, createBlock as s, createCommentVNode as V, createTextVNode as c, toDisplayString as h } from "vue";
3
3
  import O from "../_virtual/_plugin-vue_export-helper.js";
4
4
  const z = { class: "yahee-complex-search" }, E = { class: "search-type-checkbox" }, P = { class: "dialog-footer" };
5
5
  function W(e, o, N, $, K, L) {
6
6
  const m = r("el-option"), p = r("el-select"), C = r("Search"), w = r("el-icon"), f = r("el-input"), g = r("el-checkbox"), v = r("el-link"), y = r("el-form-item"), S = r("el-row"), F = r("el-form"), k = r("el-button"), _ = r("el-dialog");
7
- return n(), d(u, null, [
7
+ return t(), d(u, null, [
8
8
  b("div", z, [
9
- t(f, {
9
+ n(f, {
10
10
  modelValue: e.putSearch,
11
11
  "onUpdate:modelValue": o[2] || (o[2] = (l) => e.putSearch = l),
12
12
  placeholder: e.placeholderText,
@@ -15,10 +15,11 @@ function W(e, o, N, $, K, L) {
15
15
  maxlength: "30",
16
16
  onChange: e.handleSearch,
17
17
  onKeyup: B(e.handleSearch, ["enter"]),
18
- onPaste: e.pasteFormatInput
18
+ onPaste: e.pasteFormatInput,
19
+ onClear: e.handleClear
19
20
  }, U({
20
21
  append: a(() => [
21
- t(w, {
22
+ n(w, {
22
23
  size: "12",
23
24
  color: "#3366cc",
24
25
  style: { cursor: "pointer" },
@@ -26,7 +27,7 @@ function W(e, o, N, $, K, L) {
26
27
  onClick: e.handleSearch
27
28
  }, {
28
29
  default: a(() => [
29
- t(C)
30
+ n(C)
30
31
  ]),
31
32
  _: 1
32
33
  }, 8, ["onClick"])
@@ -36,14 +37,14 @@ function W(e, o, N, $, K, L) {
36
37
  e.showSelect ? {
37
38
  name: "prepend",
38
39
  fn: a(() => [
39
- t(p, {
40
+ n(p, {
40
41
  modelValue: e.selectedSearchType,
41
42
  "onUpdate:modelValue": o[0] || (o[0] = (l) => e.selectedSearchType = l),
42
43
  size: "small",
43
44
  class: "custom-select"
44
45
  }, {
45
46
  default: a(() => [
46
- (n(!0), d(u, null, c(e.options, (l) => (n(), s(m, {
47
+ (t(!0), d(u, null, i(e.options, (l) => (t(), s(m, {
47
48
  key: l.label,
48
49
  label: l.label,
49
50
  value: l.value
@@ -56,7 +57,7 @@ function W(e, o, N, $, K, L) {
56
57
  } : {
57
58
  name: "prepend",
58
59
  fn: a(() => [
59
- t(p, {
60
+ n(p, {
60
61
  modelValue: e.selectedSearchType,
61
62
  "onUpdate:modelValue": o[1] || (o[1] = (l) => e.selectedSearchType = l),
62
63
  size: "small",
@@ -64,7 +65,7 @@ function W(e, o, N, $, K, L) {
64
65
  disabled: ""
65
66
  }, {
66
67
  default: a(() => [
67
- (n(!0), d(u, null, c(e.defalutOptions, (l) => (n(), s(m, {
68
+ (t(!0), d(u, null, i(e.defalutOptions, (l) => (t(), s(m, {
68
69
  key: l.label,
69
70
  label: l.label,
70
71
  value: l.value
@@ -75,34 +76,34 @@ function W(e, o, N, $, K, L) {
75
76
  ]),
76
77
  key: "1"
77
78
  }
78
- ]), 1032, ["modelValue", "placeholder", "onChange", "onKeyup", "onPaste"]),
79
+ ]), 1032, ["modelValue", "placeholder", "onChange", "onKeyup", "onPaste", "onClear"]),
79
80
  b("div", E, [
80
- e.showWithinFilterCheckbox ? (n(), s(g, {
81
+ e.showWithinFilterCheckbox ? (t(), s(g, {
81
82
  key: 0,
82
83
  modelValue: e.isWithinFilterOptions,
83
84
  "onUpdate:modelValue": o[3] || (o[3] = (l) => e.isWithinFilterOptions = l),
84
85
  onChange: e.searchWithinFilterOptions
85
86
  }, {
86
87
  default: a(() => o[8] || (o[8] = [
87
- i(h("在筛选条件内查询"))
88
+ c(h("在筛选条件内查询"))
88
89
  ])),
89
90
  _: 1,
90
91
  __: [8]
91
92
  }, 8, ["modelValue", "onChange"])) : V("", !0),
92
- e.showPatchSearch ? (n(), s(v, {
93
+ e.showPatchSearch ? (t(), s(v, {
93
94
  key: 1,
94
95
  type: "primary",
95
96
  onClick: e.showBatchSearchDialog
96
97
  }, {
97
98
  default: a(() => o[9] || (o[9] = [
98
- i(h("批量查询"))
99
+ c(h("批量查询"))
99
100
  ])),
100
101
  _: 1,
101
102
  __: [9]
102
103
  }, 8, ["onClick"])) : V("", !0)
103
104
  ])
104
105
  ]),
105
- t(_, {
106
+ n(_, {
106
107
  modelValue: e.showBatchSearch,
107
108
  "onUpdate:modelValue": o[7] || (o[7] = (l) => e.showBatchSearch = l),
108
109
  title: "批量查询",
@@ -113,20 +114,20 @@ function W(e, o, N, $, K, L) {
113
114
  }, {
114
115
  footer: a(() => [
115
116
  b("div", P, [
116
- t(k, {
117
+ n(k, {
117
118
  type: "primary",
118
119
  loading: e.confirmLoading,
119
120
  onClick: e.confirmSearch
120
121
  }, {
121
122
  default: a(() => o[10] || (o[10] = [
122
- i(h("确认"))
123
+ c(h("确认"))
123
124
  ])),
124
125
  _: 1,
125
126
  __: [10]
126
127
  }, 8, ["loading", "onClick"]),
127
- t(k, { onClick: e.handleBatchSearchClose }, {
128
+ n(k, { onClick: e.handleBatchSearchClose }, {
128
129
  default: a(() => o[11] || (o[11] = [
129
- i(h("关闭"))
130
+ c(h("关闭"))
130
131
  ])),
131
132
  _: 1,
132
133
  __: [11]
@@ -134,17 +135,17 @@ function W(e, o, N, $, K, L) {
134
135
  ])
135
136
  ]),
136
137
  default: a(() => [
137
- t(F, {
138
+ n(F, {
138
139
  ref: "batchSearchFormRef",
139
140
  model: e.batchSearchForm,
140
141
  rules: e.rules
141
142
  }, {
142
143
  default: a(() => [
143
- t(S, { class: "row-class" }, {
144
+ n(S, { class: "row-class" }, {
144
145
  default: a(() => [
145
- t(y, { prop: "searchType" }, {
146
+ n(y, { prop: "searchType" }, {
146
147
  default: a(() => [
147
- e.showSelect ? (n(), s(p, {
148
+ e.showSelect ? (t(), s(p, {
148
149
  key: 0,
149
150
  modelValue: e.batchSearchForm.searchType,
150
151
  "onUpdate:modelValue": o[4] || (o[4] = (l) => e.batchSearchForm.searchType = l),
@@ -152,14 +153,14 @@ function W(e, o, N, $, K, L) {
152
153
  style: { width: "100px", "background-color": "white" }
153
154
  }, {
154
155
  default: a(() => [
155
- (n(!0), d(u, null, c(e.isBatchSelectOptionsSameWithInput ? e.options : e.batchOptions, (l) => (n(), s(m, {
156
+ (t(!0), d(u, null, i(e.isBatchSelectOptionsSameWithInput ? e.options : e.batchOptions, (l) => (t(), s(m, {
156
157
  key: l.label,
157
158
  label: l.label,
158
159
  value: l.value
159
160
  }, null, 8, ["label", "value"]))), 128))
160
161
  ]),
161
162
  _: 1
162
- }, 8, ["modelValue"])) : (n(), s(p, {
163
+ }, 8, ["modelValue"])) : (t(), s(p, {
163
164
  key: 1,
164
165
  modelValue: e.batchSearchForm.searchType,
165
166
  "onUpdate:modelValue": o[5] || (o[5] = (l) => e.batchSearchForm.searchType = l),
@@ -168,7 +169,7 @@ function W(e, o, N, $, K, L) {
168
169
  disabled: ""
169
170
  }, {
170
171
  default: a(() => [
171
- (n(!0), d(u, null, c(e.defalutOptions, (l) => (n(), s(m, {
172
+ (t(!0), d(u, null, i(e.defalutOptions, (l) => (t(), s(m, {
172
173
  key: l.label,
173
174
  label: l.label,
174
175
  value: l.value
@@ -182,14 +183,14 @@ function W(e, o, N, $, K, L) {
182
183
  ]),
183
184
  _: 1
184
185
  }),
185
- t(S, { class: "row-class" }, {
186
+ n(S, { class: "row-class" }, {
186
187
  default: a(() => [
187
- t(y, {
188
+ n(y, {
188
189
  prop: "searchContent",
189
190
  style: { width: "100%" }
190
191
  }, {
191
192
  default: a(() => [
192
- t(f, {
193
+ n(f, {
193
194
  modelValue: e.batchSearchForm.searchContent,
194
195
  "onUpdate:modelValue": o[6] || (o[6] = (l) => e.batchSearchForm.searchContent = l),
195
196
  placeholder: "请输入批量查询内容,从EXCEL复制可自动替换为`,`",
@@ -1,7 +1,7 @@
1
- import { defineComponent as K, toRefs as D, ref as c } from "vue";
2
- import S from "../_virtual/lodash.js";
3
- import { defaultComplexSearchProps as r } from "./props.js";
4
- import { ElLink as G, ElOption as H, ElButton as V, ElRow as _, ElFormItem as L, ElForm as P, ElIcon as q, ElDialog as j, ElSelect as Y, ElCheckbox as $, ElInput as z } from "element-plus";
1
+ import { defineComponent as R, toRefs as _, ref as n, watch as k } from "vue";
2
+ import v from "../_virtual/lodash.js";
3
+ import { defaultComplexSearchProps as l } from "./props.js";
4
+ import { ElLink as G, ElOption as P, ElButton as K, ElRow as V, ElFormItem as j, ElForm as q, ElIcon as Y, ElDialog as $, ElSelect as z, ElCheckbox as J, ElInput as M } 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";
@@ -18,166 +18,177 @@ import "element-plus/theme-chalk/src/form-item.scss";
18
18
  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
- import { Search as J } from "@element-plus/icons-vue";
22
- const Se = K({
21
+ import { Search as N } from "@element-plus/icons-vue";
22
+ const Ce = R({
23
23
  name: "YaheeComplexSearch",
24
- // 使用 components 选项注册所有 Element Plus 组件
25
24
  components: {
26
- ElInput: z,
27
- ElCheckbox: $,
28
- ElSelect: Y,
29
- ElDialog: j,
30
- ElIcon: q,
31
- ElForm: P,
32
- ElFormItem: L,
33
- ElRow: _,
34
- ElButton: V,
35
- ElOption: H,
25
+ ElInput: M,
26
+ ElCheckbox: J,
27
+ ElSelect: z,
28
+ ElDialog: $,
29
+ ElIcon: Y,
30
+ ElForm: q,
31
+ ElFormItem: j,
32
+ ElRow: V,
33
+ ElButton: K,
34
+ ElOption: P,
36
35
  ElLink: G,
37
- Search: J
36
+ Search: N
38
37
  },
39
38
  props: {
40
39
  defaultSearch: {
41
40
  type: String,
42
- default: r().defaultSearch
41
+ default: l().defaultSearch
43
42
  },
44
43
  options: {
45
44
  type: Array,
46
- default: r().options
45
+ default: l().options
47
46
  },
48
47
  placeholderText: {
49
48
  type: String,
50
- default: r().placeholderText
49
+ default: l().placeholderText
51
50
  },
52
51
  showPatchSearch: {
53
52
  type: Boolean,
54
- default: r().showPatchSearch
53
+ default: l().showPatchSearch
55
54
  },
56
55
  showWithinFilterCheckbox: {
57
56
  type: Boolean,
58
- default: r().showWithinFilterCheckbox
57
+ default: l().showWithinFilterCheckbox
59
58
  },
60
59
  specialOptions: {
61
60
  type: Array,
62
- default: r().specialOptions
61
+ default: l().specialOptions
63
62
  },
64
63
  normalOptions: {
65
64
  type: Array,
66
- default: r().normalOptions
65
+ default: l().normalOptions
67
66
  },
68
67
  showSelect: {
69
68
  type: Boolean,
70
- default: r().showSelect
69
+ default: l().showSelect
71
70
  },
72
71
  searchItem: {
73
72
  type: Object,
74
- default: r().searchItem
73
+ default: l().searchItem
75
74
  },
76
75
  isBatchSelectOptionsSameWithInput: {
77
76
  type: Boolean,
78
- default: r().isBatchSelectOptionsSameWithInput
77
+ default: l().isBatchSelectOptionsSameWithInput
79
78
  },
80
79
  batchOptions: {
81
80
  type: Array,
82
- default: r().batchOptions
81
+ default: l().batchOptions
83
82
  }
84
83
  },
85
- emits: ["filterChangeGrandson"],
86
- setup(v, { emit: u }) {
87
- const { specialOptions: y, normalOptions: F, searchItem: s } = D(v), l = c(v.defaultSearch || "WHOLE_SEARCH"), i = c(""), h = c(!1), f = c(!1), p = c(!1), m = c(null), o = c({ searchType: "WHOLE_SEARCH", searchContent: "" }), C = {
88
- selectedSearchType: [{ required: !0, message: "请输入查询类型", trigger: "blur" }],
84
+ emits: ["filterChangeGrandson", "update:searchItem"],
85
+ setup(y, { emit: p }) {
86
+ const { specialOptions: C, normalOptions: I, searchItem: E } = _(y), s = n(y.defaultSearch || "WHOLE_SEARCH"), o = n(""), i = n(!1), S = n(!1), u = n(!1), d = n(null), r = n({ searchType: "WHOLE_SEARCH", searchContent: "" }), T = [{ value: "WHOLE_SEARCH", label: "综合搜索" }], F = {
89
87
  searchContent: [{ required: !0, message: "请输入查询内容", trigger: "blur" }]
90
- }, g = [{ value: "WHOLE_SEARCH", label: "综合搜索" }], E = () => {
91
- p.value = !0;
92
- }, O = () => {
93
- p.value = !1;
88
+ }, c = n({ ...E.value });
89
+ k(
90
+ () => E.value,
91
+ (e) => {
92
+ c.value = { ...e }, g();
93
+ },
94
+ { deep: !0 }
95
+ );
96
+ const g = () => {
97
+ let e = {};
98
+ i.value ? e = {
99
+ ...c.value,
100
+ ...o.value ? { putSearch: o.value } : {},
101
+ searchType: s.value
102
+ } : e = {
103
+ ...c.value,
104
+ searchType: s.value
105
+ }, e.putSearch === "" && delete e.putSearch, console.log("左侧筛选条件变化,触发搜索:", e), p("filterChangeGrandson", e, s.value);
106
+ }, m = () => {
107
+ let e = {};
108
+ i.value ? e = {
109
+ ...c.value,
110
+ putSearch: o.value || "",
111
+ searchType: s.value
112
+ } : e = {
113
+ putSearch: o.value || "",
114
+ searchType: s.value
115
+ }, e.putSearch === "" && delete e.putSearch, console.log("搜索框变化,触发搜索:", e), p("filterChangeGrandson", e, s.value);
94
116
  }, b = () => {
95
- h.value || (delete s.value.putSearch, u("filterChangeGrandson", s.value, l.value));
96
- }, W = () => s.value, I = () => {
97
- i.value ? A() : u("filterChangeGrandson", W(), l.value);
98
- }, R = (a, e) => {
99
- const t = { ...a };
100
- return S.map(y.value, (n) => n.key).includes(e.filterKey) ? y.value.forEach((n) => delete t[n.key]) : delete t[e.filterKey], t;
101
- }, k = (a) => {
102
- S.forEach(a, (e) => {
103
- const t = R(s.value, e), { checkedValues: n, filterKey: d } = e;
104
- S.isEmpty(n) || (F.value.includes(d) ? t[d] = n[0] : t[d] = n), s.value = t;
105
- }), u("filterChangeGrandson", s.value, l.value);
106
- }, T = (a) => {
107
- i.value = x(a) || "";
108
- }, w = (a) => {
109
- const e = x(a);
110
- if (e) {
111
- const t = o.value.searchContent || "";
112
- t ? o.value.searchContent = `${t},${e}` : o.value.searchContent = e;
113
- }
114
- }, x = (a) => {
115
- var t;
116
- a.preventDefault();
117
- const e = (t = a.clipboardData) == null ? void 0 : t.getData("text/plain");
118
- return e == null ? void 0 : e.replace(/[\n\r\t]+/g, ",");
119
- }, A = () => {
120
- h.value ? k([
121
- { filterKey: "putSearch", checkedValues: i.value },
122
- { filterKey: "searchType", checkedValues: l.value }
123
- ]) : u(
124
- "filterChangeGrandson",
125
- { putSearch: i.value, searchType: l.value },
126
- l.value
127
- );
117
+ m();
118
+ }, w = () => {
119
+ o.value = "", m();
120
+ }, W = () => {
121
+ o.value ? m() : g();
122
+ }, x = () => {
123
+ u.value = !0;
128
124
  }, B = () => {
129
- m.value && m.value.validate((a) => {
130
- a && (f.value = !0, h.value ? k([
131
- { filterKey: "putSearch", checkedValues: o.value.searchContent },
132
- { filterKey: "searchType", checkedValues: o.value.searchType }
133
- ]) : u(
134
- "filterChangeGrandson",
135
- {
136
- putSearch: o.value.searchContent,
137
- searchType: o.value.searchType
138
- },
139
- l.value
140
- ), p.value = !1, f.value = !1);
141
- });
125
+ u.value = !1, r.value = { searchType: "WHOLE_SEARCH", searchContent: "" };
126
+ }, H = (e, t) => {
127
+ const a = { ...e };
128
+ return v.map(C.value, (h) => h.key).includes(t.filterKey) ? C.value.forEach((h) => delete a[h.key]) : delete a[t.filterKey], a;
129
+ }, A = (e) => {
130
+ let t = { ...c.value };
131
+ v.forEach(e, (a) => {
132
+ t = H(t, a);
133
+ const { checkedValues: h, filterKey: f } = a;
134
+ v.isEmpty(h) ? delete t[f] : I.value.includes(f) ? t[f] = h[0] : t[f] = h;
135
+ }), c.value = t, p("update:searchItem", t);
136
+ }, D = (e) => {
137
+ const t = O(e);
138
+ t !== null && (o.value = t, setTimeout(() => {
139
+ m();
140
+ }, 50));
141
+ }, L = (e) => {
142
+ const t = O(e);
143
+ if (t) {
144
+ const a = r.value.searchContent || "";
145
+ r.value.searchContent = a ? `${a},${t}` : t;
146
+ }
147
+ }, O = (e) => {
148
+ var a;
149
+ e.preventDefault();
150
+ const t = (a = e.clipboardData) == null ? void 0 : a.getData("text/plain");
151
+ return t == null ? void 0 : t.replace(/[\n\r\t]+/g, ",");
142
152
  };
143
153
  return {
144
- ...{
145
- selectedSearchType: l,
146
- putSearch: i,
147
- isWithinFilterOptions: h,
148
- confirmLoading: f,
149
- showBatchSearch: p,
150
- batchSearchFormRef: m,
151
- batchSearchForm: o,
152
- defalutOptions: g,
153
- rules: C,
154
- showBatchSearchDialog: E,
155
- handleBatchSearchClose: O,
156
- searchWithinFilterOptions: b,
157
- handleSearch: I,
158
- pasteFormatInput: T,
159
- confirmSearch: B,
160
- pasteFormat: w
154
+ selectedSearchType: s,
155
+ putSearch: o,
156
+ isWithinFilterOptions: i,
157
+ confirmLoading: S,
158
+ showBatchSearch: u,
159
+ batchSearchFormRef: d,
160
+ batchSearchForm: r,
161
+ defalutOptions: T,
162
+ rules: F,
163
+ showBatchSearchDialog: x,
164
+ handleBatchSearchClose: B,
165
+ searchWithinFilterOptions: W,
166
+ handleSearch: b,
167
+ handleClear: w,
168
+ pasteFormatInput: D,
169
+ confirmSearch: () => {
170
+ d.value && d.value.validate((e) => {
171
+ var t;
172
+ if (e && ((t = r.value.searchContent) != null && t.trim())) {
173
+ S.value = !0;
174
+ let a = {};
175
+ i.value ? a = {
176
+ ...c.value,
177
+ putSearch: r.value.searchContent.trim(),
178
+ searchType: r.value.searchType
179
+ } : a = {
180
+ putSearch: r.value.searchContent.trim(),
181
+ searchType: r.value.searchType
182
+ }, p("filterChangeGrandson", a, r.value.searchType), r.value = { searchType: "WHOLE_SEARCH", searchContent: "" }, u.value = !1, S.value = !1;
183
+ }
184
+ });
161
185
  },
162
- selectedSearchType: l,
163
- putSearch: i,
164
- isWithinFilterOptions: h,
165
- confirmLoading: f,
166
- showBatchSearch: p,
167
- batchSearchFormRef: m,
168
- batchSearchForm: o,
169
- defalutOptions: g,
170
- rules: C,
171
- showBatchSearchDialog: E,
172
- handleBatchSearchClose: O,
173
- searchWithinFilterOptions: b,
174
- handleSearch: I,
175
- pasteFormatInput: T,
176
- confirmSearch: B,
177
- pasteFormat: w
186
+ pasteFormat: L,
187
+ filterChange: A,
188
+ getSearchItem: () => c.value
178
189
  };
179
190
  }
180
191
  });
181
192
  export {
182
- Se as default
193
+ Ce as default
183
194
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "yahee-components",
3
3
  "private": false,
4
- "version": "0.0.88",
4
+ "version": "0.0.90",
5
5
  "description": "深圳前海亚讯前端组件库",
6
6
  "main": "lib",
7
7
  "module": "es",
@@ -1,3 +0,0 @@
1
- import { DefineComponent } from 'vue';
2
- declare const _default: DefineComponent;
3
- export default _default;
@@ -1,7 +0,0 @@
1
- import { SFCWithInstall } from '../utils/typescript';
2
- import { DefineComponent } from 'vue';
3
- export declare const YaheeComplexSearch: SFCWithInstall<DefineComponent> & Record<string, any>;
4
- export default YaheeComplexSearch;
5
- export * from './complex-search.vue';
6
- export * from './complex-search';
7
- export * from './props';