1
This commit is contained in:
parent
6fbd00106c
commit
ee14a4653a
@ -1,5 +1,5 @@
|
|||||||
import React, { useState, useEffect } from 'react';
|
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 { FullscreenOutlined, FullscreenExitOutlined } from '@ant-design/icons';
|
||||||
import type {DeploymentConfig} from '../types';
|
import type {DeploymentConfig} from '../types';
|
||||||
import './styles.less';
|
import './styles.less';
|
||||||
@ -270,7 +270,7 @@ const DeploymentConfigModal: React.FC<DeploymentConfigModalProps> = ({
|
|||||||
items: {
|
items: {
|
||||||
type: 'object',
|
type: 'object',
|
||||||
properties: {
|
properties: {
|
||||||
column1: {
|
key: {
|
||||||
type: 'void',
|
type: 'void',
|
||||||
'x-component': 'ArrayTable.Column',
|
'x-component': 'ArrayTable.Column',
|
||||||
'x-component-props': { title: '键', width: '40%' },
|
'x-component-props': { title: '键', width: '40%' },
|
||||||
@ -296,7 +296,7 @@ const DeploymentConfigModal: React.FC<DeploymentConfigModalProps> = ({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
column2: {
|
action: {
|
||||||
type: 'void',
|
type: 'void',
|
||||||
'x-component': 'ArrayTable.Column',
|
'x-component': 'ArrayTable.Column',
|
||||||
'x-component-props': { title: '值', width: '40%' },
|
'x-component-props': { title: '值', width: '40%' },
|
||||||
@ -391,15 +391,15 @@ const DeploymentConfigModal: React.FC<DeploymentConfigModalProps> = ({
|
|||||||
try {
|
try {
|
||||||
const values = await form.submit()
|
const values = await form.submit()
|
||||||
console.log('表单提交的值:', values)
|
console.log('表单提交的值:', values)
|
||||||
console.log('环境变量数组:', values.envs)
|
onSuccess?.()
|
||||||
onSuccess?.(values as DeploymentConfig)
|
form.reset()
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error('表单提交出错:', e)
|
console.error('表单提交出错:', e)
|
||||||
|
message.error('提交失败,请检查表单数据是否正确')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
|
||||||
<Modal
|
<Modal
|
||||||
title="部署配置"
|
title="部署配置"
|
||||||
open={open}
|
open={open}
|
||||||
@ -410,7 +410,7 @@ const DeploymentConfigModal: React.FC<DeploymentConfigModalProps> = ({
|
|||||||
<Button key="cancel" onClick={onCancel}>
|
<Button key="cancel" onClick={onCancel}>
|
||||||
取消
|
取消
|
||||||
</Button>,
|
</Button>,
|
||||||
<Button key="submit" type="primary" onClick={() => form.submit()}>
|
<Button key="submit" type="primary" onClick={handleSubmit}>
|
||||||
确定
|
确定
|
||||||
</Button>
|
</Button>
|
||||||
]}
|
]}
|
||||||
@ -424,7 +424,6 @@ const DeploymentConfigModal: React.FC<DeploymentConfigModalProps> = ({
|
|||||||
<SchemaField schema={schema}/>
|
<SchemaField schema={schema}/>
|
||||||
</FormProvider>
|
</FormProvider>
|
||||||
</Modal>
|
</Modal>
|
||||||
</>
|
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user