@kg-ui/kg-ui-plus 0.1.20 → 0.1.22
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/es/KgCopilot/CopiFooter/SearchInput/index.vue.mjs +1 -1
- package/dist/es/KgCopilot/CopiFooter/SearchInput/index.vue2.mjs +53 -34
- package/dist/es/KgCopilot/CopiFooter/SearchInput/index.vue3.mjs +2 -2
- package/dist/es/KgCopilot/dialogue/index.vue.mjs +1 -1
- package/dist/es/KgCopilot/dialogue/index.vue2.mjs +3 -2
- package/dist/es/KgCopilot/dialogue/index.vue3.mjs +2 -2
- package/dist/es/KgCopilot/dialogue/messageParse/index.vue.mjs +1 -1
- package/dist/es/KgCopilot/dialogue/messageParse/index.vue2.mjs +52 -42
- package/dist/es/KgCopilot/dialogue/messageParse/index.vue3.mjs +2 -2
- package/dist/es/KgCopilot/historyRecord/index.vue.mjs +7 -0
- package/dist/es/KgCopilot/historyRecord/index.vue2.mjs +142 -0
- package/dist/es/KgCopilot/historyRecord/index.vue3.mjs +4 -0
- package/dist/es/KgCopilot/index.vue.mjs +1 -1
- package/dist/es/KgCopilot/index.vue2.mjs +33 -7
- package/dist/es/KgCopilot/index.vue3.mjs +2 -2
- package/dist/es/api/copilot.mjs +55 -2
- package/dist/es/node_modules/.pnpm/@iconify-icons_ep@1.2.7/node_modules/@iconify-icons/ep/arrow-left.mjs +8 -0
- package/dist/es/node_modules/.pnpm/@iconify-icons_ep@1.2.7/node_modules/@iconify-icons/ep/arrow-right.mjs +8 -0
- package/dist/es/node_modules/.pnpm/@iconify-icons_ep@1.2.7/node_modules/@iconify-icons/ep/delete.mjs +8 -0
- package/dist/es/node_modules/.pnpm/@iconify-icons_ep@1.2.7/node_modules/@iconify-icons/ep/search.mjs +8 -0
- package/dist/es/store/modules/copilot.mjs +124 -7
- package/dist/es/style.css +1 -1
- package/dist/es/utils/copilot.mjs +2 -0
- package/dist/es/utils/home.mjs +1 -0
- package/dist/es/utils/http/index.mjs +7 -0
- package/package.json +123 -123
@@ -1,7 +1,7 @@
|
|
1
1
|
import _sfc_main from "./index.vue2.mjs";
|
2
2
|
import "./index.vue3.mjs";
|
3
3
|
import _export_sfc from "../../../_virtual/_plugin-vue_export-helper.mjs";
|
4
|
-
const SearchInput = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
4
|
+
const SearchInput = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-3215aa28"]]);
|
5
5
|
export {
|
6
6
|
SearchInput as default
|
7
7
|
};
|
@@ -8,7 +8,7 @@ import { plusParamToStr } from "../../../utils/copilot.mjs";
|
|
8
8
|
import data$2 from "../../../node_modules/.pnpm/@iconify-icons_ep@1.2.7/node_modules/@iconify-icons/ep/promotion.mjs";
|
9
9
|
import data from "../../../node_modules/.pnpm/@iconify-icons_ri@1.2.3/node_modules/@iconify-icons/ri/braces-line.mjs";
|
10
10
|
import data$1 from "../../../node_modules/.pnpm/@iconify-icons_ri@1.2.3/node_modules/@iconify-icons/ri/close-circle-line.mjs";
|
11
|
-
const _withScopeId = (n) => (pushScopeId("data-v-
|
11
|
+
const _withScopeId = (n) => (pushScopeId("data-v-3215aa28"), n = n(), popScopeId(), n);
|
12
12
|
const _hoisted_1 = { class: "control-contain" };
|
13
13
|
const _hoisted_2 = ["onClick"];
|
14
14
|
const _hoisted_3 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("svg", {
|
@@ -36,35 +36,44 @@ const _hoisted_9 = {
|
|
36
36
|
key: 0,
|
37
37
|
class: "flex justify-between items-center plugin-town"
|
38
38
|
};
|
39
|
-
const _hoisted_10 = { class: "" };
|
39
|
+
const _hoisted_10 = { class: "flex-none" };
|
40
40
|
const _hoisted_11 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("span", null, "已选智能体:", -1));
|
41
41
|
const _hoisted_12 = { style: { "font-weight": "600" } };
|
42
42
|
const _hoisted_13 = {
|
43
|
-
class: "flex items-center justify-end",
|
44
|
-
style: { "
|
43
|
+
class: "flex flex-grow items-center justify-end ml-2",
|
44
|
+
style: { "width": "0" }
|
45
45
|
};
|
46
46
|
const _hoisted_14 = { class: "p-2" };
|
47
47
|
const _hoisted_15 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("p", null, "参数提示", -1));
|
48
48
|
const _hoisted_16 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("line", null, null, -1));
|
49
49
|
const _hoisted_17 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("br", null, null, -1));
|
50
|
-
const _hoisted_18 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("
|
51
|
-
|
52
|
-
|
53
|
-
|
50
|
+
const _hoisted_18 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("svg", {
|
51
|
+
xmlns: "http://www.w3.org/2000/svg",
|
52
|
+
width: "1em",
|
53
|
+
height: "1em",
|
54
|
+
viewBox: "0 0 24 24",
|
55
|
+
class: "cursor-pointer w-[20px] h-[20px]"
|
56
|
+
}, [
|
57
|
+
/* @__PURE__ */ createElementVNode("path", {
|
58
|
+
fill: "currentColor",
|
59
|
+
d: "M10 2a4 4 0 0 0-4 4v3H3v2h3v7a2 2 0 0 1-2 2H3v2h1a4 4 0 0 0 4-4v-7h3V9H8V6a2 2 0 0 1 2-2h1V2zm5.202 14.997L11.891 21h2.595l2.014-2.434L18.514 21h2.595l-3.311-4.003L21.105 13h-2.596L16.5 15.428L14.491 13h-2.595z"
|
60
|
+
})
|
61
|
+
], -1));
|
54
62
|
const _hoisted_19 = [
|
55
63
|
_hoisted_18
|
56
64
|
];
|
57
65
|
const _hoisted_20 = ["innerHTML"];
|
58
|
-
const _hoisted_21 =
|
66
|
+
const _hoisted_21 = ["innerHTML"];
|
67
|
+
const _hoisted_22 = {
|
59
68
|
class: "input-row",
|
60
69
|
id: "copiFooter"
|
61
70
|
};
|
62
|
-
const
|
63
|
-
const
|
64
|
-
const
|
65
|
-
const
|
66
|
-
const
|
67
|
-
const
|
71
|
+
const _hoisted_23 = ["onKeydown"];
|
72
|
+
const _hoisted_24 = { class: "bottom-controls" };
|
73
|
+
const _hoisted_25 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("div", { class: "bottom-left-controls" }, null, -1));
|
74
|
+
const _hoisted_26 = { class: "bottom-right-controls" };
|
75
|
+
const _hoisted_27 = { class: "text-sum" };
|
76
|
+
const _hoisted_28 = {
|
68
77
|
key: 1,
|
69
78
|
class: "disable",
|
70
79
|
"click.stop": ""
|
@@ -403,14 +412,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
403
412
|
])
|
404
413
|
]),
|
405
414
|
default: withCtx(() => [
|
406
|
-
(
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
height: "1em",
|
411
|
-
viewBox: "0 0 24 24",
|
412
|
-
class: "cursor-pointer w-[20px] h-[20px]"
|
413
|
-
}, _hoisted_19, 4))
|
415
|
+
createElementVNode("span", {
|
416
|
+
class: "flex items-center",
|
417
|
+
style: normalizeStyle({ color: unref(pluginPayloadStr) === "" ? "" : "orange" })
|
418
|
+
}, _hoisted_19, 4)
|
414
419
|
]),
|
415
420
|
_: 1
|
416
421
|
}),
|
@@ -419,10 +424,24 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
419
424
|
class: "icon cursor-pointer w-[20px] h-[20px]",
|
420
425
|
icon: unref(data)
|
421
426
|
}, null, 8, ["icon"])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
422
|
-
|
423
|
-
class: "
|
424
|
-
|
425
|
-
|
427
|
+
createVNode(_component_el_tooltip, {
|
428
|
+
class: "box-item",
|
429
|
+
effect: "light",
|
430
|
+
"show-after": 300,
|
431
|
+
placement: "top"
|
432
|
+
}, {
|
433
|
+
content: withCtx(() => [
|
434
|
+
createElementVNode("div", { innerHTML: unref(pluginPayloadStr) }, null, 8, _hoisted_20)
|
435
|
+
]),
|
436
|
+
default: withCtx(() => [
|
437
|
+
createElementVNode("span", {
|
438
|
+
class: "cursor-pointer ml-2 mr-2 inline-block",
|
439
|
+
style: { "overflow": "hidden", "white-space": "nowrap", "text-overflow": "ellipsis" },
|
440
|
+
innerHTML: unref(pluginPayloadStr)
|
441
|
+
}, null, 8, _hoisted_21)
|
442
|
+
]),
|
443
|
+
_: 1
|
444
|
+
}),
|
426
445
|
createVNode(_component_IconifyIconOffline, {
|
427
446
|
class: "icon cursor-pointer w-[20px] h-[20px]",
|
428
447
|
icon: unref(data$1),
|
@@ -431,7 +450,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
431
450
|
], 64))
|
432
451
|
])
|
433
452
|
])) : createCommentVNode("", true),
|
434
|
-
createElementVNode("div",
|
453
|
+
createElementVNode("div", _hoisted_22, [
|
435
454
|
createElementVNode("div", {
|
436
455
|
ref_key: "coptInput",
|
437
456
|
ref: coptInput,
|
@@ -446,12 +465,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
446
465
|
],
|
447
466
|
onCompositionstart: handleCompositionStart,
|
448
467
|
onCompositionend: handleCompositionEnd
|
449
|
-
}, null, 40,
|
468
|
+
}, null, 40, _hoisted_23)
|
450
469
|
]),
|
451
|
-
createElementVNode("div",
|
452
|
-
|
453
|
-
createElementVNode("div",
|
454
|
-
createElementVNode("span",
|
470
|
+
createElementVNode("div", _hoisted_24, [
|
471
|
+
_hoisted_25,
|
472
|
+
createElementVNode("div", _hoisted_26, [
|
473
|
+
createElementVNode("span", _hoisted_27, [
|
455
474
|
createElementVNode("span", {
|
456
475
|
style: normalizeStyle({ color: unref(textLength) >= 2e3 ? "red" : "#666666" })
|
457
476
|
}, toDisplayString(unref(textLength)), 5),
|
@@ -471,7 +490,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
471
490
|
])
|
472
491
|
])
|
473
492
|
]),
|
474
|
-
unref(stopDialogue) ? (openBlock(), createElementBlock("div",
|
493
|
+
unref(stopDialogue) ? (openBlock(), createElementBlock("div", _hoisted_28)) : createCommentVNode("", true)
|
475
494
|
])
|
476
495
|
], 512);
|
477
496
|
};
|
@@ -1,4 +1,4 @@
|
|
1
|
-
const
|
1
|
+
const index_vue_vue_type_style_index_0_scoped_3215aa28_lang = "";
|
2
2
|
export {
|
3
|
-
|
3
|
+
index_vue_vue_type_style_index_0_scoped_3215aa28_lang as default
|
4
4
|
};
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import _sfc_main from "./index.vue2.mjs";
|
2
2
|
import "./index.vue3.mjs";
|
3
3
|
import _export_sfc from "../../_virtual/_plugin-vue_export-helper.mjs";
|
4
|
-
const dialogue = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
4
|
+
const dialogue = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-197eb540"]]);
|
5
5
|
export {
|
6
6
|
dialogue as default
|
7
7
|
};
|
@@ -6,7 +6,7 @@ import data$1 from "../../node_modules/.pnpm/@iconify-icons_ph@1.2.5/node_module
|
|
6
6
|
import data from "../../node_modules/.pnpm/@iconify-icons_ph@1.2.5/node_modules/@iconify-icons/ph/caret-down-fill.mjs";
|
7
7
|
import { useCopilotStoreHook } from "../../store/modules/copilot.mjs";
|
8
8
|
import { storeToRefs } from "pinia";
|
9
|
-
const _withScopeId = (n) => (pushScopeId("data-v-
|
9
|
+
const _withScopeId = (n) => (pushScopeId("data-v-197eb540"), n = n(), popScopeId(), n);
|
10
10
|
const _hoisted_1 = { class: "msg-head" };
|
11
11
|
const _hoisted_2 = { class: "msg-box" };
|
12
12
|
const _hoisted_3 = {
|
@@ -86,12 +86,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
86
86
|
createVNode(MessageParse, {
|
87
87
|
msgs: item.msgs,
|
88
88
|
plusName: item.plusName,
|
89
|
+
isHistory: item.isHistory,
|
89
90
|
onPrintOk: printOk,
|
90
91
|
isShrink: item.isShrink,
|
91
92
|
isPrinting: item.needPrinting,
|
92
93
|
"onUpdate:isPrinting": ($event) => item.needPrinting = $event,
|
93
94
|
scrollToBottom
|
94
|
-
}, null, 8, ["msgs", "plusName", "isShrink", "isPrinting", "onUpdate:isPrinting"])
|
95
|
+
}, null, 8, ["msgs", "plusName", "isHistory", "isShrink", "isPrinting", "onUpdate:isPrinting"])
|
95
96
|
])
|
96
97
|
], 2)
|
97
98
|
])
|
@@ -1,4 +1,4 @@
|
|
1
|
-
const
|
1
|
+
const index_vue_vue_type_style_index_0_scoped_197eb540_lang = "";
|
2
2
|
export {
|
3
|
-
|
3
|
+
index_vue_vue_type_style_index_0_scoped_197eb540_lang as default
|
4
4
|
};
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import _sfc_main from "./index.vue2.mjs";
|
2
2
|
import "./index.vue3.mjs";
|
3
3
|
import _export_sfc from "../../../_virtual/_plugin-vue_export-helper.mjs";
|
4
|
-
const MessageParse = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
4
|
+
const MessageParse = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-04eb43eb"]]);
|
5
5
|
export {
|
6
6
|
MessageParse as default
|
7
7
|
};
|
@@ -6,12 +6,11 @@ import { storeToRefs } from "pinia";
|
|
6
6
|
import { useVModel } from "../../../node_modules/.pnpm/@vueuse_core@9.13.0_vue@3.2.45/node_modules/@vueuse/core/index.mjs";
|
7
7
|
import FileBox from "./fileBox.vue.mjs";
|
8
8
|
const _hoisted_1 = {
|
9
|
-
key:
|
9
|
+
key: 1,
|
10
10
|
class: "cursor"
|
11
11
|
};
|
12
|
-
const _hoisted_2 = {
|
13
|
-
|
14
|
-
key: 3,
|
12
|
+
const _hoisted_2 = {
|
13
|
+
key: 1,
|
15
14
|
class: "cursor"
|
16
15
|
};
|
17
16
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
@@ -38,6 +37,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
38
37
|
plusName: {
|
39
38
|
type: String,
|
40
39
|
default: ""
|
40
|
+
},
|
41
|
+
isHistory: {
|
42
|
+
type: Boolean,
|
43
|
+
default: false
|
41
44
|
}
|
42
45
|
},
|
43
46
|
emits: ["update:isPrinting", "printOk", "update:msgs"],
|
@@ -57,12 +60,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
57
60
|
const current = ref(1);
|
58
61
|
const firstResIndex = ref(props.msgs.length);
|
59
62
|
const notResultDom = ref(null);
|
60
|
-
const dealHeight = (force) => {
|
63
|
+
const dealHeight = (force = false) => {
|
61
64
|
nextTick(() => {
|
62
65
|
if (!props.isShrink && props.plusName) {
|
63
66
|
notResultDom.value.style.height = "auto";
|
64
67
|
const height = notResultDom.value.clientHeight;
|
65
68
|
notResultDom.value.style.height = height + "px";
|
69
|
+
} else {
|
70
|
+
notResultDom.value.style.height = "auto";
|
66
71
|
}
|
67
72
|
});
|
68
73
|
props.scrollToBottom(force);
|
@@ -75,6 +80,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
75
80
|
if (current.value < props.msgs.length && !props.msgs[current.value - 1].needPrinting) {
|
76
81
|
current.value++;
|
77
82
|
}
|
83
|
+
},
|
84
|
+
{
|
85
|
+
immediate: true
|
78
86
|
}
|
79
87
|
);
|
80
88
|
const msgsVmodel = useVModel(props, "msgs", emits);
|
@@ -114,40 +122,42 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
114
122
|
return openBlock(), createElementBlock(Fragment, {
|
115
123
|
key: item.uuid
|
116
124
|
}, [
|
117
|
-
index < current.value
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
125
|
+
(index < current.value || props.isHistory) && !item.isResult ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
126
|
+
item.type === unref(DataType)[unref(DataType).text] ? (openBlock(), createBlock(ReadMd, {
|
127
|
+
key: 0,
|
128
|
+
text: item.content,
|
129
|
+
speed: item.speed,
|
130
|
+
scrollToBottom: dealHeight,
|
131
|
+
isPrinting: item.needPrinting,
|
132
|
+
"onUpdate:isPrinting": ($event) => item.needPrinting = $event,
|
133
|
+
onPrintOk: printOk
|
134
|
+
}, null, 8, ["text", "speed", "isPrinting", "onUpdate:isPrinting"])) : createCommentVNode("", true),
|
135
|
+
item.type === unref(DataType)[unref(DataType).edit] ? (openBlock(), createBlock(Edit, {
|
136
|
+
key: 1,
|
137
|
+
content: item.content,
|
138
|
+
scrollToBottom: dealHeight,
|
139
|
+
isPrinting: item.needPrinting,
|
140
|
+
"onUpdate:isPrinting": ($event) => item.needPrinting = $event,
|
141
|
+
onPrintOk: printOk
|
142
|
+
}, null, 8, ["content", "isPrinting", "onUpdate:isPrinting"])) : createCommentVNode("", true),
|
143
|
+
item.type === unref(DataType)[unref(DataType).file] ? (openBlock(), createBlock(FileBox, {
|
144
|
+
key: 2,
|
145
|
+
desc: item.content,
|
146
|
+
isPrinting: item.needPrinting,
|
147
|
+
"onUpdate:isPrinting": ($event) => item.needPrinting = $event,
|
148
|
+
onPrintOk: printOk
|
149
|
+
}, null, 8, ["desc", "isPrinting", "onUpdate:isPrinting"])) : createCommentVNode("", true)
|
150
|
+
], 64)) : createCommentVNode("", true),
|
141
151
|
props.isPrinting && index === current.value - 1 && !item.needPrinting && current.value <= firstResIndex.value ? (openBlock(), createElementBlock("span", _hoisted_1)) : createCommentVNode("", true)
|
142
152
|
], 64);
|
143
153
|
}), 128))
|
144
154
|
], 2),
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
}, [
|
150
|
-
|
155
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(props.msgs, (item, index) => {
|
156
|
+
return openBlock(), createElementBlock(Fragment, {
|
157
|
+
key: item.uuid
|
158
|
+
}, [
|
159
|
+
(index < current.value || props.isHistory) && item.isResult ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
160
|
+
item.type === unref(DataType)[unref(DataType).text] ? (openBlock(), createBlock(ReadMd, {
|
151
161
|
key: 0,
|
152
162
|
text: item.content,
|
153
163
|
speed: item.speed,
|
@@ -156,7 +166,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
156
166
|
"onUpdate:isPrinting": ($event) => item.needPrinting = $event,
|
157
167
|
onPrintOk: printOk
|
158
168
|
}, null, 8, ["text", "speed", "scrollToBottom", "isPrinting", "onUpdate:isPrinting"])) : createCommentVNode("", true),
|
159
|
-
|
169
|
+
item.type === unref(DataType)[unref(DataType).edit] ? (openBlock(), createBlock(Edit, {
|
160
170
|
key: 1,
|
161
171
|
content: item.content,
|
162
172
|
scrollToBottom: props.scrollToBottom,
|
@@ -164,17 +174,17 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
164
174
|
"onUpdate:isPrinting": ($event) => item.needPrinting = $event,
|
165
175
|
onPrintOk: printOk
|
166
176
|
}, null, 8, ["content", "scrollToBottom", "isPrinting", "onUpdate:isPrinting"])) : createCommentVNode("", true),
|
167
|
-
|
177
|
+
item.type === unref(DataType)[unref(DataType).file] ? (openBlock(), createBlock(FileBox, {
|
168
178
|
key: 2,
|
169
179
|
desc: item.content,
|
170
180
|
isPrinting: item.needPrinting,
|
171
181
|
"onUpdate:isPrinting": ($event) => item.needPrinting = $event,
|
172
182
|
onPrintOk: printOk
|
173
|
-
}, null, 8, ["desc", "isPrinting", "onUpdate:isPrinting"])) : createCommentVNode("", true)
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
183
|
+
}, null, 8, ["desc", "isPrinting", "onUpdate:isPrinting"])) : createCommentVNode("", true)
|
184
|
+
], 64)) : createCommentVNode("", true),
|
185
|
+
props.isPrinting && index === current.value - 1 && !item.needPrinting && current.value > firstResIndex.value ? (openBlock(), createElementBlock("span", _hoisted_2)) : createCommentVNode("", true)
|
186
|
+
], 64);
|
187
|
+
}), 128))
|
178
188
|
], 64);
|
179
189
|
};
|
180
190
|
}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
const
|
1
|
+
const index_vue_vue_type_style_index_0_scoped_04eb43eb_lang = "";
|
2
2
|
export {
|
3
|
-
|
3
|
+
index_vue_vue_type_style_index_0_scoped_04eb43eb_lang as default
|
4
4
|
};
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import _sfc_main from "./index.vue2.mjs";
|
2
|
+
import "./index.vue3.mjs";
|
3
|
+
import _export_sfc from "../../_virtual/_plugin-vue_export-helper.mjs";
|
4
|
+
const HistoryReport = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-69cfb39d"]]);
|
5
|
+
export {
|
6
|
+
HistoryReport as default
|
7
|
+
};
|
@@ -0,0 +1,142 @@
|
|
1
|
+
import { defineComponent, ref, computed, resolveComponent, openBlock, createElementBlock, createTextVNode, createElementVNode, createVNode, unref, withCtx, Fragment, renderList, normalizeClass, withDirectives, withModifiers, toDisplayString, vShow } from "vue";
|
2
|
+
import data$1 from "../../node_modules/.pnpm/@iconify-icons_ep@1.2.7/node_modules/@iconify-icons/ep/delete.mjs";
|
3
|
+
import data from "../../node_modules/.pnpm/@iconify-icons_ep@1.2.7/node_modules/@iconify-icons/ep/search.mjs";
|
4
|
+
import data$3 from "../../node_modules/.pnpm/@iconify-icons_ep@1.2.7/node_modules/@iconify-icons/ep/check.mjs";
|
5
|
+
import data$2 from "../../node_modules/.pnpm/@iconify-icons_ep@1.2.7/node_modules/@iconify-icons/ep/close.mjs";
|
6
|
+
import { ElMessageBox } from "element-plus";
|
7
|
+
import { useCopilotStoreHook } from "../../store/modules/copilot.mjs";
|
8
|
+
import { storeToRefs } from "pinia";
|
9
|
+
const _hoisted_1 = { class: "history" };
|
10
|
+
const _hoisted_2 = { class: "search_box" };
|
11
|
+
const _hoisted_3 = { class: "list_box" };
|
12
|
+
const _hoisted_4 = ["onClick"];
|
13
|
+
const _hoisted_5 = { class: "content" };
|
14
|
+
const _hoisted_6 = ["title", "onDblclick"];
|
15
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
16
|
+
__name: "index",
|
17
|
+
setup(__props) {
|
18
|
+
const copilotStore = useCopilotStoreHook();
|
19
|
+
const { historyList, currentHistoryRecord } = storeToRefs(copilotStore);
|
20
|
+
const { changeCurrentRecord, delHistoryRecord, updataHistoryName } = copilotStore;
|
21
|
+
const searchText = ref("");
|
22
|
+
let timeOut = null;
|
23
|
+
const changeActive = (item) => {
|
24
|
+
clearTimeout(timeOut);
|
25
|
+
timeOut = setTimeout(() => {
|
26
|
+
changeCurrentRecord(item);
|
27
|
+
}, 260);
|
28
|
+
};
|
29
|
+
const searchList = computed(() => {
|
30
|
+
return historyList.value.filter((item) => item.name.includes(searchText.value));
|
31
|
+
});
|
32
|
+
const deleteItem = (item) => {
|
33
|
+
ElMessageBox.confirm("删除后无法恢复,是否继续删除?", "提示", {
|
34
|
+
confirmButtonText: "确定",
|
35
|
+
cancelButtonText: "取消",
|
36
|
+
type: "warning"
|
37
|
+
}).then(() => {
|
38
|
+
delHistoryRecord(item);
|
39
|
+
}).catch(() => {
|
40
|
+
});
|
41
|
+
};
|
42
|
+
const deleteAll = () => {
|
43
|
+
ElMessageBox.confirm("删除后无法恢复,是否继续删除所有历史记录?", "提示", {
|
44
|
+
confirmButtonText: "确定",
|
45
|
+
cancelButtonText: "取消",
|
46
|
+
type: "warning"
|
47
|
+
}).then(() => {
|
48
|
+
delHistoryRecord({ isAll: true });
|
49
|
+
}).catch(() => {
|
50
|
+
});
|
51
|
+
};
|
52
|
+
const close = (item) => {
|
53
|
+
item.showInput = false;
|
54
|
+
};
|
55
|
+
const check = async (item) => {
|
56
|
+
await updataHistoryName({ sessionId: item.sessionId, name: item.editName });
|
57
|
+
item.showInput = false;
|
58
|
+
};
|
59
|
+
const toShowInput = (item) => {
|
60
|
+
clearTimeout(timeOut);
|
61
|
+
item.editName = item.name;
|
62
|
+
item.showInput = true;
|
63
|
+
};
|
64
|
+
return (_ctx, _cache) => {
|
65
|
+
const _component_IconifyIconOffline = resolveComponent("IconifyIconOffline");
|
66
|
+
const _component_el_input = resolveComponent("el-input");
|
67
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [
|
68
|
+
createTextVNode(" 历史记录 "),
|
69
|
+
createElementVNode("div", _hoisted_2, [
|
70
|
+
createVNode(_component_el_input, {
|
71
|
+
modelValue: searchText.value,
|
72
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => searchText.value = $event),
|
73
|
+
placeholder: "搜索历史纪录",
|
74
|
+
"suffix-icon": unref(data)
|
75
|
+
}, {
|
76
|
+
suffix: withCtx(() => [
|
77
|
+
createVNode(_component_IconifyIconOffline, { icon: unref(data) }, null, 8, ["icon"])
|
78
|
+
]),
|
79
|
+
_: 1
|
80
|
+
}, 8, ["modelValue", "suffix-icon"]),
|
81
|
+
createVNode(_component_IconifyIconOffline, {
|
82
|
+
class: "icon",
|
83
|
+
icon: unref(data$1),
|
84
|
+
onClick: deleteAll
|
85
|
+
}, null, 8, ["icon"])
|
86
|
+
]),
|
87
|
+
createElementVNode("div", _hoisted_3, [
|
88
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(searchList), (item) => {
|
89
|
+
return openBlock(), createElementBlock("div", {
|
90
|
+
key: item.name,
|
91
|
+
onClick: ($event) => changeActive(item),
|
92
|
+
class: normalizeClass({
|
93
|
+
list_item: true,
|
94
|
+
active: item.sessionId === unref(currentHistoryRecord).sessionId
|
95
|
+
})
|
96
|
+
}, [
|
97
|
+
createElementVNode("div", _hoisted_5, [
|
98
|
+
withDirectives(createElementVNode("span", {
|
99
|
+
title: item.name,
|
100
|
+
onDblclick: withModifiers(($event) => toShowInput(item), ["stop"])
|
101
|
+
}, toDisplayString(item.name), 41, _hoisted_6), [
|
102
|
+
[vShow, !item.showInput]
|
103
|
+
]),
|
104
|
+
withDirectives(createVNode(_component_el_input, {
|
105
|
+
modelValue: item.editName,
|
106
|
+
"onUpdate:modelValue": ($event) => item.editName = $event,
|
107
|
+
onClick: _cache[1] || (_cache[1] = withModifiers(() => {
|
108
|
+
}, ["stop"])),
|
109
|
+
spellcheck: "false"
|
110
|
+
}, {
|
111
|
+
suffix: withCtx(() => [
|
112
|
+
createVNode(_component_IconifyIconOffline, {
|
113
|
+
icon: unref(data$2),
|
114
|
+
class: "icon",
|
115
|
+
onClick: withModifiers(($event) => close(item), ["stop"])
|
116
|
+
}, null, 8, ["icon", "onClick"]),
|
117
|
+
createVNode(_component_IconifyIconOffline, {
|
118
|
+
class: "icon",
|
119
|
+
icon: unref(data$3),
|
120
|
+
onClick: withModifiers(($event) => check(item), ["stop"])
|
121
|
+
}, null, 8, ["icon", "onClick"])
|
122
|
+
]),
|
123
|
+
_: 2
|
124
|
+
}, 1032, ["modelValue", "onUpdate:modelValue"]), [
|
125
|
+
[vShow, item.showInput]
|
126
|
+
])
|
127
|
+
]),
|
128
|
+
createVNode(_component_IconifyIconOffline, {
|
129
|
+
class: "icon",
|
130
|
+
icon: unref(data$1),
|
131
|
+
onClick: withModifiers(($event) => deleteItem(item), ["stop"])
|
132
|
+
}, null, 8, ["icon", "onClick"])
|
133
|
+
], 10, _hoisted_4);
|
134
|
+
}), 128))
|
135
|
+
])
|
136
|
+
]);
|
137
|
+
};
|
138
|
+
}
|
139
|
+
});
|
140
|
+
export {
|
141
|
+
_sfc_main as default
|
142
|
+
};
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import _sfc_main from "./index.vue2.mjs";
|
2
2
|
import "./index.vue3.mjs";
|
3
3
|
import _export_sfc from "../_virtual/_plugin-vue_export-helper.mjs";
|
4
|
-
const KgCopilot = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
4
|
+
const KgCopilot = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-77f10b90"]]);
|
5
5
|
export {
|
6
6
|
KgCopilot as default
|
7
7
|
};
|
@@ -1,16 +1,23 @@
|
|
1
|
-
import { defineComponent, onMounted, watch, useSlots, openBlock, createElementBlock,
|
1
|
+
import { defineComponent, onMounted, watch, useSlots, ref, resolveComponent, openBlock, createElementBlock, withDirectives, createVNode, vShow, unref, createCommentVNode, createElementVNode, createSlots, renderList, withCtx, renderSlot, toRaw } from "vue";
|
2
2
|
import dialogue from "./dialogue/index.vue.mjs";
|
3
3
|
import "../style/tailwind.css.mjs";
|
4
4
|
import "../style/index.scss.mjs";
|
5
5
|
import CopiFooter from "./CopiFooter/index.vue.mjs";
|
6
6
|
import { useCopilotStoreHook } from "../store/modules/copilot.mjs";
|
7
7
|
import { storeToRefs } from "pinia";
|
8
|
+
import data$1 from "../node_modules/.pnpm/@iconify-icons_ep@1.2.7/node_modules/@iconify-icons/ep/arrow-right.mjs";
|
9
|
+
import data from "../node_modules/.pnpm/@iconify-icons_ep@1.2.7/node_modules/@iconify-icons/ep/arrow-left.mjs";
|
10
|
+
import HistoryReport from "./historyRecord/index.vue.mjs";
|
8
11
|
const _hoisted_1 = {
|
9
12
|
class: "wrap",
|
10
13
|
style: { "height": "100%" }
|
11
14
|
};
|
12
|
-
const _hoisted_2 = {
|
13
|
-
|
15
|
+
const _hoisted_2 = {
|
16
|
+
key: 0,
|
17
|
+
class: "left-wrap"
|
18
|
+
};
|
19
|
+
const _hoisted_3 = { class: "copilot-box" };
|
20
|
+
const _hoisted_4 = { class: "copilot-bottom-box" };
|
14
21
|
const __default__ = {
|
15
22
|
name: "KgCopilot"
|
16
23
|
};
|
@@ -24,7 +31,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
24
31
|
intelligentAnalysisConfig: null,
|
25
32
|
defaultDeal: null,
|
26
33
|
plugins: null,
|
27
|
-
pluginsPayload: null
|
34
|
+
pluginsPayload: null,
|
35
|
+
useHistoryRecord: { type: Boolean, default: false },
|
36
|
+
knowledgeToken: null
|
28
37
|
},
|
29
38
|
emits: ["cancleBtnEvent"],
|
30
39
|
setup(__props, { expose, emit }) {
|
@@ -41,7 +50,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
41
50
|
placeholder: props.placeholder,
|
42
51
|
intelligentAnalysisConfig: props.intelligentAnalysisConfig,
|
43
52
|
defaultDeal: props.defaultDeal,
|
44
|
-
pluginsPayload: props.pluginsPayload || {}
|
53
|
+
pluginsPayload: props.pluginsPayload || {},
|
54
|
+
useHistoryRecord: props.useHistoryRecord,
|
55
|
+
knowledgeToken: props.knowledgeToken
|
45
56
|
});
|
46
57
|
});
|
47
58
|
const getSearchText = () => {
|
@@ -67,9 +78,24 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
67
78
|
sendMsgAuto
|
68
79
|
});
|
69
80
|
const slots = useSlots();
|
81
|
+
const showHistoryList = ref(false);
|
82
|
+
const changeExpand = () => {
|
83
|
+
showHistoryList.value = !showHistoryList.value;
|
84
|
+
};
|
70
85
|
return (_ctx, _cache) => {
|
86
|
+
const _component_IconifyIconOffline = resolveComponent("IconifyIconOffline");
|
71
87
|
return openBlock(), createElementBlock("div", _hoisted_1, [
|
72
|
-
|
88
|
+
props.useHistoryRecord ? (openBlock(), createElementBlock("div", _hoisted_2, [
|
89
|
+
withDirectives(createVNode(HistoryReport, null, null, 512), [
|
90
|
+
[vShow, showHistoryList.value]
|
91
|
+
]),
|
92
|
+
createVNode(_component_IconifyIconOffline, {
|
93
|
+
class: "icon",
|
94
|
+
icon: showHistoryList.value ? unref(data) : unref(data$1),
|
95
|
+
onClick: changeExpand
|
96
|
+
}, null, 8, ["icon"])
|
97
|
+
])) : createCommentVNode("", true),
|
98
|
+
createElementVNode("div", _hoisted_3, [
|
73
99
|
createVNode(dialogue, null, createSlots({ _: 2 }, [
|
74
100
|
renderList(unref(slots), (item, key) => {
|
75
101
|
return {
|
@@ -80,7 +106,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
80
106
|
};
|
81
107
|
})
|
82
108
|
]), 1024),
|
83
|
-
createElementVNode("div",
|
109
|
+
createElementVNode("div", _hoisted_4, [
|
84
110
|
createVNode(CopiFooter, {
|
85
111
|
onCancleBtnEvent: _cache[0] || (_cache[0] = () => {
|
86
112
|
emit("cancleBtnEvent");
|