general-basic-form 1.0.27 → 1.0.29

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.
package/dist/index.js CHANGED
@@ -1,376 +1,102 @@
1
- import { defineComponent as k, inject as h, resolveComponent as d, openBlock as o, createBlock as c, mergeProps as b, withKeys as ne, createSlots as J, renderList as $, withCtx as f, resolveDynamicComponent as W, createCommentVNode as y, ref as g, unref as m, resolveDirective as U, withDirectives as C, createElementBlock as S, createVNode as T, createElementVNode as H, computed as j, onBeforeUnmount as oe, normalizeStyle as re, createTextVNode as I, toDisplayString as D, h as se, normalizeProps as ae, guardReactiveProps as le, Fragment as L, provide as O, renderSlot as Q, vShow as ie, watch as ue } from "vue";
2
- import { useRoute as ce } from "vue-router";
3
- const X = {
4
- placeholder: "请输入",
5
- style: "width: 200px",
6
- clearable: !0
7
- }, pe = {
8
- style: "width: 227px",
9
- "start-placeholder": "开始日期",
10
- "end-placeholder": "结束日期",
11
- type: "daterange"
12
- }, Y = {
13
- placeholder: "请选择",
14
- filterable: !0,
15
- clearable: !0,
16
- style: "width: 200px"
17
- }, me = k({
18
- components: {
19
- InputArchive: (e) => {
20
- const { templateEle: n } = e;
21
- return n();
1
+ function f(r, e, a, t, n, o, u, d) {
2
+ var s = typeof r == "function" ? r.options : r;
3
+ e && (s.render = e, s.staticRenderFns = a, s._compiled = !0), t && (s.functional = !0), o && (s._scopeId = "data-v-" + o);
4
+ var l;
5
+ if (u ? (l = function(i) {
6
+ i = i || // cached call
7
+ this.$vnode && this.$vnode.ssrContext || // stateful
8
+ this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext, !i && typeof __VUE_SSR_CONTEXT__ < "u" && (i = __VUE_SSR_CONTEXT__), n && n.call(this, i), i && i._registeredComponents && i._registeredComponents.add(u);
9
+ }, s._ssrRegister = l) : n && (l = d ? function() {
10
+ n.call(
11
+ this,
12
+ (s.functional ? this.parent : this).$root.$options.shadowRoot
13
+ );
14
+ } : n), l)
15
+ if (s.functional) {
16
+ s._injectStyles = l;
17
+ var h = s.render;
18
+ s.render = function(m, c) {
19
+ return l.call(c), h(m, c);
20
+ };
21
+ } else {
22
+ var p = s.beforeCreate;
23
+ s.beforeCreate = p ? [].concat(p, l) : [l];
22
24
  }
23
- },
25
+ return {
26
+ exports: r,
27
+ options: s
28
+ };
29
+ }
30
+ const y = {
24
31
  props: {
25
- item: null
26
- // null就是any
27
- },
28
- setup() {
29
- const e = h("queryParams", {}), n = h("getList"), t = h("size");
30
- return { queryParams: e, getList: n, size: t };
32
+ verificationSetting: {
33
+ type: Object,
34
+ default: () => {
35
+ }
36
+ },
37
+ getSmscode: {
38
+ type: Function,
39
+ default: () => {
40
+ }
41
+ }
31
42
  },
32
43
  data() {
33
44
  return {
34
- inputSetting: {
35
- ...X,
36
- ...this.item.inputSetting
37
- }
45
+ defaultText: this.verificationSetting.defaultText || "获取验证码",
46
+ buttonText: this.verificationSetting.defaultText || "获取验证码",
47
+ restTime: this.verificationSetting.restTime || 60,
48
+ timer: null
38
49
  };
39
50
  },
40
- // created() {
41
- // console.log("new", this.item);
42
- // console.log("new", this.inputSetting);
43
- // },
44
- methods: {
45
- currentInputComponent() {
46
- return "input-archive";
51
+ computed: {
52
+ buttonType() {
53
+ return this.buttonText === this.defaultText;
47
54
  }
48
- }
49
- // watch: {
50
- // item(val) {
51
- // console.log("item", val);
52
- // },
53
- // size(val) {
54
- // console.log(val);
55
- // },
56
- // },
57
- }), w = (e, n) => {
58
- const t = e.__vccOpts || e;
59
- for (const [a, l] of n)
60
- t[a] = l;
61
- return t;
62
- };
63
- function de(e, n, t, a, l, s) {
64
- const i = d("el-input");
65
- return o(), c(i, b({
66
- onKeydown: ne(e.getList, ["enter"]),
67
- modelValue: e.queryParams[e.item.prop],
68
- "onUpdate:modelValue": n[0] || (n[0] = (r) => e.queryParams[e.item.prop] = r),
69
- size: e.size
70
- }, e.inputSetting), J({ _: 2 }, [
71
- $(e.item.template, (r, _) => ({
72
- name: _,
73
- fn: f(() => [
74
- r ? (o(), c(W(e.currentInputComponent()), {
75
- key: _,
76
- templateEle: r
77
- }, null, 8, ["templateEle"])) : y("", !0)
78
- ])
79
- }))
80
- ]), 1040, ["onKeydown", "modelValue", "size"]);
81
- }
82
- const K = /* @__PURE__ */ w(me, [["render", de]]), _e = /* @__PURE__ */ k({
83
- __name: "index",
84
- props: {
85
- item: {}
86
55
  },
87
- setup(e) {
88
- const { item: n } = e, t = h("queryParams", {}), a = h("size"), l = g({
89
- ...X,
90
- ...n.inputSetting
91
- });
92
- return (s, i) => {
93
- const r = d("el-input-number");
94
- return o(), c(r, b({
95
- modelValue: m(t)[s.item.prop],
96
- "onUpdate:modelValue": i[0] || (i[0] = (_) => m(t)[s.item.prop] = _),
97
- size: m(a)
98
- }, l.value), null, 16, ["modelValue", "size"]);
99
- };
100
- }
101
- }), Z = Symbol(), fe = { class: "input-graphic-verification" }, ye = ["src", "alt"], he = /* @__PURE__ */ k({
102
- __name: "index",
103
- props: {
104
- item: {}
105
- },
106
- setup(e) {
107
- const { item: n } = e, {
108
- graphicSrc: t = "",
109
- graphicAlt: a = "",
110
- getGraphic: l = () => {
111
- },
112
- key: s
113
- } = n, { formLoading: i, updateFormLoading: r } = h(Z), _ = async () => {
114
- l && !i.value && await l();
115
- };
116
- return (p, P) => {
117
- const q = U("loading");
118
- return C((o(), S("div", fe, [
119
- T(K, {
120
- item: p.item,
121
- class: "input"
122
- }, null, 8, ["item"]),
123
- H("img", {
124
- class: "graphic",
125
- onClick: _,
126
- src: m(t),
127
- alt: m(a) || `${m(s)}`
128
- }, null, 8, ye)
129
- ])), [
130
- [q, m(i)]
131
- ]);
132
- };
133
- }
134
- });
135
- const ve = /* @__PURE__ */ w(he, [["__scopeId", "data-v-006751c3"]]), B = "获取验证码", ge = 60, be = /* @__PURE__ */ k({
136
- __name: "verification-button",
137
- props: {
138
- getSmscode: { type: Function }
56
+ destroyed() {
57
+ this.reset();
139
58
  },
140
- setup(e) {
141
- const { getSmscode: n } = e, t = g(B), a = g(null), l = j(() => t.value === B), s = () => {
142
- a && (clearInterval(a.value), a.value = null, t.value = B);
143
- }, i = async () => {
144
- if (t.value === B)
145
- if (t.value = ge, a.value = setInterval(() => {
146
- if (Number(t.value) <= 0 || !t.value) {
147
- s();
59
+ methods: {
60
+ reset() {
61
+ this.timer && (clearInterval(this.timer), this.timer = null, this.buttonText = this.defaultText);
62
+ },
63
+ async buttonClick() {
64
+ if (this.buttonText === this.defaultText)
65
+ if (this.buttonText = this.restTime, this.timer = setInterval(() => {
66
+ if (Number(this.buttonText) <= 0 || !this.buttonText) {
67
+ this.reset();
148
68
  return;
149
69
  } else
150
- t.value = Number(t.value) - 1;
151
- }, 1e3), n)
152
- await n() === !1 && s();
70
+ this.buttonText = Number(this.buttonText) - 1;
71
+ }, 1e3), this.getSmscode)
72
+ await this.getSmscode() === !1 && this.reset();
153
73
  else
154
74
  return;
155
- };
156
- return oe(() => {
157
- s();
158
- }), (r, _) => {
159
- const p = d("el-button");
160
- return o(), c(p, {
161
- class: "verifiaction-button",
162
- style: re({
163
- color: l.value ? "var(--color-primary, #409EFF)" : "var(--text-color-placeholder, #A8ABB2)",
164
- cursor: l.value ? "pointer" : "default"
165
- }),
166
- onClick: i
167
- }, {
168
- default: f(() => [
169
- I(D(l.value ? B : t.value + "s"), 1)
170
- ]),
171
- _: 1
172
- }, 8, ["style"]);
173
- };
174
- }
175
- });
176
- const ke = /* @__PURE__ */ w(be, [["__scopeId", "data-v-4074e137"]]), Se = /* @__PURE__ */ k({
177
- __name: "index",
178
- props: {
179
- item: {}
180
- },
181
- setup(e) {
182
- const { item: n } = e, t = n;
183
- return t.template = {
184
- append: () => se(ke, {
185
- getSmscode: t.getSmscode
186
- })
187
- }, (a, l) => (o(), c(K, {
188
- item: m(t),
189
- class: "input"
190
- }, null, 8, ["item"]));
191
- }
192
- }), ze = k({
193
- components: {
194
- slotArchive: (e) => {
195
- const { templateEle: n } = e;
196
- return n();
197
75
  }
198
- },
199
- props: {
200
- item: null
201
- // null就是any
202
- },
203
- setup() {
204
- },
205
- data() {
206
- return {
207
- dividerSetting: {
208
- ...this.item.dividerSetting
209
- }
210
- };
211
- },
212
- methods: {
213
- currentInputComponent() {
214
- return "slot-archive";
215
- }
216
- }
217
- });
218
- function $e(e, n, t, a, l, s) {
219
- const i = d("el-divider");
220
- return o(), c(i, ae(le(e.dividerSetting)), J({ _: 2 }, [
221
- $(e.item.template, (r, _) => ({
222
- name: _,
223
- fn: f(() => [
224
- r ? (o(), c(W(e.currentInputComponent()), {
225
- key: _,
226
- templateEle: r
227
- }, null, 8, ["templateEle"])) : y("", !0)
228
- ])
229
- }))
230
- ]), 1040);
231
- }
232
- const Pe = /* @__PURE__ */ w(ze, [["render", $e]]), qe = /* @__PURE__ */ k({
233
- __name: "index",
234
- props: {
235
- item: {}
236
- },
237
- setup(e) {
238
- const { item: n } = e, t = h("queryParams", {}), a = h("size"), l = g({
239
- ...n.radioGroupSetting
240
- });
241
- return (s, i) => {
242
- const r = d("el-radio"), _ = d("el-radio-group");
243
- return o(), c(_, b({
244
- modelValue: m(t)[s.item.prop],
245
- "onUpdate:modelValue": i[0] || (i[0] = (p) => m(t)[s.item.prop] = p),
246
- size: m(a)
247
- }, l.value), {
248
- default: f(() => [
249
- (o(!0), S(L, null, $(s.item.option || [], (p) => (o(), c(r, b({
250
- size: m(a),
251
- key: p.label
252
- }, p), {
253
- default: f(() => [
254
- I(D(p.value), 1)
255
- ]),
256
- _: 2
257
- }, 1040, ["size"]))), 128))
258
- ]),
259
- _: 1
260
- }, 16, ["modelValue", "size"]);
261
- };
262
- }
263
- }), Ve = /* @__PURE__ */ k({
264
- __name: "index",
265
- props: {
266
- item: {}
267
- },
268
- setup(e) {
269
- const { item: n } = e, t = h("queryParams", {}), a = h("size"), l = g({
270
- ...n.checkboxGroupSetting
271
- });
272
- return (s, i) => {
273
- const r = d("el-checkbox"), _ = d("el-checkbox-group");
274
- return o(), c(_, b({
275
- modelValue: m(t)[s.item.prop],
276
- "onUpdate:modelValue": i[0] || (i[0] = (p) => m(t)[s.item.prop] = p),
277
- size: m(a)
278
- }, l.value), {
279
- default: f(() => [
280
- (o(!0), S(L, null, $(s.item.option || [], (p) => (o(), c(r, b({
281
- size: m(a),
282
- key: p.label
283
- }, p), {
284
- default: f(() => [
285
- I(D(p.value), 1)
286
- ]),
287
- _: 2
288
- }, 1040, ["size"]))), 128))
289
- ]),
290
- _: 1
291
- }, 16, ["modelValue", "size"]);
292
- };
293
- }
294
- }), Ie = /* @__PURE__ */ k({
295
- __name: "index",
296
- props: {
297
- item: {}
298
- },
299
- setup(e) {
300
- const { item: n } = e, t = h("queryParams", {}), a = h("size"), l = g({
301
- ...pe,
302
- ...n.datePackerSetting
303
- });
304
- return (s, i) => {
305
- const r = d("el-date-picker");
306
- return o(), c(r, b({
307
- modelValue: m(t)[s.item.prop],
308
- "onUpdate:modelValue": i[0] || (i[0] = (_) => m(t)[s.item.prop] = _),
309
- size: m(a)
310
- }, l.value), null, 16, ["modelValue", "size"]);
311
- };
312
76
  }
313
- }), Le = /* @__PURE__ */ k({
314
- __name: "index",
315
- props: {
316
- item: {}
317
- },
318
- setup(e) {
319
- const { item: n } = e, t = h("queryParams", {}), a = h("size"), l = g({
320
- ...Y,
321
- ...n.selectSetting
322
- });
323
- return (s, i) => {
324
- const r = d("el-option"), _ = d("el-select");
325
- return o(), c(_, b({
326
- modelValue: m(t)[s.item.prop],
327
- "onUpdate:modelValue": i[0] || (i[0] = (p) => m(t)[s.item.prop] = p),
328
- size: m(a)
329
- }, l.value), {
330
- default: f(() => [
331
- (o(!0), S(L, null, $(s.item.option || [], (p) => (o(), c(r, {
332
- key: p.value,
333
- label: p.label,
334
- value: p.value
335
- }, null, 8, ["label", "value"]))), 128))
336
- ]),
337
- _: 1
338
- }, 16, ["modelValue", "size"]);
339
- };
340
- }
341
- }), Ce = /* @__PURE__ */ k({
342
- __name: "index",
343
- props: {
344
- item: {}
345
- },
346
- setup(e) {
347
- const { item: n } = e, t = h("queryParams", {}), a = h("size"), l = g({
348
- ...Y,
349
- ...n.selectSetting
350
- });
351
- return (s, i) => {
352
- const r = d("el-cascader");
353
- return o(), c(r, b({
354
- modelValue: m(t)[s.item.prop],
355
- "onUpdate:modelValue": i[0] || (i[0] = (_) => m(t)[s.item.prop] = _),
356
- size: m(a),
357
- options: s.item.options || []
358
- }, l.value), null, 16, ["modelValue", "size", "options"]);
359
- };
360
- }
361
- }), De = k({
77
+ };
78
+ var _ = function() {
79
+ var e = this, a = e._self._c;
80
+ return a("el-button", { on: { click: e.buttonClick } }, [e._v(e._s(e.buttonType ? e.defaultText : e.buttonText + "s"))]);
81
+ }, g = [], b = /* @__PURE__ */ f(
82
+ y,
83
+ _,
84
+ g,
85
+ !1,
86
+ null,
87
+ null,
88
+ null,
89
+ null
90
+ );
91
+ const v = b.exports;
92
+ const S = {
362
93
  name: "GeneralBasicForm",
363
94
  components: {
364
- Input: K,
365
- InputNumber: _e,
366
- InputGraphicVerification: ve,
367
- InputMobileVerification: Se,
368
- Divider: Pe,
369
- Radio: qe,
370
- Checkbox: Ve,
371
- DatePicker: Ie,
372
- Select: Le,
373
- Cascader: Ce
95
+ InputArchive: (r) => {
96
+ const { templateEle: e } = r;
97
+ return e();
98
+ },
99
+ VerificationButton: v
374
100
  },
375
101
  props: {
376
102
  showSearch: {
@@ -433,40 +159,52 @@ const Pe = /* @__PURE__ */ w(ze, [["render", $e]]), qe = /* @__PURE__ */ k({
433
159
  }
434
160
  },
435
161
  data() {
162
+ var r;
436
163
  return {
164
+ queryParams: {
165
+ ...this.noUrlParameters ? {} : (r = this.$route) == null ? void 0 : r.query
166
+ },
167
+ // form表单数据
437
168
  formLoading: this.loading || !1,
438
- trimRegex: /\S/
439
- };
440
- },
441
- setup(e) {
442
- const { size: n, noUrlParameters: t, getList: a } = e, l = ce(), s = g({
443
- ...t ? {} : l == null ? void 0 : l.query
444
- });
445
- return O(
446
- /* 注入名 */
447
- "queryParams",
448
- /* 值 */
449
- s
450
- ), O(
451
- /* 注入名 */
452
- "size",
453
- /* 值 */
454
- n
455
- ), O(
456
- /* 注入名 */
457
- "getList",
458
- /* 值 */
459
- a
460
- ), {
461
- queryParams: s
169
+ selectSetting: {
170
+ placeholder: "请选择",
171
+ filterable: !0,
172
+ clearable: !0,
173
+ style: "width: 200px"
174
+ },
175
+ inputSetting: {
176
+ placeholder: "请输入",
177
+ style: "width: 200px",
178
+ clearable: !0
179
+ },
180
+ datePackerSetting: {
181
+ style: "width: 227px",
182
+ "start-placeholder": "开始日期",
183
+ "end-placeholder": "结束日期",
184
+ type: "daterange"
185
+ }
462
186
  };
463
187
  },
188
+ // setup(props) {
189
+ //设置默认值
190
+ // console.log(props);
191
+ // // const { formItem } = toRefs(props);
192
+ // const { formItem } = props;
193
+ // console.log(formItem);
194
+ // const queryParams = {};
195
+ // formItem.forEach((item) => {
196
+ // queryParams[item.prop] = "";
197
+ // });
198
+ // return {
199
+ // queryParams,
200
+ // };
201
+ // },
464
202
  watch: {
465
203
  formData: {
466
- handler(e, n) {
467
- JSON.stringify(e) !== JSON.stringify(n) && (this.queryParams = {
204
+ handler(r, e) {
205
+ JSON.stringify(r) !== JSON.stringify(e) && (this.queryParams = {
468
206
  ...this.noUrlParameters ? {} : this.queryParams,
469
- ...e
207
+ ...r
470
208
  });
471
209
  },
472
210
  // watch 默认是懒执行的:仅当数据源变化时,才会执行回调。但在某些场景中,我们希望在创建侦听器时,立即执行一遍回调。举例来说,我们想请求一些初始数据,然后在相关状态更改时重新请求数据。
@@ -475,335 +213,120 @@ const Pe = /* @__PURE__ */ w(ze, [["render", $e]]), qe = /* @__PURE__ */ k({
475
213
  // deep: true,
476
214
  },
477
215
  queryParams: {
478
- handler(e) {
479
- this.$emit("update:formData", e);
216
+ handler(r) {
217
+ this.$emit("update:formData", r);
480
218
  },
481
219
  deep: !0
482
220
  },
483
- loading(e) {
484
- this.formLoading !== e && (this.formLoading = e);
221
+ loading(r) {
222
+ this.formLoading !== r && (this.formLoading = r);
485
223
  },
486
- formLoading(e) {
487
- this.loading !== e && this.$emit("update:loading", e);
224
+ formLoading(r) {
225
+ this.loading !== r && this.$emit("update:loading", r);
488
226
  }
489
227
  },
490
- provide() {
491
- return {
492
- // 显式提供一个计算属性
493
- [Z]: {
494
- formLoading: j(() => this.formLoading),
495
- updateFormLoading: (e) => {
496
- this.formLoading = e;
497
- }
498
- }
499
- };
500
- },
501
228
  methods: {
502
229
  /** 搜索按钮操作 */
503
230
  handleQuery() {
504
- var t;
505
- const e = { page: 1, limit: 10 }, n = {
506
- ...(t = this.$route) == null ? void 0 : t.query,
231
+ var a;
232
+ const r = { page: 1, limit: 10 }, e = {
233
+ ...(a = this.$route) == null ? void 0 : a.query,
507
234
  ...this.queryParams,
508
- ...e
235
+ ...r
509
236
  };
510
237
  this.noUrlParameters || this.$router.push({
511
- query: { ...n }
238
+ query: { ...e }
512
239
  }), this.getList({
513
- ...n
240
+ ...e
514
241
  });
515
242
  },
516
243
  /** 重置按钮操作 */
517
244
  async resetQuery() {
518
- var n;
245
+ var e;
519
246
  this.$refs.queryFormRef.resetFields();
520
- const e = { page: 1 };
247
+ const r = { page: 1 };
521
248
  this.noUrlParameters || await this.$router.push({
522
- query: { ...e }
249
+ query: { ...r }
523
250
  }), this.queryParams = {
524
- ...this.noUrlParameters ? {} : (n = this.$route) == null ? void 0 : n.query
251
+ ...this.noUrlParameters ? {} : (e = this.$route) == null ? void 0 : e.query
525
252
  }, this.afterReset(), this.handleQuery();
526
253
  },
527
- getItemRules(e) {
528
- const { type: n, rules: t = [] } = e, a = [...t];
529
- return this.noInputBlank && n === "input" && a.push({
254
+ currentInputComponent() {
255
+ return "input-archive";
256
+ },
257
+ getItemRules(r) {
258
+ const { type: e, rules: a = [] } = r, t = [...a];
259
+ return this.noInputBlank && e === "input" && t.push({
530
260
  pattern: this.trimRegex,
531
261
  message: "请输入(不能仅输入空格)",
532
262
  trigger: "blur"
533
- }), a;
534
- }
535
- }
536
- });
537
- function we(e, n, t, a, l, s) {
538
- const i = d("Input"), r = d("Radio"), _ = d("Select"), p = d("Divider"), P = d("Cascader"), q = d("Checkbox"), F = d("DatePicker"), G = d("InputNumber"), N = d("InputMobileVerification"), x = d("InputGraphicVerification"), V = d("el-form-item"), R = d("el-button"), E = d("el-form"), v = U("loading");
539
- return C((o(), c(E, b({
540
- model: e.queryParams,
541
- ref: "queryFormRef",
542
- inline: "",
543
- "label-position": "left",
544
- "label-width": e.labelWidth
545
- }, e.$attrs), {
546
- default: f(() => [
547
- (o(!0), S(L, null, $(e.formItem, (u) => (o(), c(V, {
548
- label: u.label,
549
- prop: u.prop,
550
- key: u.prop,
551
- rules: e.getItemRules(u)
552
- }, {
553
- default: f(() => [
554
- u.type === "input" ? (o(), c(i, {
555
- key: 0,
556
- item: u
557
- }, null, 8, ["item"])) : y("", !0),
558
- u.type === "radio" ? (o(), c(r, {
559
- key: 1,
560
- item: u
561
- }, null, 8, ["item"])) : y("", !0),
562
- u.type === "select" ? (o(), c(_, {
563
- key: 2,
564
- item: u
565
- }, null, 8, ["item"])) : y("", !0),
566
- u.type === "divider" ? (o(), c(p, {
567
- key: 3,
568
- item: u
569
- }, null, 8, ["item"])) : y("", !0),
570
- u.type === "cascader" ? (o(), c(P, {
571
- key: 4,
572
- item: u
573
- }, null, 8, ["item"])) : y("", !0),
574
- u.type === "checkbox" ? (o(), c(q, {
575
- key: 5,
576
- item: u
577
- }, null, 8, ["item"])) : y("", !0),
578
- u.type === "date-picker" ? (o(), c(F, {
579
- key: 6,
580
- item: u
581
- }, null, 8, ["item"])) : y("", !0),
582
- u.type === "input-number" ? (o(), c(G, {
583
- key: 7,
584
- item: u
585
- }, null, 8, ["item"])) : y("", !0),
586
- u.type === "form-item-slot" ? Q(e.$slots, u.name, { key: 8 }) : y("", !0),
587
- u.type === "input-mobile-verification" ? (o(), c(N, {
588
- key: 9,
589
- item: u
590
- }, null, 8, ["item"])) : y("", !0),
591
- u.type === "input-graphic-verification" ? (o(), c(x, {
592
- item: u,
593
- key: u.key
594
- }, null, 8, ["item"])) : y("", !0)
595
- ]),
596
- _: 2
597
- }, 1032, ["label", "prop", "rules"]))), 128)),
598
- Q(e.$slots, "default"),
599
- e.formOnly ? y("", !0) : (o(), c(V, { key: 0 }, {
600
- default: f(() => [
601
- C((o(), c(R, {
602
- type: "primary",
603
- size: e.size,
604
- onClick: e.handleQuery
605
- }, {
606
- default: f(() => [
607
- I("查询")
608
- ]),
609
- _: 1
610
- }, 8, ["size", "onClick"])), [
611
- [v, e.formLoading]
612
- ]),
613
- T(R, {
614
- size: e.size,
615
- onClick: e.resetQuery
616
- }, {
617
- default: f(() => [
618
- I("重置")
619
- ]),
620
- _: 1
621
- }, 8, ["size", "onClick"])
622
- ]),
623
- _: 1
624
- })),
625
- Q(e.$slots, "behind-the-button")
626
- ]),
627
- _: 3
628
- }, 16, ["model", "label-width"])), [
629
- [ie, e.showSearch]
630
- ]);
631
- }
632
- const xe = /* @__PURE__ */ w(De, [["render", we]]), Be = ["infinite-scroll-disabled"], Fe = ["infinite-scroll-disabled"], Re = { class: "checkbox" }, Ue = /* @__PURE__ */ k({
633
- __name: "InfiniteScrollList",
634
- props: {
635
- search: {
636
- type: Function,
637
- required: !0
638
- },
639
- checkbox: {
640
- type: Boolean,
641
- required: !1
642
- },
643
- id: {
644
- type: String,
645
- required: !0
646
- },
647
- name: {
648
- type: String,
649
- required: !0
263
+ }), t;
650
264
  },
651
- extra: {
652
- type: null,
653
- required: !1
265
+ getInputSetting(r) {
266
+ const { inputSetting: e } = r;
267
+ return {
268
+ ...this.inputSetting,
269
+ ...e
270
+ };
654
271
  },
655
- defaultSelection: {
656
- type: Array,
657
- required: !1
658
- }
659
- },
660
- setup(e, { expose: n }) {
661
- const t = e, { search: a, id: l, name: s, extra: i } = t, r = g([]), _ = g(1), p = g(!1), P = g([]), q = g(!1), F = (v, u) => {
662
- const { i: A } = v;
663
- return i && i !== "false" ? i(A) : "";
664
- }, G = (v) => {
665
- P.value = v.map((u) => typeof u == "object" ? u[l] : u);
666
- };
667
- ue(
668
- () => t.defaultSelection,
669
- (v = [], u = []) => {
670
- G(v);
671
- },
672
- { immediate: !0 }
673
- );
674
- const N = () => {
675
- x(), P.value = [];
676
- }, x = () => {
677
- _.value = 1, r.value = [], p.value = !1;
678
- }, V = async () => {
679
- if (q.value || p.value)
680
- return;
681
- q.value = !0;
682
- const v = await a(_.value);
683
- v && v.length > 0 ? (r.value = [...r.value, ...v], _.value += 1) : p.value = !0, q.value = !1;
684
- }, R = () => {
685
- x(), V();
686
- }, E = j(
687
- () => r.value.filter((v) => P.value.includes(v[l]))
688
- ) || {};
689
- return n({
690
- reset: N,
691
- lowReset: x,
692
- loadList: V,
693
- selectInfo: E,
694
- list: r,
695
- ifbottom: p,
696
- refreshList: R
697
- }), (v, u) => {
698
- const A = d("el-checkbox"), ee = d("el-checkbox-group"), M = U("infinite-scroll"), te = U("loading");
699
- return t.checkbox ? C((o(), c(ee, b({
700
- key: 0,
701
- modelValue: P.value,
702
- "onUpdate:modelValue": u[0] || (u[0] = (z) => P.value = z)
703
- }, t), {
704
- default: f(() => [
705
- C((o(), S("ul", {
706
- class: "list",
707
- "infinite-scroll-disabled": p.value
708
- }, [
709
- (o(!0), S(L, null, $(r.value, (z) => (o(), S("li", {
710
- key: z[m(l)],
711
- class: "list-item"
712
- }, [
713
- T(A, {
714
- label: z[m(l)],
715
- class: "checkbox"
716
- }, {
717
- default: f(() => [
718
- I(D(z[m(s)]) + " ", 1),
719
- t.extra ? (o(), c(F, {
720
- key: 0,
721
- i: z
722
- }, null, 8, ["i"])) : y("", !0)
723
- ]),
724
- _: 2
725
- }, 1032, ["label"])
726
- ]))), 128))
727
- ], 8, Be)), [
728
- [M, V]
729
- ])
730
- ]),
731
- _: 1
732
- }, 16, ["modelValue"])), [
733
- [te, q.value]
734
- ]) : C((o(), S("ul", b({
735
- key: 1,
736
- class: "list",
737
- "infinite-scroll-disabled": p.value
738
- }, t), [
739
- (o(!0), S(L, null, $(r.value, (z) => (o(), S("li", {
740
- key: z[m(l)],
741
- class: "list-item"
742
- }, [
743
- H("div", Re, [
744
- I(D(z[m(s)]) + " ", 1),
745
- t.extra ? (o(), c(F, {
746
- key: 0,
747
- i: z
748
- }, null, 8, ["i"])) : y("", !0)
749
- ])
750
- ]))), 128))
751
- ], 16, Fe)), [
752
- [M, V]
753
- ]);
754
- };
755
- }
756
- });
757
- const Ge = /* @__PURE__ */ w(Ue, [["__scopeId", "data-v-fa74e9b9"]]), Ne = { key: 1 }, Ee = /* @__PURE__ */ k({
758
- __name: "Descriptions",
759
- props: {
760
- formData: {
761
- type: Object,
762
- required: !0
272
+ getSelectSetting(r) {
273
+ const { selectSetting: e } = r;
274
+ return {
275
+ ...this.selectSetting,
276
+ ...e
277
+ };
763
278
  },
764
- formItem: {
765
- type: Array,
766
- required: !0
279
+ getDatePackerSetting(r) {
280
+ const { datePackerSetting: e } = r;
281
+ return {
282
+ ...this.datePackerSetting,
283
+ ...e
284
+ };
767
285
  }
768
- },
769
- setup(e) {
770
- const n = e, t = (a, l) => {
771
- const { i: s, render: i, formData: r } = a;
772
- return i({
773
- row: r,
774
- $index: s
775
- });
776
- };
777
- return (a, l) => {
778
- const s = d("el-descriptions-item"), i = d("el-descriptions");
779
- return o(), c(i, b({
780
- column: 1,
781
- border: "",
782
- class: "form-width"
783
- }, n), {
784
- default: f(() => [
785
- (o(!0), S(L, null, $(n.formItem, (r, _) => (o(), c(s, b({
786
- key: r.prop,
787
- label: r.label
788
- }, r.descriptionsItemProps), {
789
- default: f(() => [
790
- r.render ? (o(), c(t, {
791
- key: 0,
792
- i: _,
793
- render: r.render,
794
- formData: e.formData
795
- }, null, 8, ["i", "render", "formData"])) : (o(), S("span", Ne, D(e.formData[r.prop]), 1))
796
- ]),
797
- _: 2
798
- }, 1040, ["label"]))), 128))
799
- ]),
800
- _: 1
801
- }, 16);
802
- };
803
286
  }
804
- }), Qe = xe, Te = Ge, je = Ee;
287
+ };
288
+ var k = function() {
289
+ var e = this, a = e._self._c;
290
+ return a("el-form", e._b({ directives: [{ name: "show", rawName: "v-show", value: e.showSearch, expression: "showSearch" }], ref: "queryFormRef", attrs: { model: e.queryParams, inline: "", "label-position": "left", "label-width": e.labelWidth } }, "el-form", e.$attrs, !1), [e._l(e.formItem, function(t) {
291
+ return a("el-form-item", { key: t.prop, attrs: { label: t.label, prop: t.prop, rules: e.getItemRules(t) } }, [t.type === "input" ? a("el-input", e._b({ attrs: { size: e.size }, on: { keydown: function(n) {
292
+ return !n.type.indexOf("key") && e._k(n.keyCode, "enter", 13, n.key, "Enter") ? null : e.getList.apply(null, arguments);
293
+ } }, scopedSlots: e._u([e._l(t.template, function(n, o) {
294
+ return { key: o, fn: function() {
295
+ return [n ? a(e.currentInputComponent(), { key: o, tag: "component", attrs: { templateEle: n } }) : e._e()];
296
+ }, proxy: !0 };
297
+ })], null, !0), model: { value: e.queryParams[t.prop], callback: function(n) {
298
+ e.$set(e.queryParams, t.prop, n);
299
+ }, expression: "queryParams[item.prop]" } }, "el-input", e.getInputSetting(t), !1)) : t.type === "input-mobile-verification" ? a("el-input", e._b({ attrs: { size: e.size }, on: { keydown: function(n) {
300
+ return !n.type.indexOf("key") && e._k(n.keyCode, "enter", 13, n.key, "Enter") ? null : e.getList.apply(null, arguments);
301
+ } }, scopedSlots: e._u([e._l(t.template, function(n, o) {
302
+ return { key: o, fn: function() {
303
+ return [n ? a(e.currentInputComponent(), { key: o, tag: "component", attrs: { templateEle: n } }) : e._e()];
304
+ }, proxy: !0 };
305
+ })], null, !0), model: { value: e.queryParams[t.prop], callback: function(n) {
306
+ e.$set(e.queryParams, t.prop, n);
307
+ }, expression: "queryParams[item.prop]" } }, "el-input", e.getInputSetting(t), !1), [a("template", { slot: "append" }, [a("verification-button", { attrs: { verificationSetting: t.verificationSetting, getSmscode: t.getSmscode } })], 1)], 2) : t.type === "select" ? a("el-select", e._b({ attrs: { filterable: "", size: e.size }, model: { value: e.queryParams[t.prop], callback: function(n) {
308
+ e.$set(e.queryParams, t.prop, n);
309
+ }, expression: "queryParams[item.prop]" } }, "el-select", e.getSelectSetting(t), !1), e._l(t.option || [], function(n) {
310
+ return a("el-option", { key: n.value, attrs: { label: n.desc, value: n.value } });
311
+ }), 1) : t.type === "cascader" ? a("el-cascader", e._b({ attrs: { filterable: "", size: e.size, options: t.options || [] }, model: { value: e.queryParams[t.prop], callback: function(n) {
312
+ e.$set(e.queryParams, t.prop, n);
313
+ }, expression: "queryParams[item.prop]" } }, "el-cascader", e.getSelectSetting(t), !1)) : t.type === "date-picker" ? a("el-date-picker", e._b({ attrs: { size: e.size }, model: { value: e.queryParams[t.prop], callback: function(n) {
314
+ e.$set(e.queryParams, t.prop, n);
315
+ }, expression: "queryParams[item.prop]" } }, "el-date-picker", e.getDatePackerSetting(t), !1)) : e._e(), t.type === "input-number" ? a("el-input-number", e._b({ attrs: { size: e.size }, model: { value: e.queryParams[t.prop], callback: function(n) {
316
+ e.$set(e.queryParams, t.prop, n);
317
+ }, expression: "queryParams[item.prop]" } }, "el-input-number", e.getInputSetting(t), !1)) : e._e()], 1);
318
+ }), e._t("default"), e.formOnly ? e._e() : a("el-form-item", [a("el-button", { directives: [{ name: "loading", rawName: "v-loading", value: e.formLoading, expression: "formLoading" }], attrs: { type: "primary", icon: "el-icon-search", size: e.size }, on: { click: e.handleQuery } }, [e._v("查询")]), a("el-button", { attrs: { icon: "el-icon-refresh", size: e.size }, on: { click: e.resetQuery } }, [e._v("重置")])], 1)], 2);
319
+ }, P = [], q = /* @__PURE__ */ f(
320
+ S,
321
+ k,
322
+ P,
323
+ !1,
324
+ null,
325
+ "a9566079",
326
+ null,
327
+ null
328
+ );
329
+ const x = q.exports, T = x;
805
330
  export {
806
- je as VDescriptions,
807
- Qe as VGeneralBasicForm,
808
- Te as VInfiniteScrollList
331
+ T as VGeneralBasicForm
809
332
  };