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