@blueking/ai-ui-sdk 0.1.19-beta.14 → 0.1.19-beta.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/dist/components/render-auto-height-textarea/index.vue.css +11 -11
  2. package/dist/components/render-auto-height-textarea/index.vue.js +1 -1
  3. package/dist/components/render-auto-refresh/index.vue.css +8 -8
  4. package/dist/components/render-auto-refresh/index.vue.js +1 -1
  5. package/dist/components/render-checkbox/index.vue.css +9 -9
  6. package/dist/components/render-checkbox/index.vue.js +1 -1
  7. package/dist/components/render-choose-tag/index.script.vue.js.js +23 -6
  8. package/dist/components/render-choose-tag/index.vue.css +7 -7
  9. package/dist/components/render-choose-tag/index.vue.js +1 -1
  10. package/dist/components/render-collapse/index.vue.css +2 -2
  11. package/dist/components/render-collapse/index.vue.js +1 -1
  12. package/dist/components/render-dataset/components/dataset-data-tool-icons/index.script.vue.js +1 -1
  13. package/dist/components/render-dataset/components/edit-dataset-data/index.vue.css +3 -3
  14. package/dist/components/render-dataset/components/edit-dataset-data/index.vue.js +1 -1
  15. package/dist/components/render-dataset/components/operation-record/index.vue.css +4 -4
  16. package/dist/components/render-dataset/components/operation-record/index.vue.js +1 -1
  17. package/dist/components/render-dataset/components/operation-record/table/index.vue.css +1 -1
  18. package/dist/components/render-dataset/components/operation-record/table/index.vue.js +1 -1
  19. package/dist/components/render-dataset/components/operation-record/view-op-result/index.vue.css +2 -2
  20. package/dist/components/render-dataset/components/operation-record/view-op-result/index.vue.js +1 -1
  21. package/dist/components/render-dataset/components/plus-dataset/index.vue.css +2 -2
  22. package/dist/components/render-dataset/components/plus-dataset/index.vue.js +1 -1
  23. package/dist/components/render-dataset/components/plus-dataset-data/form/api.vue.css +2 -2
  24. package/dist/components/render-dataset/components/plus-dataset-data/form/api.vue.js +1 -1
  25. package/dist/components/render-dataset/components/plus-dataset-data/form/footer.vue.css +1 -1
  26. package/dist/components/render-dataset/components/plus-dataset-data/form/footer.vue.js +1 -1
  27. package/dist/components/render-dataset/components/plus-dataset-data/form/index.vue.css +2 -2
  28. package/dist/components/render-dataset/components/plus-dataset-data/form/index.vue.js +1 -1
  29. package/dist/components/render-dataset/components/review-dataset-data/index.vue.css +10 -10
  30. package/dist/components/render-dataset/components/review-dataset-data/index.vue.js +1 -1
  31. package/dist/components/render-dataset-detail-origin-data/index.vue.css +3 -3
  32. package/dist/components/render-dataset-detail-origin-data/index.vue.js +1 -1
  33. package/dist/components/render-dataset-list/components/header.script.vue.js.js +1 -0
  34. package/dist/components/render-dataset-list/components/main.vue.css +3 -3
  35. package/dist/components/render-dataset-list/components/main.vue.js +1 -1
  36. package/dist/components/render-dataset-list/index.vue.css +1 -1
  37. package/dist/components/render-dataset-list/index.vue.js +1 -1
  38. package/dist/components/render-file-card/index.vue.css +11 -11
  39. package/dist/components/render-file-card/index.vue.js +1 -1
  40. package/dist/components/render-file-type-icon/index.vue.css +5 -5
  41. package/dist/components/render-file-type-icon/index.vue.js +1 -1
  42. package/dist/components/render-header/index.vue.css +3 -3
  43. package/dist/components/render-header/index.vue.js +1 -1
  44. package/dist/components/render-like/index.vue.css +5 -5
  45. package/dist/components/render-like/index.vue.js +1 -1
  46. package/dist/components/render-router-tab/index.vue.css +3 -3
  47. package/dist/components/render-router-tab/index.vue.js +1 -1
  48. package/dist/components/render-t-table/index.vue.css +16 -16
  49. package/dist/components/render-t-table/index.vue.js +1 -1
  50. package/dist/components/render-tag-tree/index.vue.css +7 -7
  51. package/dist/components/render-tag-tree/index.vue.js +1 -1
  52. package/dist/hooks/use-chat.d.ts +8 -2
  53. package/dist/hooks/use-t-table.ts.js +86 -0
  54. package/dist/hooks.d.ts +1 -0
  55. package/dist/hooks.ts.js +1 -0
  56. package/dist/http/helper/knowledge.ts.js +1 -0
  57. package/dist/http/helper/tool.ts.js +4 -2
  58. package/dist/types/knowledge.d.ts +2 -0
  59. package/dist/types/tool.d.ts +3 -1
  60. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  import script from './main.script.vue.js.js';
2
- script.__scopeId = "data-v-upjlk58e";
2
+ script.__scopeId = "data-v-r60c8j5x";
3
3
  script.__file = "./src/components/render-dataset-list/components/main.vue";
4
4
  import './main.vue.css';
5
5
  export default script;
@@ -1,5 +1,5 @@
1
1
 
2
- .dataset-main[data-v-hcucxmq9] {
2
+ .dataset-main[data-v-kkaxeqxj] {
3
3
  height: calc(100% - 90px);
4
4
  margin-top: 2px;
5
5
  }
@@ -1,5 +1,5 @@
1
1
  import script from './index.script.vue.js.js';
2
- script.__scopeId = "data-v-hcucxmq9";
2
+ script.__scopeId = "data-v-kkaxeqxj";
3
3
  script.__file = "./src/components/render-dataset-list/index.vue";
4
4
  import './index.vue.css';
5
5
  export default script;
@@ -1,21 +1,21 @@
1
1
 
2
- .upload-file-home[data-v-4h55j2b8] {
2
+ .upload-file-home[data-v-7cizynd8] {
3
3
  position: relative;
4
4
  background: #FFFFFF;
5
5
  border: 1px solid #DCDEE5;
6
6
  border-radius: 4px;
7
7
  padding: 12px 12px 10px 12px;
8
8
  }
9
- .upload-file-home[data-v-4h55j2b8]:hover {
9
+ .upload-file-home[data-v-7cizynd8]:hover {
10
10
  border: 1px solid #3A84FF;
11
11
  }
12
- .upload-file-home:hover .file-icons[data-v-4h55j2b8] {
12
+ .upload-file-home:hover .file-icons[data-v-7cizynd8] {
13
13
  display: flex;
14
14
  }
15
- .upload-file-home .file-icon[data-v-4h55j2b8] {
15
+ .upload-file-home .file-icon[data-v-7cizynd8] {
16
16
  font-size: 32px;
17
17
  }
18
- .upload-file-home .file-content[data-v-4h55j2b8] {
18
+ .upload-file-home .file-content[data-v-7cizynd8] {
19
19
  font-size: 12px;
20
20
  flex: 1;
21
21
  align-items: flex-start;
@@ -23,28 +23,28 @@
23
23
  font-weight: normal;
24
24
  width: 0;
25
25
  }
26
- .upload-file-home .file-content .file-name[data-v-4h55j2b8] {
26
+ .upload-file-home .file-content .file-name[data-v-7cizynd8] {
27
27
  width: 100%;
28
28
  font-size: 14px;
29
29
  line-height: 20px;
30
30
  }
31
- .upload-file-home .file-content .file-size[data-v-4h55j2b8] {
31
+ .upload-file-home .file-content .file-size[data-v-7cizynd8] {
32
32
  font-size: 12px;
33
33
  color: #979BA5;
34
34
  line-height: 20px;
35
35
  }
36
- .upload-file-home .file-icons[data-v-4h55j2b8] {
36
+ .upload-file-home .file-icons[data-v-7cizynd8] {
37
37
  display: none;
38
38
  color: #979BA5;
39
39
  }
40
- .upload-file-home .file-icons .bkaidev-icon[data-v-4h55j2b8] {
40
+ .upload-file-home .file-icons .bkaidev-icon[data-v-7cizynd8] {
41
41
  cursor: pointer;
42
42
  margin-right: 15px;
43
43
  font-size: 16px;
44
44
  }
45
- .upload-file-home .file-icons .bkaidev-icon[data-v-4h55j2b8]:hover {
45
+ .upload-file-home .file-icons .bkaidev-icon[data-v-7cizynd8]:hover {
46
46
  color: #3A84FF;
47
47
  }
48
- .upload-file-home .file-icons .bkaidev-delete[data-v-4h55j2b8] {
48
+ .upload-file-home .file-icons .bkaidev-delete[data-v-7cizynd8] {
49
49
  margin: 0;
50
50
  }
@@ -1,5 +1,5 @@
1
1
  import script from './index.script.vue.js.js';
2
- script.__scopeId = "data-v-4h55j2b8";
2
+ script.__scopeId = "data-v-7cizynd8";
3
3
  script.__file = "./src/components/render-file-card/index.vue";
4
4
  import './index.vue.css';
5
5
  export default script;
@@ -1,16 +1,16 @@
1
1
 
2
- .ai-ui-sdk-icon.ai-ui-sdk-pdf[data-v-kaqqvw1m] {
2
+ .ai-ui-sdk-icon.ai-ui-sdk-pdf[data-v-ualph6i2] {
3
3
  color: #EA3636;
4
4
  }
5
- .ai-ui-sdk-icon.ai-ui-sdk-doc-2[data-v-kaqqvw1m], .ai-ui-sdk-icon.ai-ui-sdk-ppt-2[data-v-kaqqvw1m], .ai-ui-sdk-icon.ai-ui-sdk-markdown[data-v-kaqqvw1m] {
5
+ .ai-ui-sdk-icon.ai-ui-sdk-doc-2[data-v-ualph6i2], .ai-ui-sdk-icon.ai-ui-sdk-ppt-2[data-v-ualph6i2], .ai-ui-sdk-icon.ai-ui-sdk-markdown[data-v-ualph6i2] {
6
6
  color: #3A84FF;
7
7
  }
8
- .ai-ui-sdk-icon.ai-ui-sdk-folder-fill[data-v-kaqqvw1m] {
8
+ .ai-ui-sdk-icon.ai-ui-sdk-folder-fill[data-v-ualph6i2] {
9
9
  color: #C4C6CC;
10
10
  }
11
- .ai-ui-sdk-icon.ai-ui-sdk-excel[data-v-kaqqvw1m] {
11
+ .ai-ui-sdk-icon.ai-ui-sdk-excel[data-v-ualph6i2] {
12
12
  color: #2DCB56;
13
13
  }
14
- .ai-ui-sdk-icon.ai-ui-sdk-wangye[data-v-kaqqvw1m] {
14
+ .ai-ui-sdk-icon.ai-ui-sdk-wangye[data-v-ualph6i2] {
15
15
  color: #14A568;
16
16
  }
@@ -1,5 +1,5 @@
1
1
  import script from './index.script.vue.js.js';
2
- script.__scopeId = "data-v-kaqqvw1m";
2
+ script.__scopeId = "data-v-ualph6i2";
3
3
  script.__file = "./src/components/render-file-type-icon/index.vue";
4
4
  import './index.vue.css';
5
5
  export default script;
@@ -1,13 +1,13 @@
1
1
 
2
- .header-home[data-v-4l5d1w88] {
2
+ .header-home[data-v-v6oyawcw] {
3
3
  width: 100%;
4
4
  background: #FFFFFF;
5
5
  box-shadow: 0 3px 4px 0 #0000000a;
6
6
  }
7
- .render-tab[data-v-4l5d1w88] {
7
+ .render-tab[data-v-v6oyawcw] {
8
8
  border-bottom: 2px solid transparent;
9
9
  }
10
- .render-tab.active[data-v-4l5d1w88] {
10
+ .render-tab.active[data-v-v6oyawcw] {
11
11
  color: #3A84FF;
12
12
  border-bottom: 2px solid #3A84FF;
13
13
  }
@@ -1,5 +1,5 @@
1
1
  import script from './index.script.vue.js.js';
2
- script.__scopeId = "data-v-4l5d1w88";
2
+ script.__scopeId = "data-v-v6oyawcw";
3
3
  script.__file = "./src/components/render-header/index.vue";
4
4
  import './index.vue.css';
5
5
  export default script;
@@ -1,20 +1,20 @@
1
1
 
2
- .dislike-icon[data-v-koyqr5ge] {
2
+ .dislike-icon[data-v-v9ybzyz6] {
3
3
  transform: rotateX(180deg);
4
4
  }
5
- .option-items[data-v-koyqr5ge] {
5
+ .option-items[data-v-v9ybzyz6] {
6
6
  padding: 1px 8px;
7
7
  background-color: #F0F1F5;
8
8
  line-height: 22px;
9
9
  border-radius: 2px;
10
10
  }
11
- .option-items[data-v-koyqr5ge]:hover {
11
+ .option-items[data-v-v9ybzyz6]:hover {
12
12
  background-color: #E1ECFF;
13
13
  color: #3A84FF;
14
14
  }
15
- .option-items-selected[data-v-koyqr5ge]{
15
+ .option-items-selected[data-v-v9ybzyz6]{
16
16
  background-color: #E1ECFF;
17
17
  }
18
- [data-v-koyqr5ge] .bk-form-item {
18
+ [data-v-v9ybzyz6] .bk-form-item {
19
19
  margin-bottom: 17px;
20
20
  }
@@ -1,5 +1,5 @@
1
1
  import script from './index.script.vue.js.js';
2
- script.__scopeId = "data-v-koyqr5ge";
2
+ script.__scopeId = "data-v-v9ybzyz6";
3
3
  script.__file = "./src/components/render-like/index.vue";
4
4
  import './index.vue.css';
5
5
  export default script;
@@ -1,12 +1,12 @@
1
1
 
2
- .router-tab[data-v-vf2otu5e] {
2
+ .router-tab[data-v-npvckt31] {
3
3
  margin-top: 2px;
4
4
  height: 42px;
5
5
  background: #FFFFFF;
6
6
  box-shadow: 0 2px 4px 0 #1919290d;
7
7
  padding: 0 45px;
8
8
  }
9
- .router-tab a[data-v-vf2otu5e] {
9
+ .router-tab a[data-v-npvckt31] {
10
10
  padding: 0 8px;
11
11
  margin-right: 24px;
12
12
  font-size: 14px;
@@ -15,7 +15,7 @@
15
15
  color: #4D4F56;
16
16
  box-sizing: border-box;
17
17
  }
18
- .router-tab a.router-link-exact-active[data-v-vf2otu5e] {
18
+ .router-tab a.router-link-exact-active[data-v-npvckt31] {
19
19
  color: #3A84FF;
20
20
  border-bottom: 2px solid #3A84FF;
21
21
  }
@@ -1,5 +1,5 @@
1
1
  import script from './index.script.vue.js.js';
2
- script.__scopeId = "data-v-vf2otu5e";
2
+ script.__scopeId = "data-v-npvckt31";
3
3
  script.__file = "./src/components/render-router-tab/index.vue";
4
4
  import './index.vue.css';
5
5
  export default script;
@@ -1,62 +1,62 @@
1
1
 
2
- .t-t-pagination[data-v-yye6bndq] {
2
+ .t-t-pagination[data-v-1ystn6om] {
3
3
  position: sticky;
4
4
  bottom: 0;
5
5
  }
6
- .t-t-pagination[data-v-yye6bndq] .bk-pagination-list.is-last {
6
+ .t-t-pagination[data-v-1ystn6om] .bk-pagination-list.is-last {
7
7
  margin-left: auto;
8
8
  }
9
- .t-t-table[data-v-yye6bndq] {
9
+ .t-t-table[data-v-1ystn6om] {
10
10
  display: inline;
11
11
  height: calc(100% - 64px);
12
12
  }
13
- .t-t-table[data-v-yye6bndq] .t-table__affixed-header-elm-wrap{
13
+ .t-t-table[data-v-1ystn6om] .t-table__affixed-header-elm-wrap{
14
14
  width: 100% !important;
15
15
  top: -2px;
16
16
  }
17
- .t-t-table[data-v-yye6bndq] .t-table__affixed-header-elm-wrap>div {
17
+ .t-t-table[data-v-1ystn6om] .t-table__affixed-header-elm-wrap>div {
18
18
  width: 100% !important;
19
19
  top: -2px;
20
20
  scrollbar-width: none;
21
21
  }
22
- .t-t-table[data-v-yye6bndq] .t-table--layout-fixed{
22
+ .t-t-table[data-v-1ystn6om] .t-table--layout-fixed{
23
23
  width: 100% !important;
24
24
  }
25
- .t-t-table[data-v-yye6bndq] .bk-exception-description{
25
+ .t-t-table[data-v-1ystn6om] .bk-exception-description{
26
26
  margin-bottom: 0;
27
27
  }
28
- .t-t-table[data-v-yye6bndq] .t-table--layout-fixed .t-table__header{
28
+ .t-t-table[data-v-1ystn6om] .t-table--layout-fixed .t-table__header{
29
29
  position: sticky;
30
30
  top: -4px;
31
31
  }
32
- .t-t-table[data-v-yye6bndq] .t-table__content{
32
+ .t-t-table[data-v-1ystn6om] .t-table__content{
33
33
  z-index: 2;
34
34
  max-height: 100%;
35
35
  overflow: auto;
36
36
  }
37
- .t-t-table[data-v-yye6bndq] .t-table__content::-webkit-scrollbar {
37
+ .t-t-table[data-v-1ystn6om] .t-table__content::-webkit-scrollbar {
38
38
  width: 6px;
39
39
  height: 6px;
40
40
  }
41
- .t-t-table[data-v-yye6bndq] .t-table__content::-webkit-scrollbar-thumb {
41
+ .t-t-table[data-v-1ystn6om] .t-table__content::-webkit-scrollbar-thumb {
42
42
  width: 6px;
43
43
  height: 6px;
44
44
  border-radius: 3px;
45
45
  background-color: #dcdee5;
46
46
  }
47
- .t-t-table[data-v-yye6bndq] .t-table__content::-webkit-scrollbar-thumb:hover {
47
+ .t-t-table[data-v-1ystn6om] .t-table__content::-webkit-scrollbar-thumb:hover {
48
48
  background-color: #979ba5;
49
49
  }
50
- .t-t-table[data-v-yye6bndq] .t-table__ellipsis.t-text-ellipsis:has(.checkbox){
50
+ .t-t-table[data-v-1ystn6om] .t-table__ellipsis.t-text-ellipsis:has(.checkbox){
51
51
  line-height: 100%;
52
52
  }
53
- .t-t-table[data-v-yye6bndq] .t-table__cell--sort-trigger.t-table__double-icons{
53
+ .t-t-table[data-v-1ystn6om] .t-table__cell--sort-trigger.t-table__double-icons{
54
54
  gap: 5px;
55
55
  }
56
- .t-t-table[data-v-yye6bndq] .t-table__sort-icon--active>i{
56
+ .t-t-table[data-v-1ystn6om] .t-table__sort-icon--active>i{
57
57
  color: #3a84ff !important;
58
58
  }
59
- .t-t-table[data-v-yye6bndq] .t-table__cell--fixed-left:has(.checkbox){
59
+ .t-t-table[data-v-1ystn6om] .t-table__cell--fixed-left:has(.checkbox){
60
60
  line-height: 100%;
61
61
  }
62
62
 
@@ -1,5 +1,5 @@
1
1
  import script from './index.script.vue.js';
2
- script.__scopeId = "data-v-yye6bndq";
2
+ script.__scopeId = "data-v-1ystn6om";
3
3
  script.__file = "./src/components/render-t-table/index.vue";
4
4
  import './index.vue.css';
5
5
  export default script;
@@ -1,27 +1,27 @@
1
1
 
2
- .tag-tree[data-v-7yx29n7f] {
2
+ .tag-tree[data-v-5m3vqlhd] {
3
3
  font-size: 12px;
4
4
  height: auto;
5
5
  }
6
- .tag-tree .manage-tree-item[data-v-7yx29n7f] {
6
+ .tag-tree .manage-tree-item[data-v-5m3vqlhd] {
7
7
  height: 32px;
8
8
  flex: 1;
9
9
  }
10
- .tag-tree .quick-icon[data-v-7yx29n7f] {
10
+ .tag-tree .quick-icon[data-v-5m3vqlhd] {
11
11
  margin-left: -24px;
12
12
  padding-left: 8px;
13
13
  }
14
- .tag-tree[data-v-7yx29n7f] .tree-item:has(.quick-icon.ai-ui-sdk-wubiaoqian) {
14
+ .tag-tree[data-v-5m3vqlhd] .tree-item:has(.quick-icon.ai-ui-sdk-wubiaoqian) {
15
15
  border-bottom: 1px solid #F0F1F5;
16
16
  }
17
- .tag-tree[data-v-7yx29n7f] .tree-item.active .quick-icon {
17
+ .tag-tree[data-v-5m3vqlhd] .tree-item.active .quick-icon {
18
18
  color: #3A84FF;
19
19
  }
20
- .tag-tree[data-v-7yx29n7f] .tree-item.active .tag-number {
20
+ .tag-tree[data-v-5m3vqlhd] .tree-item.active .tag-number {
21
21
  background: #A3C5FD;
22
22
  color: #fff;
23
23
  }
24
- .tag-number[data-v-7yx29n7f] {
24
+ .tag-number[data-v-5m3vqlhd] {
25
25
  line-height: 16px;
26
26
  padding: 0 4px;
27
27
  background-color: #F0F1F5;
@@ -1,5 +1,5 @@
1
1
  import script from './index.script.vue.js.js';
2
- script.__scopeId = "data-v-7yx29n7f";
2
+ script.__scopeId = "data-v-5m3vqlhd";
3
3
  script.__file = "./src/components/render-tag-tree/index.vue";
4
4
  import './index.vue.css';
5
5
  export default script;
@@ -92,7 +92,8 @@ export declare const useChat: ({ handleStart, handleText, handleReferenceDoc, ha
92
92
  }[];
93
93
  creator: string;
94
94
  createTime: string;
95
- updateTime: string;
95
+ updatedBy?: string;
96
+ updatedAt?: string;
96
97
  toolCode: string;
97
98
  toolName: string;
98
99
  tagNames: string[][];
@@ -329,6 +330,7 @@ export declare const useChat: ({ handleStart, handleText, handleReferenceDoc, ha
329
330
  folderNumber?: number;
330
331
  url?: string;
331
332
  updatedBy?: string;
333
+ updatedAt?: string;
332
334
  indexConfig?: {
333
335
  vector_indexes: {
334
336
  index_name: string;
@@ -425,6 +427,7 @@ export declare const useChat: ({ handleStart, handleText, handleReferenceDoc, ha
425
427
  folderNumber?: number;
426
428
  url?: string;
427
429
  updatedBy?: string;
430
+ updatedAt?: string;
428
431
  indexConfig?: {
429
432
  vector_indexes: {
430
433
  index_name: string;
@@ -582,7 +585,8 @@ export declare const useChat: ({ handleStart, handleText, handleReferenceDoc, ha
582
585
  }[];
583
586
  creator: string;
584
587
  createTime: string;
585
- updateTime: string;
588
+ updatedBy?: string;
589
+ updatedAt?: string;
586
590
  toolCode: string;
587
591
  toolName: string;
588
592
  tagNames: string[][];
@@ -819,6 +823,7 @@ export declare const useChat: ({ handleStart, handleText, handleReferenceDoc, ha
819
823
  folderNumber?: number;
820
824
  url?: string;
821
825
  updatedBy?: string;
826
+ updatedAt?: string;
822
827
  indexConfig?: {
823
828
  vector_indexes: {
824
829
  index_name: string;
@@ -915,6 +920,7 @@ export declare const useChat: ({ handleStart, handleText, handleReferenceDoc, ha
915
920
  folderNumber?: number;
916
921
  url?: string;
917
922
  updatedBy?: string;
923
+ updatedAt?: string;
918
924
  indexConfig?: {
919
925
  vector_indexes: {
920
926
  index_name: string;
@@ -0,0 +1,86 @@
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
+ if (!callBack) {
17
+ console.error('先调用initHook初始化回调函数');
18
+ return;
19
+ }
20
+ isLoading.value = true;
21
+ callBack({
22
+ page: pagination.value.current,
23
+ pageSize: pagination.value.limit,
24
+ orderBy: sort.value.sortKey,
25
+ orderMethod: sort.value.descending
26
+ }).then((apiResult)=>{
27
+ if (isPagination.value) {
28
+ tableData.value = apiResult.results;
29
+ pagination.value.count = apiResult.count;
30
+ } else {
31
+ tableData.value = apiResult;
32
+ }
33
+ }).finally(()=>{
34
+ isLoading.value = false;
35
+ });
36
+ };
37
+ const initHook = (callBackFn, isShowPagination)=>{
38
+ callBack = callBackFn;
39
+ isPagination.value = isShowPagination;
40
+ };
41
+ // sortKey 为必传
42
+ const handleSortChange = (config, { col })=>{
43
+ if (!config) {
44
+ sort.value = {};
45
+ return triggerApi();
46
+ }
47
+ const { descending } = config;
48
+ sort.value = {
49
+ sortKey: col.sortKey,
50
+ descending: descending ? OrderMethod.Desc : OrderMethod.Asc
51
+ };
52
+ triggerApi();
53
+ };
54
+ // 分页器 当前页变化处理
55
+ const handlePageChange = (current)=>{
56
+ if (pagination.value.current === current) return;
57
+ pagination.value.current = current;
58
+ triggerApi();
59
+ };
60
+ // 分页器 页码大小变化处理
61
+ const handlePageSizeChange = (pageSize)=>{
62
+ if (pagination.value.limit === pageSize) return;
63
+ pagination.value.limit = pageSize;
64
+ pagination.value.current = 1;
65
+ triggerApi();
66
+ };
67
+ const resetPagination = ()=>{
68
+ pagination.value = {
69
+ current: 1,
70
+ limit: 20,
71
+ count: 0
72
+ };
73
+ };
74
+ return {
75
+ isLoading,
76
+ initHook,
77
+ sort,
78
+ handleSortChange,
79
+ triggerApi,
80
+ pagination,
81
+ resetPagination,
82
+ tableData,
83
+ handlePageChange,
84
+ handlePageSizeChange
85
+ };
86
+ };
package/dist/hooks.d.ts CHANGED
@@ -8,3 +8,4 @@ export * from './hooks/use-permission';
8
8
  export * from './hooks/use-think';
9
9
  export * from './hooks/use-reference-doc';
10
10
  export * from './hooks/use-member-http';
11
+ export * from './hooks/use-t-table';
package/dist/hooks.ts.js CHANGED
@@ -8,3 +8,4 @@ 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
10
  export * from './hooks/use-member-http.ts.js';
11
+ export * from './hooks/use-t-table.ts.js';
@@ -229,6 +229,7 @@ import { transferResourcePermission } from './permission.ts.js';
229
229
  number: data.knowledge_count,
230
230
  folderNumber: data.folder_num,
231
231
  updatedBy: data.updated_by,
232
+ updatedAt: data.updated_at,
232
233
  anchorPath: data.anchor_path,
233
234
  description: data.description,
234
235
  indexConfig: data.index_config,
@@ -10,7 +10,8 @@ import { transferResourcePermission } from './permission.ts.js';
10
10
  path: data.property.path,
11
11
  creator: data.created_by,
12
12
  createTime: data.created_at,
13
- updateTime: data.updated_at,
13
+ updatedBy: data.updated_by,
14
+ updatedAt: data.updated_at,
14
15
  toolCode: data.tool_code,
15
16
  toolName: data.tool_name,
16
17
  tagNames: data.tag_names,
@@ -36,7 +37,8 @@ import { transferResourcePermission } from './permission.ts.js';
36
37
  */ export const transferTool = (data)=>({
37
38
  created_by: data.creator,
38
39
  created_at: data.createTime,
39
- updated_at: data.updateTime,
40
+ updated_by: data.updatedBy,
41
+ updated_at: data.updatedAt,
40
42
  tool_code: data.toolCode,
41
43
  tool_name: data.toolName,
42
44
  tag_names: data.tagNames,
@@ -111,6 +111,7 @@ export interface IKnowledgebaseApi {
111
111
  knowledge_count?: number;
112
112
  folder_num?: number;
113
113
  updated_by?: string;
114
+ updated_at?: string;
114
115
  index_config?: IKnowledgeIndexConfig;
115
116
  permission?: IResourcePermissionApi;
116
117
  children?: Array<IKnowledgeApi>;
@@ -141,6 +142,7 @@ export interface IKnowledgebase {
141
142
  folderNumber?: number;
142
143
  url?: string;
143
144
  updatedBy?: string;
145
+ updatedAt?: string;
144
146
  indexConfig?: IKnowledgeIndexConfig;
145
147
  permission?: IResourcePermission;
146
148
  children?: Array<IKnowledgebase>;
@@ -26,6 +26,7 @@ export interface IToolApi {
26
26
  space_id?: string;
27
27
  created_by: string;
28
28
  created_at: string;
29
+ updated_by: string;
29
30
  updated_at: string;
30
31
  tool_code: string;
31
32
  tool_name: string;
@@ -52,7 +53,8 @@ export interface ITool {
52
53
  path?: IToolParam[];
53
54
  creator: string;
54
55
  createTime: string;
55
- updateTime: string;
56
+ updatedBy?: string;
57
+ updatedAt?: string;
56
58
  toolCode: string;
57
59
  toolName: string;
58
60
  tagNames: string[][];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blueking/ai-ui-sdk",
3
- "version": "0.1.19-beta.14",
3
+ "version": "0.1.19-beta.16",
4
4
  "description": "蓝鲸AI UI SDK",
5
5
  "main": "dist/main.js",
6
6
  "types": "dist/main.d.ts",