1
This commit is contained in:
parent
c5c353a9a6
commit
cf84034643
@ -2,7 +2,7 @@ import React from 'react';
|
|||||||
import {Modal} from 'antd';
|
import {Modal} from 'antd';
|
||||||
import type {DeploymentConfig} from '../types';
|
import type {DeploymentConfig} from '../types';
|
||||||
import './styles.less';
|
import './styles.less';
|
||||||
import {FormButtonGroup, FormItem, Select, Submit, FormGrid} from '@formily/antd-v5'
|
import {FormButtonGroup, FormItem, Select, Submit, FormGrid, Input, ArrayTable} from '@formily/antd-v5'
|
||||||
import {createForm, Field, FieldDataSource, onFormInit} from '@formily/core'
|
import {createForm, Field, FieldDataSource, onFormInit} from '@formily/core'
|
||||||
import {createSchemaField, FormProvider, ISchema} from '@formily/react'
|
import {createSchemaField, FormProvider, ISchema} from '@formily/react'
|
||||||
import {action} from '@formily/reactive'
|
import {action} from '@formily/reactive'
|
||||||
@ -59,7 +59,9 @@ const DeploymentConfigModal: React.FC<DeploymentConfigModalProps> = ({
|
|||||||
components: {
|
components: {
|
||||||
Select,
|
Select,
|
||||||
FormItem,
|
FormItem,
|
||||||
FormGrid
|
FormGrid,
|
||||||
|
Input,
|
||||||
|
ArrayTable
|
||||||
},
|
},
|
||||||
scope: {
|
scope: {
|
||||||
useAsyncDataSource
|
useAsyncDataSource
|
||||||
@ -185,6 +187,106 @@ const DeploymentConfigModal: React.FC<DeploymentConfigModalProps> = ({
|
|||||||
"description": "{{$self.dataSource && $self.value ? ($self.dataSource.find(item => item.value === $self.value)?.extra?.description) : undefined}}"
|
"description": "{{$self.dataSource && $self.value ? ($self.dataSource.find(item => item.value === $self.value)?.extra?.description) : undefined}}"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
environmentVariables: {
|
||||||
|
type: 'void',
|
||||||
|
'x-component': 'FormGrid',
|
||||||
|
'x-component-props': {
|
||||||
|
maxColumns: 1,
|
||||||
|
minColumns: 1
|
||||||
|
},
|
||||||
|
properties: {
|
||||||
|
envvAR: {
|
||||||
|
type: 'array',
|
||||||
|
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%' }
|
||||||
|
},
|
||||||
|
items: {
|
||||||
|
type: 'object',
|
||||||
|
properties: {
|
||||||
|
column1: {
|
||||||
|
type: 'void',
|
||||||
|
'x-component': 'ArrayTable.Column',
|
||||||
|
'x-component-props': {
|
||||||
|
title: '键',
|
||||||
|
width: '40%'
|
||||||
|
},
|
||||||
|
properties: {
|
||||||
|
key: {
|
||||||
|
type: 'string',
|
||||||
|
'x-decorator': 'FormItem',
|
||||||
|
'x-component': 'Input',
|
||||||
|
'x-component-props': {
|
||||||
|
placeholder: '请输入键'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
column2: {
|
||||||
|
type: 'void',
|
||||||
|
'x-component': 'ArrayTable.Column',
|
||||||
|
'x-component-props': {
|
||||||
|
title: '值',
|
||||||
|
width: '40%'
|
||||||
|
},
|
||||||
|
properties: {
|
||||||
|
value: {
|
||||||
|
type: 'string',
|
||||||
|
'x-decorator': 'FormItem',
|
||||||
|
'x-component': 'Input',
|
||||||
|
'x-component-props': {
|
||||||
|
placeholder: '请输入值'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
column3: {
|
||||||
|
type: 'void',
|
||||||
|
'x-component': 'ArrayTable.Column',
|
||||||
|
'x-component-props': {
|
||||||
|
title: '操作',
|
||||||
|
width: '20%',
|
||||||
|
align: 'center'
|
||||||
|
},
|
||||||
|
properties: {
|
||||||
|
remove: {
|
||||||
|
type: 'void',
|
||||||
|
'x-component': 'ArrayTable.Remove'
|
||||||
|
},
|
||||||
|
moveUp: {
|
||||||
|
type: 'void',
|
||||||
|
'x-component': 'ArrayTable.MoveUp'
|
||||||
|
},
|
||||||
|
moveDown: {
|
||||||
|
type: 'void',
|
||||||
|
'x-component': 'ArrayTable.MoveDown'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
properties: {
|
||||||
|
add: {
|
||||||
|
type: 'void',
|
||||||
|
'x-component': 'ArrayTable.Addition',
|
||||||
|
'x-component-props': {
|
||||||
|
title: '添加环境变量'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user