hy-dispatch-ui-v3 0.2.59 → 0.2.61
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/tailwind.css +131 -6
- package/es/_virtual/_plugin-vue_export-helper.mjs +9 -0
- package/es/api/index.mjs +137 -0
- package/es/bussiness/hyAddDepartmentType/addDepartmentType.vue.mjs +365 -0
- package/es/bussiness/hyAddDepartmentType/index.mjs +6 -0
- package/es/bussiness/hyAddDepartmentType/style/addDepartmentType.scss +31 -0
- package/es/bussiness/index.mjs +1 -1
- package/es/components/hyAudioPlayer/audioPlayer.vue.mjs +1 -1
- package/es/components/hyBatchUploadDialog/batchUploadDialog.vue.mjs +45 -36
- package/es/components/hyDatePicker/datePicker.vue.mjs +2 -0
- package/es/components/hyForm/cpns/formItem.vue.mjs +106 -43
- package/es/components/hyForm/cpns/locationSelect.vue.mjs +358 -0
- package/es/components/hyForm/form.vue.mjs +83 -31
- package/es/components/hyForm/js/index.mjs +9 -2
- package/es/components/hyForm/js/useAppForm.mjs +6 -36
- package/es/components/hyMap/map.vue.mjs +3 -3
- package/es/components/hyMenu/menu.vue.mjs +38 -23
- package/es/components/hyMenu/style/menu.scss +3 -1
- package/es/components/hyOrgCascader/js/index.mjs +2 -2
- package/es/components/hyRadioGroup/index.mjs +6 -0
- package/es/components/hyRadioGroup/radioGroup.vue.mjs +123 -0
- package/es/components/hyRadioGroup/style/radioGroup.scss +0 -0
- package/es/components/hySearch/cpns/searchItem.vue.mjs +20 -13
- package/es/components/hySearch/js/useAppSearch.mjs +3 -33
- package/es/components/hyTable/cpns/virtualTable.vue.mjs +9 -1
- package/es/components/hyTable/js/index.mjs +6 -3
- package/es/components/hyTable/js/search.mjs +1 -0
- package/es/components/hyTable/table.vue.mjs +11 -4
- package/es/components/hyTableForm/batchTableForm.vue.mjs +5 -2
- package/es/components/hyTableForm/tableForm.vue.mjs +6 -0
- package/es/components/hyTree/js/index.mjs +69 -53
- package/es/components/hyTree/tree.vue.mjs +36 -1
- package/es/components/hyVideoPlayer/js/index.mjs +0 -1
- package/es/components/index.mjs +1 -0
- package/es/hooks/useApi.mjs +2 -2
- package/es/hooks/useGlobalConfig.mjs +1 -1
- package/es/index.mjs +4 -1
- package/es/locale/en.mjs +17 -1
- package/es/locale/zh_CN.mjs +17 -1
- package/es/static/hy-svg-icons/hy-icon-ops-linear-shouqi.js +8 -0
- package/es/static/hy-svg-icons/hy-icon-ops-linear-zhankai.js +8 -0
- package/es/style/index.scss +53 -0
- package/es/style/theme.scss +0 -53
- package/es/utils/form.mjs +56 -7
- package/es/utils/handler.mjs +5 -0
- package/es/utils/index.mjs +2 -1
- package/es/utils/map/hook/bigMap.mjs +4 -0
- package/es/utils/map/hook/gaode.mjs +3 -0
- package/es/utils/map/hook/leafletjs.mjs +10 -10
- package/es/utils/map/index.mjs +27 -7
- package/es/utils/tree.mjs +1 -0
- package/es/version.mjs +1 -1
- package/lib/_virtual/_plugin-vue_export-helper.js +13 -0
- package/lib/api/index.js +147 -0
- package/lib/bussiness/hyAddDepartmentType/addDepartmentType.vue.js +369 -0
- package/lib/bussiness/hyAddDepartmentType/index.js +11 -0
- package/lib/bussiness/hyAddDepartmentType/style/addDepartmentType.scss +31 -0
- package/lib/bussiness/index.js +5 -0
- package/lib/components/hyBatchUploadDialog/batchUploadDialog.vue.js +44 -35
- package/lib/components/hyDatePicker/datePicker.vue.js +2 -0
- package/lib/components/hyForm/cpns/formItem.vue.js +111 -48
- package/lib/components/hyForm/cpns/locationSelect.vue.js +362 -0
- package/lib/components/hyForm/form.vue.js +79 -27
- package/lib/components/hyForm/js/index.js +9 -1
- package/lib/components/hyForm/js/useAppForm.js +5 -35
- package/lib/components/hyMap/map.vue.js +3 -3
- package/lib/components/hyMenu/menu.vue.js +37 -22
- package/lib/components/hyMenu/style/menu.scss +3 -1
- package/lib/components/hyOrgCascader/js/index.js +2 -2
- package/lib/components/hyRadioGroup/index.js +11 -0
- package/lib/components/hyRadioGroup/radioGroup.vue.js +127 -0
- package/lib/components/hyRadioGroup/style/radioGroup.scss +0 -0
- package/lib/components/hySearch/cpns/searchItem.vue.js +19 -12
- package/lib/components/hySearch/js/useAppSearch.js +2 -32
- package/lib/components/hyTable/cpns/virtualTable.vue.js +9 -1
- package/lib/components/hyTable/js/index.js +6 -3
- package/lib/components/hyTable/js/search.js +1 -0
- package/lib/components/hyTable/table.vue.js +43 -36
- package/lib/components/hyTableForm/batchTableForm.vue.js +5 -2
- package/lib/components/hyTableForm/tableForm.vue.js +6 -0
- package/lib/components/hyTree/js/index.js +69 -53
- package/lib/components/hyTree/tree.vue.js +36 -1
- package/lib/components/hyVideoPlayer/js/index.js +0 -1
- package/lib/components/index.js +14 -12
- package/lib/hooks/useApi.js +2 -2
- package/lib/index.js +61 -49
- package/lib/locale/en.js +17 -1
- package/lib/locale/zh_CN.js +17 -1
- package/lib/static/hy-svg-icons/hy-icon-ops-linear-shouqi.js +8 -0
- package/lib/static/hy-svg-icons/hy-icon-ops-linear-zhankai.js +8 -0
- package/lib/style/index.scss +53 -0
- package/lib/style/theme.scss +0 -53
- package/lib/utils/form.js +57 -5
- package/lib/utils/handler.js +5 -0
- package/lib/utils/index.js +8 -0
- package/lib/utils/map/hook/bigMap.js +4 -0
- package/lib/utils/map/hook/gaode.js +3 -0
- package/lib/utils/map/hook/leafletjs.js +10 -10
- package/lib/utils/map/index.js +26 -6
- package/lib/utils/tree.js +10 -0
- package/lib/version.js +1 -1
- package/package.json +2 -2
package/dist/tailwind.css
CHANGED
|
@@ -232,10 +232,18 @@
|
|
|
232
232
|
right: 50%;
|
|
233
233
|
}
|
|
234
234
|
|
|
235
|
+
.right-2 {
|
|
236
|
+
right: 0.5rem;
|
|
237
|
+
}
|
|
238
|
+
|
|
235
239
|
.right-3 {
|
|
236
240
|
right: 0.75rem;
|
|
237
241
|
}
|
|
238
242
|
|
|
243
|
+
.right-4 {
|
|
244
|
+
right: 1rem;
|
|
245
|
+
}
|
|
246
|
+
|
|
239
247
|
.top-0 {
|
|
240
248
|
top: 0px;
|
|
241
249
|
}
|
|
@@ -244,14 +252,26 @@
|
|
|
244
252
|
top: 50%;
|
|
245
253
|
}
|
|
246
254
|
|
|
255
|
+
.top-2 {
|
|
256
|
+
top: 0.5rem;
|
|
257
|
+
}
|
|
258
|
+
|
|
247
259
|
.top-\[19px\] {
|
|
248
260
|
top: 19px;
|
|
249
261
|
}
|
|
250
262
|
|
|
263
|
+
.z-0 {
|
|
264
|
+
z-index: 0;
|
|
265
|
+
}
|
|
266
|
+
|
|
251
267
|
.z-10 {
|
|
252
268
|
z-index: 10;
|
|
253
269
|
}
|
|
254
270
|
|
|
271
|
+
.z-20 {
|
|
272
|
+
z-index: 20;
|
|
273
|
+
}
|
|
274
|
+
|
|
255
275
|
.z-\[1\] {
|
|
256
276
|
z-index: 1;
|
|
257
277
|
}
|
|
@@ -344,6 +364,10 @@
|
|
|
344
364
|
margin-left: 0.75rem;
|
|
345
365
|
}
|
|
346
366
|
|
|
367
|
+
.ml-4 {
|
|
368
|
+
margin-left: 1rem;
|
|
369
|
+
}
|
|
370
|
+
|
|
347
371
|
.ml-\[4px\] {
|
|
348
372
|
margin-left: 4px;
|
|
349
373
|
}
|
|
@@ -400,6 +424,10 @@
|
|
|
400
424
|
margin-top: 1rem;
|
|
401
425
|
}
|
|
402
426
|
|
|
427
|
+
.mt-5 {
|
|
428
|
+
margin-top: 1.25rem;
|
|
429
|
+
}
|
|
430
|
+
|
|
403
431
|
.mt-\[10px\] {
|
|
404
432
|
margin-top: 10px;
|
|
405
433
|
}
|
|
@@ -448,6 +476,10 @@
|
|
|
448
476
|
display: none;
|
|
449
477
|
}
|
|
450
478
|
|
|
479
|
+
.\!h-14 {
|
|
480
|
+
height: 3.5rem !important;
|
|
481
|
+
}
|
|
482
|
+
|
|
451
483
|
.\!h-3 {
|
|
452
484
|
height: 0.75rem !important;
|
|
453
485
|
}
|
|
@@ -456,10 +488,6 @@
|
|
|
456
488
|
height: 1rem !important;
|
|
457
489
|
}
|
|
458
490
|
|
|
459
|
-
.\!h-5 {
|
|
460
|
-
height: 1.25rem !important;
|
|
461
|
-
}
|
|
462
|
-
|
|
463
491
|
.\!h-\[12px\] {
|
|
464
492
|
height: 12px !important;
|
|
465
493
|
}
|
|
@@ -484,6 +512,10 @@
|
|
|
484
512
|
height: 40px !important;
|
|
485
513
|
}
|
|
486
514
|
|
|
515
|
+
.\!h-\[42px\] {
|
|
516
|
+
height: 42px !important;
|
|
517
|
+
}
|
|
518
|
+
|
|
487
519
|
.\!h-\[46px\] {
|
|
488
520
|
height: 46px !important;
|
|
489
521
|
}
|
|
@@ -520,6 +552,10 @@
|
|
|
520
552
|
height: 1rem;
|
|
521
553
|
}
|
|
522
554
|
|
|
555
|
+
.h-8 {
|
|
556
|
+
height: 2rem;
|
|
557
|
+
}
|
|
558
|
+
|
|
523
559
|
.h-\[12px\] {
|
|
524
560
|
height: 12px;
|
|
525
561
|
}
|
|
@@ -532,6 +568,14 @@
|
|
|
532
568
|
height: 22px;
|
|
533
569
|
}
|
|
534
570
|
|
|
571
|
+
.h-\[24px\] {
|
|
572
|
+
height: 24px;
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
.h-\[280px\] {
|
|
576
|
+
height: 280px;
|
|
577
|
+
}
|
|
578
|
+
|
|
535
579
|
.h-\[30px\] {
|
|
536
580
|
height: 30px;
|
|
537
581
|
}
|
|
@@ -552,6 +596,10 @@
|
|
|
552
596
|
height: 38px;
|
|
553
597
|
}
|
|
554
598
|
|
|
599
|
+
.h-\[40px\] {
|
|
600
|
+
height: 40px;
|
|
601
|
+
}
|
|
602
|
+
|
|
555
603
|
.h-\[42px\] {
|
|
556
604
|
height: 42px;
|
|
557
605
|
}
|
|
@@ -612,6 +660,18 @@
|
|
|
612
660
|
min-height: 40px;
|
|
613
661
|
}
|
|
614
662
|
|
|
663
|
+
.min-h-\[56px\] {
|
|
664
|
+
min-height: 56px;
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
.min-h-\[64px\] {
|
|
668
|
+
min-height: 64px;
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
.min-h-\[72px\] {
|
|
672
|
+
min-height: 72px;
|
|
673
|
+
}
|
|
674
|
+
|
|
615
675
|
.\!w-3 {
|
|
616
676
|
width: 0.75rem !important;
|
|
617
677
|
}
|
|
@@ -620,8 +680,8 @@
|
|
|
620
680
|
width: 1rem !important;
|
|
621
681
|
}
|
|
622
682
|
|
|
623
|
-
.\!w-
|
|
624
|
-
width:
|
|
683
|
+
.\!w-9 {
|
|
684
|
+
width: 2.25rem !important;
|
|
625
685
|
}
|
|
626
686
|
|
|
627
687
|
.\!w-\[12px\] {
|
|
@@ -648,6 +708,10 @@
|
|
|
648
708
|
width: 40px !important;
|
|
649
709
|
}
|
|
650
710
|
|
|
711
|
+
.\!w-\[42px\] {
|
|
712
|
+
width: 42px !important;
|
|
713
|
+
}
|
|
714
|
+
|
|
651
715
|
.\!w-\[46px\] {
|
|
652
716
|
width: 46px !important;
|
|
653
717
|
}
|
|
@@ -688,6 +752,10 @@
|
|
|
688
752
|
width: 1.25rem;
|
|
689
753
|
}
|
|
690
754
|
|
|
755
|
+
.w-\[110px\] {
|
|
756
|
+
width: 110px;
|
|
757
|
+
}
|
|
758
|
+
|
|
691
759
|
.w-\[12px\] {
|
|
692
760
|
width: 12px;
|
|
693
761
|
}
|
|
@@ -724,6 +792,10 @@
|
|
|
724
792
|
width: 42px;
|
|
725
793
|
}
|
|
726
794
|
|
|
795
|
+
.w-\[44px\] {
|
|
796
|
+
width: 44px;
|
|
797
|
+
}
|
|
798
|
+
|
|
727
799
|
.w-\[54px\] {
|
|
728
800
|
width: 54px;
|
|
729
801
|
}
|
|
@@ -732,6 +804,10 @@
|
|
|
732
804
|
width: 68px;
|
|
733
805
|
}
|
|
734
806
|
|
|
807
|
+
.w-\[80px\] {
|
|
808
|
+
width: 80px;
|
|
809
|
+
}
|
|
810
|
+
|
|
735
811
|
.w-full {
|
|
736
812
|
width: 100%;
|
|
737
813
|
}
|
|
@@ -827,6 +903,10 @@
|
|
|
827
903
|
resize: both;
|
|
828
904
|
}
|
|
829
905
|
|
|
906
|
+
.flex-row {
|
|
907
|
+
flex-direction: row;
|
|
908
|
+
}
|
|
909
|
+
|
|
830
910
|
.flex-row-reverse {
|
|
831
911
|
flex-direction: row-reverse;
|
|
832
912
|
}
|
|
@@ -859,6 +939,10 @@
|
|
|
859
939
|
justify-content: space-between;
|
|
860
940
|
}
|
|
861
941
|
|
|
942
|
+
.gap-1 {
|
|
943
|
+
gap: 0.25rem;
|
|
944
|
+
}
|
|
945
|
+
|
|
862
946
|
.gap-1\.5 {
|
|
863
947
|
gap: 0.375rem;
|
|
864
948
|
}
|
|
@@ -1000,6 +1084,10 @@
|
|
|
1000
1084
|
border-color: rgb(var(--hy-border), var(--tw-border-opacity, 1));
|
|
1001
1085
|
}
|
|
1002
1086
|
|
|
1087
|
+
.border-border\/50 {
|
|
1088
|
+
border-color: rgb(var(--hy-border), 0.5);
|
|
1089
|
+
}
|
|
1090
|
+
|
|
1003
1091
|
.border-theme {
|
|
1004
1092
|
--tw-border-opacity: 1;
|
|
1005
1093
|
border-color: rgb(var(--hy-theme), var(--tw-border-opacity, 1));
|
|
@@ -1052,6 +1140,10 @@
|
|
|
1052
1140
|
background-color: rgb(var(--hy-background-4), var(--tw-bg-opacity, 1));
|
|
1053
1141
|
}
|
|
1054
1142
|
|
|
1143
|
+
.bg-background\/70 {
|
|
1144
|
+
background-color: rgb(var(--hy-background), 0.7);
|
|
1145
|
+
}
|
|
1146
|
+
|
|
1055
1147
|
.bg-danger-2 {
|
|
1056
1148
|
--tw-bg-opacity: 1;
|
|
1057
1149
|
background-color: rgb(var(--hy-danger-2), var(--tw-bg-opacity, 1));
|
|
@@ -1317,6 +1409,14 @@
|
|
|
1317
1409
|
line-height: 1.25rem;
|
|
1318
1410
|
}
|
|
1319
1411
|
|
|
1412
|
+
.leading-\[20px\] {
|
|
1413
|
+
line-height: 20px;
|
|
1414
|
+
}
|
|
1415
|
+
|
|
1416
|
+
.text-\[var\(--hy-el-text-color-disabled\)\] {
|
|
1417
|
+
color: var(--hy-el-text-color-disabled);
|
|
1418
|
+
}
|
|
1419
|
+
|
|
1320
1420
|
.text-auxiliary {
|
|
1321
1421
|
--tw-text-opacity: 1;
|
|
1322
1422
|
color: rgb(var(--hy-auxiliary), var(--tw-text-opacity, 1));
|
|
@@ -1373,6 +1473,12 @@
|
|
|
1373
1473
|
box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
|
|
1374
1474
|
}
|
|
1375
1475
|
|
|
1476
|
+
.shadow-\[0_0_6px_0\] {
|
|
1477
|
+
--tw-shadow: 0 0 6px 0;
|
|
1478
|
+
--tw-shadow-colored: 0 0 6px 0 var(--tw-shadow-color);
|
|
1479
|
+
box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
|
|
1480
|
+
}
|
|
1481
|
+
|
|
1376
1482
|
.shadow-\[0px_0px_10px_2px_var\(--dangerv2\)\] {
|
|
1377
1483
|
--tw-shadow: 0px 0px 10px 2px var(--dangerv2);
|
|
1378
1484
|
--tw-shadow-colored: 0px 0px 10px 2px var(--tw-shadow-color);
|
|
@@ -1384,6 +1490,11 @@
|
|
|
1384
1490
|
--tw-shadow: var(--tw-shadow-colored);
|
|
1385
1491
|
}
|
|
1386
1492
|
|
|
1493
|
+
.shadow-theme {
|
|
1494
|
+
--tw-shadow-color: rgb(var(--hy-theme), 1);
|
|
1495
|
+
--tw-shadow: var(--tw-shadow-colored);
|
|
1496
|
+
}
|
|
1497
|
+
|
|
1387
1498
|
.outline {
|
|
1388
1499
|
outline-style: solid;
|
|
1389
1500
|
}
|
|
@@ -1454,6 +1565,10 @@
|
|
|
1454
1565
|
transition-duration: 300ms;
|
|
1455
1566
|
}
|
|
1456
1567
|
|
|
1568
|
+
.duration-500 {
|
|
1569
|
+
transition-duration: 500ms;
|
|
1570
|
+
}
|
|
1571
|
+
|
|
1457
1572
|
.ease-in {
|
|
1458
1573
|
transition-timing-function: cubic-bezier(0.4, 0, 1, 1);
|
|
1459
1574
|
}
|
|
@@ -1481,6 +1596,10 @@ menu {
|
|
|
1481
1596
|
padding: 0;
|
|
1482
1597
|
}
|
|
1483
1598
|
|
|
1599
|
+
.hover\:border-\[rgba\(var\(--hy-auxiliary\)\2c 1\)\]:hover {
|
|
1600
|
+
border-color: rgba(var(--hy-auxiliary),1);
|
|
1601
|
+
}
|
|
1602
|
+
|
|
1484
1603
|
.hover\:border-theme:hover {
|
|
1485
1604
|
--tw-border-opacity: 1;
|
|
1486
1605
|
border-color: rgb(var(--hy-theme), var(--tw-border-opacity, 1));
|
|
@@ -1510,6 +1629,12 @@ menu {
|
|
|
1510
1629
|
color: rgb(var(--hy-theme), var(--tw-text-opacity, 1));
|
|
1511
1630
|
}
|
|
1512
1631
|
|
|
1632
|
+
.hover\:shadow-\[0px_0px_5px_0px_rgba\(var\(--hy-auxiliary\)\2c 0\.5\)\]:hover {
|
|
1633
|
+
--tw-shadow: 0px 0px 5px 0px rgba(var(--hy-auxiliary),0.5);
|
|
1634
|
+
--tw-shadow-colored: 0px 0px 5px 0px var(--tw-shadow-color);
|
|
1635
|
+
box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
|
|
1636
|
+
}
|
|
1637
|
+
|
|
1513
1638
|
.hover\:shadow-\[0px_0px_5px_0px_rgba\(var\(--hy-theme\)\2c 0\.5\)\]:hover {
|
|
1514
1639
|
--tw-shadow: 0px 0px 5px 0px rgba(var(--hy-theme),0.5);
|
|
1515
1640
|
--tw-shadow-colored: 0px 0px 5px 0px var(--tw-shadow-color);
|
package/es/api/index.mjs
ADDED
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { unref } from 'vue';
|
|
2
|
+
import { useApi } from '../hooks/useApi.mjs';
|
|
3
|
+
import { useLocale } from '../hooks/useLocale.mjs';
|
|
4
|
+
|
|
5
|
+
const { t } = useLocale();
|
|
6
|
+
function selectApi(controller, params) {
|
|
7
|
+
return new Promise((resolve, reject) => {
|
|
8
|
+
const { api } = useApi();
|
|
9
|
+
const http = unref(api);
|
|
10
|
+
if (!params) {
|
|
11
|
+
return reject(new Error(t("iDNotPassed")));
|
|
12
|
+
}
|
|
13
|
+
http.post(controller + "/select", {
|
|
14
|
+
id: params !== -1 ? params : null
|
|
15
|
+
}).then((res) => {
|
|
16
|
+
resolve(res);
|
|
17
|
+
}).catch((res) => {
|
|
18
|
+
reject(new Error(t("interfaceError")));
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
function detailApi(controller, params) {
|
|
23
|
+
return new Promise((resolve, reject) => {
|
|
24
|
+
const { api } = useApi();
|
|
25
|
+
const http = unref(api);
|
|
26
|
+
if (!params) {
|
|
27
|
+
return reject(new Error(t("iDNotPassed")));
|
|
28
|
+
}
|
|
29
|
+
http.post(controller + "/detail", { id: params }).then((res) => {
|
|
30
|
+
resolve(res);
|
|
31
|
+
}).catch((res) => {
|
|
32
|
+
reject(new Error(t("interfaceError")));
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
function insertFnApi(controller, params) {
|
|
37
|
+
for (const obj in params) {
|
|
38
|
+
if (obj.indexOf("createDtm") > -1 || obj.indexOf("updateDtm") > -1) {
|
|
39
|
+
delete params[obj];
|
|
40
|
+
} else if (params[obj] === null) {
|
|
41
|
+
delete params[obj];
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
const url = controller + "/insert";
|
|
45
|
+
return new Promise((resolve, reject) => {
|
|
46
|
+
const { api } = useApi();
|
|
47
|
+
const http = unref(api);
|
|
48
|
+
http.post(url, params, { isJSON: true }).then((res) => {
|
|
49
|
+
return resolve(res);
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
function saveFnApi(controller, params, options) {
|
|
54
|
+
for (const obj in params) {
|
|
55
|
+
if (obj.indexOf("createDtm") > -1 || obj.indexOf("updateDtm") > -1) {
|
|
56
|
+
delete params[obj];
|
|
57
|
+
} else if (params[obj] === null) {
|
|
58
|
+
delete params[obj];
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
const url = controller + "/save";
|
|
62
|
+
return new Promise((resolve, reject) => {
|
|
63
|
+
const { api } = useApi();
|
|
64
|
+
const http = unref(api);
|
|
65
|
+
http.post(url, params, { isJSON: true, ...options }).then((res) => {
|
|
66
|
+
return resolve(res);
|
|
67
|
+
}).catch((res) => {
|
|
68
|
+
reject(res);
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
function saveApi(controller, params) {
|
|
73
|
+
for (const obj in params) {
|
|
74
|
+
if (obj.indexOf("createDtm") > -1 || obj.indexOf("updateDtm") > -1) {
|
|
75
|
+
delete params[obj];
|
|
76
|
+
} else if (params[obj] === null) {
|
|
77
|
+
delete params[obj];
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
let url = "";
|
|
81
|
+
if (params.id) {
|
|
82
|
+
url = controller + "/update";
|
|
83
|
+
} else {
|
|
84
|
+
url = controller + "/insert";
|
|
85
|
+
}
|
|
86
|
+
return new Promise((resolve, reject) => {
|
|
87
|
+
const { api } = useApi();
|
|
88
|
+
const http = unref(api);
|
|
89
|
+
http.post(url, params, { isJSON: true }).then((res) => {
|
|
90
|
+
return resolve(res);
|
|
91
|
+
});
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
function findAllApi(controller, params) {
|
|
95
|
+
return new Promise((resolve, reject) => {
|
|
96
|
+
const { api } = useApi();
|
|
97
|
+
const http = unref(api);
|
|
98
|
+
http.post(controller + "/findAll", params).then((res) => {
|
|
99
|
+
resolve(res);
|
|
100
|
+
});
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
function pageApi(controller, params, isJsonData) {
|
|
104
|
+
return new Promise((resolve, reject) => {
|
|
105
|
+
const { api } = useApi();
|
|
106
|
+
const http = unref(api);
|
|
107
|
+
http.post(controller + "/page", params, { isJSON: isJsonData }).then((res) => {
|
|
108
|
+
resolve(res);
|
|
109
|
+
});
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
function deleteBatchApi(controller, ids) {
|
|
113
|
+
return new Promise((resolve, reject) => {
|
|
114
|
+
const { api } = useApi();
|
|
115
|
+
const http = unref(api);
|
|
116
|
+
if (!ids) {
|
|
117
|
+
return reject(new Error(t("iDNotPassed")));
|
|
118
|
+
}
|
|
119
|
+
http.post(controller + "/deleteBatch", { ids }).then((res) => {
|
|
120
|
+
resolve(res);
|
|
121
|
+
});
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
function displayChangeApi(controller, ids, display) {
|
|
125
|
+
return new Promise((resolve) => {
|
|
126
|
+
const { api } = useApi();
|
|
127
|
+
const http = unref(api);
|
|
128
|
+
http.post(controller + "/displayChange", {
|
|
129
|
+
ids: ids.toString(),
|
|
130
|
+
display
|
|
131
|
+
}).then(() => {
|
|
132
|
+
resolve();
|
|
133
|
+
});
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export { deleteBatchApi, detailApi, displayChangeApi, findAllApi, insertFnApi, pageApi, saveApi, saveFnApi, selectApi };
|