general-basic-form 2.0.61 → 2.0.63

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