|
|
@@ -126,6 +126,12 @@ const content_max_width = computed(() => {
|
|
|
return props.width - 40 - 40 - 20;
|
|
|
});
|
|
|
|
|
|
+const system_message = computed(() => {
|
|
|
+ const answer = props.answer;
|
|
|
+
|
|
|
+ return answer.client_custom_running_msg || '';
|
|
|
+});
|
|
|
+
|
|
|
/**
|
|
|
* 智能体回答的内容的html字符串
|
|
|
* 是markdown格式
|
|
|
@@ -177,12 +183,23 @@ const answer_html = computed(() => {
|
|
|
// answer_string = answer_string + download_file_str;
|
|
|
// }
|
|
|
|
|
|
+ /**
|
|
|
+ * 系统消息展示
|
|
|
+ * 如果有系统消息,则展示系统消息
|
|
|
+ * 如果没有系统消息,则不用展示
|
|
|
+ */
|
|
|
+ const loader_str = `<div class="answer-system-message-content-container">${system_message.value} <span class="answer-system-message-content-loader"></span></div>`;
|
|
|
+
|
|
|
/**
|
|
|
* 所有步骤已经走完
|
|
|
* 返回最终的html字符串
|
|
|
* 此字符串就是要渲染到界面上的html字符串
|
|
|
*/
|
|
|
- return answer_string;
|
|
|
+ if (system_message.value) {
|
|
|
+ return `${answer_string}${loader_str}`;
|
|
|
+ } else {
|
|
|
+ return answer_string;
|
|
|
+ }
|
|
|
});
|
|
|
|
|
|
/**
|
|
|
@@ -319,3 +336,39 @@ onMounted(() => {
|
|
|
padding-right: 45px;
|
|
|
}
|
|
|
</style>
|
|
|
+
|
|
|
+<style>
|
|
|
+.answer-system-message-content-container {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+}
|
|
|
+
|
|
|
+.answer-system-message-content-loader {
|
|
|
+ display: inline-block;
|
|
|
+
|
|
|
+ margin-left: 14px;
|
|
|
+
|
|
|
+ width: 6px;
|
|
|
+ height: 6px;
|
|
|
+ border-radius: 50%;
|
|
|
+ background-color: #165dff;
|
|
|
+ box-shadow: 10px 0 #165dff, -10px 0 #165dff;
|
|
|
+ position: relative;
|
|
|
+ animation: flash 0.8s ease-out infinite alternate;
|
|
|
+}
|
|
|
+
|
|
|
+@keyframes flash {
|
|
|
+ 0% {
|
|
|
+ background-color: #fff2;
|
|
|
+ box-shadow: 10px 0 #fff2, -10px 0 #165dff;
|
|
|
+ }
|
|
|
+ 50% {
|
|
|
+ background-color: #165dff;
|
|
|
+ box-shadow: 10px 0 #fff2, -10px 0 #fff2;
|
|
|
+ }
|
|
|
+ 100% {
|
|
|
+ background-color: #fff2;
|
|
|
+ box-shadow: 10px 0 #165dff, -10px 0 #fff2;
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|