@blueking/ai-ui-sdk 0.1.12-beta.47 → 0.1.12-beta.48
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/chart-helper.d.ts +8 -1
- package/dist/common/chart-helper.ts.js +32 -9
- 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.vue.css +8 -8
- package/dist/components/render-auto-refresh/index.vue.js +1 -1
- package/dist/components/render-checkbox/index.vue.css +9 -9
- package/dist/components/render-checkbox/index.vue.js +1 -1
- package/dist/components/render-choose-tag/index.vue.css +7 -7
- package/dist/components/render-choose-tag/index.vue.js +1 -1
- package/dist/components/render-collapse/index.script.vue.js.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/dataset-data-level/index.script.vue.js.js +1 -1
- package/dist/components/render-dataset/components/dataset-data-tool-icons/index.script.vue.js +1 -1
- 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.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.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.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/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/api.vue.css +2 -2
- package/dist/components/render-dataset/components/plus-dataset-data/form/api.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 +2 -2
- package/dist/components/render-dataset/components/review-dataset-data/index.vue.css +10 -10
- package/dist/components/render-dataset/components/review-dataset-data/index.vue.js +1 -1
- 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/components/header.script.vue.js.js +1 -1
- package/dist/components/render-dataset-detail-origin-data/index.vue.css +3 -3
- 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/hooks/use-chat.ts.js +15 -3
- package/dist/hooks/use-session-http.d.ts +7 -1
- package/dist/hooks/use-session-http.ts.js +43 -15
- package/dist/http/fetch/index.d.ts +3 -0
- package/dist/http/fetch/index.ts.js +23 -5
- package/dist/types/common.d.ts +5 -0
- package/dist/types/session.d.ts +3 -0
- package/package.json +1 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
|
|
2
|
-
.dataset-data-api-endpoint[data-v-
|
|
2
|
+
.dataset-data-api-endpoint[data-v-wt2uhb03] {
|
|
3
3
|
line-height: 44px;
|
|
4
4
|
background: #F5F7FA;
|
|
5
5
|
border-radius: 2px;
|
|
6
6
|
padding: 0 12px;
|
|
7
7
|
}
|
|
8
|
-
[data-v-
|
|
8
|
+
[data-v-wt2uhb03] .dataset-data-api-demo .v-show-content {
|
|
9
9
|
padding: 0 !important;
|
|
10
10
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import script from './api.script.vue.js.js';
|
|
2
|
-
script.__scopeId = "data-v-
|
|
2
|
+
script.__scopeId = "data-v-wt2uhb03";
|
|
3
3
|
script.__file = "./src/components/render-dataset/components/plus-dataset-data/form/api.vue";
|
|
4
4
|
import './api.vue.css';
|
|
5
5
|
export default script;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import script from './footer.script.vue.js.js';
|
|
2
|
-
script.__scopeId = "data-v-
|
|
2
|
+
script.__scopeId = "data-v-jr92hmxo";
|
|
3
3
|
script.__file = "./src/components/render-dataset/components/plus-dataset-data/form/footer.vue";
|
|
4
4
|
import './footer.vue.css';
|
|
5
5
|
export default script;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
|
-
.plus-dataset-data[data-v-
|
|
2
|
+
.plus-dataset-data[data-v-gs726r3m] {
|
|
3
3
|
padding: 20px 24px;
|
|
4
4
|
}
|
|
5
|
-
.plus-dataset-sideslider[data-v-
|
|
5
|
+
.plus-dataset-sideslider[data-v-gs726r3m] .bk-modal-content {
|
|
6
6
|
scrollbar-gutter: inherit !important;
|
|
7
7
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import script from './index.script.vue.js.js';
|
|
2
|
-
script.__scopeId = "data-v-
|
|
2
|
+
script.__scopeId = "data-v-gs726r3m";
|
|
3
3
|
script.__file = "./src/components/render-dataset/components/plus-dataset-data/form/index.vue";
|
|
4
4
|
import './index.vue.css';
|
|
5
5
|
export default script;
|
package/dist/components/render-dataset/components/review-dataset-data/index.script.vue.js.js
CHANGED
|
@@ -290,7 +290,7 @@ export default /*@__PURE__*/ _defineComponent({
|
|
|
290
290
|
]),
|
|
291
291
|
_createElementVNode("section", _hoisted_4, [
|
|
292
292
|
_cache[9] || (_cache[9] = _createElementVNode("h5", {
|
|
293
|
-
class: "g-text-14 g-
|
|
293
|
+
class: "g-text-14 g-font-bold g-mb-12"
|
|
294
294
|
}, " 审核数据 ", -1 /* HOISTED */ )),
|
|
295
295
|
_createVNode(_component_bk_form, {
|
|
296
296
|
"form-type": "vertical",
|
|
@@ -322,7 +322,7 @@ export default /*@__PURE__*/ _defineComponent({
|
|
|
322
322
|
]),
|
|
323
323
|
_cache[6] || (_cache[6] = _createTextVNode(", 审核状态:")),
|
|
324
324
|
_createVNode(DatasetDataStatus, {
|
|
325
|
-
class: "g-
|
|
325
|
+
class: "g-font-bold",
|
|
326
326
|
status: (_unref_1 = _unref(tableData)[0]) === null || _unref_1 === void 0 ? void 0 : _unref_1.reviewStatus,
|
|
327
327
|
name: (_unref_2 = _unref(tableData)[0]) === null || _unref_2 === void 0 ? void 0 : _unref_2.reviewStatusName
|
|
328
328
|
}, null, 8 /* PROPS */ , [
|
|
@@ -1,41 +1,41 @@
|
|
|
1
1
|
|
|
2
|
-
.content[data-v-
|
|
2
|
+
.content[data-v-bm4t1qba] {
|
|
3
3
|
padding: 18px 24px 0;
|
|
4
4
|
height: 100%;
|
|
5
5
|
overflow: auto;
|
|
6
6
|
}
|
|
7
|
-
.data-set-review-slider .value-content[data-v-
|
|
7
|
+
.data-set-review-slider .value-content[data-v-bm4t1qba] {
|
|
8
8
|
padding: 16px;
|
|
9
9
|
border: 1px solid #DCDEE5;
|
|
10
10
|
line-height: 22px;
|
|
11
11
|
}
|
|
12
|
-
.data-set-review-slider .review-data[data-v-
|
|
12
|
+
.data-set-review-slider .review-data[data-v-bm4t1qba] {
|
|
13
13
|
height: calc(100% - 337px);
|
|
14
14
|
padding: 18px 24px;
|
|
15
15
|
}
|
|
16
|
-
.data-set-review-slider .review-level[data-v-
|
|
16
|
+
.data-set-review-slider .review-level[data-v-bm4t1qba] {
|
|
17
17
|
box-shadow: 0 -2px 4px 0 #1919291f;
|
|
18
18
|
height: 337px;
|
|
19
19
|
padding: 16px 24px 24px;
|
|
20
20
|
}
|
|
21
|
-
.data-set-review-slider .review-level .level-score[data-v-
|
|
21
|
+
.data-set-review-slider .review-level .level-score[data-v-bm4t1qba] {
|
|
22
22
|
gap: 50px;
|
|
23
23
|
}
|
|
24
|
-
.data-set-review-slider .review-level .level-score .bk-form-item[data-v-
|
|
24
|
+
.data-set-review-slider .review-level .level-score .bk-form-item[data-v-bm4t1qba] {
|
|
25
25
|
flex: 1;
|
|
26
26
|
}
|
|
27
|
-
.data-set-review-slider .bold-title[data-v-
|
|
27
|
+
.data-set-review-slider .bold-title[data-v-bm4t1qba] .bk-form-label {
|
|
28
28
|
font-weight: bold;
|
|
29
29
|
font-size: 14px;
|
|
30
30
|
}
|
|
31
|
-
.data-set-review-slider[data-v-
|
|
31
|
+
.data-set-review-slider[data-v-bm4t1qba] .bk-sideslider-title {
|
|
32
32
|
justify-content: space-between;
|
|
33
33
|
width: 100%;
|
|
34
34
|
}
|
|
35
|
-
.data-set-review-slider[data-v-
|
|
35
|
+
.data-set-review-slider[data-v-bm4t1qba] .bk-modal-content {
|
|
36
36
|
height: calc(100% - 100px) !important;
|
|
37
37
|
scrollbar-gutter: inherit !important;
|
|
38
38
|
}
|
|
39
|
-
.data-set-review-slider[data-v-
|
|
39
|
+
.data-set-review-slider[data-v-bm4t1qba] .bk-modal-content >div, .data-set-review-slider[data-v-bm4t1qba] .bk-modal-content .bk-sideslider-content {
|
|
40
40
|
height: 100%;
|
|
41
41
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import script from './index.script.vue.js.js';
|
|
2
|
-
script.__scopeId = "data-v-
|
|
2
|
+
script.__scopeId = "data-v-bm4t1qba";
|
|
3
3
|
script.__file = "./src/components/render-dataset/components/review-dataset-data/index.vue";
|
|
4
4
|
import './index.vue.css';
|
|
5
5
|
export default script;
|
|
@@ -87,7 +87,7 @@ export default /*@__PURE__*/ _defineComponent({
|
|
|
87
87
|
_createTextVNode(" " + _toDisplayString(handleGetDatasetStatusName(key)) + " ", 1 /* TEXT */ ),
|
|
88
88
|
_createElementVNode("span", {
|
|
89
89
|
class: _normalizeClass({
|
|
90
|
-
'g-
|
|
90
|
+
'g-font-bold': true,
|
|
91
91
|
'g-text-red': key === _unref(DatasetDataReviewLevel).D,
|
|
92
92
|
'g-text-green': [
|
|
93
93
|
_unref(DatasetDataReviewLevel).A,
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
|
|
2
|
-
.origin-data-content[data-v-
|
|
2
|
+
.origin-data-content[data-v-f3ge5p46] {
|
|
3
3
|
padding: 24px;
|
|
4
4
|
height: calc(100% - 52px - 44px);
|
|
5
5
|
}
|
|
6
|
-
.origin-data-panel[data-v-
|
|
6
|
+
.origin-data-panel[data-v-f3ge5p46] {
|
|
7
7
|
height: 100%;
|
|
8
8
|
padding: 20px;
|
|
9
9
|
background: #ffffff;
|
|
10
10
|
box-shadow: 0 2px 4px 0 #1919290d;
|
|
11
11
|
border-radius: 2px;
|
|
12
12
|
}
|
|
13
|
-
.origin-data-panel .toolbar-search[data-v-
|
|
13
|
+
.origin-data-panel .toolbar-search[data-v-f3ge5p46] {
|
|
14
14
|
width: 6.17rem;
|
|
15
15
|
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
|
|
2
|
-
.main-content[data-v-
|
|
2
|
+
.main-content[data-v-iy5dp6lv] {
|
|
3
3
|
padding: 20px 24px;
|
|
4
4
|
height: calc(100% - 52px);
|
|
5
5
|
}
|
|
6
|
-
.main-panel[data-v-
|
|
6
|
+
.main-panel[data-v-iy5dp6lv] {
|
|
7
7
|
height: 100%;
|
|
8
8
|
padding: 20px 24px 0;
|
|
9
9
|
background: #ffffff;
|
|
10
10
|
box-shadow: 0 2px 4px 0 #1919290d;
|
|
11
11
|
border-radius: 2px;
|
|
12
12
|
}
|
|
13
|
-
.main-search[data-v-
|
|
13
|
+
.main-search[data-v-iy5dp6lv] {
|
|
14
14
|
width: 6.17rem;
|
|
15
15
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
.expend-collapse-home[data-v-
|
|
2
|
+
.expend-collapse-home[data-v-4tt15h60] {
|
|
3
3
|
width: 16px;
|
|
4
4
|
height: 64px;
|
|
5
5
|
background: #DCDEE5;
|
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
cursor: pointer;
|
|
16
16
|
z-index: 1550;
|
|
17
17
|
}
|
|
18
|
-
.expend-collapse-home[data-v-
|
|
18
|
+
.expend-collapse-home[data-v-4tt15h60]:hover {
|
|
19
19
|
background: #979BA5;
|
|
20
20
|
}
|
|
21
|
-
.expend-collapse-home.is-close[data-v-
|
|
21
|
+
.expend-collapse-home.is-close[data-v-4tt15h60] {
|
|
22
22
|
left: 0;
|
|
23
23
|
}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
|
|
2
|
-
.upload-file-home[data-v-
|
|
2
|
+
.upload-file-home[data-v-71xkz4a4] {
|
|
3
3
|
position: relative;
|
|
4
4
|
background: #FFFFFF;
|
|
5
5
|
border: 1px solid #DCDEE5;
|
|
6
6
|
border-radius: 4px;
|
|
7
7
|
padding: 12px 12px 10px 12px;
|
|
8
8
|
}
|
|
9
|
-
.upload-file-home[data-v-
|
|
9
|
+
.upload-file-home[data-v-71xkz4a4]:hover {
|
|
10
10
|
border: 1px solid #3A84FF;
|
|
11
11
|
}
|
|
12
|
-
.upload-file-home:hover .file-icons[data-v-
|
|
12
|
+
.upload-file-home:hover .file-icons[data-v-71xkz4a4] {
|
|
13
13
|
display: flex;
|
|
14
14
|
}
|
|
15
|
-
.upload-file-home .file-icon[data-v-
|
|
15
|
+
.upload-file-home .file-icon[data-v-71xkz4a4] {
|
|
16
16
|
font-size: 32px;
|
|
17
17
|
}
|
|
18
|
-
.upload-file-home .file-content[data-v-
|
|
18
|
+
.upload-file-home .file-content[data-v-71xkz4a4] {
|
|
19
19
|
font-size: 12px;
|
|
20
20
|
flex: 1;
|
|
21
21
|
align-items: flex-start;
|
|
@@ -23,28 +23,28 @@
|
|
|
23
23
|
font-weight: normal;
|
|
24
24
|
width: 0;
|
|
25
25
|
}
|
|
26
|
-
.upload-file-home .file-content .file-name[data-v-
|
|
26
|
+
.upload-file-home .file-content .file-name[data-v-71xkz4a4] {
|
|
27
27
|
width: 100%;
|
|
28
28
|
font-size: 14px;
|
|
29
29
|
line-height: 20px;
|
|
30
30
|
}
|
|
31
|
-
.upload-file-home .file-content .file-size[data-v-
|
|
31
|
+
.upload-file-home .file-content .file-size[data-v-71xkz4a4] {
|
|
32
32
|
font-size: 12px;
|
|
33
33
|
color: #979BA5;
|
|
34
34
|
line-height: 20px;
|
|
35
35
|
}
|
|
36
|
-
.upload-file-home .file-icons[data-v-
|
|
36
|
+
.upload-file-home .file-icons[data-v-71xkz4a4] {
|
|
37
37
|
display: none;
|
|
38
38
|
color: #979BA5;
|
|
39
39
|
}
|
|
40
|
-
.upload-file-home .file-icons .bkaidev-icon[data-v-
|
|
40
|
+
.upload-file-home .file-icons .bkaidev-icon[data-v-71xkz4a4] {
|
|
41
41
|
cursor: pointer;
|
|
42
42
|
margin-right: 15px;
|
|
43
43
|
font-size: 16px;
|
|
44
44
|
}
|
|
45
|
-
.upload-file-home .file-icons .bkaidev-icon[data-v-
|
|
45
|
+
.upload-file-home .file-icons .bkaidev-icon[data-v-71xkz4a4]:hover {
|
|
46
46
|
color: #3A84FF;
|
|
47
47
|
}
|
|
48
|
-
.upload-file-home .file-icons .bkaidev-delete[data-v-
|
|
48
|
+
.upload-file-home .file-icons .bkaidev-delete[data-v-71xkz4a4] {
|
|
49
49
|
margin: 0;
|
|
50
50
|
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
|
|
2
|
-
.ai-ui-sdk-icon.ai-ui-sdk-pdf[data-v-
|
|
2
|
+
.ai-ui-sdk-icon.ai-ui-sdk-pdf[data-v-tjf682rr] {
|
|
3
3
|
color: #EA3636;
|
|
4
4
|
}
|
|
5
|
-
.ai-ui-sdk-icon.ai-ui-sdk-doc-2[data-v-
|
|
5
|
+
.ai-ui-sdk-icon.ai-ui-sdk-doc-2[data-v-tjf682rr], .ai-ui-sdk-icon.ai-ui-sdk-ppt-2[data-v-tjf682rr], .ai-ui-sdk-icon.ai-ui-sdk-markdown[data-v-tjf682rr] {
|
|
6
6
|
color: #3A84FF;
|
|
7
7
|
}
|
|
8
|
-
.ai-ui-sdk-icon.ai-ui-sdk-folder-fill[data-v-
|
|
8
|
+
.ai-ui-sdk-icon.ai-ui-sdk-folder-fill[data-v-tjf682rr] {
|
|
9
9
|
color: #C4C6CC;
|
|
10
10
|
}
|
|
11
|
-
.ai-ui-sdk-icon.ai-ui-sdk-excel[data-v-
|
|
11
|
+
.ai-ui-sdk-icon.ai-ui-sdk-excel[data-v-tjf682rr] {
|
|
12
12
|
color: #2DCB56;
|
|
13
13
|
}
|
|
14
|
-
.ai-ui-sdk-icon.ai-ui-sdk-wangye[data-v-
|
|
14
|
+
.ai-ui-sdk-icon.ai-ui-sdk-wangye[data-v-tjf682rr] {
|
|
15
15
|
color: #14A568;
|
|
16
16
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
.header-home[data-v-
|
|
2
|
+
.header-home[data-v-86b8fvqc] {
|
|
3
3
|
width: 100%;
|
|
4
4
|
height: 52px;
|
|
5
5
|
background: #FFFFFF;
|
|
@@ -7,14 +7,14 @@
|
|
|
7
7
|
position: relative;
|
|
8
8
|
z-index: 2;
|
|
9
9
|
}
|
|
10
|
-
.header-title[data-v-
|
|
10
|
+
.header-title[data-v-86b8fvqc] {
|
|
11
11
|
position: absolute;
|
|
12
12
|
left: 24px;
|
|
13
13
|
top: 14px;
|
|
14
14
|
font-size: 16px;
|
|
15
15
|
color: #313238;
|
|
16
16
|
}
|
|
17
|
-
.header-main[data-v-
|
|
17
|
+
.header-main[data-v-86b8fvqc] {
|
|
18
18
|
display: flex;
|
|
19
19
|
align-items: center;
|
|
20
20
|
justify-content: flex-end;
|
|
@@ -22,13 +22,13 @@
|
|
|
22
22
|
height: 100%;
|
|
23
23
|
margin: 0 auto;
|
|
24
24
|
}
|
|
25
|
-
.header-select[data-v-
|
|
25
|
+
.header-select[data-v-86b8fvqc] {
|
|
26
26
|
width: 300px;
|
|
27
27
|
margin-right: 8px;
|
|
28
28
|
z-index: 9;
|
|
29
29
|
font-size: 12px;
|
|
30
30
|
}
|
|
31
|
-
.header-input[data-v-
|
|
31
|
+
.header-input[data-v-86b8fvqc] {
|
|
32
32
|
width: 300px;
|
|
33
33
|
font-size: 12px;
|
|
34
34
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
|
|
2
|
-
.router-tab[data-v-
|
|
2
|
+
.router-tab[data-v-fxcvhsbp] {
|
|
3
3
|
margin-top: 2px;
|
|
4
4
|
height: 42px;
|
|
5
5
|
background: #FFFFFF;
|
|
6
6
|
box-shadow: 0 2px 4px 0 #1919290d;
|
|
7
7
|
padding: 0 45px;
|
|
8
8
|
}
|
|
9
|
-
.router-tab a[data-v-
|
|
9
|
+
.router-tab a[data-v-fxcvhsbp] {
|
|
10
10
|
padding: 0 8px;
|
|
11
11
|
margin-right: 24px;
|
|
12
12
|
font-size: 14px;
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
color: #4D4F56;
|
|
16
16
|
box-sizing: border-box;
|
|
17
17
|
}
|
|
18
|
-
.router-tab a.router-link-exact-active[data-v-
|
|
18
|
+
.router-tab a.router-link-exact-active[data-v-fxcvhsbp] {
|
|
19
19
|
color: #3A84FF;
|
|
20
20
|
border-bottom: 2px solid #3A84FF;
|
|
21
21
|
}
|
|
@@ -90,7 +90,12 @@ import { HttpErrorCode, SessionContentRole, SessionContentStatus } from '../type
|
|
|
90
90
|
// ai 聊天
|
|
91
91
|
export const useChat = ({ handleStart, handleText, handleReferenceDoc, handleThink, handleEnd, handleError, requestOptions, otherOptions })=>{
|
|
92
92
|
// 创建一个变量保存当前的API实现
|
|
93
|
-
let apiImpl = useSessionHttp(
|
|
93
|
+
let apiImpl = useSessionHttp({
|
|
94
|
+
apiPrefix: requestOptions.url,
|
|
95
|
+
headers: requestOptions.headers,
|
|
96
|
+
beforeRequest: requestOptions.beforeRequest,
|
|
97
|
+
afterRequest: requestOptions.afterRequest
|
|
98
|
+
});
|
|
94
99
|
// start message
|
|
95
100
|
const startMessage = '内容正在生成中...';
|
|
96
101
|
// 用 ref 存储 requestOptions,使其可更新
|
|
@@ -213,7 +218,9 @@ export const useChat = ({ handleStart, handleText, handleReferenceDoc, handleThi
|
|
|
213
218
|
handleReferenceDoc: handleReferenceDocChat,
|
|
214
219
|
handleThink: handleThinkChat,
|
|
215
220
|
handleEnd: handleEndChat,
|
|
216
|
-
handleError: handleErrorChat
|
|
221
|
+
handleError: handleErrorChat,
|
|
222
|
+
beforeRequest: requestOptions.beforeRequest,
|
|
223
|
+
afterRequest: requestOptions.afterRequest
|
|
217
224
|
});
|
|
218
225
|
// 更新 requestOptions 的方法
|
|
219
226
|
function updateRequestOptions(newOptions) {
|
|
@@ -221,7 +228,12 @@ export const useChat = ({ handleStart, handleText, handleReferenceDoc, handleThi
|
|
|
221
228
|
currentRequestOptions.value = _object_spread({}, currentRequestOptions.value, newOptions);
|
|
222
229
|
// 如果 URL 变更,重新获取 API
|
|
223
230
|
if (newOptions.url || newOptions.headers) {
|
|
224
|
-
apiImpl = useSessionHttp(
|
|
231
|
+
apiImpl = useSessionHttp({
|
|
232
|
+
apiPrefix: currentRequestOptions.value.url,
|
|
233
|
+
headers: currentRequestOptions.value.headers,
|
|
234
|
+
beforeRequest: currentRequestOptions.value.beforeRequest,
|
|
235
|
+
afterRequest: currentRequestOptions.value.afterRequest
|
|
236
|
+
});
|
|
225
237
|
}
|
|
226
238
|
}
|
|
227
239
|
// 新增 db
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
+
import type { RequestHookData } from '@/types/common';
|
|
1
2
|
import type { ISession, ISessionContent } from '@/types/session';
|
|
2
|
-
export declare const useSessionHttp: (apiPrefix
|
|
3
|
+
export declare const useSessionHttp: ({ apiPrefix, headers, beforeRequest, afterRequest, }: {
|
|
4
|
+
apiPrefix: string;
|
|
5
|
+
headers?: Record<string, string>;
|
|
6
|
+
beforeRequest?: (data: RequestHookData) => RequestHookData;
|
|
7
|
+
afterRequest?: (data: RequestHookData, response: Response) => void;
|
|
8
|
+
}) => {
|
|
3
9
|
getAgentInfo: () => Promise<import("@/types/agent").IAgentInfo>;
|
|
4
10
|
clearSession: (sessionCode: string) => Promise<unknown>;
|
|
5
11
|
getSessions: () => Promise<ISession[]>;
|
|
@@ -2,68 +2,96 @@ import fetch from '../http/fetch/index.ts.js';
|
|
|
2
2
|
import { transferAgentInfoApi2AgentInfo } from '../http/helper/agent.ts.js';
|
|
3
3
|
import { transferSession2SessionApi, transferSessionApi2Session, transferSessionContent2SessionContentApi, transferSessionContentApi2SessionContent } from '../http/helper/session.ts.js';
|
|
4
4
|
// session 相关接口
|
|
5
|
-
export const useSessionHttp = (apiPrefix, headers)=>{
|
|
5
|
+
export const useSessionHttp = ({ apiPrefix, headers, beforeRequest, afterRequest })=>{
|
|
6
6
|
// 获取 agent 信息
|
|
7
7
|
const getAgentInfo = ()=>fetch.get(`${apiPrefix}/agent/info/`, undefined, {
|
|
8
|
-
headers
|
|
8
|
+
headers,
|
|
9
|
+
beforeRequest,
|
|
10
|
+
afterRequest
|
|
9
11
|
}).then((res)=>transferAgentInfoApi2AgentInfo(res));
|
|
10
12
|
// 清除聊天上下文
|
|
11
13
|
const clearSession = (sessionCode)=>fetch.post(`${apiPrefix}/chat_completion/${sessionCode}/clear/`, undefined, {
|
|
12
|
-
headers
|
|
14
|
+
headers,
|
|
15
|
+
beforeRequest,
|
|
16
|
+
afterRequest
|
|
13
17
|
});
|
|
14
18
|
// 获取会话列表
|
|
15
19
|
const getSessions = ()=>fetch.get(`${apiPrefix}/session/`, undefined, {
|
|
16
|
-
headers
|
|
20
|
+
headers,
|
|
21
|
+
beforeRequest,
|
|
22
|
+
afterRequest
|
|
17
23
|
}).then((res)=>res.map(transferSessionApi2Session));
|
|
18
24
|
// 新增会话
|
|
19
25
|
const plusSession = (data)=>fetch.post(`${apiPrefix}/session/`, transferSession2SessionApi(data), {
|
|
20
|
-
headers
|
|
26
|
+
headers,
|
|
27
|
+
beforeRequest,
|
|
28
|
+
afterRequest
|
|
21
29
|
}).then((res)=>transferSessionApi2Session(res));
|
|
22
30
|
// 修改会话
|
|
23
31
|
const modifySession = (data)=>fetch.put(`${apiPrefix}/session/${data.sessionCode}/`, transferSession2SessionApi(data), {
|
|
24
|
-
headers
|
|
32
|
+
headers,
|
|
33
|
+
beforeRequest,
|
|
34
|
+
afterRequest
|
|
25
35
|
}).then((res)=>transferSessionApi2Session(res));
|
|
26
36
|
// 删除会话
|
|
27
37
|
const deleteSession = (sessionCode)=>fetch.delete(`${apiPrefix}/session/${sessionCode}/`, undefined, {
|
|
28
|
-
headers
|
|
38
|
+
headers,
|
|
39
|
+
beforeRequest,
|
|
40
|
+
afterRequest
|
|
29
41
|
});
|
|
30
42
|
// 批量删除会话
|
|
31
43
|
const batchDeleteSessions = (sessionCodes)=>fetch.post(`${apiPrefix}/session/batch_delete/`, {
|
|
32
44
|
session_codes: sessionCodes
|
|
33
45
|
}, {
|
|
34
|
-
headers
|
|
46
|
+
headers,
|
|
47
|
+
beforeRequest,
|
|
48
|
+
afterRequest
|
|
35
49
|
});
|
|
36
50
|
// 获取会话资源
|
|
37
51
|
const getSession = (sessionCode)=>fetch.get(`${apiPrefix}/session/${sessionCode}/`, undefined, {
|
|
38
|
-
headers
|
|
52
|
+
headers,
|
|
53
|
+
beforeRequest,
|
|
54
|
+
afterRequest
|
|
39
55
|
}).then((res)=>transferSessionApi2Session(res));
|
|
40
56
|
// 获取会话内容列表
|
|
41
57
|
const getSessionContents = (sessionCode)=>fetch.get(`${apiPrefix}/session_content/content/`, {
|
|
42
58
|
session_code: sessionCode
|
|
43
59
|
}, {
|
|
44
|
-
headers
|
|
60
|
+
headers,
|
|
61
|
+
beforeRequest,
|
|
62
|
+
afterRequest
|
|
45
63
|
}).then((res)=>res.map(transferSessionContentApi2SessionContent));
|
|
46
64
|
// 新增会话内容
|
|
47
65
|
const plusSessionContent = (data)=>fetch.post(`${apiPrefix}/session_content/`, transferSessionContent2SessionContentApi(data), {
|
|
48
|
-
headers
|
|
66
|
+
headers,
|
|
67
|
+
beforeRequest,
|
|
68
|
+
afterRequest
|
|
49
69
|
});
|
|
50
70
|
// 修改会话内容
|
|
51
71
|
const modifySessionContent = (data)=>fetch.put(`${apiPrefix}/session_content/${data.id}/`, transferSessionContent2SessionContentApi(data), {
|
|
52
|
-
headers
|
|
72
|
+
headers,
|
|
73
|
+
beforeRequest,
|
|
74
|
+
afterRequest
|
|
53
75
|
});
|
|
54
76
|
// 删除会话内容
|
|
55
77
|
const deleteSessionContent = (id)=>fetch.delete(`${apiPrefix}/session_content/${id}/`, undefined, {
|
|
56
|
-
headers
|
|
78
|
+
headers,
|
|
79
|
+
beforeRequest,
|
|
80
|
+
afterRequest
|
|
57
81
|
});
|
|
58
82
|
// 批量删除聊天内容
|
|
59
83
|
const batchDeleteSessionContents = (ids)=>fetch.post(`${apiPrefix}/session_content/batch_delete/`, {
|
|
60
84
|
ids
|
|
61
85
|
}, {
|
|
62
|
-
headers
|
|
86
|
+
headers,
|
|
87
|
+
beforeRequest,
|
|
88
|
+
afterRequest
|
|
63
89
|
});
|
|
64
90
|
// 会话重命名
|
|
65
91
|
const renameSession = (sessionCode)=>fetch.post(`${apiPrefix}/session/${sessionCode}/ai_rename/`, undefined, {
|
|
66
|
-
headers
|
|
92
|
+
headers,
|
|
93
|
+
beforeRequest,
|
|
94
|
+
afterRequest
|
|
67
95
|
}).then((res)=>({
|
|
68
96
|
sessionCode: res.session_code,
|
|
69
97
|
sessionName: res.session_name
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { RequestHookData } from '@/types/common';
|
|
1
2
|
export interface IFetchConfig extends RequestInit {
|
|
2
3
|
requestType?: 'json' | 'formData';
|
|
3
4
|
responseType?: 'json' | 'text' | 'formData' | 'file' | 'blob';
|
|
@@ -5,6 +6,8 @@ export interface IFetchConfig extends RequestInit {
|
|
|
5
6
|
signal?: AbortSignal;
|
|
6
7
|
withoutSpace?: boolean;
|
|
7
8
|
noCheckPermission?: boolean;
|
|
9
|
+
beforeRequest?: (data: RequestHookData) => RequestHookData | undefined;
|
|
10
|
+
afterRequest?: (data: RequestHookData, response: Response) => void;
|
|
8
11
|
}
|
|
9
12
|
type HttpMethod = <T>(url: string, payload?: any, config?: IFetchConfig) => Promise<T>;
|
|
10
13
|
interface IHttp {
|