From ee14a4653aae5874fb7e5a6b73795063db25ef80 Mon Sep 17 00:00:00 2001 From: asp_ly Date: Fri, 17 Jan 2025 21:52:19 +0800 Subject: [PATCH] 1 --- .../List/components/DeploymentConfigModal.tsx | 61 +++++++++---------- 1 file changed, 30 insertions(+), 31 deletions(-) diff --git a/frontend/src/pages/Deploy/Deployment/List/components/DeploymentConfigModal.tsx b/frontend/src/pages/Deploy/Deployment/List/components/DeploymentConfigModal.tsx index 393a7097..d145648c 100644 --- a/frontend/src/pages/Deploy/Deployment/List/components/DeploymentConfigModal.tsx +++ b/frontend/src/pages/Deploy/Deployment/List/components/DeploymentConfigModal.tsx @@ -1,5 +1,5 @@ import React, { useState, useEffect } from 'react'; -import {Modal, Button} from 'antd'; +import {Modal, Button, message} from 'antd'; import { FullscreenOutlined, FullscreenExitOutlined } from '@ant-design/icons'; import type {DeploymentConfig} from '../types'; import './styles.less'; @@ -270,7 +270,7 @@ const DeploymentConfigModal: React.FC = ({ items: { type: 'object', properties: { - column1: { + key: { type: 'void', 'x-component': 'ArrayTable.Column', 'x-component-props': { title: '键', width: '40%' }, @@ -296,7 +296,7 @@ const DeploymentConfigModal: React.FC = ({ } } }, - column2: { + action: { type: 'void', 'x-component': 'ArrayTable.Column', 'x-component-props': { title: '值', width: '40%' }, @@ -391,40 +391,39 @@ const DeploymentConfigModal: React.FC = ({ try { const values = await form.submit() console.log('表单提交的值:', values) - console.log('环境变量数组:', values.envs) - onSuccess?.(values as DeploymentConfig) + onSuccess?.() + form.reset() } catch (e) { console.error('表单提交出错:', e) + message.error('提交失败,请检查表单数据是否正确') } } return ( - <> - - 取消 - , - - ]} - bodyStyle={{ - padding: '24px', - maxHeight: '80vh', - overflow: 'auto' - }} - > - - - - - + + 取消 + , + + ]} + bodyStyle={{ + padding: '24px', + maxHeight: '80vh', + overflow: 'auto' + }} + > + + + + ); };