From a5c92999b1c44deed7900198ff59ff8ea65b7cbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9E=97=E5=BF=97=E5=86=9B?= <543024265@qq.com> Date: Thu, 10 Jul 2025 19:05:38 +0800 Subject: [PATCH 01/65] =?UTF-8?q?feat(property-marketing):=20=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E6=9C=88=E6=95=B0=E6=8D=AE=E5=A4=8D=E5=88=B6=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=EF=BC=8C=E4=BC=98=E5=8C=96=E7=BB=84=E4=BB=B6=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=E5=B8=83=E5=B1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/routes/modules/agent.ts | 39 ++++ src/views/Agent/Chat/components/CozeChat.vue | 221 +++++++++++++++++++ src/views/Agent/Chat/index.vue | 76 +++++++ 3 files changed, 336 insertions(+) create mode 100644 src/router/routes/modules/agent.ts create mode 100644 src/views/Agent/Chat/components/CozeChat.vue create mode 100644 src/views/Agent/Chat/index.vue diff --git a/src/router/routes/modules/agent.ts b/src/router/routes/modules/agent.ts new file mode 100644 index 0000000..1cd422c --- /dev/null +++ b/src/router/routes/modules/agent.ts @@ -0,0 +1,39 @@ +/** + * 智能体应用 + */ + +import type { AppRouteRecordRaw } from '../types'; +import { MENU_GROUP_IDS } from '@/router/constants'; + +import IconRepository from '@/assets/svg/icon-repository.svg'; + +const COMPONENTS: AppRouteRecordRaw[] = [ + { + path: '/agent', + name: 'Agent', + redirect: 'agent/listData', + meta: { + locale: '品牌资产管理', + icon: IconRepository, + requiresAuth: true, + requireLogin: true, + roles: ['*'], + id: MENU_GROUP_IDS.PROPERTY_ID, + }, + children: [ + { + path: 'chat', + name: 'Chat', + meta: { + locale: '品牌信息', + requiresAuth: true, + requireLogin: true, + roles: ['*'], + }, + component: () => import('@/views/Agent/Chat'), + }, + ], + } +]; + +export default COMPONENTS; diff --git a/src/views/Agent/Chat/components/CozeChat.vue b/src/views/Agent/Chat/components/CozeChat.vue new file mode 100644 index 0000000..c5c559c --- /dev/null +++ b/src/views/Agent/Chat/components/CozeChat.vue @@ -0,0 +1,221 @@ + + + + + diff --git a/src/views/Agent/Chat/index.vue b/src/views/Agent/Chat/index.vue new file mode 100644 index 0000000..9b98eeb --- /dev/null +++ b/src/views/Agent/Chat/index.vue @@ -0,0 +1,76 @@ + + + + + From f7ff8b2bd5ebe2f749b236947b2e56ebdedf4733 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9E=97=E5=BF=97=E5=86=9B?= <543024265@qq.com> Date: Fri, 11 Jul 2025 14:40:19 +0800 Subject: [PATCH 02/65] =?UTF-8?q?feat(agent):=20=E9=87=8D=E6=9E=84?= =?UTF-8?q?=E8=81=8A=E5=A4=A9=E9=A1=B5=E9=9D=A2=E5=AE=9E=E7=8E=B0=EF=BC=8C?= =?UTF-8?q?=E6=96=B0=E5=A2=9ECoze=20SDK=E9=9B=86=E6=88=90=E5=92=8CAPI?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=EF=BC=8C=E4=BC=98=E5=8C=96=E8=B7=AF=E7=94=B1?= =?UTF-8?q?=E6=9D=83=E9=99=90=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/all/agent.ts | 6 + src/permission/permission.ts | 5 +- src/router/routes/modules/agent.ts | 5 +- src/views/Agent/Chat/index.vue | 189 +++++++++++++++++++++++------ 4 files changed, 159 insertions(+), 46 deletions(-) create mode 100644 src/api/all/agent.ts diff --git a/src/api/all/agent.ts b/src/api/all/agent.ts new file mode 100644 index 0000000..69be57a --- /dev/null +++ b/src/api/all/agent.ts @@ -0,0 +1,6 @@ +// 投放账号计划 +import Http from '@/api'; +// 获取聊天智能体 +export const getChatAgent = (id: number) => { + return Http.get(`/v1/agent/getChatAgent/${id}`); +}; diff --git a/src/permission/permission.ts b/src/permission/permission.ts index 7c12722..13418fd 100644 --- a/src/permission/permission.ts +++ b/src/permission/permission.ts @@ -5,6 +5,7 @@ export function checkRoutePermission(routeName: string) { const allowAccessRoutes = userStore.allowAccessRoutes; if (!routeName) return false; - - return allowAccessRoutes.includes(routeName); + // todo + return true; + // return allowAccessRoutes.includes(routeName); } diff --git a/src/router/routes/modules/agent.ts b/src/router/routes/modules/agent.ts index 1cd422c..da1a73c 100644 --- a/src/router/routes/modules/agent.ts +++ b/src/router/routes/modules/agent.ts @@ -25,10 +25,7 @@ const COMPONENTS: AppRouteRecordRaw[] = [ path: 'chat', name: 'Chat', meta: { - locale: '品牌信息', - requiresAuth: true, - requireLogin: true, - roles: ['*'], + hideInMenu: true, }, component: () => import('@/views/Agent/Chat'), }, diff --git a/src/views/Agent/Chat/index.vue b/src/views/Agent/Chat/index.vue index 9b98eeb..c22dae3 100644 --- a/src/views/Agent/Chat/index.vue +++ b/src/views/Agent/Chat/index.vue @@ -1,57 +1,166 @@ - diff --git a/src/views/Agent/Chat/index.vue b/src/views/Agent/Chat/index.vue index 4af74e1..037a273 100644 --- a/src/views/Agent/Chat/index.vue +++ b/src/views/Agent/Chat/index.vue @@ -1,119 +1,5 @@ - - - - + + From c4b074b7750e9e35ead86b66accaa3aa34a62484 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9E=97=E5=BF=97=E5=86=9B?= <543024265@qq.com> Date: Mon, 14 Jul 2025 11:48:19 +0800 Subject: [PATCH 05/65] =?UTF-8?q?feat(agent):=20=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E8=B7=AF=E7=94=B1=E9=85=8D=E7=BD=AE=EF=BC=8C=E4=B8=BAAgent?= =?UTF-8?q?=E4=B8=BB=E8=B7=AF=E7=94=B1=E6=B7=BB=E5=8A=A0=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/routes/modules/agent.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/router/routes/modules/agent.ts b/src/router/routes/modules/agent.ts index c1d5db9..feef729 100644 --- a/src/router/routes/modules/agent.ts +++ b/src/router/routes/modules/agent.ts @@ -12,6 +12,7 @@ const COMPONENTS: AppRouteRecordRaw[] = [ path: '/agent', name: 'Agent', redirect: 'agent/listData', + component: () => import('@/views/Agent/Chat/index.vue'), meta: { locale: '扣子智能体', icon: IconRepository, @@ -20,10 +21,8 @@ const COMPONENTS: AppRouteRecordRaw[] = [ roles: ['*'], id: MENU_GROUP_IDS.PROPERTY_ID, }, - children: [ - - ], - } + children: [], + }, ]; export default COMPONENTS; From 616665d219caf216e571b0caa46ab456e1ce873a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9E=97=E5=BF=97=E5=86=9B?= <543024265@qq.com> Date: Tue, 15 Jul 2025 15:16:03 +0800 Subject: [PATCH 06/65] =?UTF-8?q?feat(agent):=20=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E6=99=BA=E8=83=BD=E4=BD=93=E5=BA=94=E7=94=A8=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 添加智能体列表页面和相关API - 实现聊天功能,包括历史对话和当前对话 - 新增工作流功能,包括表单提交和结果展示- 优化路由配置,增加智能体相关路由 - 添加全局常量和枚举,用于智能体类型区分 --- package.json | 1 + src/api/all/agent.ts | 24 +- src/components/_base/navbar/index.vue | 2 +- src/router/constants.ts | 1 + src/router/routes/modules/agent.ts | 40 +++- src/views/Agent/AgentConstants.ts | 4 + src/views/Agent/Chat/components/CozeChat.vue | 4 - .../Agent/Chat/components/HistoryChat.vue | 35 ++- src/views/Agent/Chat/index.vue | 106 ++++++++- src/views/Agent/Chat/style.scss | 27 +++ src/views/Agent/Index/index.vue | 68 ++++++ src/views/Agent/Index/style.scss | 20 ++ .../work-flow/components/DynamicForm.vue | 73 ++++++ .../work-flow/components/HistoryChat.vue | 52 +++++ .../Agent/work-flow/components/WorkFlow.vue | 217 ++++++++++++++++++ .../work-flow/form/FormFieldRenderer.vue | 37 +++ src/views/Agent/work-flow/form/InputField.vue | 31 +++ .../Agent/work-flow/form/SelectField.vue | 31 +++ src/views/Agent/work-flow/index.vue | 83 +++++++ src/views/Agent/work-flow/style.scss | 41 ++++ 20 files changed, 869 insertions(+), 28 deletions(-) create mode 100644 src/views/Agent/AgentConstants.ts create mode 100644 src/views/Agent/Chat/style.scss create mode 100644 src/views/Agent/Index/index.vue create mode 100644 src/views/Agent/Index/style.scss create mode 100644 src/views/Agent/work-flow/components/DynamicForm.vue create mode 100644 src/views/Agent/work-flow/components/HistoryChat.vue create mode 100644 src/views/Agent/work-flow/components/WorkFlow.vue create mode 100644 src/views/Agent/work-flow/form/FormFieldRenderer.vue create mode 100644 src/views/Agent/work-flow/form/InputField.vue create mode 100644 src/views/Agent/work-flow/form/SelectField.vue create mode 100644 src/views/Agent/work-flow/index.vue create mode 100644 src/views/Agent/work-flow/style.scss diff --git a/package.json b/package.json index 5f28272..8082532 100644 --- a/package.json +++ b/package.json @@ -29,6 +29,7 @@ "update": "^0.7.4", "vue": "^3.2.45", "vue-cropper": "^1.1.4", + "vue-draggable-next": "^2.2.1", "vue-draggable-plus": "^0.6.0", "vue-echarts": "^7.0.3", "vue-router": "^4.1.6", diff --git a/src/api/all/agent.ts b/src/api/all/agent.ts index 69be57a..b258e45 100644 --- a/src/api/all/agent.ts +++ b/src/api/all/agent.ts @@ -1,6 +1,28 @@ -// 投放账号计划 import Http from '@/api'; // 获取聊天智能体 export const getChatAgent = (id: number) => { return Http.get(`/v1/agent/getChatAgent/${id}`); }; + +// 获取历史聊天 +export const getHistoryChat = (params: any) => { + return Http.get(`/v1/agent/getConversations`, { params }); +}; +// 获取智能体分类 +export const getCategoriesMenus = () => { + return Http.get(`/v1/agent/getCategoriesMenus`); +}; + +export const getAgentList = () => { + return Http.get(`/v1/agent/getAgentList`); +}; + +// 获取工作流详情 +export const getWorkFlowInfo = (id: number) => { + return Http.get(`/v1/agent/getWorkFlowInfo/${id}`); +}; + +// 执行工作流 +export const executeWorkFlow = (params: any) => { + return Http.post(`/v1/agent/executeWorkFlow`, params); +}; diff --git a/src/components/_base/navbar/index.vue b/src/components/_base/navbar/index.vue index 333167b..87412b6 100644 --- a/src/components/_base/navbar/index.vue +++ b/src/components/_base/navbar/index.vue @@ -10,7 +10,7 @@ import router from '@/router'; // import { useRoute } from 'vue-router'; import ExitAccountModal from '@/components/_base/exit-account-modal/index.vue'; // import { appRoutes } from '@/router/routes'; -// import { MENU_LIST } from './constants'; +// import { MENU_LIST } from './AgentConstants.ts'; const sidebarStore = useSidebarStore(); // const enterpriseStore = useEnterpriseStore(); diff --git a/src/router/constants.ts b/src/router/constants.ts index 6fc8bef..1b17254 100644 --- a/src/router/constants.ts +++ b/src/router/constants.ts @@ -26,4 +26,5 @@ export const MENU_GROUP_IDS = { MANAGEMENT_ID: -1, // 管理中心 PROPERTY_ID: 10, // 资产营销平台 WORK_BENCH_ID: -99, // 工作台 + AGENT: 2, // 智能体 }; diff --git a/src/router/routes/modules/agent.ts b/src/router/routes/modules/agent.ts index feef729..f36fcb4 100644 --- a/src/router/routes/modules/agent.ts +++ b/src/router/routes/modules/agent.ts @@ -1,7 +1,3 @@ -/** - * 智能体应用 - */ - import type { AppRouteRecordRaw } from '../types'; import { MENU_GROUP_IDS } from '@/router/constants'; @@ -12,16 +8,46 @@ const COMPONENTS: AppRouteRecordRaw[] = [ path: '/agent', name: 'Agent', redirect: 'agent/listData', - component: () => import('@/views/Agent/Chat/index.vue'), meta: { locale: '扣子智能体', icon: IconRepository, requiresAuth: true, requireLogin: true, roles: ['*'], - id: MENU_GROUP_IDS.PROPERTY_ID, + id: MENU_GROUP_IDS.AGENT, }, - children: [], + children: [ + { + path: 'index', + name: 'AgentListData', + component: () => import('@/views/agent/index'), + meta: { + locale: '智能体列表', + requiresAuth: false, + requireLogin: true, + }, + }, + { + path: 'chat', + name: 'Chat', + component: () => import('@/views/agent/chat'), + meta: { + hideSidebar: true, + requiresAuth: false, + requireLogin: true, + }, + }, + { + path: 'workFlow', + name: 'AgentWorkFlow', + component: () => import('@/views/agent/work-flow'), + meta: { + hideSidebar: true, + requiresAuth: false, + requireLogin: true, + }, + }, + ], }, ]; diff --git a/src/views/Agent/AgentConstants.ts b/src/views/Agent/AgentConstants.ts new file mode 100644 index 0000000..b5dfbe5 --- /dev/null +++ b/src/views/Agent/AgentConstants.ts @@ -0,0 +1,4 @@ +export enum AGENT_TYPE { + AGENT = 1, // 智能体 + WORKFLLOW = 2, // 工作流 +} diff --git a/src/views/Agent/Chat/components/CozeChat.vue b/src/views/Agent/Chat/components/CozeChat.vue index c5c559c..66d02e2 100644 --- a/src/views/Agent/Chat/components/CozeChat.vue +++ b/src/views/Agent/Chat/components/CozeChat.vue @@ -116,7 +116,6 @@ export default { } }; - // 重试机制 const retry = async () => { error.value = false; loading.value = true; @@ -130,7 +129,6 @@ export default { } }; - // 组件挂载时初始化 onMounted(async () => { try { await loadSDK(); @@ -142,13 +140,11 @@ export default { } }); - // 组件卸载时清理 onBeforeUnmount(() => { if (chatClient && typeof chatClient.destroy === 'function') { chatClient.destroy(); } - // 移除我们添加的脚本 if (scriptLoaded) { const scripts = document.querySelectorAll('script[src*="coze.cn"]'); scripts.forEach((script) => script.remove()); diff --git a/src/views/Agent/Chat/components/HistoryChat.vue b/src/views/Agent/Chat/components/HistoryChat.vue index cee070a..af7802e 100644 --- a/src/views/Agent/Chat/components/HistoryChat.vue +++ b/src/views/Agent/Chat/components/HistoryChat.vue @@ -1,12 +1,13 @@ + + + + diff --git a/src/views/Agent/Chat/style.scss b/src/views/Agent/Chat/style.scss new file mode 100644 index 0000000..5e867e7 --- /dev/null +++ b/src/views/Agent/Chat/style.scss @@ -0,0 +1,27 @@ +.chat-wrap { + .chat-contain { + font-family: Avenir, Helvetica, Arial, sans-serif; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + color: #2c3e50; + margin-top: 24px; + + .span-back { + color: var(--Text-2, #3C4043); + font-size: 14px; + font-family: Alibaba PuHuiTi; + font-weight: 400; + line-height: 62px; + word-wrap: break-word + } + } + + .span-back { + color: var(--Text-2, #3C4043); + font-size: 14px; + font-family: Alibaba PuHuiTi; + font-weight: 400; + line-height: 22px; + word-wrap: break-word + } +} diff --git a/src/views/Agent/Index/index.vue b/src/views/Agent/Index/index.vue new file mode 100644 index 0000000..d5bd328 --- /dev/null +++ b/src/views/Agent/Index/index.vue @@ -0,0 +1,68 @@ + + + + + diff --git a/src/views/Agent/Index/style.scss b/src/views/Agent/Index/style.scss new file mode 100644 index 0000000..93b3f24 --- /dev/null +++ b/src/views/Agent/Index/style.scss @@ -0,0 +1,20 @@ +.agent-wrap { + padding: 24px; + background: #fff; + border-radius: 4px; + + .ant-card-cover img { + height: 150px; + object-fit: cover; + } + + .span-title { + color: var(--Text-2, #3C4043); + font-size: 16px; + font-family: Alibaba PuHuiTi; + font-weight: 400; + line-height: 44px; + word-wrap: break-word; + padding-bottom: 20px; + } +} diff --git a/src/views/Agent/work-flow/components/DynamicForm.vue b/src/views/Agent/work-flow/components/DynamicForm.vue new file mode 100644 index 0000000..6fc406c --- /dev/null +++ b/src/views/Agent/work-flow/components/DynamicForm.vue @@ -0,0 +1,73 @@ + + + + diff --git a/src/views/Agent/work-flow/components/HistoryChat.vue b/src/views/Agent/work-flow/components/HistoryChat.vue new file mode 100644 index 0000000..5f138d7 --- /dev/null +++ b/src/views/Agent/work-flow/components/HistoryChat.vue @@ -0,0 +1,52 @@ + + + + + diff --git a/src/views/Agent/work-flow/components/WorkFlow.vue b/src/views/Agent/work-flow/components/WorkFlow.vue new file mode 100644 index 0000000..66d02e2 --- /dev/null +++ b/src/views/Agent/work-flow/components/WorkFlow.vue @@ -0,0 +1,217 @@ + + + + + diff --git a/src/views/Agent/work-flow/form/FormFieldRenderer.vue b/src/views/Agent/work-flow/form/FormFieldRenderer.vue new file mode 100644 index 0000000..563d2c9 --- /dev/null +++ b/src/views/Agent/work-flow/form/FormFieldRenderer.vue @@ -0,0 +1,37 @@ + + + diff --git a/src/views/Agent/work-flow/form/InputField.vue b/src/views/Agent/work-flow/form/InputField.vue new file mode 100644 index 0000000..b4a9616 --- /dev/null +++ b/src/views/Agent/work-flow/form/InputField.vue @@ -0,0 +1,31 @@ + + + diff --git a/src/views/Agent/work-flow/form/SelectField.vue b/src/views/Agent/work-flow/form/SelectField.vue new file mode 100644 index 0000000..0896a55 --- /dev/null +++ b/src/views/Agent/work-flow/form/SelectField.vue @@ -0,0 +1,31 @@ + + + diff --git a/src/views/Agent/work-flow/index.vue b/src/views/Agent/work-flow/index.vue new file mode 100644 index 0000000..689e663 --- /dev/null +++ b/src/views/Agent/work-flow/index.vue @@ -0,0 +1,83 @@ + + + + + diff --git a/src/views/Agent/work-flow/style.scss b/src/views/Agent/work-flow/style.scss new file mode 100644 index 0000000..203353e --- /dev/null +++ b/src/views/Agent/work-flow/style.scss @@ -0,0 +1,41 @@ +.chat-wrap { + .chat-contain { + font-family: Avenir, Helvetica, Arial, sans-serif; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + color: #2c3e50; + margin-top: 24px; + + .span-back { + color: var(--Text-2, #3C4043); + font-size: 14px; + font-family: Alibaba PuHuiTi; + font-weight: 400; + line-height: 62px; + word-wrap: break-word + } + } + + .span-back { + color: var(--Text-2, #3C4043); + font-size: 14px; + font-family: Alibaba PuHuiTi; + line-height: 22px; + word-wrap: break-word + } + + .content-container { + width: 40%; + background-color: #fff; + } + + .work-res-span { + padding: 24px; + line-height: 34px; + } + + .layout-sider{ + border-radius: 6px; + margin-left: 20px; + } +} From b3af007dd2db156156b165ff55220af50399713c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9E=97=E5=BF=97=E5=86=9B?= <543024265@qq.com> Date: Wed, 16 Jul 2025 18:49:28 +0800 Subject: [PATCH 07/65] =?UTF-8?q?feat(agent):=20=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E6=99=BA=E8=83=BD=E4=BD=93=E5=BA=94=E7=94=A8=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 添加智能体列表页面和相关API - 实现聊天功能,包括历史对话和当前对话 - 新增工作流功能,包括表单提交和结果展示- 优化路由配置,增加智能体相关路由 - 添加全局常量和枚举,用于智能体类型区分 --- src/api/all/agent.ts | 10 +- src/assets/svg/img.png | Bin 0 -> 1256 bytes src/main.ts | 9 +- src/router/routes/modules/agentDynamic.ts | 46 ++++++ .../Agent/Chat/components/HistoryChat.vue | 74 +++++++-- src/views/Agent/Chat/index.vue | 50 ++++-- src/views/Agent/Index/index.vue | 71 +++++--- src/views/Agent/Index/style.scss | 151 +++++++++++++++++- .../work-flow/components/DynamicForm.vue | 6 +- .../work-flow/components/HistoryChat.vue | 15 +- .../work-flow/form/FormFieldRenderer.vue | 37 ----- src/views/Agent/work-flow/form/InputField.vue | 31 ---- .../Agent/work-flow/form/SelectField.vue | 31 ---- src/views/Agent/work-flow/index.vue | 45 +++--- src/views/Agent/work-flow/style.scss | 18 ++- 15 files changed, 412 insertions(+), 182 deletions(-) create mode 100644 src/assets/svg/img.png create mode 100644 src/router/routes/modules/agentDynamic.ts delete mode 100644 src/views/Agent/work-flow/form/FormFieldRenderer.vue delete mode 100644 src/views/Agent/work-flow/form/InputField.vue delete mode 100644 src/views/Agent/work-flow/form/SelectField.vue diff --git a/src/api/all/agent.ts b/src/api/all/agent.ts index b258e45..d8cee3c 100644 --- a/src/api/all/agent.ts +++ b/src/api/all/agent.ts @@ -6,15 +6,15 @@ export const getChatAgent = (id: number) => { // 获取历史聊天 export const getHistoryChat = (params: any) => { - return Http.get(`/v1/agent/getConversations`, { params }); + return Http.get(`/v1/agent/getConversations`, params); }; // 获取智能体分类 export const getCategoriesMenus = () => { return Http.get(`/v1/agent/getCategoriesMenus`); }; -export const getAgentList = () => { - return Http.get(`/v1/agent/getAgentList`); +export const getAgentList = (params: any) => { + return Http.get(`/v1/agent/getAgentList`, params); }; // 获取工作流详情 @@ -26,3 +26,7 @@ export const getWorkFlowInfo = (id: number) => { export const executeWorkFlow = (params: any) => { return Http.post(`/v1/agent/executeWorkFlow`, params); }; + +export const delAgentMessage = (params: any) => { + return Http.post(`/v1/agent/delAgentMessage`, params); +}; diff --git a/src/assets/svg/img.png b/src/assets/svg/img.png new file mode 100644 index 0000000000000000000000000000000000000000..6503abc96e987dcc559c336227229466fc5a6ac1 GIT binary patch literal 1256 zcmVP)LXK6GouIF~uBJHlYV9 z7*oVqWfMG7rf8TyGuCCm zLbd8SK3d0Fj86)ieuj4+AEU;(9MPTWK4ap42y+s^Q^cb0SCGmp zN={<)k_M)5A;NhQ0qYbqqMlP!a*J(37Jrb4CS>s^@jT-fq`o^yI`O{s!nb9~BI*&e z3O`Sh&qTWo<(04l*?@z|1{_Q_;9#-=2a^prm~6noWCIQ+8!$b;skh8UBg@c7pwW3H)VC^Md>_h>@LFBd{yl52&c&oI81o*w~3tY;cD#VOM0>IPK2 z8w>MxMJq;8_+_fi8QFjetpVp*J*OKqgNoewmAxB4;5;ad-v#RuT~U1Ehz3||T{W+Y zR)}rEt*4^RyRs0pCY*1Nc}38~UWSfpfHp4)!%wz)! zXkafh*?%*oH@K6R&EIIqv}u(o<%bXYlL^vj1KoObyZjopgfu~aEtLU+l0XlIOic^ z;f;nK%td2!Hgk$zyLMa zKwHRJ8=(1?z%f)07@!6lj4lLYXFOoOXRJ}*5;%tH0Rvj~+22+V_RXY1?GFk z(i))Uaddy5Y=if0q*F2Pb)q|E#Set;x$D9_&8sv>cgJUqGmm)Y! zf2+-rz#L9AU+aPXKEgwr<7s}8+(1wFMumnYR(imVBjIi4h)fTQCYQU;K=I5NvpU>^ zcN2zBZg!nvi}lb|d}6_s*yn)~m_fQVQvAvm { + await loadDynamicMenus(router); // 传入 router 实例 + + console.log(router,'router') + app.mount('#app'); +}); diff --git a/src/router/routes/modules/agentDynamic.ts b/src/router/routes/modules/agentDynamic.ts new file mode 100644 index 0000000..720a7df --- /dev/null +++ b/src/router/routes/modules/agentDynamic.ts @@ -0,0 +1,46 @@ +import { getCategoriesMenus } from '@/api/all/agent'; +import type { AppRouteRecordRaw } from '../types'; +import { MENU_GROUP_IDS } from '@/router/constants'; +import IconRepository from '@/assets/svg/icon-repository.svg'; +import { IconBookmark } from '@arco-design/web-vue/es/icon'; + +export const loadDynamicMenus = async (routerInstance) => { + try { + const { code, data } = await getCategoriesMenus(); + + let router = [ + { + path: '/repository233', + name: 'Repository', + redirect: 'repository/brandMaterials', + meta: { + locale: '品牌资产管理', + icon: IconRepository, + requiresAuth: true, + requireLogin: true, + roles: ['*'], + id: MENU_GROUP_IDS.PROPERTY_ID, + }, + children: [ + { + path: 'brandMaterials', + name: 'RepositoryBrandMaterials', + meta: { + locale: '品牌信息', + requiresAuth: true, + requireLogin: true, + roles: ['*'], + }, + component: () => import('@/views/property-marketing/brands/brand-materials/index.vue'), + }, + ], + }, + ]; + // 添加子路由到名为 Agent 的父路由下 + router.forEach(route => { + routerInstance.addRoute('Agent', route); + }); + } catch (error) { + console.error('Failed to load dynamic menus:', error); + } +}; diff --git a/src/views/Agent/Chat/components/HistoryChat.vue b/src/views/Agent/Chat/components/HistoryChat.vue index af7802e..c3abfd3 100644 --- a/src/views/Agent/Chat/components/HistoryChat.vue +++ b/src/views/Agent/Chat/components/HistoryChat.vue @@ -1,27 +1,39 @@ @@ -48,4 +75,19 @@ onMounted(() => { .logo { margin-bottom: 20px; } + +.menu-title { + color: var(--Text-1, #211f24); + font-size: 18px; + font-family: Alibaba PuHuiTi; + font-weight: 400; + line-height: 26px; + word-wrap: break-word; +} +.agent-img { + width: 100%; + height: 230px; + border-radius: 4px; +} + diff --git a/src/views/Agent/Chat/index.vue b/src/views/Agent/Chat/index.vue index 96f616e..7cf179c 100644 --- a/src/views/Agent/Chat/index.vue +++ b/src/views/Agent/Chat/index.vue @@ -1,9 +1,15 @@ diff --git a/src/views/Agent/work-flow/form/InputField.vue b/src/views/Agent/work-flow/form/InputField.vue deleted file mode 100644 index b4a9616..0000000 --- a/src/views/Agent/work-flow/form/InputField.vue +++ /dev/null @@ -1,31 +0,0 @@ - - - diff --git a/src/views/Agent/work-flow/form/SelectField.vue b/src/views/Agent/work-flow/form/SelectField.vue deleted file mode 100644 index 0896a55..0000000 --- a/src/views/Agent/work-flow/form/SelectField.vue +++ /dev/null @@ -1,31 +0,0 @@ - - - diff --git a/src/views/Agent/work-flow/index.vue b/src/views/Agent/work-flow/index.vue index 689e663..824ae77 100644 --- a/src/views/Agent/work-flow/index.vue +++ b/src/views/Agent/work-flow/index.vue @@ -1,27 +1,21 @@ diff --git a/src/router/index.ts b/src/router/index.ts index af3a60b..93c5b5c 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -38,7 +38,18 @@ export const router = createRouter({ { path: '/agent/chat', name: 'Chat', - component: () => import('@/views/Agent/chat'), + component: () => import('@/views/agent/chat'), + meta: { + hideSidebar: true, + requiresAuth: false, + requireLogin: true, + id: MENU_GROUP_IDS.WORK_BENCH_ID, + }, + }, + { + path: '/agent/workFlow', + name: 'WorkFlow', + component: () => import('@/views/agent/work-flow'), meta: { hideSidebar: true, requiresAuth: false, diff --git a/src/router/routes/modules/agent.ts b/src/router/routes/modules/agent.ts index 24544a0..b7619da 100644 --- a/src/router/routes/modules/agent.ts +++ b/src/router/routes/modules/agent.ts @@ -4,42 +4,31 @@ import { MENU_GROUP_IDS } from '@/router/constants'; import IconRepository from '@/assets/svg/icon-repository.svg'; const COMPONENTS: AppRouteRecordRaw[] = [ - { - path: '/agent', - name: 'Agent', - redirect: 'agent/index', - meta: { - locale: '扣子智能体', - icon: IconRepository, - requiresAuth: true, - requireLogin: true, - roles: ['*'], - id: MENU_GROUP_IDS.PROPERTY_ID, - }, - children: [ - { - path: 'index', - name: 'AgentIndex', - component: () => import('@/views/agent/index'), - meta: { - requiresAuth: false, - requireLogin: true, - id: MENU_GROUP_IDS.WORK_BENCH_ID, - }, - }, - { - path: 'chat', - name: 'Chat', - component: () => import('@/views/agent/chat'), - meta: { - hideSidebar: true, - requiresAuth: false, - requireLogin: true, - id: MENU_GROUP_IDS.WORK_BENCH_ID, - }, - }, - ], - }, + // { + // path: '/agent', + // name: 'Agent', + // redirect: 'agent/index', + // meta: { + // locale: '扣子智能体', + // icon: IconRepository, + // requiresAuth: true, + // requireLogin: true, + // roles: ['*'], + // id: MENU_GROUP_IDS.AGENT, + // }, + // children: [ + // { + // path: 'index', + // name: 'AgentIndex', + // component: () => import('@/views/agent/index'), + // meta: { + // requiresAuth: false, + // requireLogin: true, + // }, + // } + // + // ], + // }, ]; export default COMPONENTS; diff --git a/src/views/Agent/Chat/components/ChatBox.vue b/src/views/Agent/Chat/components/ChatBox.vue deleted file mode 100644 index b2f5b32..0000000 --- a/src/views/Agent/Chat/components/ChatBox.vue +++ /dev/null @@ -1,36 +0,0 @@ - - - diff --git a/src/views/Agent/Chat/components/CozeChat.vue b/src/views/Agent/Chat/components/CozeChat.vue deleted file mode 100644 index 66d02e2..0000000 --- a/src/views/Agent/Chat/components/CozeChat.vue +++ /dev/null @@ -1,217 +0,0 @@ - - - - - diff --git a/src/views/Agent/work-flow/components/WorkFlow.vue b/src/views/Agent/work-flow/components/WorkFlow.vue deleted file mode 100644 index 66d02e2..0000000 --- a/src/views/Agent/work-flow/components/WorkFlow.vue +++ /dev/null @@ -1,217 +0,0 @@ - - - - - diff --git a/src/views/Agent/AgentConstants.ts b/src/views/agent/AgentConstants.ts similarity index 100% rename from src/views/Agent/AgentConstants.ts rename to src/views/agent/AgentConstants.ts diff --git a/src/views/Agent/Chat/components/HistoryChat.vue b/src/views/agent/chat/components/HistoryChat.vue similarity index 100% rename from src/views/Agent/Chat/components/HistoryChat.vue rename to src/views/agent/chat/components/HistoryChat.vue diff --git a/src/views/Agent/Chat/index.vue b/src/views/agent/chat/index.vue similarity index 93% rename from src/views/Agent/Chat/index.vue rename to src/views/agent/chat/index.vue index 5f42670..542333c 100644 --- a/src/views/Agent/Chat/index.vue +++ b/src/views/agent/chat/index.vue @@ -27,7 +27,7 @@ import { useRouter } from 'vue-router'; const router = useRouter(); // 存储认证令牌 -const authToken = ref('pat_tuIM7jubM1hLXaIWzbWg1U15lBe66AlYwu9BkXMQXInh8VdPszRFTwlTPmdziHwg'); +const authToken = ref(''); // 模拟从API获取token const fetchToken = async () => { @@ -89,9 +89,8 @@ const initChat = async () => { }; const cozeWebSdkConfig = (botId, name, auth) => { - console.log(name, 'title'); auth.onRefreshToken = function () { - return 'pat_tuIM7jubM1hLXaIWzbWg1U15lBe66AlYwu9BkXMQXInh8VdPszRFTwlTPmdziHwg'; + return ''; }; let config = { config: { @@ -105,6 +104,9 @@ const cozeWebSdkConfig = (botId, name, auth) => { title: name, isNeedFunctionCallMessage: true, }, + footer:{ + expressionText:"内容由AI生成,无法确保真实准确,仅供参考。", + }, }, auth: auth, base: { diff --git a/src/views/Agent/Chat/style.scss b/src/views/agent/chat/style.scss similarity index 100% rename from src/views/Agent/Chat/style.scss rename to src/views/agent/chat/style.scss diff --git a/src/views/Agent/Index/index.vue b/src/views/agent/index/index.vue similarity index 98% rename from src/views/Agent/Index/index.vue rename to src/views/agent/index/index.vue index ea730a0..c81addc 100644 --- a/src/views/Agent/Index/index.vue +++ b/src/views/agent/index/index.vue @@ -2,7 +2,7 @@
{ }; const query = reactive({ - title: '', + name: '', }); const goDetail = (type: number, id: number) => { if (type === 1) { diff --git a/src/views/Agent/Index/style.scss b/src/views/agent/index/style.scss similarity index 100% rename from src/views/Agent/Index/style.scss rename to src/views/agent/index/style.scss diff --git a/src/views/Agent/work-flow/components/DynamicForm.vue b/src/views/agent/work-flow/components/DynamicForm.vue similarity index 55% rename from src/views/Agent/work-flow/components/DynamicForm.vue rename to src/views/agent/work-flow/components/DynamicForm.vue index 73ea51f..2dbe195 100644 --- a/src/views/Agent/work-flow/components/DynamicForm.vue +++ b/src/views/agent/work-flow/components/DynamicForm.vue @@ -4,16 +4,30 @@ - - - - - - + + + + + + {{ option.label }} @@ -25,6 +39,7 @@ diff --git a/src/views/Agent/work-flow/components/HistoryChat.vue b/src/views/agent/work-flow/components/HistoryChat.vue similarity index 72% rename from src/views/Agent/work-flow/components/HistoryChat.vue rename to src/views/agent/work-flow/components/HistoryChat.vue index 671927f..a9c7d0b 100644 --- a/src/views/Agent/work-flow/components/HistoryChat.vue +++ b/src/views/agent/work-flow/components/HistoryChat.vue @@ -5,11 +5,10 @@
- {{ cozeInfo.title }} + {{ cozeInfo.name }} {{ cozeInfo.type == 1 ? '智能体' : '对话式' }} - {{ cozeInfo.views }}次使用 + {{ cozeInfo.views }}次使用 - 历史对话 @@ -28,15 +27,8 @@ const props = defineProps({ default: '', }, }); -console.log(props.cozeInfo, 'cozeInfo'); -const getHistoryChat = async () => { - const { code, data } = await getHistoryChat({ botId: props.botId }); - console.log(data, 'data'); - // 获取历史对话 -}; onMounted(() => { - getHistoryChat(); }); diff --git a/src/views/Agent/work-flow/index.vue b/src/views/agent/work-flow/index.vue similarity index 81% rename from src/views/Agent/work-flow/index.vue rename to src/views/agent/work-flow/index.vue index 824ae77..4349dbd 100644 --- a/src/views/Agent/work-flow/index.vue +++ b/src/views/agent/work-flow/index.vue @@ -13,9 +13,8 @@ -
- {{ workFlowRes?.output }} -
+
+
@@ -26,9 +25,11 @@ diff --git a/src/views/agent/chat/components/history.scss b/src/views/agent/chat/components/history.scss new file mode 100644 index 0000000..d2b4103 --- /dev/null +++ b/src/views/agent/chat/components/history.scss @@ -0,0 +1,227 @@ + +.agent-card { + width: 100%; + height: 100%; + background: var(--BG-100, #F7F8FA); + overflow: hidden; + border-radius: 8px; + display: flex; + flex-direction: column; + justify-content: flex-start; + align-items: flex-start; + + .header-section { + align-self: stretch; + height: 160px; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + gap: 10px; + + .image-container { + align-self: stretch; + flex: 1 1 0; + position: relative; + background: #FFEDED; + overflow: hidden; + border-radius: 8px; + + img { + width: 408.14px; + height: 219px; + left: -24.07px; + top: -29px; + position: absolute; + } + } + } + + .info-section { + align-self: stretch; + padding-top: 15px; + padding-bottom: 15px; + display: flex; + justify-content: space-between; + align-items: flex-start; + + .title-group { + display: flex; + justify-content: flex-start; + align-items: center; + gap: 4px; + + .title { + color: var(--Text-1, #211F24); + font-size: 18px; + font-family: 'Alibaba PuHuiTi', sans-serif; + font-weight: 400; + line-height: 26px; + } + + .tag { + height: 20px; + padding: 0 8px; + background: var(--Brand-1, #F0EDFF); + border-radius: 2px; + display: flex; + justify-content: flex-start; + align-items: center; + gap: 4px; + + .icon { + width: 12px; + height: 12px; + position: relative; + + &::before { + content: ''; + width: 10.74px; + height: 10.50px; + left: 0.63px; + top: 0.75px; + position: absolute; + background: var(--Brand-6, #6D4CFE); + } + } + + .text { + color: var(--Brand-6, #6D4CFE); + font-size: 12px; + font-family: 'Alibaba PuHuiTi', sans-serif; + font-weight: 400; + line-height: 20px; + } + } + } + + .usage-info { + width: 79px; + height: 24px; + position: relative; + + .count { + left: 0px; + top: 0px; + position: absolute; + color: var(--Text-2, #3C4043); + font-size: 16px; + font-family: 'Alibaba PuHuiTi', sans-serif; + font-weight: 400; + line-height: 24px; + } + + .label { + left: 43px; + top: 3px; + position: absolute; + color: var(--Text-3, #737478); + font-size: 12px; + font-family: 'Alibaba PuHuiTi', sans-serif; + font-weight: 400; + line-height: 20px; + } + } + } + + .description-section { + align-self: stretch; + overflow: hidden; + display: flex; + flex-direction: column; + justify-content: flex-start; + align-items: center; + gap: 10px; + + .description { + align-self: stretch; + color: var(--Text-2, #3C4043); + font-size: 14px; + font-family: 'Alibaba PuHuiTi', sans-serif; + font-weight: 400; + line-height: 22px; + } + } + + .divider { + align-self: stretch; + height: 0px; + outline: 1px var(--Border-2, #E6E6E8) solid; + outline-offset: -0.50px; + } + + .history-section { + align-self: stretch; + flex: 1 1 0; + position: relative; + display: flex; + flex-direction: column; + justify-content: flex-start; + align-items: flex-start; + + .history-title { + align-self: stretch; + height: 40px; + display: flex; + justify-content: flex-start; + align-items: center; + gap: 10px; + + .text { + color: var(--Text-3, #737478); + font-size: 14px; + font-family: 'Alibaba PuHuiTi', sans-serif; + font-weight: 400; + line-height: 22px; + } + } + + .history-list { + align-self: stretch; + display: flex; + flex-direction: column; + justify-content: flex-start; + align-items: flex-start; + + .history-item { + align-self: stretch; + height: 40px; + padding: 8px; + border-radius: 8px; + display: flex; + justify-content: flex-start; + align-items: center; + gap: 10px; + + .item-text { + flex: 1 1 0; + color: var(--Text-1, #211F24); + font-size: 14px; + font-family: 'Alibaba PuHuiTi', sans-serif; + font-weight: 400; + line-height: 22px; + } + } + } + + .scroll-indicator { + width: 8px; + height: 240px; + padding: 8px 1px; + position: absolute; + left: 362px; + top: 40px; + display: flex; + justify-content: flex-start; + align-items: flex-start; + gap: 10px; + + .indicator-bar { + flex: 1 1 0; + height: 80px; + background: var(--BG-600, #939499); + border-radius: 4px; + } + } + } +} diff --git a/src/views/agent/index/index.vue b/src/views/agent/index/index.vue index c81addc..01f81e0 100644 --- a/src/views/agent/index/index.vue +++ b/src/views/agent/index/index.vue @@ -24,15 +24,23 @@
{{ product?.name }}
{{ product?.description }}
+ @@ -47,7 +55,8 @@ diff --git a/src/views/agent/work-flow/components/history.scss b/src/views/agent/work-flow/components/history.scss new file mode 100644 index 0000000..b212e99 --- /dev/null +++ b/src/views/agent/work-flow/components/history.scss @@ -0,0 +1,198 @@ +.container { + width: 100%; + height: 100%; + background: var(--BG-100, #F7F8FA); + overflow: hidden; + border-radius: 8px; + flex-direction: column; + justify-content: flex-start; + align-items: flex-start; + display: inline-flex; +} + +.header-image-container { + align-self: stretch; + height: 160px; + flex-direction: column; + justify-content: center; + align-items: center; + gap: 10px; + display: flex; +} + +.header-image { + align-self: stretch; + flex: 1 1 0; + position: relative; + background: #FFEDED; + overflow: hidden; + border-radius: 8px; +} + +.header-image img { + width: 408.90px; + height: 218px; + left: -24.45px; + top: -29px; + position: absolute; +} + +.title-container { + align-self: stretch; + padding-top: 15px; + padding-bottom: 15px; + justify-content: space-between; + align-items: flex-start; + display: inline-flex; +} + +.title { + justify-content: center; + display: flex; + flex-direction: column; + color: var(--Text-1, #211F24); + font-size: 18px; + padding: 5px; + font-family: Alibaba PuHuiTi; + font-weight: 400; + line-height: 26px; + word-wrap: break-word; +} + +.tag { + height: 20px; + padding-left: 8px; + padding-right: 8px; + background: var(--Functional-Red-1, #FFE9E7); + overflow: hidden; + border-radius: 2px; + justify-content: flex-start; + align-items: center; + gap: 4px; + display: flex; +} + +.tag-icon { + width: 12px; + height: 12px; + position: relative; +} + +.tag-icon-inner { + width: 11.50px; + height: 10.75px; + left: 0.25px; + top: 0.63px; + position: absolute; + background: var(--Functional-Red-6, #F64B31); +} + +.tag-text { + color: var(--Functional-Red-6, #F64B31); + font-size: 12px; + font-family: Alibaba PuHuiTi; + font-weight: 400; + line-height: 20px; + word-wrap: break-word; +} + +.usage-stats { + width: 79px; + height: 24px; + position: relative; +} + +.usage-count { + left: 0px; + top: 0px; + position: absolute; + color: var(--Text-2, #3C4043); + font-size: 16px; + font-family: Alibaba PuHuiTi; + font-weight: 400; + line-height: 24px; + word-wrap: break-word; +} + +.usage-label { + left: 43px; + top: 3px; + position: absolute; + color: var(--Text-3, #737478); + font-size: 12px; + font-family: Alibaba PuHuiTi; + font-weight: 400; + line-height: 20px; + word-wrap: break-word; +} + +.description { + align-self: stretch; + color: var(--Text-2, #3C4043); + font-size: 14px; + font-family: Alibaba PuHuiTi; + font-weight: 400; + line-height: 22px; + word-wrap: break-word; + padding-inline: 5px; +} + +.divider { + align-self: stretch; + height: 0px; + outline: 1px var(--Border-2, #E6E6E8) solid; + outline-offset: -0.50px; +} + +.history-title { + color: var(--Text-3, #737478); + font-size: 14px; + font-family: Alibaba PuHuiTi; + font-weight: 400; + line-height: 22px; + word-wrap: break-word; +} + +.history-item { + align-self: stretch; + height: 40px; + padding: 8px; + border-radius: 8px; + justify-content: flex-start; + align-items: center; + gap: 10px; + display: inline-flex; +} + +.history-item-text { + flex: 1 1 0; + color: var(--Text-1, #211F24); + font-size: 14px; + font-family: Alibaba PuHuiTi; + font-weight: 400; + line-height: 22px; + word-wrap: break-word; +} + +.scroll-indicator { + width: 8px; + height: 240px; + padding-left: 1px; + padding-right: 1px; + padding-top: 8px; + padding-bottom: 8px; + left: 362px; + top: 40px; + position: absolute; + justify-content: flex-start; + align-items: flex-start; + gap: 10px; + display: inline-flex; +} + +.scroll-indicator-bar { + flex: 1 1 0; + height: 80px; + background: var(--BG-600, #939499); + border-radius: 4px; +} diff --git a/src/views/agent/work-flow/index.vue b/src/views/agent/work-flow/index.vue index 4349dbd..c91b716 100644 --- a/src/views/agent/work-flow/index.vue +++ b/src/views/agent/work-flow/index.vue @@ -5,7 +5,7 @@
- + @@ -24,7 +24,7 @@ diff --git a/src/views/agent/work-flow/components/history.scss b/src/views/agent/work-flow/components/history.scss index b212e99..e70c356 100644 --- a/src/views/agent/work-flow/components/history.scss +++ b/src/views/agent/work-flow/components/history.scss @@ -1,198 +1,225 @@ -.container { + +.agent-card { width: 100%; height: 100%; background: var(--BG-100, #F7F8FA); overflow: hidden; border-radius: 8px; + display: flex; flex-direction: column; justify-content: flex-start; align-items: flex-start; - display: inline-flex; -} -.header-image-container { - align-self: stretch; - height: 160px; - flex-direction: column; - justify-content: center; - align-items: center; - gap: 10px; - display: flex; -} + .header-section { + align-self: stretch; + height: 300px; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + gap: 10px; -.header-image { - align-self: stretch; - flex: 1 1 0; - position: relative; - background: #FFEDED; - overflow: hidden; - border-radius: 8px; -} + .image-container { + height: 400px; + overflow: hidden; + border-radius: 8px; + } -.header-image img { - width: 408.90px; - height: 218px; - left: -24.45px; - top: -29px; - position: absolute; -} + .image-container img { + width: 100%; + height: auto; + aspect-ratio: 1 / 1; + object-fit: cover; + } + } -.title-container { - align-self: stretch; - padding-top: 15px; - padding-bottom: 15px; - justify-content: space-between; - align-items: flex-start; - display: inline-flex; -} + .info-section { + align-self: stretch; + padding-top: 15px; + padding-bottom: 15px; + display: flex; + justify-content: space-between; + align-items: flex-start; -.title { - justify-content: center; - display: flex; - flex-direction: column; - color: var(--Text-1, #211F24); - font-size: 18px; - padding: 5px; - font-family: Alibaba PuHuiTi; - font-weight: 400; - line-height: 26px; - word-wrap: break-word; -} + .title-group { + display: flex; + justify-content: flex-start; + align-items: center; + gap: 4px; -.tag { - height: 20px; - padding-left: 8px; - padding-right: 8px; - background: var(--Functional-Red-1, #FFE9E7); - overflow: hidden; - border-radius: 2px; - justify-content: flex-start; - align-items: center; - gap: 4px; - display: flex; -} + .title { + color: var(--Text-1, #211F24); + font-size: 18px; + font-family: 'Alibaba PuHuiTi', sans-serif; + font-weight: 400; + line-height: 26px; + padding: 10px; + } -.tag-icon { - width: 12px; - height: 12px; - position: relative; -} + .tag { + height: 20px; + padding: 0 8px; + background: var(--Functional-Red-1, #FFE9E7); + border-radius: 2px; + display: flex; + justify-content: flex-start; + align-items: center; + gap: 4px; -.tag-icon-inner { - width: 11.50px; - height: 10.75px; - left: 0.25px; - top: 0.63px; - position: absolute; - background: var(--Functional-Red-6, #F64B31); -} + .icon { + width: 12px; + height: 12px; + position: relative; -.tag-text { - color: var(--Functional-Red-6, #F64B31); - font-size: 12px; - font-family: Alibaba PuHuiTi; - font-weight: 400; - line-height: 20px; - word-wrap: break-word; -} + &::before { + content: ''; + width: 10.74px; + height: 10.50px; + left: 0.63px; + top: 0.75px; + position: absolute; + background: var(--Brand-6, #6D4CFE); + } + } -.usage-stats { - width: 79px; - height: 24px; - position: relative; -} + .text { + color: var(--Functional-Red-6, #F64B31); + font-size: 12px; + font-family: 'Alibaba PuHuiTi', sans-serif; + font-weight: 400; + line-height: 20px; + } + } + } -.usage-count { - left: 0px; - top: 0px; - position: absolute; - color: var(--Text-2, #3C4043); - font-size: 16px; - font-family: Alibaba PuHuiTi; - font-weight: 400; - line-height: 24px; - word-wrap: break-word; -} + .usage-info { + width: 79px; + height: 34px; + position: relative; -.usage-label { - left: 43px; - top: 3px; - position: absolute; - color: var(--Text-3, #737478); - font-size: 12px; - font-family: Alibaba PuHuiTi; - font-weight: 400; - line-height: 20px; - word-wrap: break-word; -} + .count { + left: 0px; + top: 10px; + position: absolute; + color: var(--Text-2, #3C4043); + font-size: 16px; + font-family: 'Alibaba PuHuiTi', sans-serif; + font-weight: 400; + line-height: 24px; + } -.description { - align-self: stretch; - color: var(--Text-2, #3C4043); - font-size: 14px; - font-family: Alibaba PuHuiTi; - font-weight: 400; - line-height: 22px; - word-wrap: break-word; - padding-inline: 5px; -} + .label { + left: 43px; + top: 10px; + position: absolute; + color: var(--Text-3, #737478); + font-size: 12px; + font-family: 'Alibaba PuHuiTi', sans-serif; + font-weight: 400; + line-height: 20px; + } + } + } -.divider { - align-self: stretch; - height: 0px; - outline: 1px var(--Border-2, #E6E6E8) solid; - outline-offset: -0.50px; -} + .description-section { + align-self: stretch; + overflow: hidden; + display: flex; + flex-direction: column; + justify-content: flex-start; + align-items: center; + gap: 10px; -.history-title { - color: var(--Text-3, #737478); - font-size: 14px; - font-family: Alibaba PuHuiTi; - font-weight: 400; - line-height: 22px; - word-wrap: break-word; -} + .description { + align-self: stretch; + color: var(--Text-2, #3C4043); + font-size: 14px; + font-family: 'Alibaba PuHuiTi', sans-serif; + font-weight: 400; + line-height: 22px; + padding: 10px; + } + } -.history-item { - align-self: stretch; - height: 40px; - padding: 8px; - border-radius: 8px; - justify-content: flex-start; - align-items: center; - gap: 10px; - display: inline-flex; -} + .divider { + align-self: stretch; + height: 0px; + outline: 1px var(--Border-2, #E6E6E8) solid; + outline-offset: -0.50px; + } -.history-item-text { - flex: 1 1 0; - color: var(--Text-1, #211F24); - font-size: 14px; - font-family: Alibaba PuHuiTi; - font-weight: 400; - line-height: 22px; - word-wrap: break-word; -} + .history-section { + align-self: stretch; + flex: 1 1 0; + position: relative; + display: flex; + flex-direction: column; + justify-content: flex-start; + align-items: flex-start; -.scroll-indicator { - width: 8px; - height: 240px; - padding-left: 1px; - padding-right: 1px; - padding-top: 8px; - padding-bottom: 8px; - left: 362px; - top: 40px; - position: absolute; - justify-content: flex-start; - align-items: flex-start; - gap: 10px; - display: inline-flex; -} + .history-title { + align-self: stretch; + height: 40px; + display: flex; + justify-content: flex-start; + align-items: center; + gap: 10px; -.scroll-indicator-bar { - flex: 1 1 0; - height: 80px; - background: var(--BG-600, #939499); - border-radius: 4px; + .text { + color: var(--Functional-Red-6, #F64B31); + font-size: 14px; + font-family: 'Alibaba PuHuiTi', sans-serif; + font-weight: 400; + line-height: 22px; + } + } + + .history-list { + align-self: stretch; + display: flex; + flex-direction: column; + justify-content: flex-start; + align-items: flex-start; + + .history-item { + align-self: stretch; + height: 40px; + padding: 8px; + border-radius: 8px; + display: flex; + justify-content: flex-start; + align-items: center; + gap: 10px; + + .item-text { + flex: 1 1 0; + color: var(--Text-1, #211F24); + font-size: 14px; + font-family: 'Alibaba PuHuiTi', sans-serif; + font-weight: 400; + line-height: 22px; + } + } + } + + .scroll-indicator { + width: 8px; + height: 240px; + padding: 8px 1px; + position: absolute; + left: 362px; + top: 40px; + display: flex; + justify-content: flex-start; + align-items: flex-start; + gap: 10px; + + .indicator-bar { + flex: 1 1 0; + height: 80px; + background: var(--BG-600, #939499); + border-radius: 4px; + } + } + } } From 6a43cfad75114e6ede9faf91447cc78874033005 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9E=97=E5=BF=97=E5=86=9B?= <543024265@qq.com> Date: Mon, 28 Jul 2025 14:45:32 +0800 Subject: [PATCH 18/65] =?UTF-8?q?refactor(agent):=20=E9=87=8D=E6=9E=84?= =?UTF-8?q?=E6=99=BA=E8=83=BD=E4=BD=93=E9=A1=B5=E9=9D=A2=E5=B8=83=E5=B1=80?= =?UTF-8?q?=E5=92=8C=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -调整了智能体卡片的布局结构,优化了标题和描述的显示方式 - 改进了历史对话的展示样式,增加了滚动指示器 - 统一了标签和图标的样式,提升了视觉一致性 - 优化了搜索框和卡片列表的样式,提高了用户体验 --- src/router/routes/modules/agent.ts | 4 ++-- src/views/agent/chat/components/HistoryChat.vue | 2 +- src/views/agent/chat/components/history.scss | 5 ++--- src/views/agent/chat/index.vue | 3 ++- src/views/agent/chat/style.scss | 15 +++++++++++++++ src/views/agent/index/index.vue | 6 +++++- 6 files changed, 27 insertions(+), 8 deletions(-) diff --git a/src/router/routes/modules/agent.ts b/src/router/routes/modules/agent.ts index c97b82d..c9efb45 100644 --- a/src/router/routes/modules/agent.ts +++ b/src/router/routes/modules/agent.ts @@ -9,7 +9,7 @@ const COMPONENTS: AppRouteRecordRaw[] = [ name: 'Agent', redirect: 'agent/index', meta: { - locale: '扣子智能体', + locale: '灵机ai', icon: IconRepository, requiresAuth: true, requireLogin: true, @@ -22,7 +22,7 @@ const COMPONENTS: AppRouteRecordRaw[] = [ name: 'AgentIndex', component: () => import('@/views/agent/index'), meta: { - locale:'ai应用', + locale:'智能体应用', requiresAuth: false, requireLogin: true, }, diff --git a/src/views/agent/chat/components/HistoryChat.vue b/src/views/agent/chat/components/HistoryChat.vue index b68b64b..e572ac6 100644 --- a/src/views/agent/chat/components/HistoryChat.vue +++ b/src/views/agent/chat/components/HistoryChat.vue @@ -9,7 +9,7 @@
{{cozeInfo.name}}
-
+
返回空间
- + @@ -136,4 +136,5 @@ onUnmounted(() => { diff --git a/src/views/agent/chat/style.scss b/src/views/agent/chat/style.scss index 5e867e7..780a2d8 100644 --- a/src/views/agent/chat/style.scss +++ b/src/views/agent/chat/style.scss @@ -24,4 +24,19 @@ line-height: 22px; word-wrap: break-word } + .custom-sider { + width: 20% !important; // 强制覆盖 + } + + @media (min-width: 1400px) and (max-width: 1799px) { + .custom-sider { + width: 30% !important; + } + } + + @media (min-width: 1800px) { + .custom-sider { + width: 15% !important; + } + } } diff --git a/src/views/agent/index/index.vue b/src/views/agent/index/index.vue index 5f467af..f816baa 100644 --- a/src/views/agent/index/index.vue +++ b/src/views/agent/index/index.vue @@ -15,7 +15,11 @@
{{ item.name }} - +
Date: Mon, 28 Jul 2025 16:08:02 +0800 Subject: [PATCH 19/65] =?UTF-8?q?refactor(agent):=20=E9=87=8D=E6=9E=84?= =?UTF-8?q?=E6=99=BA=E8=83=BD=E4=BD=93=E9=A1=B5=E9=9D=A2=E5=B8=83=E5=B1=80?= =?UTF-8?q?=E5=92=8C=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -调整了智能体卡片的布局结构,优化了标题和描述的显示方式 - 改进了历史对话的展示样式,增加了滚动指示器 - 统一了标签和图标的样式,提升了视觉一致性 - 优化了搜索框和卡片列表的样式,提高了用户体验 --- src/assets/svg/menu-fold.svg | 3 ++ src/assets/svg/menu-unfold.svg | 3 ++ src/layouts/Page.vue | 3 +- src/router/routes/modules/agent.ts | 1 + src/views/agent/chat/index.vue | 52 ++++++++++++++++++++++-------- src/views/agent/chat/style.scss | 2 ++ src/views/agent/index/index.vue | 10 +++--- src/views/agent/index/style.scss | 1 + 8 files changed, 56 insertions(+), 19 deletions(-) create mode 100644 src/assets/svg/menu-fold.svg create mode 100644 src/assets/svg/menu-unfold.svg diff --git a/src/assets/svg/menu-fold.svg b/src/assets/svg/menu-fold.svg new file mode 100644 index 0000000..08a646c --- /dev/null +++ b/src/assets/svg/menu-fold.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/assets/svg/menu-unfold.svg b/src/assets/svg/menu-unfold.svg new file mode 100644 index 0000000..fde0009 --- /dev/null +++ b/src/assets/svg/menu-unfold.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/layouts/Page.vue b/src/layouts/Page.vue index 6f6a6aa..d9fbcb5 100644 --- a/src/layouts/Page.vue +++ b/src/layouts/Page.vue @@ -8,6 +8,7 @@ const route = useRoute(); const routerKey = computed(() => { return route.path + Math.random(); }); +const hideFooter = computed(() => route.meta?.hideFooter); /*** - end */ @@ -19,7 +20,7 @@ const routerKey = computed(() => { - + 闽公网安备 352018502850842号 闽ICP备20250520582号 © 2025小题科技,All Rights Reserved. * 数据通过公开渠道获取,灵机进行统计分析 diff --git a/src/router/routes/modules/agent.ts b/src/router/routes/modules/agent.ts index c9efb45..2707987 100644 --- a/src/router/routes/modules/agent.ts +++ b/src/router/routes/modules/agent.ts @@ -25,6 +25,7 @@ const COMPONENTS: AppRouteRecordRaw[] = [ locale:'智能体应用', requiresAuth: false, requireLogin: true, + hideFooter: true, }, } ], diff --git a/src/views/agent/chat/index.vue b/src/views/agent/chat/index.vue index 566150f..23c4301 100644 --- a/src/views/agent/chat/index.vue +++ b/src/views/agent/chat/index.vue @@ -1,19 +1,36 @@ @@ -23,11 +40,19 @@ import { ref, onMounted } from 'vue'; import { getChatAgent } from '@/api/all/agent'; import HistoryChat from './components/HistoryChat.vue'; import { useRouter } from 'vue-router'; +import menuFold from '@/assets/svg/menu-fold.svg'; +import menuUnfold from '@/assets/svg/menu-unfold.svg'; const router = useRouter(); // 存储认证令牌 const authToken = ref(''); +const isCollapsed = ref(false); + +// 切换折叠状态 +const toggleCollapse = () => { + isCollapsed.value = !isCollapsed.value; +}; // 模拟从API获取token const fetchToken = async () => { @@ -136,5 +161,4 @@ onUnmounted(() => { diff --git a/src/views/agent/chat/style.scss b/src/views/agent/chat/style.scss index 780a2d8..e2128d4 100644 --- a/src/views/agent/chat/style.scss +++ b/src/views/agent/chat/style.scss @@ -39,4 +39,6 @@ width: 15% !important; } } + + } diff --git a/src/views/agent/index/index.vue b/src/views/agent/index/index.vue index f816baa..c6d7a7f 100644 --- a/src/views/agent/index/index.vue +++ b/src/views/agent/index/index.vue @@ -1,7 +1,7 @@ @@ -30,9 +58,17 @@ import { executeWorkFlow, getWorkFlowInfo } 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'; const formFields = ref({}); +// 是否折叠状态 +const isCollapsed = ref(false); +// 切换折叠状态 +const toggleCollapse = () => { + isCollapsed.value = !isCollapsed.value; +}; // 表单数据对象(动态生成初始值) const formData = ref({}); From 82175b4096a0c366b522cb66966608d4cec4c9ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9E=97=E5=BF=97=E5=86=9B?= <543024265@qq.com> Date: Mon, 28 Jul 2025 17:25:23 +0800 Subject: [PATCH 22/65] =?UTF-8?q?refactor(agent):=20=E9=87=8D=E6=9E=84?= =?UTF-8?q?=E6=99=BA=E8=83=BD=E4=BD=93=E9=A1=B5=E9=9D=A2=E5=B8=83=E5=B1=80?= =?UTF-8?q?=E5=92=8C=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -调整了智能体卡片的布局结构,优化了标题和描述的显示方式 - 改进了历史对话的展示样式,增加了滚动指示器 - 统一了标签和图标的样式,提升了视觉一致性 - 优化了搜索框和卡片列表的样式,提高了用户体验 --- src/views/agent/work-flow/components/DynamicForm.vue | 4 +++- src/views/agent/work-flow/components/history.scss | 2 +- src/views/agent/work-flow/index.vue | 12 ++++++------ src/views/agent/work-flow/style.scss | 2 +- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/views/agent/work-flow/components/DynamicForm.vue b/src/views/agent/work-flow/components/DynamicForm.vue index c7e66f7..553c96d 100644 --- a/src/views/agent/work-flow/components/DynamicForm.vue +++ b/src/views/agent/work-flow/components/DynamicForm.vue @@ -70,7 +70,9 @@ const handleSubmit = async () => { diff --git a/src/views/agent/work-flow/components/HistoryChat.vue b/src/views/agent/work-flow/components/HistoryChat.vue index 20063bf..4645a41 100644 --- a/src/views/agent/work-flow/components/HistoryChat.vue +++ b/src/views/agent/work-flow/components/HistoryChat.vue @@ -28,18 +28,7 @@ {{cozeInfo.description}}
-
- - - - - - - - - -
diff --git a/src/views/agent/work-flow/components/history.scss b/src/views/agent/work-flow/components/history.scss index 6b65b6a..72a5e8a 100644 --- a/src/views/agent/work-flow/components/history.scss +++ b/src/views/agent/work-flow/components/history.scss @@ -36,8 +36,6 @@ .info-section { align-self: stretch; - padding-top: 15px; - padding-bottom: 15px; display: flex; justify-content: space-between; align-items: flex-start; @@ -47,7 +45,7 @@ justify-content: flex-start; align-items: center; gap: 4px; - padding: 24px; + padding: 10px 24px 0 24px; .title { color: var(--Text-1, #211F24); font-size: 18px; @@ -97,10 +95,10 @@ width: 79px; height: 34px; position: relative; - margin-top: 24px; + margin-top: 10px; margin-right: 24px; .count { - left: 0px; + left: 20px; top: 10px; position: absolute; color: var(--Text-2, #3C4043); @@ -143,12 +141,7 @@ } } - .divider { - align-self: stretch; - height: 0px; - outline: 1px var(--Border-2, #E6E6E8) solid; - outline-offset: -0.50px; - } + .history-section { align-self: stretch; diff --git a/src/views/agent/work-flow/index.vue b/src/views/agent/work-flow/index.vue index 49ca9de..aa52383 100644 --- a/src/views/agent/work-flow/index.vue +++ b/src/views/agent/work-flow/index.vue @@ -5,45 +5,48 @@
- + -
- +
- - + + - +
- +
@@ -113,7 +116,7 @@ const renderedMarkdown = computed(() => { const handleSubmit = async (formData) => { try { const param = { form_data: formData, workflow_id: cozeInfo.workflow_id, bot_id: formFields.value.bot_id }; - console.log(param, 'param'); + workFlowRes.output = ''; loading.value = true; const { code, data } = await executeWorkFlow(param); if (code === 200) { @@ -121,7 +124,6 @@ const handleSubmit = async (formData) => { loading.value = false; } } catch (error) { - console.log(error, 'error'); loading.value = false; } }; From f307588cc56603f43ed0559ea37b38895210b71f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9E=97=E5=BF=97=E5=86=9B?= <543024265@qq.com> Date: Mon, 28 Jul 2025 20:20:47 +0800 Subject: [PATCH 26/65] =?UTF-8?q?refactor(agent):=20=E9=87=8D=E6=9E=84?= =?UTF-8?q?=E6=99=BA=E8=83=BD=E4=BD=93=E9=A1=B5=E9=9D=A2=E5=B8=83=E5=B1=80?= =?UTF-8?q?=E5=92=8C=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -调整了智能体卡片的布局结构,优化了标题和描述的显示方式 - 改进了历史对话的展示样式,增加了滚动指示器 - 统一了标签和图标的样式,提升了视觉一致性 - 优化了搜索框和卡片列表的样式,提高了用户体验 --- .../agent/chat/components/HistoryChat.vue | 23 +++++++++---------- src/views/agent/chat/components/history.scss | 12 ++-------- .../work-flow/components/HistoryChat.vue | 9 ++++++-- .../agent/work-flow/components/history.scss | 14 ++--------- 4 files changed, 22 insertions(+), 36 deletions(-) diff --git a/src/views/agent/chat/components/HistoryChat.vue b/src/views/agent/chat/components/HistoryChat.vue index 1a1590b..479aa92 100644 --- a/src/views/agent/chat/components/HistoryChat.vue +++ b/src/views/agent/chat/components/HistoryChat.vue @@ -2,33 +2,33 @@
- +
-
{{cozeInfo.name}}
+
{{ cozeInfo.name }}
- +
对话式
-
{{cozeInfo.views}}
-
次使用
+ + {{ cozeInfo.views }} + + + 次使用 +
- {{cozeInfo.description}} + {{ cozeInfo.description }}
-
@@ -64,8 +64,7 @@ const truncateText = (text: string, maxLength = 30) => { return text.slice(0, maxLength) + '...'; }; -onMounted(() => { -}); +onMounted(() => {}); diff --git a/src/styles/lib/variable.scss b/src/styles/lib/variable.scss index fe28ae1..a6bd989 100644 --- a/src/styles/lib/variable.scss +++ b/src/styles/lib/variable.scss @@ -11,7 +11,7 @@ $font-family-manrope-medium: 'Manrope-Medium'; $font-family-manrope-bold: 'Manrope-Bold'; $font-family-manrope-semiBold: 'Manrope-SemiBold'; -$color-background: #f9f9f9; +$color-background: #F7F8FA; $color-primary: #6d4cfe; // 常规 $color-primary-5: #8A70FE; // hover diff --git a/src/views/agent/chat/index.vue b/src/views/agent/chat/index.vue index 4987804..172cfd0 100644 --- a/src/views/agent/chat/index.vue +++ b/src/views/agent/chat/index.vue @@ -6,7 +6,9 @@
- +
+ +
{{ cozeInfo?.name }}
diff --git a/src/views/agent/chat/style.scss b/src/views/agent/chat/style.scss index dd7f3e8..d679249 100644 --- a/src/views/agent/chat/style.scss +++ b/src/views/agent/chat/style.scss @@ -29,7 +29,8 @@ justify-content: flex-start; align-items: flex-start; display: inline-flex; - + background: var(--BG-100, #F7F8FA); + // .header { // align-self: stretch; // height: 160px; @@ -228,6 +229,7 @@ background: var(--BG-White, white); overflow: hidden; border-radius: 8px; + display: flex; flex-direction: column; .header { diff --git a/src/views/agent/work-flow/index.vue b/src/views/agent/work-flow/index.vue index e917f75..140b2ec 100644 --- a/src/views/agent/work-flow/index.vue +++ b/src/views/agent/work-flow/index.vue @@ -1,25 +1,26 @@