general-basic-form 2.0.52 → 2.0.53

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.
Files changed (35) hide show
  1. package/README.assets/image-20210820173738506.png +0 -0
  2. package/README.md +1 -0
  3. package/package.json +3 -14
  4. package/script/link.ts +36 -0
  5. package/script/unlink.ts +45 -0
  6. package/src/Descriptions.vue +106 -0
  7. package/src/GeneralBasicForm.vue +277 -0
  8. package/src/InfiniteScrollList.vue +170 -0
  9. package/src/assets/image-20210820173037871.png +0 -0
  10. package/src/assets/logo.png +0 -0
  11. package/src/components/CustomCom/img-mask/index.vue +79 -0
  12. package/src/components/CustomCom/input-graphic-verification/index.vue +82 -0
  13. package/src/components/CustomCom/input-mobile-verification/index.vue +52 -0
  14. package/src/components/CustomCom/input-mobile-verification/verification-button.vue +81 -0
  15. package/src/components/VABasic/input/index.vue +75 -0
  16. package/src/components/VBasic/cascader/index.vue +32 -0
  17. package/src/components/VBasic/checkbox/index.vue +37 -0
  18. package/src/components/VBasic/date-picker/index.vue +31 -0
  19. package/src/components/VBasic/divider/index.vue +53 -0
  20. package/src/components/VBasic/input/index.vue +67 -0
  21. package/src/components/VBasic/input-number/index.vue +31 -0
  22. package/src/components/VBasic/radio/index.vue +37 -0
  23. package/src/components/VBasic/select/index.vue +37 -0
  24. package/src/components/setting.ts +28 -0
  25. package/src/index.ts +30 -0
  26. package/src/injectKey.ts +2 -0
  27. package/src/types/basicFrom.ts +63 -0
  28. package/src/types/componentType.ts +6 -0
  29. package/src/types/componentsProps.ts +18 -0
  30. package/tsconfig.json +14 -0
  31. package/vite.config.js +123 -0
  32. package/dist/index.js +0 -968
  33. package/dist/index.umd.cjs +0 -1
  34. package/dist/style.css +0 -1
  35. /package/{dist → public}/index.d.ts +0 -0
package/dist/index.js DELETED
@@ -1,968 +0,0 @@
1
- import { defineComponent as b, inject as f, resolveComponent as d, openBlock as o, createBlock as u, mergeProps as v, withKeys as Z, createSlots as X, renderList as V, withCtx as _, resolveDynamicComponent as w, createCommentVNode as g, ref as S, unref as m, onMounted as le, createElementBlock as k, computed as N, shallowRef as T, onBeforeUnmount as ue, createTextVNode as L, toDisplayString as E, h as J, normalizeProps as ce, guardReactiveProps as pe, Fragment as x, provide as j, resolveDirective as Q, withDirectives as A, renderSlot as K, createVNode as ee, vShow as me, watch as de, createElementVNode as fe } from "vue";
2
- import { useRoute as ye } from "vue-router";
3
- const Y = {
4
- placeholder: "请输入",
5
- style: "width: 200px",
6
- clearable: !0
7
- }, he = {
8
- style: "width: 227px",
9
- "start-placeholder": "开始日期",
10
- "end-placeholder": "结束日期",
11
- type: "daterange"
12
- }, te = {
13
- placeholder: "请选择",
14
- filterable: !0,
15
- clearable: !0,
16
- style: "width: 200px"
17
- }, _e = b({
18
- components: {
19
- InputArchive: (e) => {
20
- const { templateEle: t } = e;
21
- return t();
22
- }
23
- },
24
- props: {
25
- item: null
26
- // null就是any
27
- },
28
- setup() {
29
- const e = f("queryParams", {}), t = f("getList"), n = f("size", "default");
30
- return { queryParams: e, getList: t, size: n };
31
- },
32
- data() {
33
- return {
34
- inputSetting: {
35
- ...Y,
36
- ...this.item.inputSetting,
37
- ...this.item.setting
38
- }
39
- };
40
- },
41
- // created() {
42
- // console.log("new", this.item);
43
- // console.log("new", this.inputSetting);
44
- // },
45
- methods: {
46
- currentInputComponent() {
47
- return "input-archive";
48
- }
49
- }
50
- // watch: {
51
- // item(val) {
52
- // console.log("item", val);
53
- // },
54
- // size(val) {
55
- // console.log(val);
56
- // },
57
- // },
58
- }), F = (e, t) => {
59
- const n = e.__vccOpts || e;
60
- for (const [a, r] of t)
61
- n[a] = r;
62
- return n;
63
- };
64
- function ge(e, t, n, a, r, l) {
65
- const c = d("el-input");
66
- return o(), u(c, v({
67
- onKeydown: Z(e.getList, ["enter"]),
68
- modelValue: e.queryParams[e.item.prop],
69
- "onUpdate:modelValue": t[0] || (t[0] = (s) => e.queryParams[e.item.prop] = s),
70
- size: e.size
71
- }, e.inputSetting), X({ _: 2 }, [
72
- V(e.item.template, (s, i) => ({
73
- name: i,
74
- fn: _(() => [
75
- s ? (o(), u(w(e.currentInputComponent()), {
76
- key: i,
77
- templateEle: s
78
- }, null, 8, ["templateEle"])) : g("", !0)
79
- ])
80
- }))
81
- ]), 1040, ["onKeydown", "modelValue", "size"]);
82
- }
83
- const U = /* @__PURE__ */ F(_e, [["render", ge]]), ve = /* @__PURE__ */ b({
84
- __name: "index",
85
- props: {
86
- item: {}
87
- },
88
- setup(e) {
89
- const t = f("queryParams", {}), n = f("size"), a = S({
90
- ...Y,
91
- ...e.item.inputSetting,
92
- ...e.item.setting
93
- });
94
- return (r, l) => {
95
- const c = d("el-input-number");
96
- return o(), u(c, v({
97
- modelValue: m(t)[r.item.prop],
98
- "onUpdate:modelValue": l[0] || (l[0] = (s) => m(t)[r.item.prop] = s),
99
- size: m(n)
100
- }, a.value), null, 16, ["modelValue", "size"]);
101
- };
102
- }
103
- }), be = b({
104
- components: {
105
- InputArchive: (e) => {
106
- const { templateEle: t } = e;
107
- return t();
108
- }
109
- },
110
- props: {
111
- item: null
112
- // null就是any
113
- },
114
- setup() {
115
- const e = f("queryParams", {}), t = f("getList", () => {
116
- }), n = f("size", "default"), r = f("Form").useInjectFormItemContext();
117
- return { queryParams: e, getList: t, size: n, formItemContext: r };
118
- },
119
- data() {
120
- return {
121
- inputSetting: {
122
- ...Y,
123
- ...this.item.inputSetting,
124
- ...this.item.setting
125
- }
126
- };
127
- },
128
- // created() {
129
- // console.log("new", this.item);
130
- // console.log("new", this.inputSetting);
131
- // },
132
- methods: {
133
- currentInputComponent() {
134
- return "input-archive";
135
- },
136
- onInputChange(e) {
137
- this.queryParams[this.item.prop] = e.target.value, this.formItemContext.onFieldChange();
138
- }
139
- }
140
- // watch: {
141
- // item(val) {
142
- // console.log("item", val);
143
- // },
144
- // size(val) {
145
- // console.log(val);
146
- // },
147
- // },
148
- });
149
- function ke(e, t, n, a, r, l) {
150
- const c = d("a-input");
151
- return o(), u(c, v({
152
- onKeydown: Z(e.getList, ["enter"]),
153
- onChange: e.onInputChange,
154
- value: e.queryParams[e.item.prop],
155
- size: e.size
156
- }, e.inputSetting), X({ _: 2 }, [
157
- V(e.item.template, (s, i) => ({
158
- name: i,
159
- fn: _(() => [
160
- s ? (o(), u(w(e.currentInputComponent()), {
161
- key: i,
162
- templateEle: s
163
- }, null, 8, ["templateEle"])) : g("", !0)
164
- ])
165
- }))
166
- ]), 1040, ["onKeydown", "onChange", "value", "size"]);
167
- }
168
- const ne = /* @__PURE__ */ F(be, [["render", ke]]), oe = Symbol(), Se = /* @__PURE__ */ b({
169
- __name: "index",
170
- props: {
171
- imgSrc: {}
172
- },
173
- setup(e) {
174
- const t = S();
175
- return le(() => {
176
- const n = new Image(), a = [], r = 8, l = 8;
177
- let c = 0, s = 0;
178
- const i = 300, y = t.value, I = y.getContext("2d");
179
- n.onload = function() {
180
- y.width = n.width, y.height = n.height, s = Math.floor(n.width / r), c = Math.floor(n.height / l), q(), C();
181
- }, n.src = e.imgSrc;
182
- const q = () => {
183
- for (let P = 0; P < l; P++)
184
- for (let h = 0; h < r; h++)
185
- a.push({
186
- x: s * h,
187
- y: c * P,
188
- offsetX: (Math.random() - 0.5) * i,
189
- offsetY: (Math.random() - 0.5) * i
190
- });
191
- }, C = () => {
192
- I.clearRect(0, 0, y.width, y.height);
193
- let P = !0;
194
- a.forEach((h, B) => {
195
- I.drawImage(n, h.x, h.y, s, c, h.x + h.offsetX, h.y + h.offsetY, s, c), Math.abs(h.offsetX) > 0.5 && (P = !1, h.offsetX *= 0.95), Math.abs(h.offsetY) > 0.5 && (h.offsetY *= 0.95, P = !1);
196
- }), P ? setTimeout(() => {
197
- q(), C();
198
- }, 300) : requestAnimationFrame(C);
199
- };
200
- }), (n, a) => (o(), k("canvas", {
201
- ref_key: "loadingCanvas",
202
- ref: t
203
- }, null, 512));
204
- }
205
- }), $e = { class: "input-graphic-verification" }, Ie = ["src", "alt"], Pe = /* @__PURE__ */ b({
206
- __name: "index",
207
- props: {
208
- item: {},
209
- componentType: { default: "Element Plus" },
210
- loading: { type: Boolean, default: !1 }
211
- },
212
- setup(e) {
213
- const {
214
- graphicSrc: t = "",
215
- graphicAlt: n = "",
216
- getGraphic: a = () => {
217
- },
218
- key: r
219
- } = e.item, { formLoading: l } = f(oe, !1), c = N(() => (l == null ? void 0 : l.value) || e.loading), s = async () => {
220
- a && !(c != null && c.value) && await a();
221
- }, i = T(U);
222
- switch (e.componentType) {
223
- case "Element Plus":
224
- i.value = U;
225
- break;
226
- case "Ant Design Vue":
227
- i.value = ne;
228
- break;
229
- }
230
- return (y, I) => (o(), k("div", $e, [
231
- (o(), u(w(i.value), {
232
- item: y.item,
233
- class: "input"
234
- }, null, 8, ["item"])),
235
- c.value ? (o(), u(Se, {
236
- key: 0,
237
- class: "graphic",
238
- imgSrc: m(t)
239
- }, null, 8, ["imgSrc"])) : (o(), k("img", {
240
- key: 1,
241
- class: "graphic",
242
- onClick: s,
243
- src: m(t),
244
- alt: m(n) || `${m(r)}`
245
- }, null, 8, Ie))
246
- ]));
247
- }
248
- });
249
- const re = /* @__PURE__ */ F(Pe, [["__scopeId", "data-v-f76fdd37"]]), R = "获取验证码", ze = 60, Ve = /* @__PURE__ */ b({
250
- __name: "verification-button",
251
- props: {
252
- getSmscode: { type: Function },
253
- componentType: { default: "Element Plus" },
254
- item: {}
255
- },
256
- setup(e) {
257
- const t = S(R), n = S(null), a = N(() => t.value === R), r = T("el-button");
258
- switch (e.componentType) {
259
- case "Element Plus":
260
- r.value = "el-button";
261
- break;
262
- case "Ant Design Vue":
263
- r.value = "a-button";
264
- break;
265
- }
266
- const l = () => {
267
- n && (clearInterval(n.value), n.value = null, t.value = R);
268
- }, c = async () => {
269
- if (t.value === R)
270
- if (t.value = ze, n.value = setInterval(() => {
271
- if (Number(t.value) <= 0 || !t.value) {
272
- l();
273
- return;
274
- } else
275
- t.value = Number(t.value) - 1;
276
- }, 1e3), e.getSmscode)
277
- await e.getSmscode() === !1 && l();
278
- else
279
- return;
280
- };
281
- ue(() => {
282
- l();
283
- });
284
- const s = { ...e.item.buttonSetting };
285
- return (i, y) => (o(), u(w(r.value), v({
286
- class: "verifiaction-button",
287
- style: {
288
- color: a.value ? "var(--color-primary, #409EFF)" : "var(--text-color-placeholder, #A8ABB2)",
289
- cursor: a.value ? "pointer" : "default"
290
- },
291
- onClick: c
292
- }, s), {
293
- default: _(() => [
294
- L(E(a.value ? R : t.value + "s"), 1)
295
- ]),
296
- _: 1
297
- }, 16, ["style"]));
298
- }
299
- });
300
- const H = /* @__PURE__ */ F(Ve, [["__scopeId", "data-v-f5cd774b"]]), se = /* @__PURE__ */ b({
301
- __name: "index",
302
- props: {
303
- item: {},
304
- componentType: { default: "Element Plus" }
305
- },
306
- setup(e) {
307
- const t = e.item, n = T(U);
308
- switch (e.componentType) {
309
- case "Element Plus":
310
- n.value = U, t.template = {
311
- append: () => J(H, {
312
- getSmscode: t.getSmscode,
313
- item: e.item
314
- })
315
- };
316
- break;
317
- case "Ant Design Vue":
318
- n.value = ne, t.template = {
319
- suffix: () => J(H, {
320
- getSmscode: t.getSmscode,
321
- item: e.item
322
- })
323
- };
324
- break;
325
- }
326
- return (a, r) => (o(), u(w(n.value), {
327
- item: m(t),
328
- class: "input"
329
- }, null, 8, ["item"]));
330
- }
331
- }), qe = b({
332
- components: {
333
- slotArchive: (e) => {
334
- const { templateEle: t } = e;
335
- return t();
336
- }
337
- },
338
- props: {
339
- item: null
340
- // null就是any
341
- },
342
- setup() {
343
- },
344
- data() {
345
- return {
346
- dividerSetting: {
347
- ...this.item.dividerSetting,
348
- ...this.item.setting
349
- }
350
- };
351
- },
352
- methods: {
353
- currentInputComponent() {
354
- return "slot-archive";
355
- }
356
- }
357
- });
358
- function Ce(e, t, n, a, r, l) {
359
- const c = d("el-divider");
360
- return o(), u(c, ce(pe(e.dividerSetting)), X({ _: 2 }, [
361
- V(e.item.template, (s, i) => ({
362
- name: i,
363
- fn: _(() => [
364
- s ? (o(), u(w(e.currentInputComponent()), {
365
- key: i,
366
- templateEle: s
367
- }, null, 8, ["templateEle"])) : g("", !0)
368
- ])
369
- }))
370
- ]), 1040);
371
- }
372
- const we = /* @__PURE__ */ F(qe, [["render", Ce]]), De = /* @__PURE__ */ b({
373
- __name: "index",
374
- props: {
375
- item: {}
376
- },
377
- setup(e) {
378
- const t = f("queryParams", {}), n = f("size"), a = S({
379
- ...e.item.radioGroupSetting,
380
- ...e.item.setting
381
- });
382
- return (r, l) => {
383
- const c = d("el-radio"), s = d("el-radio-group");
384
- return o(), u(s, v({
385
- modelValue: m(t)[r.item.prop],
386
- "onUpdate:modelValue": l[0] || (l[0] = (i) => m(t)[r.item.prop] = i),
387
- size: m(n)
388
- }, a.value), {
389
- default: _(() => [
390
- (o(!0), k(x, null, V(r.item.option || [], (i) => (o(), u(c, v({
391
- size: m(n),
392
- key: i.value,
393
- ref_for: !0
394
- }, i), {
395
- default: _(() => [
396
- L(E(i.label), 1)
397
- ]),
398
- _: 2
399
- }, 1040, ["size"]))), 128))
400
- ]),
401
- _: 1
402
- }, 16, ["modelValue", "size"]);
403
- };
404
- }
405
- }), Le = /* @__PURE__ */ b({
406
- __name: "index",
407
- props: {
408
- item: {}
409
- },
410
- setup(e) {
411
- const t = f("queryParams", {}), n = f("size"), a = S({
412
- ...e.item.checkboxGroupSetting,
413
- ...e.item.setting
414
- });
415
- return (r, l) => {
416
- const c = d("el-checkbox"), s = d("el-checkbox-group");
417
- return o(), u(s, v({
418
- modelValue: m(t)[r.item.prop],
419
- "onUpdate:modelValue": l[0] || (l[0] = (i) => m(t)[r.item.prop] = i),
420
- size: m(n)
421
- }, a.value), {
422
- default: _(() => [
423
- (o(!0), k(x, null, V(r.item.option || [], (i) => (o(), u(c, v({
424
- size: m(n),
425
- key: i.value,
426
- ref_for: !0
427
- }, i), {
428
- default: _(() => [
429
- L(E(i.label), 1)
430
- ]),
431
- _: 2
432
- }, 1040, ["size"]))), 128))
433
- ]),
434
- _: 1
435
- }, 16, ["modelValue", "size"]);
436
- };
437
- }
438
- }), xe = /* @__PURE__ */ b({
439
- __name: "index",
440
- props: {
441
- item: {}
442
- },
443
- setup(e) {
444
- const t = f("queryParams", {}), n = f("size"), a = S({
445
- ...he,
446
- ...e.item.datePackerSetting,
447
- ...e.item.setting
448
- });
449
- return (r, l) => {
450
- const c = d("el-date-picker");
451
- return o(), u(c, v({
452
- modelValue: m(t)[r.item.prop],
453
- "onUpdate:modelValue": l[0] || (l[0] = (s) => m(t)[r.item.prop] = s),
454
- size: m(n)
455
- }, a.value), null, 16, ["modelValue", "size"]);
456
- };
457
- }
458
- }), Fe = /* @__PURE__ */ b({
459
- __name: "index",
460
- props: {
461
- item: {}
462
- },
463
- setup(e) {
464
- const t = f("queryParams", {}), n = f("size"), a = S({
465
- ...te,
466
- ...e.item.selectSetting,
467
- ...e.item.setting
468
- });
469
- return (r, l) => {
470
- const c = d("el-option"), s = d("el-select");
471
- return o(), u(s, v({
472
- modelValue: m(t)[r.item.prop],
473
- "onUpdate:modelValue": l[0] || (l[0] = (i) => m(t)[r.item.prop] = i),
474
- size: m(n)
475
- }, a.value), {
476
- default: _(() => [
477
- (o(!0), k(x, null, V(r.item.option || [], (i) => (o(), u(c, v({
478
- key: i.value,
479
- ref_for: !0
480
- }, i), null, 16))), 128))
481
- ]),
482
- _: 1
483
- }, 16, ["modelValue", "size"]);
484
- };
485
- }
486
- }), Be = /* @__PURE__ */ b({
487
- __name: "index",
488
- props: {
489
- item: {}
490
- },
491
- setup(e) {
492
- const t = f("queryParams", {}), n = f("size"), a = S({
493
- ...te,
494
- ...e.item.selectSetting,
495
- ...e.item.setting
496
- });
497
- return (r, l) => {
498
- const c = d("el-cascader");
499
- return o(), u(c, v({
500
- modelValue: m(t)[r.item.prop],
501
- "onUpdate:modelValue": l[0] || (l[0] = (s) => m(t)[r.item.prop] = s),
502
- size: m(n),
503
- options: r.item.options || []
504
- }, a.value), null, 16, ["modelValue", "size", "options"]);
505
- };
506
- }
507
- }), Ee = b({
508
- name: "GeneralBasicForm",
509
- components: {
510
- Input: U,
511
- InputNumber: ve,
512
- InputGraphicVerification: re,
513
- InputMobileVerification: se,
514
- Divider: we,
515
- Radio: De,
516
- Checkbox: Le,
517
- DatePicker: xe,
518
- Select: Fe,
519
- Cascader: Be
520
- },
521
- props: {
522
- showSearch: {
523
- // 是否展示所有元素
524
- type: Boolean,
525
- default: !0
526
- },
527
- loading: {
528
- // 加载动画
529
- type: Boolean,
530
- default: !1
531
- },
532
- formOnly: {
533
- // 是否只展示表单不展示按钮
534
- type: Boolean,
535
- default: !1
536
- },
537
- getList: {
538
- // 查找数据调用的函数
539
- type: Function,
540
- default: () => {
541
- }
542
- },
543
- afterReset: {
544
- // 在重置按钮点击完后但还没重新请求时触发的的函数
545
- type: Function,
546
- default: () => {
547
- }
548
- },
549
- formItem: {
550
- // 定义表单的数据
551
- type: Array,
552
- default: []
553
- },
554
- size: {
555
- // 控制按钮大小
556
- type: String,
557
- default: "default"
558
- },
559
- labelWidth: {
560
- // 表单文字宽度
561
- type: String,
562
- default: "90px"
563
- },
564
- noUrlParameters: {
565
- // 不接受和不改变url的参数
566
- type: Boolean,
567
- default: () => !1
568
- },
569
- formData: {
570
- // 外部传入的表单数据,用于回填
571
- type: Object,
572
- default: () => {
573
- }
574
- },
575
- noInputBlank: {
576
- // 用于判断input框是否校验仅空格
577
- type: Boolean,
578
- default: () => !1
579
- }
580
- },
581
- data() {
582
- return {
583
- formLoading: this.loading || !1,
584
- trimRegex: /\S/
585
- };
586
- },
587
- setup(e) {
588
- const { size: t, noUrlParameters: n, getList: a } = e, r = ye(), l = S({
589
- ...n ? {} : r == null ? void 0 : r.query
590
- });
591
- return j(
592
- /* 注入名 */
593
- "queryParams",
594
- /* 值 */
595
- l
596
- ), j(
597
- /* 注入名 */
598
- "size",
599
- /* 值 */
600
- t
601
- ), j(
602
- /* 注入名 */
603
- "getList",
604
- /* 值 */
605
- a
606
- ), {
607
- queryParams: l
608
- };
609
- },
610
- watch: {
611
- formData: {
612
- handler(e, t) {
613
- JSON.stringify(e) !== JSON.stringify(t) && (this.queryParams = {
614
- ...this.noUrlParameters ? {} : this.queryParams,
615
- ...e
616
- });
617
- },
618
- // watch 默认是懒执行的:仅当数据源变化时,才会执行回调。但在某些场景中,我们希望在创建侦听器时,立即执行一遍回调。举例来说,我们想请求一些初始数据,然后在相关状态更改时重新请求数据。
619
- // https://cn.vuejs.org/guide/essentials/watchers.html#deep-watchers
620
- immediate: !0
621
- // deep: true,
622
- },
623
- queryParams: {
624
- handler(e) {
625
- this.$emit("update:formData", e);
626
- },
627
- deep: !0
628
- },
629
- loading(e) {
630
- this.formLoading !== e && (this.formLoading = e);
631
- },
632
- formLoading(e) {
633
- this.loading !== e && this.$emit("update:loading", e);
634
- }
635
- },
636
- provide() {
637
- return {
638
- // 显式提供一个计算属性
639
- [oe]: {
640
- formLoading: N(() => this.formLoading),
641
- updateFormLoading: (e) => {
642
- this.formLoading = e;
643
- }
644
- }
645
- };
646
- },
647
- methods: {
648
- /** 搜索按钮操作 */
649
- handleQuery() {
650
- var n;
651
- const e = { page: 1, limit: 10 }, t = {
652
- ...(n = this.$route) == null ? void 0 : n.query,
653
- ...this.queryParams,
654
- ...e
655
- };
656
- this.noUrlParameters || this.$router.push({
657
- query: { ...t }
658
- }), this.getList({
659
- ...t
660
- });
661
- },
662
- /** 重置按钮操作 */
663
- async resetQuery() {
664
- var t;
665
- this.$refs.queryFormRef.resetFields();
666
- const e = { page: 1 };
667
- this.noUrlParameters || await this.$router.push({
668
- query: { ...e }
669
- }), this.queryParams = {
670
- ...this.noUrlParameters ? {} : (t = this.$route) == null ? void 0 : t.query
671
- }, this.afterReset(), this.handleQuery();
672
- },
673
- getItemRules(e) {
674
- const { type: t, rules: n = [] } = e, a = [...n];
675
- return this.noInputBlank && t === "input" && a.push({
676
- pattern: this.trimRegex,
677
- message: "请输入(不能仅输入空格)",
678
- trigger: "blur"
679
- }), a;
680
- }
681
- }
682
- });
683
- function Re(e, t, n, a, r, l) {
684
- const c = d("Input"), s = d("Radio"), i = d("Select"), y = d("Divider"), I = d("Cascader"), q = d("Checkbox"), C = d("DatePicker"), P = d("InputNumber"), h = d("InputMobileVerification"), B = d("InputGraphicVerification"), D = d("el-form-item"), G = d("el-button"), M = d("el-form"), $ = Q("loading");
685
- return A((o(), u(M, v({
686
- model: e.queryParams,
687
- ref: "queryFormRef",
688
- inline: "",
689
- "label-position": "left",
690
- "label-width": e.labelWidth
691
- }, e.$attrs), {
692
- default: _(() => [
693
- (o(!0), k(x, null, V(e.formItem, (p) => (o(), u(D, {
694
- label: p.label,
695
- prop: p.prop,
696
- key: p.prop,
697
- rules: e.getItemRules(p)
698
- }, {
699
- default: _(() => [
700
- /^input$/i.test(p.type) ? (o(), u(c, {
701
- key: 0,
702
- item: p
703
- }, null, 8, ["item"])) : g("", !0),
704
- /^radio$/i.test(p.type) ? (o(), u(s, {
705
- key: 1,
706
- item: p
707
- }, null, 8, ["item"])) : g("", !0),
708
- /^select$/i.test(p.type) ? (o(), u(i, {
709
- key: 2,
710
- item: p
711
- }, null, 8, ["item"])) : g("", !0),
712
- /^divider$/i.test(p.type) ? (o(), u(y, {
713
- key: 3,
714
- item: p
715
- }, null, 8, ["item"])) : g("", !0),
716
- /^cascader$/i.test(p.type) ? (o(), u(I, {
717
- key: 4,
718
- item: p
719
- }, null, 8, ["item"])) : g("", !0),
720
- /^checkbox$/i.test(p.type) ? (o(), u(q, {
721
- key: 5,
722
- item: p
723
- }, null, 8, ["item"])) : g("", !0),
724
- /^date-picker$/i.test(p.type) ? (o(), u(C, {
725
- key: 6,
726
- item: p
727
- }, null, 8, ["item"])) : g("", !0),
728
- /^input-number$/i.test(p.type) ? (o(), u(P, {
729
- key: 7,
730
- item: p
731
- }, null, 8, ["item"])) : g("", !0),
732
- /^form-item-slot$/i.test(p.type) ? K(e.$slots, p.name, { key: 8 }) : g("", !0),
733
- /^input-mobile-verification$/i.test(p.type) ? (o(), u(h, {
734
- key: 9,
735
- item: p
736
- }, null, 8, ["item"])) : g("", !0),
737
- /^input-graphic-verification$/i.test(p.type) ? (o(), u(B, {
738
- item: p,
739
- key: p.key
740
- }, null, 8, ["item"])) : g("", !0)
741
- ]),
742
- _: 2
743
- }, 1032, ["label", "prop", "rules"]))), 128)),
744
- K(e.$slots, "default"),
745
- e.formOnly ? g("", !0) : (o(), u(D, { key: 0 }, {
746
- default: _(() => [
747
- A((o(), u(G, {
748
- type: "primary",
749
- size: e.size,
750
- onClick: e.handleQuery
751
- }, {
752
- default: _(() => t[0] || (t[0] = [
753
- L("查询")
754
- ])),
755
- _: 1
756
- }, 8, ["size", "onClick"])), [
757
- [$, e.formLoading]
758
- ]),
759
- ee(G, {
760
- size: e.size,
761
- onClick: e.resetQuery
762
- }, {
763
- default: _(() => t[1] || (t[1] = [
764
- L("重置")
765
- ])),
766
- _: 1
767
- }, 8, ["size", "onClick"])
768
- ]),
769
- _: 1
770
- })),
771
- K(e.$slots, "behind-the-button")
772
- ]),
773
- _: 3
774
- }, 16, ["model", "label-width"])), [
775
- [me, e.showSearch]
776
- ]);
777
- }
778
- const Ae = /* @__PURE__ */ F(Ee, [["render", Re]]), Te = ["infinite-scroll-disabled"], Ue = ["infinite-scroll-disabled"], Ge = { class: "checkbox" }, Ne = /* @__PURE__ */ b({
779
- __name: "InfiniteScrollList",
780
- props: {
781
- search: {
782
- type: Function,
783
- required: !0
784
- },
785
- checkbox: {
786
- type: Boolean,
787
- required: !1
788
- },
789
- id: {
790
- type: String,
791
- required: !0
792
- },
793
- name: {
794
- type: String,
795
- required: !0
796
- },
797
- extra: {
798
- type: null,
799
- required: !1
800
- },
801
- defaultSelection: {
802
- type: Array,
803
- required: !1
804
- }
805
- },
806
- setup(e, { expose: t }) {
807
- const n = e, { search: a, id: r, name: l, extra: c } = n, s = S([]), i = S(1), y = S(!1), I = S([]), q = S(!1), C = ($, p) => {
808
- const { i: O } = $;
809
- return c && c !== "false" ? c(O) : "";
810
- }, P = ($) => {
811
- I.value = $.map((p) => typeof p == "object" ? p[r] : p);
812
- };
813
- de(
814
- () => n.defaultSelection,
815
- ($ = [], p = []) => {
816
- P($);
817
- },
818
- { immediate: !0 }
819
- );
820
- const h = () => {
821
- B(), I.value = [];
822
- }, B = () => {
823
- i.value = 1, s.value = [], y.value = !1;
824
- }, D = async () => {
825
- if (q.value || y.value)
826
- return;
827
- q.value = !0;
828
- const $ = await a(i.value);
829
- $ && $.length > 0 ? (s.value = [...s.value, ...$], i.value += 1) : y.value = !0, q.value = !1;
830
- }, G = () => {
831
- B(), D();
832
- }, M = N(
833
- () => s.value.filter(($) => I.value.includes($[r]))
834
- ) || {};
835
- return t({
836
- reset: h,
837
- lowReset: B,
838
- loadList: D,
839
- selectInfo: M,
840
- list: s,
841
- ifbottom: y,
842
- refreshList: G
843
- }), ($, p) => {
844
- const O = d("el-checkbox"), ie = d("el-checkbox-group"), W = Q("infinite-scroll"), ae = Q("loading");
845
- return n.checkbox ? A((o(), u(ie, v({
846
- key: 0,
847
- modelValue: I.value,
848
- "onUpdate:modelValue": p[0] || (p[0] = (z) => I.value = z)
849
- }, n), {
850
- default: _(() => [
851
- A((o(), k("ul", {
852
- class: "list",
853
- "infinite-scroll-disabled": y.value
854
- }, [
855
- (o(!0), k(x, null, V(s.value, (z) => (o(), k("li", {
856
- key: z[m(r)],
857
- class: "list-item"
858
- }, [
859
- ee(O, {
860
- value: z[m(r)],
861
- class: "checkbox"
862
- }, {
863
- default: _(() => [
864
- L(E(z[m(l)]) + " ", 1),
865
- n.extra ? (o(), u(C, {
866
- key: 0,
867
- i: z
868
- }, null, 8, ["i"])) : g("", !0)
869
- ]),
870
- _: 2
871
- }, 1032, ["value"])
872
- ]))), 128))
873
- ], 8, Te)), [
874
- [W, D]
875
- ])
876
- ]),
877
- _: 1
878
- }, 16, ["modelValue"])), [
879
- [ae, q.value]
880
- ]) : A((o(), k("ul", v({
881
- key: 1,
882
- class: "list",
883
- "infinite-scroll-disabled": y.value
884
- }, n), [
885
- (o(!0), k(x, null, V(s.value, (z) => (o(), k("li", {
886
- key: z[m(r)],
887
- class: "list-item"
888
- }, [
889
- fe("div", Ge, [
890
- L(E(z[m(l)]) + " ", 1),
891
- n.extra ? (o(), u(C, {
892
- key: 0,
893
- i: z
894
- }, null, 8, ["i"])) : g("", !0)
895
- ])
896
- ]))), 128))
897
- ], 16, Ue)), [
898
- [W, D]
899
- ]);
900
- };
901
- }
902
- });
903
- const Me = /* @__PURE__ */ F(Ne, [["__scopeId", "data-v-77737aab"]]), Oe = { key: 1 }, je = /* @__PURE__ */ b({
904
- __name: "Descriptions",
905
- props: {
906
- formData: {
907
- type: Object,
908
- required: !0
909
- },
910
- formItem: {
911
- type: Array,
912
- required: !0
913
- },
914
- componentType: {
915
- type: String,
916
- default: "Element Plus"
917
- }
918
- },
919
- setup(e) {
920
- const t = e, n = T("el-descriptions-item"), a = T("descriptions-item");
921
- switch (t.componentType) {
922
- case "Element Plus":
923
- n.value = "el-descriptions-item", a.value = "el-descriptions-item";
924
- break;
925
- case "Ant Design Vue":
926
- n.value = "a-descriptions", a.value = "a-descriptions-item";
927
- break;
928
- }
929
- const r = (l, c) => {
930
- const { i: s, render: i, formData: y } = l;
931
- return i({
932
- row: y,
933
- $index: s
934
- });
935
- };
936
- return (l, c) => (o(), u(w(n.value), v({
937
- column: 1,
938
- border: "",
939
- class: "form-width"
940
- }, l.$attrs), {
941
- default: _(() => [
942
- (o(!0), k(x, null, V(t.formItem, (s, i) => (o(), u(w(a.value), v({
943
- key: s.prop,
944
- label: s.label,
945
- ref_for: !0
946
- }, s.descriptionsItemProps), {
947
- default: _(() => [
948
- s.render ? (o(), u(r, {
949
- key: 0,
950
- i,
951
- render: s.render,
952
- formData: e.formData
953
- }, null, 8, ["i", "render", "formData"])) : (o(), k("span", Oe, E(e.formData[s.prop]), 1))
954
- ]),
955
- _: 2
956
- }, 1040, ["label"]))), 128))
957
- ]),
958
- _: 1
959
- }, 16));
960
- }
961
- }), Xe = Ae, Ye = Me, We = je, Je = re, He = se;
962
- export {
963
- We as VDescriptions,
964
- Xe as VGeneralBasicForm,
965
- Ye as VInfiniteScrollList,
966
- Je as VInputGraphicVerification,
967
- He as VInputMobilecVerification
968
- };