@blueking/ai-ui-sdk 0.1.9-beta.7 → 0.1.10-beta.10
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/common/util.d.ts +7 -0
- package/dist/common/util.ts.js +9 -0
- package/dist/components/render-aside/index.vue.css +9 -9
- package/dist/components/render-aside/index.vue.js +1 -1
- package/dist/components/render-auto-height-textarea/index.vue.css +11 -11
- package/dist/components/render-auto-height-textarea/index.vue.js +1 -1
- package/dist/components/render-auto-refresh/index.script.vue.js.js +125 -0
- package/dist/components/render-auto-refresh/index.vue.css +45 -0
- package/dist/components/render-auto-refresh/index.vue.d.ts +6 -0
- package/dist/components/render-auto-refresh/index.vue.js +5 -0
- package/dist/components/render-checkbox/index.script.vue.js.js +37 -0
- package/dist/components/render-checkbox/index.vue.css +59 -0
- package/dist/components/render-checkbox/index.vue.d.ts +11 -0
- package/dist/components/render-checkbox/index.vue.js +5 -0
- package/dist/components/render-choose-tag/index.script.vue.js.js +196 -3
- package/dist/components/render-choose-tag/index.vue.css +19 -12
- package/dist/components/render-choose-tag/index.vue.js +1 -1
- 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/batch-review-dataset-data/index.script.vue.js.js +321 -0
- package/dist/components/render-dataset/components/batch-review-dataset-data/index.vue.d.ts +16 -0
- package/dist/components/render-dataset/components/batch-review-dataset-data/index.vue.js +3 -0
- package/dist/components/render-dataset/components/dataset-data-level/index.script.vue.js.js +19 -0
- package/dist/components/render-dataset/components/dataset-data-level/index.vue.d.ts +6 -0
- package/dist/components/render-dataset/components/dataset-data-level/index.vue.js +3 -0
- package/dist/components/render-dataset/components/dataset-data-status/index.script.vue.js.js +51 -0
- package/dist/components/render-dataset/components/dataset-data-status/index.vue.d.ts +7 -0
- package/dist/components/render-dataset/components/dataset-data-status/index.vue.js +3 -0
- package/dist/components/render-dataset/components/edit-dataset-data/index.script.vue.js.js +3 -2
- 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 +2 -0
- package/dist/components/render-dataset/components/edit-dataset-data/index.vue.js +1 -1
- package/dist/components/render-dataset/components/operation-record/index.vue.css +4 -4
- 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 +23 -12
- 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.js +1 -1
- package/dist/components/render-dataset/components/operation-record/view-op-result/index.script.vue.js.js +1 -7
- 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-form.script.vue.js +1 -1
- package/dist/components/render-dataset/components/plus-dataset/index.vue.css +2 -2
- package/dist/components/render-dataset/components/plus-dataset/index.vue.js +1 -1
- 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.js +1 -1
- 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.js +1 -1
- package/dist/components/render-dataset/components/review-dataset-data/index.script.vue.js.js +454 -0
- package/dist/components/render-dataset/components/review-dataset-data/index.vue.css +41 -0
- package/dist/components/render-dataset/components/review-dataset-data/index.vue.d.ts +17 -0
- package/dist/components/render-dataset/components/review-dataset-data/index.vue.js +5 -0
- package/dist/components/render-dataset/components/search-dataset-data/index.script.vue.js.js +81 -3
- package/dist/components/render-dataset/components/search-dataset-data/index.vue.d.ts +1 -0
- package/dist/components/render-dataset/components/search-operation-record/index.script.vue.js.js +4 -0
- package/dist/components/render-dataset/index.vue.css +1 -1
- package/dist/components/render-dataset/index.vue.js +1 -1
- package/dist/components/render-dataset-detail-origin-data/components/batch-operation/index.script.vue.js.js +103 -72
- package/dist/components/render-dataset-detail-origin-data/components/batch-operation/index.vue.d.ts +3 -2
- package/dist/components/render-dataset-detail-origin-data/components/table/index.script.vue.js +181 -27
- 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 +1 -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 +73 -12
- 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 +1 -0
- package/dist/components/render-dataset-detail-origin-data/index.vue.js +1 -1
- package/dist/components/render-dataset-list/components/main.vue.css +3 -3
- package/dist/components/render-dataset-list/components/main.vue.js +1 -1
- 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/components.d.ts +3 -1
- package/dist/components.ts.js +3 -1
- package/dist/css/fonts/iconcool.eot +0 -0
- package/dist/css/fonts/iconcool.svg +30 -0
- package/dist/css/fonts/iconcool.ttf +0 -0
- package/dist/css/fonts/iconcool.woff +0 -0
- package/dist/css/iconcool.js +2 -2
- package/dist/css/style.css +30 -0
- package/dist/hooks/use-chat.d.ts +2 -0
- package/dist/hooks/use-chat.ts.js +22 -0
- package/dist/hooks/use-dataset-http.d.ts +3 -1
- package/dist/hooks/use-dataset-http.ts.js +17 -3
- package/dist/hooks/use-form-rule.ts.js +101 -0
- package/dist/hooks/use-meta-http.ts.js +1 -1
- package/dist/http/helper/dataset.d.ts +24 -1
- package/dist/http/helper/dataset.ts.js +45 -5
- package/dist/types/dataset.d.ts +52 -5
- package/dist/types/enum.d.ts +27 -2
- package/dist/types/enum.ts.js +28 -0
- package/dist/types/permission.d.ts +1 -0
- package/package.json +4 -3
@@ -1,6 +1,41 @@
|
|
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
|
+
}
|
1
30
|
import { defineComponent as _defineComponent } from 'vue';
|
2
|
-
import { resolveComponent as _resolveComponent, openBlock as _openBlock, createBlock as _createBlock } 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";
|
32
|
+
const _hoisted_1 = {
|
33
|
+
key: 0,
|
34
|
+
class: "g-flex-row plus-tag-input render-tag"
|
35
|
+
};
|
36
|
+
import { Done, Error } from 'bkui-vue/lib/icon';
|
3
37
|
import { onBeforeMount, ref, toRef, watch } from 'vue';
|
38
|
+
import { useFormRule } from '../../hooks/use-form-rule.ts.js';
|
4
39
|
import { useMetaHttp } from '../../hooks/use-meta-http.ts.js';
|
5
40
|
export default /*@__PURE__*/ _defineComponent({
|
6
41
|
props: {
|
@@ -15,12 +50,81 @@ export default /*@__PURE__*/ _defineComponent({
|
|
15
50
|
setup (__props, { emit: __emit }) {
|
16
51
|
const props = __props;
|
17
52
|
const emits = __emit;
|
18
|
-
const {
|
53
|
+
const { getLengthRule } = useFormRule(props.apiPrefix, toRef(props, 'spaceId'));
|
54
|
+
const { getTags, plusTag, checkTag } = useMetaHttp(props.apiPrefix, toRef(props, 'spaceId'));
|
55
|
+
const isShowEdit = ref(false);
|
56
|
+
const isPulsingTag = ref(false);
|
57
|
+
const tempTagName = ref('');
|
58
|
+
const tagRef = ref();
|
59
|
+
const tagFormRef = ref();
|
19
60
|
const isLoadingTag = ref(false);
|
61
|
+
const isShow = ref(false);
|
20
62
|
const tags = ref([]);
|
63
|
+
const checkTagRule = {
|
64
|
+
validator: (value)=>checkTag(handleGetTagNames(value)).then(()=>true).catch(()=>false),
|
65
|
+
message: '标签名称重复',
|
66
|
+
trigger: 'change'
|
67
|
+
};
|
68
|
+
const tagRules = {
|
69
|
+
tempTagName: [
|
70
|
+
checkTagRule,
|
71
|
+
getLengthRule('标签名称', 16)
|
72
|
+
]
|
73
|
+
};
|
74
|
+
const handleFocus = ()=>{
|
75
|
+
isShow.value = true;
|
76
|
+
};
|
77
|
+
const handleBlur = ()=>{
|
78
|
+
isShow.value = false;
|
79
|
+
};
|
21
80
|
const handleChange = (val)=>{
|
22
81
|
emits('update:modelValue', val);
|
23
82
|
};
|
83
|
+
const handleTagKeyDown = (value, event)=>{
|
84
|
+
if (event.keyCode === 13 || event.key === 'Enter') {
|
85
|
+
handlePlusTag();
|
86
|
+
}
|
87
|
+
};
|
88
|
+
const handleGetTagNames = (tagName)=>{
|
89
|
+
const tagGroups = tagName.split('、');
|
90
|
+
return tagGroups.reduce((acc, cur)=>{
|
91
|
+
if (cur.trim()) {
|
92
|
+
const tagNames = cur.split('/').filter(Boolean);
|
93
|
+
acc.push(tagNames);
|
94
|
+
}
|
95
|
+
return acc;
|
96
|
+
}, []);
|
97
|
+
};
|
98
|
+
const handlePlusTag = function() {
|
99
|
+
var _ref = _async_to_generator(function*() {
|
100
|
+
try {
|
101
|
+
isPulsingTag.value = true;
|
102
|
+
const tagNames = handleGetTagNames(tempTagName.value);
|
103
|
+
yield tagFormRef.value.validate();
|
104
|
+
yield plusTag(tagNames);
|
105
|
+
emits('update:modelValue', [
|
106
|
+
...props.modelValue,
|
107
|
+
...tagNames
|
108
|
+
]);
|
109
|
+
handleGetTags();
|
110
|
+
handleHidePlusTag();
|
111
|
+
} catch (error) {
|
112
|
+
console.error(error.message || error);
|
113
|
+
} finally{
|
114
|
+
isPulsingTag.value = false;
|
115
|
+
}
|
116
|
+
});
|
117
|
+
return function handlePlusTag() {
|
118
|
+
return _ref.apply(this, arguments);
|
119
|
+
};
|
120
|
+
}();
|
121
|
+
const handleShowPlusTag = ()=>{
|
122
|
+
isShowEdit.value = true;
|
123
|
+
};
|
124
|
+
const handleHidePlusTag = ()=>{
|
125
|
+
isShowEdit.value = false;
|
126
|
+
tempTagName.value = '';
|
127
|
+
};
|
24
128
|
const handleGetTags = ()=>{
|
25
129
|
isLoadingTag.value = true;
|
26
130
|
getTags().then((result)=>{
|
@@ -32,17 +136,106 @@ export default /*@__PURE__*/ _defineComponent({
|
|
32
136
|
watch(()=>props.spaceId, handleGetTags);
|
33
137
|
onBeforeMount(handleGetTags);
|
34
138
|
return (_ctx, _cache)=>{
|
139
|
+
const _component_bk_input = _resolveComponent("bk-input");
|
140
|
+
const _component_bk_popover = _resolveComponent("bk-popover");
|
141
|
+
const _component_bk_form_item = _resolveComponent("bk-form-item");
|
142
|
+
const _component_bk_form = _resolveComponent("bk-form");
|
35
143
|
const _component_bk_cascader = _resolveComponent("bk-cascader");
|
144
|
+
const _directive_bkloading = _resolveDirective("bkloading");
|
36
145
|
return _openBlock(), _createBlock(_component_bk_cascader, {
|
37
146
|
filterable: "",
|
38
147
|
"id-key": "tagName",
|
39
148
|
"name-key": "tagName",
|
149
|
+
"ext-cls": "tag-cascader",
|
40
150
|
multiple: true,
|
41
151
|
loading: isLoadingTag.value,
|
42
152
|
list: tags.value,
|
43
153
|
"model-value": _ctx.modelValue,
|
44
154
|
"onUpdate:modelValue": handleChange
|
45
|
-
},
|
155
|
+
}, {
|
156
|
+
extension: _withCtx(()=>[
|
157
|
+
isShowEdit.value ? (_openBlock(), _createElementBlock("section", _hoisted_1, [
|
158
|
+
_createVNode(_component_bk_form, {
|
159
|
+
class: "plus-tag-form",
|
160
|
+
ref_key: "tagFormRef",
|
161
|
+
ref: tagFormRef,
|
162
|
+
model: {
|
163
|
+
tempTagName: tempTagName.value
|
164
|
+
},
|
165
|
+
rules: tagRules
|
166
|
+
}, {
|
167
|
+
default: _withCtx(()=>[
|
168
|
+
_createVNode(_component_bk_form_item, {
|
169
|
+
class: "plus-tag-form-item",
|
170
|
+
"label-width": 0,
|
171
|
+
property: "tempTagName",
|
172
|
+
"error-display-type": "tooltips",
|
173
|
+
required: ""
|
174
|
+
}, {
|
175
|
+
default: _withCtx(()=>[
|
176
|
+
_createVNode(_component_bk_popover, {
|
177
|
+
"is-show": isShow.value,
|
178
|
+
theme: "light",
|
179
|
+
trigger: "manual"
|
180
|
+
}, {
|
181
|
+
content: _withCtx(()=>_cache[1] || (_cache[1] = [
|
182
|
+
_createTextVNode(" 如需定义层级标签,以英文“/”分割层级,多个标签以“、”分隔 ")
|
183
|
+
])),
|
184
|
+
default: _withCtx(()=>[
|
185
|
+
_createVNode(_component_bk_input, {
|
186
|
+
modelValue: tempTagName.value,
|
187
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event)=>tempTagName.value = $event),
|
188
|
+
maxlength: 20,
|
189
|
+
ref_key: "tagRef",
|
190
|
+
ref: tagRef,
|
191
|
+
placeholder: "如需定义层级标签,以英文“/”分割层级,多个标签以“、”分隔",
|
192
|
+
onKeydown: handleTagKeyDown,
|
193
|
+
onFocus: handleFocus,
|
194
|
+
onBlur: handleBlur
|
195
|
+
}, null, 8 /* PROPS */ , [
|
196
|
+
"modelValue"
|
197
|
+
])
|
198
|
+
]),
|
199
|
+
_: 1 /* STABLE */
|
200
|
+
}, 8 /* PROPS */ , [
|
201
|
+
"is-show"
|
202
|
+
])
|
203
|
+
]),
|
204
|
+
_: 1 /* STABLE */
|
205
|
+
})
|
206
|
+
]),
|
207
|
+
_: 1 /* STABLE */
|
208
|
+
}, 8 /* PROPS */ , [
|
209
|
+
"model"
|
210
|
+
]),
|
211
|
+
_withDirectives(_createVNode(_unref(Done), {
|
212
|
+
class: "plus-tag-done",
|
213
|
+
onClick: handlePlusTag
|
214
|
+
}, null, 512 /* NEED_PATCH */ ), [
|
215
|
+
[
|
216
|
+
_directive_bkloading,
|
217
|
+
{
|
218
|
+
loading: isPulsingTag.value
|
219
|
+
}
|
220
|
+
]
|
221
|
+
]),
|
222
|
+
_createVNode(_unref(Error), {
|
223
|
+
class: "plus-tag-error",
|
224
|
+
onClick: handleHidePlusTag
|
225
|
+
})
|
226
|
+
])) : (_openBlock(), _createElementBlock("span", {
|
227
|
+
key: 1,
|
228
|
+
class: "plus-tag render-tag",
|
229
|
+
onClick: handleShowPlusTag
|
230
|
+
}, _cache[2] || (_cache[2] = [
|
231
|
+
_createElementVNode("i", {
|
232
|
+
class: "ai-ui-sdk-icon ai-ui-sdk-plus-circle g-text-14 g-mr-6"
|
233
|
+
}, null, -1 /* HOISTED */ ),
|
234
|
+
_createTextVNode(" 新建标签 ")
|
235
|
+
])))
|
236
|
+
]),
|
237
|
+
_: 1 /* STABLE */
|
238
|
+
}, 8 /* PROPS */ , [
|
46
239
|
"loading",
|
47
240
|
"list",
|
48
241
|
"model-value"
|
@@ -1,39 +1,46 @@
|
|
1
1
|
|
2
|
-
.plus-tag-input[data-v-
|
2
|
+
.plus-tag-input[data-v-cfz2a66r] {
|
3
3
|
padding: 7px 12px;
|
4
|
-
|
4
|
+
height: 40px;
|
5
|
+
background: #FAFBFD;
|
6
|
+
border-top: 1px solid #DCDEE5;
|
5
7
|
}
|
6
|
-
.plus-tag-input .plus-tag-done[data-v-
|
8
|
+
.plus-tag-input .plus-tag-done[data-v-cfz2a66r] {
|
7
9
|
cursor: pointer;
|
8
10
|
font-size: 22px;
|
9
11
|
color: #2DCB56;
|
10
12
|
margin: 0 5px 0 10px;
|
11
13
|
}
|
12
|
-
.plus-tag-input .plus-tag-error[data-v-
|
14
|
+
.plus-tag-input .plus-tag-error[data-v-cfz2a66r] {
|
13
15
|
cursor: pointer;
|
14
16
|
font-size: 16px;
|
15
17
|
color: #C4C6CC;
|
16
18
|
margin-right: 5px;
|
17
19
|
}
|
18
|
-
.plus-tag-input .plus-tag-form[data-v-
|
20
|
+
.plus-tag-input .plus-tag-form[data-v-cfz2a66r] {
|
19
21
|
flex: 1;
|
20
22
|
}
|
21
|
-
.plus-tag-input .plus-tag-form-item[data-v-
|
23
|
+
.plus-tag-input .plus-tag-form-item[data-v-cfz2a66r] {
|
22
24
|
margin-bottom: 0;
|
23
25
|
}
|
24
|
-
.plus-tag[data-v-
|
26
|
+
.plus-tag[data-v-cfz2a66r] {
|
25
27
|
cursor: pointer;
|
26
28
|
width: 100%;
|
29
|
+
height: 40px;
|
30
|
+
background: #FAFBFD;
|
31
|
+
border-top: 1px solid #DCDEE5;
|
32
|
+
border-radius: 0 0 2px 2px;
|
27
33
|
display: flex;
|
28
34
|
justify-content: center;
|
29
35
|
align-items: center;
|
30
36
|
font-size: 12px;
|
31
37
|
line-height: 20px;
|
32
38
|
}
|
33
|
-
.plus-tag
|
34
|
-
font-size: 14px;
|
35
|
-
margin-right: 6px;
|
36
|
-
}
|
37
|
-
.plus-tag[data-v-a4kk3wtg]:hover {
|
39
|
+
.plus-tag[data-v-cfz2a66r]:hover {
|
38
40
|
color: #3A84FF;
|
39
41
|
}
|
42
|
+
|
43
|
+
|
44
|
+
.bk-cascader-popover:has(.render-tag) .bk-cascader-node {
|
45
|
+
width: 240px !important;
|
46
|
+
}
|
@@ -1,10 +1,10 @@
|
|
1
1
|
|
2
|
-
.collapse-title[data-v-
|
2
|
+
.collapse-title[data-v-8lqjgsrl] {
|
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-8lqjgsrl] {
|
9
9
|
transform: rotate(-90deg);
|
10
10
|
}
|
package/dist/components/render-dataset/components/batch-review-dataset-data/index.script.vue.js.js
ADDED
@@ -0,0 +1,321 @@
|
|
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 { createElementVNode as _createElementVNode, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, resolveComponent as _resolveComponent, withCtx as _withCtx, createVNode as _createVNode, unref as _unref, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode } from "vue";
|
32
|
+
const _hoisted_1 = {
|
33
|
+
class: "g-flex-row"
|
34
|
+
};
|
35
|
+
const _hoisted_2 = {
|
36
|
+
class: "g-text-gray g-text-14"
|
37
|
+
};
|
38
|
+
import { ref, toRef, watch } from 'vue';
|
39
|
+
import AutoHeightTextarea from '../../../render-auto-height-textarea/index.vue.js';
|
40
|
+
import { useDatasetHttp } from '../../../../hooks/use-dataset-http.ts.js';
|
41
|
+
import { DatasetDataReviewLevel } from '../../../../types/enum.ts.js';
|
42
|
+
export default /*@__PURE__*/ _defineComponent({
|
43
|
+
props: {
|
44
|
+
modelValue: {
|
45
|
+
type: Boolean
|
46
|
+
},
|
47
|
+
datasetDatas: {},
|
48
|
+
datasetId: {},
|
49
|
+
apiPrefix: {},
|
50
|
+
spaceId: {}
|
51
|
+
},
|
52
|
+
emits: [
|
53
|
+
"update:modelValue",
|
54
|
+
"success-review"
|
55
|
+
],
|
56
|
+
setup (__props, { emit: __emit }) {
|
57
|
+
const props = __props;
|
58
|
+
const emits = __emit;
|
59
|
+
const { batchReviewDatasetData } = useDatasetHttp(props.apiPrefix, toRef(props, 'spaceId'));
|
60
|
+
const isLoading = ref(false);
|
61
|
+
const formRef = ref();
|
62
|
+
const formData = ref({
|
63
|
+
acceptAi: true,
|
64
|
+
accept: true,
|
65
|
+
datasetId: undefined,
|
66
|
+
datasetItemIds: [],
|
67
|
+
level: DatasetDataReviewLevel.A,
|
68
|
+
reviewReason: ''
|
69
|
+
});
|
70
|
+
const handleConfirm = function() {
|
71
|
+
var _ref = _async_to_generator(function*() {
|
72
|
+
try {
|
73
|
+
// loading
|
74
|
+
isLoading.value = true;
|
75
|
+
// 表单验证
|
76
|
+
yield formRef.value.validate();
|
77
|
+
// 创建空间
|
78
|
+
yield batchReviewDatasetData(formData.value);
|
79
|
+
// 关闭弹窗
|
80
|
+
handleClose();
|
81
|
+
// 触发成功事件
|
82
|
+
emits('success-review');
|
83
|
+
} catch (error) {
|
84
|
+
console.error(error);
|
85
|
+
} finally{
|
86
|
+
isLoading.value = false;
|
87
|
+
}
|
88
|
+
});
|
89
|
+
return function handleConfirm() {
|
90
|
+
return _ref.apply(this, arguments);
|
91
|
+
};
|
92
|
+
}();
|
93
|
+
const handleClose = ()=>{
|
94
|
+
emits('update:modelValue', false);
|
95
|
+
};
|
96
|
+
watch(()=>props.modelValue, (newVal)=>{
|
97
|
+
if (newVal) {
|
98
|
+
formData.value = {
|
99
|
+
datasetItemIds: props.datasetDatas.map((datasetData)=>datasetData.id),
|
100
|
+
datasetId: props.datasetId,
|
101
|
+
acceptAi: true,
|
102
|
+
accept: true,
|
103
|
+
level: DatasetDataReviewLevel.A,
|
104
|
+
reviewReason: ''
|
105
|
+
};
|
106
|
+
}
|
107
|
+
});
|
108
|
+
return (_ctx, _cache)=>{
|
109
|
+
const _component_bk_radio_button = _resolveComponent("bk-radio-button");
|
110
|
+
const _component_bk_radio_group = _resolveComponent("bk-radio-group");
|
111
|
+
const _component_bk_form_item = _resolveComponent("bk-form-item");
|
112
|
+
const _component_bk_form = _resolveComponent("bk-form");
|
113
|
+
const _component_bk_button = _resolveComponent("bk-button");
|
114
|
+
const _component_bk_dialog = _resolveComponent("bk-dialog");
|
115
|
+
return _openBlock(), _createBlock(_component_bk_dialog, {
|
116
|
+
width: "508",
|
117
|
+
"dialog-type": "show",
|
118
|
+
"render-directive": "if",
|
119
|
+
"quick-close": false,
|
120
|
+
"is-show": _ctx.modelValue,
|
121
|
+
onClosed: handleClose
|
122
|
+
}, {
|
123
|
+
header: _withCtx(()=>[
|
124
|
+
_createElementVNode("span", _hoisted_1, [
|
125
|
+
_cache[4] || (_cache[4] = _createElementVNode("span", {
|
126
|
+
class: "g-text-black g-learning-28 g-text-20"
|
127
|
+
}, "批量审核", -1 /* HOISTED */ )),
|
128
|
+
_cache[5] || (_cache[5] = _createElementVNode("span", {
|
129
|
+
class: "g-gap g-ml-8 g-mr-8"
|
130
|
+
}, null, -1 /* HOISTED */ )),
|
131
|
+
_createElementVNode("span", _hoisted_2, "已选 " + _toDisplayString(_ctx.datasetDatas.length) + " 条数据", 1 /* TEXT */ )
|
132
|
+
])
|
133
|
+
]),
|
134
|
+
footer: _withCtx(()=>[
|
135
|
+
_createVNode(_component_bk_button, {
|
136
|
+
theme: "primary",
|
137
|
+
loading: isLoading.value,
|
138
|
+
onClick: handleConfirm
|
139
|
+
}, {
|
140
|
+
default: _withCtx(()=>_cache[10] || (_cache[10] = [
|
141
|
+
_createTextVNode(" 确认 ")
|
142
|
+
])),
|
143
|
+
_: 1 /* STABLE */ ,
|
144
|
+
__: [
|
145
|
+
10
|
146
|
+
]
|
147
|
+
}, 8 /* PROPS */ , [
|
148
|
+
"loading"
|
149
|
+
]),
|
150
|
+
_createVNode(_component_bk_button, {
|
151
|
+
class: "g-ml-4",
|
152
|
+
disabled: isLoading.value,
|
153
|
+
onClick: handleClose
|
154
|
+
}, {
|
155
|
+
default: _withCtx(()=>_cache[11] || (_cache[11] = [
|
156
|
+
_createTextVNode(" 取消 ")
|
157
|
+
])),
|
158
|
+
_: 1 /* STABLE */ ,
|
159
|
+
__: [
|
160
|
+
11
|
161
|
+
]
|
162
|
+
}, 8 /* PROPS */ , [
|
163
|
+
"disabled"
|
164
|
+
])
|
165
|
+
]),
|
166
|
+
default: _withCtx(()=>[
|
167
|
+
_createElementVNode("section", null, [
|
168
|
+
_createVNode(_component_bk_form, {
|
169
|
+
"form-type": "vertical",
|
170
|
+
ref_key: "formRef",
|
171
|
+
ref: formRef,
|
172
|
+
class: "g-small-form g-short-form",
|
173
|
+
model: formData.value
|
174
|
+
}, {
|
175
|
+
default: _withCtx(()=>[
|
176
|
+
_createVNode(_component_bk_form_item, null, {
|
177
|
+
default: _withCtx(()=>[
|
178
|
+
_createVNode(_component_bk_radio_group, {
|
179
|
+
class: "g-radio-group",
|
180
|
+
modelValue: formData.value.acceptAi,
|
181
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event)=>formData.value.acceptAi = $event)
|
182
|
+
}, {
|
183
|
+
default: _withCtx(()=>[
|
184
|
+
_createVNode(_component_bk_radio_button, {
|
185
|
+
label: true
|
186
|
+
}, {
|
187
|
+
default: _withCtx(()=>_cache[6] || (_cache[6] = [
|
188
|
+
_createTextVNode(" 维持当前审核结果 ")
|
189
|
+
])),
|
190
|
+
_: 1 /* STABLE */ ,
|
191
|
+
__: [
|
192
|
+
6
|
193
|
+
]
|
194
|
+
}),
|
195
|
+
_createVNode(_component_bk_radio_button, {
|
196
|
+
label: false
|
197
|
+
}, {
|
198
|
+
default: _withCtx(()=>_cache[7] || (_cache[7] = [
|
199
|
+
_createTextVNode(" 统一修改预审结果 ")
|
200
|
+
])),
|
201
|
+
_: 1 /* STABLE */ ,
|
202
|
+
__: [
|
203
|
+
7
|
204
|
+
]
|
205
|
+
})
|
206
|
+
]),
|
207
|
+
_: 1 /* STABLE */
|
208
|
+
}, 8 /* PROPS */ , [
|
209
|
+
"modelValue"
|
210
|
+
])
|
211
|
+
]),
|
212
|
+
_: 1 /* STABLE */
|
213
|
+
}),
|
214
|
+
!formData.value.acceptAi ? (_openBlock(), _createBlock(_component_bk_form_item, {
|
215
|
+
key: 0,
|
216
|
+
label: "质量等级",
|
217
|
+
property: "level",
|
218
|
+
required: ""
|
219
|
+
}, {
|
220
|
+
default: _withCtx(()=>[
|
221
|
+
_createVNode(_component_bk_radio_group, {
|
222
|
+
class: "g-radio-group",
|
223
|
+
modelValue: formData.value.level,
|
224
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event)=>formData.value.level = $event)
|
225
|
+
}, {
|
226
|
+
default: _withCtx(()=>[
|
227
|
+
(_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(DatasetDataReviewLevel), (value, key)=>{
|
228
|
+
return _openBlock(), _createBlock(_component_bk_radio_button, {
|
229
|
+
key: key,
|
230
|
+
label: value
|
231
|
+
}, {
|
232
|
+
default: _withCtx(()=>[
|
233
|
+
_createTextVNode(_toDisplayString(key), 1 /* TEXT */ )
|
234
|
+
]),
|
235
|
+
_: 2 /* DYNAMIC */
|
236
|
+
}, 1032 /* PROPS, DYNAMIC_SLOTS */ , [
|
237
|
+
"label"
|
238
|
+
]);
|
239
|
+
}), 128 /* KEYED_FRAGMENT */ ))
|
240
|
+
]),
|
241
|
+
_: 1 /* STABLE */
|
242
|
+
}, 8 /* PROPS */ , [
|
243
|
+
"modelValue"
|
244
|
+
])
|
245
|
+
]),
|
246
|
+
_: 1 /* STABLE */
|
247
|
+
})) : _createCommentVNode("v-if", true),
|
248
|
+
!formData.value.acceptAi ? (_openBlock(), _createBlock(_component_bk_form_item, {
|
249
|
+
key: 1,
|
250
|
+
label: "审核状态",
|
251
|
+
property: "accept",
|
252
|
+
required: ""
|
253
|
+
}, {
|
254
|
+
default: _withCtx(()=>[
|
255
|
+
_createVNode(_component_bk_radio_group, {
|
256
|
+
class: "g-radio-group",
|
257
|
+
modelValue: formData.value.accept,
|
258
|
+
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event)=>formData.value.accept = $event)
|
259
|
+
}, {
|
260
|
+
default: _withCtx(()=>[
|
261
|
+
_createVNode(_component_bk_radio_button, {
|
262
|
+
label: true
|
263
|
+
}, {
|
264
|
+
default: _withCtx(()=>_cache[8] || (_cache[8] = [
|
265
|
+
_createTextVNode(" 采纳 ")
|
266
|
+
])),
|
267
|
+
_: 1 /* STABLE */ ,
|
268
|
+
__: [
|
269
|
+
8
|
270
|
+
]
|
271
|
+
}),
|
272
|
+
_createVNode(_component_bk_radio_button, {
|
273
|
+
label: false
|
274
|
+
}, {
|
275
|
+
default: _withCtx(()=>_cache[9] || (_cache[9] = [
|
276
|
+
_createTextVNode(" 拒绝 ")
|
277
|
+
])),
|
278
|
+
_: 1 /* STABLE */ ,
|
279
|
+
__: [
|
280
|
+
9
|
281
|
+
]
|
282
|
+
})
|
283
|
+
]),
|
284
|
+
_: 1 /* STABLE */
|
285
|
+
}, 8 /* PROPS */ , [
|
286
|
+
"modelValue"
|
287
|
+
])
|
288
|
+
]),
|
289
|
+
_: 1 /* STABLE */
|
290
|
+
})) : _createCommentVNode("v-if", true),
|
291
|
+
!formData.value.acceptAi ? (_openBlock(), _createBlock(_component_bk_form_item, {
|
292
|
+
key: 2,
|
293
|
+
class: "g-last-form-item",
|
294
|
+
label: "审核备注",
|
295
|
+
property: "reviewReason"
|
296
|
+
}, {
|
297
|
+
default: _withCtx(()=>[
|
298
|
+
_createVNode(AutoHeightTextarea, {
|
299
|
+
modelValue: formData.value.reviewReason,
|
300
|
+
"onUpdate:modelValue": _cache[3] || (_cache[3] = ($event)=>formData.value.reviewReason = $event),
|
301
|
+
height: 100
|
302
|
+
}, null, 8 /* PROPS */ , [
|
303
|
+
"modelValue"
|
304
|
+
])
|
305
|
+
]),
|
306
|
+
_: 1 /* STABLE */
|
307
|
+
})) : _createCommentVNode("v-if", true)
|
308
|
+
]),
|
309
|
+
_: 1 /* STABLE */
|
310
|
+
}, 8 /* PROPS */ , [
|
311
|
+
"model"
|
312
|
+
])
|
313
|
+
])
|
314
|
+
]),
|
315
|
+
_: 1 /* STABLE */
|
316
|
+
}, 8 /* PROPS */ , [
|
317
|
+
"is-show"
|
318
|
+
]);
|
319
|
+
};
|
320
|
+
}
|
321
|
+
});
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import type { IDatasetData } from '@/types/dataset';
|
2
|
+
interface IProps {
|
3
|
+
modelValue: boolean;
|
4
|
+
datasetDatas: IDatasetData[];
|
5
|
+
datasetId: number;
|
6
|
+
apiPrefix: string;
|
7
|
+
spaceId?: string;
|
8
|
+
}
|
9
|
+
declare const _default: import("vue").DefineComponent<IProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
10
|
+
"update:modelValue": (value: boolean) => any;
|
11
|
+
"success-review": () => any;
|
12
|
+
}, string, import("vue").PublicProps, Readonly<IProps> & Readonly<{
|
13
|
+
"onUpdate:modelValue"?: (value: boolean) => any;
|
14
|
+
"onSuccess-review"?: () => any;
|
15
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
16
|
+
export default _default;
|