@kg-ui/kg-ui-plus 0.1.19 → 0.1.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/README.md +3 -3
- package/dist/es/KgCopilot/CopiContent/AnswerHead.vue.mjs +1 -1
- package/dist/es/KgCopilot/CopiContent/AnswerHead.vue2.mjs +1 -1
- package/dist/es/KgCopilot/CopiContent/AnswerHead.vue3.mjs +2 -2
- package/dist/es/KgCopilot/CopiContent/UserHead.vue.mjs +2 -2
- package/dist/es/KgCopilot/CopiContent/UserHead.vue2.mjs +2 -2
- package/dist/es/KgCopilot/CopiFooter/SearchInput/NewTheme.vue.mjs +1 -1
- package/dist/es/KgCopilot/CopiFooter/SearchInput/NewTheme.vue2.mjs +1 -1
- package/dist/es/KgCopilot/CopiFooter/SearchInput/NewTheme.vue3.mjs +2 -2
- package/dist/es/KgCopilot/CopiFooter/SearchInput/SelectPluginByKey.vue.mjs +1 -1
- package/dist/es/KgCopilot/CopiFooter/SearchInput/SelectPluginByKey.vue3.mjs +2 -2
- package/dist/es/KgCopilot/CopiFooter/SearchInput/index.vue.mjs +1 -1
- package/dist/es/KgCopilot/CopiFooter/SearchInput/index.vue2.mjs +107 -31
- package/dist/es/KgCopilot/CopiFooter/SearchInput/index.vue3.mjs +2 -2
- package/dist/es/KgCopilot/CopiFooter/index.vue.mjs +1 -1
- package/dist/es/KgCopilot/CopiFooter/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/edit.vue.mjs +1 -1
- package/dist/es/KgCopilot/dialogue/messageParse/edit.vue3.mjs +2 -2
- package/dist/es/KgCopilot/dialogue/messageParse/fileBox.vue.mjs +1 -1
- package/dist/es/KgCopilot/dialogue/messageParse/fileBox.vue2.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/dialogue/messageParse/readMd.vue.mjs +1 -1
- package/dist/es/KgCopilot/dialogue/messageParse/readMd.vue2.mjs +2 -2
- package/dist/es/KgCopilot/dialogue/messageParse/readMd.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 +44 -9
- package/dist/es/KgCopilot/index.vue3.mjs +2 -2
- package/dist/es/api/copilot.mjs +55 -2
- package/dist/es/home/LFilter/FilterArea.vue.mjs +1 -1
- package/dist/es/home/LFilter/FilterArea.vue2.mjs +1 -1
- package/dist/es/home/LFilter/FilterArea.vue3.mjs +2 -2
- package/dist/es/home/LFilter/FilterItem.vue.mjs +1 -1
- package/dist/es/home/LFilter/FilterItem.vue2.mjs +1 -1
- package/dist/es/home/LFilter/FilterItem.vue3.mjs +2 -2
- package/dist/es/home/LFilter/FilterItemIcon.vue.mjs +1 -1
- package/dist/es/home/LFilter/FilterItemIcon.vue2.mjs +1 -1
- package/dist/es/home/LFilter/FilterItemIcon.vue3.mjs +2 -2
- package/dist/es/home/LProject/index.vue.mjs +1 -1
- package/dist/es/home/LProject/index.vue3.mjs +2 -2
- package/dist/es/home/index.vue.mjs +1 -1
- package/dist/es/home/index.vue3.mjs +2 -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/node_modules/.pnpm/@iconify-icons_ri@1.2.3/node_modules/@iconify-icons/ri/braces-line.mjs +8 -0
- package/dist/es/node_modules/.pnpm/@iconify-icons_ri@1.2.3/node_modules/@iconify-icons/ri/close-circle-line.mjs +8 -0
- package/dist/es/node_modules/.pnpm/{dompurify@3.0.10 → dompurify@3.1.5}/node_modules/dompurify/dist/purify.es.mjs +48 -11
- package/dist/es/node_modules/.pnpm/{marked@12.0.1 → marked@12.0.2}/node_modules/marked/lib/marked.esm.mjs +2 -1
- package/dist/es/store/modules/copilot.mjs +158 -5
- package/dist/es/style.css +1 -1
- package/dist/es/utils/copilot.mjs +25 -0
- package/dist/es/utils/home.mjs +1 -0
- package/dist/es/utils/http/index.mjs +7 -0
- package/package.json +123 -123
@@ -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
|
};
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import _sfc_main from "./readMd.vue2.mjs";
|
2
2
|
import "./readMd.vue3.mjs";
|
3
3
|
import _export_sfc from "../../../_virtual/_plugin-vue_export-helper.mjs";
|
4
|
-
const ReadMd = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
4
|
+
const ReadMd = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-25449f8b"]]);
|
5
5
|
export {
|
6
6
|
ReadMd as default
|
7
7
|
};
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { defineComponent, ref, computed, watch, onMounted, resolveDirective, openBlock, createElementBlock, withDirectives, createElementVNode, unref } from "vue";
|
2
|
-
import purify from "../../../node_modules/.pnpm/dompurify@3.
|
3
|
-
import { marked } from "../../../node_modules/.pnpm/marked@12.0.
|
2
|
+
import purify from "../../../node_modules/.pnpm/dompurify@3.1.5/node_modules/dompurify/dist/purify.es.mjs";
|
3
|
+
import { marked } from "../../../node_modules/.pnpm/marked@12.0.2/node_modules/marked/lib/marked.esm.mjs";
|
4
4
|
import isInCode from "./mdInCode.mjs";
|
5
5
|
import { useCopilotStoreHook } from "../../../store/modules/copilot.mjs";
|
6
6
|
import { storeToRefs } from "pinia";
|
@@ -1,4 +1,4 @@
|
|
1
|
-
const
|
1
|
+
const readMd_vue_vue_type_style_index_0_scoped_25449f8b_lang = "";
|
2
2
|
export {
|
3
|
-
|
3
|
+
readMd_vue_vue_type_style_index_0_scoped_25449f8b_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,36 +1,46 @@
|
|
1
|
-
import { defineComponent, onMounted, 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
|
};
|
17
24
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
18
25
|
...__default__,
|
19
26
|
props: {
|
20
|
-
plugins: null,
|
21
27
|
initText: { default: "你好,我是AI智能助手,如有任何需要,请随时告诉我,我会尽力为您提供帮助。" },
|
22
28
|
aiName: { default: "Copilot" },
|
23
29
|
placeholder: { default: "输入“@”选择智能体,可通过上下键切换智能体选项,回车选中。" },
|
24
30
|
maxSendNum: { default: 0 },
|
25
31
|
intelligentAnalysisConfig: null,
|
26
|
-
defaultDeal: null
|
32
|
+
defaultDeal: null,
|
33
|
+
plugins: null,
|
34
|
+
pluginsPayload: null,
|
35
|
+
useHistoryRecord: { type: Boolean, default: false },
|
36
|
+
knowledgeToken: null
|
27
37
|
},
|
28
38
|
emits: ["cancleBtnEvent"],
|
29
39
|
setup(__props, { expose, emit }) {
|
30
40
|
const props = __props;
|
31
41
|
const CopilotStore = useCopilotStoreHook();
|
32
42
|
const { searchText, msgList } = storeToRefs(CopilotStore);
|
33
|
-
const { initCopilot, setSearchText, sendMsg } = CopilotStore;
|
43
|
+
const { initCopilot, setSearchText, sendMsg, setPluginsPayload } = CopilotStore;
|
34
44
|
onMounted(() => {
|
35
45
|
initCopilot({
|
36
46
|
plugins: props.plugins,
|
@@ -39,7 +49,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
39
49
|
maxSendNum: props.maxSendNum,
|
40
50
|
placeholder: props.placeholder,
|
41
51
|
intelligentAnalysisConfig: props.intelligentAnalysisConfig,
|
42
|
-
defaultDeal: props.defaultDeal
|
52
|
+
defaultDeal: props.defaultDeal,
|
53
|
+
pluginsPayload: props.pluginsPayload || {},
|
54
|
+
useHistoryRecord: props.useHistoryRecord,
|
55
|
+
knowledgeToken: props.knowledgeToken
|
43
56
|
});
|
44
57
|
});
|
45
58
|
const getSearchText = () => {
|
@@ -51,6 +64,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
51
64
|
const sendMsgAuto = (str) => {
|
52
65
|
sendMsg(str);
|
53
66
|
};
|
67
|
+
watch(
|
68
|
+
() => props.pluginsPayload,
|
69
|
+
(newValue) => {
|
70
|
+
setPluginsPayload(newValue);
|
71
|
+
},
|
72
|
+
{ immediate: true, deep: true }
|
73
|
+
);
|
54
74
|
expose({
|
55
75
|
getSearchText,
|
56
76
|
setSearchText,
|
@@ -58,9 +78,24 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
58
78
|
sendMsgAuto
|
59
79
|
});
|
60
80
|
const slots = useSlots();
|
81
|
+
const showHistoryList = ref(false);
|
82
|
+
const changeExpand = () => {
|
83
|
+
showHistoryList.value = !showHistoryList.value;
|
84
|
+
};
|
61
85
|
return (_ctx, _cache) => {
|
86
|
+
const _component_IconifyIconOffline = resolveComponent("IconifyIconOffline");
|
62
87
|
return openBlock(), createElementBlock("div", _hoisted_1, [
|
63
|
-
|
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, [
|
64
99
|
createVNode(dialogue, null, createSlots({ _: 2 }, [
|
65
100
|
renderList(unref(slots), (item, key) => {
|
66
101
|
return {
|
@@ -71,7 +106,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
71
106
|
};
|
72
107
|
})
|
73
108
|
]), 1024),
|
74
|
-
createElementVNode("div",
|
109
|
+
createElementVNode("div", _hoisted_4, [
|
75
110
|
createVNode(CopiFooter, {
|
76
111
|
onCancleBtnEvent: _cache[0] || (_cache[0] = () => {
|
77
112
|
emit("cancleBtnEvent");
|
@@ -1,4 +1,4 @@
|
|
1
|
-
const
|
1
|
+
const index_vue_vue_type_style_index_0_scoped_77f10b90_lang = "";
|
2
2
|
export {
|
3
|
-
|
3
|
+
index_vue_vue_type_style_index_0_scoped_77f10b90_lang as default
|
4
4
|
};
|
package/dist/es/api/copilot.mjs
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import "../utils/http/index.mjs";
|
1
|
+
import { http } from "../utils/http/index.mjs";
|
2
2
|
import { fetchEventSource } from "../node_modules/.pnpm/@microsoft_fetch-event-source@2.0.1/node_modules/@microsoft/fetch-event-source/lib/esm/fetch.mjs";
|
3
3
|
const getReport = (param) => {
|
4
4
|
const controller = new AbortController();
|
@@ -32,6 +32,59 @@ const getReport = (param) => {
|
|
32
32
|
controller.abort();
|
33
33
|
};
|
34
34
|
};
|
35
|
+
const getHistoryRecordList = (data = {}) => {
|
36
|
+
return http.request("get", "/api/chatHistory/list", {
|
37
|
+
data,
|
38
|
+
timeout: 6e4
|
39
|
+
});
|
40
|
+
};
|
41
|
+
const createHistoryRecord = (data) => {
|
42
|
+
return http.request("post", "/api/chatHistory/session", {
|
43
|
+
data,
|
44
|
+
timeout: 6e4
|
45
|
+
});
|
46
|
+
};
|
47
|
+
const deleteHistoryRecord = (params) => {
|
48
|
+
return http.request(
|
49
|
+
"delete",
|
50
|
+
"/api/chatHistory/session",
|
51
|
+
{
|
52
|
+
params,
|
53
|
+
timeout: 6e4
|
54
|
+
}
|
55
|
+
);
|
56
|
+
};
|
57
|
+
const updataHistoryInfo = (data) => {
|
58
|
+
return http.request("patch", "/api/chatHistory/info", {
|
59
|
+
data,
|
60
|
+
timeout: 6e4
|
61
|
+
});
|
62
|
+
};
|
63
|
+
const createHistoryInfo = (data) => {
|
64
|
+
return http.request("post", "/api/chatHistory/info", {
|
65
|
+
data,
|
66
|
+
timeout: 6e4
|
67
|
+
});
|
68
|
+
};
|
69
|
+
const getHistoryInfo = (params) => {
|
70
|
+
return http.request("get", "/api/chatHistory/records", {
|
71
|
+
params,
|
72
|
+
timeout: 6e4
|
73
|
+
});
|
74
|
+
};
|
75
|
+
const updataHistoryRecord = (data) => {
|
76
|
+
return http.request("patch", "/api/chatHistory/session", {
|
77
|
+
data,
|
78
|
+
timeout: 6e4
|
79
|
+
});
|
80
|
+
};
|
35
81
|
export {
|
36
|
-
|
82
|
+
createHistoryInfo,
|
83
|
+
createHistoryRecord,
|
84
|
+
deleteHistoryRecord,
|
85
|
+
getHistoryInfo,
|
86
|
+
getHistoryRecordList,
|
87
|
+
getReport,
|
88
|
+
updataHistoryInfo,
|
89
|
+
updataHistoryRecord
|
37
90
|
};
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import _sfc_main from "./FilterArea.vue2.mjs";
|
2
2
|
import "./FilterArea.vue3.mjs";
|
3
3
|
import _export_sfc from "../../_virtual/_plugin-vue_export-helper.mjs";
|
4
|
-
const FilterArea = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
4
|
+
const FilterArea = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-4e04c24d"]]);
|
5
5
|
export {
|
6
6
|
FilterArea as default
|
7
7
|
};
|
@@ -9,7 +9,7 @@ import data$2 from "../../node_modules/.pnpm/@iconify-icons_ri@1.2.3/node_module
|
|
9
9
|
import { checkFilterShow_xinyuan, checkFilterShow, checkFilterShow_letter } from "../../utils/home.mjs";
|
10
10
|
import FilterItem from "./FilterItem.vue.mjs";
|
11
11
|
import FilterItemIcon from "./FilterItemIcon.vue.mjs";
|
12
|
-
const _withScopeId = (n) => (pushScopeId("data-v-
|
12
|
+
const _withScopeId = (n) => (pushScopeId("data-v-4e04c24d"), n = n(), popScopeId(), n);
|
13
13
|
const _hoisted_1 = { id: "filterWrap" };
|
14
14
|
const _hoisted_2 = { key: 0 };
|
15
15
|
const _hoisted_3 = { class: "flex flex-1 align-middle justify-items-start flex-wrap" };
|
@@ -1,4 +1,4 @@
|
|
1
|
-
const
|
1
|
+
const FilterArea_vue_vue_type_style_index_0_scoped_4e04c24d_lang = "";
|
2
2
|
export {
|
3
|
-
|
3
|
+
FilterArea_vue_vue_type_style_index_0_scoped_4e04c24d_lang as default
|
4
4
|
};
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import _sfc_main from "./FilterItem.vue2.mjs";
|
2
2
|
import "./FilterItem.vue3.mjs";
|
3
3
|
import _export_sfc from "../../_virtual/_plugin-vue_export-helper.mjs";
|
4
|
-
const FilterItem = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
4
|
+
const FilterItem = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-be1d5ffc"]]);
|
5
5
|
export {
|
6
6
|
FilterItem as default
|
7
7
|
};
|
@@ -4,7 +4,7 @@ import { useFilterStoreHook } from "../../store/modules/filters.mjs";
|
|
4
4
|
import { EnumFilterKind } from "../../store/modules/types.mjs";
|
5
5
|
import data from "../../node_modules/.pnpm/@iconify-icons_ri@1.2.3/node_modules/@iconify-icons/ri/more-2-fill.mjs";
|
6
6
|
import { getFilterRemark } from "../../utils/home.mjs";
|
7
|
-
const _withScopeId = (n) => (pushScopeId("data-v-
|
7
|
+
const _withScopeId = (n) => (pushScopeId("data-v-be1d5ffc"), n = n(), popScopeId(), n);
|
8
8
|
const _hoisted_1 = { class: "p-2" };
|
9
9
|
const _hoisted_2 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("line", null, null, -1));
|
10
10
|
const _hoisted_3 = ["innerHTML"];
|
@@ -1,4 +1,4 @@
|
|
1
|
-
const
|
1
|
+
const FilterItem_vue_vue_type_style_index_0_scoped_be1d5ffc_lang = "";
|
2
2
|
export {
|
3
|
-
|
3
|
+
FilterItem_vue_vue_type_style_index_0_scoped_be1d5ffc_lang as default
|
4
4
|
};
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import _sfc_main from "./FilterItemIcon.vue2.mjs";
|
2
2
|
import "./FilterItemIcon.vue3.mjs";
|
3
3
|
import _export_sfc from "../../_virtual/_plugin-vue_export-helper.mjs";
|
4
|
-
const FilterItemIcon = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
4
|
+
const FilterItemIcon = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-c55b8933"]]);
|
5
5
|
export {
|
6
6
|
FilterItemIcon as default
|
7
7
|
};
|
@@ -4,7 +4,7 @@ import { useFilterStoreHook } from "../../store/modules/filters.mjs";
|
|
4
4
|
import data from "../../node_modules/.pnpm/@iconify-icons_ri@1.2.3/node_modules/@iconify-icons/ri/more-2-fill.mjs";
|
5
5
|
import data$1 from "../../node_modules/.pnpm/@iconify-icons_ri@1.2.3/node_modules/@iconify-icons/ri/check-fill.mjs";
|
6
6
|
import { getFilterRemark } from "../../utils/home.mjs";
|
7
|
-
const _withScopeId = (n) => (pushScopeId("data-v-
|
7
|
+
const _withScopeId = (n) => (pushScopeId("data-v-c55b8933"), n = n(), popScopeId(), n);
|
8
8
|
const _hoisted_1 = {
|
9
9
|
key: 0,
|
10
10
|
class: "flex items-end"
|
@@ -1,4 +1,4 @@
|
|
1
|
-
const
|
1
|
+
const FilterItemIcon_vue_vue_type_style_index_0_scoped_c55b8933_lang = "";
|
2
2
|
export {
|
3
|
-
|
3
|
+
FilterItemIcon_vue_vue_type_style_index_0_scoped_c55b8933_lang as default
|
4
4
|
};
|