@blueking/ai-ui-sdk 0.1.19-beta.4 → 0.1.19-beta.40

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 (162) 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 +9 -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 +129 -92
  11. package/dist/components/render-choose-tag/index.vue.css +7 -7
  12. package/dist/components/render-choose-tag/index.vue.d.ts +4 -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/batch-delete-dataset-data/index.script.vue.js +86 -0
  17. package/dist/components/render-dataset/components/batch-delete-dataset-data/index.vue.css +16 -0
  18. package/dist/components/render-dataset/components/batch-delete-dataset-data/index.vue.d.ts +16 -0
  19. package/dist/components/render-dataset/components/batch-delete-dataset-data/index.vue.js +5 -0
  20. package/dist/components/render-dataset/components/batch-edit-valid-dataset-data/index.script.vue.js.js +133 -0
  21. package/dist/components/render-dataset/components/batch-edit-valid-dataset-data/index.vue.css +4 -0
  22. package/dist/components/render-dataset/components/batch-edit-valid-dataset-data/index.vue.d.ts +16 -0
  23. package/dist/components/render-dataset/components/batch-edit-valid-dataset-data/index.vue.js +5 -0
  24. package/dist/components/render-dataset/components/dataset-data-status/index.script.vue.js.js +6 -8
  25. package/dist/components/render-dataset/components/dataset-data-tool-icons/index.script.vue.js +1 -1
  26. package/dist/components/render-dataset/components/dataset-data-valid/index.script.vue.js.js +176 -0
  27. package/dist/components/render-dataset/components/dataset-data-valid/index.vue.css +4 -0
  28. package/dist/components/render-dataset/components/dataset-data-valid/index.vue.d.ts +16 -0
  29. package/dist/components/render-dataset/components/dataset-data-valid/index.vue.js +5 -0
  30. package/dist/components/render-dataset/components/edit-dataset-data/index.vue.css +3 -3
  31. package/dist/components/render-dataset/components/edit-dataset-data/index.vue.js +1 -1
  32. package/dist/components/render-dataset/components/operation-record/index.script.vue.js.js +36 -1
  33. package/dist/components/render-dataset/components/operation-record/index.vue.css +4 -4
  34. package/dist/components/render-dataset/components/operation-record/index.vue.js +1 -1
  35. package/dist/components/render-dataset/components/operation-record/table/index.script.vue.js +174 -0
  36. package/dist/components/render-dataset/components/operation-record/table/index.vue.css +1 -1
  37. package/dist/components/render-dataset/components/operation-record/table/index.vue.d.ts +5 -1
  38. package/dist/components/render-dataset/components/operation-record/table/index.vue.js +2 -2
  39. package/dist/components/render-dataset/components/operation-record/view-op-result/index.vue.css +2 -2
  40. package/dist/components/render-dataset/components/operation-record/view-op-result/index.vue.js +1 -1
  41. package/dist/components/render-dataset/components/plus-dataset/dataset-form.script.vue.js +39 -44
  42. package/dist/components/render-dataset/components/plus-dataset/index.script.vue.js.js +26 -8
  43. package/dist/components/render-dataset/components/plus-dataset/index.vue.css +2 -2
  44. package/dist/components/render-dataset/components/plus-dataset/index.vue.d.ts +2 -2
  45. package/dist/components/render-dataset/components/plus-dataset/index.vue.js +1 -1
  46. package/dist/components/render-dataset/components/plus-dataset-data/form/api.script.vue.js.js +21 -29
  47. package/dist/components/render-dataset/components/plus-dataset-data/form/api.vue.css +2 -2
  48. package/dist/components/render-dataset/components/plus-dataset-data/form/api.vue.js +1 -1
  49. package/dist/components/render-dataset/components/plus-dataset-data/form/dataset.script.vue.js.js +4 -1
  50. package/dist/components/render-dataset/components/plus-dataset-data/form/footer.vue.css +1 -1
  51. package/dist/components/render-dataset/components/plus-dataset-data/form/footer.vue.js +1 -1
  52. package/dist/components/render-dataset/components/plus-dataset-data/form/index.vue.css +2 -2
  53. package/dist/components/render-dataset/components/plus-dataset-data/form/index.vue.js +1 -1
  54. package/dist/components/render-dataset/components/plus-dataset-data/index.script.vue.js.js +8 -3
  55. package/dist/components/render-dataset/components/plus-dataset-data/index.vue.d.ts +3 -2
  56. package/dist/components/render-dataset/components/review-dataset-data/index.vue.css +10 -10
  57. package/dist/components/render-dataset/components/review-dataset-data/index.vue.js +1 -1
  58. package/dist/components/render-dataset/components/search-dataset/index.script.vue.js.js +21 -31
  59. package/dist/components/render-dataset/components/search-dataset/index.vue.d.ts +1 -0
  60. package/dist/components/render-dataset/components/search-dataset-data/index.script.vue.js.js +14 -0
  61. package/dist/components/render-dataset-detail/components/header.script.vue.js.js +1 -1
  62. package/dist/components/render-dataset-detail-origin-data/components/batch-operation/index.script.vue.js.js +61 -39
  63. package/dist/components/render-dataset-detail-origin-data/components/table/index.script.vue.js +259 -388
  64. package/dist/components/render-dataset-detail-origin-data/components/table/index.vue.d.ts +3 -1
  65. package/dist/components/render-dataset-detail-origin-data/index.script.vue.js.js +8 -7
  66. package/dist/components/render-dataset-detail-origin-data/index.vue.css +3 -3
  67. package/dist/components/render-dataset-detail-origin-data/index.vue.js +1 -1
  68. package/dist/components/render-dataset-list/components/header.script.vue.js.js +6 -3
  69. package/dist/components/render-dataset-list/components/header.vue.d.ts +4 -1
  70. package/dist/components/render-dataset-list/components/main.script.vue.js.js +38 -14
  71. package/dist/components/render-dataset-list/components/main.vue.css +4 -4
  72. package/dist/components/render-dataset-list/components/main.vue.d.ts +12 -5
  73. package/dist/components/render-dataset-list/components/main.vue.js +1 -1
  74. package/dist/components/render-dataset-list/components/table.script.vue.js +405 -0
  75. package/dist/components/render-dataset-list/components/table.vue.d.ts +13 -2
  76. package/dist/components/render-dataset-list/components/table.vue.js +1 -1
  77. package/dist/components/render-dataset-list/index.script.vue.js.js +37 -16
  78. package/dist/components/render-dataset-list/index.vue.css +4 -1
  79. package/dist/components/render-dataset-list/index.vue.d.ts +2 -6
  80. package/dist/components/render-dataset-list/index.vue.js +1 -1
  81. package/dist/components/render-dropdown/index.script.vue.js.js +171 -0
  82. package/dist/components/render-dropdown/index.vue.css +29 -0
  83. package/dist/components/render-dropdown/index.vue.d.ts +64 -0
  84. package/dist/components/render-dropdown/index.vue.js +4 -0
  85. package/dist/components/render-file-card/index.script.vue.js.js +5 -15
  86. package/dist/components/render-file-card/index.vue.css +11 -11
  87. package/dist/components/render-file-card/index.vue.js +1 -1
  88. package/dist/components/render-file-type-icon/index.vue.css +5 -5
  89. package/dist/components/render-file-type-icon/index.vue.js +1 -1
  90. package/dist/components/render-header/index.script.vue.js.js +11 -3
  91. package/dist/components/render-header/index.vue.css +3 -3
  92. package/dist/components/render-header/index.vue.d.ts +1 -1
  93. package/dist/components/render-header/index.vue.js +1 -1
  94. package/dist/components/render-like/index.script.vue.js.js +3 -3
  95. package/dist/components/render-like/index.vue.css +14 -13
  96. package/dist/components/render-like/index.vue.js +1 -1
  97. package/dist/components/render-router-tab/index.vue.css +4 -4
  98. package/dist/components/render-router-tab/index.vue.js +1 -1
  99. package/dist/components/render-search-empty/index.script.vue.js.js +61 -0
  100. package/dist/components/render-search-empty/index.vue.d.ts +20 -0
  101. package/dist/components/render-search-empty/index.vue.js +3 -0
  102. package/dist/components/render-search-select/index.script.vue.js.js +1 -0
  103. package/dist/components/render-t-table/index.script.vue.js +351 -0
  104. package/dist/components/render-t-table/index.vue.css +208 -0
  105. package/dist/components/render-t-table/index.vue.d.ts +59 -0
  106. package/dist/components/render-t-table/index.vue.js +5 -0
  107. package/dist/components/render-tag-tree/index.script.vue.js.js +112 -26
  108. package/dist/components/render-tag-tree/index.vue.css +7 -7
  109. package/dist/components/render-tag-tree/index.vue.d.ts +7 -3
  110. package/dist/components/render-tag-tree/index.vue.js +1 -1
  111. package/dist/components/render-tree/index.script.vue.js +17 -8
  112. package/dist/components/render-tree/index.vue.d.ts +4 -1
  113. package/dist/components.d.ts +4 -1
  114. package/dist/components.ts.js +4 -1
  115. package/dist/css/fonts/iconcool.eot +0 -0
  116. package/dist/css/fonts/iconcool.svg +5 -2
  117. package/dist/css/fonts/iconcool.ttf +0 -0
  118. package/dist/css/fonts/iconcool.woff +0 -0
  119. package/dist/css/iconcool.js +1 -1
  120. package/dist/css/style.css +5 -2
  121. package/dist/css/tailwind.css +105 -11
  122. package/dist/hooks/use-chat.d.ts +14 -4
  123. package/dist/hooks/use-common-http.d.ts +5 -2
  124. package/dist/hooks/use-common-http.ts.js +8 -6
  125. package/dist/hooks/use-dataset-http.d.ts +6 -4
  126. package/dist/hooks/use-dataset-http.ts.js +17 -6
  127. package/dist/hooks/use-ellipsis-tooltip.d.ts +3 -0
  128. package/dist/hooks/use-ellipsis-tooltip.ts.js +86 -0
  129. package/dist/hooks/use-member-http.d.ts +8 -0
  130. package/dist/hooks/use-member-http.ts.js +30 -0
  131. package/dist/hooks/use-meta-http.d.ts +3 -3
  132. package/dist/hooks/use-meta-http.ts.js +9 -5
  133. package/dist/hooks/use-style.d.ts +1 -0
  134. package/dist/hooks/use-style.ts.js +1 -0
  135. package/dist/hooks/use-t-table.d.ts +39 -0
  136. package/dist/hooks/use-t-table.ts.js +82 -0
  137. package/dist/hooks.d.ts +3 -0
  138. package/dist/hooks.ts.js +3 -0
  139. package/dist/http/fetch/index.ts.js +3 -2
  140. package/dist/http/helper/agent.d.ts +13 -1
  141. package/dist/http/helper/agent.ts.js +69 -24
  142. package/dist/http/helper/common.ts.js +4 -4
  143. package/dist/http/helper/dataset.d.ts +7 -1
  144. package/dist/http/helper/dataset.ts.js +20 -4
  145. package/dist/http/helper/knowledge.ts.js +9 -3
  146. package/dist/http/helper/tool.ts.js +7 -4
  147. package/dist/images/market.png +0 -0
  148. package/dist/transforms.d.ts +1 -0
  149. package/dist/transforms.ts.js +1 -0
  150. package/dist/types/agent.d.ts +41 -24
  151. package/dist/types/common.d.ts +28 -1
  152. package/dist/types/dataset.d.ts +16 -0
  153. package/dist/types/enum.d.ts +15 -2
  154. package/dist/types/enum.ts.js +16 -1
  155. package/dist/types/knowledge.d.ts +6 -0
  156. package/dist/types/model.d.ts +4 -4
  157. package/dist/types/tool.d.ts +5 -3
  158. package/dist/util.d.ts +1 -0
  159. package/dist/util.ts.js +1 -0
  160. package/package.json +11 -2
  161. package/dist/components/render-dataset/components/operation-record/table/index.script.vue.js.js +0 -226
  162. package/dist/components/render-dataset-list/components/table.script.vue.js.js +0 -580
@@ -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-ze881b7m] {
2
+ .send-container[data-v-ep97y4xb] {
3
3
  position: relative;
4
4
  }
5
- .send-container[data-v-ze881b7m]:has(textarea:focus) {
5
+ .send-container[data-v-ep97y4xb]:has(textarea:focus) {
6
6
  z-index: 2;
7
7
  }
8
- .send-container:hover .send-clear[data-v-ze881b7m] {
8
+ .send-container:hover .send-clear[data-v-ep97y4xb] {
9
9
  display: inline-flex !important;
10
10
  }
11
- .send-input[data-v-ze881b7m] {
11
+ .send-input[data-v-ep97y4xb] {
12
12
  width: 100%;
13
13
  flex-direction: row;
14
14
  height: var(--origin-height);
15
15
  }
16
- .send-input[data-v-ze881b7m]:has(textarea:focus) {
16
+ .send-input[data-v-ep97y4xb]:has(textarea:focus) {
17
17
  height: var(--text-height);
18
18
  }
19
- .send-input[data-v-ze881b7m] textarea {
19
+ .send-input[data-v-ep97y4xb] 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-ze881b7m] textarea::-webkit-scrollbar {
25
+ .send-input[data-v-ep97y4xb] textarea::-webkit-scrollbar {
26
26
  width: 4px;
27
27
  height: 4px;
28
28
  }
29
- .send-input[data-v-ze881b7m] textarea::-webkit-scrollbar-thumb {
29
+ .send-input[data-v-ep97y4xb] 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-ze881b7m] textarea::placeholder {
34
+ .send-input[data-v-ep97y4xb] textarea::placeholder {
35
35
  line-height: 16px;
36
36
  }
37
- .send-clear[data-v-ze881b7m] {
37
+ .send-clear[data-v-ep97y4xb] {
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-ze881b7m]:hover {
46
+ .send-clear[data-v-ep97y4xb]: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-ze881b7m";
2
+ script.__scopeId = "data-v-ep97y4xb";
3
3
  script.__file = "./src/components/render-auto-height-textarea/index.vue";
4
4
  import './index.vue.css';
5
5
  export default script;
@@ -1,11 +1,12 @@
1
1
 
2
- .auto-refresh[data-v-v1nkaqqm] {
2
+ .auto-refresh[data-v-nuknjymv] {
3
3
  position: relative;
4
4
  cursor: pointer;
5
5
  line-height: 26px;
6
6
  padding: 0 4px;
7
+ white-space: nowrap;
7
8
  }
8
- .auto-refresh[data-v-v1nkaqqm]:after {
9
+ .auto-refresh[data-v-nuknjymv]:after {
9
10
  content: '';
10
11
  position: absolute;
11
12
  top: 5px;
@@ -15,31 +16,31 @@
15
16
  background-color: #dcdee5;
16
17
  z-index: 1;
17
18
  }
18
- .auto-refresh[data-v-v1nkaqqm]:hover {
19
+ .auto-refresh[data-v-nuknjymv]:hover {
19
20
  color: #3A84FF;
20
21
  background-color: #E1ECFF;
21
22
  }
22
- .refresh[data-v-v1nkaqqm] {
23
+ .refresh[data-v-nuknjymv] {
23
24
  cursor: pointer;
24
25
  line-height: 26px;
25
26
  padding: 0 4px;
26
27
  }
27
- .refresh[data-v-v1nkaqqm]:hover {
28
+ .refresh[data-v-nuknjymv]:hover {
28
29
  color: #3A84FF;
29
30
  background-color: #E1ECFF;
30
31
  }
31
- .textarea-list[data-v-v1nkaqqm] {
32
+ .textarea-list[data-v-nuknjymv] {
32
33
  padding: 4px 0;
33
34
  line-height: 32px;
34
35
  max-height: 300px;
35
36
  position: relative;
36
37
  z-index: 2;
37
38
  }
38
- .textarea-list .textarea-item[data-v-v1nkaqqm] {
39
+ .textarea-list .textarea-item[data-v-nuknjymv] {
39
40
  padding: 0 12px;
40
41
  cursor: pointer;
41
42
  }
42
- .textarea-list .textarea-item[data-v-v1nkaqqm]:hover {
43
+ .textarea-list .textarea-item[data-v-nuknjymv]:hover {
43
44
  background: #E1ECFF;
44
45
  color: #3A84FF;
45
46
  }
@@ -1,5 +1,5 @@
1
1
  import script from './index.script.vue.js.js';
2
- script.__scopeId = "data-v-v1nkaqqm";
2
+ script.__scopeId = "data-v-nuknjymv";
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-yehba66b] {
2
+ .checkbox[data-v-briv0swz] {
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-yehba66b] {
11
+ .checkbox.disabled[data-v-briv0swz] {
12
12
  cursor: not-allowed;
13
13
  background: #fafbfd;
14
14
  border-color: #dcdee5;
15
15
  }
16
- .checkbox.disabled.checked[data-v-yehba66b] {
16
+ .checkbox.disabled.checked[data-v-briv0swz] {
17
17
  background-color: #a3c5fd;
18
18
  border-color: #a3c5fd;
19
19
  }
20
- .checkbox.disabled.indeterminate[data-v-yehba66b] {
20
+ .checkbox.disabled.indeterminate[data-v-briv0swz] {
21
21
  background-color: #fafbfd;
22
22
  border-color: #dcdee5;
23
23
  }
24
- .checkbox.disabled.indeterminate[data-v-yehba66b]:after {
24
+ .checkbox.disabled.indeterminate[data-v-briv0swz]:after {
25
25
  background: #dcdee5;
26
26
  }
27
- .checkbox.checked[data-v-yehba66b] {
27
+ .checkbox.checked[data-v-briv0swz] {
28
28
  background-color: #3a84ff;
29
29
  border: 1px solid #3a84ff;
30
30
  }
31
- .checkbox.checked[data-v-yehba66b]:after {
31
+ .checkbox.checked[data-v-briv0swz]: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-yehba66b] {
44
+ .checkbox.indeterminate[data-v-briv0swz] {
45
45
  background-color: #3a84ff;
46
46
  border: 1px solid #3a84ff;
47
47
  }
48
- .checkbox.indeterminate[data-v-yehba66b]:after {
48
+ .checkbox.indeterminate[data-v-briv0swz]: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-yehba66b";
2
+ script.__scopeId = "data-v-briv0swz";
3
3
  script.__file = "./src/components/render-checkbox/index.vue";
4
4
  import './index.vue.css';
5
5
  export default script;
@@ -28,23 +28,30 @@ 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({
41
41
  props: {
42
42
  modelValue: {},
43
43
  apiPrefix: {},
44
+ module: {},
45
+ multiple: {
46
+ type: Boolean
47
+ },
44
48
  spaceId: {},
45
49
  isDataset: {
46
50
  type: Boolean
47
51
  },
52
+ isEnabledCreateTag: {
53
+ type: Boolean
54
+ },
48
55
  popoverOptions: {}
49
56
  },
50
57
  emits: [
@@ -71,7 +78,7 @@ export default /*@__PURE__*/ _defineComponent({
71
78
  const tagNames = handleGetTagNames(value);
72
79
  try {
73
80
  templateTagNameErrorMessage = '';
74
- yield fun(tagNames);
81
+ yield fun(tagNames, props.module);
75
82
  } catch (error) {
76
83
  templateTagNameErrorMessage = error.message;
77
84
  return false;
@@ -89,6 +96,9 @@ export default /*@__PURE__*/ _defineComponent({
89
96
  checkTagRule
90
97
  ]
91
98
  };
99
+ const getModuleValue = ()=>{
100
+ return props.multiple ? props.modelValue : props.modelValue[0] || [];
101
+ };
92
102
  const handleFocus = ()=>{
93
103
  isShow.value = true;
94
104
  };
@@ -96,7 +106,10 @@ export default /*@__PURE__*/ _defineComponent({
96
106
  isShow.value = false;
97
107
  };
98
108
  const handleChange = (val)=>{
99
- emits('update:modelValue', val);
109
+ const moduleValue = props.multiple ? val : [
110
+ val
111
+ ];
112
+ emits('update:modelValue', moduleValue);
100
113
  };
101
114
  const handleTagKeyDown = (value, event)=>{
102
115
  if (event.keyCode === 13 || event.key === 'Enter') {
@@ -120,7 +133,7 @@ export default /*@__PURE__*/ _defineComponent({
120
133
  const tagNames = handleGetTagNames(tempTagName.value);
121
134
  const plusTagFun = props.isDataset ? plusDatasetTag : plusTag;
122
135
  yield tagFormRef.value.validate();
123
- yield plusTagFun(tagNames);
136
+ yield plusTagFun(tagNames, props.module);
124
137
  emits('update:modelValue', [
125
138
  ...props.modelValue,
126
139
  ...tagNames
@@ -139,6 +152,11 @@ export default /*@__PURE__*/ _defineComponent({
139
152
  }();
140
153
  const handleShowPlusTag = ()=>{
141
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
+ });
142
160
  };
143
161
  const handleHidePlusTag = ()=>{
144
162
  isShowEdit.value = false;
@@ -146,12 +164,17 @@ export default /*@__PURE__*/ _defineComponent({
146
164
  };
147
165
  const handleGetTags = ()=>{
148
166
  isLoadingTag.value = true;
149
- (props.isDataset ? getDatasetTags() : getTags()).then((result)=>{
167
+ (props.isDataset ? getDatasetTags(props.module) : getTags(props.module)).then((result)=>{
150
168
  tags.value = result;
151
169
  }).finally(()=>{
152
170
  isLoadingTag.value = false;
153
171
  });
154
172
  };
173
+ const handleCascaderToggle = (isShow)=>{
174
+ if (!isShow && !tempTagName.value.trim()) {
175
+ isShowEdit.value = false;
176
+ }
177
+ };
155
178
  watch(()=>props.spaceId, handleGetTags);
156
179
  onBeforeMount(handleGetTags);
157
180
  return (_ctx, _cache)=>{
@@ -166,94 +189,108 @@ export default /*@__PURE__*/ _defineComponent({
166
189
  "id-key": "tagName",
167
190
  "name-key": "tagName",
168
191
  "ext-cls": "tag-cascader",
169
- multiple: true,
192
+ placeholder: "请选择标签",
193
+ multiple: _ctx.multiple,
170
194
  loading: isLoadingTag.value,
171
195
  list: tags.value,
172
- "model-value": _ctx.modelValue,
173
- "onUpdate:modelValue": handleChange
174
- }, {
175
- extension: _withCtx(()=>[
176
- isShowEdit.value ? (_openBlock(), _createElementBlock("section", _hoisted_1, [
177
- _createVNode(_component_bk_form, {
178
- class: "plus-tag-form",
179
- ref_key: "tagFormRef",
180
- ref: tagFormRef,
181
- model: {
182
- tempTagName: tempTagName.value
183
- },
184
- rules: tagRules
185
- }, {
186
- default: _withCtx(()=>[
187
- _createVNode(_component_bk_form_item, {
188
- class: "plus-tag-form-item",
189
- "label-width": 0,
190
- property: "tempTagName",
191
- "error-display-type": "tooltips",
192
- required: ""
193
- }, {
194
- default: _withCtx(()=>[
195
- _createVNode(_component_bk_popover, {
196
- "is-show": isShow.value,
197
- theme: "light",
198
- trigger: "manual"
199
- }, {
200
- content: _withCtx(()=>_cache[1] || (_cache[1] = [
201
- _createTextVNode(" 如需定义层级标签,以英文“/”分割层级,多个标签以“、”分隔 ")
202
- ])),
203
- default: _withCtx(()=>[
204
- _createVNode(_component_bk_input, {
205
- modelValue: tempTagName.value,
206
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event)=>tempTagName.value = $event),
207
- ref_key: "tagRef",
208
- ref: tagRef,
209
- placeholder: "如需定义层级标签,以英文“/”分割层级,多个标签以“、”分隔",
210
- onKeydown: handleTagKeyDown,
211
- onFocus: handleFocus,
212
- onBlur: handleBlur
213
- }, null, 8 /* PROPS */ , [
214
- "modelValue"
215
- ])
216
- ]),
217
- _: 1 /* STABLE */
218
- }, 8 /* PROPS */ , [
219
- "is-show"
220
- ])
221
- ]),
222
- _: 1 /* STABLE */
223
- })
224
- ]),
225
- _: 1 /* STABLE */
226
- }, 8 /* PROPS */ , [
227
- "model"
228
- ]),
229
- _withDirectives(_createVNode(_unref(Done), {
230
- class: "plus-tag-done",
231
- onClick: handlePlusTag
232
- }, null, 512 /* NEED_PATCH */ ), [
233
- [
234
- _directive_bkloading,
235
- {
236
- loading: isPulsingTag.value
237
- }
238
- ]
239
- ]),
240
- _createVNode(_unref(Error), {
241
- class: "plus-tag-error",
242
- onClick: handleHidePlusTag
243
- })
244
- ])) : (_openBlock(), _createElementBlock("span", {
245
- key: 1,
246
- class: "plus-tag render-tag",
247
- onClick: handleShowPlusTag
248
- }, _cache[2] || (_cache[2] = [
249
- _createElementVNode("i", {
250
- class: "ai-ui-sdk-icon ai-ui-sdk-plus-circle g-text-14 g-mr-6"
251
- }, null, -1 /* HOISTED */ ),
252
- _createTextVNode(" 新建标签 ")
253
- ])))
254
- ]),
255
- _: 1 /* STABLE */
256
- }, 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 */ , [
293
+ "multiple",
257
294
  "loading",
258
295
  "list",
259
296
  "model-value"