@blueking/ai-ui-sdk 0.1.19-beta.9 → 0.1.19
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/common/util.d.ts +24 -0
- package/dist/common/util.ts.js +41 -0
- package/dist/components/render-auth/auth-dialog.script.vue.js.js +27 -26
- package/dist/components/render-auto-height-textarea/index.vue.css +11 -11
- package/dist/components/render-auto-height-textarea/index.vue.js +1 -1
- package/dist/components/render-auto-refresh/index.vue.css +8 -8
- package/dist/components/render-auto-refresh/index.vue.js +1 -1
- package/dist/components/render-checkbox/index.vue.css +9 -9
- package/dist/components/render-checkbox/index.vue.js +1 -1
- package/dist/components/render-choose-tag/index.script.vue.js.js +123 -91
- package/dist/components/render-choose-tag/index.vue.css +7 -7
- package/dist/components/render-choose-tag/index.vue.d.ts +1 -0
- package/dist/components/render-choose-tag/index.vue.js +1 -1
- package/dist/components/render-collapse/index.vue.css +2 -2
- package/dist/components/render-collapse/index.vue.js +1 -1
- package/dist/components/render-dataset/components/dataset-data-status/index.script.vue.js.js +6 -8
- package/dist/components/render-dataset/components/dataset-data-tool-icons/index.script.vue.js +1 -1
- package/dist/components/render-dataset/components/edit-dataset-data/index.vue.css +3 -3
- package/dist/components/render-dataset/components/edit-dataset-data/index.vue.js +1 -1
- package/dist/components/render-dataset/components/operation-record/index.script.vue.js.js +36 -1
- package/dist/components/render-dataset/components/operation-record/index.vue.css +4 -4
- package/dist/components/render-dataset/components/operation-record/index.vue.js +1 -1
- package/dist/components/render-dataset/components/operation-record/table/index.script.vue.js +174 -0
- package/dist/components/render-dataset/components/operation-record/table/index.vue.css +1 -1
- package/dist/components/render-dataset/components/operation-record/table/index.vue.d.ts +5 -1
- package/dist/components/render-dataset/components/operation-record/table/index.vue.js +2 -2
- package/dist/components/render-dataset/components/operation-record/view-op-result/index.vue.css +2 -2
- package/dist/components/render-dataset/components/operation-record/view-op-result/index.vue.js +1 -1
- package/dist/components/render-dataset/components/plus-dataset/dataset-form.script.vue.js +34 -42
- package/dist/components/render-dataset/components/plus-dataset/index.script.vue.js.js +24 -6
- package/dist/components/render-dataset/components/plus-dataset/index.vue.css +2 -2
- package/dist/components/render-dataset/components/plus-dataset/index.vue.js +1 -1
- package/dist/components/render-dataset/components/plus-dataset-data/form/api.script.vue.js.js +21 -29
- package/dist/components/render-dataset/components/plus-dataset-data/form/api.vue.css +2 -2
- package/dist/components/render-dataset/components/plus-dataset-data/form/api.vue.js +1 -1
- package/dist/components/render-dataset/components/plus-dataset-data/form/dataset.script.vue.js.js +4 -1
- package/dist/components/render-dataset/components/plus-dataset-data/form/footer.vue.css +1 -1
- package/dist/components/render-dataset/components/plus-dataset-data/form/footer.vue.js +1 -1
- package/dist/components/render-dataset/components/plus-dataset-data/form/index.vue.css +2 -2
- package/dist/components/render-dataset/components/plus-dataset-data/form/index.vue.js +1 -1
- package/dist/components/render-dataset/components/plus-dataset-data/index.script.vue.js.js +6 -1
- package/dist/components/render-dataset/components/plus-dataset-data/index.vue.d.ts +1 -0
- package/dist/components/render-dataset/components/review-dataset-data/index.vue.css +10 -10
- package/dist/components/render-dataset/components/review-dataset-data/index.vue.js +1 -1
- package/dist/components/render-dataset/components/search-dataset/index.script.vue.js.js +21 -31
- package/dist/components/render-dataset/components/search-dataset/index.vue.d.ts +1 -0
- package/dist/components/render-dataset-detail/components/header.script.vue.js.js +1 -1
- package/dist/components/render-dataset-detail-origin-data/components/table/index.script.vue.js +245 -388
- package/dist/components/render-dataset-detail-origin-data/components/table/index.vue.d.ts +3 -1
- package/dist/components/render-dataset-detail-origin-data/index.script.vue.js.js +7 -6
- package/dist/components/render-dataset-detail-origin-data/index.vue.css +3 -3
- package/dist/components/render-dataset-detail-origin-data/index.vue.js +1 -1
- package/dist/components/render-dataset-list/components/header.script.vue.js.js +2 -2
- package/dist/components/render-dataset-list/components/main.script.vue.js.js +11 -7
- package/dist/components/render-dataset-list/components/main.vue.css +4 -4
- package/dist/components/render-dataset-list/components/main.vue.d.ts +1 -0
- package/dist/components/render-dataset-list/components/main.vue.js +1 -1
- package/dist/components/render-dataset-list/components/table.script.vue.js +408 -0
- package/dist/components/render-dataset-list/components/table.vue.d.ts +2 -0
- package/dist/components/render-dataset-list/components/table.vue.js +1 -1
- package/dist/components/render-dataset-list/index.script.vue.js.js +7 -2
- package/dist/components/render-dataset-list/index.vue.css +4 -1
- package/dist/components/render-dataset-list/index.vue.d.ts +1 -0
- package/dist/components/render-dataset-list/index.vue.js +1 -1
- package/dist/components/render-file-card/index.script.vue.js.js +5 -15
- package/dist/components/render-file-card/index.vue.css +11 -11
- package/dist/components/render-file-card/index.vue.js +1 -1
- package/dist/components/render-file-type-icon/index.vue.css +5 -5
- package/dist/components/render-file-type-icon/index.vue.js +1 -1
- package/dist/components/render-header/index.script.vue.js.js +10 -2
- package/dist/components/render-header/index.vue.css +3 -3
- package/dist/components/render-header/index.vue.d.ts +1 -1
- package/dist/components/render-header/index.vue.js +1 -1
- package/dist/components/render-like/index.script.vue.js.js +3 -3
- package/dist/components/render-like/index.vue.css +14 -13
- package/dist/components/render-like/index.vue.js +1 -1
- package/dist/components/render-router-tab/index.vue.css +4 -4
- package/dist/components/render-router-tab/index.vue.js +1 -1
- package/dist/components/render-search-empty/index.script.vue.js.js +61 -0
- package/dist/components/render-search-empty/index.vue.d.ts +20 -0
- package/dist/components/render-search-empty/index.vue.js +3 -0
- package/dist/components/render-t-table/index.script.vue.js +317 -0
- package/dist/components/render-t-table/index.vue.css +196 -0
- package/dist/components/render-t-table/index.vue.d.ts +58 -0
- package/dist/components/render-t-table/index.vue.js +5 -0
- package/dist/components/render-tag-tree/index.script.vue.js.js +101 -24
- package/dist/components/render-tag-tree/index.vue.css +7 -7
- package/dist/components/render-tag-tree/index.vue.d.ts +2 -1
- package/dist/components/render-tag-tree/index.vue.js +1 -1
- package/dist/components/render-tree/index.script.vue.js +17 -8
- package/dist/components/render-tree/index.vue.d.ts +4 -1
- package/dist/components.d.ts +3 -1
- package/dist/components.ts.js +3 -1
- package/dist/css/fonts/iconcool.eot +0 -0
- package/dist/css/fonts/iconcool.svg +3 -0
- package/dist/css/fonts/iconcool.ttf +0 -0
- package/dist/css/fonts/iconcool.woff +0 -0
- package/dist/css/iconcool.js +1 -1
- package/dist/css/style.css +3 -0
- package/dist/css/tailwind.css +88 -10
- package/dist/hooks/use-chat.d.ts +12 -4
- package/dist/hooks/use-common-http.d.ts +5 -2
- package/dist/hooks/use-common-http.ts.js +7 -5
- package/dist/hooks/use-dataset-http.d.ts +2 -2
- package/dist/hooks/use-dataset-http.ts.js +6 -4
- package/dist/hooks/use-ellipsis-tooltip.d.ts +4 -0
- package/dist/hooks/use-ellipsis-tooltip.ts.js +87 -0
- package/dist/hooks/use-member-http.d.ts +8 -0
- package/dist/hooks/use-member-http.ts.js +30 -0
- package/dist/hooks/use-meta-http.d.ts +3 -3
- package/dist/hooks/use-meta-http.ts.js +9 -5
- package/dist/hooks/use-t-table.d.ts +39 -0
- package/dist/hooks/use-t-table.ts.js +82 -0
- package/dist/hooks.d.ts +3 -0
- package/dist/hooks.ts.js +3 -0
- package/dist/http/fetch/index.ts.js +3 -2
- package/dist/http/helper/common.ts.js +4 -4
- package/dist/http/helper/dataset.ts.js +4 -2
- package/dist/http/helper/knowledge.ts.js +9 -3
- package/dist/http/helper/tool.ts.js +5 -4
- package/dist/images/market.png +0 -0
- package/dist/types/common.d.ts +23 -0
- package/dist/types/dataset.d.ts +2 -0
- package/dist/types/knowledge.d.ts +6 -0
- package/dist/types/tool.d.ts +3 -3
- package/dist/util.d.ts +1 -0
- package/dist/util.ts.js +1 -0
- package/package.json +11 -2
- package/dist/components/render-dataset/components/operation-record/table/index.script.vue.js.js +0 -226
- package/dist/components/render-dataset-list/components/table.script.vue.js.js +0 -592
package/dist/css/tailwind.css
CHANGED
|
@@ -22,15 +22,19 @@
|
|
|
22
22
|
.g-flex-column {
|
|
23
23
|
display: flex;
|
|
24
24
|
flex-direction: column;
|
|
25
|
-
align-items:
|
|
25
|
+
align-items: initial !important;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.g-align-center {
|
|
29
|
+
align-items: center !important;
|
|
26
30
|
}
|
|
27
31
|
|
|
28
32
|
.g-align-start {
|
|
29
|
-
align-items: flex-start;
|
|
33
|
+
align-items: flex-start !important;
|
|
30
34
|
}
|
|
31
35
|
|
|
32
36
|
.g-align-self-center {
|
|
33
|
-
align-self: center;
|
|
37
|
+
align-self: center !important;
|
|
34
38
|
}
|
|
35
39
|
|
|
36
40
|
.g-justify-between {
|
|
@@ -45,6 +49,10 @@
|
|
|
45
49
|
justify-content: end;
|
|
46
50
|
}
|
|
47
51
|
|
|
52
|
+
.g-justify-start {
|
|
53
|
+
justify-content: start;
|
|
54
|
+
}
|
|
55
|
+
|
|
48
56
|
.g-overflow-hidden {
|
|
49
57
|
overflow: hidden;
|
|
50
58
|
}
|
|
@@ -74,6 +82,10 @@
|
|
|
74
82
|
padding: 4px;
|
|
75
83
|
}
|
|
76
84
|
|
|
85
|
+
.g-p-12 {
|
|
86
|
+
padding: 12px;
|
|
87
|
+
}
|
|
88
|
+
|
|
77
89
|
.g-p-24 {
|
|
78
90
|
padding: 24px;
|
|
79
91
|
}
|
|
@@ -134,10 +146,6 @@
|
|
|
134
146
|
margin-top: 25px;
|
|
135
147
|
}
|
|
136
148
|
|
|
137
|
-
.g-mt-30 {
|
|
138
|
-
margin-top: 30px;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
149
|
.g-mt-100 {
|
|
142
150
|
margin-top: 100px;
|
|
143
151
|
}
|
|
@@ -362,6 +370,14 @@
|
|
|
362
370
|
padding-right: 5px !important;
|
|
363
371
|
}
|
|
364
372
|
|
|
373
|
+
.g-pr-8 {
|
|
374
|
+
padding-right: 8px;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
.g-pr-14 {
|
|
378
|
+
padding-right: 14px;
|
|
379
|
+
}
|
|
380
|
+
|
|
365
381
|
.g-pr-16 {
|
|
366
382
|
padding-right: 16px !important;
|
|
367
383
|
}
|
|
@@ -374,10 +390,18 @@
|
|
|
374
390
|
padding-top: 4px;
|
|
375
391
|
}
|
|
376
392
|
|
|
393
|
+
.g-pt-8 {
|
|
394
|
+
padding-top: 8px;
|
|
395
|
+
}
|
|
396
|
+
|
|
377
397
|
.g-pt-12 {
|
|
378
398
|
padding-top: 12px;
|
|
379
399
|
}
|
|
380
400
|
|
|
401
|
+
.g-pt-14 {
|
|
402
|
+
padding-top: 14px;
|
|
403
|
+
}
|
|
404
|
+
|
|
381
405
|
.g-pt-16 {
|
|
382
406
|
padding-top: 16px;
|
|
383
407
|
}
|
|
@@ -402,10 +426,22 @@
|
|
|
402
426
|
padding-bottom: 4px;
|
|
403
427
|
}
|
|
404
428
|
|
|
429
|
+
.g-pb-8 {
|
|
430
|
+
padding-bottom: 8px;
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
.g-pb-10 {
|
|
434
|
+
padding-bottom: 10px;
|
|
435
|
+
}
|
|
436
|
+
|
|
405
437
|
.g-pb-12 {
|
|
406
438
|
padding-bottom: 12px;
|
|
407
439
|
}
|
|
408
440
|
|
|
441
|
+
.g-pb-14 {
|
|
442
|
+
padding-bottom: 14px;
|
|
443
|
+
}
|
|
444
|
+
|
|
409
445
|
.g-pb-16 {
|
|
410
446
|
padding-bottom: 16px;
|
|
411
447
|
}
|
|
@@ -426,6 +462,14 @@
|
|
|
426
462
|
padding: 0 3px;
|
|
427
463
|
}
|
|
428
464
|
|
|
465
|
+
.g-w-auto {
|
|
466
|
+
width: auto !important;
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
.g-w-0 {
|
|
470
|
+
width: 0 !important;
|
|
471
|
+
}
|
|
472
|
+
|
|
429
473
|
.g-w-8 {
|
|
430
474
|
width: 8px;
|
|
431
475
|
}
|
|
@@ -614,8 +658,8 @@
|
|
|
614
658
|
width: 108px;
|
|
615
659
|
}
|
|
616
660
|
|
|
617
|
-
.g-width-
|
|
618
|
-
width:
|
|
661
|
+
.g-width-5rem {
|
|
662
|
+
width: 5rem !important;
|
|
619
663
|
}
|
|
620
664
|
|
|
621
665
|
.g-height-max-600 {
|
|
@@ -654,6 +698,22 @@
|
|
|
654
698
|
height: 42px;
|
|
655
699
|
}
|
|
656
700
|
|
|
701
|
+
.g-height-56 {
|
|
702
|
+
height: 56px;
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
.g-height-60 {
|
|
706
|
+
height: 60px;
|
|
707
|
+
}
|
|
708
|
+
|
|
709
|
+
.g-height-70 {
|
|
710
|
+
height: 70px;
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
.g-height-78 {
|
|
714
|
+
height: 78px;
|
|
715
|
+
}
|
|
716
|
+
|
|
657
717
|
.g-height-60 {
|
|
658
718
|
height: 60px;
|
|
659
719
|
}
|
|
@@ -700,7 +760,7 @@
|
|
|
700
760
|
|
|
701
761
|
.g-hover-text-blue {
|
|
702
762
|
&:hover {
|
|
703
|
-
color: #3a84ff;
|
|
763
|
+
color: #3a84ff !important;
|
|
704
764
|
}
|
|
705
765
|
}
|
|
706
766
|
|
|
@@ -722,6 +782,12 @@
|
|
|
722
782
|
}
|
|
723
783
|
}
|
|
724
784
|
|
|
785
|
+
.g-hover-text-normal {
|
|
786
|
+
&:hover {
|
|
787
|
+
color: #4d4f56;
|
|
788
|
+
}
|
|
789
|
+
}
|
|
790
|
+
|
|
725
791
|
.g-hover-border-blue {
|
|
726
792
|
&:hover {
|
|
727
793
|
border: 1px solid #3a84ff !important;
|
|
@@ -850,6 +916,10 @@
|
|
|
850
916
|
column-gap: 16px;
|
|
851
917
|
}
|
|
852
918
|
|
|
919
|
+
.g-gap-x-20 {
|
|
920
|
+
column-gap: 20px;
|
|
921
|
+
}
|
|
922
|
+
|
|
853
923
|
.g-gap-x-21 {
|
|
854
924
|
column-gap: 21px;
|
|
855
925
|
}
|
|
@@ -931,3 +1001,11 @@
|
|
|
931
1001
|
.g-rounded-2 {
|
|
932
1002
|
border-radius: 2px;
|
|
933
1003
|
}
|
|
1004
|
+
|
|
1005
|
+
.g-z-index-9999 {
|
|
1006
|
+
z-index: 9999;
|
|
1007
|
+
}
|
|
1008
|
+
|
|
1009
|
+
.g-fill-current-color {
|
|
1010
|
+
fill: currentColor;
|
|
1011
|
+
}
|
package/dist/hooks/use-chat.d.ts
CHANGED
|
@@ -92,11 +92,11 @@ export declare const useChat: ({ handleStart, handleText, handleReferenceDoc, ha
|
|
|
92
92
|
}[];
|
|
93
93
|
creator: string;
|
|
94
94
|
createTime: string;
|
|
95
|
-
|
|
95
|
+
updatedBy?: string;
|
|
96
|
+
updatedAt?: string;
|
|
96
97
|
toolCode: string;
|
|
97
98
|
toolName: string;
|
|
98
99
|
tagNames: string[][];
|
|
99
|
-
icon: string;
|
|
100
100
|
description: string;
|
|
101
101
|
method: string;
|
|
102
102
|
url: string;
|
|
@@ -303,6 +303,8 @@ export declare const useChat: ({ handleStart, handleText, handleReferenceDoc, ha
|
|
|
303
303
|
};
|
|
304
304
|
}[];
|
|
305
305
|
};
|
|
306
|
+
approvers?: string[];
|
|
307
|
+
ticketUrl?: string;
|
|
306
308
|
}[];
|
|
307
309
|
knowledgebases?: {
|
|
308
310
|
id?: number;
|
|
@@ -330,6 +332,7 @@ export declare const useChat: ({ handleStart, handleText, handleReferenceDoc, ha
|
|
|
330
332
|
folderNumber?: number;
|
|
331
333
|
url?: string;
|
|
332
334
|
updatedBy?: string;
|
|
335
|
+
updatedAt?: string;
|
|
333
336
|
indexConfig?: {
|
|
334
337
|
vector_indexes: {
|
|
335
338
|
index_name: string;
|
|
@@ -426,6 +429,7 @@ export declare const useChat: ({ handleStart, handleText, handleReferenceDoc, ha
|
|
|
426
429
|
folderNumber?: number;
|
|
427
430
|
url?: string;
|
|
428
431
|
updatedBy?: string;
|
|
432
|
+
updatedAt?: string;
|
|
429
433
|
indexConfig?: {
|
|
430
434
|
vector_indexes: {
|
|
431
435
|
index_name: string;
|
|
@@ -583,11 +587,11 @@ export declare const useChat: ({ handleStart, handleText, handleReferenceDoc, ha
|
|
|
583
587
|
}[];
|
|
584
588
|
creator: string;
|
|
585
589
|
createTime: string;
|
|
586
|
-
|
|
590
|
+
updatedBy?: string;
|
|
591
|
+
updatedAt?: string;
|
|
587
592
|
toolCode: string;
|
|
588
593
|
toolName: string;
|
|
589
594
|
tagNames: string[][];
|
|
590
|
-
icon: string;
|
|
591
595
|
description: string;
|
|
592
596
|
method: string;
|
|
593
597
|
url: string;
|
|
@@ -794,6 +798,8 @@ export declare const useChat: ({ handleStart, handleText, handleReferenceDoc, ha
|
|
|
794
798
|
};
|
|
795
799
|
}[];
|
|
796
800
|
};
|
|
801
|
+
approvers?: string[];
|
|
802
|
+
ticketUrl?: string;
|
|
797
803
|
}[];
|
|
798
804
|
knowledgebases?: {
|
|
799
805
|
id?: number;
|
|
@@ -821,6 +827,7 @@ export declare const useChat: ({ handleStart, handleText, handleReferenceDoc, ha
|
|
|
821
827
|
folderNumber?: number;
|
|
822
828
|
url?: string;
|
|
823
829
|
updatedBy?: string;
|
|
830
|
+
updatedAt?: string;
|
|
824
831
|
indexConfig?: {
|
|
825
832
|
vector_indexes: {
|
|
826
833
|
index_name: string;
|
|
@@ -917,6 +924,7 @@ export declare const useChat: ({ handleStart, handleText, handleReferenceDoc, ha
|
|
|
917
924
|
folderNumber?: number;
|
|
918
925
|
url?: string;
|
|
919
926
|
updatedBy?: string;
|
|
927
|
+
updatedAt?: string;
|
|
920
928
|
indexConfig?: {
|
|
921
929
|
vector_indexes: {
|
|
922
930
|
index_name: string;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { type Ref } from 'vue';
|
|
2
|
-
import { GroupType, Module } from '@/types/enum';
|
|
2
|
+
import { EnumCharacter, GroupType, Module } from '@/types/enum';
|
|
3
3
|
export declare const useCommonHttp: (apiPrefix: string, spaceId?: Ref<string>) => {
|
|
4
|
-
getTagTree:
|
|
4
|
+
getTagTree: {
|
|
5
|
+
(module: Module, subModule: Module, tagName: string, groupType?: GroupType, generateType?: EnumCharacter): Promise<import("@/types/common").ITagTree>;
|
|
6
|
+
abort(): void;
|
|
7
|
+
};
|
|
5
8
|
};
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
import fetch from '../http/fetch/index.ts.js';
|
|
1
|
+
import fetch, { withAbort } from '../http/fetch/index.ts.js';
|
|
2
2
|
import { transferTagTreeApiToTagTree } from '../http/helper/common.ts.js';
|
|
3
3
|
export const useCommonHttp = (apiPrefix, spaceId)=>{
|
|
4
4
|
// 获取标签树
|
|
5
|
-
const getTagTree = (module, subModule, tagName, groupType)=>fetch.get(`${apiPrefix}/${module}/v1/${subModule}/tag_tree/`, {
|
|
5
|
+
const getTagTree = withAbort((signal, module, subModule, tagName, groupType, generateType)=>fetch.get(`${apiPrefix}/${module}/v1/${subModule}/tag_tree/`, {
|
|
6
6
|
tag_name: tagName,
|
|
7
|
-
group_type: groupType
|
|
7
|
+
group_type: groupType,
|
|
8
|
+
generate_type: generateType
|
|
8
9
|
}, {
|
|
9
10
|
headers: {
|
|
10
11
|
'x-space-id': spaceId === null || spaceId === void 0 ? void 0 : spaceId.value
|
|
11
|
-
}
|
|
12
|
-
|
|
12
|
+
},
|
|
13
|
+
signal
|
|
14
|
+
}).then((data)=>transferTagTreeApiToTagTree(data)));
|
|
13
15
|
return {
|
|
14
16
|
getTagTree
|
|
15
17
|
};
|
|
@@ -47,6 +47,6 @@ export declare const useDatasetHttp: (apiPrefix?: string, spaceId?: Ref<string>)
|
|
|
47
47
|
batchReviewDatasetData: (data: IBatchReviewDatasetData) => Promise<unknown>;
|
|
48
48
|
batchRetryReviewDatasetData: (data: IBatchRetryReviewDatasetData) => Promise<unknown>;
|
|
49
49
|
getTags: (module: Module) => Promise<import("@/types/meta").ITag[]>;
|
|
50
|
-
plusTag: (tagNames: string[][]) => Promise<ITagApi>;
|
|
51
|
-
checkTag: (tagNames: string[][]) => Promise<boolean>;
|
|
50
|
+
plusTag: (tagNames: string[][], module: Module) => Promise<ITagApi>;
|
|
51
|
+
checkTag: (tagNames: string[][], module: Module) => Promise<boolean>;
|
|
52
52
|
};
|
|
@@ -210,8 +210,9 @@ export const useDatasetHttp = (apiPrefix, spaceId)=>{
|
|
|
210
210
|
}
|
|
211
211
|
}).then((result)=>result.map(transferTagApi2Tag));
|
|
212
212
|
// 新增 tag
|
|
213
|
-
const plusTag = (tagNames)=>fetch.post(`${apiPrefix}/${datasetPerfix}/tag/`, {
|
|
214
|
-
tag_names: tagNames
|
|
213
|
+
const plusTag = (tagNames, module)=>fetch.post(`${apiPrefix}/${datasetPerfix}/tag/`, {
|
|
214
|
+
tag_names: tagNames,
|
|
215
|
+
scope_name: module
|
|
215
216
|
}, {
|
|
216
217
|
globalError: false,
|
|
217
218
|
headers: {
|
|
@@ -219,8 +220,9 @@ export const useDatasetHttp = (apiPrefix, spaceId)=>{
|
|
|
219
220
|
}
|
|
220
221
|
});
|
|
221
222
|
// check tag
|
|
222
|
-
const checkTag = (tagNames)=>fetch.post(`${apiPrefix}/${datasetPerfix}/tag/check/`, {
|
|
223
|
-
tag_names: tagNames
|
|
223
|
+
const checkTag = (tagNames, module)=>fetch.post(`${apiPrefix}/${datasetPerfix}/tag/check/`, {
|
|
224
|
+
tag_names: tagNames,
|
|
225
|
+
scope_name: module
|
|
224
226
|
}, {
|
|
225
227
|
globalError: false,
|
|
226
228
|
headers: {
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import tippy from 'tippy.js';
|
|
2
|
+
import 'tippy.js/dist/tippy.css';
|
|
3
|
+
// 全局事件代理,如果文本溢出,则显示 tooltip
|
|
4
|
+
export const useEllipsisTooltip = ()=>{
|
|
5
|
+
let tippyInstance = null;
|
|
6
|
+
const handleInitEllipsisTooltip = ()=>{
|
|
7
|
+
handleInitEvent();
|
|
8
|
+
handleInitStyle();
|
|
9
|
+
};
|
|
10
|
+
const handleInitEvent = ()=>{
|
|
11
|
+
document.addEventListener('mouseenter', handleMouseEnter, true);
|
|
12
|
+
};
|
|
13
|
+
const handleInitStyle = ()=>{
|
|
14
|
+
const style = document.createElement('style');
|
|
15
|
+
style.textContent = `
|
|
16
|
+
.tippy-box[data-theme~='ellipsis-tooltip'] .tippy-content {
|
|
17
|
+
font-size: 12px !important;
|
|
18
|
+
padding: 7px 14px !important;
|
|
19
|
+
white-space: pre-wrap !important;
|
|
20
|
+
max-height: 400px;
|
|
21
|
+
overflow-y: auto;
|
|
22
|
+
}
|
|
23
|
+
.tippy-box[data-theme~='ellipsis-tooltip'] .tippy-content::-webkit-scrollbar {
|
|
24
|
+
width: 6px;
|
|
25
|
+
height: 6px;
|
|
26
|
+
}
|
|
27
|
+
.tippy-box[data-theme~='ellipsis-tooltip'] .tippy-content::-webkit-scrollbar-thumb {
|
|
28
|
+
width: 6px;
|
|
29
|
+
height: 6px;
|
|
30
|
+
border-radius: 3px;
|
|
31
|
+
background-color: #dcdee5;
|
|
32
|
+
|
|
33
|
+
&:hover {
|
|
34
|
+
background-color: #979ba5;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
.tippy-box[data-theme~='ellipsis-tooltip'][data-placement^=top]>.tippy-arrow:before {
|
|
38
|
+
bottom: -5px !important;
|
|
39
|
+
}
|
|
40
|
+
.tippy-box[data-theme~='ellipsis-tooltip'][data-placement^=bottom]>.tippy-arrow:before {
|
|
41
|
+
top: -5px !important;
|
|
42
|
+
}
|
|
43
|
+
`;
|
|
44
|
+
document.head.appendChild(style);
|
|
45
|
+
};
|
|
46
|
+
const handleMouseEnter = (event)=>{
|
|
47
|
+
var _target_hasAttribute;
|
|
48
|
+
const target = event.target;
|
|
49
|
+
// 没有标识,什么都不做
|
|
50
|
+
if (!(target === null || target === void 0 ? void 0 : (_target_hasAttribute = target.hasAttribute) === null || _target_hasAttribute === void 0 ? void 0 : _target_hasAttribute.call(target, 'data-ellipsis-tooltip'))) return;
|
|
51
|
+
const isOverflow = target.scrollWidth > target.clientWidth || target.scrollHeight > target.clientHeight;
|
|
52
|
+
// 没有溢出,什么都不做
|
|
53
|
+
if (!isOverflow) return;
|
|
54
|
+
const computedStyle = window.getComputedStyle(target);
|
|
55
|
+
const hasScrollbar = computedStyle.overflowX === 'scroll' || computedStyle.overflowX === 'auto' || computedStyle.overflowY === 'scroll' || computedStyle.overflowY === 'auto' || computedStyle.overflow === 'scroll' || computedStyle.overflow === 'auto';
|
|
56
|
+
// 如果有滚动条,不显示 tooltip
|
|
57
|
+
if (hasScrollbar) return;
|
|
58
|
+
// 如果有旧实例,先销毁
|
|
59
|
+
if (tippyInstance) {
|
|
60
|
+
tippyInstance.destroy();
|
|
61
|
+
tippyInstance = null;
|
|
62
|
+
}
|
|
63
|
+
tippyInstance = tippy(target, {
|
|
64
|
+
content: target.getAttribute('data-ellipsis-tooltip') || target.textContent,
|
|
65
|
+
interactive: true,
|
|
66
|
+
arrow: true,
|
|
67
|
+
appendTo: ()=>document.body,
|
|
68
|
+
hideOnClick: false,
|
|
69
|
+
offset: [
|
|
70
|
+
0,
|
|
71
|
+
2
|
|
72
|
+
],
|
|
73
|
+
theme: 'ellipsis-tooltip',
|
|
74
|
+
onHidden: (instance)=>{
|
|
75
|
+
// tooltip 隐藏后销毁实例
|
|
76
|
+
instance.destroy();
|
|
77
|
+
if (tippyInstance === instance) {
|
|
78
|
+
tippyInstance = null;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
tippyInstance.show();
|
|
83
|
+
};
|
|
84
|
+
return {
|
|
85
|
+
handleInitEllipsisTooltip
|
|
86
|
+
};
|
|
87
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Message } from 'bkui-vue';
|
|
2
|
+
export const useMemberHttp = ()=>{
|
|
3
|
+
const getMemberList = (memberUrl, search)=>{
|
|
4
|
+
return new Promise((resolve, reject)=>{
|
|
5
|
+
const callback = `jsonp_init_bk_member_${Math.ceil(Math.random() * 1000)}`;
|
|
6
|
+
const script = document.createElement('script');
|
|
7
|
+
script.src = `${memberUrl}?callback=${callback}&app_code=bk-magicbox&fuzzy_lookups=${search}`;
|
|
8
|
+
script.onerror = reject;
|
|
9
|
+
document.body.appendChild(script);
|
|
10
|
+
// @ts-ignore
|
|
11
|
+
window[callback] = (res)=>{
|
|
12
|
+
if (!res.code) {
|
|
13
|
+
resolve(res.data.results.map((item)=>({
|
|
14
|
+
id: item.username,
|
|
15
|
+
name: `${item.username}(${item.display_name})`
|
|
16
|
+
})));
|
|
17
|
+
} else {
|
|
18
|
+
reject(res.message);
|
|
19
|
+
Message({
|
|
20
|
+
theme: 'error',
|
|
21
|
+
message: res.message
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
return {
|
|
28
|
+
getMemberList
|
|
29
|
+
};
|
|
30
|
+
};
|
|
@@ -10,7 +10,7 @@ export declare const useMetaHttp: (apiPrefix: string, spaceId?: Ref<string>) =>
|
|
|
10
10
|
data: boolean;
|
|
11
11
|
message: string;
|
|
12
12
|
}>;
|
|
13
|
-
getTags: () => Promise<import("@/types/meta").ITag[]>;
|
|
14
|
-
plusTag: (tagNames: string[][]) => Promise<ITagApi>;
|
|
15
|
-
checkTag: (tagNames: string[][]) => Promise<boolean>;
|
|
13
|
+
getTags: (module: Module) => Promise<import("@/types/meta").ITag[]>;
|
|
14
|
+
plusTag: (tagNames: string[][], module: Module) => Promise<ITagApi>;
|
|
15
|
+
checkTag: (tagNames: string[][], module: Module) => Promise<boolean>;
|
|
16
16
|
};
|
|
@@ -51,14 +51,17 @@ export const useMetaHttp = (apiPrefix, spaceId)=>{
|
|
|
51
51
|
}
|
|
52
52
|
});
|
|
53
53
|
// 获取tag列表
|
|
54
|
-
const getTags = ()=>fetch.get(`${apiPrefix}/${metaPerfix}/tag/`,
|
|
54
|
+
const getTags = (module)=>fetch.get(`${apiPrefix}/${metaPerfix}/tag/`, {
|
|
55
|
+
scope_name: module
|
|
56
|
+
}, {
|
|
55
57
|
headers: {
|
|
56
58
|
'x-space-id': spaceId === null || spaceId === void 0 ? void 0 : spaceId.value
|
|
57
59
|
}
|
|
58
60
|
}).then((result)=>result.map(transferTagApi2Tag));
|
|
59
61
|
// 新增 tag
|
|
60
|
-
const plusTag = (tagNames)=>fetch.post(`${apiPrefix}/${metaPerfix}/tag/`, {
|
|
61
|
-
tag_names: tagNames
|
|
62
|
+
const plusTag = (tagNames, module)=>fetch.post(`${apiPrefix}/${metaPerfix}/tag/`, {
|
|
63
|
+
tag_names: tagNames,
|
|
64
|
+
scope_name: module
|
|
62
65
|
}, {
|
|
63
66
|
globalError: false,
|
|
64
67
|
headers: {
|
|
@@ -66,8 +69,9 @@ export const useMetaHttp = (apiPrefix, spaceId)=>{
|
|
|
66
69
|
}
|
|
67
70
|
});
|
|
68
71
|
// check tag
|
|
69
|
-
const checkTag = (tagNames)=>fetch.post(`${apiPrefix}/${metaPerfix}/tag/check/`, {
|
|
70
|
-
tag_names: tagNames
|
|
72
|
+
const checkTag = (tagNames, module)=>fetch.post(`${apiPrefix}/${metaPerfix}/tag/check/`, {
|
|
73
|
+
tag_names: tagNames,
|
|
74
|
+
scope_name: module
|
|
71
75
|
}, {
|
|
72
76
|
globalError: false,
|
|
73
77
|
headers: {
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { IPagination, IPaginationParam, ISortParam, ITTableSort } from '@/types/common';
|
|
2
|
+
import { OrderMethod } from '@/types/enum';
|
|
3
|
+
interface IPaginatedApiResult<T> {
|
|
4
|
+
results?: T;
|
|
5
|
+
count?: number;
|
|
6
|
+
}
|
|
7
|
+
export declare const useTTable: <T>() => {
|
|
8
|
+
isLoading: import("vue").Ref<boolean, boolean>;
|
|
9
|
+
initHook: (callBackFn: (search: IPaginationParam & ISortParam) => Promise<IPaginatedApiResult<T> | T>, isShowPagination: boolean) => void;
|
|
10
|
+
sort: import("vue").Ref<{
|
|
11
|
+
descending?: OrderMethod;
|
|
12
|
+
sortKey?: string;
|
|
13
|
+
}, ITTableSort | {
|
|
14
|
+
descending?: OrderMethod;
|
|
15
|
+
sortKey?: string;
|
|
16
|
+
}>;
|
|
17
|
+
handleSortChange: (config: {
|
|
18
|
+
descending: boolean;
|
|
19
|
+
}, { col }: {
|
|
20
|
+
col: {
|
|
21
|
+
sortKey: string;
|
|
22
|
+
};
|
|
23
|
+
}) => Promise<void>;
|
|
24
|
+
triggerApi: () => Promise<void>;
|
|
25
|
+
pagination: import("vue").Ref<{
|
|
26
|
+
current: number;
|
|
27
|
+
limit: number;
|
|
28
|
+
count: number;
|
|
29
|
+
}, IPagination | {
|
|
30
|
+
current: number;
|
|
31
|
+
limit: number;
|
|
32
|
+
count: number;
|
|
33
|
+
}>;
|
|
34
|
+
resetPagination: () => void;
|
|
35
|
+
tableData: [[] | T] extends [import("vue").Ref<any, any>] ? import("@vue/shared").IfAny<import("vue").Ref<any, any> & ([] | T), import("vue").Ref<import("vue").Ref<any, any> & ([] | T), import("vue").Ref<any, any> & ([] | T)>, import("vue").Ref<any, any> & ([] | T)> : import("vue").Ref<[] | import("vue").UnwrapRef<T>, [] | T | import("vue").UnwrapRef<T>>;
|
|
36
|
+
handlePageChange: (current: number) => void;
|
|
37
|
+
handlePageSizeChange: (pageSize: number) => void;
|
|
38
|
+
};
|
|
39
|
+
export {};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { ref } from 'vue';
|
|
2
|
+
import { OrderMethod } from '../types/enum.ts.js';
|
|
3
|
+
export const useTTable = ()=>{
|
|
4
|
+
const isLoading = ref(false);
|
|
5
|
+
const isPagination = ref(false);
|
|
6
|
+
let callBack;
|
|
7
|
+
const sort = ref({});
|
|
8
|
+
const tableData = ref([]);
|
|
9
|
+
const pagination = ref({
|
|
10
|
+
current: 1,
|
|
11
|
+
limit: 20,
|
|
12
|
+
count: 0
|
|
13
|
+
});
|
|
14
|
+
// 更新数据
|
|
15
|
+
const triggerApi = ()=>{
|
|
16
|
+
isLoading.value = true;
|
|
17
|
+
return callBack({
|
|
18
|
+
page: pagination.value.current,
|
|
19
|
+
pageSize: pagination.value.limit,
|
|
20
|
+
orderBy: sort.value.sortKey,
|
|
21
|
+
orderMethod: sort.value.descending
|
|
22
|
+
}).then((apiResult)=>{
|
|
23
|
+
if (isPagination.value) {
|
|
24
|
+
tableData.value = apiResult.results;
|
|
25
|
+
pagination.value.count = apiResult.count;
|
|
26
|
+
} else {
|
|
27
|
+
tableData.value = apiResult;
|
|
28
|
+
}
|
|
29
|
+
}).finally(()=>{
|
|
30
|
+
isLoading.value = false;
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
const initHook = (callBackFn, isShowPagination)=>{
|
|
34
|
+
callBack = callBackFn;
|
|
35
|
+
isPagination.value = isShowPagination;
|
|
36
|
+
};
|
|
37
|
+
// sortKey 为必传
|
|
38
|
+
const handleSortChange = (config, { col })=>{
|
|
39
|
+
if (!config) {
|
|
40
|
+
sort.value = {};
|
|
41
|
+
return triggerApi();
|
|
42
|
+
}
|
|
43
|
+
const { descending } = config;
|
|
44
|
+
sort.value = {
|
|
45
|
+
sortKey: col.sortKey,
|
|
46
|
+
descending: descending ? OrderMethod.Desc : OrderMethod.Asc
|
|
47
|
+
};
|
|
48
|
+
triggerApi();
|
|
49
|
+
};
|
|
50
|
+
// 分页器 当前页变化处理
|
|
51
|
+
const handlePageChange = (current)=>{
|
|
52
|
+
if (pagination.value.current === current) return;
|
|
53
|
+
pagination.value.current = current;
|
|
54
|
+
triggerApi();
|
|
55
|
+
};
|
|
56
|
+
// 分页器 页码大小变化处理
|
|
57
|
+
const handlePageSizeChange = (pageSize)=>{
|
|
58
|
+
if (pagination.value.limit === pageSize) return;
|
|
59
|
+
pagination.value.limit = pageSize;
|
|
60
|
+
pagination.value.current = 1;
|
|
61
|
+
triggerApi();
|
|
62
|
+
};
|
|
63
|
+
const resetPagination = ()=>{
|
|
64
|
+
pagination.value = {
|
|
65
|
+
current: 1,
|
|
66
|
+
limit: 20,
|
|
67
|
+
count: 0
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
return {
|
|
71
|
+
isLoading,
|
|
72
|
+
initHook,
|
|
73
|
+
sort,
|
|
74
|
+
handleSortChange,
|
|
75
|
+
triggerApi,
|
|
76
|
+
pagination,
|
|
77
|
+
resetPagination,
|
|
78
|
+
tableData,
|
|
79
|
+
handlePageChange,
|
|
80
|
+
handlePageSizeChange
|
|
81
|
+
};
|
|
82
|
+
};
|
package/dist/hooks.d.ts
CHANGED
|
@@ -7,3 +7,6 @@ export * from './hooks/use-table';
|
|
|
7
7
|
export * from './hooks/use-permission';
|
|
8
8
|
export * from './hooks/use-think';
|
|
9
9
|
export * from './hooks/use-reference-doc';
|
|
10
|
+
export * from './hooks/use-member-http';
|
|
11
|
+
export * from './hooks/use-t-table';
|
|
12
|
+
export * from './hooks/use-ellipsis-tooltip';
|
package/dist/hooks.ts.js
CHANGED
|
@@ -7,3 +7,6 @@ export * from './hooks/use-table.ts.js';
|
|
|
7
7
|
export * from './hooks/use-permission.ts.js';
|
|
8
8
|
export * from './hooks/use-think.ts.js';
|
|
9
9
|
export * from './hooks/use-reference-doc.ts.js';
|
|
10
|
+
export * from './hooks/use-member-http.ts.js';
|
|
11
|
+
export * from './hooks/use-t-table.ts.js';
|
|
12
|
+
export * from './hooks/use-ellipsis-tooltip.ts.js';
|
|
@@ -82,7 +82,7 @@ function _object_spread_props(target, source) {
|
|
|
82
82
|
import errorInterceptor from './error-interceptor.ts.js';
|
|
83
83
|
import RequestError from './request-error.ts.js';
|
|
84
84
|
import successInterceptor from './success-interceptor.ts.js';
|
|
85
|
-
import { deepMerge, getCookies } from '../../common/util.ts.js';
|
|
85
|
+
import { deepMerge, getCookies, getTraceparent } from '../../common/util.ts.js';
|
|
86
86
|
// Content-Type
|
|
87
87
|
const contentTypeMap = {
|
|
88
88
|
json: 'application/json',
|
|
@@ -108,7 +108,8 @@ const allMethods = [
|
|
|
108
108
|
const getFetchConfig = (method, payload, config)=>{
|
|
109
109
|
const headers = {
|
|
110
110
|
'X-Requested-With': 'fetch',
|
|
111
|
-
'X-CSRFToken': getCookies('aidev_csrftoken') || ''
|
|
111
|
+
'X-CSRFToken': getCookies('aidev_csrftoken') || '',
|
|
112
|
+
traceparent: getTraceparent()
|
|
112
113
|
};
|
|
113
114
|
if (config.requestType !== 'formData') {
|
|
114
115
|
headers['Content-Type'] = contentTypeMap[config.requestType] || 'application/json';
|