From cf84034643df8c07e91f84e674ace3e86675cda0 Mon Sep 17 00:00:00 2001 From: asp_ly Date: Fri, 17 Jan 2025 20:54:14 +0800 Subject: [PATCH] 1 --- .../List/components/DeploymentConfigModal.tsx | 106 +++++++++++++++++- 1 file changed, 104 insertions(+), 2 deletions(-) diff --git a/frontend/src/pages/Deploy/Deployment/List/components/DeploymentConfigModal.tsx b/frontend/src/pages/Deploy/Deployment/List/components/DeploymentConfigModal.tsx index c8e16821..dd2841a3 100644 --- a/frontend/src/pages/Deploy/Deployment/List/components/DeploymentConfigModal.tsx +++ b/frontend/src/pages/Deploy/Deployment/List/components/DeploymentConfigModal.tsx @@ -2,7 +2,7 @@ import React from 'react'; import {Modal} from 'antd'; import type {DeploymentConfig} from '../types'; 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 {createSchemaField, FormProvider, ISchema} from '@formily/react' import {action} from '@formily/reactive' @@ -59,7 +59,9 @@ const DeploymentConfigModal: React.FC = ({ components: { Select, FormItem, - FormGrid + FormGrid, + Input, + ArrayTable }, scope: { useAsyncDataSource @@ -185,6 +187,106 @@ const DeploymentConfigModal: React.FC = ({ "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: '添加环境变量' + } + } + } + } + } } } };