Commit 041aadbe authored by mhw's avatar mhw

--

parent 0295590b
<!-- 答案内容预览 -->
<template>
<vue-markdown :source="content" v-highlight class="markdown-body">
<vue-markdown :source="content"
v-highlight
class="markdown-body">
</vue-markdown>
</template>
......@@ -71,7 +73,7 @@ export default {
event.preventDefault();
that.$dialog.show('文件预览', filePreview, {
area: ['100%', '100%']
}, {url: tagUrl }).then(res => {
}, { url: tagUrl }).then(res => {
}).catch(e => { });
}
......@@ -229,7 +231,7 @@ export default {
<style>
.describe-view {
overflow: hidden !important;
transition:all 0.5s ;
transition: all 0.5s;
color: #000;
font-size: 14px;
background-color: #fff;
......@@ -239,13 +241,12 @@ export default {
}
</style>
<style>
.vis-label {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.full{
.full {
width: 20px;
height: 20px;
/* background: #0092FF; */
......@@ -257,7 +258,7 @@ export default {
border-radius: 5px;
/* transition: all 0.5s; */
}
.down{
.down {
width: 20px;
height: 20px;
/* background: #0092FF; */
......
<!-- 右侧聊天界面 -->
<template>
<div class="box" ref="box">
<div class="contentBox" ref="contentBox" v-if="myHistory.length > 0">
<div v-for=" item in myHistory" :key="item.id">
<div class="box"
ref="box">
<div class="contentBox"
ref="contentBox"
v-if="myHistory.length > 0">
<div v-for="item in myHistory"
:key="item.id">
<div class="userBox">
<div class="content">
<contentView :content="item.content" />
</div>
<div class="icon">
{{ item.role }}
</div>
</div>
<div v-if="item.answer" class="gptBox">
<div class="icon">
GPT
</div>
<div v-if="item.answer"
class="gptBox">
<div class="icon">GPT</div>
<div class="content">
<contentView :content="item.answer" :ref="'contentView' + item.id" />
<contentView :content="item.answer"
:ref="'contentView' + item.id" />
</div>
</div>
</div>
</div>
<div class="initBox" ref="initBox" v-else>
<div class="initBox"
ref="initBox"
v-else>
<div class="text">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;你好,<br>
我是人工智能语言模型<br>
我可以回答你的问题,为你提供有用信息,帮助你完成创作。<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;你好,<br />
我是人工智能语言模型<br />
我可以回答你的问题,为你提供有用信息,帮助你完成创作。<br />
</div>
</div>
<div class="inputBox">
<el-input placeholder="请输入内容" v-model="inputContent" class="input-with-select" @keyup.enter.native="submit">
<el-button slot="append" icon="el-icon-position" @click="submit"></el-button>
<el-input placeholder="请输入内容"
v-model="inputContent"
class="input-with-select"
@keyup.enter.native="submit">
<el-button slot="append"
icon="el-icon-position"
@click="submit"></el-button>
</el-input>
<el-button icon="el-icon-delete" style="margin-left:10px" @click="clear" type="danger" plain></el-button>
<el-button icon="el-icon-delete"
style="margin-left: 10px"
@click="clear"
type="danger"
plain></el-button>
</div>
<div id="network"></div>
</div>
......@@ -169,13 +180,14 @@ export default {
nowChat.answer += item.answer || '\n' + item.docs
})
} else if (this.chatForm.pattern === '知识图谱问答') {
console.log(data);
let temporary = JSON.parse(`[${data}]`.replace(/}{/g, '},{'))
temporary.forEach((item) => {
console.log(item);
this.modifyContent(item)// 修改返回内容
nowChat.excludeReferenceAnswer += item.answer || '' // 排除回答中的引用内容
nowChat.answer += item.answer || '\n' + item.docs
nowChat.answer += item.answer || '\n' + item.docs.join()
// nowChat.answer += item.answer += '\n' + item.docs.join()
})
}
......@@ -216,7 +228,6 @@ export default {
var data = match2[1]
// 修改文本内容
textAfterSpecifiedString = `<div class="describe-view" data="${data}" >${textAfterSpecifiedString}</div>`
item2 = item2.replace(match2[2], textAfterSpecifiedString)
}
return item2.replace('出处', '知识溯源')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment