diff --git a/frontend/src/pages/Deploy/Deployment/List/components/DeploymentConfigModal.tsx b/frontend/src/pages/Deploy/Deployment/List/components/DeploymentConfigModal.tsx index b00aaab0..7535f4d0 100644 --- a/frontend/src/pages/Deploy/Deployment/List/components/DeploymentConfigModal.tsx +++ b/frontend/src/pages/Deploy/Deployment/List/components/DeploymentConfigModal.tsx @@ -126,27 +126,7 @@ const DeploymentConfigModal: React.FC = ({ }) // 创建表单实例 - const form = createForm({ - validateFirst: true, - initialValues: {}, - effects() { - onFormInit((form) => { - form.setFieldState('*', (state) => { - if (state.decorator[0] === 'FormItem') { - state.decoratorProps = { - labelWidth: 100, - labelAlign: 'right', - layout: 'horizontal', - labelCol: 8, - wrapperCol: 16, - colon: true, - ...state.decoratorProps - } - } - }) - }) - } - }) + const form = createForm() const schema: ISchema = { type: 'object', @@ -162,7 +142,8 @@ const DeploymentConfigModal: React.FC = ({ properties: { externalSystemId: { type: 'string', - title: '三方系统', + title: 'Jenkins系统', + required: true, 'x-decorator': 'FormItem', 'x-decorator-props': { labelCol: 24, @@ -184,6 +165,7 @@ const DeploymentConfigModal: React.FC = ({ viewId: { type: 'string', title: 'Jenkins视图', + required: true, 'x-decorator': 'FormItem', 'x-decorator-props': { labelCol: 24, @@ -209,12 +191,12 @@ const DeploymentConfigModal: React.FC = ({ }, run: '{{$deps[0] ? useAsyncDataSource(`/api/v1/jenkins-view/list?externalSystemId=${$deps[0]}`, { mapping: { label: "viewName", value: "id" } })($self) : ($self.dataSource = [])}}' } - }, - "description": "{{$self.dataSource && $self.value ? ($self.dataSource.find(item => item.value === $self.value)?.extra?.description) : undefined}}" + } }, jobId: { type: 'string', title: 'Jenkins作业', + required: true, 'x-decorator': 'FormItem', 'x-decorator-props': { labelCol: 24, @@ -240,8 +222,7 @@ const DeploymentConfigModal: React.FC = ({ }, run: '{{($deps[0] && $deps[1]) ? useAsyncDataSource(`/api/v1/jenkins-job/list?externalSystemId=${$deps[0]}&viewId=${$deps[1]}`, { mapping: { label: "jobName", value: "id" } })($self) : ($self.dataSource = [])}}' } - }, - "description": "{{$self.dataSource && $self.value ? ($self.dataSource.find(item => item.value === $self.value)?.extra?.description) : undefined}}" + } }, } }, @@ -255,8 +236,16 @@ const DeploymentConfigModal: React.FC = ({ properties: { envs: { type: 'array', - 'x-component': 'ArrayTable', + title: '环境变量', 'x-decorator': 'FormItem', + 'x-decorator-props': { + labelCol: 24, + wrapperCol: 24, + layout: 'vertical', + colon: false, + labelAlign: 'left' + }, + 'x-component': 'ArrayTable', 'x-component-props': { pagination: { pageSize: 10 }, scroll: { x: '100%' }, @@ -295,7 +284,7 @@ const DeploymentConfigModal: React.FC = ({ } } }, - action: { + value: { type: 'void', 'x-component': 'ArrayTable.Column', 'x-component-props': { title: '值', width: '40%' },