diff --git a/web/apps/web-ele/src/api/ai-platform/ai-platform.ts b/web/apps/web-ele/src/api/ai-platform/ai-platform.ts index 0bcbf2c..d4865ed 100644 --- a/web/apps/web-ele/src/api/ai-platform/ai-platform.ts +++ b/web/apps/web-ele/src/api/ai-platform/ai-platform.ts @@ -1,26 +1,5 @@ import { requestClient } from '#/api/request'; import { streamRequestClient } from '#/api/stream-request'; -import { useAppContextStore } from '#/store/app-context'; - -/** - * Inject current application context into AI requests. - */ -function injectSystemVariables( - inputs: Record, -): Record { - const appContextStore = useAppContextStore(); - const result = { ...inputs }; - - if (appContextStore.currentApp?.id && !result.application_id) { - result.application_id = appContextStore.currentApp.id; - } - - if (appContextStore.currentApp?.code && !result.application_code) { - result.application_code = appContextStore.currentApp.code; - } - - return result; -} /** * AI 平台 API @@ -953,12 +932,9 @@ export function runWorkflowStreamApi( onComplete?: () => void, useDraft: boolean = false, ): () => void { - // Inject current application context. - const finalInputs = injectSystemVariables(inputs); - return streamRequestClient( `${BASE_URL}/workflow/${id}/run/stream`, - { inputs: finalInputs, use_draft: useDraft }, + { inputs, use_draft: useDraft }, { onData: onEvent, onError: (error) => { @@ -1482,12 +1458,9 @@ export function sendAgentMessageStream( onError?: (error: Error) => void, onComplete?: () => void, ) { - // Inject current application context. - const finalData = injectSystemVariables(data); - return streamRequestClient( `${BASE_URL}/agent/${agentId}/chat`, - finalData, + data, { onData: onEvent, onError: (error) => { diff --git a/web/apps/web-ele/src/locales/langs/zh-CN/ai-platform.json b/web/apps/web-ele/src/locales/langs/zh-CN/ai-platform.json index a544e09..895911c 100644 --- a/web/apps/web-ele/src/locales/langs/zh-CN/ai-platform.json +++ b/web/apps/web-ele/src/locales/langs/zh-CN/ai-platform.json @@ -61,11 +61,11 @@ "namePlaceholder": "请输入智能体名称", "code": "编码", "codePlaceholder": "请输入唯一编码", - "appCode": "应用编码", + "appCode": "智能体编码", "mode": "模式", "description": "描述", "descriptionPlaceholder": "请输入描述", - "globalVisible": "子应用可见" + "globalVisible": "共享可用" }, "importExport": { "export": "导出", @@ -87,7 +87,7 @@ "agentInfo": "智能体信息", "modelName": "模型", "workflowCode": "关联工作流", - "appTip": "导入的智能体将归属到当前应用,状态为草稿", + "appTip": "导入的智能体状态为草稿,可在编辑器中确认模型、工具和知识库配置", "refTip": "模型、工作流、知识库按编码/名称匹配;目标环境缺失时导入后需在编辑器中重新配置" }, "basicInfo": "基本信息", @@ -356,7 +356,7 @@ "status": "状态", "active": "启用", "disabled": "停用", - "globalVisible": "子应用可见", + "globalVisible": "共享可用", "documents": "文档", "segments": "分段", "tokens": "Tokens", @@ -606,7 +606,7 @@ "type": "类型", "description": "描述", "descriptionPlaceholder": "请输入描述", - "globalVisible": "子应用可见" + "globalVisible": "共享可用" }, "status": { "draft": "草稿", @@ -646,7 +646,7 @@ "confirmImport": "确认导入", "reselect": "重新选择", "workflowInfo": "工作流信息", - "appTip": "导入的工作流将归属到当前应用,状态为草稿", + "appTip": "导入的工作流状态为草稿,可在编辑器中确认节点配置后发布", "subflowTip": "子流程节点按编码匹配;若目标环境无对应子流程,导入后需在编辑器中重新选择" }, "nodeLabel": "节点名称", @@ -1103,9 +1103,8 @@ "rawResponse": "原始响应", "cortexLlmResponse": "Cortex LLM 响应", "userInput": "用户输入", - "appId": "子应用ID", - "appCode": "子应用编码", - "formCode": "表单编码", + "sessionId": "会话 ID", + "agentId": "智能体 ID", "renderResult": "渲染结果", "generatedSqlStatement": "生成的 SQL 语句", "sqlThought": "SQL 生成思路", @@ -1309,9 +1308,8 @@ }, "start": { "userInputDesc": "用户在对话框中输入的内容,自动传入此变量", - "appIdDesc": "子应用下自动注入实际ID,主应用模式下为main", - "appCodeDesc": "子应用下自动注入应用编码,主应用模式下为空", - "formCodeDesc": "从表单列表调用时自动注入表单编码,其他情况下为空" + "sessionIdDesc": "当前对话会话 ID,用于多轮记忆和执行追踪", + "agentIdDesc": "当前调用智能体 ID,用于智能体协作和审计" }, "choice": { "label": "选项节点", diff --git a/web/apps/web-ele/src/router/access.ts b/web/apps/web-ele/src/router/access.ts index 01ea745..83fb253 100644 --- a/web/apps/web-ele/src/router/access.ts +++ b/web/apps/web-ele/src/router/access.ts @@ -27,10 +27,6 @@ const lightMenuNames = new Set([ 'KnowledgeBase', 'Message', 'MessageList', - 'SubAppAIAgentEditor', - 'SubAppAIKnowledgeDetail', - 'SubAppAIWorkflowEditor', - 'SubAppAIWorkflowRuns', 'SystemConfigManager', 'SystemManagement', 'SystemMenu', diff --git a/web/apps/web-ele/src/router/routes/modules/ai-platform.ts b/web/apps/web-ele/src/router/routes/modules/ai-platform.ts index 36eff05..324f346 100644 --- a/web/apps/web-ele/src/router/routes/modules/ai-platform.ts +++ b/web/apps/web-ele/src/router/routes/modules/ai-platform.ts @@ -7,6 +7,15 @@ const routes: RouteRecordRaw[] = [ path: '/ai-platform/knowledge', redirect: '/ai-platform/knowledge-base', }, + { + meta: { + hideInMenu: true, + title: '智能体对话', + }, + name: 'AgentChat', + path: '/agent-chat/:code', + component: () => import('#/views/_core/agent-chat/index.vue'), + }, { meta: { hideInMenu: true, @@ -22,19 +31,6 @@ const routes: RouteRecordRaw[] = [ path: '/ai-platform/knowledge/detail/:id', redirect: (to) => `/ai-platform/knowledge-base/detail/${to.params.id}`, }, - { - meta: { hideInMenu: true }, - name: 'SubAppAIKnowledgeLegacyRedirect', - path: '/app/:appCode/ai-platform/knowledge', - redirect: (to) => `/app/${to.params.appCode}/ai-platform/knowledge-base`, - }, - { - meta: { hideInMenu: true }, - name: 'SubAppAIKnowledgeLegacyDetailRedirect', - path: '/app/:appCode/ai-platform/knowledge/detail/:id', - redirect: (to) => - `/app/${to.params.appCode}/ai-platform/knowledge-base/detail/${to.params.id}`, - }, { meta: { hideInMenu: true, @@ -44,16 +40,7 @@ const routes: RouteRecordRaw[] = [ path: '/ai-platform/workflow-runs', component: () => import('#/views/ai-platform/workflow-runs/index.vue'), }, - { - meta: { - hideInMenu: true, - title: '执行历史', - }, - name: 'SubAppAIWorkflowRuns', - path: '/app/:appCode/ai-platform/workflow-runs', - component: () => import('#/views/ai-platform/workflow-runs/index.vue'), - }, - // 工作流编辑器 - 主应用 + // 工作流编辑器 { meta: { hideInMenu: true, @@ -64,18 +51,7 @@ const routes: RouteRecordRaw[] = [ path: '/ai-platform/workflow/editor/:id', component: () => import('#/views/ai-platform/workflow/editor/index.vue'), }, - // 工作流编辑器 - 子应用 - { - meta: { - hideInMenu: true, - title: '工作流编辑器', - noBasicLayout: true, - }, - name: 'SubAppAIWorkflowEditor', - path: '/app/:appCode/ai-platform/workflow/editor/:id', - component: () => import('#/views/ai-platform/workflow/editor/index.vue'), - }, - // 智能体编辑器 - 主应用 + // 智能体编辑器 { meta: { hideInMenu: true, @@ -86,18 +62,7 @@ const routes: RouteRecordRaw[] = [ path: '/ai-platform/agent/editor/:id', component: () => import('#/views/ai-platform/agent/editor/index.vue'), }, - // 智能体编辑器 - 子应用 - { - meta: { - hideInMenu: true, - title: '智能体编辑器', - noBasicLayout: true, - }, - name: 'SubAppAIAgentEditor', - path: '/app/:appCode/ai-platform/agent/editor/:id', - component: () => import('#/views/ai-platform/agent/editor/index.vue'), - }, - // 知识库详情 - 主应用 + // 知识库详情 { meta: { hideInMenu: true, @@ -107,16 +72,6 @@ const routes: RouteRecordRaw[] = [ path: '/ai-platform/knowledge-base/detail/:id', component: () => import('#/views/ai-platform/knowledge/detail/index.vue'), }, - // 知识库详情 - 子应用 - { - meta: { - hideInMenu: true, - title: '知识库详情', - }, - name: 'SubAppAIKnowledgeDetail', - path: '/app/:appCode/ai-platform/knowledge-base/detail/:id', - component: () => import('#/views/ai-platform/knowledge/detail/index.vue'), - }, ]; export default routes; diff --git a/web/apps/web-ele/src/views/ai-platform/agent/components/AgentChatPanel.vue b/web/apps/web-ele/src/views/ai-platform/agent/components/AgentChatPanel.vue index ef8142a..08140e4 100644 --- a/web/apps/web-ele/src/views/ai-platform/agent/components/AgentChatPanel.vue +++ b/web/apps/web-ele/src/views/ai-platform/agent/components/AgentChatPanel.vue @@ -248,7 +248,7 @@ async function doSendMessage(message: string, addUserMessage: boolean = true) { scrollToBottom(); // 发送流式请求 - // 系统变量(application_id 等)由 API 层自动注入 + // 系统变量由 API 层自动注入 cancelStream = sendAgentMessageStream( props.agentId, { diff --git a/web/apps/web-ele/src/views/ai-platform/agent/components/PublishToMenuDialog.vue b/web/apps/web-ele/src/views/ai-platform/agent/components/PublishToMenuDialog.vue index 558d226..bee5d3a 100644 --- a/web/apps/web-ele/src/views/ai-platform/agent/components/PublishToMenuDialog.vue +++ b/web/apps/web-ele/src/views/ai-platform/agent/components/PublishToMenuDialog.vue @@ -19,7 +19,6 @@ import { import { publishAgentToMenuApi } from '#/api/ai-platform/ai-platform'; import { ZqIconPicker } from '#/components/zq-form/zq-icon-picker'; import { ZqMenuSelector } from '#/components/zq-form/zq-menu-selector'; -import { useAppContextStore } from '#/store/app-context'; interface Props { modelValue: boolean; @@ -35,8 +34,6 @@ const emit = defineEmits<{ 'update:modelValue': [value: boolean]; }>(); -const appContextStore = useAppContextStore(); - const dialogVisible = computed({ get: () => props.modelValue, set: (val) => emit('update:modelValue', val), @@ -133,7 +130,6 @@ async function handlePublish() { :placeholder=" $t('ai-platform.agent.publishDialog.parentMenuPlaceholder') " - :application-id="appContextStore.currentApp?.id" @change="handleMenuChange" /> diff --git a/web/apps/web-ele/src/views/ai-platform/agent/editor/index.vue b/web/apps/web-ele/src/views/ai-platform/agent/editor/index.vue index bc308ac..ea1edbc 100644 --- a/web/apps/web-ele/src/views/ai-platform/agent/editor/index.vue +++ b/web/apps/web-ele/src/views/ai-platform/agent/editor/index.vue @@ -49,14 +49,11 @@ import { publishAgentApi, updateAgentApi, } from '#/api/ai-platform/ai-platform'; -import { useAppContextStore } from '#/store/app-context'; const AiChatPanel = defineAsyncComponent(() => import('#/components/ai-chat-panel/AiChatPanel.vue'), ); -const appContextStore = useAppContextStore(); - const route = useRoute(); const router = useRouter(); const agentId = route.params.id as string; @@ -220,7 +217,7 @@ async function handlePublish() { // 返回 function handleBack() { - router.push(appContextStore.getContextPath('/ai-platform/agent')); + router.push('/ai-platform/agent'); } // 添加性格特点 diff --git a/web/apps/web-ele/src/views/ai-platform/agent/index.vue b/web/apps/web-ele/src/views/ai-platform/agent/index.vue index 823a14b..b280616 100644 --- a/web/apps/web-ele/src/views/ai-platform/agent/index.vue +++ b/web/apps/web-ele/src/views/ai-platform/agent/index.vue @@ -52,7 +52,6 @@ import { publishAgentApi, unpublishAgentMenuApi, } from '#/api/ai-platform/ai-platform'; -import { useAppContextStore } from '#/store/app-context'; import PublishToMenuDialog from './components/PublishToMenuDialog.vue'; import ImportDialog from './modules/import-dialog.vue'; @@ -60,7 +59,6 @@ import ImportDialog from './modules/import-dialog.vue'; defineOptions({ name: 'AgentList' }); const router = useRouter(); -const appContextStore = useAppContextStore(); // 搜索关键词 const searchKeyword = ref(''); @@ -102,7 +100,6 @@ async function fetchList() { page: pagination.current, pageSize: pagination.pageSize, name: searchKeyword.value || undefined, - applicationId: appContextStore.currentApp?.id, }); agentList.value = res.items; pagination.total = res.total; @@ -159,14 +156,10 @@ async function handleCreate() { try { const agent = await createAgentApi({ ...createForm, - application_id: appContextStore.currentApp?.id, }); ElMessage.success($t('ai-platform.agent.createSuccess')); createDialogVisible.value = false; - // 跳转到编辑页(支持子应用模式) - router.push( - appContextStore.getContextPath(`/ai-platform/agent/editor/${agent.id}`), - ); + router.push(`/ai-platform/agent/editor/${agent.id}`); } catch (error: any) { ElMessage.error(error.message || $t('ai-platform.agent.createFailed')); } finally { @@ -176,16 +169,12 @@ async function handleCreate() { // 编辑智能体 function handleEdit(agent: AgentListItem) { - router.push( - appContextStore.getContextPath(`/ai-platform/agent/editor/${agent.id}`), - ); + router.push(`/ai-platform/agent/editor/${agent.id}`); } // 对话 function handleChat(agent: AgentListItem) { - router.push( - appContextStore.getContextPath(`/ai-platform/agent/chat/${agent.id}`), - ); + router.push(`/agent-chat/${agent.code}`); } // 发布 diff --git a/web/apps/web-ele/src/views/ai-platform/agent/modules/import-dialog.vue b/web/apps/web-ele/src/views/ai-platform/agent/modules/import-dialog.vue index 60340f4..03e7209 100644 --- a/web/apps/web-ele/src/views/ai-platform/agent/modules/import-dialog.vue +++ b/web/apps/web-ele/src/views/ai-platform/agent/modules/import-dialog.vue @@ -24,7 +24,6 @@ import { importAgentConfigApi, } from '#/api/ai-platform/ai-platform'; import { ZqDialog } from '#/components/zq-dialog'; -import { useAppContextStore } from '#/store/app-context'; interface Props { modelValue: boolean; @@ -37,8 +36,6 @@ const emit = defineEmits<{ 'update:modelValue': [value: boolean]; }>(); -const appContextStore = useAppContextStore(); - const dialogVisible = computed({ get: () => props.modelValue, set: (val) => emit('update:modelValue', val), @@ -132,7 +129,6 @@ async function handleConfirmImport() { try { const payload: AgentImportInput = { ...importData.value, - application_id: appContextStore.currentApp?.id, code: checkResult.value?.code_exists ? newCode.value.trim() : importData.value.code, diff --git a/web/apps/web-ele/src/views/ai-platform/knowledge/detail/index.vue b/web/apps/web-ele/src/views/ai-platform/knowledge/detail/index.vue index 6916bff..3d320c2 100644 --- a/web/apps/web-ele/src/views/ai-platform/knowledge/detail/index.vue +++ b/web/apps/web-ele/src/views/ai-platform/knowledge/detail/index.vue @@ -97,11 +97,9 @@ import { ZqDialog } from '#/components/zq-dialog'; import FileSelector from '#/components/zq-form/file-selector/file-selector.vue'; import { ZqTabs } from '#/components/zq-tabs/index'; import { getFileUrl } from '#/composables/useFileUrl'; -import { useAppContextStore } from '#/store/app-context'; const route = useRoute(); const router = useRouter(); -const appContextStore = useAppContextStore(); const kbId = computed(() => route.params.id as string); const activeTab = ref('documents'); @@ -867,7 +865,7 @@ async function handleSaveSettings() { } function handleBack() { - router.push(appContextStore.getContextPath('/ai-platform/knowledge-base')); + router.push('/ai-platform/knowledge-base'); } // Tab 切换时加载数据 diff --git a/web/apps/web-ele/src/views/ai-platform/knowledge/index.vue b/web/apps/web-ele/src/views/ai-platform/knowledge/index.vue index 84bf54d..309223e 100644 --- a/web/apps/web-ele/src/views/ai-platform/knowledge/index.vue +++ b/web/apps/web-ele/src/views/ai-platform/knowledge/index.vue @@ -47,12 +47,10 @@ import { updateKnowledgeBaseApi, } from '#/api/ai-platform/ai-platform'; import { ZqDialog } from '#/components/zq-dialog'; -import { useAppContextStore } from '#/store/app-context'; defineOptions({ name: 'KnowledgeBase' }); const router = useRouter(); -const appContextStore = useAppContextStore(); // 表单 const createForm = reactive({ @@ -106,7 +104,6 @@ async function fetchList() { page: pagination.current, pageSize: pagination.pageSize, name: searchKeyword.value || undefined, - applicationId: appContextStore.currentApp?.id, }); kbList.value = res.items; pagination.total = res.total; @@ -179,7 +176,6 @@ async function handleConfirm() { ElMessage.success($t('ai-platform.knowledge.saveSuccess')); } else { const res = await createKnowledgeBaseApi({ - application_id: appContextStore.currentApp?.id, is_global: createForm.is_global, name: createForm.name, code: createForm.code, @@ -195,12 +191,7 @@ async function handleConfirm() { indexing_technique: createForm.indexing_technique, }); ElMessage.success($t('ai-platform.knowledge.createSuccess')); - // 跳转到详情页 - router.push( - appContextStore.getContextPath( - `/ai-platform/knowledge-base/detail/${res.id}`, - ), - ); + router.push(`/ai-platform/knowledge-base/detail/${res.id}`); } dialogVisible.value = false; fetchList(); @@ -213,11 +204,7 @@ async function handleConfirm() { } function handleDetail(item: KnowledgeBaseListItem) { - router.push( - appContextStore.getContextPath( - `/ai-platform/knowledge-base/detail/${item.id}`, - ), - ); + router.push(`/ai-platform/knowledge-base/detail/${item.id}`); } async function handleDelete(item: KnowledgeBaseListItem) { diff --git a/web/apps/web-ele/src/views/ai-platform/workflow-runs/data.ts b/web/apps/web-ele/src/views/ai-platform/workflow-runs/data.ts index 2117547..113a09b 100644 --- a/web/apps/web-ele/src/views/ai-platform/workflow-runs/data.ts +++ b/web/apps/web-ele/src/views/ai-platform/workflow-runs/data.ts @@ -5,7 +5,6 @@ import type { VbenFormSchema } from '#/adapter/form'; import { $t } from '@vben/locales'; import { getWorkflowListApi } from '#/api/ai-platform/ai-platform'; -import { useAppContextStore } from '#/store/app-context'; type TagType = 'danger' | 'info' | 'primary' | 'success' | 'warning'; @@ -52,8 +51,6 @@ export function formatTime(value?: string) { } export function useSearchFormSchema(): VbenFormSchema[] { - const appContextStore = useAppContextStore(); - return [ { component: 'ApiSelect', @@ -64,7 +61,6 @@ export function useSearchFormSchema(): VbenFormSchema[] { const res = await getWorkflowListApi({ page: 1, pageSize: 200, - applicationId: appContextStore.currentApp?.id, }); return (res.items || []).map((item) => ({ label: item.name, diff --git a/web/apps/web-ele/src/views/ai-platform/workflow-runs/index.vue b/web/apps/web-ele/src/views/ai-platform/workflow-runs/index.vue index 70448a2..29bbc6d 100644 --- a/web/apps/web-ele/src/views/ai-platform/workflow-runs/index.vue +++ b/web/apps/web-ele/src/views/ai-platform/workflow-runs/index.vue @@ -11,7 +11,6 @@ import { ElButton, ElTag } from 'element-plus'; import { getAllWorkflowRunsApi } from '#/api/ai-platform/ai-platform'; import { useZqTable } from '#/components/zq-table'; -import { useAppContextStore } from '#/store/app-context'; import RunStatusTag from './components/RunStatusTag.vue'; import { @@ -27,7 +26,6 @@ import DetailDialog from './modules/detail-dialog.vue'; defineOptions({ name: 'WorkflowRunHistory' }); -const appContextStore = useAppContextStore(); const detailRef = ref>(); const triggerOptions = getTriggerOptions(); @@ -38,7 +36,6 @@ const fetchRunList = async (params: any) => { workflowId: params.form?.workflowId || undefined, status: params.form?.status || undefined, triggerType: params.form?.triggerType || undefined, - applicationId: appContextStore.currentApp?.id, }); return { items: res.items, diff --git a/web/apps/web-ele/src/views/ai-platform/workflow-runs/modules/detail-dialog.vue b/web/apps/web-ele/src/views/ai-platform/workflow-runs/modules/detail-dialog.vue index 641cc9a..1c0964b 100644 --- a/web/apps/web-ele/src/views/ai-platform/workflow-runs/modules/detail-dialog.vue +++ b/web/apps/web-ele/src/views/ai-platform/workflow-runs/modules/detail-dialog.vue @@ -14,7 +14,6 @@ import { ElAlert, ElButton, ElTag } from 'element-plus'; import { getWorkflowDetailApi, getWorkflowRunDetailApi } from '#/api/ai-platform/ai-platform'; import { ZqDesc, ZqDescItem } from '#/components/zq-desc'; import { ZqDialog } from '#/components/zq-dialog'; -import { useAppContextStore } from '#/store/app-context'; import { definitionToFlowElements } from '../../workflow/shared/loadDefinition'; import { applyRunReplay } from '../../workflow/shared/useRunReplay'; @@ -29,7 +28,6 @@ import { } from '../data'; const router = useRouter(); -const appContextStore = useAppContextStore(); const triggerOptions = getTriggerOptions(); const visible = ref(false); @@ -94,11 +92,7 @@ function handleOpen() { function openEditor() { if (!run.value?.workflow_id) return; visible.value = false; - router.push( - appContextStore.getContextPath( - `/ai-platform/workflow/editor/${run.value.workflow_id}`, - ), - ); + router.push(`/ai-platform/workflow/editor/${run.value.workflow_id}`); } function triggerLabel(value?: string) { diff --git a/web/apps/web-ele/src/views/ai-platform/workflow/editor/components/ChatPanel.vue b/web/apps/web-ele/src/views/ai-platform/workflow/editor/components/ChatPanel.vue index d2998fb..5ae6b97 100644 --- a/web/apps/web-ele/src/views/ai-platform/workflow/editor/components/ChatPanel.vue +++ b/web/apps/web-ele/src/views/ai-platform/workflow/editor/components/ChatPanel.vue @@ -213,7 +213,7 @@ const runWorkflow = (userMessage: string, inputs: Record) => { running.value = true; // 流式运行(编辑器调试模式,使用草稿版本) - // 系统变量(application_id 等)由 API 层自动注入 + // 系统变量由 API 层自动注入 cancelStream = runWorkflowStreamApi( props.workflowId, inputs, diff --git a/web/apps/web-ele/src/views/ai-platform/workflow/editor/components/RunPanel.vue b/web/apps/web-ele/src/views/ai-platform/workflow/editor/components/RunPanel.vue index 9381e21..ea84922 100644 --- a/web/apps/web-ele/src/views/ai-platform/workflow/editor/components/RunPanel.vue +++ b/web/apps/web-ele/src/views/ai-platform/workflow/editor/components/RunPanel.vue @@ -162,7 +162,7 @@ const handleRun = () => { startTimer(); // 编辑器调试模式,使用草稿版本 - // 系统变量(application_id 等)由 API 层自动注入 + // 系统变量由 API 层自动注入 cancelStream = runWorkflowStreamApi( props.workflowId, inputs.value, diff --git a/web/apps/web-ele/src/views/ai-platform/workflow/editor/components/VariableSelector.vue b/web/apps/web-ele/src/views/ai-platform/workflow/editor/components/VariableSelector.vue index d53a7d6..01d29a3 100644 --- a/web/apps/web-ele/src/views/ai-platform/workflow/editor/components/VariableSelector.vue +++ b/web/apps/web-ele/src/views/ai-platform/workflow/editor/components/VariableSelector.vue @@ -382,19 +382,16 @@ const availableNodes = computed(() => { isSystem: true, }, { - key: 'application_id', - label: $t('ai-platform.workflow.editor.variableSelector.appId'), - isSystem: true, - }, - { - key: 'application_code', - label: $t('ai-platform.workflow.editor.variableSelector.appCode'), - isSystem: true, - }, - { - key: 'form_code', + key: 'session_id', label: $t( - 'ai-platform.workflow.editor.variableSelector.formCode', + 'ai-platform.workflow.editor.variableSelector.sessionId', + ), + isSystem: true, + }, + { + key: 'agent_id', + label: $t( + 'ai-platform.workflow.editor.variableSelector.agentId', ), isSystem: true, }, diff --git a/web/apps/web-ele/src/views/ai-platform/workflow/editor/index.vue b/web/apps/web-ele/src/views/ai-platform/workflow/editor/index.vue index de2c305..2fac1a1 100644 --- a/web/apps/web-ele/src/views/ai-platform/workflow/editor/index.vue +++ b/web/apps/web-ele/src/views/ai-platform/workflow/editor/index.vue @@ -58,7 +58,6 @@ import { runWorkflowStreamApi, updateWorkflowApi, } from '#/api/ai-platform/ai-platform'; -import { useAppContextStore } from '#/store/app-context'; import { useWorkflowEditorStore } from '#/store/workflow-editor'; import RunDialog from './components/RunDialog.vue'; @@ -79,8 +78,6 @@ const AiChatPanel = defineAsyncComponent( () => import('#/components/ai-chat-panel/AiChatPanel.vue'), ); -const appContextStore = useAppContextStore(); - const route = useRoute(); const router = useRouter(); const workflowId = route.params.id as string; @@ -1834,7 +1831,7 @@ const handleNodeComplete = (event: { }; const handleBack = () => { - router.push(appContextStore.getContextPath('/ai-platform/workflow')); + router.push('/ai-platform/workflow'); }; // 键盘快捷键 diff --git a/web/apps/web-ele/src/views/ai-platform/workflow/editor/panels/StartPanel.vue b/web/apps/web-ele/src/views/ai-platform/workflow/editor/panels/StartPanel.vue index a1a8643..7ff38cb 100644 --- a/web/apps/web-ele/src/views/ai-platform/workflow/editor/panels/StartPanel.vue +++ b/web/apps/web-ele/src/views/ai-platform/workflow/editor/panels/StartPanel.vue @@ -50,42 +50,29 @@ const handleDelete = (index: number) => { - +
- application_id + session_id {{ $t('ai-platform.workflow.panels.common.sysVar') }}
- {{ $t('ai-platform.workflow.panels.start.appIdDesc') }} + {{ $t('ai-platform.workflow.panels.start.sessionIdDesc') }}
- +
- application_code + agent_id {{ $t('ai-platform.workflow.panels.common.sysVar') }}
- {{ $t('ai-platform.workflow.panels.start.appCodeDesc') }} -
-
- - -
-
- form_code - {{ - $t('ai-platform.workflow.panels.common.sysVar') - }} -
-
- {{ $t('ai-platform.workflow.panels.start.formCodeDesc') }} + {{ $t('ai-platform.workflow.panels.start.agentIdDesc') }}
diff --git a/web/apps/web-ele/src/views/ai-platform/workflow/index.vue b/web/apps/web-ele/src/views/ai-platform/workflow/index.vue index 990dd32..d27026f 100644 --- a/web/apps/web-ele/src/views/ai-platform/workflow/index.vue +++ b/web/apps/web-ele/src/views/ai-platform/workflow/index.vue @@ -51,13 +51,11 @@ import { updateWorkflowApi, } from '#/api/ai-platform/ai-platform'; import { ZqDialog } from '#/components/zq-dialog'; -import { useAppContextStore } from '#/store/app-context'; import RunDialog from '../workflow/editor/components/RunDialog.vue'; import ImportDialog from './modules/import-dialog.vue'; const router = useRouter(); -const appContextStore = useAppContextStore(); // 工作流类型选项 const workflowTypeOptions = computed(() => [ @@ -85,7 +83,6 @@ const createForm = reactive({ is_global: false, }); -// 是否在主应用下(只有主应用才显示“子应用可见”开关) const formRef = ref(); const isEditMode = ref(false); const formLoading = ref(false); @@ -117,7 +114,6 @@ async function handleConfirm() { } else { // 创建模式 const res = await createWorkflowApi({ - application_id: appContextStore.currentApp?.id, is_global: createForm.is_global, name: createForm.name, code: createForm.code, @@ -127,12 +123,7 @@ async function handleConfirm() { ElMessage.success($t('ai-platform.workflow.createSuccess')); dialogVisible.value = false; fetchList(); - // 直接跳转到编辑器(支持子应用模式) - router.push( - appContextStore.getContextPath( - `/ai-platform/workflow/editor/${res.id}`, - ), - ); + router.push(`/ai-platform/workflow/editor/${res.id}`); } } catch { // error handled by request interceptor @@ -165,7 +156,6 @@ async function fetchList() { page: pagination.current, pageSize: pagination.pageSize, name: searchKeyword.value || undefined, - applicationId: appContextStore.currentApp?.id, }); workflowList.value = res.items; pagination.total = res.total; @@ -233,9 +223,7 @@ const handleQuickRun = async (row: WorkflowListItem) => { }; const handleEdit = (row: WorkflowListItem) => { - router.push( - appContextStore.getContextPath(`/ai-platform/workflow/editor/${row.id}`), - ); + router.push(`/ai-platform/workflow/editor/${row.id}`); }; const handleDelete = async (row: WorkflowListItem) => { @@ -308,10 +296,7 @@ const handleCopy = async (row: WorkflowListItem) => { const res = await copyWorkflowApi(row.id); ElMessage.success($t('ai-platform.workflow.copySuccess')); fetchList(); - // 跳转到新工作流的编辑器 - router.push( - appContextStore.getContextPath(`/ai-platform/workflow/editor/${res.id}`), - ); + router.push(`/ai-platform/workflow/editor/${res.id}`); } catch (error) { if (error !== 'cancel') { console.error(error); diff --git a/web/apps/web-ele/src/views/ai-platform/workflow/modules/import-dialog.vue b/web/apps/web-ele/src/views/ai-platform/workflow/modules/import-dialog.vue index 084aeba..4676b7b 100644 --- a/web/apps/web-ele/src/views/ai-platform/workflow/modules/import-dialog.vue +++ b/web/apps/web-ele/src/views/ai-platform/workflow/modules/import-dialog.vue @@ -24,7 +24,6 @@ import { importWorkflowConfigApi, } from '#/api/ai-platform/ai-platform'; import { ZqDialog } from '#/components/zq-dialog'; -import { useAppContextStore } from '#/store/app-context'; interface Props { modelValue: boolean; @@ -37,8 +36,6 @@ const emit = defineEmits<{ 'update:modelValue': [value: boolean]; }>(); -const appContextStore = useAppContextStore(); - const dialogVisible = computed({ get: () => props.modelValue, set: (val) => emit('update:modelValue', val), @@ -132,7 +129,6 @@ async function handleConfirmImport() { try { const payload: WorkflowImportInput = { ...importData.value, - application_id: appContextStore.currentApp?.id, code: checkResult.value?.code_exists ? newCode.value.trim() : importData.value.code, diff --git a/web/package.json b/web/package.json index 7b62216..0fbbeb5 100644 --- a/web/package.json +++ b/web/package.json @@ -25,7 +25,7 @@ }, "type": "module", "scripts": { - "build": "cross-env NODE_OPTIONS=--max-old-space-size=4096 pnpm -F @vben/web-ele run build", + "build": "pnpm -F @vben/web-ele run build", "build:all": "cross-env NODE_OPTIONS=--max-old-space-size=8192 turbo build", "build:analyze": "turbo build:analyze", "build:docker": "./scripts/deploy/build-local-docker-image.sh",