Refine workflow list for agent orchestration

This commit is contained in:
2026-06-11 07:36:17 +08:00
parent 2b80f7c3df
commit b3ebefeb02
@@ -36,7 +36,6 @@ import {
ElOption, ElOption,
ElPagination, ElPagination,
ElSelect, ElSelect,
ElSwitch,
ElTag, ElTag,
ElTooltip, ElTooltip,
} from 'element-plus'; } from 'element-plus';
@@ -62,14 +61,20 @@ const appContextStore = useAppContextStore();
// 工作流类型选项 // 工作流类型选项
const workflowTypeOptions = computed(() => [ const workflowTypeOptions = computed(() => [
{ label: $t('ai-platform.workflow.type.general'), value: 'general' }, { label: '智能体协作', value: 'general' },
{ label: $t('ai-platform.workflow.type.application'), value: 'application' }, { label: '自动化编排', value: 'automation' },
{ label: $t('ai-platform.workflow.type.form'), value: 'form' }, { label: 'LLM 数据流', value: 'data_process' },
{ label: $t('ai-platform.workflow.type.report'), value: 'report' },
{ label: $t('ai-platform.workflow.type.dataProcess'), value: 'data_process' },
{ label: $t('ai-platform.workflow.type.automation'), value: 'automation' },
]); ]);
const workflowTypeLabelMap: Record<string, string> = {
application: '智能体协作',
automation: '自动化编排',
data_process: 'LLM 数据流',
form: '智能体协作',
general: '智能体协作',
report: '智能体协作',
};
// 弹窗表单数据 // 弹窗表单数据
const createForm = reactive({ const createForm = reactive({
id: '', id: '',
@@ -81,7 +86,6 @@ const createForm = reactive({
}); });
// 是否在主应用下(只有主应用才显示“子应用可见”开关) // 是否在主应用下(只有主应用才显示“子应用可见”开关)
const isMainApp = !appContextStore.currentApp?.id;
const formRef = ref(); const formRef = ref();
const isEditMode = ref(false); const isEditMode = ref(false);
const formLoading = ref(false); const formLoading = ref(false);
@@ -344,7 +348,7 @@ const getWorkflowTypeText = (type: string) => {
const item = workflowTypeOptions.value.find( const item = workflowTypeOptions.value.find(
(o: { label: string; value: string }) => o.value === type, (o: { label: string; value: string }) => o.value === type,
); );
return item?.label || type; return item?.label || workflowTypeLabelMap[type] || '智能体协作';
}; };
const getStatusType = (status: string) => { const getStatusType = (status: string) => {
@@ -469,11 +473,7 @@ onMounted(() => {
{{ $t('ai-platform.workflow.publish') }} {{ $t('ai-platform.workflow.publish') }}
</ElDropdownItem> </ElDropdownItem>
<ElDropdownItem <ElDropdownItem
v-if=" v-if="item.status === 'published'"
item.status === 'published' &&
(item.workflow_type === 'data_process' ||
item.workflow_type === 'automation')
"
command="run" command="run"
> >
<Play class="mr-2 h-4 w-4" /> <Play class="mr-2 h-4 w-4" />
@@ -518,10 +518,8 @@ onMounted(() => {
<!-- 应用名称 + 创建时间 --> <!-- 应用名称 + 创建时间 -->
<div class="flex items-center justify-between"> <div class="flex items-center justify-between">
<div class="text-muted-foreground text-xs"> <div class="text-muted-foreground text-xs">
<span v-if="item.application_name">{{ v{{ item.published_version || item.version || '-' }} ·
item.application_name {{ item.run_count || 0 }} 次运行
}}</span>
<span v-else>{{ $t('ai-platform.workflow.mainApp') }}</span>
</div> </div>
<span class="text-muted-foreground text-xs"> <span class="text-muted-foreground text-xs">
{{ item.sys_create_datetime }} {{ item.sys_create_datetime }}
@@ -625,12 +623,6 @@ onMounted(() => {
:rows="3" :rows="3"
/> />
</ElFormItem> </ElFormItem>
<ElFormItem
v-if="isMainApp"
:label="$t('ai-platform.workflow.form.globalVisible')"
>
<ElSwitch v-model="createForm.is_global" />
</ElFormItem>
</ElForm> </ElForm>
</ZqDialog> </ZqDialog>