|
@@ -137,7 +137,7 @@
|
|
|
<h4>推荐问题</h4>
|
|
|
</div>
|
|
|
<p class="card-subtitle">为您精选的热门问题</p>
|
|
|
- <div class="suggestion-items">
|
|
|
+ <div class="suggestion-items" v-if="!inferenceModel">
|
|
|
<!-- Combine both QA pairs and guides -->
|
|
|
<div
|
|
|
v-for="(item, index) in [
|
|
@@ -151,6 +151,18 @@
|
|
|
{{ item.question }}
|
|
|
</div>
|
|
|
</div>
|
|
|
+
|
|
|
+ <div class="suggestion-items" v-else >
|
|
|
+ <div
|
|
|
+ v-for="(item, index) in currentQaPairsList"
|
|
|
+ :key="index"
|
|
|
+ class="suggestion-item"
|
|
|
+ @click="handleQaClick(item)"
|
|
|
+ >
|
|
|
+ {{ item.title }}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
</div>
|
|
|
<!-- Hot Topics 卡片 --><!-- Design Guide 卡片 -->
|
|
|
<!-- <div class="suggestion-card">
|
|
@@ -283,6 +295,20 @@
|
|
|
v-html="renderMarkdown(message.displayContent)"
|
|
|
></div>
|
|
|
<div v-else>{{ message.content }}</div>
|
|
|
+ <div v-if="message.analysis_result" style="background-color: #f5f5f5; padding: 12px; border-radius: 8px; margin: 8px 0;">
|
|
|
+ <div v-for="value in message.analysis_result.insights" style="margin-bottom: 6px; border-bottom: 1px dashed #e5e5e5;">
|
|
|
+ {{ value.message }}
|
|
|
+ </div>
|
|
|
+ <div v-for="value in message.analysis_result.issues" style="margin-bottom: 6px; border-bottom: 1px dashed #e5e5e5;">
|
|
|
+ {{ value.message }}
|
|
|
+ </div>
|
|
|
+ <div v-for="value in message.analysis_result.recommendations" style="margin-bottom: 6px; border-bottom: 1px dashed #e5e5e5;">
|
|
|
+ {{ value.description }}
|
|
|
+ </div>
|
|
|
+ <div v-for="value in message.automation_plan.steps" style="margin-bottom: 6px; ">
|
|
|
+ <a href="#" @click="handleStepClick(value)" style="color: #0066cc; text-decoration: none;"> {{ value.description }}</a>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
|
|
|
<!-- 音频控制按钮 -->
|
|
|
<div
|
|
@@ -1135,6 +1161,12 @@ const fetchDocumentSummary = async () => {
|
|
|
}
|
|
|
};
|
|
|
|
|
|
+// 处理步骤点击事件
|
|
|
+const handleStepClick = (step) => {
|
|
|
+ message.success('操作成功')
|
|
|
+ // 这里可以添加点击步骤后的逻辑,比如滚动到对应的步骤位置
|
|
|
+};
|
|
|
+
|
|
|
// 修改轮换显示逻辑
|
|
|
const startRotation = () => {
|
|
|
if (rotationInterval) {
|
|
@@ -1191,7 +1223,7 @@ const startRotation = () => {
|
|
|
const handleQaClick = (qa) => {
|
|
|
console.log("QA clicked:", qa); // 添加日志
|
|
|
if (qa?.question) {
|
|
|
- inputContent.value = qa.question;
|
|
|
+ inputContent.value = qa.question || qa.title;
|
|
|
sendMessage();
|
|
|
}
|
|
|
};
|
|
@@ -1477,7 +1509,7 @@ const sendMessage = async () => {
|
|
|
})),
|
|
|
};
|
|
|
messages.value.push(userMessage);
|
|
|
-
|
|
|
+const summaryHtml=ref('')
|
|
|
// 添加临时AI消息
|
|
|
const tempAiMessage = {
|
|
|
id: Date.now() + 1,
|
|
@@ -1631,11 +1663,16 @@ const sendMessage = async () => {
|
|
|
id: Date.now() + 2,
|
|
|
role: "assistant",
|
|
|
content: data.summary,
|
|
|
+ summaryHtml:data.html_content,
|
|
|
+ analysis_result:data.analysis_result,
|
|
|
+ automation_plan:data.automation_plan,
|
|
|
displayContent: "",
|
|
|
audioData: null,
|
|
|
});
|
|
|
isTyping.value = true;
|
|
|
+ summaryHtml.value=data.html_content
|
|
|
messages.value.push(aiMessage);
|
|
|
+
|
|
|
// 显示打字效果
|
|
|
try {
|
|
|
await typeMessage(aiMessage);
|
|
@@ -2162,16 +2199,29 @@ const updateCollapsedState = () => {
|
|
|
const handleInferenceModel = () => {
|
|
|
inferenceModel.value = !inferenceModel.value;
|
|
|
}; */
|
|
|
- watch(inferenceModel, (newValue) => {
|
|
|
+ const currentQaPairsList = ref([]);
|
|
|
+ watch(inferenceModel, async(newValue) => {
|
|
|
console.log('智能体状态:', newValue);
|
|
|
if (newValue) {
|
|
|
// 打开右侧窗口
|
|
|
-
|
|
|
rightMenuWidth.value = 450;
|
|
|
isRightMenuCollapsed.value = false;
|
|
|
if (document.querySelector('.chat')) {
|
|
|
document.querySelector('.chat').style.right = `${rightMenuWidth.value}px`;
|
|
|
}
|
|
|
+
|
|
|
+ //获取智能体显示参数
|
|
|
+ const response = await axios.get(
|
|
|
+ `${import.meta.env.VITE_BASE_AI_API}/api/agents/notifications/stream/`,
|
|
|
+ {
|
|
|
+ headers: {
|
|
|
+ 'Authorization': `JWT ${localStorage.getItem('token')}`
|
|
|
+ }
|
|
|
+ }
|
|
|
+ );
|
|
|
+ console.log("API Response:", response.data);
|
|
|
+ currentQaPairsList.value=response.data.notifications
|
|
|
+ // currentQaPairs
|
|
|
enableKnowledgeSearch.value=false
|
|
|
enableWebSearch.value = false;
|
|
|
} else {
|