|
|
@@ -67,23 +67,34 @@
|
|
|
<span class="dialog-span">{{ agentInfo.title }}</span>
|
|
|
</a-typography-paragraph>
|
|
|
</div>
|
|
|
- <div class="dialog-footer" v-if="item?.capacity">
|
|
|
+ <div class="dialog-footer">
|
|
|
<div
|
|
|
+ v-if="type === 'knowledge'"
|
|
|
@click="openCapacity(key)"
|
|
|
:class="[readonly || item.capacity.status === 'loading' ? 'disabled' : '']"
|
|
|
>
|
|
|
<a-spin :size="18" v-if="item.capacity.status === 'loading'" />
|
|
|
<icon-check-circle-fill :size="18" v-else />
|
|
|
- <span>{{ item.capacity.status === "loading" ? "正在调用" : "已调用" }}</span>
|
|
|
- <b>{{ item.capacity.text }}</b>
|
|
|
+ <span>{{ item.capacity.status === "loading" ? "小数正在检索" : "查看检索信息" }}</span>
|
|
|
+ <!-- <b>{{ item.capacity.text }}</b> -->
|
|
|
<icon-caret-right
|
|
|
size="18"
|
|
|
v-if="item.capacity.status === 'loaded' && !menuList[key].open"
|
|
|
/>
|
|
|
<icon-caret-down size="18" v-if="item.capacity.status === 'loaded' && menuList[key].open" />
|
|
|
</div>
|
|
|
- <section v-if="item.capacity.status === 'loaded'" v-show="menuList[key].open">
|
|
|
- <p>{{ item.capacity.data.title }}</p>
|
|
|
+ <div
|
|
|
+ v-else
|
|
|
+ v-show="item.capacity.status === 'loading'"
|
|
|
+ :class="[readonly || item.capacity.status === 'loading' ? 'disabled' : '']"
|
|
|
+ >
|
|
|
+ <a-spin :size="18" />
|
|
|
+ <span>小数正在为您生成答案...</span>
|
|
|
+ </div>
|
|
|
+ <section
|
|
|
+ v-if="type === 'knowledge' && item.capacity.status === 'loaded'"
|
|
|
+ v-show="menuList[key].open"
|
|
|
+ >
|
|
|
<div v-if="item.capacity.data.list">
|
|
|
<p v-for="(item, key) in item.capacity.data.list" :key="key">
|
|
|
<a-typography-paragraph
|
|
|
@@ -131,7 +142,9 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</section>
|
|
|
- <p v-if="item.answer">{{ item.answer }}</p>
|
|
|
+ <p v-if="item.answer" :style="{ 'margin-top': type === 'knowledge' ? '12px' : '0' }">
|
|
|
+ {{ item.answer }}
|
|
|
+ </p>
|
|
|
</div>
|
|
|
<div class="dialog-other" v-if="item?.other">
|
|
|
<p v-if="isSetting">
|
|
|
@@ -194,7 +207,7 @@ export default defineComponent({
|
|
|
components: {
|
|
|
DialogFeedback
|
|
|
},
|
|
|
- props: ["open", "suggestions", "agentInfo", "userInfo", "isSetting", "readonly"],
|
|
|
+ props: ["open", "suggestions", "agentInfo", "userInfo", "isSetting", "readonly", "type"],
|
|
|
setup(props, { emit }) {
|
|
|
const DOCUMENT_RESULT = {
|
|
|
type: "document",
|
|
|
@@ -251,10 +264,8 @@ export default defineComponent({
|
|
|
dialogScroll.value.scrollTop = dialogScroll.value.scrollHeight;
|
|
|
}
|
|
|
};
|
|
|
- let questionInterval = null;
|
|
|
let answerInterval = null;
|
|
|
const stopWriting = () => {
|
|
|
- window.clearInterval(questionInterval);
|
|
|
window.clearInterval(answerInterval);
|
|
|
emit("set-readonly", false);
|
|
|
if (dialogList[dialogIndex]) {
|
|
|
@@ -271,7 +282,6 @@ export default defineComponent({
|
|
|
scrollToEnd();
|
|
|
};
|
|
|
const mockLink = (text, file = null) => {
|
|
|
- let num1 = 0;
|
|
|
let num2 = 0;
|
|
|
let p1 = text;
|
|
|
const p2 = `尊敬的领导,
|
|
|
@@ -284,21 +294,12 @@ export default defineComponent({
|
|
|
let result = { question: "", capacity: null, answer: "", other: null, file: null };
|
|
|
// 第一步,输入问题
|
|
|
const step1 = () => {
|
|
|
- questionInterval = setInterval(() => {
|
|
|
- if (num1 < p1.length + 1) {
|
|
|
- result.question = p1.slice(0, num1);
|
|
|
- num1 += 1;
|
|
|
- addData(result);
|
|
|
- } else {
|
|
|
- window.clearInterval(questionInterval);
|
|
|
- // 如果有文件,显示上传文件
|
|
|
- if (file) {
|
|
|
- result.file = file;
|
|
|
- addData(result);
|
|
|
- }
|
|
|
- step2();
|
|
|
- }
|
|
|
- }, 50);
|
|
|
+ result.question = p1;
|
|
|
+ if (file) {
|
|
|
+ result.file = file;
|
|
|
+ addData(result);
|
|
|
+ }
|
|
|
+ step2();
|
|
|
};
|
|
|
// 第二步,调用能力
|
|
|
const step2 = () => {
|
|
|
@@ -488,7 +489,6 @@ export default defineComponent({
|
|
|
> p {
|
|
|
color: rgba(16, 16, 16, 1);
|
|
|
font-size: 14px;
|
|
|
- margin-top: 16px;
|
|
|
}
|
|
|
> div {
|
|
|
border: 1px solid rgba(64, 95, 234, 0.42);
|