af-mobile-client-vue3 1.0.86 → 1.0.89
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/package.json +1 -1
- package/src/components/core/Uploader/index.vue +11 -2
- package/src/components/core/XSelect/index.vue +2 -2
- package/src/components/data/XCellList/index.vue +227 -71
- package/src/components/data/XCellListFilter/index.vue +23 -2
- package/src/components/data/XFormItem/index.vue +962 -880
- package/src/views/component/XCellListView/index.vue +7 -7
- package/src/views/component/XFormGroupView/index.vue +2 -2
|
@@ -1,880 +1,962 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import {
|
|
3
|
-
Area as VanArea,
|
|
4
|
-
Calendar as VanCalendar,
|
|
5
|
-
Checkbox as VanCheckbox,
|
|
6
|
-
DatePicker as VanDatePicker,
|
|
7
|
-
Field as VanField,
|
|
8
|
-
Picker as VanPicker,
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import
|
|
25
|
-
import
|
|
26
|
-
import
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
let
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
const
|
|
94
|
-
const
|
|
95
|
-
const
|
|
96
|
-
const
|
|
97
|
-
const
|
|
98
|
-
const
|
|
99
|
-
const
|
|
100
|
-
const
|
|
101
|
-
const
|
|
102
|
-
const
|
|
103
|
-
const
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
//
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
//
|
|
148
|
-
//
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
case '
|
|
162
|
-
case '
|
|
163
|
-
case '
|
|
164
|
-
case 'timePicker':
|
|
165
|
-
case '
|
|
166
|
-
if (mode === '查询') {
|
|
167
|
-
// console.log(querySelectDefaultValue.value)
|
|
168
|
-
return props.modelValue !== undefined ? props.modelValue : querySelectDefaultValue.value
|
|
169
|
-
}
|
|
170
|
-
else {
|
|
171
|
-
// console.log(formSelectDefaultValue.value)
|
|
172
|
-
return props.modelValue !== undefined ? props.modelValue : formSelectDefaultValue.value
|
|
173
|
-
}
|
|
174
|
-
case '
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
return
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
case '
|
|
248
|
-
if (
|
|
249
|
-
errorMessage.value =
|
|
250
|
-
return
|
|
251
|
-
}
|
|
252
|
-
break
|
|
253
|
-
case '
|
|
254
|
-
if (
|
|
255
|
-
errorMessage.value =
|
|
256
|
-
return
|
|
257
|
-
}
|
|
258
|
-
break
|
|
259
|
-
case '
|
|
260
|
-
if (
|
|
261
|
-
errorMessage.value =
|
|
262
|
-
return
|
|
263
|
-
}
|
|
264
|
-
break
|
|
265
|
-
case '
|
|
266
|
-
if (!/^
|
|
267
|
-
errorMessage.value =
|
|
268
|
-
return
|
|
269
|
-
}
|
|
270
|
-
break
|
|
271
|
-
case '
|
|
272
|
-
if (!/^(
|
|
273
|
-
errorMessage.value =
|
|
274
|
-
return
|
|
275
|
-
}
|
|
276
|
-
break
|
|
277
|
-
case '
|
|
278
|
-
if (
|
|
279
|
-
errorMessage.value =
|
|
280
|
-
return
|
|
281
|
-
}
|
|
282
|
-
break
|
|
283
|
-
case '
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
)
|
|
316
|
-
if (!
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
if (attr.type === 'radio')
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
}
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
</
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
</
|
|
657
|
-
|
|
658
|
-
<!--
|
|
659
|
-
<VanField
|
|
660
|
-
v-if="attr.type === '
|
|
661
|
-
name="
|
|
662
|
-
:
|
|
663
|
-
:
|
|
664
|
-
:rules="[{ required: attr.rule.required === 'true', message:
|
|
665
|
-
>
|
|
666
|
-
<template #input>
|
|
667
|
-
<
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
:
|
|
697
|
-
|
|
698
|
-
:rules="[{ required: attr.rule.required === 'true', message: '请选择' }]"
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
name="
|
|
722
|
-
:label="labelData"
|
|
723
|
-
:
|
|
724
|
-
:rules="[{ required: attr.rule.required === 'true', message: '请选择' }]"
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
v-model="
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
</VanPopup>
|
|
831
|
-
|
|
832
|
-
<!--
|
|
833
|
-
<
|
|
834
|
-
v-if="attr.type === '
|
|
835
|
-
v-model="localValue"
|
|
836
|
-
|
|
837
|
-
:
|
|
838
|
-
|
|
839
|
-
:
|
|
840
|
-
:
|
|
841
|
-
:
|
|
842
|
-
|
|
843
|
-
/>
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import {
|
|
3
|
+
Area as VanArea,
|
|
4
|
+
Calendar as VanCalendar,
|
|
5
|
+
Checkbox as VanCheckbox,
|
|
6
|
+
DatePicker as VanDatePicker,
|
|
7
|
+
Field as VanField,
|
|
8
|
+
Picker as VanPicker,
|
|
9
|
+
PickerGroup as VanPickerGroup,
|
|
10
|
+
Popup as VanPopup,
|
|
11
|
+
Radio as VanRadio,
|
|
12
|
+
RadioGroup as VanRadioGroup,
|
|
13
|
+
Rate as VanRate,
|
|
14
|
+
Slider as VanSlider,
|
|
15
|
+
Stepper as VanStepper,
|
|
16
|
+
Switch as VanSwitch,
|
|
17
|
+
TimePicker as VanTimePicker,
|
|
18
|
+
CheckboxGroup as vanCheckboxGroup,
|
|
19
|
+
} from 'vant'
|
|
20
|
+
import { computed, defineEmits, defineProps, getCurrentInstance, onBeforeMount, ref, watch } from 'vue'
|
|
21
|
+
import { areaList } from '@vant/area-data'
|
|
22
|
+
import { runLogic } from '@af-mobile-client-vue3/services/api/common'
|
|
23
|
+
import Uploader from '@af-mobile-client-vue3/components/core/Uploader/index.vue'
|
|
24
|
+
import XSelect from '@af-mobile-client-vue3/components/core/XSelect/index.vue'
|
|
25
|
+
import XMultiSelect from '@af-mobile-client-vue3/components/core/XMultiSelect/index.vue'
|
|
26
|
+
import XGridDropOption from '@af-mobile-client-vue3/components/core/XGridDropOption/index.vue'
|
|
27
|
+
import type { Numeric } from 'vant/es/utils'
|
|
28
|
+
import { getDict } from '@af-mobile-client-vue3/utils/dictUtil'
|
|
29
|
+
import { executeStrFunctionByContext } from '@af-mobile-client-vue3/utils/runEvalFunction'
|
|
30
|
+
import { useUserStore } from '@af-mobile-client-vue3/stores/modules/user'
|
|
31
|
+
import { debounce } from 'lodash-es'
|
|
32
|
+
import { searchToListOption, searchToOption } from '@af-mobile-client-vue3/services/v3Api'
|
|
33
|
+
|
|
34
|
+
const props = defineProps({
|
|
35
|
+
attr: {
|
|
36
|
+
type: Object,
|
|
37
|
+
},
|
|
38
|
+
form: {
|
|
39
|
+
type: Object,
|
|
40
|
+
},
|
|
41
|
+
datePickerFilter: {
|
|
42
|
+
type: Function,
|
|
43
|
+
default: () => true,
|
|
44
|
+
},
|
|
45
|
+
datePickerFormatter: {
|
|
46
|
+
type: Function,
|
|
47
|
+
default: (type, val) => val,
|
|
48
|
+
},
|
|
49
|
+
mode: {
|
|
50
|
+
type: String,
|
|
51
|
+
default: '查询',
|
|
52
|
+
},
|
|
53
|
+
serviceName: {
|
|
54
|
+
type: String,
|
|
55
|
+
default: undefined,
|
|
56
|
+
},
|
|
57
|
+
// 调用logic获取数据源的追加参数
|
|
58
|
+
getDataParams: {
|
|
59
|
+
type: Object,
|
|
60
|
+
default: undefined,
|
|
61
|
+
},
|
|
62
|
+
disabled: {
|
|
63
|
+
type: Boolean,
|
|
64
|
+
default: false,
|
|
65
|
+
},
|
|
66
|
+
rules: {
|
|
67
|
+
type: Object,
|
|
68
|
+
default: () => {},
|
|
69
|
+
},
|
|
70
|
+
modelValue: {
|
|
71
|
+
type: [String, Number, Boolean, Array, Object],
|
|
72
|
+
default: undefined,
|
|
73
|
+
},
|
|
74
|
+
showLabel: {
|
|
75
|
+
type: Boolean,
|
|
76
|
+
default: true,
|
|
77
|
+
},
|
|
78
|
+
// radio/checkbox/select/mul-select 选项数据结构
|
|
79
|
+
columnsField: {
|
|
80
|
+
type: Object,
|
|
81
|
+
default: () => {
|
|
82
|
+
return { text: 'label', value: 'value' }
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
|
|
86
|
+
})
|
|
87
|
+
|
|
88
|
+
const emits = defineEmits(['update:modelValue'])
|
|
89
|
+
// 判断并初始化防抖函数
|
|
90
|
+
let debouncedUserLinkFunc: Function | null = null
|
|
91
|
+
let debouncedDepLinkFunc: Function | null = null
|
|
92
|
+
|
|
93
|
+
const { attr, form, mode, serviceName, getDataParams, columnsField } = props
|
|
94
|
+
const calendarShow = ref(false)
|
|
95
|
+
const option = ref([])
|
|
96
|
+
const pickerValue = ref(undefined)
|
|
97
|
+
const datePickerValue = ref(undefined)
|
|
98
|
+
const timePickerValue = ref(undefined)
|
|
99
|
+
const area = ref<any>(undefined)
|
|
100
|
+
const showPicker = ref(false)
|
|
101
|
+
const showDatePicker = ref(false)
|
|
102
|
+
const showTimePicker = ref(false)
|
|
103
|
+
const showArea = ref(false)
|
|
104
|
+
const errorMessage = ref('')
|
|
105
|
+
|
|
106
|
+
// 表单默认值
|
|
107
|
+
// 输入-非查询
|
|
108
|
+
const formInputDefaultValue = ref('')
|
|
109
|
+
// 输入-查询
|
|
110
|
+
const queryInputDefaultValue = ref('')
|
|
111
|
+
// 选择-非查询
|
|
112
|
+
const formSelectDefaultValue = ref([])
|
|
113
|
+
// 选择-查询
|
|
114
|
+
const querySelectDefaultValue = ref([])
|
|
115
|
+
|
|
116
|
+
// eslint-disable-next-line ts/no-use-before-define
|
|
117
|
+
const currUser = computed(() => userState.f.resources.id)
|
|
118
|
+
// 是否展示当前项
|
|
119
|
+
const showItem = ref(true)
|
|
120
|
+
|
|
121
|
+
// 当前组件实例(不推荐使用,可能会在后续的版本更迭中调整,暂时用来绑定函数的上下文)
|
|
122
|
+
const currInst = getCurrentInstance()
|
|
123
|
+
|
|
124
|
+
// 配置中心->表单项变更触发函数
|
|
125
|
+
const dataChangeFunc = debounce(async () => {
|
|
126
|
+
if (attr.dataChangeFunc)
|
|
127
|
+
await executeStrFunctionByContext(currInst, attr.dataChangeFunc, [form, attr, null, mode])
|
|
128
|
+
}, 500)
|
|
129
|
+
|
|
130
|
+
// 配置中心->表单项展示函数
|
|
131
|
+
const showFormItemFunc = debounce(async () => {
|
|
132
|
+
if (attr.showFormItemFunc) {
|
|
133
|
+
const obj = await executeStrFunctionByContext(currInst, attr.showFormItemFunc, [form, attr, null, mode])
|
|
134
|
+
// 判断是 bool 还是 obj 兼容
|
|
135
|
+
if (typeof obj === 'boolean') {
|
|
136
|
+
showItem.value = obj
|
|
137
|
+
}
|
|
138
|
+
else if (obj && typeof obj === 'object') {
|
|
139
|
+
// obj 是一个对象,并且不是数组
|
|
140
|
+
showItem.value = obj?.show
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}, 500)
|
|
144
|
+
|
|
145
|
+
const localValue = computed({
|
|
146
|
+
get() {
|
|
147
|
+
// if (props.modelValue !== undefined) {
|
|
148
|
+
// return props.modelValue
|
|
149
|
+
// }
|
|
150
|
+
switch (attr.type) {
|
|
151
|
+
case 'uploader':
|
|
152
|
+
if (mode === '查询') {
|
|
153
|
+
// console.log(querySelectDefaultValue.value)
|
|
154
|
+
return props.modelValue !== undefined ? props.modelValue : querySelectDefaultValue.value
|
|
155
|
+
}
|
|
156
|
+
else {
|
|
157
|
+
return props.modelValue !== undefined ? props.modelValue : formSelectDefaultValue.value
|
|
158
|
+
}
|
|
159
|
+
case 'switch':
|
|
160
|
+
return props.modelValue !== undefined ? props.modelValue : false
|
|
161
|
+
case 'checkbox':
|
|
162
|
+
case 'file':
|
|
163
|
+
case 'image':
|
|
164
|
+
case 'timePicker':
|
|
165
|
+
case 'datePicker':
|
|
166
|
+
if (mode === '查询') {
|
|
167
|
+
// console.log(querySelectDefaultValue.value)
|
|
168
|
+
return props.modelValue !== undefined ? props.modelValue : querySelectDefaultValue.value
|
|
169
|
+
}
|
|
170
|
+
else {
|
|
171
|
+
// console.log(formSelectDefaultValue.value)
|
|
172
|
+
return props.modelValue !== undefined ? props.modelValue : formSelectDefaultValue.value
|
|
173
|
+
}
|
|
174
|
+
// case 'datePicker':
|
|
175
|
+
// if (mode === '查询') {
|
|
176
|
+
// // console.log(querySelectDefaultValue.value)
|
|
177
|
+
// return props.modelValue !== undefined ? props.modelValue : querySelectDefaultValue.value
|
|
178
|
+
// }
|
|
179
|
+
// else {
|
|
180
|
+
// if (props.modelValue !== undefined) {
|
|
181
|
+
// // 拆分日期和时间
|
|
182
|
+
// const [dateStr, timeStr] = props.modelValue.split(' ')
|
|
183
|
+
// // 拆分日期部分
|
|
184
|
+
// const date = dateStr.split('-')
|
|
185
|
+
// // 拆分时间部分
|
|
186
|
+
// const time = timeStr.split(':')
|
|
187
|
+
// // 赋值给 dateTimePickerValue
|
|
188
|
+
// // eslint-disable-next-line vue/no-side-effects-in-computed-properties
|
|
189
|
+
// dateTimePickerValue.value = {
|
|
190
|
+
// date,
|
|
191
|
+
// time,
|
|
192
|
+
// }
|
|
193
|
+
// return dateTimePickerValue.value
|
|
194
|
+
// }
|
|
195
|
+
// return formSelectDefaultValue.value
|
|
196
|
+
// }
|
|
197
|
+
case 'radio':
|
|
198
|
+
case 'rate':
|
|
199
|
+
case 'slider':
|
|
200
|
+
case 'area':
|
|
201
|
+
case 'citySelect':
|
|
202
|
+
case 'calendar':
|
|
203
|
+
case 'textarea':
|
|
204
|
+
case 'intervalPicker':
|
|
205
|
+
case 'input':
|
|
206
|
+
case 'select':
|
|
207
|
+
if (mode === '查询')
|
|
208
|
+
return props.modelValue !== undefined ? props.modelValue : queryInputDefaultValue.value
|
|
209
|
+
else
|
|
210
|
+
return props.modelValue !== undefined ? props.modelValue : formInputDefaultValue.value
|
|
211
|
+
case 'stepper':
|
|
212
|
+
return props.modelValue !== undefined ? props.modelValue : 1
|
|
213
|
+
case 'rangePicker':
|
|
214
|
+
if (props.modelValue && Array.isArray(props.modelValue) && props.modelValue.length > 1)
|
|
215
|
+
return `${props.modelValue[0]} ~ ${props.modelValue[1]}`
|
|
216
|
+
|
|
217
|
+
else
|
|
218
|
+
return props.modelValue
|
|
219
|
+
|
|
220
|
+
default:
|
|
221
|
+
return undefined
|
|
222
|
+
}
|
|
223
|
+
},
|
|
224
|
+
set(newValue) {
|
|
225
|
+
emits('update:modelValue', newValue)
|
|
226
|
+
dataChangeFunc()
|
|
227
|
+
},
|
|
228
|
+
})
|
|
229
|
+
|
|
230
|
+
// 表单校验的类型校验
|
|
231
|
+
function formTypeCheck(attr, value) {
|
|
232
|
+
switch (attr.rule.type) {
|
|
233
|
+
case 'string':
|
|
234
|
+
if (value.length === 0) {
|
|
235
|
+
errorMessage.value = `${attr.name}必须为有效的字符串`
|
|
236
|
+
return
|
|
237
|
+
}
|
|
238
|
+
break
|
|
239
|
+
case 'number':
|
|
240
|
+
if (!/^[+-]?(\d+(\.\d*)?|\.\d+)$/.test(value)) {
|
|
241
|
+
errorMessage.value = `${attr.name}必须为数字`
|
|
242
|
+
return
|
|
243
|
+
}
|
|
244
|
+
break
|
|
245
|
+
case 'boolean':
|
|
246
|
+
case 'array':
|
|
247
|
+
case 'regexp':
|
|
248
|
+
if (value) {
|
|
249
|
+
errorMessage.value = ''
|
|
250
|
+
return
|
|
251
|
+
}
|
|
252
|
+
break
|
|
253
|
+
case 'integer':
|
|
254
|
+
if (!/^-?\d+$/.test(value)) {
|
|
255
|
+
errorMessage.value = `${attr.name}必须为整数`
|
|
256
|
+
return
|
|
257
|
+
}
|
|
258
|
+
break
|
|
259
|
+
case 'float':
|
|
260
|
+
if (!/^-?\d+\.\d+$/.test(value)) {
|
|
261
|
+
errorMessage.value = `${attr.name}必须为小数`
|
|
262
|
+
return
|
|
263
|
+
}
|
|
264
|
+
break
|
|
265
|
+
case 'email':
|
|
266
|
+
if (!/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(value)) {
|
|
267
|
+
errorMessage.value = `请输入正确的邮箱地址`
|
|
268
|
+
return
|
|
269
|
+
}
|
|
270
|
+
break
|
|
271
|
+
case 'idNumber':
|
|
272
|
+
if (!/^(^\d{15}$|^\d{17}([0-9]|X)$)$/.test(value)) {
|
|
273
|
+
errorMessage.value = `请输入正确的身份证号码`
|
|
274
|
+
return
|
|
275
|
+
}
|
|
276
|
+
break
|
|
277
|
+
case 'userPhone':
|
|
278
|
+
if (!/^1[3-9]\d{9}$/.test(value)) {
|
|
279
|
+
errorMessage.value = `请输入正确的手机号码`
|
|
280
|
+
return
|
|
281
|
+
}
|
|
282
|
+
break
|
|
283
|
+
case 'landlineNumber':
|
|
284
|
+
if (!/^(0\d{2,3}[-\s]?)\d{7,8}$/.test(value)) {
|
|
285
|
+
errorMessage.value = `请输入正确的座机号码`
|
|
286
|
+
return
|
|
287
|
+
}
|
|
288
|
+
break
|
|
289
|
+
case 'greaterThanZero':
|
|
290
|
+
if (!/^(?:[1-9]\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?$/.test(value)) {
|
|
291
|
+
errorMessage.value = `请输入一个大于0的数字`
|
|
292
|
+
return
|
|
293
|
+
}
|
|
294
|
+
break
|
|
295
|
+
case 'greaterThanOrEqualZero':
|
|
296
|
+
if (!/^(?:\d+|\d*\.\d+)$/.test(value)) {
|
|
297
|
+
errorMessage.value = `请输入一个大于等于0的数字`
|
|
298
|
+
return
|
|
299
|
+
}
|
|
300
|
+
break
|
|
301
|
+
case 'stringLength':
|
|
302
|
+
if (!(value.length >= attr.rule.minLen && value.length < attr.rule.maxLen)) {
|
|
303
|
+
errorMessage.value = `长度必须在${attr.rule.minLen}~${attr.rule.maxLen}之间`
|
|
304
|
+
return
|
|
305
|
+
}
|
|
306
|
+
break
|
|
307
|
+
case 'customJs':
|
|
308
|
+
// eslint-disable-next-line no-case-declarations
|
|
309
|
+
const funcStr = attr.rule.customValidatorFunc
|
|
310
|
+
// 输入的数据是否符合条件
|
|
311
|
+
// eslint-disable-next-line no-case-declarations
|
|
312
|
+
const status = ref(true)
|
|
313
|
+
// 提取函数体部分
|
|
314
|
+
// eslint-disable-next-line no-case-declarations
|
|
315
|
+
const funcBodyMatch = funcStr.match(/function\s*\(.*?\)\s*{([\s\S]*)}/)
|
|
316
|
+
if (!funcBodyMatch)
|
|
317
|
+
throw new Error('自定义校验函数不合法')
|
|
318
|
+
// eslint-disable-next-line no-case-declarations
|
|
319
|
+
const funcBody = funcBodyMatch[1].trim() // 提取函数体
|
|
320
|
+
// 使用 new Function 创建函数
|
|
321
|
+
// eslint-disable-next-line no-new-func,no-case-declarations
|
|
322
|
+
const customValidatorFunc = new Function('rule', 'value', 'callback', 'form', 'attr', 'util', funcBody)
|
|
323
|
+
// 定义 callback 函数
|
|
324
|
+
// eslint-disable-next-line no-case-declarations
|
|
325
|
+
const callback = (error) => {
|
|
326
|
+
if (error) {
|
|
327
|
+
errorMessage.value = `${error}`
|
|
328
|
+
status.value = false // 表示有错误发生
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
// 调用自定义校验函数
|
|
332
|
+
customValidatorFunc(
|
|
333
|
+
attr.rule,
|
|
334
|
+
value,
|
|
335
|
+
callback,
|
|
336
|
+
form,
|
|
337
|
+
attr,
|
|
338
|
+
{}, // util 对象(可以根据需要传递)
|
|
339
|
+
)
|
|
340
|
+
if (!status.value)
|
|
341
|
+
return
|
|
342
|
+
break
|
|
343
|
+
default:
|
|
344
|
+
errorMessage.value = ''
|
|
345
|
+
break
|
|
346
|
+
}
|
|
347
|
+
errorMessage.value = ''
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
onBeforeMount(() => {
|
|
351
|
+
init()
|
|
352
|
+
showFormItemFunc()
|
|
353
|
+
dataChangeFunc()
|
|
354
|
+
if (attr?.keyName?.toString()?.startsWith('search@根据表单项[') && attr?.keyName?.toString().endsWith(']联动人员'))
|
|
355
|
+
debouncedUserLinkFunc = debounce(() => updateResOptions('人员'), 200)
|
|
356
|
+
|
|
357
|
+
if (attr?.keyName?.toString()?.startsWith('search@根据表单项[') && attr?.keyName?.toString().endsWith(']联动部门'))
|
|
358
|
+
debouncedDepLinkFunc = debounce(() => updateResOptions('部门'), 200)
|
|
359
|
+
})
|
|
360
|
+
// 是否展示表单左侧label文字
|
|
361
|
+
const labelData = computed(() => {
|
|
362
|
+
return props.showLabel ? attr.name : null
|
|
363
|
+
})
|
|
364
|
+
// 是否只读
|
|
365
|
+
const readonly = computed(() => {
|
|
366
|
+
return attr.addOrEdit === 'readonly'
|
|
367
|
+
})
|
|
368
|
+
// 提示内容
|
|
369
|
+
const placeholder = computed(() => {
|
|
370
|
+
if (attr.addOrEdit === 'readonly')
|
|
371
|
+
return ' 暂无内容 ~ '
|
|
372
|
+
else
|
|
373
|
+
return attr.placeholder ? attr.placeholder : `请选择${attr.name}`
|
|
374
|
+
})
|
|
375
|
+
// 登录信息 (可以在配置的动态函数中使用 this.setupState 获取到当前组件内的全部函数和变量 例:this.setupState.userState)
|
|
376
|
+
const userState = useUserStore().getLogin()
|
|
377
|
+
|
|
378
|
+
const formatDate = date => `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()}`
|
|
379
|
+
|
|
380
|
+
function onCalendarConfirm(values) {
|
|
381
|
+
localValue.value = [formatDate(values[0]), formatDate(values[1])]
|
|
382
|
+
calendarShow.value = false
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
function init() {
|
|
386
|
+
if (attr.keyName && typeof attr.keyName === 'string') {
|
|
387
|
+
if (attr.keyName && attr.keyName.includes('logic@')) {
|
|
388
|
+
getData({}, (res) => {
|
|
389
|
+
option.value = res
|
|
390
|
+
initRadioValue()
|
|
391
|
+
})
|
|
392
|
+
}
|
|
393
|
+
else if (attr.keyName && attr.keyName.includes('config@')) {
|
|
394
|
+
const configName = attr.keyName.substring(7)
|
|
395
|
+
getDict(configName, (result) => {
|
|
396
|
+
if (result)
|
|
397
|
+
option.value = result
|
|
398
|
+
}, serviceName)
|
|
399
|
+
}
|
|
400
|
+
else if (attr.keyName && attr.keyName.includes('search@')) {
|
|
401
|
+
let source = attr.keyName.substring(7)
|
|
402
|
+
const userid = currUser.value
|
|
403
|
+
let roleName = 'roleName'
|
|
404
|
+
if (source.startsWith('根据角色[') && source.endsWith(']获取人员')) {
|
|
405
|
+
const startIndex = source.indexOf('[') + 1
|
|
406
|
+
const endIndex = source.indexOf(']', startIndex)
|
|
407
|
+
roleName = source.substring(startIndex, endIndex)
|
|
408
|
+
source = '根据角色获取人员'
|
|
409
|
+
}
|
|
410
|
+
const searchData = { source, userid, roleName }
|
|
411
|
+
if (source.startsWith('根据表单项[') && source.endsWith(']联动人员'))
|
|
412
|
+
updateResOptions('人员')
|
|
413
|
+
else if (source.startsWith('根据表单项[') && source.endsWith(']联动部门'))
|
|
414
|
+
updateResOptions('部门')
|
|
415
|
+
else if (attr.type === 'select' || attr.type === 'checkbox')
|
|
416
|
+
searchToListOption(searchData, res => getDataCallback(res))
|
|
417
|
+
else
|
|
418
|
+
searchToOption(searchData, res => getDataCallback(res))
|
|
419
|
+
}
|
|
420
|
+
else {
|
|
421
|
+
initRadioValue()
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
if (attr.type === 'radio' || attr.type === 'rate' || attr.type === 'slider' || attr.type === 'area' || attr.type === 'citySelect' || attr.type === 'calendar' || attr.type === 'textarea' || attr.type === 'intervalPicker' || attr.type === 'input' || attr.type === 'select') {
|
|
425
|
+
if (attr.formDefault)
|
|
426
|
+
formInputDefaultValue.value = attr.formDefault
|
|
427
|
+
if (attr.queryFormDefault)
|
|
428
|
+
queryInputDefaultValue.value = attr.queryFormDefault
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
if (attr.type === 'checkbox' || attr.type === 'uploader' || attr.type === 'file' || attr.type === 'image' || attr.type === 'datePicker' || attr.type === 'timePicker') {
|
|
432
|
+
if (attr.formDefault) {
|
|
433
|
+
if (attr.type === 'checkbox' || attr.type === 'image' || attr.type === 'file')
|
|
434
|
+
formSelectDefaultValue.value = attr.formDefault
|
|
435
|
+
else
|
|
436
|
+
formSelectDefaultValue.value.push(attr.formDefault)
|
|
437
|
+
}
|
|
438
|
+
if (attr.queryFormDefault) {
|
|
439
|
+
// console.log(querySelectDefaultValue.value)
|
|
440
|
+
querySelectDefaultValue.value.push(attr.queryFormDefault)
|
|
441
|
+
// querySelectDefaultValue.value = attr.queryFormDefault
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
function getDataCallback(res) {
|
|
447
|
+
option.value = res
|
|
448
|
+
if (attr.type === 'radio')
|
|
449
|
+
initRadioValue()
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
async function updateResOptions(type) {
|
|
453
|
+
if (attr?.keyName?.toString()?.startsWith('search@根据表单项[') && attr?.keyName?.toString()?.endsWith(`]联动${type}`)) {
|
|
454
|
+
const searchData = { source: `获取${type}`, userid: currUser.value }
|
|
455
|
+
const startIndex = attr.keyName.indexOf('[') + 1
|
|
456
|
+
const endIndex = attr.keyName.indexOf(']', startIndex)
|
|
457
|
+
const formModel = attr.keyName.substring(startIndex, endIndex).replace('.', '_')
|
|
458
|
+
// console.log(form)
|
|
459
|
+
const formModelData = form[formModel]
|
|
460
|
+
if (formModel?.length && formModelData?.length) {
|
|
461
|
+
await searchToListOption(searchData, (res) => {
|
|
462
|
+
// console.log(res)
|
|
463
|
+
// console.log(form)
|
|
464
|
+
getDataCallback(res.filter((h) => {
|
|
465
|
+
return formModelData['0'] === h.f_organization_id || formModelData['0'] === h.f_department_id || formModelData['0'] === h.parentid
|
|
466
|
+
// if (formModel.indexOf('org') > -1) {
|
|
467
|
+
// return formModelData?.includes(h.orgid || h.f_organization_id || h.parentid)
|
|
468
|
+
// } else {
|
|
469
|
+
// return formModelData?.includes(h?.parentid)
|
|
470
|
+
// }
|
|
471
|
+
}))
|
|
472
|
+
})
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
function initRadioValue() {
|
|
478
|
+
if ((mode === '新增' || mode === '修改') && attr.type === 'radio' && !localValue.value) {
|
|
479
|
+
if (attr.keys && attr.keys.length > 0)
|
|
480
|
+
localValue.value = attr.keys[0].value
|
|
481
|
+
else if (option.value && option.value.length > 0)
|
|
482
|
+
localValue.value = option.value[0].value
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
function getData(value, callback) {
|
|
487
|
+
if (value !== '') {
|
|
488
|
+
const logicName = attr.keyName
|
|
489
|
+
const logic = logicName.substring(6)
|
|
490
|
+
// 调用logic前设置参数
|
|
491
|
+
if (getDataParams && getDataParams[attr.model])
|
|
492
|
+
Object.assign(value, getDataParams[attr.model])
|
|
493
|
+
|
|
494
|
+
runLogic(logic, value, serviceName).then((res) => {
|
|
495
|
+
callback(res)
|
|
496
|
+
})
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
function onPickerConfirm({ selectedOptions }) {
|
|
501
|
+
showPicker.value = false
|
|
502
|
+
pickerValue.value = selectedOptions[0].text
|
|
503
|
+
emits('update:modelValue', [selectedOptions[0].text])
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
// 日期时间选择数据
|
|
507
|
+
const dateTimePickerValue = ref(undefined)
|
|
508
|
+
function showDataTimePicker() {
|
|
509
|
+
if (props.modelValue !== undefined && props.modelValue !== '' && props.modelValue !== null) {
|
|
510
|
+
// 拆分日期和时间
|
|
511
|
+
const [dateStr, timeStr] = props.modelValue.split(' ')
|
|
512
|
+
// 拆分日期部分
|
|
513
|
+
const date = dateStr.split('-')
|
|
514
|
+
// 拆分时间部分
|
|
515
|
+
const time = timeStr.split(':')
|
|
516
|
+
// 赋值给 dateTimePickerValue
|
|
517
|
+
dateTimePickerValue.value = {
|
|
518
|
+
date,
|
|
519
|
+
time,
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
else {
|
|
523
|
+
dateTimePickerValue.value = {
|
|
524
|
+
date: ['2015', '01', '01'],
|
|
525
|
+
time: ['00', '00', '00'],
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
showDatePicker.value = true
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
function onDatePickerConfirm({ selectedValues }) {
|
|
532
|
+
showDatePicker.value = false
|
|
533
|
+
localValue.value = selectedValues.join('-')
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
function onTimePickerConfirm({ selectedValues }) {
|
|
537
|
+
showTimePicker.value = false
|
|
538
|
+
timePickerValue.value = selectedValues.join(':')
|
|
539
|
+
emits('update:modelValue', timePickerValue.value)
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
function onAreaConfirm({ selectedOptions }) {
|
|
543
|
+
area.value = `${selectedOptions[0].text}-${selectedOptions[1].text}-${selectedOptions[2].text}`
|
|
544
|
+
showArea.value = false
|
|
545
|
+
emits('update:modelValue', [{
|
|
546
|
+
province: selectedOptions[0].text,
|
|
547
|
+
city: selectedOptions[1].text,
|
|
548
|
+
district: selectedOptions[2].text,
|
|
549
|
+
}])
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
function updateFile(files, _index) {
|
|
553
|
+
files.forEach((file) => {
|
|
554
|
+
if (file.content)
|
|
555
|
+
delete file.content
|
|
556
|
+
if (file.file)
|
|
557
|
+
delete file.file
|
|
558
|
+
if (file.objectUrl)
|
|
559
|
+
delete file.objectUrl
|
|
560
|
+
})
|
|
561
|
+
localValue.value = files
|
|
562
|
+
emits('update:modelValue', localValue.value)
|
|
563
|
+
}
|
|
564
|
+
// 监听表单发生变化后触发展示函数
|
|
565
|
+
watch(() => form, (_oldVal, _newVal) => {
|
|
566
|
+
showFormItemFunc()
|
|
567
|
+
// 数据源来自人员联动时更新数据
|
|
568
|
+
if (attr?.keyName?.toString()?.startsWith('search@根据表单项[') && attr?.keyName?.toString().endsWith(']联动人员'))
|
|
569
|
+
debouncedUserLinkFunc()
|
|
570
|
+
|
|
571
|
+
// 数据源来自部门联动时更新数据
|
|
572
|
+
if (attr?.keyName?.toString()?.startsWith('search@根据表单项[') && attr?.keyName?.toString().endsWith(']联动部门'))
|
|
573
|
+
debouncedDepLinkFunc()
|
|
574
|
+
}, { deep: true })
|
|
575
|
+
|
|
576
|
+
function onDateTimePickerConfirm() {
|
|
577
|
+
showDatePicker.value = false
|
|
578
|
+
const dateStr = dateTimePickerValue.value.date.join('-')
|
|
579
|
+
const timeStr = dateTimePickerValue.value.time.join(':')
|
|
580
|
+
localValue.value = `${dateStr} ${timeStr}`
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
function onPickerCancel() {
|
|
584
|
+
showDatePicker.value = false
|
|
585
|
+
}
|
|
586
|
+
</script>
|
|
587
|
+
|
|
588
|
+
<template>
|
|
589
|
+
<div>
|
|
590
|
+
<!-- switch开关 -->
|
|
591
|
+
<VanField
|
|
592
|
+
v-if="attr.type === 'switch' && showItem"
|
|
593
|
+
name="switch"
|
|
594
|
+
:label="labelData"
|
|
595
|
+
:rules="[{ required: attr.rule.required === 'true', message: '请选择' }]"
|
|
596
|
+
>
|
|
597
|
+
<template #input>
|
|
598
|
+
<VanSwitch v-model="localValue" />
|
|
599
|
+
</template>
|
|
600
|
+
</VanField>
|
|
601
|
+
|
|
602
|
+
<!-- 复选框 -->
|
|
603
|
+
<!-- <VanField
|
|
604
|
+
v-if="attr.type === 'checkbox'"
|
|
605
|
+
name="checkbox"
|
|
606
|
+
:label="labelData"
|
|
607
|
+
>
|
|
608
|
+
<template #input>
|
|
609
|
+
<VanCheckbox v-model="localValue" shape="square" />
|
|
610
|
+
</template>
|
|
611
|
+
</VanField> -->
|
|
612
|
+
|
|
613
|
+
<!-- 多选框-checkbox-复选框组 -->
|
|
614
|
+
<template v-if="attr.type === 'checkbox' && showItem">
|
|
615
|
+
<!-- 勾选 -->
|
|
616
|
+
<VanField
|
|
617
|
+
v-if="attr.showMode === 'checkbox' && mode !== '查询'"
|
|
618
|
+
name="checkboxGroup"
|
|
619
|
+
:label="labelData"
|
|
620
|
+
:rules="[{ required: attr.rule.required === 'true', message: `请选择${attr.name}` }]"
|
|
621
|
+
>
|
|
622
|
+
<template #input>
|
|
623
|
+
<van-checkbox-group v-model="localValue as any[]" direction="horizontal" shape="square" :disabled="readonly">
|
|
624
|
+
<VanCheckbox v-for="(item, index) in option" :key="index" style="padding: 2px" :name="item[columnsField.value]" :shape="rules?.[attr.model].shape" :value="item[columnsField.value]">
|
|
625
|
+
{{ item[columnsField.text] }}
|
|
626
|
+
</VanCheckbox>
|
|
627
|
+
</van-checkbox-group>
|
|
628
|
+
</template>
|
|
629
|
+
</VanField>
|
|
630
|
+
<VanField
|
|
631
|
+
v-if="attr.showMode === 'checkbox' && mode === '查询'"
|
|
632
|
+
name="checkboxGroup"
|
|
633
|
+
:label="labelData"
|
|
634
|
+
:rules="[{ required: attr.rule.required === 'true', message: `请选择${attr.name}` }]"
|
|
635
|
+
>
|
|
636
|
+
<template #input>
|
|
637
|
+
<XGridDropOption
|
|
638
|
+
v-model="(localValue as string[])"
|
|
639
|
+
:column-num="labelData ? 3 : 4"
|
|
640
|
+
:multiple="true"
|
|
641
|
+
:columns="option"
|
|
642
|
+
/>
|
|
643
|
+
</template>
|
|
644
|
+
</VanField>
|
|
645
|
+
<!-- 下拉 -->
|
|
646
|
+
<XMultiSelect
|
|
647
|
+
v-else
|
|
648
|
+
v-model="localValue"
|
|
649
|
+
:label="labelData"
|
|
650
|
+
:readonly="readonly"
|
|
651
|
+
:placeholder="placeholder"
|
|
652
|
+
:columns="option"
|
|
653
|
+
:option="attr.option ? attr.option : columnsField"
|
|
654
|
+
:rules="[{ required: attr.rule.required === 'true', message: `请选择${attr.name}` }]"
|
|
655
|
+
/>
|
|
656
|
+
</template>
|
|
657
|
+
|
|
658
|
+
<!-- 单选框 -->
|
|
659
|
+
<VanField
|
|
660
|
+
v-if="attr.type === 'radio' && mode !== '查询' && showItem"
|
|
661
|
+
name="radio"
|
|
662
|
+
:placeholder="attr.placeholder ? attr.placeholder : `请选择${attr.name}`"
|
|
663
|
+
:label="labelData"
|
|
664
|
+
:rules="[{ required: attr.rule.required === 'true', message: `请选择${attr.name}` }]"
|
|
665
|
+
>
|
|
666
|
+
<template #input>
|
|
667
|
+
<VanRadioGroup v-model="localValue" direction="horizontal" :disabled="readonly">
|
|
668
|
+
<VanRadio v-for="(item, index) in option" :key="index" style="padding: 2px" :name="item[columnsField.value]" :value="item[columnsField.value]">
|
|
669
|
+
{{ item[columnsField.text] }}
|
|
670
|
+
</VanRadio>
|
|
671
|
+
</VanRadioGroup>
|
|
672
|
+
</template>
|
|
673
|
+
</VanField>
|
|
674
|
+
|
|
675
|
+
<!-- 单选框-查询 -->
|
|
676
|
+
<VanField
|
|
677
|
+
v-if="attr.type === 'radio' && mode === '查询' && showItem"
|
|
678
|
+
name="radio"
|
|
679
|
+
:placeholder="attr.placeholder ? attr.placeholder : `请选择${attr.name}`"
|
|
680
|
+
:label="labelData"
|
|
681
|
+
:rules="[{ required: attr.rule.required === 'true', message: `请选择${attr.name}` }]"
|
|
682
|
+
>
|
|
683
|
+
<template #input>
|
|
684
|
+
<XGridDropOption
|
|
685
|
+
v-model="(localValue as string)"
|
|
686
|
+
:column-num="labelData ? 3 : 4"
|
|
687
|
+
:columns="option"
|
|
688
|
+
/>
|
|
689
|
+
</template>
|
|
690
|
+
</VanField>
|
|
691
|
+
|
|
692
|
+
<!-- 步进器 -->
|
|
693
|
+
<VanField
|
|
694
|
+
v-if="attr.type === 'stepper' && showItem"
|
|
695
|
+
name="stepper"
|
|
696
|
+
:label="labelData"
|
|
697
|
+
:readonly="readonly"
|
|
698
|
+
:rules="[{ required: attr.rule.required === 'true', message: '请选择' }]"
|
|
699
|
+
>
|
|
700
|
+
<template #input>
|
|
701
|
+
<VanStepper v-model="(localValue as string)" />
|
|
702
|
+
</template>
|
|
703
|
+
</VanField>
|
|
704
|
+
|
|
705
|
+
<!-- 评分 -->
|
|
706
|
+
<VanField
|
|
707
|
+
v-if="attr.type === 'rate' && showItem"
|
|
708
|
+
name="rate"
|
|
709
|
+
:label="labelData"
|
|
710
|
+
:readonly="readonly"
|
|
711
|
+
:rules="[{ required: attr.rule.required === 'true', message: '请选择' }]"
|
|
712
|
+
>
|
|
713
|
+
<template #input>
|
|
714
|
+
<VanRate v-model="(localValue as number)" />
|
|
715
|
+
</template>
|
|
716
|
+
</VanField>
|
|
717
|
+
|
|
718
|
+
<!-- 滑块 -->
|
|
719
|
+
<VanField
|
|
720
|
+
v-if="attr.type === 'slider' && showItem"
|
|
721
|
+
name="slider"
|
|
722
|
+
:label="labelData"
|
|
723
|
+
:readonly="readonly"
|
|
724
|
+
:rules="[{ required: attr.rule.required === 'true', message: '请选择' }]"
|
|
725
|
+
>
|
|
726
|
+
<template #input>
|
|
727
|
+
<VanSlider v-model="(localValue as number)" />
|
|
728
|
+
</template>
|
|
729
|
+
</VanField>
|
|
730
|
+
|
|
731
|
+
<!-- 图片文件上传 -->
|
|
732
|
+
<VanField
|
|
733
|
+
v-if="(attr.type === 'image' || attr.type === 'file') && showItem"
|
|
734
|
+
name="uploader"
|
|
735
|
+
:label="labelData"
|
|
736
|
+
:rules="[{ required: attr.rule.required === 'true', message: '请选择' }]"
|
|
737
|
+
>
|
|
738
|
+
<template #input>
|
|
739
|
+
<!-- <van-uploader v-model="localValue" /> -->
|
|
740
|
+
<Uploader
|
|
741
|
+
upload-mode="server"
|
|
742
|
+
:image-list="(localValue as any[])"
|
|
743
|
+
authority="admin"
|
|
744
|
+
@update-file-list="updateFile"
|
|
745
|
+
/>
|
|
746
|
+
</template>
|
|
747
|
+
</VanField>
|
|
748
|
+
|
|
749
|
+
<!-- 选择器 -->
|
|
750
|
+
<VanField
|
|
751
|
+
v-if="attr.type === 'picker' && showItem"
|
|
752
|
+
v-model="pickerValue"
|
|
753
|
+
name="picker"
|
|
754
|
+
:placeholder="attr.placeholder ? attr.placeholder : `请选择${attr.name}`"
|
|
755
|
+
:label="labelData"
|
|
756
|
+
:readonly="readonly"
|
|
757
|
+
is-link
|
|
758
|
+
:rules="[{ required: attr.rule.required === 'true', message: '请选择' }]"
|
|
759
|
+
@click="showPicker = true"
|
|
760
|
+
/>
|
|
761
|
+
<VanPopup v-model:show="showPicker" round position="bottom" teleport="body">
|
|
762
|
+
<VanPicker
|
|
763
|
+
v-model="(localValue as Numeric[])"
|
|
764
|
+
:title="attr.name"
|
|
765
|
+
:columns="attr.selectKey"
|
|
766
|
+
:readonly="readonly"
|
|
767
|
+
:columns-field-names="attr.customFieldName ? attr.customFieldName : { text: 'text', value: 'value', children: 'children' }"
|
|
768
|
+
:confirm-button-text="attr.confirmButtonText || attr.confirmButtonText === '' ? attr.confirmButtonText : '确认'"
|
|
769
|
+
:cancel-button-text="attr.cancelButtonText || attr.cancelButtonText === '' ? attr.cancelButtonText : '取消'"
|
|
770
|
+
@cancel="showPicker = false"
|
|
771
|
+
@confirm="onPickerConfirm"
|
|
772
|
+
/>
|
|
773
|
+
</VanPopup>
|
|
774
|
+
|
|
775
|
+
<!-- 日历选择-查询 -->
|
|
776
|
+
<VanField
|
|
777
|
+
v-if="attr.type === 'rangePicker' && mode === '查询' && showItem"
|
|
778
|
+
v-model="(localValue as string | number)"
|
|
779
|
+
is-link
|
|
780
|
+
readonly
|
|
781
|
+
name="rangePicker"
|
|
782
|
+
:label="labelData"
|
|
783
|
+
:placeholder="attr.placeholder ? attr.placeholder : `请选择${attr.name}`"
|
|
784
|
+
:rules="[{ required: attr.rule.required === 'true', message: '请选择' }]"
|
|
785
|
+
@click="calendarShow = true"
|
|
786
|
+
/>
|
|
787
|
+
<VanCalendar
|
|
788
|
+
v-model:show="calendarShow"
|
|
789
|
+
switch-mode="year-month"
|
|
790
|
+
allow-same-day
|
|
791
|
+
type="range"
|
|
792
|
+
teleport="body"
|
|
793
|
+
:show-confirm="attr.showConfirm"
|
|
794
|
+
@confirm="onCalendarConfirm"
|
|
795
|
+
/>
|
|
796
|
+
|
|
797
|
+
<!-- 日期选择-非查询 -->
|
|
798
|
+
<VanField
|
|
799
|
+
v-if="(attr.type === 'datePicker' || attr.type === 'rangePicker') && mode !== '查询' && showItem"
|
|
800
|
+
v-model="(localValue as string | number)"
|
|
801
|
+
name="datePicker"
|
|
802
|
+
:label="labelData"
|
|
803
|
+
readonly
|
|
804
|
+
:is-link="true"
|
|
805
|
+
:placeholder="placeholder"
|
|
806
|
+
:rules="[{ required: attr.rule.required === 'true', message: '请选择' }]"
|
|
807
|
+
@click="readonly ? null : showDataTimePicker()"
|
|
808
|
+
/>
|
|
809
|
+
<VanPopup v-model:show="showDatePicker" position="bottom" teleport="body">
|
|
810
|
+
<VanPickerGroup
|
|
811
|
+
:title="attr.name"
|
|
812
|
+
:tabs="['选择日期', '选择时间']"
|
|
813
|
+
next-step-text="下一步"
|
|
814
|
+
:confirm-button-text="attr.confirmButtonText ? attr.confirmButtonText : '确认'"
|
|
815
|
+
:cancel-button-text="attr.cancelButtonText ? attr.cancelButtonText : '取消'"
|
|
816
|
+
@confirm="onDateTimePickerConfirm"
|
|
817
|
+
@cancel="onPickerCancel"
|
|
818
|
+
>
|
|
819
|
+
<VanDatePicker
|
|
820
|
+
v-model="dateTimePickerValue.date"
|
|
821
|
+
:columns-type="attr.columnsType ? attr.columnsType : ['year', 'month', 'day']"
|
|
822
|
+
/>
|
|
823
|
+
<VanTimePicker
|
|
824
|
+
v-model="dateTimePickerValue.time"
|
|
825
|
+
:columns-type="['hour', 'minute', 'second']"
|
|
826
|
+
:min-time="attr.minTime ? attr.minTime : '00:00:00'"
|
|
827
|
+
:max-time="attr.maxTime ? attr.maxTime : '23:59:59'"
|
|
828
|
+
/>
|
|
829
|
+
</VanPickerGroup>
|
|
830
|
+
</VanPopup>
|
|
831
|
+
|
|
832
|
+
<!-- 日期选择-查询 -->
|
|
833
|
+
<VanField
|
|
834
|
+
v-if="attr.type === 'datePicker' && mode === '查询' && showItem"
|
|
835
|
+
v-model="(localValue as string | number)"
|
|
836
|
+
name="datePicker"
|
|
837
|
+
:label="labelData"
|
|
838
|
+
readonly
|
|
839
|
+
:is-link="true"
|
|
840
|
+
:placeholder="attr.placeholder ? attr.placeholder : `请选择${attr.name}`"
|
|
841
|
+
:rules="[{ required: attr.rule.required === 'true', message: '请选择' }]"
|
|
842
|
+
@click="showDatePicker = true"
|
|
843
|
+
/>
|
|
844
|
+
<VanPopup v-model:show="showDatePicker" position="bottom" teleport="body">
|
|
845
|
+
<VanPickerGroup
|
|
846
|
+
:title="attr.name"
|
|
847
|
+
:tabs="['选择日期', '选择时间']"
|
|
848
|
+
next-step-text="下一步"
|
|
849
|
+
:confirm-button-text="attr.confirmButtonText ? attr.confirmButtonText : '确认'"
|
|
850
|
+
:cancel-button-text="attr.cancelButtonText ? attr.cancelButtonText : '取消'"
|
|
851
|
+
@confirm="onDateTimePickerConfirm"
|
|
852
|
+
@cancel="onPickerCancel"
|
|
853
|
+
>
|
|
854
|
+
<VanDatePicker
|
|
855
|
+
v-model="dateTimePickerValue.date"
|
|
856
|
+
:columns-type="attr.columnsType ? attr.columnsType : ['year', 'month', 'day']"
|
|
857
|
+
:readonly="attr.readonly ? attr.readonly : false"
|
|
858
|
+
/>
|
|
859
|
+
<VanTimePicker
|
|
860
|
+
v-model="dateTimePickerValue.time"
|
|
861
|
+
:columns-type="['hour', 'minute', 'second']"
|
|
862
|
+
:min-time="attr.minTime ? attr.minTime : '00:00:00'"
|
|
863
|
+
:max-time="attr.maxTime ? attr.maxTime : '23:59:59'"
|
|
864
|
+
:readonly="attr.readonly ? attr.readonly : false"
|
|
865
|
+
/>
|
|
866
|
+
</VanPickerGroup>
|
|
867
|
+
</VanPopup>
|
|
868
|
+
|
|
869
|
+
<!-- 时间选择 -->
|
|
870
|
+
<VanField
|
|
871
|
+
v-if="attr.type === 'timePicker' && showItem"
|
|
872
|
+
v-model="timePickerValue"
|
|
873
|
+
name="timePicker"
|
|
874
|
+
is-link
|
|
875
|
+
readonly
|
|
876
|
+
:placeholder="attr.placeholder"
|
|
877
|
+
:label="labelData"
|
|
878
|
+
:rules="[{ required: attr.rule.required === 'true', message: '请选择' }]"
|
|
879
|
+
@click="showTimePicker = true"
|
|
880
|
+
/>
|
|
881
|
+
<VanPopup v-model:show="showTimePicker" position="bottom" teleport="body">
|
|
882
|
+
<VanTimePicker
|
|
883
|
+
v-model="localValue as string[]"
|
|
884
|
+
:title="attr.name"
|
|
885
|
+
:columns-type="attr.columnsType ? attr.columnsType : ['hour', 'minute', 'second']"
|
|
886
|
+
:min-time="attr.minTime ? attr.minTime : '00:00:00'"
|
|
887
|
+
:max-time="attr.maxTime ? attr.maxTime : '23:59:59'"
|
|
888
|
+
:readonly="attr.readonly ? attr.readonly : false"
|
|
889
|
+
@cancel="showTimePicker = false"
|
|
890
|
+
@confirm="onTimePickerConfirm"
|
|
891
|
+
/>
|
|
892
|
+
</VanPopup>
|
|
893
|
+
|
|
894
|
+
<!-- 省市区选择 -->
|
|
895
|
+
<VanField
|
|
896
|
+
v-if="(attr.type === 'area' || attr.type === 'citySelect') && showItem"
|
|
897
|
+
v-model="area"
|
|
898
|
+
name="area"
|
|
899
|
+
:placeholder="attr.placeholder ? attr.placeholder : `请选择${attr.name}`"
|
|
900
|
+
is-link
|
|
901
|
+
readonly
|
|
902
|
+
:label="labelData"
|
|
903
|
+
:rules="[{ required: attr.rule.required === 'true', message: '请选择' }]"
|
|
904
|
+
@click="readonly ? null : showArea = true"
|
|
905
|
+
/>
|
|
906
|
+
<VanPopup v-model:show="showArea" position="bottom" teleport="body">
|
|
907
|
+
<VanArea
|
|
908
|
+
v-model="localValue as string" :title="attr.name" :area-list="areaList"
|
|
909
|
+
@confirm="onAreaConfirm"
|
|
910
|
+
@cancel="showArea = false"
|
|
911
|
+
/>
|
|
912
|
+
</VanPopup>
|
|
913
|
+
|
|
914
|
+
<!-- 单选下拉列表 -->
|
|
915
|
+
<XSelect
|
|
916
|
+
v-if="attr.type === 'select' && showItem"
|
|
917
|
+
v-model="localValue"
|
|
918
|
+
:label="labelData"
|
|
919
|
+
:readonly="readonly"
|
|
920
|
+
clearable
|
|
921
|
+
:placeholder="placeholder"
|
|
922
|
+
:columns="option"
|
|
923
|
+
:option="attr.option ? attr.option : columnsField"
|
|
924
|
+
:rules="[{ required: attr.rule.required === 'true', message: '请选择' }]"
|
|
925
|
+
/>
|
|
926
|
+
|
|
927
|
+
<!-- 文本区域 -->
|
|
928
|
+
<VanField
|
|
929
|
+
v-if="attr.type === 'textarea' && showItem"
|
|
930
|
+
v-model="(localValue as string)"
|
|
931
|
+
rows="3"
|
|
932
|
+
autosize
|
|
933
|
+
:label="labelData"
|
|
934
|
+
type="textarea"
|
|
935
|
+
:readonly="readonly"
|
|
936
|
+
:maxlength="attr.maxlength"
|
|
937
|
+
:placeholder="attr.placeholder ? attr.placeholder : `请输入${attr.name}`"
|
|
938
|
+
show-word-limit
|
|
939
|
+
label-align="top"
|
|
940
|
+
:rules="[{ required: attr.rule.required === 'true', message: `请填写${attr.name}` }]"
|
|
941
|
+
/>
|
|
942
|
+
|
|
943
|
+
<!-- 文本输入框 -->
|
|
944
|
+
<VanField
|
|
945
|
+
v-if="(attr.type === 'input' || attr.type === 'intervalPicker') && showItem"
|
|
946
|
+
v-model="(localValue as string)"
|
|
947
|
+
:label="labelData"
|
|
948
|
+
:type="attr.type"
|
|
949
|
+
:readonly="readonly"
|
|
950
|
+
:disabled="attr.disabled"
|
|
951
|
+
:placeholder="placeholder"
|
|
952
|
+
:error-message="errorMessage"
|
|
953
|
+
:clearable="attr.clearable"
|
|
954
|
+
:rules="[{ required: attr.rule.required === 'true', message: `请填写${attr.name}` }]"
|
|
955
|
+
@blur="() => formTypeCheck(attr, localValue as string)"
|
|
956
|
+
/>
|
|
957
|
+
</div>
|
|
958
|
+
</template>
|
|
959
|
+
|
|
960
|
+
<style scoped>
|
|
961
|
+
|
|
962
|
+
</style>
|