diff --git a/frontend/src/pages/Deploy/Deployment/List/index.tsx b/frontend/src/pages/Deploy/Deployment/List/index.tsx index 9395f98b..17d842d3 100644 --- a/frontend/src/pages/Deploy/Deployment/List/index.tsx +++ b/frontend/src/pages/Deploy/Deployment/List/index.tsx @@ -10,6 +10,7 @@ import DeploymentConfigModal from './components/DeploymentConfigModal'; import {ProTable} from '@ant-design/pro-components'; import type {ProColumns, ActionType} from '@ant-design/pro-components'; import {Editor} from '@/components/Editor'; +import type {WorkflowDefinition} from '@/pages/Workflow/Definition/types'; const {Option} = Select; @@ -79,22 +80,28 @@ const DeploymentConfigList: React.FC = () => { const [templates, setTemplates] = useState([]); const [codePreviewVisible, setCodePreviewVisible] = useState(false); const [previewCode, setPreviewCode] = useState<{ code: string; language?: string }>({code: ''}); + const [loading, setLoading] = useState(true); const actionRef = React.useRef(); // 获取环境列表 const fetchEnvironments = async () => { try { + setLoading(true); const data = await getEnvironmentList(); setEnvironments(data); - if (data.length > 0 && !selectedEnvId) { + if (data.length > 0) { setSelectedEnvId(data[0].id); + // 手动触发表格刷新 + actionRef.current?.reload(); } } catch (error) { message.error('获取环境列表失败'); + } finally { + setLoading(false); } }; - // 获取配置模板 + // 获取��置模板 const fetchTemplates = async () => { try { const data = await getDeployConfigTemplates(); @@ -104,6 +111,7 @@ const DeploymentConfigList: React.FC = () => { } }; + // 初始化数据 useEffect(() => { fetchEnvironments(); fetchTemplates(); @@ -240,13 +248,28 @@ const DeploymentConfigList: React.FC = () => { width: 150, copyable: true, ellipsis: true, + fixed: 'left', }, { title: '应用名称', dataIndex: ['application', 'appName'], width: 150, ellipsis: true, - fixed: 'left', + }, + { + title: '工作流', + dataIndex: ['publishedWorkflowDefinition', 'name'], + width: 200, + ellipsis: true, + render: (_, record) => { + const workflow = record.publishedWorkflowDefinition; + if (!workflow) return '-'; + return ( + + {workflow.name} + + ); + } }, { title: '构建配置', @@ -309,6 +332,7 @@ const DeploymentConfigList: React.FC = () => { onChange={handleEnvChange} style={{width: 200}} placeholder="请选择环境" + loading={loading} > {environments.map((env) => (