import { formLayout } from '@/utils/formLayout';
import { Col, Row, Space } from 'antd';
import { ProForm, ProFormText, ProFormTextArea } from '@ant-design/pro-components';

export default function WxMaCodeUploadConfig() {
	return <ProForm
		{...formLayout()}
		onFinish={async (values) => {
			console.log('submit', values);
		}}
		submitter={{
			render: (_, dom) => {
				return (
					<Row>
						<Col span={14} offset={4}>
							<Space>{dom}</Space>
						</Col>
					</Row>
				);
			},
		}}
	>
		<ProFormText
			name="appId"
			label="小程序APPID"
			placeholder={'请输入小程序APPID'}
			required={true}
			rules={[
				{
					required: true,
					message: '小程序APPID为必填项',
				},
			]}
		/>
		<ProFormText
			name="currentVersion"
			label="当前版本号"
			placeholder={'请输入当前版本号'}
			required={true}
			rules={[
				{
					required: true,
					message: '当前版本号为必填项',
				},
			]}
		/>
		<ProFormTextArea
			name="updateDesc"
			label="更新描述"
			placeholder={'请输入更新描述'}
			required={true}
			rules={[
				{
					required: true,
					message: '更新描述为必填项',
				},
			]}
		/>
		<ProFormText
			name="uploadIpAddr"
			label="上传IP白名单"
			placeholder={'暂无上传IP白名单'}
			disabled={true}
		/>
		<ProFormText
			name="pagePath"
			label="页面路径"
			placeholder={'请输入页面路径'}
			required={true}
			rules={[
				{
					required: true,
					message: '页面路径为必填项',
				},
			]}
		/>
		<ProFormText
			name="orderCenterPath"
			label="小程序订单中心path"
			placeholder={'请输入小程序订单中心path'}
			required={true}
			rules={[
				{
					required: true,
					message: '小程序订单中心path为必填项',
				},
			]}
		/>
		<ProFormTextArea
			name="codeUploadSecret"
			label="小程序代码上传密钥"
			placeholder={'请输入小程序代码上传密钥'}
			required={true}
			rules={[
				{
					required: true,
					message: '小程序代码上传密钥为必填项',
				},
			]}
		/>
	</ProForm>
}
