@blueking/ai-ui-sdk 0.1.8 → 0.1.9-beta.2

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 (55) hide show
  1. package/dist/components/render-aside/index.vue.css +9 -9
  2. package/dist/components/render-aside/index.vue.js +1 -1
  3. package/dist/components/render-auto-height-textarea/index.vue.css +11 -11
  4. package/dist/components/render-auto-height-textarea/index.vue.js +1 -1
  5. package/dist/components/render-choose-tag/index.script.vue.js.js +14 -204
  6. package/dist/components/render-choose-tag/index.vue.css +8 -8
  7. package/dist/components/render-choose-tag/index.vue.d.ts +3 -3
  8. package/dist/components/render-choose-tag/index.vue.js +1 -1
  9. package/dist/components/render-collapse/index.vue.css +2 -2
  10. package/dist/components/render-collapse/index.vue.js +1 -1
  11. package/dist/components/render-dataset/components/edit-dataset-data/index.vue.css +3 -3
  12. package/dist/components/render-dataset/components/edit-dataset-data/index.vue.js +1 -1
  13. package/dist/components/render-dataset/components/operation-record/index.vue.css +4 -4
  14. package/dist/components/render-dataset/components/operation-record/index.vue.js +1 -1
  15. package/dist/components/render-dataset/components/operation-record/table/index.vue.css +1 -1
  16. package/dist/components/render-dataset/components/operation-record/table/index.vue.js +1 -1
  17. package/dist/components/render-dataset/components/operation-record/view-op-result/index.vue.css +2 -2
  18. package/dist/components/render-dataset/components/operation-record/view-op-result/index.vue.js +1 -1
  19. package/dist/components/render-dataset/components/plus-dataset/index.vue.css +2 -2
  20. package/dist/components/render-dataset/components/plus-dataset/index.vue.js +1 -1
  21. package/dist/components/render-dataset/components/plus-dataset-data/form/footer.vue.css +1 -1
  22. package/dist/components/render-dataset/components/plus-dataset-data/form/footer.vue.js +1 -1
  23. package/dist/components/render-dataset/components/plus-dataset-data/form/index.vue.css +2 -2
  24. package/dist/components/render-dataset/components/plus-dataset-data/form/index.vue.js +1 -1
  25. package/dist/components/render-dataset/index.vue.css +1 -1
  26. package/dist/components/render-dataset/index.vue.js +1 -1
  27. package/dist/components/render-dataset-detail-origin-data/components/table/index.vue.css +1 -1
  28. package/dist/components/render-dataset-detail-origin-data/components/table/index.vue.js +1 -1
  29. package/dist/components/render-dataset-detail-origin-data/index.vue.css +3 -3
  30. package/dist/components/render-dataset-detail-origin-data/index.vue.js +1 -1
  31. package/dist/components/render-dataset-list/components/main.vue.css +3 -3
  32. package/dist/components/render-dataset-list/components/main.vue.js +1 -1
  33. package/dist/components/render-expand-collapse/index.vue.css +3 -3
  34. package/dist/components/render-expand-collapse/index.vue.js +1 -1
  35. package/dist/components/render-file-card/index.vue.css +11 -11
  36. package/dist/components/render-file-card/index.vue.js +1 -1
  37. package/dist/components/render-file-type-icon/index.vue.css +5 -5
  38. package/dist/components/render-file-type-icon/index.vue.js +1 -1
  39. package/dist/components/render-header/index.script.vue.js.js +17 -33
  40. package/dist/components/render-header/index.vue.css +5 -5
  41. package/dist/components/render-header/index.vue.d.ts +15 -10
  42. package/dist/components/render-header/index.vue.js +1 -1
  43. package/dist/components/render-router-tab/index.vue.css +3 -3
  44. package/dist/components/render-router-tab/index.vue.js +1 -1
  45. package/dist/hooks/use-chat.d.ts +2 -2
  46. package/dist/hooks/use-meta-http.d.ts +3 -3
  47. package/dist/hooks/use-meta-http.ts.js +6 -5
  48. package/dist/http/helper/meta.d.ts +2 -0
  49. package/dist/http/helper/meta.ts.js +7 -0
  50. package/dist/types/dataset.d.ts +2 -2
  51. package/dist/types/knowledge.d.ts +2 -2
  52. package/dist/types/meta.d.ts +5 -0
  53. package/package.json +1 -1
  54. package/dist/hooks/use-form-rule.ts.js +0 -101
  55. package/dist/types/tag.d.ts +0 -7
@@ -1,15 +1,15 @@
1
1
 
2
- .origin-data-content[data-v-sx6muhru] {
2
+ .origin-data-content[data-v-ov8o9k4z] {
3
3
  padding: 24px;
4
4
  height: calc(100% - 52px - 44px);
5
5
  }
6
- .origin-data-panel[data-v-sx6muhru] {
6
+ .origin-data-panel[data-v-ov8o9k4z] {
7
7
  height: 100%;
8
8
  padding: 20px;
9
9
  background: #ffffff;
10
10
  box-shadow: 0 2px 4px 0 #1919290d;
11
11
  border-radius: 2px;
12
12
  }
13
- .origin-data-panel .toolbar-search[data-v-sx6muhru] {
13
+ .origin-data-panel .toolbar-search[data-v-ov8o9k4z] {
14
14
  width: 6.17rem;
15
15
  }
@@ -1,5 +1,5 @@
1
1
  import script from './index.script.vue.js.js';
2
- script.__scopeId = "data-v-sx6muhru";
2
+ script.__scopeId = "data-v-ov8o9k4z";
3
3
  script.__file = "./src/components/render-dataset-detail-origin-data/index.vue";
4
4
  import './index.vue.css';
5
5
  export default script;
@@ -1,15 +1,15 @@
1
1
 
2
- .main-content[data-v-fuole78y] {
2
+ .main-content[data-v-ttr8igjf] {
3
3
  padding: 20px 24px;
4
4
  height: calc(100% - 52px);
5
5
  }
6
- .main-panel[data-v-fuole78y] {
6
+ .main-panel[data-v-ttr8igjf] {
7
7
  height: 100%;
8
8
  padding: 20px 24px 0;
9
9
  background: #ffffff;
10
10
  box-shadow: 0 2px 4px 0 #1919290d;
11
11
  border-radius: 2px;
12
12
  }
13
- .main-search[data-v-fuole78y] {
13
+ .main-search[data-v-ttr8igjf] {
14
14
  width: 6.17rem;
15
15
  }
@@ -1,5 +1,5 @@
1
1
  import script from './main.script.vue.js.js';
2
- script.__scopeId = "data-v-fuole78y";
2
+ script.__scopeId = "data-v-ttr8igjf";
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
- .expend-collapse-home[data-v-kyqezwtx] {
2
+ .expend-collapse-home[data-v-3sn8o0cg] {
3
3
  width: 16px;
4
4
  height: 64px;
5
5
  background: #DCDEE5;
@@ -15,9 +15,9 @@
15
15
  cursor: pointer;
16
16
  z-index: 1550;
17
17
  }
18
- .expend-collapse-home[data-v-kyqezwtx]:hover {
18
+ .expend-collapse-home[data-v-3sn8o0cg]:hover {
19
19
  background: #979BA5;
20
20
  }
21
- .expend-collapse-home.is-close[data-v-kyqezwtx] {
21
+ .expend-collapse-home.is-close[data-v-3sn8o0cg] {
22
22
  left: 0;
23
23
  }
@@ -1,5 +1,5 @@
1
1
  import script from './index.script.vue.js.js';
2
- script.__scopeId = "data-v-kyqezwtx";
2
+ script.__scopeId = "data-v-3sn8o0cg";
3
3
  script.__file = "./src/components/render-expand-collapse/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-kp1h086d] {
2
+ .upload-file-home[data-v-h3mpwpy3] {
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-kp1h086d]:hover {
9
+ .upload-file-home[data-v-h3mpwpy3]:hover {
10
10
  border: 1px solid #3A84FF;
11
11
  }
12
- .upload-file-home:hover .file-icons[data-v-kp1h086d] {
12
+ .upload-file-home:hover .file-icons[data-v-h3mpwpy3] {
13
13
  display: flex;
14
14
  }
15
- .upload-file-home .file-icon[data-v-kp1h086d] {
15
+ .upload-file-home .file-icon[data-v-h3mpwpy3] {
16
16
  font-size: 32px;
17
17
  }
18
- .upload-file-home .file-content[data-v-kp1h086d] {
18
+ .upload-file-home .file-content[data-v-h3mpwpy3] {
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-kp1h086d] {
26
+ .upload-file-home .file-content .file-name[data-v-h3mpwpy3] {
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-kp1h086d] {
31
+ .upload-file-home .file-content .file-size[data-v-h3mpwpy3] {
32
32
  font-size: 12px;
33
33
  color: #979BA5;
34
34
  line-height: 20px;
35
35
  }
36
- .upload-file-home .file-icons[data-v-kp1h086d] {
36
+ .upload-file-home .file-icons[data-v-h3mpwpy3] {
37
37
  display: none;
38
38
  color: #979BA5;
39
39
  }
40
- .upload-file-home .file-icons .bkaidev-icon[data-v-kp1h086d] {
40
+ .upload-file-home .file-icons .bkaidev-icon[data-v-h3mpwpy3] {
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-kp1h086d]:hover {
45
+ .upload-file-home .file-icons .bkaidev-icon[data-v-h3mpwpy3]:hover {
46
46
  color: #3A84FF;
47
47
  }
48
- .upload-file-home .file-icons .bkaidev-delete[data-v-kp1h086d] {
48
+ .upload-file-home .file-icons .bkaidev-delete[data-v-h3mpwpy3] {
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-kp1h086d";
2
+ script.__scopeId = "data-v-h3mpwpy3";
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-xogyp4b7] {
2
+ .ai-ui-sdk-icon.ai-ui-sdk-pdf[data-v-ts9on280] {
3
3
  color: #EA3636;
4
4
  }
5
- .ai-ui-sdk-icon.ai-ui-sdk-doc-2[data-v-xogyp4b7], .ai-ui-sdk-icon.ai-ui-sdk-ppt-2[data-v-xogyp4b7], .ai-ui-sdk-icon.ai-ui-sdk-markdown[data-v-xogyp4b7] {
5
+ .ai-ui-sdk-icon.ai-ui-sdk-doc-2[data-v-ts9on280], .ai-ui-sdk-icon.ai-ui-sdk-ppt-2[data-v-ts9on280], .ai-ui-sdk-icon.ai-ui-sdk-markdown[data-v-ts9on280] {
6
6
  color: #3A84FF;
7
7
  }
8
- .ai-ui-sdk-icon.ai-ui-sdk-folder-fill[data-v-xogyp4b7] {
8
+ .ai-ui-sdk-icon.ai-ui-sdk-folder-fill[data-v-ts9on280] {
9
9
  color: #C4C6CC;
10
10
  }
11
- .ai-ui-sdk-icon.ai-ui-sdk-excel[data-v-xogyp4b7] {
11
+ .ai-ui-sdk-icon.ai-ui-sdk-excel[data-v-ts9on280] {
12
12
  color: #2DCB56;
13
13
  }
14
- .ai-ui-sdk-icon.ai-ui-sdk-wangye[data-v-xogyp4b7] {
14
+ .ai-ui-sdk-icon.ai-ui-sdk-wangye[data-v-ts9on280] {
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-xogyp4b7";
2
+ script.__scopeId = "data-v-ts9on280";
3
3
  script.__file = "./src/components/render-file-type-icon/index.vue";
4
4
  import './index.vue.css';
5
5
  export default script;
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as _defineComponent } from 'vue';
2
- import { renderSlot as _renderSlot, toDisplayString as _toDisplayString, createElementVNode as _createElementVNode, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, resolveComponent as _resolveComponent, createBlock as _createBlock, withCtx as _withCtx, createCommentVNode as _createCommentVNode } from "vue";
2
+ import { renderSlot as _renderSlot, toDisplayString as _toDisplayString, createElementVNode as _createElementVNode, resolveComponent as _resolveComponent, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, createElementBlock as _createElementBlock } from "vue";
3
3
  const _hoisted_1 = {
4
4
  class: "header-home"
5
5
  };
@@ -13,9 +13,12 @@ const _hoisted_3 = {
13
13
  export default /*@__PURE__*/ _defineComponent({
14
14
  props: {
15
15
  title: String,
16
- tags: Array,
17
- tagNames: Array,
16
+ tagName: String,
18
17
  search: String,
18
+ showTag: {
19
+ type: Boolean,
20
+ default: false
21
+ },
19
22
  showSearch: {
20
23
  type: Boolean,
21
24
  default: true
@@ -26,21 +29,18 @@ export default /*@__PURE__*/ _defineComponent({
26
29
  }
27
30
  },
28
31
  emits: [
29
- 'update:tagNames',
32
+ 'update:tagName',
30
33
  'update:search'
31
34
  ],
32
35
  setup (__props, { emit: __emit }) {
33
36
  const emit = __emit;
34
37
  const handleTagChange = (val)=>{
35
- emit('update:tagNames', val);
38
+ emit('update:tagName', val);
36
39
  };
37
40
  const handleSearchChange = (val)=>{
38
41
  emit('update:search', val);
39
42
  };
40
43
  return (_ctx, _cache)=>{
41
- var __props_tags;
42
- const _component_bk_option = _resolveComponent("bk-option");
43
- const _component_bk_select = _resolveComponent("bk-select");
44
44
  const _component_bk_input = _resolveComponent("bk-input");
45
45
  return _openBlock(), _createElementBlock("section", _hoisted_1, [
46
46
  _renderSlot(_ctx.$slots, "title", {}, ()=>[
@@ -48,32 +48,16 @@ export default /*@__PURE__*/ _defineComponent({
48
48
  ], true),
49
49
  !__props.isCodeReviewHistory ? (_openBlock(), _createElementBlock("section", _hoisted_3, [
50
50
  _renderSlot(_ctx.$slots, "search", {}, undefined, true),
51
- ((__props_tags = __props.tags) === null || __props_tags === void 0 ? void 0 : __props_tags.length) ? (_openBlock(), _createBlock(_component_bk_select, {
51
+ __props.showTag ? (_openBlock(), _createBlock(_component_bk_input, {
52
52
  key: 0,
53
- multiple: "",
54
- filterable: "",
55
- "collapse-tags": "",
56
- placeholder: "标签",
57
- "multiple-mode": "tag",
58
- class: "header-select",
59
- "input-search": false,
60
- "model-value": __props.tagNames,
61
- onChange: handleTagChange
62
- }, {
63
- default: _withCtx(()=>[
64
- (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(__props.tags, (tag, index)=>{
65
- return _openBlock(), _createBlock(_component_bk_option, {
66
- id: tag.name,
67
- name: tag.name,
68
- key: index
69
- }, null, 8 /* PROPS */ , [
70
- "id",
71
- "name"
72
- ]);
73
- }), 128 /* KEYED_FRAGMENT */ ))
74
- ]),
75
- _: 1 /* STABLE */
76
- }, 8 /* PROPS */ , [
53
+ class: "header-input",
54
+ type: "search",
55
+ placeholder: "请输入标签",
56
+ clearable: true,
57
+ "model-value": __props.tagName,
58
+ onChange: handleTagChange,
59
+ onInput: handleTagChange
60
+ }, null, 8 /* PROPS */ , [
77
61
  "model-value"
78
62
  ])) : _createCommentVNode("v-if", true),
79
63
  __props.showSearch ? (_openBlock(), _createBlock(_component_bk_input, {
@@ -1,5 +1,5 @@
1
1
 
2
- .header-home[data-v-8m14qxgh] {
2
+ .header-home[data-v-6796pm8x] {
3
3
  width: 100%;
4
4
  height: 52px;
5
5
  background: #FFFFFF;
@@ -7,14 +7,14 @@
7
7
  position: relative;
8
8
  z-index: 2;
9
9
  }
10
- .header-title[data-v-8m14qxgh] {
10
+ .header-title[data-v-6796pm8x] {
11
11
  position: absolute;
12
12
  left: 24px;
13
13
  top: 14px;
14
14
  font-size: 16px;
15
15
  color: #313238;
16
16
  }
17
- .header-main[data-v-8m14qxgh] {
17
+ .header-main[data-v-6796pm8x] {
18
18
  display: flex;
19
19
  align-items: center;
20
20
  justify-content: flex-end;
@@ -22,13 +22,13 @@
22
22
  height: 100%;
23
23
  margin: 0 auto;
24
24
  }
25
- .header-select[data-v-8m14qxgh] {
25
+ .header-select[data-v-6796pm8x] {
26
26
  width: 300px;
27
27
  margin-right: 8px;
28
28
  z-index: 9;
29
29
  font-size: 12px;
30
30
  }
31
- .header-input[data-v-8m14qxgh] {
31
+ .header-input[data-v-6796pm8x] {
32
32
  width: 300px;
33
33
  font-size: 12px;
34
34
  }
@@ -1,18 +1,19 @@
1
- import { PropType } from 'vue';
2
- import type { ITag } from '@/types/tag';
3
- declare var __VLS_1: {}, __VLS_3: {}, __VLS_26: {};
1
+ declare var __VLS_1: {}, __VLS_3: {}, __VLS_23: {};
4
2
  type __VLS_Slots = {} & {
5
3
  title?: (props: typeof __VLS_1) => any;
6
4
  } & {
7
5
  search?: (props: typeof __VLS_3) => any;
8
6
  } & {
9
- default?: (props: typeof __VLS_26) => any;
7
+ default?: (props: typeof __VLS_23) => any;
10
8
  };
11
9
  declare const __VLS_component: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
12
10
  title: StringConstructor;
13
- tags: PropType<ITag[]>;
14
- tagNames: PropType<string[]>;
11
+ tagName: StringConstructor;
15
12
  search: StringConstructor;
13
+ showTag: {
14
+ type: BooleanConstructor;
15
+ default: boolean;
16
+ };
16
17
  showSearch: {
17
18
  type: BooleanConstructor;
18
19
  default: boolean;
@@ -22,13 +23,16 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
22
23
  default: boolean;
23
24
  };
24
25
  }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
25
- "update:tagNames": (...args: any[]) => void;
26
+ "update:tagName": (...args: any[]) => void;
26
27
  "update:search": (...args: any[]) => void;
27
28
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
28
29
  title: StringConstructor;
29
- tags: PropType<ITag[]>;
30
- tagNames: PropType<string[]>;
30
+ tagName: StringConstructor;
31
31
  search: StringConstructor;
32
+ showTag: {
33
+ type: BooleanConstructor;
34
+ default: boolean;
35
+ };
32
36
  showSearch: {
33
37
  type: BooleanConstructor;
34
38
  default: boolean;
@@ -38,9 +42,10 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
38
42
  default: boolean;
39
43
  };
40
44
  }>> & Readonly<{
41
- "onUpdate:tagNames"?: (...args: any[]) => any;
45
+ "onUpdate:tagName"?: (...args: any[]) => any;
42
46
  "onUpdate:search"?: (...args: any[]) => any;
43
47
  }>, {
48
+ showTag: boolean;
44
49
  showSearch: boolean;
45
50
  isCodeReviewHistory: boolean;
46
51
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -1,5 +1,5 @@
1
1
  import script from './index.script.vue.js.js';
2
- script.__scopeId = "data-v-8m14qxgh";
2
+ script.__scopeId = "data-v-6796pm8x";
3
3
  script.__file = "./src/components/render-header/index.vue";
4
4
  import './index.vue.css';
5
5
  export default script;
@@ -1,12 +1,12 @@
1
1
 
2
- .router-tab[data-v-6yqjpcq2] {
2
+ .router-tab[data-v-s7smqyoe] {
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-6yqjpcq2] {
9
+ .router-tab a[data-v-s7smqyoe] {
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-6yqjpcq2] {
18
+ .router-tab a.router-link-exact-active[data-v-s7smqyoe] {
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-6yqjpcq2";
2
+ script.__scopeId = "data-v-s7smqyoe";
3
3
  script.__file = "./src/components/render-router-tab/index.vue";
4
4
  import './index.vue.css';
5
5
  export default script;
@@ -119,7 +119,7 @@ export declare const useChat: ({ handleStart, handleText, handleReferenceDoc, ha
119
119
  spaceId?: string;
120
120
  url?: string;
121
121
  content?: string;
122
- tagNames?: string[];
122
+ tagNames?: string[][];
123
123
  splitter?: string;
124
124
  handleType?: string[];
125
125
  updateFrequency?: number;
@@ -536,7 +536,7 @@ export declare const useChat: ({ handleStart, handleText, handleReferenceDoc, ha
536
536
  spaceId?: string;
537
537
  url?: string;
538
538
  content?: string;
539
- tagNames?: string[];
539
+ tagNames?: string[][];
540
540
  splitter?: string;
541
541
  handleType?: string[];
542
542
  updateFrequency?: number;
@@ -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<string[]>;
14
- plusTag: (tagName: string) => Promise<ITagApi>;
15
- checkTag: (tagName: string) => Promise<boolean>;
13
+ getTags: () => Promise<import("@/types/meta").ITag[]>;
14
+ plusTag: (tagNames: string[][]) => Promise<ITagApi>;
15
+ checkTag: (tagNames: string[][]) => Promise<boolean>;
16
16
  };
@@ -27,6 +27,7 @@ function _object_spread(target) {
27
27
  return target;
28
28
  }
29
29
  import fetch from '../http/fetch/index.ts.js';
30
+ import { transferTagApi2Tag } from '../http/helper/meta.ts.js';
30
31
  const metaPerfix = 'meta/v1';
31
32
  export const useMetaHttp = (apiPrefix, spaceId)=>{
32
33
  // 名称校验
@@ -54,10 +55,10 @@ export const useMetaHttp = (apiPrefix, spaceId)=>{
54
55
  headers: {
55
56
  'x-space-id': spaceId === null || spaceId === void 0 ? void 0 : spaceId.value
56
57
  }
57
- }).then((result)=>result.map((item)=>item.tag_name));
58
+ }).then((result)=>result.map(transferTagApi2Tag));
58
59
  // 新增 tag
59
- const plusTag = (tagName)=>fetch.post(`${apiPrefix}/${metaPerfix}/tag/`, {
60
- tag_name: tagName
60
+ const plusTag = (tagNames)=>fetch.post(`${apiPrefix}/${metaPerfix}/tag/`, {
61
+ tag_names: tagNames
61
62
  }, {
62
63
  globalError: false,
63
64
  headers: {
@@ -65,8 +66,8 @@ export const useMetaHttp = (apiPrefix, spaceId)=>{
65
66
  }
66
67
  });
67
68
  // check tag
68
- const checkTag = (tagName)=>fetch.get(`${apiPrefix}/${metaPerfix}/tag/check/`, {
69
- tag_name: tagName
69
+ const checkTag = (tagNames)=>fetch.get(`${apiPrefix}/${metaPerfix}/tag/check/`, {
70
+ tag_names: tagNames
70
71
  }, {
71
72
  globalError: false,
72
73
  headers: {
@@ -0,0 +1,2 @@
1
+ import type { ITag, ITagApi } from '@/types/meta';
2
+ export declare const transferTagApi2Tag: (data: ITagApi) => ITag;
@@ -0,0 +1,7 @@
1
+ export const transferTagApi2Tag = (data)=>{
2
+ var _data_children;
3
+ return {
4
+ tagName: data.tag_name,
5
+ children: (_data_children = data.children) === null || _data_children === void 0 ? void 0 : _data_children.map(transferTagApi2Tag)
6
+ };
7
+ };
@@ -8,7 +8,7 @@ export interface IDatasetInfo {
8
8
  }
9
9
  export interface IDatasetFormApi {
10
10
  component_ids: number[];
11
- tag_names: string[];
11
+ tag_names: string[][];
12
12
  company_id: string;
13
13
  dataset_code: string;
14
14
  dataset_name: string;
@@ -17,7 +17,7 @@ export interface IDatasetFormApi {
17
17
  }
18
18
  export interface IDatasetForm {
19
19
  componentIds: number[];
20
- tagNames: string[];
20
+ tagNames: string[][];
21
21
  companyId?: string;
22
22
  datasetName: string;
23
23
  datasetCode: string;
@@ -29,7 +29,7 @@ export interface IKnowledge {
29
29
  spaceId?: string;
30
30
  url?: string;
31
31
  content?: string;
32
- tagNames?: string[];
32
+ tagNames?: string[][];
33
33
  splitter?: string;
34
34
  handleType?: string[];
35
35
  updateFrequency?: number;
@@ -60,7 +60,7 @@ export interface IKnowledgeApi {
60
60
  space_id?: string;
61
61
  url?: string;
62
62
  content?: string;
63
- tag_names?: string[];
63
+ tag_names?: string[][];
64
64
  config?: {
65
65
  handle_type?: string[];
66
66
  splitter?: string;
@@ -1,3 +1,8 @@
1
1
  export interface ITagApi {
2
2
  tag_name: string;
3
+ children?: ITagApi[];
4
+ }
5
+ export interface ITag {
6
+ tagName: string;
7
+ children?: ITag[];
3
8
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blueking/ai-ui-sdk",
3
- "version": "0.1.8",
3
+ "version": "0.1.9-beta.2",
4
4
  "description": "蓝鲸AI UI SDK",
5
5
  "main": "dist/main.js",
6
6
  "types": "dist/main.d.ts",
@@ -1,101 +0,0 @@
1
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
2
- try {
3
- var info = gen[key](arg);
4
- var value = info.value;
5
- } catch (error) {
6
- reject(error);
7
- return;
8
- }
9
- if (info.done) {
10
- resolve(value);
11
- } else {
12
- Promise.resolve(value).then(_next, _throw);
13
- }
14
- }
15
- function _async_to_generator(fn) {
16
- return function() {
17
- var self = this, args = arguments;
18
- return new Promise(function(resolve, reject) {
19
- var gen = fn.apply(self, args);
20
- function _next(value) {
21
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
22
- }
23
- function _throw(err) {
24
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
25
- }
26
- _next(undefined);
27
- });
28
- };
29
- }
30
- import { useMetaHttp } from './use-meta-http.ts.js';
31
- export const useFormRule = (apiPrefix, spaceId)=>{
32
- const { nameValidator, codeValidator } = useMetaHttp(apiPrefix, spaceId);
33
- let nameErrorMessage = '';
34
- let codeErrorMessage = '';
35
- const codeRule = {
36
- validator: (value)=>/^[a-zA-Z0-9-]+$/.test(value),
37
- message: '需要是英文字符、数字、中划线',
38
- trigger: 'change'
39
- };
40
- const getNameRule = (type)=>({
41
- validator: function() {
42
- var _ref = _async_to_generator(function*(value) {
43
- try {
44
- nameErrorMessage = '';
45
- const res = yield nameValidator(value, type)();
46
- return res.data;
47
- } catch (error) {
48
- nameErrorMessage = error.message;
49
- return false;
50
- }
51
- });
52
- return function(value) {
53
- return _ref.apply(this, arguments);
54
- };
55
- }(),
56
- message: ()=>nameErrorMessage,
57
- trigger: 'change'
58
- });
59
- const getCodeRule = (type, getIsEdit, getData)=>({
60
- validator: function() {
61
- var _ref = _async_to_generator(function*(value) {
62
- try {
63
- codeErrorMessage = '';
64
- // 编辑态不校验code
65
- const isEdit = getIsEdit();
66
- if (isEdit) {
67
- return true;
68
- }
69
- // 新建态校验code
70
- const res = yield codeValidator(value, type, getData === null || getData === void 0 ? void 0 : getData())();
71
- return res.data;
72
- } catch (error) {
73
- codeErrorMessage = error.message;
74
- return false;
75
- }
76
- });
77
- return function(value) {
78
- return _ref.apply(this, arguments);
79
- };
80
- }(),
81
- message: ()=>codeErrorMessage,
82
- trigger: 'change'
83
- });
84
- const getLengthRule = (label, num)=>({
85
- validator: (value)=>value.length <= num,
86
- message: `${label}长度不能超过${num}`,
87
- trigger: 'change'
88
- });
89
- const getApiUrlRule = ()=>({
90
- validator: (value)=>/https?:\/\//.test(value),
91
- message: '需要是http://或者https://开头的字符串',
92
- trigger: 'change'
93
- });
94
- return {
95
- codeRule,
96
- getApiUrlRule,
97
- getNameRule,
98
- getCodeRule,
99
- getLengthRule
100
- };
101
- };
@@ -1,7 +0,0 @@
1
- export interface ITagApi {
2
- tag_name: string;
3
- }
4
- export interface ITag {
5
- name: string;
6
- number: number;
7
- }