Restore full AI platform interactions
This commit is contained in:
@@ -23,7 +23,7 @@ import {
|
|||||||
sendAgentMessageStream,
|
sendAgentMessageStream,
|
||||||
} from '#/api/ai-platform/ai-platform';
|
} from '#/api/ai-platform/ai-platform';
|
||||||
import { ChatBox } from '#/components/ChatBox/index';
|
import { ChatBox } from '#/components/ChatBox/index';
|
||||||
import { DesignEditorPanel } from '#/components/form-editor';
|
import { AppDesignPanel, DesignEditorPanel } from '#/components/form-editor';
|
||||||
|
|
||||||
import AiWorkingAnimation from '../../../../components/ai-loading/AiWorkingAnimation.vue';
|
import AiWorkingAnimation from '../../../../components/ai-loading/AiWorkingAnimation.vue';
|
||||||
|
|
||||||
@@ -54,6 +54,7 @@ const emit = defineEmits<{
|
|||||||
|
|
||||||
// 设计面板显示状态
|
// 设计面板显示状态
|
||||||
const showDesignPanel = ref(false);
|
const showDesignPanel = ref(false);
|
||||||
|
const showAppDesignPanel = ref(false);
|
||||||
|
|
||||||
// 对话状态
|
// 对话状态
|
||||||
const chatMessages = ref<AgentMessage[]>([]);
|
const chatMessages = ref<AgentMessage[]>([]);
|
||||||
@@ -71,9 +72,17 @@ const waitingConfig = ref<any>(null);
|
|||||||
// 设计面板状态
|
// 设计面板状态
|
||||||
const currentDesign = ref<null | {
|
const currentDesign = ref<null | {
|
||||||
data: any;
|
data: any;
|
||||||
data_sources?: any[];
|
form_fields?: any[];
|
||||||
|
nodeId: string;
|
||||||
|
table_configs?: any[];
|
||||||
|
title: string;
|
||||||
|
type: string;
|
||||||
|
}>(null);
|
||||||
|
|
||||||
|
// 应用设计面板状态
|
||||||
|
const currentAppDesign = ref<null | {
|
||||||
|
data: any;
|
||||||
nodeId: string;
|
nodeId: string;
|
||||||
schema_fields?: any[];
|
|
||||||
title: string;
|
title: string;
|
||||||
type: string;
|
type: string;
|
||||||
}>(null);
|
}>(null);
|
||||||
@@ -273,7 +282,7 @@ async function doSendMessage(message: string, addUserMessage: boolean = true) {
|
|||||||
scrollToBottom();
|
scrollToBottom();
|
||||||
|
|
||||||
// 发送流式请求
|
// 发送流式请求
|
||||||
// 业务上下文由 API 层按 Agent 配置解析
|
// 系统变量(application_id 等)由 API 层自动注入
|
||||||
cancelStream = sendAgentMessageStream(
|
cancelStream = sendAgentMessageStream(
|
||||||
props.agentId,
|
props.agentId,
|
||||||
{
|
{
|
||||||
@@ -484,6 +493,19 @@ function handleStreamEvent(
|
|||||||
if (configData?.type === 'design_preview') {
|
if (configData?.type === 'design_preview') {
|
||||||
const previewType = configData.preview_type;
|
const previewType = configData.preview_type;
|
||||||
|
|
||||||
|
// 应用设计方案使用 AppDesignPanel(富文本编辑器)
|
||||||
|
if (previewType === 'app_design') {
|
||||||
|
currentAppDesign.value = {
|
||||||
|
type: previewType,
|
||||||
|
title:
|
||||||
|
configData.title ||
|
||||||
|
$t('ai-platform.agent.chatPanel.appDesignTitle'),
|
||||||
|
data: configData.data || {},
|
||||||
|
nodeId: event.node_id || '',
|
||||||
|
};
|
||||||
|
showAppDesignPanel.value = true;
|
||||||
|
} else {
|
||||||
|
// 其他设计类型使用 DesignEditorPanel(表单编辑器)
|
||||||
currentDesign.value = {
|
currentDesign.value = {
|
||||||
type: previewType,
|
type: previewType,
|
||||||
title:
|
title:
|
||||||
@@ -491,10 +513,11 @@ function handleStreamEvent(
|
|||||||
$t('ai-platform.agent.chatPanel.designPreview'),
|
$t('ai-platform.agent.chatPanel.designPreview'),
|
||||||
data: configData.data || {},
|
data: configData.data || {},
|
||||||
nodeId: event.node_id || '',
|
nodeId: event.node_id || '',
|
||||||
data_sources: configData.data_sources || configData.table_configs || [],
|
form_fields: configData.form_fields || [],
|
||||||
schema_fields: configData.schema_fields || configData.form_fields || [],
|
table_configs: configData.table_configs || [],
|
||||||
};
|
};
|
||||||
showDesignPanel.value = true;
|
showDesignPanel.value = true;
|
||||||
|
}
|
||||||
|
|
||||||
// 显示提示消息
|
// 显示提示消息
|
||||||
const waitingContent = `**${configData.title}**\n\n${configData.message || $t('ai-platform.agent.chatPanel.designPanelHint')}`;
|
const waitingContent = `**${configData.title}**\n\n${configData.message || $t('ai-platform.agent.chatPanel.designPanelHint')}`;
|
||||||
@@ -772,6 +795,46 @@ function handleDesignCancel() {
|
|||||||
currentDesign.value = null;
|
currentDesign.value = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 应用设计面板确认
|
||||||
|
function handleAppDesignConfirm(data: Record<string, any>) {
|
||||||
|
showAppDesignPanel.value = false;
|
||||||
|
|
||||||
|
// 添加用户确认消息
|
||||||
|
const userMsg: AgentMessage = {
|
||||||
|
id: generateId(),
|
||||||
|
role: 'user',
|
||||||
|
content: $t('ai-platform.agent.chatPanel.confirmAppDesign'),
|
||||||
|
status: 'completed',
|
||||||
|
reasoning_steps: [],
|
||||||
|
tool_calls: [],
|
||||||
|
prompt_tokens: 0,
|
||||||
|
completion_tokens: 0,
|
||||||
|
total_tokens: 0,
|
||||||
|
elapsed_time: 0,
|
||||||
|
error_message: '',
|
||||||
|
feedback: '',
|
||||||
|
created_at: new Date().toISOString(),
|
||||||
|
};
|
||||||
|
chatMessages.value.push(userMsg);
|
||||||
|
|
||||||
|
// 重置等待状态
|
||||||
|
waitingForInput.value = false;
|
||||||
|
waitingConfig.value = null;
|
||||||
|
currentAppDesign.value = null;
|
||||||
|
|
||||||
|
// 继续工作流,传递编辑后的数据
|
||||||
|
doSendMessage(JSON.stringify(data), false);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 应用设计面板取消
|
||||||
|
function handleAppDesignCancel() {
|
||||||
|
showAppDesignPanel.value = false;
|
||||||
|
waitingForInput.value = false;
|
||||||
|
waitingConfig.value = null;
|
||||||
|
currentAppDesign.value = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 暴露方法给父组件
|
||||||
defineExpose({
|
defineExpose({
|
||||||
clearChat,
|
clearChat,
|
||||||
scrollToBottom,
|
scrollToBottom,
|
||||||
@@ -838,13 +901,26 @@ onUnmounted(() => {
|
|||||||
title: currentDesign.title,
|
title: currentDesign.title,
|
||||||
data: currentDesign.data,
|
data: currentDesign.data,
|
||||||
nodeId: currentDesign.nodeId,
|
nodeId: currentDesign.nodeId,
|
||||||
data_sources: currentDesign.data_sources,
|
form_fields: currentDesign.form_fields,
|
||||||
schema_fields: currentDesign.schema_fields,
|
table_configs: currentDesign.table_configs,
|
||||||
}"
|
}"
|
||||||
@confirm="handleDesignConfirm"
|
@confirm="handleDesignConfirm"
|
||||||
@close="handleDesignCancel"
|
@close="handleDesignCancel"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- 应用设计面板 -->
|
||||||
|
<div
|
||||||
|
v-if="showAppDesignPanel && currentAppDesign"
|
||||||
|
class="flex flex-1 flex-col overflow-hidden"
|
||||||
|
>
|
||||||
|
<AppDesignPanel
|
||||||
|
:visible="showAppDesignPanel"
|
||||||
|
:design="currentAppDesign as any"
|
||||||
|
@update:visible="showAppDesignPanel = $event"
|
||||||
|
@confirm="handleAppDesignConfirm"
|
||||||
|
@close="handleAppDesignCancel"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -291,12 +291,9 @@ async function handlePreviewDoc(doc: KnowledgeDocumentListItem) {
|
|||||||
docPreviewUrlList.value = [url];
|
docPreviewUrlList.value = [url];
|
||||||
docPreviewVisible.value = true;
|
docPreviewVisible.value = true;
|
||||||
} else {
|
} else {
|
||||||
try {
|
const ext = getDocFileExt(doc);
|
||||||
const url = await getFileUrl(doc.file_id);
|
const query = new URLSearchParams({ name: doc.name || '', ext });
|
||||||
window.open(url, '_blank');
|
window.open(`/file-preview/${doc.file_id}?${query.toString()}`, '_blank');
|
||||||
} catch {
|
|
||||||
ElMessage.error($t('ai-platform.knowledge.chunkPreview.error'));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -870,7 +867,7 @@ async function handleSaveSettings() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function handleBack() {
|
function handleBack() {
|
||||||
router.push(appContextStore.getContextPath('/ai-platform/knowledge-base'));
|
router.push(appContextStore.getContextPath('/ai-platform/knowledge'));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Tab 切换时加载数据
|
// Tab 切换时加载数据
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import type { VbenFormSchema } from '#/adapter/form';
|
|||||||
import { $t } from '@vben/locales';
|
import { $t } from '@vben/locales';
|
||||||
|
|
||||||
import { getWorkflowListApi } from '#/api/ai-platform/ai-platform';
|
import { getWorkflowListApi } from '#/api/ai-platform/ai-platform';
|
||||||
|
import { useAppContextStore } from '#/store/app-context';
|
||||||
|
|
||||||
type TagType = 'danger' | 'info' | 'primary' | 'success' | 'warning';
|
type TagType = 'danger' | 'info' | 'primary' | 'success' | 'warning';
|
||||||
|
|
||||||
@@ -51,6 +52,8 @@ export function formatTime(value?: string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function useSearchFormSchema(): VbenFormSchema[] {
|
export function useSearchFormSchema(): VbenFormSchema[] {
|
||||||
|
const appContextStore = useAppContextStore();
|
||||||
|
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
component: 'ApiSelect',
|
component: 'ApiSelect',
|
||||||
@@ -58,7 +61,11 @@ export function useSearchFormSchema(): VbenFormSchema[] {
|
|||||||
label: $t('ai-platform.workflowRuns.filters.workflow'),
|
label: $t('ai-platform.workflowRuns.filters.workflow'),
|
||||||
componentProps: {
|
componentProps: {
|
||||||
api: async () => {
|
api: async () => {
|
||||||
const res = await getWorkflowListApi({ page: 1, pageSize: 200 });
|
const res = await getWorkflowListApi({
|
||||||
|
page: 1,
|
||||||
|
pageSize: 200,
|
||||||
|
applicationId: appContextStore.currentApp?.id,
|
||||||
|
});
|
||||||
return (res.items || []).map((item) => ({
|
return (res.items || []).map((item) => ({
|
||||||
label: item.name,
|
label: item.name,
|
||||||
value: item.id,
|
value: item.id,
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import { ElButton, ElTag } from 'element-plus';
|
|||||||
|
|
||||||
import { getAllWorkflowRunsApi } from '#/api/ai-platform/ai-platform';
|
import { getAllWorkflowRunsApi } from '#/api/ai-platform/ai-platform';
|
||||||
import { useZqTable } from '#/components/zq-table';
|
import { useZqTable } from '#/components/zq-table';
|
||||||
|
import { useAppContextStore } from '#/store/app-context';
|
||||||
|
|
||||||
import RunStatusTag from './components/RunStatusTag.vue';
|
import RunStatusTag from './components/RunStatusTag.vue';
|
||||||
import {
|
import {
|
||||||
@@ -26,6 +27,7 @@ import DetailDialog from './modules/detail-dialog.vue';
|
|||||||
|
|
||||||
defineOptions({ name: 'WorkflowRunHistory' });
|
defineOptions({ name: 'WorkflowRunHistory' });
|
||||||
|
|
||||||
|
const appContextStore = useAppContextStore();
|
||||||
const detailRef = ref<InstanceType<typeof DetailDialog>>();
|
const detailRef = ref<InstanceType<typeof DetailDialog>>();
|
||||||
const triggerOptions = getTriggerOptions();
|
const triggerOptions = getTriggerOptions();
|
||||||
|
|
||||||
@@ -36,6 +38,7 @@ const fetchRunList = async (params: any) => {
|
|||||||
workflowId: params.form?.workflowId || undefined,
|
workflowId: params.form?.workflowId || undefined,
|
||||||
status: params.form?.status || undefined,
|
status: params.form?.status || undefined,
|
||||||
triggerType: params.form?.triggerType || undefined,
|
triggerType: params.form?.triggerType || undefined,
|
||||||
|
applicationId: appContextStore.currentApp?.id,
|
||||||
});
|
});
|
||||||
return {
|
return {
|
||||||
items: res.items,
|
items: res.items,
|
||||||
|
|||||||
@@ -2,13 +2,18 @@
|
|||||||
import type { WorkflowStreamEvent } from '#/api/ai-platform/ai-platform';
|
import type { WorkflowStreamEvent } from '#/api/ai-platform/ai-platform';
|
||||||
import type { ChatMessage, ReasoningStep } from '#/components/ChatBox/index';
|
import type { ChatMessage, ReasoningStep } from '#/components/ChatBox/index';
|
||||||
import type {
|
import type {
|
||||||
|
AppDesignData,
|
||||||
|
AppSettingsData,
|
||||||
|
DashboardBasicInfoData,
|
||||||
|
DashboardDesignData,
|
||||||
|
DashboardPublishData,
|
||||||
DesignData,
|
DesignData,
|
||||||
SystemSummaryData,
|
SystemSummaryData,
|
||||||
} from '#/components/form-editor';
|
} from '#/components/form-editor';
|
||||||
|
|
||||||
import { computed, onUnmounted, ref, watch } from 'vue';
|
import { computed, onUnmounted, ref, watch } from 'vue';
|
||||||
|
|
||||||
import { Close, Setting } from '@element-plus/icons-vue';
|
import { Settings2, X } from '@vben/icons';
|
||||||
import { $t } from '@vben/locales';
|
import { $t } from '@vben/locales';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
@@ -26,6 +31,11 @@ import {
|
|||||||
} from '#/api/ai-platform/ai-platform';
|
} from '#/api/ai-platform/ai-platform';
|
||||||
import { ChatBox } from '#/components/ChatBox/index';
|
import { ChatBox } from '#/components/ChatBox/index';
|
||||||
import {
|
import {
|
||||||
|
AppDesignPanel,
|
||||||
|
AppSettingsPanel,
|
||||||
|
DashboardBasicInfoConfirmPanel,
|
||||||
|
DashboardDesignConfirmPanel,
|
||||||
|
DashboardPublishConfirmPanel,
|
||||||
DesignEditorPanel,
|
DesignEditorPanel,
|
||||||
SystemSummaryConfirmPanel,
|
SystemSummaryConfirmPanel,
|
||||||
} from '#/components/form-editor';
|
} from '#/components/form-editor';
|
||||||
@@ -64,6 +74,30 @@ const currentRunId = ref('');
|
|||||||
const showDesignPanel = ref(false);
|
const showDesignPanel = ref(false);
|
||||||
const currentDesign = ref<DesignData | undefined>(undefined);
|
const currentDesign = ref<DesignData | undefined>(undefined);
|
||||||
|
|
||||||
|
// 应用设计面板状态
|
||||||
|
const showAppDesignPanel = ref(false);
|
||||||
|
const currentAppDesign = ref<AppDesignData | undefined>(undefined);
|
||||||
|
|
||||||
|
// 应用设置面板状态
|
||||||
|
const showAppSettingsPanel = ref(false);
|
||||||
|
const currentAppSettings = ref<AppSettingsData | undefined>(undefined);
|
||||||
|
|
||||||
|
// 仪表盘基础信息面板状态
|
||||||
|
const showDashboardBasicInfoPanel = ref(false);
|
||||||
|
const currentDashboardBasicInfo = ref<DashboardBasicInfoData | undefined>(
|
||||||
|
undefined,
|
||||||
|
);
|
||||||
|
|
||||||
|
// 仪表盘设计面板状态
|
||||||
|
const showDashboardDesignPanel = ref(false);
|
||||||
|
const currentDashboardDesign = ref<DashboardDesignData | undefined>(undefined);
|
||||||
|
|
||||||
|
// 仪表盘发布面板状态
|
||||||
|
const showDashboardPublishPanel = ref(false);
|
||||||
|
const currentDashboardPublish = ref<DashboardPublishData | undefined>(
|
||||||
|
undefined,
|
||||||
|
);
|
||||||
|
|
||||||
// 系统总结面板状态
|
// 系统总结面板状态
|
||||||
const showSystemSummaryPanel = ref(false);
|
const showSystemSummaryPanel = ref(false);
|
||||||
const currentSystemSummary = ref<SystemSummaryData | undefined>(undefined);
|
const currentSystemSummary = ref<SystemSummaryData | undefined>(undefined);
|
||||||
@@ -215,7 +249,7 @@ const runWorkflow = (userMessage: string, inputs: Record<string, any>) => {
|
|||||||
running.value = true;
|
running.value = true;
|
||||||
|
|
||||||
// 流式运行(编辑器调试模式,使用草稿版本)
|
// 流式运行(编辑器调试模式,使用草稿版本)
|
||||||
// 业务上下文由 API 层按 Workflow 配置解析
|
// 系统变量(application_id 等)由 API 层自动注入
|
||||||
cancelStream = runWorkflowStreamApi(
|
cancelStream = runWorkflowStreamApi(
|
||||||
props.workflowId,
|
props.workflowId,
|
||||||
inputs,
|
inputs,
|
||||||
@@ -566,6 +600,84 @@ const handleStreamEvent = (event: WorkflowStreamEvent, msgId: string) => {
|
|||||||
if (configData?.type === 'design_preview') {
|
if (configData?.type === 'design_preview') {
|
||||||
// 检查是否是应用设计类型
|
// 检查是否是应用设计类型
|
||||||
switch (configData.preview_type) {
|
switch (configData.preview_type) {
|
||||||
|
case 'app_design': {
|
||||||
|
// 应用设计:打开专用的应用设计面板
|
||||||
|
currentAppDesign.value = {
|
||||||
|
type: 'app_design',
|
||||||
|
title:
|
||||||
|
configData.title ||
|
||||||
|
$t('ai-platform.workflow.editor.chatPanel.appDesignTitle'),
|
||||||
|
data: configData.data || {},
|
||||||
|
nodeId: event.node_id || '',
|
||||||
|
};
|
||||||
|
showAppDesignPanel.value = true;
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 'app_settings': {
|
||||||
|
// 应用设置:打开专用的应用设置面板
|
||||||
|
currentAppSettings.value = {
|
||||||
|
type: 'app_settings',
|
||||||
|
title:
|
||||||
|
configData.title ||
|
||||||
|
$t('ai-platform.workflow.editor.chatPanel.appSettingsTitle'),
|
||||||
|
data: configData.data || {},
|
||||||
|
nodeId: event.node_id || '',
|
||||||
|
layoutOptions: configData.layoutOptions || [],
|
||||||
|
themeOptions: configData.themeOptions || [],
|
||||||
|
};
|
||||||
|
showAppSettingsPanel.value = true;
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 'dashboard_basic_info': {
|
||||||
|
// 仪表盘基础信息:打开专用面板(在聊天框右侧)
|
||||||
|
currentDashboardBasicInfo.value = {
|
||||||
|
type: 'dashboard_basic_info',
|
||||||
|
title:
|
||||||
|
configData.title ||
|
||||||
|
$t(
|
||||||
|
'ai-platform.workflow.editor.chatPanel.dashboardBasicInfoTitle',
|
||||||
|
),
|
||||||
|
data: configData.data || {},
|
||||||
|
nodeId: event.node_id || '',
|
||||||
|
};
|
||||||
|
showDashboardBasicInfoPanel.value = true;
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 'dashboard_design': {
|
||||||
|
// 仪表盘设计:打开设计器面板(在聊天框右侧)
|
||||||
|
currentDashboardDesign.value = {
|
||||||
|
type: 'dashboard_design',
|
||||||
|
title:
|
||||||
|
configData.title ||
|
||||||
|
$t(
|
||||||
|
'ai-platform.workflow.editor.chatPanel.dashboardDesignTitle',
|
||||||
|
),
|
||||||
|
data: configData.data || {},
|
||||||
|
nodeId: event.node_id || '',
|
||||||
|
};
|
||||||
|
showDashboardDesignPanel.value = true;
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 'dashboard_publish': {
|
||||||
|
// 仪表盘发布:打开发布确认面板(在聊天框右侧)
|
||||||
|
currentDashboardPublish.value = {
|
||||||
|
type: 'dashboard_publish',
|
||||||
|
title:
|
||||||
|
configData.title ||
|
||||||
|
$t(
|
||||||
|
'ai-platform.workflow.editor.chatPanel.dashboardPublishTitle',
|
||||||
|
),
|
||||||
|
data: configData.data || {},
|
||||||
|
nodeId: event.node_id || '',
|
||||||
|
};
|
||||||
|
showDashboardPublishPanel.value = true;
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
case 'system_summary': {
|
case 'system_summary': {
|
||||||
// 系统总结:打开总结展示面板
|
// 系统总结:打开总结展示面板
|
||||||
currentSystemSummary.value = {
|
currentSystemSummary.value = {
|
||||||
@@ -589,10 +701,8 @@ const handleStreamEvent = (event: WorkflowStreamEvent, msgId: string) => {
|
|||||||
$t('ai-platform.workflow.editor.chatPanel.designPreviewTitle'),
|
$t('ai-platform.workflow.editor.chatPanel.designPreviewTitle'),
|
||||||
data: configData.data || {},
|
data: configData.data || {},
|
||||||
nodeId: event.node_id || '',
|
nodeId: event.node_id || '',
|
||||||
data_sources:
|
form_fields: configData.form_fields || [], // 传递表单字段列表(用于列表设计)
|
||||||
configData.data_sources || configData.table_configs || [],
|
table_configs: configData.table_configs || [], // 传递数据表配置(用于表单设计)
|
||||||
schema_fields:
|
|
||||||
configData.schema_fields || configData.form_fields || [],
|
|
||||||
};
|
};
|
||||||
showDesignPanel.value = true;
|
showDesignPanel.value = true;
|
||||||
}
|
}
|
||||||
@@ -869,6 +979,153 @@ const handleDesignClose = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// 处理应用设计确认
|
// 处理应用设计确认
|
||||||
|
const handleAppDesignConfirm = (data: Record<string, any>) => {
|
||||||
|
showAppDesignPanel.value = false;
|
||||||
|
currentAppDesign.value = undefined;
|
||||||
|
|
||||||
|
// 添加用户确认消息
|
||||||
|
const userMsg: ChatMessage = {
|
||||||
|
id: generateId(),
|
||||||
|
role: 'user',
|
||||||
|
content: $t('ai-platform.workflow.editor.chatPanel.confirmAppDesign'),
|
||||||
|
timestamp: new Date(),
|
||||||
|
};
|
||||||
|
messages.value.push(userMsg);
|
||||||
|
|
||||||
|
// 重置等待状态
|
||||||
|
waitingForInput.value = false;
|
||||||
|
waitingConfig.value = null;
|
||||||
|
|
||||||
|
// 恢复工作流,传递编辑后的数据
|
||||||
|
resumeWorkflow(JSON.stringify(data));
|
||||||
|
};
|
||||||
|
|
||||||
|
// 处理应用设计面板关闭
|
||||||
|
const handleAppDesignClose = () => {
|
||||||
|
showAppDesignPanel.value = false;
|
||||||
|
currentAppDesign.value = undefined;
|
||||||
|
};
|
||||||
|
|
||||||
|
// 处理应用设置确认
|
||||||
|
const handleAppSettingsConfirm = (data: Record<string, any>) => {
|
||||||
|
showAppSettingsPanel.value = false;
|
||||||
|
currentAppSettings.value = undefined;
|
||||||
|
|
||||||
|
// 添加用户确认消息
|
||||||
|
const userMsg: ChatMessage = {
|
||||||
|
id: generateId(),
|
||||||
|
role: 'user',
|
||||||
|
content: $t('ai-platform.workflow.editor.chatPanel.confirmAppSettings'),
|
||||||
|
timestamp: new Date(),
|
||||||
|
};
|
||||||
|
messages.value.push(userMsg);
|
||||||
|
|
||||||
|
// 重置等待状态
|
||||||
|
waitingForInput.value = false;
|
||||||
|
waitingConfig.value = null;
|
||||||
|
|
||||||
|
// 恢复工作流,传递编辑后的数据
|
||||||
|
resumeWorkflow(JSON.stringify(data));
|
||||||
|
};
|
||||||
|
|
||||||
|
// 处理应用设置面板关闭
|
||||||
|
const handleAppSettingsClose = () => {
|
||||||
|
showAppSettingsPanel.value = false;
|
||||||
|
currentAppSettings.value = undefined;
|
||||||
|
};
|
||||||
|
|
||||||
|
// 处理仪表盘基础信息确认
|
||||||
|
const handleDashboardBasicInfoConfirm = (data: Record<string, any>) => {
|
||||||
|
showDashboardBasicInfoPanel.value = false;
|
||||||
|
currentDashboardBasicInfo.value = undefined;
|
||||||
|
|
||||||
|
// 添加用户确认消息
|
||||||
|
const userMsg: ChatMessage = {
|
||||||
|
id: generateId(),
|
||||||
|
role: 'user',
|
||||||
|
content: $t(
|
||||||
|
'ai-platform.workflow.editor.chatPanel.confirmDashboardBasicInfo',
|
||||||
|
),
|
||||||
|
timestamp: new Date(),
|
||||||
|
};
|
||||||
|
messages.value.push(userMsg);
|
||||||
|
|
||||||
|
// 重置等待状态
|
||||||
|
waitingForInput.value = false;
|
||||||
|
waitingConfig.value = null;
|
||||||
|
|
||||||
|
// 恢复工作流,传递编辑后的数据
|
||||||
|
resumeWorkflow(JSON.stringify(data));
|
||||||
|
};
|
||||||
|
|
||||||
|
// 处理仪表盘基础信息面板关闭
|
||||||
|
const handleDashboardBasicInfoClose = () => {
|
||||||
|
showDashboardBasicInfoPanel.value = false;
|
||||||
|
currentDashboardBasicInfo.value = undefined;
|
||||||
|
};
|
||||||
|
|
||||||
|
// 处理仪表盘设计确认
|
||||||
|
const handleDashboardDesignConfirm = (data: Record<string, any>) => {
|
||||||
|
showDashboardDesignPanel.value = false;
|
||||||
|
currentDashboardDesign.value = undefined;
|
||||||
|
|
||||||
|
// 添加用户确认消息
|
||||||
|
const userMsg: ChatMessage = {
|
||||||
|
id: generateId(),
|
||||||
|
role: 'user',
|
||||||
|
content: $t('ai-platform.workflow.editor.chatPanel.confirmDashboardDesign'),
|
||||||
|
timestamp: new Date(),
|
||||||
|
};
|
||||||
|
messages.value.push(userMsg);
|
||||||
|
|
||||||
|
// 重置等待状态
|
||||||
|
waitingForInput.value = false;
|
||||||
|
waitingConfig.value = null;
|
||||||
|
|
||||||
|
// 恢复工作流,传递编辑后的数据
|
||||||
|
resumeWorkflow(JSON.stringify(data));
|
||||||
|
};
|
||||||
|
|
||||||
|
// 处理仪表盘设计面板关闭
|
||||||
|
const handleDashboardDesignClose = () => {
|
||||||
|
showDashboardDesignPanel.value = false;
|
||||||
|
currentDashboardDesign.value = undefined;
|
||||||
|
};
|
||||||
|
|
||||||
|
// 处理仪表盘发布确认
|
||||||
|
const handleDashboardPublishConfirm = (data: Record<string, any>) => {
|
||||||
|
console.log('[ChatPanel] 接收到发布确认数据:', data);
|
||||||
|
showDashboardPublishPanel.value = false;
|
||||||
|
currentDashboardPublish.value = undefined;
|
||||||
|
|
||||||
|
// 添加用户确认消息
|
||||||
|
const userMsg: ChatMessage = {
|
||||||
|
id: generateId(),
|
||||||
|
role: 'user',
|
||||||
|
content: $t('ai-platform.workflow.editor.chatPanel.publishToMenu', {
|
||||||
|
name: data.menu_name,
|
||||||
|
}),
|
||||||
|
timestamp: new Date(),
|
||||||
|
};
|
||||||
|
messages.value.push(userMsg);
|
||||||
|
|
||||||
|
// 重置等待状态
|
||||||
|
waitingForInput.value = false;
|
||||||
|
waitingConfig.value = null;
|
||||||
|
|
||||||
|
// 恢复工作流,传递发布数据
|
||||||
|
const userInputStr = JSON.stringify(data);
|
||||||
|
console.log('[ChatPanel] 传递给 resumeWorkflow 的数据:', userInputStr);
|
||||||
|
resumeWorkflow(userInputStr);
|
||||||
|
};
|
||||||
|
|
||||||
|
// 处理仪表盘发布面板关闭
|
||||||
|
const handleDashboardPublishClose = () => {
|
||||||
|
showDashboardPublishPanel.value = false;
|
||||||
|
currentDashboardPublish.value = undefined;
|
||||||
|
};
|
||||||
|
|
||||||
|
// 处理系统总结确认
|
||||||
const handleSystemSummaryConfirm = (data: Record<string, any>) => {
|
const handleSystemSummaryConfirm = (data: Record<string, any>) => {
|
||||||
showSystemSummaryPanel.value = false;
|
showSystemSummaryPanel.value = false;
|
||||||
currentSystemSummary.value = undefined;
|
currentSystemSummary.value = undefined;
|
||||||
@@ -920,11 +1177,11 @@ onUnmounted(() => {
|
|||||||
<ElButton
|
<ElButton
|
||||||
v-if="hasMultipleVariables"
|
v-if="hasMultipleVariables"
|
||||||
link
|
link
|
||||||
:icon="Setting"
|
:icon="Settings2"
|
||||||
:title="$t('ai-platform.workflow.editor.chatPanel.configVariables')"
|
:title="$t('ai-platform.workflow.editor.chatPanel.configVariables')"
|
||||||
@click="variablesDialogVisible = true"
|
@click="variablesDialogVisible = true"
|
||||||
/>
|
/>
|
||||||
<ElButton link :icon="Close" @click="$emit('close')" />
|
<ElButton link :icon="X" @click="$emit('close')" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -1001,6 +1258,51 @@ onUnmounted(() => {
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
<!-- 应用设计面板 -->
|
<!-- 应用设计面板 -->
|
||||||
|
<AppDesignPanel
|
||||||
|
:visible="showAppDesignPanel"
|
||||||
|
:design="currentAppDesign"
|
||||||
|
@update:visible="showAppDesignPanel = $event"
|
||||||
|
@confirm="handleAppDesignConfirm"
|
||||||
|
@close="handleAppDesignClose"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<!-- 应用设置面板 -->
|
||||||
|
<AppSettingsPanel
|
||||||
|
:visible="showAppSettingsPanel"
|
||||||
|
:settings="currentAppSettings"
|
||||||
|
@update:visible="showAppSettingsPanel = $event"
|
||||||
|
@confirm="handleAppSettingsConfirm"
|
||||||
|
@close="handleAppSettingsClose"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<!-- 仪表盘基础信息面板 -->
|
||||||
|
<DashboardBasicInfoConfirmPanel
|
||||||
|
:visible="showDashboardBasicInfoPanel"
|
||||||
|
:basic-info="currentDashboardBasicInfo"
|
||||||
|
@update:visible="showDashboardBasicInfoPanel = $event"
|
||||||
|
@confirm="handleDashboardBasicInfoConfirm"
|
||||||
|
@close="handleDashboardBasicInfoClose"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<!-- 仪表盘设计面板 -->
|
||||||
|
<DashboardDesignConfirmPanel
|
||||||
|
:visible="showDashboardDesignPanel"
|
||||||
|
:design="currentDashboardDesign"
|
||||||
|
@update:visible="showDashboardDesignPanel = $event"
|
||||||
|
@confirm="handleDashboardDesignConfirm"
|
||||||
|
@close="handleDashboardDesignClose"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<!-- 仪表盘发布面板 -->
|
||||||
|
<DashboardPublishConfirmPanel
|
||||||
|
:visible="showDashboardPublishPanel"
|
||||||
|
:publish-data="currentDashboardPublish"
|
||||||
|
@update:visible="showDashboardPublishPanel = $event"
|
||||||
|
@confirm="handleDashboardPublishConfirm"
|
||||||
|
@close="handleDashboardPublishClose"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<!-- 系统总结面板 -->
|
||||||
<SystemSummaryConfirmPanel
|
<SystemSummaryConfirmPanel
|
||||||
:visible="showSystemSummaryPanel"
|
:visible="showSystemSummaryPanel"
|
||||||
:data="currentSystemSummary"
|
:data="currentSystemSummary"
|
||||||
|
|||||||
+1
-1
@@ -222,7 +222,7 @@ const formattedInputs = computed(() => {
|
|||||||
v-if="displayResult.tokens_used"
|
v-if="displayResult.tokens_used"
|
||||||
class="text-muted-foreground text-sm"
|
class="text-muted-foreground text-sm"
|
||||||
>
|
>
|
||||||
消耗 Token:{{ displayResult.tokens_used }}
|
Tokens: {{ displayResult.tokens_used }}
|
||||||
</span>
|
</span>
|
||||||
<div v-if="hasIterations" class="flex items-center gap-1.5">
|
<div v-if="hasIterations" class="flex items-center gap-1.5">
|
||||||
<span class="text-muted-foreground text-xs">
|
<span class="text-muted-foreground text-xs">
|
||||||
|
|||||||
@@ -54,6 +54,7 @@ const components: Record<string, any> = {
|
|||||||
),
|
),
|
||||||
// 循环节点
|
// 循环节点
|
||||||
loop: defineAsyncComponent(() => import('../panels/LoopPanel.vue')),
|
loop: defineAsyncComponent(() => import('../panels/LoopPanel.vue')),
|
||||||
|
// 表单节点
|
||||||
form_basic_info: defineAsyncComponent(
|
form_basic_info: defineAsyncComponent(
|
||||||
() => import('../panels/FormBasicInfoPanel.vue'),
|
() => import('../panels/FormBasicInfoPanel.vue'),
|
||||||
),
|
),
|
||||||
@@ -75,6 +76,7 @@ const components: Record<string, any> = {
|
|||||||
form_publish: defineAsyncComponent(
|
form_publish: defineAsyncComponent(
|
||||||
() => import('../panels/FormPublishPanel.vue'),
|
() => import('../panels/FormPublishPanel.vue'),
|
||||||
),
|
),
|
||||||
|
// 应用节点
|
||||||
app_create: defineAsyncComponent(
|
app_create: defineAsyncComponent(
|
||||||
() => import('../panels/AppCreatePanel.vue'),
|
() => import('../panels/AppCreatePanel.vue'),
|
||||||
),
|
),
|
||||||
@@ -87,6 +89,7 @@ const components: Record<string, any> = {
|
|||||||
app_update: defineAsyncComponent(
|
app_update: defineAsyncComponent(
|
||||||
() => import('../panels/AppUpdatePanel.vue'),
|
() => import('../panels/AppUpdatePanel.vue'),
|
||||||
),
|
),
|
||||||
|
// 仪表盘节点
|
||||||
dashboard_basic_info: defineAsyncComponent(
|
dashboard_basic_info: defineAsyncComponent(
|
||||||
() => import('../panels/DashboardBasicInfoPanel.vue'),
|
() => import('../panels/DashboardBasicInfoPanel.vue'),
|
||||||
),
|
),
|
||||||
@@ -99,9 +102,13 @@ const components: Record<string, any> = {
|
|||||||
dashboard_publish: defineAsyncComponent(
|
dashboard_publish: defineAsyncComponent(
|
||||||
() => import('../panels/DashboardPublishPanel.vue'),
|
() => import('../panels/DashboardPublishPanel.vue'),
|
||||||
),
|
),
|
||||||
|
// 系统总结节点
|
||||||
system_summary: defineAsyncComponent(
|
system_summary: defineAsyncComponent(
|
||||||
() => import('../panels/SystemSummaryPanel.vue'),
|
() => import('../panels/SystemSummaryPanel.vue'),
|
||||||
),
|
),
|
||||||
|
// 子流程节点
|
||||||
|
subflow: defineAsyncComponent(() => import('../panels/SubflowPanel.vue')),
|
||||||
|
// 表单数据节点
|
||||||
form_data_create: defineAsyncComponent(
|
form_data_create: defineAsyncComponent(
|
||||||
() => import('../panels/FormDataPanel.vue'),
|
() => import('../panels/FormDataPanel.vue'),
|
||||||
),
|
),
|
||||||
@@ -120,8 +127,6 @@ const components: Record<string, any> = {
|
|||||||
form_schema_to_llm: defineAsyncComponent(
|
form_schema_to_llm: defineAsyncComponent(
|
||||||
() => import('../panels/FormDataPanel.vue'),
|
() => import('../panels/FormDataPanel.vue'),
|
||||||
),
|
),
|
||||||
// 子流程节点
|
|
||||||
subflow: defineAsyncComponent(() => import('../panels/SubflowPanel.vue')),
|
|
||||||
// Text-to-SQL 节点
|
// Text-to-SQL 节点
|
||||||
text_to_sql: defineAsyncComponent(
|
text_to_sql: defineAsyncComponent(
|
||||||
() => import('../panels/TextToSqlPanel.vue'),
|
() => import('../panels/TextToSqlPanel.vue'),
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ const totalStats = computed(() => {
|
|||||||
(sum, s) => sum + (s.elapsed_time || 0),
|
(sum, s) => sum + (s.elapsed_time || 0),
|
||||||
0,
|
0,
|
||||||
);
|
);
|
||||||
const totalTokenCount = completed.reduce(
|
const totalTokens = completed.reduce(
|
||||||
(sum, s) => sum + (s.tokens_used || 0),
|
(sum, s) => sum + (s.tokens_used || 0),
|
||||||
0,
|
0,
|
||||||
);
|
);
|
||||||
@@ -101,7 +101,7 @@ const totalStats = computed(() => {
|
|||||||
failed: states.filter((s) => s.status === 'failed').length,
|
failed: states.filter((s) => s.status === 'failed').length,
|
||||||
running: states.filter((s) => s.status === 'running').length,
|
running: states.filter((s) => s.status === 'running').length,
|
||||||
totalTime,
|
totalTime,
|
||||||
totalTokenCount,
|
totalTokens,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -547,8 +547,8 @@ const handleStop = () => {
|
|||||||
{{ totalStats.completed }}/{{ totalStats.total }}
|
{{ totalStats.completed }}/{{ totalStats.total }}
|
||||||
{{ $t('ai-platform.workflow.editor.runPanel.nodes') }}
|
{{ $t('ai-platform.workflow.editor.runPanel.nodes') }}
|
||||||
</ElTag>
|
</ElTag>
|
||||||
<ElTag v-if="totalStats.totalTokenCount > 0" size="small">
|
<ElTag v-if="totalStats.totalTokens > 0" size="small">
|
||||||
消耗 Token:{{ totalStats.totalTokenCount }}
|
{{ totalStats.totalTokens }} tokens
|
||||||
</ElTag>
|
</ElTag>
|
||||||
<ElTag v-if="totalStats.totalTime > 0" size="small">
|
<ElTag v-if="totalStats.totalTime > 0" size="small">
|
||||||
{{ formatTime(totalStats.totalTime) }}
|
{{ formatTime(totalStats.totalTime) }}
|
||||||
@@ -631,7 +631,7 @@ const handleStop = () => {
|
|||||||
class="mt-1 pl-5"
|
class="mt-1 pl-5"
|
||||||
>
|
>
|
||||||
<span v-if="state.tokens_used" class="text-muted-foreground">
|
<span v-if="state.tokens_used" class="text-muted-foreground">
|
||||||
消耗 Token:{{ state.tokens_used }}
|
{{ state.tokens_used }} tokens
|
||||||
</span>
|
</span>
|
||||||
<span
|
<span
|
||||||
v-if="state.error_message"
|
v-if="state.error_message"
|
||||||
|
|||||||
+485
-41
@@ -2,26 +2,28 @@
|
|||||||
import { computed, ref } from 'vue';
|
import { computed, ref } from 'vue';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
ArrowDown,
|
AppWindow,
|
||||||
ArrowRight,
|
BookOpen,
|
||||||
ChatLineRound,
|
Bot,
|
||||||
Check,
|
ChevronDown,
|
||||||
Coin,
|
ChevronRight,
|
||||||
Collection,
|
CircleHelp,
|
||||||
Connection,
|
ClipboardCheck,
|
||||||
Cpu,
|
Code,
|
||||||
DataAnalysis,
|
Combine,
|
||||||
Document,
|
Database,
|
||||||
Finished,
|
FileText,
|
||||||
Guide,
|
Globe,
|
||||||
Help,
|
HelpCircle,
|
||||||
Link,
|
LayoutDashboard,
|
||||||
MagicStick,
|
LayoutTemplate,
|
||||||
Operation,
|
ListChecks,
|
||||||
|
MessageSquareText,
|
||||||
|
Play,
|
||||||
Search,
|
Search,
|
||||||
Switch,
|
Snowflake,
|
||||||
VideoPlay,
|
Square,
|
||||||
} from '@element-plus/icons-vue';
|
} from '@vben/icons';
|
||||||
import { $t } from '@vben/locales';
|
import { $t } from '@vben/locales';
|
||||||
|
|
||||||
import { useVueFlow } from '@vue-flow/core';
|
import { useVueFlow } from '@vue-flow/core';
|
||||||
@@ -39,29 +41,52 @@ const collapsedNodes = ref<Set<string>>(new Set());
|
|||||||
|
|
||||||
// 定义不同节点的图标
|
// 定义不同节点的图标
|
||||||
const icons: any = {
|
const icons: any = {
|
||||||
start: VideoPlay,
|
start: Play,
|
||||||
llm: MagicStick,
|
llm: Bot,
|
||||||
http: Link,
|
http: Globe,
|
||||||
code: Cpu,
|
code: Code,
|
||||||
template: Document,
|
template: LayoutTemplate,
|
||||||
end: Finished,
|
end: Square,
|
||||||
db_query: Coin,
|
db_query: Database,
|
||||||
db_insert: Coin,
|
db_insert: Database,
|
||||||
db_update: Coin,
|
db_update: Database,
|
||||||
db_delete: Coin,
|
db_delete: Database,
|
||||||
db_sql: Coin,
|
db_sql: Database,
|
||||||
question: Help,
|
// 对话流节点
|
||||||
choice: Operation,
|
question: HelpCircle,
|
||||||
message: ChatLineRound,
|
choice: ListChecks,
|
||||||
confirm: Check,
|
message: MessageSquareText,
|
||||||
snowflake_cortex_llm: DataAnalysis,
|
confirm: CircleHelp,
|
||||||
snowflake_cortex_analyst: DataAnalysis,
|
// Snowflake Cortex 节点
|
||||||
loop: Switch,
|
snowflake_cortex_llm: Snowflake,
|
||||||
merge: Connection,
|
snowflake_cortex_analyst: Snowflake,
|
||||||
subflow: Guide,
|
// 循环节点
|
||||||
knowledge_retrieval: Collection,
|
loop: Play,
|
||||||
|
// 合并节点
|
||||||
|
merge: Combine,
|
||||||
|
// 表单节点
|
||||||
|
form_basic_info: FileText,
|
||||||
|
form_database_design: Database,
|
||||||
|
form_database_create: Database,
|
||||||
|
// 应用节点
|
||||||
|
app_create: AppWindow,
|
||||||
|
app_design: LayoutDashboard,
|
||||||
|
app_settings: LayoutDashboard,
|
||||||
|
app_update: LayoutDashboard,
|
||||||
|
// 仪表盘节点
|
||||||
|
dashboard_basic_info: LayoutDashboard,
|
||||||
|
dashboard_design: LayoutDashboard,
|
||||||
|
dashboard_create: LayoutDashboard,
|
||||||
|
dashboard_publish: LayoutDashboard,
|
||||||
|
// 系统总结节点
|
||||||
|
system_summary: ClipboardCheck,
|
||||||
|
// 子流程节点
|
||||||
|
subflow: Play,
|
||||||
|
// 知识库检索节点
|
||||||
|
knowledge_retrieval: BookOpen,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 获取当前节点的父循环节点(如果存在)
|
||||||
const getParentLoopNode = (nodeId: string) => {
|
const getParentLoopNode = (nodeId: string) => {
|
||||||
const currentNode = nodes.value.find((n) => n.id === nodeId);
|
const currentNode = nodes.value.find((n) => n.id === nodeId);
|
||||||
if (currentNode?.parentNode) {
|
if (currentNode?.parentNode) {
|
||||||
@@ -114,6 +139,92 @@ const availableNodes = computed(() => {
|
|||||||
|
|
||||||
// 根据节点类型获取输出变量 schema
|
// 根据节点类型获取输出变量 schema
|
||||||
switch (node.type) {
|
switch (node.type) {
|
||||||
|
case 'app_create': {
|
||||||
|
variables = [
|
||||||
|
{
|
||||||
|
key: 'app_id',
|
||||||
|
label: $t('ai-platform.workflow.editor.variableSelector.appId'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'app_code',
|
||||||
|
label: $t('ai-platform.workflow.editor.variableSelector.appCode'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'app_name',
|
||||||
|
label: $t('ai-platform.workflow.editor.variableSelector.appName'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'success',
|
||||||
|
label: $t(
|
||||||
|
'ai-platform.workflow.editor.variableSelector.createSuccess',
|
||||||
|
),
|
||||||
|
},
|
||||||
|
];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 'app_design': {
|
||||||
|
variables = [
|
||||||
|
{
|
||||||
|
key: 'design_content',
|
||||||
|
label: $t(
|
||||||
|
'ai-platform.workflow.editor.variableSelector.designContent',
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'design_title',
|
||||||
|
label: $t(
|
||||||
|
'ai-platform.workflow.editor.variableSelector.designTitle',
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'confirmed',
|
||||||
|
label: $t(
|
||||||
|
'ai-platform.workflow.editor.variableSelector.isConfirmed',
|
||||||
|
),
|
||||||
|
},
|
||||||
|
];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 'app_settings': {
|
||||||
|
variables = [
|
||||||
|
{
|
||||||
|
key: 'settings',
|
||||||
|
label: $t(
|
||||||
|
'ai-platform.workflow.editor.variableSelector.appSettings',
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'confirmed',
|
||||||
|
label: $t(
|
||||||
|
'ai-platform.workflow.editor.variableSelector.isConfirmed',
|
||||||
|
),
|
||||||
|
},
|
||||||
|
];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 'app_update': {
|
||||||
|
variables = [
|
||||||
|
{
|
||||||
|
key: 'update_success',
|
||||||
|
label: $t(
|
||||||
|
'ai-platform.workflow.editor.variableSelector.updateSuccess',
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'config_id',
|
||||||
|
label: $t(
|
||||||
|
'ai-platform.workflow.editor.variableSelector.configId',
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'update_message',
|
||||||
|
label: $t(
|
||||||
|
'ai-platform.workflow.editor.variableSelector.updateMessage',
|
||||||
|
),
|
||||||
|
},
|
||||||
|
];
|
||||||
|
break;
|
||||||
|
}
|
||||||
case 'choice': {
|
case 'choice': {
|
||||||
const choiceVar = node.data.variable_name || 'user_choice';
|
const choiceVar = node.data.variable_name || 'user_choice';
|
||||||
variables = [
|
variables = [
|
||||||
@@ -169,6 +280,96 @@ const availableNodes = computed(() => {
|
|||||||
];
|
];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case 'dashboard_basic_info': {
|
||||||
|
variables = [
|
||||||
|
{
|
||||||
|
key: 'dashboard_basic_info',
|
||||||
|
label: $t(
|
||||||
|
'ai-platform.workflow.editor.variableSelector.dashboardBasicInfo',
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'dashboard_name',
|
||||||
|
label: $t(
|
||||||
|
'ai-platform.workflow.editor.variableSelector.dashboardName',
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'dashboard_code',
|
||||||
|
label: $t(
|
||||||
|
'ai-platform.workflow.editor.variableSelector.dashboardCode',
|
||||||
|
),
|
||||||
|
},
|
||||||
|
];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 'dashboard_create': {
|
||||||
|
variables = [
|
||||||
|
{
|
||||||
|
key: 'dashboard_id',
|
||||||
|
label: $t(
|
||||||
|
'ai-platform.workflow.editor.variableSelector.dashboardId',
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'dashboard_code',
|
||||||
|
label: $t(
|
||||||
|
'ai-platform.workflow.editor.variableSelector.dashboardCode',
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'page_meta',
|
||||||
|
label: $t(
|
||||||
|
'ai-platform.workflow.editor.variableSelector.pageMeta',
|
||||||
|
),
|
||||||
|
},
|
||||||
|
];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 'dashboard_design': {
|
||||||
|
variables = [
|
||||||
|
{
|
||||||
|
key: 'page_config',
|
||||||
|
label: $t(
|
||||||
|
'ai-platform.workflow.editor.variableSelector.pageConfig',
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'design_title',
|
||||||
|
label: $t(
|
||||||
|
'ai-platform.workflow.editor.variableSelector.designTitle',
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'confirmed',
|
||||||
|
label: $t(
|
||||||
|
'ai-platform.workflow.editor.variableSelector.isConfirmed',
|
||||||
|
),
|
||||||
|
},
|
||||||
|
];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 'dashboard_publish': {
|
||||||
|
variables = [
|
||||||
|
{
|
||||||
|
key: 'menu_id',
|
||||||
|
label: $t('ai-platform.workflow.editor.variableSelector.menuId'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'route_path',
|
||||||
|
label: $t(
|
||||||
|
'ai-platform.workflow.editor.variableSelector.routePath',
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'publish_result',
|
||||||
|
label: $t(
|
||||||
|
'ai-platform.workflow.editor.variableSelector.publishResult',
|
||||||
|
),
|
||||||
|
},
|
||||||
|
];
|
||||||
|
break;
|
||||||
|
}
|
||||||
case 'db_delete': {
|
case 'db_delete': {
|
||||||
const deleteOutputVar = node.data.output_variable || 'delete_result';
|
const deleteOutputVar = node.data.output_variable || 'delete_result';
|
||||||
variables = [
|
variables = [
|
||||||
@@ -259,6 +460,205 @@ const availableNodes = computed(() => {
|
|||||||
];
|
];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case 'form_basic_info': {
|
||||||
|
variables = [
|
||||||
|
{
|
||||||
|
key: 'form_basic_info',
|
||||||
|
label: $t(
|
||||||
|
'ai-platform.workflow.editor.variableSelector.formBasicInfoObj',
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'form_name',
|
||||||
|
label: $t(
|
||||||
|
'ai-platform.workflow.editor.variableSelector.formName',
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'form_code',
|
||||||
|
label: $t(
|
||||||
|
'ai-platform.workflow.editor.variableSelector.formCode',
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'form_type',
|
||||||
|
label: $t(
|
||||||
|
'ai-platform.workflow.editor.variableSelector.formType',
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'form_description',
|
||||||
|
label: $t(
|
||||||
|
'ai-platform.workflow.editor.variableSelector.formDescription',
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'form_sort',
|
||||||
|
label: $t(
|
||||||
|
'ai-platform.workflow.editor.variableSelector.formSort',
|
||||||
|
),
|
||||||
|
},
|
||||||
|
];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 'form_create': {
|
||||||
|
variables = [
|
||||||
|
{
|
||||||
|
key: 'form_id',
|
||||||
|
label: $t('ai-platform.workflow.editor.variableSelector.formId'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'form_code',
|
||||||
|
label: $t(
|
||||||
|
'ai-platform.workflow.editor.variableSelector.formCode',
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'form_meta',
|
||||||
|
label: $t(
|
||||||
|
'ai-platform.workflow.editor.variableSelector.formMeta',
|
||||||
|
),
|
||||||
|
},
|
||||||
|
];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 'form_database_create': {
|
||||||
|
variables = [
|
||||||
|
{
|
||||||
|
key: 'creation_result',
|
||||||
|
label: $t(
|
||||||
|
'ai-platform.workflow.editor.variableSelector.creationResult',
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'all_tables_ready',
|
||||||
|
label: $t(
|
||||||
|
'ai-platform.workflow.editor.variableSelector.allTablesReady',
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'created_count',
|
||||||
|
label: $t(
|
||||||
|
'ai-platform.workflow.editor.variableSelector.createdCount',
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'error_count',
|
||||||
|
label: $t(
|
||||||
|
'ai-platform.workflow.editor.variableSelector.errorCount',
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'schema_name',
|
||||||
|
label: $t(
|
||||||
|
'ai-platform.workflow.editor.variableSelector.schemaName',
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'table_name',
|
||||||
|
label: $t(
|
||||||
|
'ai-platform.workflow.editor.variableSelector.tableName',
|
||||||
|
),
|
||||||
|
},
|
||||||
|
];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 'form_database_design': {
|
||||||
|
variables = [
|
||||||
|
{
|
||||||
|
key: 'database_design',
|
||||||
|
label: $t(
|
||||||
|
'ai-platform.workflow.editor.variableSelector.dbDesignObj',
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'table_name',
|
||||||
|
label: $t(
|
||||||
|
'ai-platform.workflow.editor.variableSelector.tableName',
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'field_count',
|
||||||
|
label: $t(
|
||||||
|
'ai-platform.workflow.editor.variableSelector.fieldCount',
|
||||||
|
),
|
||||||
|
},
|
||||||
|
];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 'form_list_design': {
|
||||||
|
variables = [
|
||||||
|
{
|
||||||
|
key: 'list_config',
|
||||||
|
label: $t(
|
||||||
|
'ai-platform.workflow.editor.variableSelector.listConfig',
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'query_field_count',
|
||||||
|
label: $t(
|
||||||
|
'ai-platform.workflow.editor.variableSelector.queryFieldCount',
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'column_count',
|
||||||
|
label: $t(
|
||||||
|
'ai-platform.workflow.editor.variableSelector.columnCount',
|
||||||
|
),
|
||||||
|
},
|
||||||
|
];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 'form_publish': {
|
||||||
|
variables = [
|
||||||
|
{
|
||||||
|
key: 'menu_id',
|
||||||
|
label: $t('ai-platform.workflow.editor.variableSelector.menuId'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'route_path',
|
||||||
|
label: $t(
|
||||||
|
'ai-platform.workflow.editor.variableSelector.routePath',
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'publish_result',
|
||||||
|
label: $t(
|
||||||
|
'ai-platform.workflow.editor.variableSelector.publishResult',
|
||||||
|
),
|
||||||
|
},
|
||||||
|
];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 'form_ui_design': {
|
||||||
|
variables = [
|
||||||
|
{
|
||||||
|
key: 'form_ui_design',
|
||||||
|
label: $t(
|
||||||
|
'ai-platform.workflow.editor.variableSelector.formUiDesign',
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'form_code',
|
||||||
|
label: $t(
|
||||||
|
'ai-platform.workflow.editor.variableSelector.formCode',
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'field_count',
|
||||||
|
label: $t(
|
||||||
|
'ai-platform.workflow.editor.variableSelector.fieldCount',
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'group_count',
|
||||||
|
label: $t(
|
||||||
|
'ai-platform.workflow.editor.variableSelector.groupCount',
|
||||||
|
),
|
||||||
|
},
|
||||||
|
];
|
||||||
|
break;
|
||||||
|
}
|
||||||
case 'http': {
|
case 'http': {
|
||||||
variables = [
|
variables = [
|
||||||
{
|
{
|
||||||
@@ -485,6 +885,23 @@ const availableNodes = computed(() => {
|
|||||||
),
|
),
|
||||||
isSystem: true,
|
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',
|
||||||
|
label: $t(
|
||||||
|
'ai-platform.workflow.editor.variableSelector.formCode',
|
||||||
|
),
|
||||||
|
isSystem: true,
|
||||||
|
},
|
||||||
];
|
];
|
||||||
// 加上自定义变量
|
// 加上自定义变量
|
||||||
variables.push(
|
variables.push(
|
||||||
@@ -548,6 +965,33 @@ const availableNodes = computed(() => {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case 'system_summary': {
|
||||||
|
variables = [
|
||||||
|
{
|
||||||
|
key: 'summary',
|
||||||
|
label: $t(
|
||||||
|
'ai-platform.workflow.editor.variableSelector.summaryData',
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'total_forms',
|
||||||
|
label: $t(
|
||||||
|
'ai-platform.workflow.editor.variableSelector.totalForms',
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'has_app',
|
||||||
|
label: $t('ai-platform.workflow.editor.variableSelector.hasApp'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'has_dashboard',
|
||||||
|
label: $t(
|
||||||
|
'ai-platform.workflow.editor.variableSelector.hasDashboard',
|
||||||
|
),
|
||||||
|
},
|
||||||
|
];
|
||||||
|
break;
|
||||||
|
}
|
||||||
case 'template': {
|
case 'template': {
|
||||||
const templateOutputVar =
|
const templateOutputVar =
|
||||||
node.data.output_variable || 'template_result';
|
node.data.output_variable || 'template_result';
|
||||||
@@ -663,7 +1107,7 @@ const handleSelect = (nodeId: string, variable: string) => {
|
|||||||
@click="toggleNodeCollapse(node.id)"
|
@click="toggleNodeCollapse(node.id)"
|
||||||
>
|
>
|
||||||
<component
|
<component
|
||||||
:is="isNodeCollapsed(node.id) ? ArrowRight : ArrowDown"
|
:is="isNodeCollapsed(node.id) ? ChevronRight : ChevronDown"
|
||||||
class="text-muted-foreground size-3 shrink-0"
|
class="text-muted-foreground size-3 shrink-0"
|
||||||
/>
|
/>
|
||||||
<component
|
<component
|
||||||
|
|||||||
@@ -184,6 +184,7 @@ const nodeTypes = {
|
|||||||
snowflake_cortex_analyst: markRaw(SnowflakeCortexAnalystNode),
|
snowflake_cortex_analyst: markRaw(SnowflakeCortexAnalystNode),
|
||||||
// 循环节点
|
// 循环节点
|
||||||
loop: markRaw(LoopNode),
|
loop: markRaw(LoopNode),
|
||||||
|
// 表单节点
|
||||||
form_basic_info: markRaw(FormBasicInfoNode),
|
form_basic_info: markRaw(FormBasicInfoNode),
|
||||||
form_database_design: markRaw(FormDatabaseDesignNode),
|
form_database_design: markRaw(FormDatabaseDesignNode),
|
||||||
form_database_create: markRaw(FormDatabaseCreateNode),
|
form_database_create: markRaw(FormDatabaseCreateNode),
|
||||||
@@ -191,23 +192,27 @@ const nodeTypes = {
|
|||||||
form_list_design: markRaw(FormListDesignNode),
|
form_list_design: markRaw(FormListDesignNode),
|
||||||
form_create: markRaw(FormCreateNode),
|
form_create: markRaw(FormCreateNode),
|
||||||
form_publish: markRaw(FormPublishNode),
|
form_publish: markRaw(FormPublishNode),
|
||||||
|
// 应用管理节点
|
||||||
app_create: markRaw(AppCreateNode),
|
app_create: markRaw(AppCreateNode),
|
||||||
app_design: markRaw(AppDesignNode),
|
app_design: markRaw(AppDesignNode),
|
||||||
app_settings: markRaw(AppSettingsNode),
|
app_settings: markRaw(AppSettingsNode),
|
||||||
app_update: markRaw(AppUpdateNode),
|
app_update: markRaw(AppUpdateNode),
|
||||||
|
// 仪表盘节点
|
||||||
dashboard_basic_info: markRaw(DashboardBasicInfoNode),
|
dashboard_basic_info: markRaw(DashboardBasicInfoNode),
|
||||||
dashboard_design: markRaw(DashboardDesignNode),
|
dashboard_design: markRaw(DashboardDesignNode),
|
||||||
dashboard_create: markRaw(DashboardCreateNode),
|
dashboard_create: markRaw(DashboardCreateNode),
|
||||||
dashboard_publish: markRaw(DashboardPublishNode),
|
dashboard_publish: markRaw(DashboardPublishNode),
|
||||||
|
// 系统总结节点
|
||||||
system_summary: markRaw(SystemSummaryNode),
|
system_summary: markRaw(SystemSummaryNode),
|
||||||
|
// 子流程节点
|
||||||
|
subflow: markRaw(SubflowNode),
|
||||||
|
// 表单数据节点
|
||||||
form_data_create: markRaw(FormDataNode),
|
form_data_create: markRaw(FormDataNode),
|
||||||
form_data_read: markRaw(FormDataNode),
|
form_data_read: markRaw(FormDataNode),
|
||||||
form_data_update: markRaw(FormDataNode),
|
form_data_update: markRaw(FormDataNode),
|
||||||
form_data_delete: markRaw(FormDataNode),
|
form_data_delete: markRaw(FormDataNode),
|
||||||
form_data_list: markRaw(FormDataNode),
|
form_data_list: markRaw(FormDataNode),
|
||||||
form_schema_to_llm: markRaw(FormDataNode),
|
form_schema_to_llm: markRaw(FormDataNode),
|
||||||
// 子流程节点
|
|
||||||
subflow: markRaw(SubflowNode),
|
|
||||||
// Text-to-SQL 节点
|
// Text-to-SQL 节点
|
||||||
text_to_sql: markRaw(TextToSqlNode),
|
text_to_sql: markRaw(TextToSqlNode),
|
||||||
// 知识库节点
|
// 知识库节点
|
||||||
@@ -715,19 +720,19 @@ const iconComponents: Record<string, any> = {
|
|||||||
// 循环节点图标
|
// 循环节点图标
|
||||||
RefreshCw,
|
RefreshCw,
|
||||||
CornerDownLeft,
|
CornerDownLeft,
|
||||||
|
// 表单节点图标
|
||||||
FileText,
|
FileText,
|
||||||
TableProperties,
|
TableProperties,
|
||||||
LayoutDashboard,
|
|
||||||
Settings,
|
|
||||||
FilePlus,
|
|
||||||
Upload,
|
|
||||||
ClipboardCheck,
|
|
||||||
// 表单节点图标
|
|
||||||
Send,
|
Send,
|
||||||
// 应用节点图标
|
// 应用节点图标
|
||||||
|
LayoutDashboard,
|
||||||
|
Settings,
|
||||||
Save,
|
Save,
|
||||||
// 仪表盘节点图标
|
// 仪表盘节点图标
|
||||||
|
FilePlus,
|
||||||
|
Upload,
|
||||||
// 系统总结节点图标
|
// 系统总结节点图标
|
||||||
|
ClipboardCheck,
|
||||||
// 子流程节点图标
|
// 子流程节点图标
|
||||||
Workflow,
|
Workflow,
|
||||||
// 知识库节点图标
|
// 知识库节点图标
|
||||||
@@ -736,8 +741,10 @@ const iconComponents: Record<string, any> = {
|
|||||||
|
|
||||||
// 过滤后的节点分类
|
// 过滤后的节点分类
|
||||||
const filteredNodeCategories = computed(() => {
|
const filteredNodeCategories = computed(() => {
|
||||||
|
// 首先根据工作流类型过滤分类
|
||||||
let categories = nodeCategories.value;
|
let categories = nodeCategories.value;
|
||||||
|
|
||||||
|
// 如果是通用类型,排除表单设计、应用管理、仪表盘分组
|
||||||
if (workflow.value?.workflow_type === 'general') {
|
if (workflow.value?.workflow_type === 'general') {
|
||||||
const excludeNames = new Set([
|
const excludeNames = new Set([
|
||||||
$t('ai-platform.workflow.editor.categories.appManage'),
|
$t('ai-platform.workflow.editor.categories.appManage'),
|
||||||
|
|||||||
@@ -279,7 +279,7 @@ const nodeColorConfig = computed(() => {
|
|||||||
class="size-3"
|
class="size-3"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<span v-if="executionStatus.status === 'running'">运行中...</span>
|
<span v-if="executionStatus.status === 'running'">Running...</span>
|
||||||
<span v-else-if="executionStatus.elapsed_time !== undefined">{{ executionStatus.elapsed_time }}ms</span>
|
<span v-else-if="executionStatus.elapsed_time !== undefined">{{ executionStatus.elapsed_time }}ms</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -357,7 +357,7 @@ const nodeColorConfig = computed(() => {
|
|||||||
"
|
"
|
||||||
ref="addButtonRef"
|
ref="addButtonRef"
|
||||||
class="bg-primary hover:bg-primary/90 absolute -right-8 top-1/2 flex size-6 -translate-y-1/2 cursor-pointer items-center justify-center rounded-full text-white opacity-0 shadow-md transition-opacity hover:scale-110 group-hover:opacity-100"
|
class="bg-primary hover:bg-primary/90 absolute -right-8 top-1/2 flex size-6 -translate-y-1/2 cursor-pointer items-center justify-center rounded-full text-white opacity-0 shadow-md transition-opacity hover:scale-110 group-hover:opacity-100"
|
||||||
title="添加下一个节点"
|
title="{{ $t('ai-platform.workflow.nodes.common.addNextNode') }}"
|
||||||
@click.stop="handleClick"
|
@click.stop="handleClick"
|
||||||
>
|
>
|
||||||
<Plus class="pointer-events-none size-3.5" />
|
<Plus class="pointer-events-none size-3.5" />
|
||||||
|
|||||||
@@ -173,7 +173,7 @@ watch(
|
|||||||
<XCircle class="size-3 cursor-help" />
|
<XCircle class="size-3 cursor-help" />
|
||||||
</ElTooltip>
|
</ElTooltip>
|
||||||
<XCircle v-else-if="isFailed" class="size-3" />
|
<XCircle v-else-if="isFailed" class="size-3" />
|
||||||
<span v-if="isRunning">运行中...</span>
|
<span v-if="isRunning">Running...</span>
|
||||||
<span v-else-if="executionStatus.elapsed_time !== undefined">
|
<span v-else-if="executionStatus.elapsed_time !== undefined">
|
||||||
{{ executionStatus.elapsed_time }}ms
|
{{ executionStatus.elapsed_time }}ms
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
@@ -124,7 +124,7 @@ const removeExample = (intentIndex: number, exampleIndex: number) => {
|
|||||||
<ElFormItem :label="$t('ai-platform.workflow.panels.common.model')">
|
<ElFormItem :label="$t('ai-platform.workflow.panels.common.model')">
|
||||||
<ElSelect
|
<ElSelect
|
||||||
v-model="form.model_id"
|
v-model="form.model_id"
|
||||||
:placeholder="$t('ai-platform.workflow.panels.intent.selectModelHint')"
|
placeholder="{{ $t('ai-platform.workflow.panels.intent.selectModelHint') }}"
|
||||||
>
|
>
|
||||||
<ElOption
|
<ElOption
|
||||||
v-for="m in models"
|
v-for="m in models"
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, watch } from 'vue';
|
import { ref, watch } from 'vue';
|
||||||
|
|
||||||
import { Delete as Trash2, Plus } from '@element-plus/icons-vue';
|
import { Plus, Trash2 } from '@vben/icons';
|
||||||
import { $t } from '@vben/locales';
|
import { $t } from '@vben/locales';
|
||||||
|
|
||||||
import { ElButton, ElForm, ElInput, ElOption, ElSelect } from 'element-plus';
|
import { ElButton, ElForm, ElInput, ElOption, ElSelect } from 'element-plus';
|
||||||
@@ -50,6 +50,45 @@ const handleDelete = (index: number) => {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- 默认的 application_id 变量(不可删除) -->
|
||||||
|
<div class="border-primary/30 bg-primary/5 rounded border p-3">
|
||||||
|
<div class="mb-2 flex items-center justify-between">
|
||||||
|
<span class="text-primary text-sm font-medium">application_id</span>
|
||||||
|
<span class="text-muted-foreground text-xs">{{
|
||||||
|
$t('ai-platform.workflow.panels.common.sysVar')
|
||||||
|
}}</span>
|
||||||
|
</div>
|
||||||
|
<div class="text-muted-foreground text-xs">
|
||||||
|
{{ $t('ai-platform.workflow.panels.start.appIdDesc') }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 默认的 application_code 变量(不可删除) -->
|
||||||
|
<div class="border-primary/30 bg-primary/5 rounded border p-3">
|
||||||
|
<div class="mb-2 flex items-center justify-between">
|
||||||
|
<span class="text-primary text-sm font-medium">application_code</span>
|
||||||
|
<span class="text-muted-foreground text-xs">{{
|
||||||
|
$t('ai-platform.workflow.panels.common.sysVar')
|
||||||
|
}}</span>
|
||||||
|
</div>
|
||||||
|
<div class="text-muted-foreground text-xs">
|
||||||
|
{{ $t('ai-platform.workflow.panels.start.appCodeDesc') }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 默认的 form_code 变量(不可删除) -->
|
||||||
|
<div class="border-primary/30 bg-primary/5 rounded border p-3">
|
||||||
|
<div class="mb-2 flex items-center justify-between">
|
||||||
|
<span class="text-primary text-sm font-medium">form_code</span>
|
||||||
|
<span class="text-muted-foreground text-xs">{{
|
||||||
|
$t('ai-platform.workflow.panels.common.sysVar')
|
||||||
|
}}</span>
|
||||||
|
</div>
|
||||||
|
<div class="text-muted-foreground text-xs">
|
||||||
|
{{ $t('ai-platform.workflow.panels.start.formCodeDesc') }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="flex items-center justify-between">
|
<div class="flex items-center justify-between">
|
||||||
<span class="text-foreground text-sm font-medium">{{
|
<span class="text-foreground text-sm font-medium">{{
|
||||||
$t('ai-platform.workflow.panels.common.customVars')
|
$t('ai-platform.workflow.panels.common.customVars')
|
||||||
|
|||||||
@@ -1,16 +1,32 @@
|
|||||||
import { markRaw } from 'vue';
|
import { markRaw } from 'vue';
|
||||||
|
|
||||||
import AddButtonEdge from '../editor/edges/AddButtonEdge.vue';
|
import AddButtonEdge from '../editor/edges/AddButtonEdge.vue';
|
||||||
|
import AppCreateNode from '../editor/nodes/AppCreateNode.vue';
|
||||||
|
import AppDesignNode from '../editor/nodes/AppDesignNode.vue';
|
||||||
|
import AppSettingsNode from '../editor/nodes/AppSettingsNode.vue';
|
||||||
|
import AppUpdateNode from '../editor/nodes/AppUpdateNode.vue';
|
||||||
import ChoiceNode from '../editor/nodes/ChoiceNode.vue';
|
import ChoiceNode from '../editor/nodes/ChoiceNode.vue';
|
||||||
import CodeNode from '../editor/nodes/CodeNode.vue';
|
import CodeNode from '../editor/nodes/CodeNode.vue';
|
||||||
import ConditionNode from '../editor/nodes/ConditionNode.vue';
|
import ConditionNode from '../editor/nodes/ConditionNode.vue';
|
||||||
import ConfirmNode from '../editor/nodes/ConfirmNode.vue';
|
import ConfirmNode from '../editor/nodes/ConfirmNode.vue';
|
||||||
|
import DashboardBasicInfoNode from '../editor/nodes/DashboardBasicInfoNode.vue';
|
||||||
|
import DashboardCreateNode from '../editor/nodes/DashboardCreateNode.vue';
|
||||||
|
import DashboardDesignNode from '../editor/nodes/DashboardDesignNode.vue';
|
||||||
|
import DashboardPublishNode from '../editor/nodes/DashboardPublishNode.vue';
|
||||||
import DbDeleteNode from '../editor/nodes/DbDeleteNode.vue';
|
import DbDeleteNode from '../editor/nodes/DbDeleteNode.vue';
|
||||||
import DbInsertNode from '../editor/nodes/DbInsertNode.vue';
|
import DbInsertNode from '../editor/nodes/DbInsertNode.vue';
|
||||||
import DbQueryNode from '../editor/nodes/DbQueryNode.vue';
|
import DbQueryNode from '../editor/nodes/DbQueryNode.vue';
|
||||||
import DbSqlNode from '../editor/nodes/DbSqlNode.vue';
|
import DbSqlNode from '../editor/nodes/DbSqlNode.vue';
|
||||||
import DbUpdateNode from '../editor/nodes/DbUpdateNode.vue';
|
import DbUpdateNode from '../editor/nodes/DbUpdateNode.vue';
|
||||||
import EndNode from '../editor/nodes/EndNode.vue';
|
import EndNode from '../editor/nodes/EndNode.vue';
|
||||||
|
import FormBasicInfoNode from '../editor/nodes/FormBasicInfoNode.vue';
|
||||||
|
import FormCreateNode from '../editor/nodes/FormCreateNode.vue';
|
||||||
|
import FormDatabaseCreateNode from '../editor/nodes/FormDatabaseCreateNode.vue';
|
||||||
|
import FormDatabaseDesignNode from '../editor/nodes/FormDatabaseDesignNode.vue';
|
||||||
|
import FormDataNode from '../editor/nodes/FormDataNode.vue';
|
||||||
|
import FormListDesignNode from '../editor/nodes/FormListDesignNode.vue';
|
||||||
|
import FormPublishNode from '../editor/nodes/FormPublishNode.vue';
|
||||||
|
import FormUIDesignNode from '../editor/nodes/FormUIDesignNode.vue';
|
||||||
import HttpNode from '../editor/nodes/HttpNode.vue';
|
import HttpNode from '../editor/nodes/HttpNode.vue';
|
||||||
import IntentNode from '../editor/nodes/IntentNode.vue';
|
import IntentNode from '../editor/nodes/IntentNode.vue';
|
||||||
import KnowledgeRetrievalNode from '../editor/nodes/KnowledgeRetrievalNode.vue';
|
import KnowledgeRetrievalNode from '../editor/nodes/KnowledgeRetrievalNode.vue';
|
||||||
@@ -24,6 +40,7 @@ import SnowflakeCortexAnalystNode from '../editor/nodes/SnowflakeCortexAnalystNo
|
|||||||
import SnowflakeCortexLLMNode from '../editor/nodes/SnowflakeCortexLLMNode.vue';
|
import SnowflakeCortexLLMNode from '../editor/nodes/SnowflakeCortexLLMNode.vue';
|
||||||
import StartNode from '../editor/nodes/StartNode.vue';
|
import StartNode from '../editor/nodes/StartNode.vue';
|
||||||
import SubflowNode from '../editor/nodes/SubflowNode.vue';
|
import SubflowNode from '../editor/nodes/SubflowNode.vue';
|
||||||
|
import SystemSummaryNode from '../editor/nodes/SystemSummaryNode.vue';
|
||||||
import TemplateNode from '../editor/nodes/TemplateNode.vue';
|
import TemplateNode from '../editor/nodes/TemplateNode.vue';
|
||||||
import TextToSqlNode from '../editor/nodes/TextToSqlNode.vue';
|
import TextToSqlNode from '../editor/nodes/TextToSqlNode.vue';
|
||||||
|
|
||||||
@@ -50,7 +67,29 @@ export const workflowNodeTypes = {
|
|||||||
snowflake_cortex_llm: markRaw(SnowflakeCortexLLMNode),
|
snowflake_cortex_llm: markRaw(SnowflakeCortexLLMNode),
|
||||||
snowflake_cortex_analyst: markRaw(SnowflakeCortexAnalystNode),
|
snowflake_cortex_analyst: markRaw(SnowflakeCortexAnalystNode),
|
||||||
loop: markRaw(LoopNode),
|
loop: markRaw(LoopNode),
|
||||||
|
form_basic_info: markRaw(FormBasicInfoNode),
|
||||||
|
form_database_design: markRaw(FormDatabaseDesignNode),
|
||||||
|
form_database_create: markRaw(FormDatabaseCreateNode),
|
||||||
|
form_ui_design: markRaw(FormUIDesignNode),
|
||||||
|
form_list_design: markRaw(FormListDesignNode),
|
||||||
|
form_create: markRaw(FormCreateNode),
|
||||||
|
form_publish: markRaw(FormPublishNode),
|
||||||
|
app_create: markRaw(AppCreateNode),
|
||||||
|
app_design: markRaw(AppDesignNode),
|
||||||
|
app_settings: markRaw(AppSettingsNode),
|
||||||
|
app_update: markRaw(AppUpdateNode),
|
||||||
|
dashboard_basic_info: markRaw(DashboardBasicInfoNode),
|
||||||
|
dashboard_design: markRaw(DashboardDesignNode),
|
||||||
|
dashboard_create: markRaw(DashboardCreateNode),
|
||||||
|
dashboard_publish: markRaw(DashboardPublishNode),
|
||||||
|
system_summary: markRaw(SystemSummaryNode),
|
||||||
subflow: markRaw(SubflowNode),
|
subflow: markRaw(SubflowNode),
|
||||||
|
form_data_create: markRaw(FormDataNode),
|
||||||
|
form_data_read: markRaw(FormDataNode),
|
||||||
|
form_data_update: markRaw(FormDataNode),
|
||||||
|
form_data_delete: markRaw(FormDataNode),
|
||||||
|
form_data_list: markRaw(FormDataNode),
|
||||||
|
form_schema_to_llm: markRaw(FormDataNode),
|
||||||
text_to_sql: markRaw(TextToSqlNode),
|
text_to_sql: markRaw(TextToSqlNode),
|
||||||
knowledge_retrieval: markRaw(KnowledgeRetrievalNode),
|
knowledge_retrieval: markRaw(KnowledgeRetrievalNode),
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user