Compare commits
5 Commits
3a94d3e9dc
...
171e102cde
| Author | SHA1 | Date |
|---|---|---|
|
|
171e102cde | 1 month ago |
|
|
5ba171124f | 1 month ago |
|
|
422c95034c | 1 month ago |
|
|
fcd40cf1ce | 1 month ago |
|
|
577529c7ad | 1 month ago |
7 changed files with 284 additions and 10 deletions
@ -0,0 +1,183 @@ |
|||||
|
<!-- |
||||
|
@ 作者: han2015 |
||||
|
@ 时间: 2025-05-12 15:39:13 |
||||
|
@ 备注: aibot组件 |
||||
|
--> |
||||
|
<script lang="ts" setup> |
||||
|
import { getShareChat} from "@/api/doc/space" |
||||
|
import {ElText} from "element-plus"; |
||||
|
import { VueMarkdown } from '@crazydos/vue-markdown' |
||||
|
import rehypeRaw from 'rehype-raw' |
||||
|
import remarkGfm from 'remark-gfm' |
||||
|
import { useRoute } from 'vue-router' |
||||
|
|
||||
|
const route = useRoute() |
||||
|
const interact_msg=ref<{ask:boolean,think:string,content:string,docinfo?:any[],share:boolean}[]>([]) |
||||
|
|
||||
|
//消息体 |
||||
|
interface message{ |
||||
|
ask:boolean, |
||||
|
think:string, |
||||
|
content:string |
||||
|
} |
||||
|
//会话记录 |
||||
|
interface chatRecord{ |
||||
|
uuid:string, |
||||
|
agentuuid:string, |
||||
|
brief:string, |
||||
|
messages:message[] |
||||
|
} |
||||
|
|
||||
|
|
||||
|
//查看分享chat记录 |
||||
|
function showSharedChat(uuid:string){ |
||||
|
getShareChat(uuid).then(resp=>{ |
||||
|
let data=JSON.parse(resp.data.content) |
||||
|
data.share=true |
||||
|
interact_msg.value = data |
||||
|
}).catch(err=>{ |
||||
|
alert(err) |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
//渲染完页面再执行 |
||||
|
onMounted(() => { |
||||
|
const query = route.query |
||||
|
//只是分享链接的请求 |
||||
|
if (query.shared && query.shared!=""){ |
||||
|
showSharedChat(query.shared as string) |
||||
|
} |
||||
|
}); |
||||
|
</script> |
||||
|
|
||||
|
<template> |
||||
|
<div class="app_container"> |
||||
|
<div class="reply_area" > |
||||
|
<span class="text_title">恒信高科AI平台</span> |
||||
|
<template v-for="msg,index of interact_msg"> |
||||
|
<el-text v-if="msg.ask" class="t_ask" >{{ msg.content }}</el-text> |
||||
|
<div v-else class="t_resp"> |
||||
|
<el-text style="white-space: pre-line" v-html="msg.think"></el-text> |
||||
|
<VueMarkdown :id="'content'+index" :markdown="msg.content" :rehype-plugins="[rehypeRaw]" :remark-plugins="[remarkGfm]" ></VueMarkdown> |
||||
|
</div> |
||||
|
</template> |
||||
|
</div> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<style lang="scss" scoped> |
||||
|
.app_container { |
||||
|
height: calc(100vh - 65px); |
||||
|
width: 50%; |
||||
|
overflow-y:auto; |
||||
|
background-color: #efefef; |
||||
|
margin: auto; |
||||
|
} |
||||
|
.text_title{ |
||||
|
text-align: center; |
||||
|
margin-bottom: 12px; |
||||
|
font-size: larger; |
||||
|
font-weight: bold; |
||||
|
} |
||||
|
.question_com{ |
||||
|
position: fixed; |
||||
|
padding: 0 13px; |
||||
|
text-align: center; |
||||
|
display: block; |
||||
|
button{ |
||||
|
position: absolute; |
||||
|
bottom: 27px; |
||||
|
right: 20px; |
||||
|
} |
||||
|
} |
||||
|
.reply_area{ |
||||
|
display: flex; |
||||
|
min-height: 20%; |
||||
|
flex-direction: column; |
||||
|
margin: 15px 15px 210px 15px; |
||||
|
} |
||||
|
.t_ask{ |
||||
|
align-self: end; |
||||
|
line-height: 34px; |
||||
|
background-color: rgb(188 211 241); |
||||
|
padding: 0 30px; |
||||
|
border-radius:10px; |
||||
|
} |
||||
|
.t_resp{ |
||||
|
align-self: start; |
||||
|
line-height: 23px; |
||||
|
font-size: 13px; |
||||
|
color: black; |
||||
|
} |
||||
|
.actions{ |
||||
|
display: flex; |
||||
|
width: 100%; |
||||
|
margin: 5px 0; |
||||
|
background-color: #f3f3f3; |
||||
|
justify-content: center; |
||||
|
} |
||||
|
.dynamic-width-message-box-byme .el-message-box__message{ |
||||
|
width: 100%; |
||||
|
} |
||||
|
|
||||
|
</style> |
||||
|
|
||||
|
<style> |
||||
|
think { |
||||
|
color: #939393; |
||||
|
margin-bottom: 8px; |
||||
|
display: block; |
||||
|
} |
||||
|
|
||||
|
.t_resp{ |
||||
|
h2,h3,h4,h5{ |
||||
|
margin: 12px 0; |
||||
|
} |
||||
|
p{ |
||||
|
margin-left: 16px; |
||||
|
} |
||||
|
p+ul{ |
||||
|
margin-left: 56px; |
||||
|
} |
||||
|
li p{ |
||||
|
margin-left: 0; |
||||
|
} |
||||
|
ol{ |
||||
|
margin-left: 14px; |
||||
|
ul{ |
||||
|
margin-left: 30px; |
||||
|
li{ |
||||
|
list-style: disc; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
ol>li{ |
||||
|
list-style-type: decimal; |
||||
|
} |
||||
|
ul{ |
||||
|
margin-left: 30px; |
||||
|
list-style: disc; |
||||
|
li{ |
||||
|
list-style: disc; |
||||
|
} |
||||
|
ul{ |
||||
|
margin-left: 30px; |
||||
|
} |
||||
|
} |
||||
|
table{ |
||||
|
border: 0px solid; |
||||
|
border-spacing: 1px; |
||||
|
border-collapse: collapse; |
||||
|
th{ |
||||
|
background-color: #e5e5e5; |
||||
|
border: 1px solid; |
||||
|
min-width: 180px; |
||||
|
} |
||||
|
td{ |
||||
|
border: 1px solid; |
||||
|
min-width: 180px; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
</style> |
||||
Loading…
Reference in new issue