|
@@ -31,8 +31,9 @@ import { useLoading } from '/@/utils/loading-util'
|
|
import { Setting as EleSetting } from '@element-plus/icons-vue'
|
|
import { Setting as EleSetting } from '@element-plus/icons-vue'
|
|
import { useRouter } from 'vue-router'
|
|
import { useRouter } from 'vue-router'
|
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
|
|
|
+import StructDataPlugin from '/@/components/markdown/plugins/struct-data'
|
|
|
|
|
|
-const plugins: Array<MarkdownPlugin<any>> = [EChartsPlugin(), ToolsLoadingPlugin(), TablePlugin()]
|
|
|
|
|
|
+const plugins: Array<MarkdownPlugin<any>> = [EChartsPlugin(), ToolsLoadingPlugin(), TablePlugin(),StructDataPlugin()]
|
|
|
|
|
|
//聊天管理接口
|
|
//聊天管理接口
|
|
// 消息列表
|
|
// 消息列表
|
|
@@ -103,11 +104,11 @@ const openPromptDialog = ref(false)
|
|
|
|
|
|
// 模型选择
|
|
// 模型选择
|
|
const modelOptions = ref<LmConfigInfo[]>([])
|
|
const modelOptions = ref<LmConfigInfo[]>([])
|
|
-const modelLabel = computed(()=> {
|
|
|
|
- const select = modelOptions.value.filter(i=>i.id === selectedModel.value)
|
|
|
|
|
|
+const modelLabel = computed(() => {
|
|
|
|
+ const select = modelOptions.value.filter((i) => i.id === selectedModel.value)
|
|
|
|
|
|
if (select.length === 0) {
|
|
if (select.length === 0) {
|
|
- return "选择模型"
|
|
|
|
|
|
+ return '选择模型'
|
|
}
|
|
}
|
|
|
|
|
|
return select[0].modelName
|
|
return select[0].modelName
|
|
@@ -271,6 +272,14 @@ const chatInternal = (rtn: Message, context: Message[] = messages.value) => {
|
|
},
|
|
},
|
|
onReceive: (resp: ChatResponse) => {
|
|
onReceive: (resp: ChatResponse) => {
|
|
switch (resp.type) {
|
|
switch (resp.type) {
|
|
|
|
+ case 'structdata':
|
|
|
|
+ rtn.render_content += `
|
|
|
|
+\`\`\`structdata
|
|
|
|
+${resp.uuid}
|
|
|
|
+\`\`\`
|
|
|
|
+
|
|
|
|
+`
|
|
|
|
+ break
|
|
case 'message':
|
|
case 'message':
|
|
rtn.render_content += resp.message
|
|
rtn.render_content += resp.message
|
|
rtn.content += resp.message
|
|
rtn.content += resp.message
|
|
@@ -718,8 +727,7 @@ const { loading: exportConversationLoading, doLoading: exportConversation } = us
|
|
exportId.value = -1
|
|
exportId.value = -1
|
|
})
|
|
})
|
|
|
|
|
|
-
|
|
|
|
-const isBlank = (str:string)=> {
|
|
|
|
|
|
+const isBlank = (str: string) => {
|
|
return str == null || str.trim().length === 0
|
|
return str == null || str.trim().length === 0
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|
|
@@ -782,16 +790,7 @@ const isBlank = (str:string)=> {
|
|
<!-- 非编辑状态的三点菜单 -->
|
|
<!-- 非编辑状态的三点菜单 -->
|
|
<template v-if="editingConversationId !== conv.session_id">
|
|
<template v-if="editingConversationId !== conv.session_id">
|
|
<el-dropdown trigger="click" placement="bottom-end" @click.stop>
|
|
<el-dropdown trigger="click" placement="bottom-end" @click.stop>
|
|
- <el-button
|
|
|
|
- type="primary"
|
|
|
|
- size="small"
|
|
|
|
- :icon="MoreFilled"
|
|
|
|
- class="action-btn more-btn"
|
|
|
|
- title="更多操作"
|
|
|
|
- plain
|
|
|
|
- circle
|
|
|
|
- @click.stop
|
|
|
|
- />
|
|
|
|
|
|
+ <el-button type="primary" size="small" :icon="MoreFilled" class="action-btn more-btn" title="更多操作" plain circle @click.stop />
|
|
<template #dropdown>
|
|
<template #dropdown>
|
|
<el-dropdown-menu>
|
|
<el-dropdown-menu>
|
|
<el-dropdown-item @click="exportConversation(conv.session_id)">
|
|
<el-dropdown-item @click="exportConversation(conv.session_id)">
|