1
This commit is contained in:
parent
6fbd00106c
commit
ee14a4653a
@ -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<DeploymentConfigModalProps> = ({
|
||||
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<DeploymentConfigModalProps> = ({
|
||||
}
|
||||
}
|
||||
},
|
||||
column2: {
|
||||
action: {
|
||||
type: 'void',
|
||||
'x-component': 'ArrayTable.Column',
|
||||
'x-component-props': { title: '值', width: '40%' },
|
||||
@ -391,15 +391,15 @@ const DeploymentConfigModal: React.FC<DeploymentConfigModalProps> = ({
|
||||
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 (
|
||||
<>
|
||||
<Modal
|
||||
title="部署配置"
|
||||
open={open}
|
||||
@ -410,7 +410,7 @@ const DeploymentConfigModal: React.FC<DeploymentConfigModalProps> = ({
|
||||
<Button key="cancel" onClick={onCancel}>
|
||||
取消
|
||||
</Button>,
|
||||
<Button key="submit" type="primary" onClick={() => form.submit()}>
|
||||
<Button key="submit" type="primary" onClick={handleSubmit}>
|
||||
确定
|
||||
</Button>
|
||||
]}
|
||||
@ -424,7 +424,6 @@ const DeploymentConfigModal: React.FC<DeploymentConfigModalProps> = ({
|
||||
<SchemaField schema={schema}/>
|
||||
</FormProvider>
|
||||
</Modal>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user