|
@@ -4,6 +4,8 @@ import HttpService from '../../../services/httpService'
|
|
|
import { respuestas } from '../../../utilities'
|
|
|
import { SaveOutlined } from '@ant-design/icons'
|
|
|
import { useNavigate } from 'react-router-dom'
|
|
|
+import DefaultLayout from '../../../components/layouts/DefaultLayout'
|
|
|
+import { commonRules } from '../../../constants/rules'
|
|
|
|
|
|
|
|
|
export const Formulario = ({ model = null, id, alTerminar, endPoint, url, idModelo, media }) => {
|
|
@@ -47,55 +49,49 @@ export const Formulario = ({ model = null, id, alTerminar, endPoint, url, idMode
|
|
|
}
|
|
|
}, [form, model])
|
|
|
|
|
|
- return (<Form
|
|
|
- layout="vertical"
|
|
|
- form={form}
|
|
|
- onFinish={handleFinish}
|
|
|
- >
|
|
|
- <Row gutter={[10, 0]}>
|
|
|
- <Col xs={24} lg={12}>
|
|
|
- <Form.Item
|
|
|
- label="Clave"
|
|
|
- name="clave"
|
|
|
- rules={[{
|
|
|
- required: true,
|
|
|
- message: 'Por favor ingresa una clave'
|
|
|
- }]}
|
|
|
- >
|
|
|
- <Input/>
|
|
|
- </Form.Item>
|
|
|
- </Col>
|
|
|
- <Col xs={24} lg={12}>
|
|
|
- <Form.Item
|
|
|
- label="Nombre"
|
|
|
- name="nombre"
|
|
|
- rules={[{
|
|
|
- required: true,
|
|
|
- message: 'Por favor ingresa un nombre'
|
|
|
- }]}
|
|
|
- >
|
|
|
- <Input/>
|
|
|
- </Form.Item>
|
|
|
- </Col>
|
|
|
- </Row>
|
|
|
- <br/>
|
|
|
- <Row justify="end">
|
|
|
- <Col xs={24} lg={6}>
|
|
|
- <Form.Item>
|
|
|
- <Button
|
|
|
- type="primary"
|
|
|
- htmlType="submit"
|
|
|
- size="large"
|
|
|
- block
|
|
|
- icon={<SaveOutlined/>}
|
|
|
- loading={guardando}
|
|
|
+ return (
|
|
|
+ <DefaultLayout>
|
|
|
+ <Form
|
|
|
+ layout="vertical"
|
|
|
+ name="basic"
|
|
|
+ form={form}
|
|
|
+ onFinish={handleFinish}
|
|
|
+ onFinishFailed={() => {}}
|
|
|
+ >
|
|
|
+ <Row gutter={[10, 10]}>
|
|
|
+ <Col span={24}>
|
|
|
+ <h2>Información de Nivel</h2>
|
|
|
+ </Col>
|
|
|
+ <Col span={24} md={12}>
|
|
|
+ <Form.Item
|
|
|
+ label="Clave"
|
|
|
+ name="clave"
|
|
|
+ rules={[commonRules.requerido]}
|
|
|
>
|
|
|
- Guardar
|
|
|
- </Button>
|
|
|
- </Form.Item>
|
|
|
- </Col>
|
|
|
- </Row>
|
|
|
- </Form>
|
|
|
- )
|
|
|
+ <Input size="large" />
|
|
|
+ </Form.Item>
|
|
|
+ </Col>
|
|
|
+ <Col span={12}>
|
|
|
+ <Form.Item label="Nombre" name="nombre">
|
|
|
+ <Input/>
|
|
|
+ </Form.Item>
|
|
|
+ </Col>
|
|
|
+ <Col span={24}>
|
|
|
+ <Form.Item>
|
|
|
+ <Button
|
|
|
+ size="large"
|
|
|
+ type="primary"
|
|
|
+ htmlType="submit"
|
|
|
+ loading={guardando}
|
|
|
+ style={{ marginTop: "30px" }}
|
|
|
+ >
|
|
|
+ Guardar
|
|
|
+ </Button>
|
|
|
+ </Form.Item>
|
|
|
+ </Col>
|
|
|
+ </Row>
|
|
|
+ </Form>
|
|
|
+ </DefaultLayout>
|
|
|
+ );
|
|
|
|
|
|
}
|