@blueking/ai-ui-sdk 0.1.2-beta.2 → 0.1.2-beta.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/render-aside/index.vue.css +9 -9
- package/dist/components/render-aside/index.vue.js +1 -1
- package/dist/components/render-auth/auth-dialog-fn.d.ts +2 -0
- package/dist/components/render-auth/auth-dialog-fn.ts.js +14 -0
- package/dist/components/render-auth/auth-dialog.script.vue.js.js +113 -0
- package/dist/components/render-auth/auth-dialog.vue.css +4 -0
- package/dist/components/render-auth/auth-dialog.vue.d.ts +5 -0
- package/dist/components/render-auth/auth-dialog.vue.js +4 -0
- package/dist/components/render-auto-height-textarea/index.vue.css +11 -11
- package/dist/components/render-auto-height-textarea/index.vue.d.ts +2 -2
- package/dist/components/render-auto-height-textarea/index.vue.js +1 -1
- package/dist/components/render-choose-tag/index.script.vue.js.js +242 -0
- package/dist/components/render-choose-tag/index.vue.css +39 -0
- package/dist/components/render-choose-tag/index.vue.d.ts +12 -0
- package/dist/components/render-choose-tag/index.vue.js +5 -0
- package/dist/components/render-collapse/index.vue.css +2 -2
- package/dist/components/render-collapse/index.vue.js +1 -1
- package/dist/components/render-dataset/components/edit-dataset-data/index.script.vue.js.js +163 -171
- package/dist/components/render-dataset/components/edit-dataset-data/index.vue.css +3 -3
- package/dist/components/render-dataset/components/edit-dataset-data/index.vue.d.ts +4 -0
- package/dist/components/render-dataset/components/edit-dataset-data/index.vue.js +1 -1
- package/dist/components/render-dataset/components/operation-record/index.script.vue.js.js +88 -89
- package/dist/components/render-dataset/components/operation-record/index.vue.css +4 -4
- package/dist/components/render-dataset/components/operation-record/index.vue.d.ts +7 -1
- package/dist/components/render-dataset/components/operation-record/index.vue.js +1 -1
- package/dist/components/render-dataset/components/operation-record/table/index.script.vue.js.js +4 -3
- package/dist/components/render-dataset/components/operation-record/table/index.vue.css +1 -1
- package/dist/components/render-dataset/components/operation-record/table/index.vue.d.ts +1 -0
- package/dist/components/render-dataset/components/operation-record/table/index.vue.js +1 -1
- package/dist/components/render-dataset/components/operation-record/view-op-result/index.vue.css +2 -2
- package/dist/components/render-dataset/components/operation-record/view-op-result/index.vue.js +1 -1
- package/dist/components/render-dataset/components/plus-dataset/dataset-footer.script.vue.js.js +6 -4
- package/dist/components/render-dataset/components/plus-dataset/dataset-footer.vue.d.ts +4 -2
- package/dist/components/render-dataset/components/plus-dataset/dataset-form.script.vue.js +86 -23
- package/dist/components/render-dataset/components/plus-dataset/dataset-form.vue.d.ts +3 -0
- package/dist/components/render-dataset/components/plus-dataset/index.script.vue.js.js +98 -58
- package/dist/components/render-dataset/components/plus-dataset/index.vue.css +2 -2
- package/dist/components/render-dataset/components/plus-dataset/index.vue.d.ts +6 -0
- package/dist/components/render-dataset/components/plus-dataset/index.vue.js +1 -1
- package/dist/components/render-dataset/components/plus-dataset-data/form/dataset.script.vue.js.js +10 -3
- package/dist/components/render-dataset/components/plus-dataset-data/form/dataset.vue.d.ts +2 -0
- package/dist/components/render-dataset/components/plus-dataset-data/form/file.script.vue.js.js +4 -3
- package/dist/components/render-dataset/components/plus-dataset-data/form/file.vue.d.ts +1 -0
- package/dist/components/render-dataset/components/plus-dataset-data/form/footer.script.vue.js.js +4 -3
- package/dist/components/render-dataset/components/plus-dataset-data/form/footer.vue.css +1 -1
- package/dist/components/render-dataset/components/plus-dataset-data/form/footer.vue.d.ts +1 -0
- package/dist/components/render-dataset/components/plus-dataset-data/form/footer.vue.js +1 -1
- package/dist/components/render-dataset/components/plus-dataset-data/form/index.script.vue.js.js +22 -6
- package/dist/components/render-dataset/components/plus-dataset-data/form/index.vue.css +2 -2
- package/dist/components/render-dataset/components/plus-dataset-data/form/index.vue.d.ts +2 -0
- package/dist/components/render-dataset/components/plus-dataset-data/form/index.vue.js +1 -1
- package/dist/components/render-dataset/components/plus-dataset-data/form/manual.script.vue.js +4 -3
- package/dist/components/render-dataset/components/plus-dataset-data/form/manual.vue.d.ts +1 -0
- package/dist/components/render-dataset/components/plus-dataset-data/index.script.vue.js.js +49 -7
- package/dist/components/render-dataset/components/plus-dataset-data/index.vue.d.ts +3 -0
- package/dist/components/render-dataset/components/search-dataset/index.script.vue.js.js +21 -6
- package/dist/components/render-dataset/components/search-dataset/index.vue.d.ts +2 -0
- package/dist/components/render-dataset/components/source-type-icon/index.script.vue.js.js +2 -2
- package/dist/components/render-dataset/components/source-type-icon/index.vue.js +0 -2
- package/dist/components/render-dataset/index.script.vue.js.js +34 -8
- package/dist/components/render-dataset/index.vue.css +1 -1
- package/dist/components/render-dataset/index.vue.d.ts +2 -0
- package/dist/components/render-dataset/index.vue.js +1 -1
- package/dist/components/render-dataset-detail/components/header.script.vue.js.js +10 -35
- package/dist/components/render-dataset-detail/components/header.vue.d.ts +1 -2
- package/dist/components/render-dataset-detail/index.script.vue.js.js +86 -13
- package/dist/components/render-dataset-detail/index.vue.d.ts +2 -0
- package/dist/components/render-dataset-detail-origin-data/components/batch-operation/index.script.vue.js.js +49 -17
- package/dist/components/render-dataset-detail-origin-data/components/batch-operation/index.vue.d.ts +4 -0
- package/dist/components/render-dataset-detail-origin-data/components/table/index.script.vue.js +261 -170
- package/dist/components/render-dataset-detail-origin-data/components/table/index.vue.css +1 -1
- package/dist/components/render-dataset-detail-origin-data/components/table/index.vue.d.ts +3 -0
- package/dist/components/render-dataset-detail-origin-data/components/table/index.vue.js +1 -1
- package/dist/components/render-dataset-detail-origin-data/index.script.vue.js.js +33 -6
- package/dist/components/render-dataset-detail-origin-data/index.vue.css +3 -3
- package/dist/components/render-dataset-detail-origin-data/index.vue.d.ts +3 -0
- package/dist/components/render-dataset-detail-origin-data/index.vue.js +1 -1
- package/dist/components/render-dataset-list/components/main.script.vue.js.js +56 -13
- package/dist/components/render-dataset-list/components/main.vue.css +3 -3
- package/dist/components/render-dataset-list/components/main.vue.d.ts +4 -0
- package/dist/components/render-dataset-list/components/main.vue.js +1 -1
- package/dist/components/render-dataset-list/components/table.script.vue.js.js +442 -143
- package/dist/components/render-dataset-list/components/table.vue.d.ts +4 -0
- package/dist/components/render-dataset-list/index.script.vue.js.js +13 -2
- package/dist/components/render-dataset-list/index.vue.d.ts +4 -0
- package/dist/components/render-expand-collapse/index.vue.css +3 -3
- package/dist/components/render-expand-collapse/index.vue.js +1 -1
- package/dist/components/render-file-card/index.vue.css +11 -11
- package/dist/components/render-file-card/index.vue.js +1 -1
- package/dist/components/render-file-type-icon/index.vue.css +5 -5
- package/dist/components/render-file-type-icon/index.vue.js +1 -1
- package/dist/components/render-header/index.vue.css +5 -5
- package/dist/components/render-header/index.vue.js +1 -1
- package/dist/components/render-router-tab/index.vue.css +3 -3
- package/dist/components/render-router-tab/index.vue.js +1 -1
- package/dist/{component.d.ts → components.d.ts} +3 -1
- package/dist/{component.ts.js → components.ts.js} +3 -1
- package/dist/enums.d.ts +1 -0
- package/dist/enums.ts.js +1 -0
- package/dist/event/index.d.ts +3 -3
- package/dist/event/index.ts.js +2 -2
- package/dist/events.d.ts +1 -0
- package/dist/events.ts.js +1 -0
- package/dist/helpers.d.ts +1 -0
- package/dist/helpers.ts.js +1 -0
- package/dist/hooks/use-chat.d.ts +16 -0
- package/dist/hooks/use-chat.ts.js +13 -12
- package/dist/hooks/use-dataset-http.d.ts +3 -2
- package/dist/hooks/use-dataset-http.ts.js +107 -21
- package/dist/hooks/use-form-rule.d.ts +29 -0
- package/dist/hooks/use-form-rule.ts.js +101 -0
- package/dist/hooks/use-meta-http.d.ts +16 -0
- package/dist/hooks/use-meta-http.ts.js +83 -0
- package/dist/hooks/use-permission-http.d.ts +7 -0
- package/dist/hooks/use-permission-http.ts.js +26 -0
- package/dist/hooks/use-permission.d.ts +9 -0
- package/dist/hooks/use-permission.ts.js +100 -0
- package/dist/hooks/use-session-http.d.ts +1 -1
- package/dist/hooks/use-session-http.ts.js +37 -11
- package/dist/hooks.d.ts +9 -0
- package/dist/hooks.ts.js +9 -0
- package/dist/http/fetch/index.ts.js +59 -6
- package/dist/http/helper/dataset.ts.js +16 -3
- package/dist/http/helper/permission.d.ts +7 -1
- package/dist/http/helper/permission.ts.js +11 -1
- package/dist/https.d.ts +2 -0
- package/dist/https.ts.js +2 -0
- package/dist/transforms.d.ts +4 -0
- package/dist/transforms.ts.js +4 -0
- package/dist/types/dataset.d.ts +19 -1
- package/dist/types/enum.d.ts +46 -1
- package/dist/types/enum.ts.js +48 -0
- package/dist/types/meta.d.ts +3 -0
- package/dist/types/permission.d.ts +43 -0
- package/dist/types.d.ts +6 -0
- package/dist/types.ts.js +6 -0
- package/package.json +35 -10
- package/dist/components/render-dataset/components/source-type-icon/index.vue.css +0 -10
- package/dist/main.d.ts +0 -22
- package/dist/main.ts.js +0 -28
@@ -1,12 +1,12 @@
|
|
1
1
|
|
2
|
-
.aside-home[data-v-
|
2
|
+
.aside-home[data-v-jlamzolf] {
|
3
3
|
width: 300px;
|
4
4
|
height: 100%;
|
5
5
|
background: #FFFFFF;
|
6
6
|
padding: 16px;
|
7
7
|
border-right: 1px solid #eaebf0;
|
8
8
|
}
|
9
|
-
[data-v-
|
9
|
+
[data-v-jlamzolf] .aside-item {
|
10
10
|
width: 268px;
|
11
11
|
line-height: 36px;
|
12
12
|
border-radius: 2px;
|
@@ -16,30 +16,30 @@
|
|
16
16
|
justify-content: space-between;
|
17
17
|
color: #979BA5;
|
18
18
|
}
|
19
|
-
[data-v-
|
19
|
+
[data-v-jlamzolf] .aside-item.is-tab {
|
20
20
|
background: #F5F7FA;
|
21
21
|
cursor: pointer;
|
22
22
|
color: #4D4F56;
|
23
23
|
}
|
24
|
-
[data-v-
|
24
|
+
[data-v-jlamzolf] .aside-item.is-tab:hover {
|
25
25
|
background: #F0F5FF;
|
26
26
|
}
|
27
|
-
[data-v-
|
27
|
+
[data-v-jlamzolf] .aside-item.active {
|
28
28
|
background: #F0F5FF;
|
29
29
|
color: #3A84FF;
|
30
30
|
font-weight: 700;
|
31
31
|
}
|
32
|
-
[data-v-
|
32
|
+
[data-v-jlamzolf] .aside-item.active .tab-num {
|
33
33
|
background: #3A84FF;
|
34
34
|
color: #fff;
|
35
35
|
}
|
36
|
-
[data-v-
|
36
|
+
[data-v-jlamzolf] .aside-item.active .active-text {
|
37
37
|
color: #3A84FF;
|
38
38
|
}
|
39
|
-
[data-v-
|
39
|
+
[data-v-jlamzolf] .aside-item .tab-name {
|
40
40
|
flex: 1;
|
41
41
|
}
|
42
|
-
[data-v-
|
42
|
+
[data-v-jlamzolf] .aside-item .tab-num {
|
43
43
|
background: #EAEBF0;
|
44
44
|
border-radius: 2px;
|
45
45
|
margin-left: 5px;
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { h, render } from 'vue';
|
2
|
+
import authDialog from './auth-dialog.vue.js';
|
3
|
+
const getVnode = ()=>{
|
4
|
+
const vNode = h(authDialog);
|
5
|
+
const rootElement = document.querySelector('.app');
|
6
|
+
vNode.appContext = rootElement.__vue_app__._context;
|
7
|
+
render(vNode, document.body);
|
8
|
+
return vNode;
|
9
|
+
};
|
10
|
+
export const renderAuthDialog = (perm, cancelCallback)=>{
|
11
|
+
var _vNode_component_exposed, _vNode_component;
|
12
|
+
const vNode = getVnode();
|
13
|
+
(_vNode_component = vNode.component) === null || _vNode_component === void 0 ? void 0 : (_vNode_component_exposed = _vNode_component.exposed) === null || _vNode_component_exposed === void 0 ? void 0 : _vNode_component_exposed.handleShow(perm, cancelCallback);
|
14
|
+
};
|
@@ -0,0 +1,113 @@
|
|
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";
|
3
|
+
import { ref } from 'vue';
|
4
|
+
export default /*@__PURE__*/ _defineComponent({
|
5
|
+
setup (__props, { expose: __expose }) {
|
6
|
+
const isShow = ref(false);
|
7
|
+
const perm = ref();
|
8
|
+
const tableData = ref();
|
9
|
+
let cancelCallback;
|
10
|
+
const handleApply = ()=>{
|
11
|
+
var _perm_value;
|
12
|
+
window.open((_perm_value = perm.value) === null || _perm_value === void 0 ? void 0 : _perm_value.apply_url, '_blank');
|
13
|
+
};
|
14
|
+
const handleClosed = ()=>{
|
15
|
+
isShow.value = false;
|
16
|
+
cancelCallback === null || cancelCallback === void 0 ? void 0 : cancelCallback();
|
17
|
+
};
|
18
|
+
const handleShow = (data, callback)=>{
|
19
|
+
var _data_permission, _data_permission_actions, _data_permission1, _data_permission_actions__related_resource_types__instances__at, _data_permission_actions__related_resource_types__instances_, _data_permission_actions__related_resource_types__instances, _data_permission_actions__related_resource_types_, _data_permission_actions__related_resource_types, _data_permission_actions_, _data_permission2;
|
20
|
+
perm.value = data;
|
21
|
+
isShow.value = true;
|
22
|
+
tableData.value = [
|
23
|
+
{
|
24
|
+
system_name: data === null || data === void 0 ? void 0 : (_data_permission = data.permission) === null || _data_permission === void 0 ? void 0 : _data_permission.system_name,
|
25
|
+
name: data === null || data === void 0 ? void 0 : (_data_permission1 = data.permission) === null || _data_permission1 === void 0 ? void 0 : (_data_permission_actions = _data_permission1.actions) === null || _data_permission_actions === void 0 ? void 0 : _data_permission_actions.map((item)=>item.name).join(','),
|
26
|
+
instance_name: data === null || data === void 0 ? void 0 : (_data_permission2 = data.permission) === null || _data_permission2 === void 0 ? void 0 : (_data_permission_actions_ = _data_permission2.actions[0]) === null || _data_permission_actions_ === void 0 ? void 0 : (_data_permission_actions__related_resource_types = _data_permission_actions_.related_resource_types) === null || _data_permission_actions__related_resource_types === void 0 ? void 0 : (_data_permission_actions__related_resource_types_ = _data_permission_actions__related_resource_types[0]) === null || _data_permission_actions__related_resource_types_ === void 0 ? void 0 : (_data_permission_actions__related_resource_types__instances = _data_permission_actions__related_resource_types_.instances) === null || _data_permission_actions__related_resource_types__instances === void 0 ? void 0 : (_data_permission_actions__related_resource_types__instances_ = _data_permission_actions__related_resource_types__instances[0]) === null || _data_permission_actions__related_resource_types__instances_ === void 0 ? void 0 : (_data_permission_actions__related_resource_types__instances__at = _data_permission_actions__related_resource_types__instances_.at(-1)) === null || _data_permission_actions__related_resource_types__instances__at === void 0 ? void 0 : _data_permission_actions__related_resource_types__instances__at.name
|
27
|
+
}
|
28
|
+
];
|
29
|
+
cancelCallback = callback;
|
30
|
+
};
|
31
|
+
__expose({
|
32
|
+
handleShow
|
33
|
+
});
|
34
|
+
return (_ctx, _cache)=>{
|
35
|
+
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
|
+
const _component_bk_button = _resolveComponent("bk-button");
|
39
|
+
const _component_bk_dialog = _resolveComponent("bk-dialog");
|
40
|
+
return _openBlock(), _createBlock(_component_bk_dialog, {
|
41
|
+
"is-show": isShow.value,
|
42
|
+
width: 640,
|
43
|
+
class: "auth-dialog",
|
44
|
+
onClosed: handleClosed
|
45
|
+
}, {
|
46
|
+
header: _withCtx(()=>[
|
47
|
+
_createVNode(_component_bk_exception, {
|
48
|
+
type: "403",
|
49
|
+
scene: "part",
|
50
|
+
title: "该操作需要以下权限"
|
51
|
+
})
|
52
|
+
]),
|
53
|
+
footer: _withCtx(()=>[
|
54
|
+
_createElementVNode("div", null, [
|
55
|
+
_createVNode(_component_bk_button, {
|
56
|
+
theme: "primary",
|
57
|
+
onClick: handleApply
|
58
|
+
}, {
|
59
|
+
default: _withCtx(()=>_cache[0] || (_cache[0] = [
|
60
|
+
_createTextVNode(" 去申请 ")
|
61
|
+
])),
|
62
|
+
_: 1 /* STABLE */ ,
|
63
|
+
__: [
|
64
|
+
0
|
65
|
+
]
|
66
|
+
}),
|
67
|
+
_createVNode(_component_bk_button, {
|
68
|
+
class: "g-ml-8",
|
69
|
+
onClick: handleClosed
|
70
|
+
}, {
|
71
|
+
default: _withCtx(()=>_cache[1] || (_cache[1] = [
|
72
|
+
_createTextVNode(" 取消 ")
|
73
|
+
])),
|
74
|
+
_: 1 /* STABLE */ ,
|
75
|
+
__: [
|
76
|
+
1
|
77
|
+
]
|
78
|
+
})
|
79
|
+
])
|
80
|
+
]),
|
81
|
+
default: _withCtx(()=>[
|
82
|
+
_createVNode(_component_bk_table, {
|
83
|
+
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"
|
105
|
+
])
|
106
|
+
]),
|
107
|
+
_: 1 /* STABLE */
|
108
|
+
}, 8 /* PROPS */ , [
|
109
|
+
"is-show"
|
110
|
+
]);
|
111
|
+
};
|
112
|
+
}
|
113
|
+
});
|
@@ -0,0 +1,5 @@
|
|
1
|
+
import type { IPermissionApplyData } from '@/types/permission';
|
2
|
+
declare const _default: import("vue").DefineComponent<{}, {
|
3
|
+
handleShow: (data: IPermissionApplyData, callback?: Function) => void;
|
4
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
5
|
+
export default _default;
|
@@ -1,40 +1,40 @@
|
|
1
1
|
|
2
|
-
.send-container[data-v-
|
2
|
+
.send-container[data-v-useny97d] {
|
3
3
|
position: relative;
|
4
4
|
}
|
5
|
-
.send-container[data-v-
|
5
|
+
.send-container[data-v-useny97d]:has(textarea:focus) {
|
6
6
|
z-index: 2;
|
7
7
|
}
|
8
|
-
.send-container:hover .send-clear[data-v-
|
8
|
+
.send-container:hover .send-clear[data-v-useny97d] {
|
9
9
|
display: inline-flex !important;
|
10
10
|
}
|
11
|
-
.send-input[data-v-
|
11
|
+
.send-input[data-v-useny97d] {
|
12
12
|
width: 100%;
|
13
13
|
flex-direction: row;
|
14
14
|
height: var(--origin-height);
|
15
15
|
}
|
16
|
-
.send-input[data-v-
|
16
|
+
.send-input[data-v-useny97d]:has(textarea:focus) {
|
17
17
|
height: var(--text-height);
|
18
18
|
}
|
19
|
-
.send-input[data-v-
|
19
|
+
.send-input[data-v-useny97d] 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-
|
25
|
+
.send-input[data-v-useny97d] textarea::-webkit-scrollbar {
|
26
26
|
width: 4px;
|
27
27
|
height: 4px;
|
28
28
|
}
|
29
|
-
.send-input[data-v-
|
29
|
+
.send-input[data-v-useny97d] 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-
|
34
|
+
.send-input[data-v-useny97d] textarea::placeholder {
|
35
35
|
line-height: 16px;
|
36
36
|
}
|
37
|
-
.send-clear[data-v-
|
37
|
+
.send-clear[data-v-useny97d] {
|
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-
|
46
|
+
.send-clear[data-v-useny97d]:hover {
|
47
47
|
color: #313238;
|
48
48
|
}
|
@@ -7,11 +7,11 @@ interface IProps {
|
|
7
7
|
disabled?: boolean;
|
8
8
|
}
|
9
9
|
declare const _default: import("vue").DefineComponent<IProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
10
|
-
"update:modelValue": (...args: any[]) => void;
|
11
10
|
input: (...args: any[]) => void;
|
11
|
+
"update:modelValue": (...args: any[]) => void;
|
12
12
|
}, string, import("vue").PublicProps, Readonly<IProps> & Readonly<{
|
13
|
-
"onUpdate:modelValue"?: (...args: any[]) => any;
|
14
13
|
onInput?: (...args: any[]) => any;
|
14
|
+
"onUpdate:modelValue"?: (...args: any[]) => any;
|
15
15
|
}>, {
|
16
16
|
maxHeight: number;
|
17
17
|
focusShowHeight: boolean;
|
@@ -0,0 +1,242 @@
|
|
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 { defineComponent as _defineComponent } from 'vue';
|
31
|
+
import { renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, resolveComponent as _resolveComponent, createBlock as _createBlock, createVNode as _createVNode, withCtx as _withCtx, unref as _unref, resolveDirective as _resolveDirective, withDirectives as _withDirectives, createElementVNode as _createElementVNode, createTextVNode as _createTextVNode } from "vue";
|
32
|
+
const _hoisted_1 = {
|
33
|
+
key: 0,
|
34
|
+
class: "g-flex-row plus-tag-input"
|
35
|
+
};
|
36
|
+
import { Message } from 'bkui-vue';
|
37
|
+
import { Done, Error } from 'bkui-vue/lib/icon';
|
38
|
+
import { nextTick, onBeforeMount, ref, toRef, watch } from 'vue';
|
39
|
+
import { useFormRule } from '../../hooks/use-form-rule.ts.js';
|
40
|
+
import { useMetaHttp } from '../../hooks/use-meta-http.ts.js';
|
41
|
+
import { HttpErrorCode, Modules } from '../../types/enum.ts.js';
|
42
|
+
export default /*@__PURE__*/ _defineComponent({
|
43
|
+
props: {
|
44
|
+
modelValue: {},
|
45
|
+
apiPrefix: {},
|
46
|
+
spaceId: {},
|
47
|
+
popoverOptions: {}
|
48
|
+
},
|
49
|
+
emits: [
|
50
|
+
"update:modelValue"
|
51
|
+
],
|
52
|
+
setup (__props, { emit: __emit }) {
|
53
|
+
const props = __props;
|
54
|
+
const emits = __emit;
|
55
|
+
const { getTags, plusTag, checkTag } = useMetaHttp(props.apiPrefix, toRef(props, 'spaceId'));
|
56
|
+
const { getNameRule, getLengthRule } = useFormRule(props.apiPrefix, toRef(props, 'spaceId'));
|
57
|
+
const isShowEdit = ref(false);
|
58
|
+
const isPulsingTag = ref(false);
|
59
|
+
const tempTagName = ref('');
|
60
|
+
const tagRef = ref();
|
61
|
+
const tagFormRef = ref();
|
62
|
+
const isLoadingTag = ref(false);
|
63
|
+
const tags = ref([]);
|
64
|
+
const checkTagRule = {
|
65
|
+
validator: (value)=>checkTag(value).then(()=>true).catch(()=>false),
|
66
|
+
message: '标签名称重复',
|
67
|
+
trigger: 'change'
|
68
|
+
};
|
69
|
+
const tagRules = {
|
70
|
+
tempTagName: [
|
71
|
+
getNameRule(Modules.Tag),
|
72
|
+
checkTagRule,
|
73
|
+
getLengthRule('标签名称', 16)
|
74
|
+
]
|
75
|
+
};
|
76
|
+
const handleShowPlusTag = ()=>{
|
77
|
+
isShowEdit.value = true;
|
78
|
+
nextTick(()=>{
|
79
|
+
tagRef.value.focus();
|
80
|
+
});
|
81
|
+
};
|
82
|
+
const handleTagToggle = (isOpen)=>{
|
83
|
+
if (!isOpen) {
|
84
|
+
handleHidePlusTag();
|
85
|
+
}
|
86
|
+
};
|
87
|
+
const handleSelect = (value)=>{
|
88
|
+
emits('update:modelValue', value);
|
89
|
+
};
|
90
|
+
const handleTagKeyDown = (value, event)=>{
|
91
|
+
if (event.keyCode === 13 || event.key === 'Enter') {
|
92
|
+
handlePlusTag();
|
93
|
+
}
|
94
|
+
};
|
95
|
+
const handlePlusTag = function() {
|
96
|
+
var _ref = _async_to_generator(function*() {
|
97
|
+
try {
|
98
|
+
isPulsingTag.value = true;
|
99
|
+
yield tagFormRef.value.validate();
|
100
|
+
yield plusTag(tempTagName.value);
|
101
|
+
emits('update:modelValue', [
|
102
|
+
...props.modelValue,
|
103
|
+
tempTagName.value
|
104
|
+
]);
|
105
|
+
handleGetTags();
|
106
|
+
handleHidePlusTag();
|
107
|
+
} catch (error) {
|
108
|
+
if (error.code === HttpErrorCode.TagRepeat) {
|
109
|
+
Message({
|
110
|
+
message: '标签已存在,请重新输入',
|
111
|
+
theme: 'error'
|
112
|
+
});
|
113
|
+
} else {
|
114
|
+
console.error(error.message || error);
|
115
|
+
}
|
116
|
+
} finally{
|
117
|
+
isPulsingTag.value = false;
|
118
|
+
}
|
119
|
+
});
|
120
|
+
return function handlePlusTag() {
|
121
|
+
return _ref.apply(this, arguments);
|
122
|
+
};
|
123
|
+
}();
|
124
|
+
const handleHidePlusTag = ()=>{
|
125
|
+
isShowEdit.value = false;
|
126
|
+
tempTagName.value = '';
|
127
|
+
};
|
128
|
+
const handleGetTags = ()=>{
|
129
|
+
isLoadingTag.value = true;
|
130
|
+
getTags().then((result)=>{
|
131
|
+
tags.value = result;
|
132
|
+
}).finally(()=>{
|
133
|
+
isLoadingTag.value = false;
|
134
|
+
});
|
135
|
+
};
|
136
|
+
watch(()=>props.spaceId, handleGetTags);
|
137
|
+
onBeforeMount(handleGetTags);
|
138
|
+
return (_ctx, _cache)=>{
|
139
|
+
const _component_bk_option = _resolveComponent("bk-option");
|
140
|
+
const _component_bk_input = _resolveComponent("bk-input");
|
141
|
+
const _component_bk_form_item = _resolveComponent("bk-form-item");
|
142
|
+
const _component_bk_form = _resolveComponent("bk-form");
|
143
|
+
const _component_bk_select = _resolveComponent("bk-select");
|
144
|
+
const _directive_bkloading = _resolveDirective("bkloading");
|
145
|
+
return _openBlock(), _createBlock(_component_bk_select, {
|
146
|
+
multiple: "",
|
147
|
+
filterable: "",
|
148
|
+
"collapse-tags": "",
|
149
|
+
"multiple-mode": "tag",
|
150
|
+
"popover-options": _ctx.popoverOptions,
|
151
|
+
loading: isLoadingTag.value,
|
152
|
+
"input-search": false,
|
153
|
+
"model-value": _ctx.modelValue,
|
154
|
+
onChange: handleSelect,
|
155
|
+
onToggle: handleTagToggle
|
156
|
+
}, {
|
157
|
+
extension: _withCtx(()=>[
|
158
|
+
isShowEdit.value ? (_openBlock(), _createElementBlock("section", _hoisted_1, [
|
159
|
+
_createVNode(_component_bk_form, {
|
160
|
+
class: "plus-tag-form",
|
161
|
+
ref_key: "tagFormRef",
|
162
|
+
ref: tagFormRef,
|
163
|
+
model: {
|
164
|
+
tempTagName: tempTagName.value
|
165
|
+
},
|
166
|
+
rules: tagRules
|
167
|
+
}, {
|
168
|
+
default: _withCtx(()=>[
|
169
|
+
_createVNode(_component_bk_form_item, {
|
170
|
+
class: "plus-tag-form-item",
|
171
|
+
"label-width": 0,
|
172
|
+
property: "tempTagName",
|
173
|
+
"error-display-type": "tooltips",
|
174
|
+
required: ""
|
175
|
+
}, {
|
176
|
+
default: _withCtx(()=>[
|
177
|
+
_createVNode(_component_bk_input, {
|
178
|
+
modelValue: tempTagName.value,
|
179
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event)=>tempTagName.value = $event),
|
180
|
+
maxlength: 20,
|
181
|
+
ref_key: "tagRef",
|
182
|
+
ref: tagRef,
|
183
|
+
placeholder: "请输入标签名称",
|
184
|
+
onKeydown: handleTagKeyDown
|
185
|
+
}, null, 8 /* PROPS */ , [
|
186
|
+
"modelValue"
|
187
|
+
])
|
188
|
+
]),
|
189
|
+
_: 1 /* STABLE */
|
190
|
+
})
|
191
|
+
]),
|
192
|
+
_: 1 /* STABLE */
|
193
|
+
}, 8 /* PROPS */ , [
|
194
|
+
"model"
|
195
|
+
]),
|
196
|
+
_withDirectives(_createVNode(_unref(Done), {
|
197
|
+
class: "plus-tag-done",
|
198
|
+
onClick: handlePlusTag
|
199
|
+
}, null, 512 /* NEED_PATCH */ ), [
|
200
|
+
[
|
201
|
+
_directive_bkloading,
|
202
|
+
{
|
203
|
+
loading: isPulsingTag.value
|
204
|
+
}
|
205
|
+
]
|
206
|
+
]),
|
207
|
+
_createVNode(_unref(Error), {
|
208
|
+
class: "plus-tag-error",
|
209
|
+
onClick: handleHidePlusTag
|
210
|
+
})
|
211
|
+
])) : (_openBlock(), _createElementBlock("span", {
|
212
|
+
key: 1,
|
213
|
+
class: "plus-tag",
|
214
|
+
onClick: handleShowPlusTag
|
215
|
+
}, _cache[1] || (_cache[1] = [
|
216
|
+
_createElementVNode("i", {
|
217
|
+
class: "bkaidev-icon bkaidev-plus-circle"
|
218
|
+
}, null, -1 /* HOISTED */ ),
|
219
|
+
_createTextVNode(" 新建标签 ")
|
220
|
+
])))
|
221
|
+
]),
|
222
|
+
default: _withCtx(()=>[
|
223
|
+
(_openBlock(true), _createElementBlock(_Fragment, null, _renderList(tags.value, (tag)=>{
|
224
|
+
return _openBlock(), _createBlock(_component_bk_option, {
|
225
|
+
key: tag,
|
226
|
+
id: tag,
|
227
|
+
name: tag
|
228
|
+
}, null, 8 /* PROPS */ , [
|
229
|
+
"id",
|
230
|
+
"name"
|
231
|
+
]);
|
232
|
+
}), 128 /* KEYED_FRAGMENT */ ))
|
233
|
+
]),
|
234
|
+
_: 1 /* STABLE */
|
235
|
+
}, 8 /* PROPS */ , [
|
236
|
+
"popover-options",
|
237
|
+
"loading",
|
238
|
+
"model-value"
|
239
|
+
]);
|
240
|
+
};
|
241
|
+
}
|
242
|
+
});
|
@@ -0,0 +1,39 @@
|
|
1
|
+
|
2
|
+
.plus-tag-input[data-v-569fqv9p] {
|
3
|
+
padding: 7px 12px;
|
4
|
+
width: 100%;
|
5
|
+
}
|
6
|
+
.plus-tag-input .plus-tag-done[data-v-569fqv9p] {
|
7
|
+
cursor: pointer;
|
8
|
+
font-size: 22px;
|
9
|
+
color: #2DCB56;
|
10
|
+
margin: 0 5px 0 10px;
|
11
|
+
}
|
12
|
+
.plus-tag-input .plus-tag-error[data-v-569fqv9p] {
|
13
|
+
cursor: pointer;
|
14
|
+
font-size: 16px;
|
15
|
+
color: #C4C6CC;
|
16
|
+
margin-right: 5px;
|
17
|
+
}
|
18
|
+
.plus-tag-input .plus-tag-form[data-v-569fqv9p] {
|
19
|
+
flex: 1;
|
20
|
+
}
|
21
|
+
.plus-tag-input .plus-tag-form-item[data-v-569fqv9p] {
|
22
|
+
margin-bottom: 0;
|
23
|
+
}
|
24
|
+
.plus-tag[data-v-569fqv9p] {
|
25
|
+
cursor: pointer;
|
26
|
+
width: 100%;
|
27
|
+
display: flex;
|
28
|
+
justify-content: center;
|
29
|
+
align-items: center;
|
30
|
+
font-size: 12px;
|
31
|
+
line-height: 20px;
|
32
|
+
}
|
33
|
+
.plus-tag .bkaidev-plus-circle[data-v-569fqv9p] {
|
34
|
+
font-size: 14px;
|
35
|
+
margin-right: 6px;
|
36
|
+
}
|
37
|
+
.plus-tag[data-v-569fqv9p]:hover {
|
38
|
+
color: #3A84FF;
|
39
|
+
}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
interface IProps {
|
2
|
+
modelValue: string[];
|
3
|
+
apiPrefix: string;
|
4
|
+
spaceId?: string;
|
5
|
+
popoverOptions?: Record<string, unknown>;
|
6
|
+
}
|
7
|
+
declare const _default: import("vue").DefineComponent<IProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
8
|
+
"update:modelValue": (value: string[]) => any;
|
9
|
+
}, string, import("vue").PublicProps, Readonly<IProps> & Readonly<{
|
10
|
+
"onUpdate:modelValue"?: (value: string[]) => any;
|
11
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
12
|
+
export default _default;
|
@@ -1,10 +1,10 @@
|
|
1
1
|
|
2
|
-
.collapse-title[data-v-
|
2
|
+
.collapse-title[data-v-b08fekz5] {
|
3
3
|
height: 28px;
|
4
4
|
background: #F0F1F5;
|
5
5
|
border-radius: 2px;
|
6
6
|
padding: 0 12px;
|
7
7
|
}
|
8
|
-
.collapse-title .is-hidden[data-v-
|
8
|
+
.collapse-title .is-hidden[data-v-b08fekz5] {
|
9
9
|
transform: rotate(-90deg);
|
10
10
|
}
|