@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.
Files changed (130) hide show
  1. package/dist/common/util.d.ts +24 -0
  2. package/dist/common/util.ts.js +41 -0
  3. package/dist/components/render-auth/auth-dialog.script.vue.js.js +27 -26
  4. package/dist/components/render-auto-height-textarea/index.vue.css +11 -11
  5. package/dist/components/render-auto-height-textarea/index.vue.js +1 -1
  6. package/dist/components/render-auto-refresh/index.vue.css +8 -8
  7. package/dist/components/render-auto-refresh/index.vue.js +1 -1
  8. package/dist/components/render-checkbox/index.vue.css +9 -9
  9. package/dist/components/render-checkbox/index.vue.js +1 -1
  10. package/dist/components/render-choose-tag/index.script.vue.js.js +123 -91
  11. package/dist/components/render-choose-tag/index.vue.css +7 -7
  12. package/dist/components/render-choose-tag/index.vue.d.ts +1 -0
  13. package/dist/components/render-choose-tag/index.vue.js +1 -1
  14. package/dist/components/render-collapse/index.vue.css +2 -2
  15. package/dist/components/render-collapse/index.vue.js +1 -1
  16. package/dist/components/render-dataset/components/dataset-data-status/index.script.vue.js.js +6 -8
  17. package/dist/components/render-dataset/components/dataset-data-tool-icons/index.script.vue.js +1 -1
  18. package/dist/components/render-dataset/components/edit-dataset-data/index.vue.css +3 -3
  19. package/dist/components/render-dataset/components/edit-dataset-data/index.vue.js +1 -1
  20. package/dist/components/render-dataset/components/operation-record/index.script.vue.js.js +36 -1
  21. package/dist/components/render-dataset/components/operation-record/index.vue.css +4 -4
  22. package/dist/components/render-dataset/components/operation-record/index.vue.js +1 -1
  23. package/dist/components/render-dataset/components/operation-record/table/index.script.vue.js +174 -0
  24. package/dist/components/render-dataset/components/operation-record/table/index.vue.css +1 -1
  25. package/dist/components/render-dataset/components/operation-record/table/index.vue.d.ts +5 -1
  26. package/dist/components/render-dataset/components/operation-record/table/index.vue.js +2 -2
  27. package/dist/components/render-dataset/components/operation-record/view-op-result/index.vue.css +2 -2
  28. package/dist/components/render-dataset/components/operation-record/view-op-result/index.vue.js +1 -1
  29. package/dist/components/render-dataset/components/plus-dataset/dataset-form.script.vue.js +34 -42
  30. package/dist/components/render-dataset/components/plus-dataset/index.script.vue.js.js +24 -6
  31. package/dist/components/render-dataset/components/plus-dataset/index.vue.css +2 -2
  32. package/dist/components/render-dataset/components/plus-dataset/index.vue.js +1 -1
  33. package/dist/components/render-dataset/components/plus-dataset-data/form/api.script.vue.js.js +21 -29
  34. package/dist/components/render-dataset/components/plus-dataset-data/form/api.vue.css +2 -2
  35. package/dist/components/render-dataset/components/plus-dataset-data/form/api.vue.js +1 -1
  36. package/dist/components/render-dataset/components/plus-dataset-data/form/dataset.script.vue.js.js +4 -1
  37. package/dist/components/render-dataset/components/plus-dataset-data/form/footer.vue.css +1 -1
  38. package/dist/components/render-dataset/components/plus-dataset-data/form/footer.vue.js +1 -1
  39. package/dist/components/render-dataset/components/plus-dataset-data/form/index.vue.css +2 -2
  40. package/dist/components/render-dataset/components/plus-dataset-data/form/index.vue.js +1 -1
  41. package/dist/components/render-dataset/components/plus-dataset-data/index.script.vue.js.js +6 -1
  42. package/dist/components/render-dataset/components/plus-dataset-data/index.vue.d.ts +1 -0
  43. package/dist/components/render-dataset/components/review-dataset-data/index.vue.css +10 -10
  44. package/dist/components/render-dataset/components/review-dataset-data/index.vue.js +1 -1
  45. package/dist/components/render-dataset/components/search-dataset/index.script.vue.js.js +21 -31
  46. package/dist/components/render-dataset/components/search-dataset/index.vue.d.ts +1 -0
  47. package/dist/components/render-dataset-detail/components/header.script.vue.js.js +1 -1
  48. package/dist/components/render-dataset-detail-origin-data/components/table/index.script.vue.js +245 -388
  49. package/dist/components/render-dataset-detail-origin-data/components/table/index.vue.d.ts +3 -1
  50. package/dist/components/render-dataset-detail-origin-data/index.script.vue.js.js +7 -6
  51. package/dist/components/render-dataset-detail-origin-data/index.vue.css +3 -3
  52. package/dist/components/render-dataset-detail-origin-data/index.vue.js +1 -1
  53. package/dist/components/render-dataset-list/components/header.script.vue.js.js +2 -2
  54. package/dist/components/render-dataset-list/components/main.script.vue.js.js +11 -7
  55. package/dist/components/render-dataset-list/components/main.vue.css +4 -4
  56. package/dist/components/render-dataset-list/components/main.vue.d.ts +1 -0
  57. package/dist/components/render-dataset-list/components/main.vue.js +1 -1
  58. package/dist/components/render-dataset-list/components/table.script.vue.js +408 -0
  59. package/dist/components/render-dataset-list/components/table.vue.d.ts +2 -0
  60. package/dist/components/render-dataset-list/components/table.vue.js +1 -1
  61. package/dist/components/render-dataset-list/index.script.vue.js.js +7 -2
  62. package/dist/components/render-dataset-list/index.vue.css +4 -1
  63. package/dist/components/render-dataset-list/index.vue.d.ts +1 -0
  64. package/dist/components/render-dataset-list/index.vue.js +1 -1
  65. package/dist/components/render-file-card/index.script.vue.js.js +5 -15
  66. package/dist/components/render-file-card/index.vue.css +11 -11
  67. package/dist/components/render-file-card/index.vue.js +1 -1
  68. package/dist/components/render-file-type-icon/index.vue.css +5 -5
  69. package/dist/components/render-file-type-icon/index.vue.js +1 -1
  70. package/dist/components/render-header/index.script.vue.js.js +10 -2
  71. package/dist/components/render-header/index.vue.css +3 -3
  72. package/dist/components/render-header/index.vue.d.ts +1 -1
  73. package/dist/components/render-header/index.vue.js +1 -1
  74. package/dist/components/render-like/index.script.vue.js.js +3 -3
  75. package/dist/components/render-like/index.vue.css +14 -13
  76. package/dist/components/render-like/index.vue.js +1 -1
  77. package/dist/components/render-router-tab/index.vue.css +4 -4
  78. package/dist/components/render-router-tab/index.vue.js +1 -1
  79. package/dist/components/render-search-empty/index.script.vue.js.js +61 -0
  80. package/dist/components/render-search-empty/index.vue.d.ts +20 -0
  81. package/dist/components/render-search-empty/index.vue.js +3 -0
  82. package/dist/components/render-t-table/index.script.vue.js +317 -0
  83. package/dist/components/render-t-table/index.vue.css +196 -0
  84. package/dist/components/render-t-table/index.vue.d.ts +58 -0
  85. package/dist/components/render-t-table/index.vue.js +5 -0
  86. package/dist/components/render-tag-tree/index.script.vue.js.js +101 -24
  87. package/dist/components/render-tag-tree/index.vue.css +7 -7
  88. package/dist/components/render-tag-tree/index.vue.d.ts +2 -1
  89. package/dist/components/render-tag-tree/index.vue.js +1 -1
  90. package/dist/components/render-tree/index.script.vue.js +17 -8
  91. package/dist/components/render-tree/index.vue.d.ts +4 -1
  92. package/dist/components.d.ts +3 -1
  93. package/dist/components.ts.js +3 -1
  94. package/dist/css/fonts/iconcool.eot +0 -0
  95. package/dist/css/fonts/iconcool.svg +3 -0
  96. package/dist/css/fonts/iconcool.ttf +0 -0
  97. package/dist/css/fonts/iconcool.woff +0 -0
  98. package/dist/css/iconcool.js +1 -1
  99. package/dist/css/style.css +3 -0
  100. package/dist/css/tailwind.css +88 -10
  101. package/dist/hooks/use-chat.d.ts +12 -4
  102. package/dist/hooks/use-common-http.d.ts +5 -2
  103. package/dist/hooks/use-common-http.ts.js +7 -5
  104. package/dist/hooks/use-dataset-http.d.ts +2 -2
  105. package/dist/hooks/use-dataset-http.ts.js +6 -4
  106. package/dist/hooks/use-ellipsis-tooltip.d.ts +4 -0
  107. package/dist/hooks/use-ellipsis-tooltip.ts.js +87 -0
  108. package/dist/hooks/use-member-http.d.ts +8 -0
  109. package/dist/hooks/use-member-http.ts.js +30 -0
  110. package/dist/hooks/use-meta-http.d.ts +3 -3
  111. package/dist/hooks/use-meta-http.ts.js +9 -5
  112. package/dist/hooks/use-t-table.d.ts +39 -0
  113. package/dist/hooks/use-t-table.ts.js +82 -0
  114. package/dist/hooks.d.ts +3 -0
  115. package/dist/hooks.ts.js +3 -0
  116. package/dist/http/fetch/index.ts.js +3 -2
  117. package/dist/http/helper/common.ts.js +4 -4
  118. package/dist/http/helper/dataset.ts.js +4 -2
  119. package/dist/http/helper/knowledge.ts.js +9 -3
  120. package/dist/http/helper/tool.ts.js +5 -4
  121. package/dist/images/market.png +0 -0
  122. package/dist/types/common.d.ts +23 -0
  123. package/dist/types/dataset.d.ts +2 -0
  124. package/dist/types/knowledge.d.ts +6 -0
  125. package/dist/types/tool.d.ts +3 -3
  126. package/dist/util.d.ts +1 -0
  127. package/dist/util.ts.js +1 -0
  128. package/package.json +11 -2
  129. package/dist/components/render-dataset/components/operation-record/table/index.script.vue.js.js +0 -226
  130. package/dist/components/render-dataset-list/components/table.script.vue.js.js +0 -592
@@ -102,3 +102,27 @@ export declare const getFullScreenWrap: (target: HTMLElement) => HTMLElement;
102
102
  * @returns 是否有
103
103
  */
104
104
  export declare const isParentHasClass: (ele: HTMLElement, cls: string) => boolean;
105
+ /**
106
+ * 判断值是否为空
107
+ * @param { string | array | object | null | undefined } value 值
108
+ * @returns boolean
109
+ */
110
+ export declare function isEmpty(value: string | Array<any> | Object | null | undefined): boolean;
111
+ /**
112
+ * 生成随机数
113
+ * @param {Number} n
114
+ * @param str,默认26位字母及数字
115
+ */
116
+ export declare const random: (n?: number, str?: string) => string;
117
+ /**
118
+ * 获取 traceparent
119
+ * @returns traceparent
120
+ */
121
+ export declare const getTraceparent: () => string;
122
+ /**
123
+ * 判断搜索文本是否匹配
124
+ * @param text 文本
125
+ * @param search 搜索内容
126
+ * @returns 是否匹配
127
+ */
128
+ export declare function isSearchMatch(text: string, search: string): boolean;
@@ -259,3 +259,44 @@ export const handleCopy = (text)=>{
259
259
  }
260
260
  return result;
261
261
  };
262
+ /**
263
+ * 判断值是否为空
264
+ * @param { string | array | object | null | undefined } value 值
265
+ * @returns boolean
266
+ */ export function isEmpty(value) {
267
+ if (value === '' || value === null || value === undefined) {
268
+ return true;
269
+ }
270
+ if (Array.isArray(value) && value.length < 1) {
271
+ return true;
272
+ }
273
+ if (Object.prototype.toString.call(value) === '[object Object]' && Object.keys(value).length < 1) {
274
+ return true;
275
+ }
276
+ return false;
277
+ }
278
+ /**
279
+ * 生成随机数
280
+ * @param {Number} n
281
+ * @param str,默认26位字母及数字
282
+ */ export const random = (n = 8, str = 'abcdefghijklmnopqrstuvwxyz0123456789')=>{
283
+ let result = '';
284
+ for(let i = 0; i < n; i++){
285
+ result += str[Math.floor(Math.random() * str.length)];
286
+ }
287
+ return result;
288
+ };
289
+ /**
290
+ * 获取 traceparent
291
+ * @returns traceparent
292
+ */ export const getTraceparent = ()=>{
293
+ return `00-${random(32, 'abcdef0123456789')}-${random(16, 'abcdef0123456789')}-01`;
294
+ };
295
+ /**
296
+ * 判断搜索文本是否匹配
297
+ * @param text 文本
298
+ * @param search 搜索内容
299
+ * @returns 是否匹配
300
+ */ export function isSearchMatch(text, search) {
301
+ return !search || text.toLowerCase().includes(search.toLowerCase());
302
+ }
@@ -1,12 +1,30 @@
1
1
  import { defineComponent as _defineComponent } from 'vue';
2
- import { resolveComponent as _resolveComponent, createVNode as _createVNode, withCtx as _withCtx, createTextVNode as _createTextVNode, createElementVNode as _createElementVNode, openBlock as _openBlock, createBlock as _createBlock } from "vue";
2
+ import { resolveComponent as _resolveComponent, createVNode as _createVNode, createTextVNode as _createTextVNode, withCtx as _withCtx, createElementVNode as _createElementVNode, openBlock as _openBlock, createBlock as _createBlock } from "vue";
3
3
  import { ref } from 'vue';
4
+ import RenderTTable from '../render-t-table/index.vue.js';
4
5
  export default /*@__PURE__*/ _defineComponent({
5
6
  setup (__props, { expose: __expose }) {
6
7
  const isShow = ref(false);
7
8
  const perm = ref();
8
- const tableData = ref();
9
+ const tableData = ref([]);
9
10
  let cancelCallback;
11
+ const getColumns = ()=>[
12
+ {
13
+ colKey: 'system_name',
14
+ ellipsis: true,
15
+ title: '系统'
16
+ },
17
+ {
18
+ colKey: 'name',
19
+ ellipsis: true,
20
+ title: '需要申请的权限'
21
+ },
22
+ {
23
+ colKey: 'instance_name',
24
+ ellipsis: true,
25
+ title: '关联的资源实例'
26
+ }
27
+ ];
10
28
  const handleApply = ()=>{
11
29
  var _perm_value;
12
30
  window.open((_perm_value = perm.value) === null || _perm_value === void 0 ? void 0 : _perm_value.apply_url, '_blank');
@@ -33,8 +51,6 @@ export default /*@__PURE__*/ _defineComponent({
33
51
  });
34
52
  return (_ctx, _cache)=>{
35
53
  const _component_bk_exception = _resolveComponent("bk-exception");
36
- const _component_bk_table_column = _resolveComponent("bk-table-column");
37
- const _component_bk_table = _resolveComponent("bk-table");
38
54
  const _component_bk_button = _resolveComponent("bk-button");
39
55
  const _component_bk_dialog = _resolveComponent("bk-dialog");
40
56
  return _openBlock(), _createBlock(_component_bk_dialog, {
@@ -79,29 +95,14 @@ export default /*@__PURE__*/ _defineComponent({
79
95
  ])
80
96
  ]),
81
97
  default: _withCtx(()=>[
82
- _createVNode(_component_bk_table, {
98
+ _createVNode(RenderTTable, {
99
+ "row-key": "system_name",
83
100
  class: "g-mb-20",
84
- "show-overflow-tooltip": "",
85
- "empty-cell-text": "--",
86
- data: tableData.value
87
- }, {
88
- default: _withCtx(()=>[
89
- _createVNode(_component_bk_table_column, {
90
- label: "系统",
91
- field: "system_name"
92
- }),
93
- _createVNode(_component_bk_table_column, {
94
- label: "需要申请的权限",
95
- field: "name"
96
- }),
97
- _createVNode(_component_bk_table_column, {
98
- label: "关联的资源实例",
99
- field: "instance_name"
100
- })
101
- ]),
102
- _: 1 /* STABLE */
103
- }, 8 /* PROPS */ , [
104
- "data"
101
+ columns: getColumns(),
102
+ "table-data": tableData.value
103
+ }, null, 8 /* PROPS */ , [
104
+ "columns",
105
+ "table-data"
105
106
  ])
106
107
  ]),
107
108
  _: 1 /* STABLE */
@@ -1,40 +1,40 @@
1
1
 
2
- .send-container[data-v-ev32lw0m] {
2
+ .send-container[data-v-ce8iv3ez] {
3
3
  position: relative;
4
4
  }
5
- .send-container[data-v-ev32lw0m]:has(textarea:focus) {
5
+ .send-container[data-v-ce8iv3ez]:has(textarea:focus) {
6
6
  z-index: 2;
7
7
  }
8
- .send-container:hover .send-clear[data-v-ev32lw0m] {
8
+ .send-container:hover .send-clear[data-v-ce8iv3ez] {
9
9
  display: inline-flex !important;
10
10
  }
11
- .send-input[data-v-ev32lw0m] {
11
+ .send-input[data-v-ce8iv3ez] {
12
12
  width: 100%;
13
13
  flex-direction: row;
14
14
  height: var(--origin-height);
15
15
  }
16
- .send-input[data-v-ev32lw0m]:has(textarea:focus) {
16
+ .send-input[data-v-ce8iv3ez]:has(textarea:focus) {
17
17
  height: var(--text-height);
18
18
  }
19
- .send-input[data-v-ev32lw0m] textarea {
19
+ .send-input[data-v-ce8iv3ez] textarea {
20
20
  font-size: 12px;
21
21
  line-height: 16px;
22
22
  padding: 7px;
23
23
  resize: none !important;
24
24
  }
25
- .send-input[data-v-ev32lw0m] textarea::-webkit-scrollbar {
25
+ .send-input[data-v-ce8iv3ez] textarea::-webkit-scrollbar {
26
26
  width: 4px;
27
27
  height: 4px;
28
28
  }
29
- .send-input[data-v-ev32lw0m] textarea::-webkit-scrollbar-thumb {
29
+ .send-input[data-v-ce8iv3ez] textarea::-webkit-scrollbar-thumb {
30
30
  height: 5px;
31
31
  border-radius: 3px;
32
32
  background-color: #dcdee5;
33
33
  }
34
- .send-input[data-v-ev32lw0m] textarea::placeholder {
34
+ .send-input[data-v-ce8iv3ez] textarea::placeholder {
35
35
  line-height: 16px;
36
36
  }
37
- .send-clear[data-v-ev32lw0m] {
37
+ .send-clear[data-v-ce8iv3ez] {
38
38
  display: none !important;
39
39
  position: absolute;
40
40
  right: 10px;
@@ -43,6 +43,6 @@
43
43
  font-size: 14px;
44
44
  cursor: pointer;
45
45
  }
46
- .send-clear[data-v-ev32lw0m]:hover {
46
+ .send-clear[data-v-ce8iv3ez]:hover {
47
47
  color: #313238;
48
48
  }
@@ -1,5 +1,5 @@
1
1
  import script from './index.script.vue.js.js';
2
- script.__scopeId = "data-v-ev32lw0m";
2
+ script.__scopeId = "data-v-ce8iv3ez";
3
3
  script.__file = "./src/components/render-auto-height-textarea/index.vue";
4
4
  import './index.vue.css';
5
5
  export default script;
@@ -1,12 +1,12 @@
1
1
 
2
- .auto-refresh[data-v-4rlb4aws] {
2
+ .auto-refresh[data-v-g1aaetzc] {
3
3
  position: relative;
4
4
  cursor: pointer;
5
5
  line-height: 26px;
6
6
  padding: 0 4px;
7
7
  white-space: nowrap;
8
8
  }
9
- .auto-refresh[data-v-4rlb4aws]:after {
9
+ .auto-refresh[data-v-g1aaetzc]:after {
10
10
  content: '';
11
11
  position: absolute;
12
12
  top: 5px;
@@ -16,31 +16,31 @@
16
16
  background-color: #dcdee5;
17
17
  z-index: 1;
18
18
  }
19
- .auto-refresh[data-v-4rlb4aws]:hover {
19
+ .auto-refresh[data-v-g1aaetzc]:hover {
20
20
  color: #3A84FF;
21
21
  background-color: #E1ECFF;
22
22
  }
23
- .refresh[data-v-4rlb4aws] {
23
+ .refresh[data-v-g1aaetzc] {
24
24
  cursor: pointer;
25
25
  line-height: 26px;
26
26
  padding: 0 4px;
27
27
  }
28
- .refresh[data-v-4rlb4aws]:hover {
28
+ .refresh[data-v-g1aaetzc]:hover {
29
29
  color: #3A84FF;
30
30
  background-color: #E1ECFF;
31
31
  }
32
- .textarea-list[data-v-4rlb4aws] {
32
+ .textarea-list[data-v-g1aaetzc] {
33
33
  padding: 4px 0;
34
34
  line-height: 32px;
35
35
  max-height: 300px;
36
36
  position: relative;
37
37
  z-index: 2;
38
38
  }
39
- .textarea-list .textarea-item[data-v-4rlb4aws] {
39
+ .textarea-list .textarea-item[data-v-g1aaetzc] {
40
40
  padding: 0 12px;
41
41
  cursor: pointer;
42
42
  }
43
- .textarea-list .textarea-item[data-v-4rlb4aws]:hover {
43
+ .textarea-list .textarea-item[data-v-g1aaetzc]:hover {
44
44
  background: #E1ECFF;
45
45
  color: #3A84FF;
46
46
  }
@@ -1,5 +1,5 @@
1
1
  import script from './index.script.vue.js.js';
2
- script.__scopeId = "data-v-4rlb4aws";
2
+ script.__scopeId = "data-v-g1aaetzc";
3
3
  script.__file = "./src/components/render-auto-refresh/index.vue";
4
4
  import './index.vue.css';
5
5
  export default script;
@@ -1,5 +1,5 @@
1
1
 
2
- .checkbox[data-v-7x77gorv] {
2
+ .checkbox[data-v-yg5x7jyd] {
3
3
  position: relative;
4
4
  display: inline-block;
5
5
  width: 16px;
@@ -8,27 +8,27 @@
8
8
  border-radius: 2px;
9
9
  cursor: pointer;
10
10
  }
11
- .checkbox.disabled[data-v-7x77gorv] {
11
+ .checkbox.disabled[data-v-yg5x7jyd] {
12
12
  cursor: not-allowed;
13
13
  background: #fafbfd;
14
14
  border-color: #dcdee5;
15
15
  }
16
- .checkbox.disabled.checked[data-v-7x77gorv] {
16
+ .checkbox.disabled.checked[data-v-yg5x7jyd] {
17
17
  background-color: #a3c5fd;
18
18
  border-color: #a3c5fd;
19
19
  }
20
- .checkbox.disabled.indeterminate[data-v-7x77gorv] {
20
+ .checkbox.disabled.indeterminate[data-v-yg5x7jyd] {
21
21
  background-color: #fafbfd;
22
22
  border-color: #dcdee5;
23
23
  }
24
- .checkbox.disabled.indeterminate[data-v-7x77gorv]:after {
24
+ .checkbox.disabled.indeterminate[data-v-yg5x7jyd]:after {
25
25
  background: #dcdee5;
26
26
  }
27
- .checkbox.checked[data-v-7x77gorv] {
27
+ .checkbox.checked[data-v-yg5x7jyd] {
28
28
  background-color: #3a84ff;
29
29
  border: 1px solid #3a84ff;
30
30
  }
31
- .checkbox.checked[data-v-7x77gorv]:after {
31
+ .checkbox.checked[data-v-yg5x7jyd]:after {
32
32
  position: absolute;
33
33
  top: 50%;
34
34
  left: 50%;
@@ -41,11 +41,11 @@
41
41
  transform: translate(-50%, -60%) rotate(45deg);
42
42
  transform-origin: center;
43
43
  }
44
- .checkbox.indeterminate[data-v-7x77gorv] {
44
+ .checkbox.indeterminate[data-v-yg5x7jyd] {
45
45
  background-color: #3a84ff;
46
46
  border: 1px solid #3a84ff;
47
47
  }
48
- .checkbox.indeterminate[data-v-7x77gorv]:after {
48
+ .checkbox.indeterminate[data-v-yg5x7jyd]:after {
49
49
  position: absolute;
50
50
  top: 50%;
51
51
  left: 50%;
@@ -1,5 +1,5 @@
1
1
  import script from './index.script.vue.js.js';
2
- script.__scopeId = "data-v-7x77gorv";
2
+ script.__scopeId = "data-v-yg5x7jyd";
3
3
  script.__file = "./src/components/render-checkbox/index.vue";
4
4
  import './index.vue.css';
5
5
  export default script;
@@ -28,13 +28,13 @@ function _async_to_generator(fn) {
28
28
  };
29
29
  }
30
30
  import { defineComponent as _defineComponent } from 'vue';
31
- import { resolveComponent as _resolveComponent, createVNode as _createVNode, createTextVNode as _createTextVNode, withCtx as _withCtx, unref as _unref, resolveDirective as _resolveDirective, withDirectives as _withDirectives, openBlock as _openBlock, createElementBlock as _createElementBlock, createElementVNode as _createElementVNode, createBlock as _createBlock } from "vue";
31
+ import { resolveComponent as _resolveComponent, createVNode as _createVNode, createTextVNode as _createTextVNode, withCtx as _withCtx, unref as _unref, withModifiers as _withModifiers, resolveDirective as _resolveDirective, withDirectives as _withDirectives, openBlock as _openBlock, createElementBlock as _createElementBlock, createElementVNode as _createElementVNode, createSlots as _createSlots, createBlock as _createBlock } from "vue";
32
32
  const _hoisted_1 = {
33
33
  key: 0,
34
34
  class: "g-flex-row plus-tag-input render-tag"
35
35
  };
36
36
  import { Done, Error } from 'bkui-vue/lib/icon';
37
- import { onBeforeMount, ref, toRef, watch } from 'vue';
37
+ import { nextTick, onBeforeMount, ref, toRef, watch } from 'vue';
38
38
  import { useDatasetHttp } from '../../hooks/use-dataset-http.ts.js';
39
39
  import { useMetaHttp } from '../../hooks/use-meta-http.ts.js';
40
40
  export default /*@__PURE__*/ _defineComponent({
@@ -49,6 +49,9 @@ export default /*@__PURE__*/ _defineComponent({
49
49
  isDataset: {
50
50
  type: Boolean
51
51
  },
52
+ isEnabledCreateTag: {
53
+ type: Boolean
54
+ },
52
55
  popoverOptions: {}
53
56
  },
54
57
  emits: [
@@ -75,7 +78,7 @@ export default /*@__PURE__*/ _defineComponent({
75
78
  const tagNames = handleGetTagNames(value);
76
79
  try {
77
80
  templateTagNameErrorMessage = '';
78
- yield fun(tagNames);
81
+ yield fun(tagNames, props.module);
79
82
  } catch (error) {
80
83
  templateTagNameErrorMessage = error.message;
81
84
  return false;
@@ -93,6 +96,9 @@ export default /*@__PURE__*/ _defineComponent({
93
96
  checkTagRule
94
97
  ]
95
98
  };
99
+ const getModuleValue = ()=>{
100
+ return props.multiple ? props.modelValue : props.modelValue[0] || [];
101
+ };
96
102
  const handleFocus = ()=>{
97
103
  isShow.value = true;
98
104
  };
@@ -100,7 +106,10 @@ export default /*@__PURE__*/ _defineComponent({
100
106
  isShow.value = false;
101
107
  };
102
108
  const handleChange = (val)=>{
103
- emits('update:modelValue', val);
109
+ const moduleValue = props.multiple ? val : [
110
+ val
111
+ ];
112
+ emits('update:modelValue', moduleValue);
104
113
  };
105
114
  const handleTagKeyDown = (value, event)=>{
106
115
  if (event.keyCode === 13 || event.key === 'Enter') {
@@ -124,7 +133,7 @@ export default /*@__PURE__*/ _defineComponent({
124
133
  const tagNames = handleGetTagNames(tempTagName.value);
125
134
  const plusTagFun = props.isDataset ? plusDatasetTag : plusTag;
126
135
  yield tagFormRef.value.validate();
127
- yield plusTagFun(tagNames);
136
+ yield plusTagFun(tagNames, props.module);
128
137
  emits('update:modelValue', [
129
138
  ...props.modelValue,
130
139
  ...tagNames
@@ -143,6 +152,11 @@ export default /*@__PURE__*/ _defineComponent({
143
152
  }();
144
153
  const handleShowPlusTag = ()=>{
145
154
  isShowEdit.value = true;
155
+ isShow.value = true;
156
+ nextTick(()=>{
157
+ var _tagRef_value;
158
+ (_tagRef_value = tagRef.value) === null || _tagRef_value === void 0 ? void 0 : _tagRef_value.focus();
159
+ });
146
160
  };
147
161
  const handleHidePlusTag = ()=>{
148
162
  isShowEdit.value = false;
@@ -150,12 +164,17 @@ export default /*@__PURE__*/ _defineComponent({
150
164
  };
151
165
  const handleGetTags = ()=>{
152
166
  isLoadingTag.value = true;
153
- (props.isDataset ? getDatasetTags(props.module) : getTags()).then((result)=>{
167
+ (props.isDataset ? getDatasetTags(props.module) : getTags(props.module)).then((result)=>{
154
168
  tags.value = result;
155
169
  }).finally(()=>{
156
170
  isLoadingTag.value = false;
157
171
  });
158
172
  };
173
+ const handleCascaderToggle = (isShow)=>{
174
+ if (!isShow && !tempTagName.value.trim()) {
175
+ isShowEdit.value = false;
176
+ }
177
+ };
159
178
  watch(()=>props.spaceId, handleGetTags);
160
179
  onBeforeMount(handleGetTags);
161
180
  return (_ctx, _cache)=>{
@@ -170,94 +189,107 @@ export default /*@__PURE__*/ _defineComponent({
170
189
  "id-key": "tagName",
171
190
  "name-key": "tagName",
172
191
  "ext-cls": "tag-cascader",
192
+ placeholder: "请选择标签",
173
193
  multiple: _ctx.multiple,
174
194
  loading: isLoadingTag.value,
175
195
  list: tags.value,
176
- "model-value": _ctx.modelValue,
177
- "onUpdate:modelValue": handleChange
178
- }, {
179
- extension: _withCtx(()=>[
180
- isShowEdit.value ? (_openBlock(), _createElementBlock("section", _hoisted_1, [
181
- _createVNode(_component_bk_form, {
182
- class: "plus-tag-form",
183
- ref_key: "tagFormRef",
184
- ref: tagFormRef,
185
- model: {
186
- tempTagName: tempTagName.value
187
- },
188
- rules: tagRules
189
- }, {
190
- default: _withCtx(()=>[
191
- _createVNode(_component_bk_form_item, {
192
- class: "plus-tag-form-item",
193
- "label-width": 0,
194
- property: "tempTagName",
195
- "error-display-type": "tooltips",
196
- required: ""
197
- }, {
198
- default: _withCtx(()=>[
199
- _createVNode(_component_bk_popover, {
200
- "is-show": isShow.value,
201
- theme: "light",
202
- trigger: "manual"
203
- }, {
204
- content: _withCtx(()=>_cache[1] || (_cache[1] = [
205
- _createTextVNode(" 如需定义层级标签,以英文“/”分割层级,多个标签以“、”分隔 ")
206
- ])),
207
- default: _withCtx(()=>[
208
- _createVNode(_component_bk_input, {
209
- modelValue: tempTagName.value,
210
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event)=>tempTagName.value = $event),
211
- ref_key: "tagRef",
212
- ref: tagRef,
213
- placeholder: "如需定义层级标签,以英文“/”分割层级,多个标签以“、”分隔",
214
- onKeydown: handleTagKeyDown,
215
- onFocus: handleFocus,
216
- onBlur: handleBlur
217
- }, null, 8 /* PROPS */ , [
218
- "modelValue"
219
- ])
220
- ]),
221
- _: 1 /* STABLE */
222
- }, 8 /* PROPS */ , [
223
- "is-show"
224
- ])
225
- ]),
226
- _: 1 /* STABLE */
227
- })
228
- ]),
229
- _: 1 /* STABLE */
230
- }, 8 /* PROPS */ , [
231
- "model"
232
- ]),
233
- _withDirectives(_createVNode(_unref(Done), {
234
- class: "plus-tag-done",
235
- onClick: handlePlusTag
236
- }, null, 512 /* NEED_PATCH */ ), [
237
- [
238
- _directive_bkloading,
239
- {
240
- loading: isPulsingTag.value
241
- }
242
- ]
243
- ]),
244
- _createVNode(_unref(Error), {
245
- class: "plus-tag-error",
246
- onClick: handleHidePlusTag
247
- })
248
- ])) : (_openBlock(), _createElementBlock("span", {
249
- key: 1,
250
- class: "plus-tag render-tag",
251
- onClick: handleShowPlusTag
252
- }, _cache[2] || (_cache[2] = [
253
- _createElementVNode("i", {
254
- class: "ai-ui-sdk-icon ai-ui-sdk-plus-circle g-text-14 g-mr-6"
255
- }, null, -1 /* HOISTED */ ),
256
- _createTextVNode(" 新建标签 ")
257
- ])))
258
- ]),
259
- _: 1 /* STABLE */
260
- }, 8 /* PROPS */ , [
196
+ "model-value": getModuleValue(),
197
+ "onUpdate:modelValue": handleChange,
198
+ onToggle: handleCascaderToggle
199
+ }, _createSlots({
200
+ _: 2 /* DYNAMIC */
201
+ }, [
202
+ _ctx.isEnabledCreateTag ? {
203
+ name: "extension",
204
+ fn: _withCtx(()=>[
205
+ isShowEdit.value ? (_openBlock(), _createElementBlock("section", _hoisted_1, [
206
+ _createVNode(_component_bk_form, {
207
+ class: "plus-tag-form",
208
+ ref_key: "tagFormRef",
209
+ ref: tagFormRef,
210
+ model: {
211
+ tempTagName: tempTagName.value
212
+ },
213
+ rules: tagRules
214
+ }, {
215
+ default: _withCtx(()=>[
216
+ _createVNode(_component_bk_form_item, {
217
+ class: "plus-tag-form-item",
218
+ "label-width": 0,
219
+ property: "tempTagName",
220
+ "error-display-type": "tooltips",
221
+ required: ""
222
+ }, {
223
+ default: _withCtx(()=>[
224
+ _createVNode(_component_bk_popover, {
225
+ "is-show": isShow.value,
226
+ theme: "light",
227
+ trigger: "manual"
228
+ }, {
229
+ content: _withCtx(()=>_cache[1] || (_cache[1] = [
230
+ _createTextVNode(" 如需定义层级标签,以英文“/”分割层级,多个标签以“、”分隔 ")
231
+ ])),
232
+ default: _withCtx(()=>[
233
+ _createVNode(_component_bk_input, {
234
+ modelValue: tempTagName.value,
235
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event)=>tempTagName.value = $event),
236
+ ref_key: "tagRef",
237
+ ref: tagRef,
238
+ placeholder: "如需定义层级标签,以英文“/”分割层级,多个标签以“、”分隔",
239
+ onKeydown: handleTagKeyDown,
240
+ onFocus: handleFocus,
241
+ onBlur: handleBlur
242
+ }, null, 8 /* PROPS */ , [
243
+ "modelValue"
244
+ ])
245
+ ]),
246
+ _: 1 /* STABLE */
247
+ }, 8 /* PROPS */ , [
248
+ "is-show"
249
+ ])
250
+ ]),
251
+ _: 1 /* STABLE */
252
+ })
253
+ ]),
254
+ _: 1 /* STABLE */
255
+ }, 8 /* PROPS */ , [
256
+ "model"
257
+ ]),
258
+ _withDirectives(_createVNode(_unref(Done), {
259
+ class: "plus-tag-done",
260
+ onClick: _withModifiers(handlePlusTag, [
261
+ "stop"
262
+ ])
263
+ }, null, 512 /* NEED_PATCH */ ), [
264
+ [
265
+ _directive_bkloading,
266
+ {
267
+ loading: isPulsingTag.value
268
+ }
269
+ ]
270
+ ]),
271
+ _createVNode(_unref(Error), {
272
+ class: "plus-tag-error",
273
+ onClick: _withModifiers(handleHidePlusTag, [
274
+ "stop"
275
+ ])
276
+ })
277
+ ])) : (_openBlock(), _createElementBlock("span", {
278
+ key: 1,
279
+ class: "plus-tag render-tag",
280
+ onClick: _withModifiers(handleShowPlusTag, [
281
+ "stop"
282
+ ])
283
+ }, _cache[2] || (_cache[2] = [
284
+ _createElementVNode("i", {
285
+ class: "ai-ui-sdk-icon ai-ui-sdk-plus-circle g-text-14 g-mr-6"
286
+ }, null, -1 /* HOISTED */ ),
287
+ _createTextVNode(" 新建标签 ")
288
+ ])))
289
+ ]),
290
+ key: "0"
291
+ } : undefined
292
+ ]), 1032 /* PROPS, DYNAMIC_SLOTS */ , [
261
293
  "multiple",
262
294
  "loading",
263
295
  "list",