refactor(agent): 重构智能对话页面布局和样式

- 重新设计了页面布局,分为左、右两个主要区域
- 左侧区域增加了聊天机器人信息展示,包括头像、名称、描述等
- 右侧区域保留聊天窗口,并增加了顶部栏
-优化了响应式布局,使页面在不同屏幕尺寸下都能良好显示
- 调整了颜色、字体等样式,提升了页面视觉效果
This commit is contained in:
林志军
2025-07-31 14:36:45 +08:00
parent 15d15a44c6
commit 7e7a4f363b
8 changed files with 109 additions and 13 deletions

View File

@ -7,7 +7,7 @@
<div class="workflow-container">
<div class="left-wap mr-24px" v-if="isCollapsed == false">
<div class="w-full w-100% mb-15px bg-#F0EDFF h-160px rounded-8px">
<img v-if="cozeInfo?.image_url" :src="cozeInfo?.image_url" class= "w-full h-full object-contain" />
<img v-if="cozeInfo?.image_url" :src="cozeInfo?.image_url" class="w-full h-full object-contain" />
</div>
<div class="content mb-15px">
<div class="title-body">
@ -40,8 +40,29 @@
<div class="item-body">
<div class="text" @click="getHistoryInfo(item)">
{{ item.title }}
<SvgIcon size="12" name="svg-more" class="color-#6D4CFE" style="float: right" />
<!-- <a-trigger position="top" auto-fit-position :unmount-on-close="false">-->
<!-- <SvgIcon size="12" name="svg-more" class="color-#6D4CFE" style="float: right" />-->
<!-- <template #content>-->
<!-- <div class="">-->
<!-- <div class="history-item-dropdown">-->
<!-- <div class="dropdown-item header-item">-->
<!-- <SvgIcon size="12" name="svg-pin" class="icon color-#6D4CFE" />-->
<!-- <div class="text">置顶</div>-->
<!-- </div>-->
<!-- <div class="dropdown-item">-->
<!-- <SvgIcon size="12" name="svg-edit" class="icon color-#6D4CFE" />-->
<!-- <div class="text">重命名</div>-->
<!-- </div>-->
<!-- <div class="dropdown-item">-->
<!-- <SvgIcon size="12" name="svg-delete" class="icon color-#6D4CFE" />-->
<!-- <a-popconfirm content="你确认删除该历史对话吗" @ok="deleteHistory(item.id,index)" type="error">-->
<!-- <div class="text delete">删除</div>-->
<!-- </a-popconfirm>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!-- </template>-->
<!-- </a-trigger>-->
</div>
</div>
</div>
@ -77,13 +98,13 @@
<script setup>
import { ref, reactive } from 'vue';
import DynamicForm from './components/DynamicForm.vue';
import { executeWorkFlow, getWorkFlowInfo } from '@/api/all/agent';
import { executeWorkFlow, getWorkFlowInfo, delWorkflowHistoryApi } from '@/api/all/agent';
import { useRoute, useRouter } from 'vue-router';
import { marked } from 'marked';
import DOMPurify from 'dompurify';
import menuFold from '@/assets/svg/menu-fold.svg';
import menuUnfold from '@/assets/svg/menu-unfold.svg';
import { formatNumberShow } from "@/utils/tools"
import { formatNumberShow } from '@/utils/tools';
const formFields = ref({});
const history = ref([]);
@ -135,6 +156,14 @@ const renderedMarkdown = computed(() => {
return '';
});
const deleteHistory = async (id, index ) => {
const { code } = await delWorkflowHistoryApi(id);
if (code === 200) {
//
history.value.splice(index, 1);
}
};
// 提交表单
const handleSubmit = async (formData) => {
try {
@ -155,7 +184,6 @@ const handleSubmit = async (formData) => {
const addHistoryItem = (item) => {
history.value.unshift(item);
};
const getHistoryInfo = (item) => {