import React from 'react';
import { Modal, Form, Input, Button } from 'antd';

const PwdForm = (props) => {
    return (
        <Modal
            title={'变更密码'}
            width={640}
            visible={props.pwdVisible}
            bodyStyle={{ padding: '32px 40px 48px' }}
            footer={null}
            onCancel={() => {
                props.onCancel();
            }}
            destroyOnClose
        >
            <Form
                layout="vertical"
                preserve={false}
                labelCol={{
                    span: 4,
                }}
                onFinish={props.onFinish}
            >
                <Form.Item name="id" hidden={true}>
                    <Input />
                </Form.Item>
                <Form.Item name="account" label="用户账户" rules={[{ required: true}]}>
                    <Input placeholder="请输入用户账户" />
                </Form.Item>
                <Form.Item name="oPwd" label="旧密码" rules={[{ required: true}]}>
                    <Input.Password placeholder="请输入旧密码" />
                </Form.Item>
                <Form.Item name="nPwd" label="新密码" rules={[{ required: true}]}>
                    <Input.Password placeholder="请输入新密码" />
                </Form.Item>
                <Form.Item>
                    <Button type="primary" htmlType="submit" style={{float:'right'}}>
                        保存
                    </Button>
                </Form.Item>
            </Form>
        </Modal>
    );
};

export default PwdForm;
