feat: lighten ai agent admin frontend
This commit is contained in:
@@ -35,24 +35,6 @@ import { ChatBox } from '#/components/ChatBox';
|
||||
import { useChatApi } from './composables/useChatApi';
|
||||
import { useEventHandler } from './composables/useEventHandler';
|
||||
|
||||
const AppDesignPanel = defineAsyncComponent(() =>
|
||||
import('#/components/form-editor/AppDesignPanel.vue'),
|
||||
);
|
||||
const AppSettingsPanel = defineAsyncComponent(() =>
|
||||
import('#/components/form-editor/AppSettingsPanel.vue'),
|
||||
);
|
||||
const DashboardBasicInfoConfirmPanel = defineAsyncComponent(() =>
|
||||
import('#/components/form-editor/DashboardBasicInfoConfirmPanel.vue'),
|
||||
);
|
||||
const DashboardDesignConfirmPanel = defineAsyncComponent(() =>
|
||||
import('#/components/form-editor/DashboardDesignConfirmPanel.vue'),
|
||||
);
|
||||
const DashboardPublishConfirmPanel = defineAsyncComponent(() =>
|
||||
import('#/components/form-editor/DashboardPublishConfirmPanel.vue'),
|
||||
);
|
||||
const DesignEditorPanel = defineAsyncComponent(() =>
|
||||
import('#/components/form-editor/DesignEditorPanel.vue'),
|
||||
);
|
||||
const SystemSummaryConfirmPanel = defineAsyncComponent(() =>
|
||||
import('#/components/form-editor/SystemSummaryConfirmPanel.vue'),
|
||||
);
|
||||
@@ -206,25 +188,7 @@ const variablesDialogVisible = ref(false);
|
||||
const variablesForm = ref<Record<string, any>>({});
|
||||
const pendingMessage = ref('');
|
||||
|
||||
// ==================== 设计预览面板状态 ====================
|
||||
const showDesignPanel = ref(false);
|
||||
const currentDesign = ref<DesignPreviewData | undefined>(undefined);
|
||||
|
||||
const showAppDesignPanel = ref(false);
|
||||
const currentAppDesign = ref<DesignPreviewData | undefined>(undefined);
|
||||
|
||||
const showAppSettingsPanel = ref(false);
|
||||
const currentAppSettings = ref<DesignPreviewData | undefined>(undefined);
|
||||
|
||||
const showDashboardBasicInfoPanel = ref(false);
|
||||
const currentDashboardBasicInfo = ref<DesignPreviewData | undefined>(undefined);
|
||||
|
||||
const showDashboardDesignPanel = ref(false);
|
||||
const currentDashboardDesign = ref<DesignPreviewData | undefined>(undefined);
|
||||
|
||||
const showDashboardPublishPanel = ref(false);
|
||||
const currentDashboardPublish = ref<DesignPreviewData | undefined>(undefined);
|
||||
|
||||
// ==================== 轻量版设计预览面板状态 ====================
|
||||
const showSystemSummaryPanel = ref(false);
|
||||
const currentSystemSummary = ref<DesignPreviewData | undefined>(undefined);
|
||||
|
||||
@@ -234,15 +198,7 @@ const loadingAnimationTitle = ref('AI 正在开发...');
|
||||
|
||||
// 是否有任何设计面板打开
|
||||
const hasAnyDesignPanelOpen = computed(
|
||||
() =>
|
||||
showDesignPanel.value ||
|
||||
showAppDesignPanel.value ||
|
||||
showAppSettingsPanel.value ||
|
||||
showDashboardBasicInfoPanel.value ||
|
||||
showDashboardDesignPanel.value ||
|
||||
showDashboardPublishPanel.value ||
|
||||
showSystemSummaryPanel.value ||
|
||||
showLoadingAnimation.value,
|
||||
() => showSystemSummaryPanel.value || showLoadingAnimation.value,
|
||||
);
|
||||
|
||||
// ==================== 工作流变量 ====================
|
||||
@@ -290,43 +246,15 @@ const handleDesignPreview = (data: DesignPreviewData) => {
|
||||
// 关闭加载动画
|
||||
showLoadingAnimation.value = false;
|
||||
|
||||
switch (data.type) {
|
||||
case 'app_design': {
|
||||
currentAppDesign.value = data;
|
||||
showAppDesignPanel.value = true;
|
||||
break;
|
||||
}
|
||||
case 'app_settings': {
|
||||
currentAppSettings.value = data;
|
||||
showAppSettingsPanel.value = true;
|
||||
break;
|
||||
}
|
||||
case 'dashboard_basic_info': {
|
||||
currentDashboardBasicInfo.value = data;
|
||||
showDashboardBasicInfoPanel.value = true;
|
||||
break;
|
||||
}
|
||||
case 'dashboard_design': {
|
||||
currentDashboardDesign.value = data;
|
||||
showDashboardDesignPanel.value = true;
|
||||
break;
|
||||
}
|
||||
case 'dashboard_publish': {
|
||||
currentDashboardPublish.value = data;
|
||||
showDashboardPublishPanel.value = true;
|
||||
break;
|
||||
}
|
||||
case 'system_summary': {
|
||||
currentSystemSummary.value = data;
|
||||
showSystemSummaryPanel.value = true;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
currentDesign.value = data;
|
||||
showDesignPanel.value = true;
|
||||
break;
|
||||
}
|
||||
if (data.type === 'system_summary') {
|
||||
currentSystemSummary.value = data;
|
||||
showSystemSummaryPanel.value = true;
|
||||
return undefined;
|
||||
}
|
||||
|
||||
waitingForInput.value = false;
|
||||
waitingConfig.value = null;
|
||||
return `**${data.title || '设计预览'}**\n\n轻量版已移除在线开发设计确认面板。请将该流程改为 LLM、对话、条件、并行、子流程或知识库检索等 AI 协作节点后再运行。`;
|
||||
};
|
||||
|
||||
const { handleStreamEvent, updateAssistantMessage } = useEventHandler({
|
||||
@@ -810,78 +738,6 @@ const createDesignCloseHandler = (
|
||||
};
|
||||
};
|
||||
|
||||
const handleDesignConfirm = createDesignConfirmHandler(
|
||||
showDesignPanel,
|
||||
currentDesign,
|
||||
'确认设计',
|
||||
);
|
||||
const handleDesignClose = createDesignCloseHandler(
|
||||
showDesignPanel,
|
||||
currentDesign,
|
||||
);
|
||||
|
||||
const handleAppDesignConfirm = createDesignConfirmHandler(
|
||||
showAppDesignPanel,
|
||||
currentAppDesign,
|
||||
'确认应用设计',
|
||||
);
|
||||
const handleAppDesignClose = createDesignCloseHandler(
|
||||
showAppDesignPanel,
|
||||
currentAppDesign,
|
||||
);
|
||||
|
||||
const handleAppSettingsConfirm = createDesignConfirmHandler(
|
||||
showAppSettingsPanel,
|
||||
currentAppSettings,
|
||||
'确认应用设置',
|
||||
);
|
||||
const handleAppSettingsClose = createDesignCloseHandler(
|
||||
showAppSettingsPanel,
|
||||
currentAppSettings,
|
||||
);
|
||||
|
||||
const handleDashboardBasicInfoConfirm = createDesignConfirmHandler(
|
||||
showDashboardBasicInfoPanel,
|
||||
currentDashboardBasicInfo,
|
||||
'确认仪表盘基础信息',
|
||||
);
|
||||
const handleDashboardBasicInfoClose = createDesignCloseHandler(
|
||||
showDashboardBasicInfoPanel,
|
||||
currentDashboardBasicInfo,
|
||||
);
|
||||
|
||||
const handleDashboardDesignConfirm = createDesignConfirmHandler(
|
||||
showDashboardDesignPanel,
|
||||
currentDashboardDesign,
|
||||
'确认仪表盘设计',
|
||||
);
|
||||
const handleDashboardDesignClose = createDesignCloseHandler(
|
||||
showDashboardDesignPanel,
|
||||
currentDashboardDesign,
|
||||
);
|
||||
|
||||
const handleDashboardPublishConfirm = (data: Record<string, any>) => {
|
||||
showDashboardPublishPanel.value = false;
|
||||
currentDashboardPublish.value = undefined;
|
||||
|
||||
const userMsg: ChatMessage = {
|
||||
id: generateId(),
|
||||
role: 'user',
|
||||
content: `发布到菜单:${data.menu_name}`,
|
||||
timestamp: new Date(),
|
||||
};
|
||||
messages.value.push(userMsg);
|
||||
|
||||
waitingForInput.value = false;
|
||||
waitingConfig.value = null;
|
||||
|
||||
resumeExecution(JSON.stringify(data));
|
||||
};
|
||||
const handleDashboardPublishClose = createDesignCloseHandler(
|
||||
showDashboardPublishPanel,
|
||||
currentDashboardPublish,
|
||||
);
|
||||
|
||||
const handleSystemSummaryConfirm = createDesignConfirmHandler(
|
||||
showSystemSummaryPanel,
|
||||
currentSystemSummary,
|
||||
@@ -1017,66 +873,6 @@ onUnmounted(() => {
|
||||
class="ml-3 h-full min-h-[400px] flex-1 rounded-lg"
|
||||
/>
|
||||
|
||||
<!-- 设计编辑面板 -->
|
||||
<DesignEditorPanel
|
||||
v-if="showDesignPanel"
|
||||
:visible="showDesignPanel"
|
||||
:design="currentDesign as any"
|
||||
@update:visible="showDesignPanel = $event"
|
||||
@confirm="handleDesignConfirm"
|
||||
@close="handleDesignClose"
|
||||
/>
|
||||
|
||||
<!-- 应用设计面板 -->
|
||||
<AppDesignPanel
|
||||
v-if="showAppDesignPanel"
|
||||
:visible="showAppDesignPanel"
|
||||
:design="currentAppDesign as any"
|
||||
@update:visible="showAppDesignPanel = $event"
|
||||
@confirm="handleAppDesignConfirm"
|
||||
@close="handleAppDesignClose"
|
||||
/>
|
||||
|
||||
<!-- 应用设置面板 -->
|
||||
<AppSettingsPanel
|
||||
v-if="showAppSettingsPanel"
|
||||
:visible="showAppSettingsPanel"
|
||||
:settings="currentAppSettings as any"
|
||||
@update:visible="showAppSettingsPanel = $event"
|
||||
@confirm="handleAppSettingsConfirm"
|
||||
@close="handleAppSettingsClose"
|
||||
/>
|
||||
|
||||
<!-- 仪表盘基础信息面板 -->
|
||||
<DashboardBasicInfoConfirmPanel
|
||||
v-if="showDashboardBasicInfoPanel"
|
||||
:visible="showDashboardBasicInfoPanel"
|
||||
:basic-info="currentDashboardBasicInfo as any"
|
||||
@update:visible="showDashboardBasicInfoPanel = $event"
|
||||
@confirm="handleDashboardBasicInfoConfirm"
|
||||
@close="handleDashboardBasicInfoClose"
|
||||
/>
|
||||
|
||||
<!-- 仪表盘设计面板 -->
|
||||
<DashboardDesignConfirmPanel
|
||||
v-if="showDashboardDesignPanel"
|
||||
:visible="showDashboardDesignPanel"
|
||||
:design="currentDashboardDesign as any"
|
||||
@update:visible="showDashboardDesignPanel = $event"
|
||||
@confirm="handleDashboardDesignConfirm"
|
||||
@close="handleDashboardDesignClose"
|
||||
/>
|
||||
|
||||
<!-- 仪表盘发布面板 -->
|
||||
<DashboardPublishConfirmPanel
|
||||
v-if="showDashboardPublishPanel"
|
||||
:visible="showDashboardPublishPanel"
|
||||
:publish-data="currentDashboardPublish as any"
|
||||
@update:visible="showDashboardPublishPanel = $event"
|
||||
@confirm="handleDashboardPublishConfirm"
|
||||
@close="handleDashboardPublishClose"
|
||||
/>
|
||||
|
||||
<!-- 系统总结面板 -->
|
||||
<SystemSummaryConfirmPanel
|
||||
v-if="showSystemSummaryPanel"
|
||||
@@ -1090,60 +886,6 @@ onUnmounted(() => {
|
||||
|
||||
<!-- 侧边栏布局时的设计面板(保持原有行为) -->
|
||||
<template v-if="layout === 'sidebar'">
|
||||
<DesignEditorPanel
|
||||
v-if="showDesignPanel"
|
||||
:visible="showDesignPanel"
|
||||
:design="currentDesign as any"
|
||||
@update:visible="showDesignPanel = $event"
|
||||
@confirm="handleDesignConfirm"
|
||||
@close="handleDesignClose"
|
||||
/>
|
||||
|
||||
<AppDesignPanel
|
||||
v-if="showAppDesignPanel"
|
||||
:visible="showAppDesignPanel"
|
||||
:design="currentAppDesign as any"
|
||||
@update:visible="showAppDesignPanel = $event"
|
||||
@confirm="handleAppDesignConfirm"
|
||||
@close="handleAppDesignClose"
|
||||
/>
|
||||
|
||||
<AppSettingsPanel
|
||||
v-if="showAppSettingsPanel"
|
||||
:visible="showAppSettingsPanel"
|
||||
:settings="currentAppSettings as any"
|
||||
@update:visible="showAppSettingsPanel = $event"
|
||||
@confirm="handleAppSettingsConfirm"
|
||||
@close="handleAppSettingsClose"
|
||||
/>
|
||||
|
||||
<DashboardBasicInfoConfirmPanel
|
||||
v-if="showDashboardBasicInfoPanel"
|
||||
:visible="showDashboardBasicInfoPanel"
|
||||
:basic-info="currentDashboardBasicInfo as any"
|
||||
@update:visible="showDashboardBasicInfoPanel = $event"
|
||||
@confirm="handleDashboardBasicInfoConfirm"
|
||||
@close="handleDashboardBasicInfoClose"
|
||||
/>
|
||||
|
||||
<DashboardDesignConfirmPanel
|
||||
v-if="showDashboardDesignPanel"
|
||||
:visible="showDashboardDesignPanel"
|
||||
:design="currentDashboardDesign as any"
|
||||
@update:visible="showDashboardDesignPanel = $event"
|
||||
@confirm="handleDashboardDesignConfirm"
|
||||
@close="handleDashboardDesignClose"
|
||||
/>
|
||||
|
||||
<DashboardPublishConfirmPanel
|
||||
v-if="showDashboardPublishPanel"
|
||||
:visible="showDashboardPublishPanel"
|
||||
:publish-data="currentDashboardPublish as any"
|
||||
@update:visible="showDashboardPublishPanel = $event"
|
||||
@confirm="handleDashboardPublishConfirm"
|
||||
@close="handleDashboardPublishClose"
|
||||
/>
|
||||
|
||||
<SystemSummaryConfirmPanel
|
||||
v-if="showSystemSummaryPanel"
|
||||
:visible="showSystemSummaryPanel"
|
||||
|
||||
@@ -28,7 +28,7 @@ interface EventHandlerConfig {
|
||||
running: Ref<boolean>;
|
||||
conversationId: Ref<null | string>;
|
||||
// 设计预览回调
|
||||
onDesignPreview?: (data: DesignPreviewData) => void;
|
||||
onDesignPreview?: (data: DesignPreviewData) => string | void;
|
||||
}
|
||||
|
||||
/** 生成消息 ID */
|
||||
@@ -104,10 +104,12 @@ export function useEventHandler(config: EventHandlerConfig) {
|
||||
};
|
||||
|
||||
// 调用设计预览回调
|
||||
onDesignPreview?.(previewData);
|
||||
const customWaitingContent = onDesignPreview?.(previewData);
|
||||
|
||||
// 显示提示消息
|
||||
const waitingContent = `**${configData.title}**\n\n${configData.message || '请在右侧面板中确认或编辑设计'}`;
|
||||
const waitingContent =
|
||||
customWaitingContent ||
|
||||
`**${configData.title}**\n\n${configData.message || '请在右侧面板中确认或编辑设计'}`;
|
||||
const initialMsg = messages.value.find((m) => m.id === msgId);
|
||||
if (initialMsg && !initialMsg.content?.trim()) {
|
||||
updateAssistantMessage(msgId, {
|
||||
|
||||
@@ -39,79 +39,22 @@ const widgetComponents: Record<
|
||||
string,
|
||||
ReturnType<typeof defineAsyncComponent>
|
||||
> = {
|
||||
'stat-card': defineAsyncComponent(() => import('./widgets/StatCard.vue')),
|
||||
'progress-card': defineAsyncComponent(
|
||||
() => import('./widgets/ProgressCard.vue'),
|
||||
),
|
||||
'chart-line': defineAsyncComponent(() => import('./widgets/ChartLine.vue')),
|
||||
'chart-bar': defineAsyncComponent(() => import('./widgets/ChartBar.vue')),
|
||||
'chart-pie': defineAsyncComponent(() => import('./widgets/ChartPie.vue')),
|
||||
'chart-gauge': defineAsyncComponent(() => import('./widgets/ChartGauge.vue')),
|
||||
'chart-area': defineAsyncComponent(() => import('./widgets/ChartArea.vue')),
|
||||
'chart-radar': defineAsyncComponent(() => import('./widgets/ChartRadar.vue')),
|
||||
'chart-funnel': defineAsyncComponent(
|
||||
() => import('./widgets/ChartFunnel.vue'),
|
||||
),
|
||||
'chart-scatter': defineAsyncComponent(
|
||||
() => import('./widgets/ChartScatter.vue'),
|
||||
),
|
||||
'chart-ring': defineAsyncComponent(() => import('./widgets/ChartRing.vue')),
|
||||
'chart-heatmap': defineAsyncComponent(
|
||||
() => import('./widgets/ChartHeatmap.vue'),
|
||||
),
|
||||
'chart-kline': defineAsyncComponent(() => import('./widgets/ChartKline.vue')),
|
||||
'chart-sankey': defineAsyncComponent(
|
||||
() => import('./widgets/ChartSankey.vue'),
|
||||
),
|
||||
'todo-list': defineAsyncComponent(() => import('./widgets/TodoList.vue')),
|
||||
'notice-list': defineAsyncComponent(() => import('./widgets/NoticeList.vue')),
|
||||
'ranking-list': defineAsyncComponent(
|
||||
() => import('./widgets/RankingList.vue'),
|
||||
),
|
||||
'announcement-list': defineAsyncComponent(
|
||||
() => import('./widgets/AnnouncementList.vue'),
|
||||
),
|
||||
'approval-center': defineAsyncComponent(
|
||||
() => import('./widgets/ApprovalCenter.vue'),
|
||||
),
|
||||
'quick-links': defineAsyncComponent(() => import('./widgets/QuickLinks.vue')),
|
||||
'welcome-card': defineAsyncComponent(
|
||||
() => import('./widgets/WelcomeCard.vue'),
|
||||
),
|
||||
calendar: defineAsyncComponent(() => import('./widgets/CalendarWidget.vue')),
|
||||
countdown: defineAsyncComponent(
|
||||
() => import('./widgets/CountdownWidget.vue'),
|
||||
),
|
||||
clock: defineAsyncComponent(() => import('./widgets/ClockWidget.vue')),
|
||||
weather: defineAsyncComponent(() => import('./widgets/WeatherWidget.vue')),
|
||||
'image-carousel': defineAsyncComponent(
|
||||
() => import('./widgets/ImageCarousel.vue'),
|
||||
),
|
||||
'data-table': defineAsyncComponent(() => import('./widgets/DataTable.vue')),
|
||||
'form-render': defineAsyncComponent(
|
||||
() => import('./widgets/FormRenderWidget.vue'),
|
||||
),
|
||||
iframe: defineAsyncComponent(() => import('./widgets/IframeWidget.vue')),
|
||||
'video-player': defineAsyncComponent(
|
||||
() => import('./widgets/VideoPlayer.vue'),
|
||||
),
|
||||
image: defineAsyncComponent(() => import('./widgets/ImageWidget.vue')),
|
||||
'approval-center': defineAsyncComponent(
|
||||
() => import('./widgets/ApprovalCenter.vue'),
|
||||
),
|
||||
'my-apps': defineAsyncComponent(() => import('./widgets/MyApps.vue')),
|
||||
'server-monitor': defineAsyncComponent(
|
||||
() => import('./widgets/ServerMonitor.vue'),
|
||||
),
|
||||
'filter-input': defineAsyncComponent(
|
||||
() => import('./widgets/FilterInput.vue'),
|
||||
),
|
||||
'filter-select': defineAsyncComponent(
|
||||
() => import('./widgets/FilterSelect.vue'),
|
||||
),
|
||||
'filter-date': defineAsyncComponent(
|
||||
() => import('./widgets/FilterDate.vue'),
|
||||
),
|
||||
'filter-date-range': defineAsyncComponent(
|
||||
() => import('./widgets/FilterDateRange.vue'),
|
||||
),
|
||||
};
|
||||
|
||||
const store = useDashboardDesignStore();
|
||||
|
||||
@@ -15,6 +15,15 @@ const props = defineProps<{
|
||||
widget: DashboardWidget;
|
||||
}>();
|
||||
|
||||
type StaticAppItem = {
|
||||
code?: string;
|
||||
icon?: string;
|
||||
id: string;
|
||||
name?: string;
|
||||
path?: string;
|
||||
title?: string;
|
||||
};
|
||||
|
||||
// 应用列表
|
||||
const appList = ref<ApplicationListItem[]>([]);
|
||||
const loading = ref(false);
|
||||
@@ -22,11 +31,22 @@ const loading = ref(false);
|
||||
// 最大显示数量
|
||||
const maxCount = computed(() => props.widget.props.maxCount || 8);
|
||||
|
||||
const configuredApps = computed<StaticAppItem[]>(() => {
|
||||
const apps = props.widget.props.apps;
|
||||
return Array.isArray(apps) ? apps.filter(Boolean) : [];
|
||||
});
|
||||
|
||||
// 显示的应用列表
|
||||
const displayApps = computed(() => appList.value.slice(0, maxCount.value));
|
||||
const displayApps = computed(() => {
|
||||
const source =
|
||||
configuredApps.value.length > 0 ? configuredApps.value : appList.value;
|
||||
return source.slice(0, maxCount.value);
|
||||
});
|
||||
|
||||
// 加载已发布的应用列表
|
||||
const loadApps = async () => {
|
||||
if (configuredApps.value.length > 0) return;
|
||||
|
||||
loading.value = true;
|
||||
try {
|
||||
const res = await getApplicationListApi({
|
||||
@@ -43,8 +63,18 @@ const loadApps = async () => {
|
||||
};
|
||||
|
||||
// 点击应用
|
||||
const handleClick = (app: ApplicationListItem) => {
|
||||
window.open(`${window.location.origin}/app/${app.code}`, '_blank');
|
||||
const handleClick = (app: ApplicationListItem | StaticAppItem) => {
|
||||
const path = 'path' in app ? app.path : '';
|
||||
const target =
|
||||
path ||
|
||||
('code' in app && app.code ? `/app/${app.code}` : '');
|
||||
|
||||
if (!target) return;
|
||||
if (/^https?:\/\//.test(target)) {
|
||||
window.open(target, '_blank');
|
||||
return;
|
||||
}
|
||||
window.open(`${window.location.origin}${target}`, '_blank');
|
||||
};
|
||||
|
||||
// 点击更多
|
||||
@@ -52,6 +82,11 @@ const handleMore = () => {
|
||||
window.open(`${window.location.origin}/application`, '_blank');
|
||||
};
|
||||
|
||||
const getAppName = (app: ApplicationListItem | StaticAppItem) => {
|
||||
if ('title' in app && app.title) return app.title;
|
||||
return app.name || app.code || '';
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
loadApps();
|
||||
});
|
||||
@@ -96,7 +131,9 @@ onMounted(() => {
|
||||
/>
|
||||
<AppWindow v-else class="h-6 w-6 text-white" />
|
||||
</div>
|
||||
<span class="text-muted-foreground w-full truncate text-center text-xs">{{ app.name }}</span>
|
||||
<span class="text-muted-foreground w-full truncate text-center text-xs">{{
|
||||
getAppName(app)
|
||||
}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<ElEmpty
|
||||
|
||||
@@ -33,11 +33,6 @@ const components: Record<string, any> = {
|
||||
template: defineAsyncComponent(() => import('../panels/TemplatePanel.vue')),
|
||||
parallel: defineAsyncComponent(() => import('../panels/ParallelPanel.vue')),
|
||||
merge: defineAsyncComponent(() => import('../panels/MergePanel.vue')),
|
||||
db_insert: defineAsyncComponent(() => import('../panels/DbInsertPanel.vue')),
|
||||
db_update: defineAsyncComponent(() => import('../panels/DbUpdatePanel.vue')),
|
||||
db_query: defineAsyncComponent(() => import('../panels/DbQueryPanel.vue')),
|
||||
db_delete: defineAsyncComponent(() => import('../panels/DbDeletePanel.vue')),
|
||||
db_sql: defineAsyncComponent(() => import('../panels/DbSqlPanel.vue')),
|
||||
// 对话流节点
|
||||
question: defineAsyncComponent(() => import('../panels/QuestionPanel.vue')),
|
||||
choice: defineAsyncComponent(() => import('../panels/ChoicePanel.vue')),
|
||||
@@ -45,88 +40,14 @@ const components: Record<string, any> = {
|
||||
confirm: defineAsyncComponent(() => import('../panels/ConfirmPanel.vue')),
|
||||
// 意图识别节点
|
||||
intent: defineAsyncComponent(() => import('../panels/IntentPanel.vue')),
|
||||
// Snowflake Cortex 节点
|
||||
snowflake_cortex_llm: defineAsyncComponent(
|
||||
() => import('../panels/SnowflakeCortexLLMPanel.vue'),
|
||||
),
|
||||
snowflake_cortex_analyst: defineAsyncComponent(
|
||||
() => import('../panels/SnowflakeCortexAnalystPanel.vue'),
|
||||
),
|
||||
// 循环节点
|
||||
loop: defineAsyncComponent(() => import('../panels/LoopPanel.vue')),
|
||||
// 表单节点
|
||||
form_basic_info: defineAsyncComponent(
|
||||
() => import('../panels/FormBasicInfoPanel.vue'),
|
||||
),
|
||||
form_database_design: defineAsyncComponent(
|
||||
() => import('../panels/FormDatabaseDesignPanel.vue'),
|
||||
),
|
||||
form_database_create: defineAsyncComponent(
|
||||
() => import('../panels/FormDatabaseCreatePanel.vue'),
|
||||
),
|
||||
form_ui_design: defineAsyncComponent(
|
||||
() => import('../panels/FormUIDesignPanel.vue'),
|
||||
),
|
||||
form_list_design: defineAsyncComponent(
|
||||
() => import('../panels/FormListDesignPanel.vue'),
|
||||
),
|
||||
form_create: defineAsyncComponent(
|
||||
() => import('../panels/FormCreatePanel.vue'),
|
||||
),
|
||||
form_publish: defineAsyncComponent(
|
||||
() => import('../panels/FormPublishPanel.vue'),
|
||||
),
|
||||
// 应用节点
|
||||
app_create: defineAsyncComponent(
|
||||
() => import('../panels/AppCreatePanel.vue'),
|
||||
),
|
||||
app_design: defineAsyncComponent(
|
||||
() => import('../panels/AppDesignPanel.vue'),
|
||||
),
|
||||
app_settings: defineAsyncComponent(
|
||||
() => import('../panels/AppSettingsPanel.vue'),
|
||||
),
|
||||
app_update: defineAsyncComponent(
|
||||
() => import('../panels/AppUpdatePanel.vue'),
|
||||
),
|
||||
// 仪表盘节点
|
||||
dashboard_basic_info: defineAsyncComponent(
|
||||
() => import('../panels/DashboardBasicInfoPanel.vue'),
|
||||
),
|
||||
dashboard_design: defineAsyncComponent(
|
||||
() => import('../panels/DashboardDesignPanel.vue'),
|
||||
),
|
||||
dashboard_create: defineAsyncComponent(
|
||||
() => import('../panels/DashboardCreatePanel.vue'),
|
||||
),
|
||||
dashboard_publish: defineAsyncComponent(
|
||||
() => import('../panels/DashboardPublishPanel.vue'),
|
||||
),
|
||||
// 系统总结节点
|
||||
system_summary: defineAsyncComponent(
|
||||
() => import('../panels/SystemSummaryPanel.vue'),
|
||||
),
|
||||
// 子流程节点
|
||||
subflow: defineAsyncComponent(() => import('../panels/SubflowPanel.vue')),
|
||||
// 表单数据节点
|
||||
form_data_create: defineAsyncComponent(
|
||||
() => import('../panels/FormDataPanel.vue'),
|
||||
),
|
||||
form_data_read: defineAsyncComponent(
|
||||
() => import('../panels/FormDataPanel.vue'),
|
||||
),
|
||||
form_data_update: defineAsyncComponent(
|
||||
() => import('../panels/FormDataPanel.vue'),
|
||||
),
|
||||
form_data_delete: defineAsyncComponent(
|
||||
() => import('../panels/FormDataPanel.vue'),
|
||||
),
|
||||
form_data_list: defineAsyncComponent(
|
||||
() => import('../panels/FormDataPanel.vue'),
|
||||
),
|
||||
form_schema_to_llm: defineAsyncComponent(
|
||||
() => import('../panels/FormDataPanel.vue'),
|
||||
),
|
||||
// Text-to-SQL 节点
|
||||
text_to_sql: defineAsyncComponent(
|
||||
() => import('../panels/TextToSqlPanel.vue'),
|
||||
|
||||
@@ -23,36 +23,22 @@ import {
|
||||
Clock,
|
||||
Code,
|
||||
Combine,
|
||||
CornerDownLeft,
|
||||
Database,
|
||||
DatabaseBackup,
|
||||
DatabaseZap,
|
||||
FilePlus,
|
||||
FileText,
|
||||
Fullscreen,
|
||||
GitBranch,
|
||||
GitFork,
|
||||
Globe,
|
||||
HelpCircle,
|
||||
LayoutDashboard,
|
||||
LayoutTemplate,
|
||||
ListChecks,
|
||||
Map,
|
||||
MessageSquareMore,
|
||||
MessageSquareText,
|
||||
Minus,
|
||||
Play,
|
||||
Plus,
|
||||
Redo2,
|
||||
RefreshCw,
|
||||
Save,
|
||||
Search,
|
||||
Send,
|
||||
Settings,
|
||||
Snowflake,
|
||||
Square,
|
||||
TableProperties,
|
||||
Trash2,
|
||||
Undo2,
|
||||
Upload,
|
||||
Workflow,
|
||||
@@ -84,32 +70,11 @@ import ContextMenu from './components/ContextMenu.vue';
|
||||
import Panel from './components/Panel.vue';
|
||||
import VersionHistoryPanel from './components/VersionHistoryPanel.vue';
|
||||
import AddButtonEdge from './edges/AddButtonEdge.vue';
|
||||
import AppCreateNode from './nodes/AppCreateNode.vue';
|
||||
import AppDesignNode from './nodes/AppDesignNode.vue';
|
||||
import AppSettingsNode from './nodes/AppSettingsNode.vue';
|
||||
import AppUpdateNode from './nodes/AppUpdateNode.vue';
|
||||
import ChoiceNode from './nodes/ChoiceNode.vue';
|
||||
import CodeNode from './nodes/CodeNode.vue';
|
||||
import ConditionNode from './nodes/ConditionNode.vue';
|
||||
import ConfirmNode from './nodes/ConfirmNode.vue';
|
||||
import DashboardBasicInfoNode from './nodes/DashboardBasicInfoNode.vue';
|
||||
import DashboardCreateNode from './nodes/DashboardCreateNode.vue';
|
||||
import DashboardDesignNode from './nodes/DashboardDesignNode.vue';
|
||||
import DashboardPublishNode from './nodes/DashboardPublishNode.vue';
|
||||
import DbDeleteNode from './nodes/DbDeleteNode.vue';
|
||||
import DbInsertNode from './nodes/DbInsertNode.vue';
|
||||
import DbQueryNode from './nodes/DbQueryNode.vue';
|
||||
import DbSqlNode from './nodes/DbSqlNode.vue';
|
||||
import DbUpdateNode from './nodes/DbUpdateNode.vue';
|
||||
import EndNode from './nodes/EndNode.vue';
|
||||
import FormBasicInfoNode from './nodes/FormBasicInfoNode.vue';
|
||||
import FormCreateNode from './nodes/FormCreateNode.vue';
|
||||
import FormDatabaseCreateNode from './nodes/FormDatabaseCreateNode.vue';
|
||||
import FormDatabaseDesignNode from './nodes/FormDatabaseDesignNode.vue';
|
||||
import FormDataNode from './nodes/FormDataNode.vue';
|
||||
import FormListDesignNode from './nodes/FormListDesignNode.vue';
|
||||
import FormPublishNode from './nodes/FormPublishNode.vue';
|
||||
import FormUIDesignNode from './nodes/FormUIDesignNode.vue';
|
||||
import HttpNode from './nodes/HttpNode.vue';
|
||||
import IntentNode from './nodes/IntentNode.vue';
|
||||
import KnowledgeRetrievalNode from './nodes/KnowledgeRetrievalNode.vue';
|
||||
@@ -119,13 +84,12 @@ import MergeNode from './nodes/MergeNode.vue';
|
||||
import MessageNode from './nodes/MessageNode.vue';
|
||||
import ParallelNode from './nodes/ParallelNode.vue';
|
||||
import QuestionNode from './nodes/QuestionNode.vue';
|
||||
import SnowflakeCortexAnalystNode from './nodes/SnowflakeCortexAnalystNode.vue';
|
||||
import SnowflakeCortexLLMNode from './nodes/SnowflakeCortexLLMNode.vue';
|
||||
import StartNode from './nodes/StartNode.vue';
|
||||
import SubflowNode from './nodes/SubflowNode.vue';
|
||||
import SystemSummaryNode from './nodes/SystemSummaryNode.vue';
|
||||
import TemplateNode from './nodes/TemplateNode.vue';
|
||||
import TextToSqlNode from './nodes/TextToSqlNode.vue';
|
||||
import UnsupportedNode from './nodes/UnsupportedNode.vue';
|
||||
|
||||
import '@vue-flow/minimap/dist/style.css';
|
||||
import '@vue-flow/core/dist/style.css';
|
||||
@@ -156,6 +120,41 @@ const contextMenu = ref({
|
||||
node: null as any,
|
||||
});
|
||||
|
||||
const legacyNodeTypes = [
|
||||
'db_insert',
|
||||
'db_update',
|
||||
'db_query',
|
||||
'db_delete',
|
||||
'db_sql',
|
||||
'snowflake_cortex_llm',
|
||||
'snowflake_cortex_analyst',
|
||||
'form_basic_info',
|
||||
'form_database_design',
|
||||
'form_database_create',
|
||||
'form_ui_design',
|
||||
'form_list_design',
|
||||
'form_create',
|
||||
'form_publish',
|
||||
'app_create',
|
||||
'app_design',
|
||||
'app_settings',
|
||||
'app_update',
|
||||
'dashboard_basic_info',
|
||||
'dashboard_design',
|
||||
'dashboard_create',
|
||||
'dashboard_publish',
|
||||
'form_data_create',
|
||||
'form_data_read',
|
||||
'form_data_update',
|
||||
'form_data_delete',
|
||||
'form_data_list',
|
||||
'form_schema_to_llm',
|
||||
] as const;
|
||||
|
||||
const legacyNodeTypeMap = Object.fromEntries(
|
||||
legacyNodeTypes.map((type) => [type, markRaw(UnsupportedNode)]),
|
||||
);
|
||||
|
||||
// 注册自定义节点
|
||||
const nodeTypes = {
|
||||
start: markRaw(StartNode),
|
||||
@@ -167,11 +166,6 @@ const nodeTypes = {
|
||||
template: markRaw(TemplateNode),
|
||||
parallel: markRaw(ParallelNode),
|
||||
merge: markRaw(MergeNode),
|
||||
db_insert: markRaw(DbInsertNode),
|
||||
db_update: markRaw(DbUpdateNode),
|
||||
db_query: markRaw(DbQueryNode),
|
||||
db_delete: markRaw(DbDeleteNode),
|
||||
db_sql: markRaw(DbSqlNode),
|
||||
// 对话流节点
|
||||
question: markRaw(QuestionNode),
|
||||
choice: markRaw(ChoiceNode),
|
||||
@@ -179,44 +173,17 @@ const nodeTypes = {
|
||||
confirm: markRaw(ConfirmNode),
|
||||
// 意图识别节点
|
||||
intent: markRaw(IntentNode),
|
||||
// Snowflake Cortex 节点
|
||||
snowflake_cortex_llm: markRaw(SnowflakeCortexLLMNode),
|
||||
snowflake_cortex_analyst: markRaw(SnowflakeCortexAnalystNode),
|
||||
// 循环节点
|
||||
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),
|
||||
// 表单数据节点
|
||||
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 节点
|
||||
text_to_sql: markRaw(TextToSqlNode),
|
||||
// 知识库节点
|
||||
knowledge_retrieval: markRaw(KnowledgeRetrievalNode),
|
||||
...legacyNodeTypeMap,
|
||||
};
|
||||
|
||||
// 注册自定义边类型
|
||||
@@ -359,7 +326,19 @@ const getNodeLabel = (type: string): string => {
|
||||
return $t(`ai-platform.workflow.editor.nodeLabels.${type}`) || type;
|
||||
};
|
||||
|
||||
const nodeCategories = computed(() => [
|
||||
type NodePaletteItem = {
|
||||
color: string;
|
||||
icon: string;
|
||||
label: string;
|
||||
type: string;
|
||||
};
|
||||
|
||||
type NodePaletteCategory = {
|
||||
name: string;
|
||||
nodes: NodePaletteItem[];
|
||||
};
|
||||
|
||||
const nodeCategories = computed<NodePaletteCategory[]>(() => [
|
||||
{
|
||||
name: $t('ai-platform.workflow.editor.categories.basic'),
|
||||
nodes: [
|
||||
@@ -388,93 +367,11 @@ const nodeCategories = computed(() => [
|
||||
icon: 'LayoutTemplate',
|
||||
color: 'blue',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: $t('ai-platform.workflow.editor.categories.formDesign'),
|
||||
nodes: [
|
||||
{
|
||||
type: 'form_basic_info',
|
||||
label: getNodeLabel('form_basic_info'),
|
||||
icon: 'FileText',
|
||||
color: 'purple',
|
||||
},
|
||||
{
|
||||
type: 'form_database_design',
|
||||
label: getNodeLabel('form_database_design'),
|
||||
icon: 'Database',
|
||||
color: 'purple',
|
||||
},
|
||||
{
|
||||
type: 'form_database_create',
|
||||
label: getNodeLabel('form_database_create'),
|
||||
icon: 'DatabaseZap',
|
||||
color: 'purple',
|
||||
},
|
||||
{
|
||||
type: 'form_ui_design',
|
||||
label: getNodeLabel('form_ui_design'),
|
||||
icon: 'LayoutTemplate',
|
||||
color: 'purple',
|
||||
},
|
||||
{
|
||||
type: 'form_list_design',
|
||||
label: getNodeLabel('form_list_design'),
|
||||
icon: 'TableProperties',
|
||||
color: 'purple',
|
||||
},
|
||||
{
|
||||
type: 'form_create',
|
||||
label: getNodeLabel('form_create'),
|
||||
icon: 'FilePlus',
|
||||
color: 'purple',
|
||||
},
|
||||
{
|
||||
type: 'form_publish',
|
||||
label: getNodeLabel('form_publish'),
|
||||
icon: 'Send',
|
||||
color: 'purple',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: $t('ai-platform.workflow.editor.categories.formData'),
|
||||
nodes: [
|
||||
{
|
||||
type: 'form_data_create',
|
||||
label: getNodeLabel('form_data_create'),
|
||||
icon: 'FilePlus',
|
||||
color: 'green',
|
||||
},
|
||||
{
|
||||
type: 'form_data_read',
|
||||
label: getNodeLabel('form_data_read'),
|
||||
icon: 'FileText',
|
||||
color: 'blue',
|
||||
},
|
||||
{
|
||||
type: 'form_data_update',
|
||||
label: getNodeLabel('form_data_update'),
|
||||
icon: 'FileText',
|
||||
color: 'orange',
|
||||
},
|
||||
{
|
||||
type: 'form_data_delete',
|
||||
label: getNodeLabel('form_data_delete'),
|
||||
icon: 'Trash2',
|
||||
color: 'red',
|
||||
},
|
||||
{
|
||||
type: 'form_data_list',
|
||||
label: getNodeLabel('form_data_list'),
|
||||
icon: 'Search',
|
||||
color: 'blue',
|
||||
},
|
||||
{
|
||||
type: 'form_schema_to_llm',
|
||||
label: getNodeLabel('form_schema_to_llm'),
|
||||
icon: 'Code',
|
||||
color: 'purple',
|
||||
type: 'system_summary',
|
||||
label: getNodeLabel('system_summary'),
|
||||
icon: 'ClipboardCheck',
|
||||
color: 'cyan',
|
||||
},
|
||||
],
|
||||
},
|
||||
@@ -507,47 +404,6 @@ const nodeCategories = computed(() => [
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: $t('ai-platform.workflow.editor.categories.database'),
|
||||
nodes: [
|
||||
{
|
||||
type: 'text_to_sql',
|
||||
label: getNodeLabel('text_to_sql'),
|
||||
icon: 'DatabaseZap',
|
||||
color: 'cyan',
|
||||
},
|
||||
{
|
||||
type: 'db_insert',
|
||||
label: getNodeLabel('db_insert'),
|
||||
icon: 'DatabaseZap',
|
||||
color: 'green',
|
||||
},
|
||||
{
|
||||
type: 'db_update',
|
||||
label: getNodeLabel('db_update'),
|
||||
icon: 'DatabaseBackup',
|
||||
color: 'green',
|
||||
},
|
||||
{
|
||||
type: 'db_query',
|
||||
label: getNodeLabel('db_query'),
|
||||
icon: 'Search',
|
||||
color: 'green',
|
||||
},
|
||||
{
|
||||
type: 'db_delete',
|
||||
label: getNodeLabel('db_delete'),
|
||||
icon: 'Trash2',
|
||||
color: 'green',
|
||||
},
|
||||
{
|
||||
type: 'db_sql',
|
||||
label: getNodeLabel('db_sql'),
|
||||
icon: 'Database',
|
||||
color: 'green',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: $t('ai-platform.workflow.editor.categories.flowControl'),
|
||||
nodes: [
|
||||
@@ -596,84 +452,12 @@ const nodeCategories = computed(() => [
|
||||
],
|
||||
},
|
||||
{
|
||||
name: 'Snowflake',
|
||||
name: $t('ai-platform.workflow.editor.categories.database'),
|
||||
nodes: [
|
||||
{
|
||||
type: 'snowflake_cortex_llm',
|
||||
label: getNodeLabel('snowflake_cortex_llm'),
|
||||
icon: 'Snowflake',
|
||||
color: 'cyan',
|
||||
},
|
||||
{
|
||||
type: 'snowflake_cortex_analyst',
|
||||
label: getNodeLabel('snowflake_cortex_analyst'),
|
||||
icon: 'MessageSquareMore',
|
||||
color: 'cyan',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: $t('ai-platform.workflow.editor.categories.appManage'),
|
||||
nodes: [
|
||||
{
|
||||
type: 'app_create',
|
||||
label: getNodeLabel('app_create'),
|
||||
icon: 'LayoutTemplate',
|
||||
color: 'indigo',
|
||||
},
|
||||
{
|
||||
type: 'app_design',
|
||||
label: getNodeLabel('app_design'),
|
||||
icon: 'LayoutDashboard',
|
||||
color: 'indigo',
|
||||
},
|
||||
{
|
||||
type: 'app_settings',
|
||||
label: getNodeLabel('app_settings'),
|
||||
icon: 'Settings',
|
||||
color: 'indigo',
|
||||
},
|
||||
{
|
||||
type: 'app_update',
|
||||
label: getNodeLabel('app_update'),
|
||||
icon: 'Save',
|
||||
color: 'indigo',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: $t('ai-platform.workflow.editor.categories.dashboard'),
|
||||
icon: 'LayoutDashboard',
|
||||
color: 'cyan',
|
||||
nodes: [
|
||||
{
|
||||
type: 'dashboard_basic_info',
|
||||
label: getNodeLabel('dashboard_basic_info'),
|
||||
icon: 'FileText',
|
||||
color: 'cyan',
|
||||
},
|
||||
{
|
||||
type: 'dashboard_design',
|
||||
label: getNodeLabel('dashboard_design'),
|
||||
icon: 'LayoutDashboard',
|
||||
color: 'cyan',
|
||||
},
|
||||
{
|
||||
type: 'dashboard_create',
|
||||
label: getNodeLabel('dashboard_create'),
|
||||
icon: 'FilePlus',
|
||||
color: 'cyan',
|
||||
},
|
||||
{
|
||||
type: 'dashboard_publish',
|
||||
label: getNodeLabel('dashboard_publish'),
|
||||
icon: 'Upload',
|
||||
color: 'cyan',
|
||||
},
|
||||
{
|
||||
type: 'system_summary',
|
||||
label: getNodeLabel('system_summary'),
|
||||
icon: 'ClipboardCheck',
|
||||
type: 'text_to_sql',
|
||||
label: getNodeLabel('text_to_sql'),
|
||||
icon: 'DatabaseZap',
|
||||
color: 'cyan',
|
||||
},
|
||||
],
|
||||
@@ -703,10 +487,6 @@ const iconComponents: Record<string, any> = {
|
||||
Combine,
|
||||
Square,
|
||||
DatabaseZap,
|
||||
DatabaseBackup,
|
||||
Search,
|
||||
Trash2,
|
||||
Database,
|
||||
// 对话交互节点图标
|
||||
MessageSquareText,
|
||||
HelpCircle,
|
||||
@@ -714,23 +494,8 @@ const iconComponents: Record<string, any> = {
|
||||
CircleHelp,
|
||||
// 意图识别节点图标
|
||||
Brain,
|
||||
// Snowflake Cortex 节点图标
|
||||
Snowflake,
|
||||
MessageSquareMore,
|
||||
// 循环节点图标
|
||||
RefreshCw,
|
||||
CornerDownLeft,
|
||||
// 表单节点图标
|
||||
FileText,
|
||||
TableProperties,
|
||||
Send,
|
||||
// 应用节点图标
|
||||
LayoutDashboard,
|
||||
Settings,
|
||||
Save,
|
||||
// 仪表盘节点图标
|
||||
FilePlus,
|
||||
Upload,
|
||||
// 系统总结节点图标
|
||||
ClipboardCheck,
|
||||
// 子流程节点图标
|
||||
@@ -741,21 +506,7 @@ const iconComponents: Record<string, any> = {
|
||||
|
||||
// 过滤后的节点分类
|
||||
const filteredNodeCategories = computed(() => {
|
||||
// 首先根据工作流类型过滤分类
|
||||
let categories = nodeCategories.value;
|
||||
|
||||
// 如果是通用类型,排除表单设计、应用管理、仪表盘分组
|
||||
if (workflow.value?.workflow_type === 'general') {
|
||||
const excludeNames = new Set([
|
||||
$t('ai-platform.workflow.editor.categories.appManage'),
|
||||
$t('ai-platform.workflow.editor.categories.dashboard'),
|
||||
$t('ai-platform.workflow.editor.categories.formDesign'),
|
||||
]);
|
||||
categories = nodeCategories.value.filter(
|
||||
(category: { name: string; nodes: any[] }) =>
|
||||
!excludeNames.has(category.name),
|
||||
);
|
||||
}
|
||||
const categories = nodeCategories.value;
|
||||
|
||||
// 再根据搜索关键词过滤
|
||||
if (!nodeSearchQuery.value.trim()) {
|
||||
@@ -765,19 +516,16 @@ const filteredNodeCategories = computed(() => {
|
||||
const query = nodeSearchQuery.value.toLowerCase();
|
||||
return categories
|
||||
.map(
|
||||
(category: {
|
||||
name: string;
|
||||
nodes: { color: string; icon: string; label: string; type: string }[];
|
||||
}) => ({
|
||||
(category: NodePaletteCategory) => ({
|
||||
...category,
|
||||
nodes: category.nodes.filter(
|
||||
(node: { label: string; type: string }) =>
|
||||
(node: NodePaletteItem) =>
|
||||
node.label.toLowerCase().includes(query) ||
|
||||
node.type.toLowerCase().includes(query),
|
||||
),
|
||||
}),
|
||||
)
|
||||
.filter((category: { nodes: any[] }) => category.nodes.length > 0);
|
||||
.filter((category: NodePaletteCategory) => category.nodes.length > 0);
|
||||
});
|
||||
|
||||
// 监听视口变化(包括滚轮缩放)
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue';
|
||||
|
||||
import { CircleHelp } from '@vben/icons';
|
||||
|
||||
import BaseNode from './BaseNode.vue';
|
||||
|
||||
const props = defineProps(['selected', 'data', 'id', 'type']);
|
||||
|
||||
const nodeType = computed(() => props.type || props.data?.type || 'legacy');
|
||||
const nodeLabel = computed(
|
||||
() => props.data?.label || props.data?.name || nodeType.value,
|
||||
);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<BaseNode
|
||||
:selected="selected"
|
||||
:execution-status="data?.executionStatus"
|
||||
:execution-result="data?.executionResult"
|
||||
:label="nodeLabel"
|
||||
:inputs="[{ id: 'target' }]"
|
||||
:outputs="[{ id: 'source' }]"
|
||||
:node-id="id"
|
||||
:node-type="nodeType"
|
||||
>
|
||||
<template #icon><CircleHelp class="size-5" /></template>
|
||||
<template #desc>历史节点</template>
|
||||
|
||||
<div class="space-y-2">
|
||||
<div
|
||||
class="border-border bg-muted text-muted-foreground rounded border px-2 py-1 text-xs"
|
||||
>
|
||||
该节点属于已精简模块,仅保留在旧流程中展示。
|
||||
</div>
|
||||
<div class="text-muted-foreground flex justify-between text-[11px]">
|
||||
<span>Type</span>
|
||||
<span class="font-mono">{{ nodeType }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</BaseNode>
|
||||
</template>
|
||||
@@ -5,11 +5,6 @@ import ChoiceNode from '../editor/nodes/ChoiceNode.vue';
|
||||
import CodeNode from '../editor/nodes/CodeNode.vue';
|
||||
import ConditionNode from '../editor/nodes/ConditionNode.vue';
|
||||
import ConfirmNode from '../editor/nodes/ConfirmNode.vue';
|
||||
import DbDeleteNode from '../editor/nodes/DbDeleteNode.vue';
|
||||
import DbInsertNode from '../editor/nodes/DbInsertNode.vue';
|
||||
import DbQueryNode from '../editor/nodes/DbQueryNode.vue';
|
||||
import DbSqlNode from '../editor/nodes/DbSqlNode.vue';
|
||||
import DbUpdateNode from '../editor/nodes/DbUpdateNode.vue';
|
||||
import EndNode from '../editor/nodes/EndNode.vue';
|
||||
import HttpNode from '../editor/nodes/HttpNode.vue';
|
||||
import IntentNode from '../editor/nodes/IntentNode.vue';
|
||||
@@ -20,13 +15,47 @@ import MergeNode from '../editor/nodes/MergeNode.vue';
|
||||
import MessageNode from '../editor/nodes/MessageNode.vue';
|
||||
import ParallelNode from '../editor/nodes/ParallelNode.vue';
|
||||
import QuestionNode from '../editor/nodes/QuestionNode.vue';
|
||||
import SnowflakeCortexAnalystNode from '../editor/nodes/SnowflakeCortexAnalystNode.vue';
|
||||
import SnowflakeCortexLLMNode from '../editor/nodes/SnowflakeCortexLLMNode.vue';
|
||||
import StartNode from '../editor/nodes/StartNode.vue';
|
||||
import SubflowNode from '../editor/nodes/SubflowNode.vue';
|
||||
import SystemSummaryNode from '../editor/nodes/SystemSummaryNode.vue';
|
||||
import TemplateNode from '../editor/nodes/TemplateNode.vue';
|
||||
import TextToSqlNode from '../editor/nodes/TextToSqlNode.vue';
|
||||
import UnsupportedNode from '../editor/nodes/UnsupportedNode.vue';
|
||||
|
||||
const legacyNodeTypes = [
|
||||
'db_insert',
|
||||
'db_update',
|
||||
'db_query',
|
||||
'db_delete',
|
||||
'db_sql',
|
||||
'snowflake_cortex_llm',
|
||||
'snowflake_cortex_analyst',
|
||||
'form_basic_info',
|
||||
'form_database_design',
|
||||
'form_database_create',
|
||||
'form_ui_design',
|
||||
'form_list_design',
|
||||
'form_create',
|
||||
'form_publish',
|
||||
'app_create',
|
||||
'app_design',
|
||||
'app_settings',
|
||||
'app_update',
|
||||
'dashboard_basic_info',
|
||||
'dashboard_design',
|
||||
'dashboard_create',
|
||||
'dashboard_publish',
|
||||
'form_data_create',
|
||||
'form_data_read',
|
||||
'form_data_update',
|
||||
'form_data_delete',
|
||||
'form_data_list',
|
||||
'form_schema_to_llm',
|
||||
] as const;
|
||||
|
||||
const legacyNodeTypeMap = Object.fromEntries(
|
||||
legacyNodeTypes.map((type) => [type, markRaw(UnsupportedNode)]),
|
||||
);
|
||||
|
||||
export const workflowNodeTypes = {
|
||||
start: markRaw(StartNode),
|
||||
@@ -38,23 +67,17 @@ export const workflowNodeTypes = {
|
||||
template: markRaw(TemplateNode),
|
||||
parallel: markRaw(ParallelNode),
|
||||
merge: markRaw(MergeNode),
|
||||
db_insert: markRaw(DbInsertNode),
|
||||
db_update: markRaw(DbUpdateNode),
|
||||
db_query: markRaw(DbQueryNode),
|
||||
db_delete: markRaw(DbDeleteNode),
|
||||
db_sql: markRaw(DbSqlNode),
|
||||
question: markRaw(QuestionNode),
|
||||
choice: markRaw(ChoiceNode),
|
||||
message: markRaw(MessageNode),
|
||||
confirm: markRaw(ConfirmNode),
|
||||
intent: markRaw(IntentNode),
|
||||
snowflake_cortex_llm: markRaw(SnowflakeCortexLLMNode),
|
||||
snowflake_cortex_analyst: markRaw(SnowflakeCortexAnalystNode),
|
||||
loop: markRaw(LoopNode),
|
||||
system_summary: markRaw(SystemSummaryNode),
|
||||
subflow: markRaw(SubflowNode),
|
||||
text_to_sql: markRaw(TextToSqlNode),
|
||||
knowledge_retrieval: markRaw(KnowledgeRetrievalNode),
|
||||
...legacyNodeTypeMap,
|
||||
};
|
||||
|
||||
export const workflowEdgeTypes = {
|
||||
|
||||
@@ -17,7 +17,7 @@ const defaultPreferences: Preferences = {
|
||||
contentPaddingTop: 0,
|
||||
defaultAvatar:
|
||||
'https://unpkg.com/@vbenjs/static-source@0.1.7/source/avatar-v1.webp',
|
||||
defaultHomePath: '/ai-platform/agent',
|
||||
defaultHomePath: '/page-render/main_home',
|
||||
dynamicTitle: true,
|
||||
enableCheckUpdates: true,
|
||||
enablePreferences: true,
|
||||
|
||||
Reference in New Issue
Block a user