| | |
| | | import React, { useState, useRef, useEffect } from 'react'; |
| | | import { |
| | | ProForm, |
| | | ProFormDigit, |
| | | ProFormText, |
| | | ProFormSelect, |
| | | ProFormDateTimePicker |
| | | } from '@ant-design/pro-components'; |
| | | import moment from 'moment'; |
| | | import { Col, Form, Modal, Row, Checkbox, Image, Tree, Drawer, Space, Button, Card, Divider } from 'antd'; |
| | | import { FormattedMessage, useIntl, useModel } from '@umijs/max'; |
| | | import * as PIXI from 'pixi.js'; |
| | | import { createStyles } from 'antd-style'; |
| | | import './index.css' |
| | | import './index.css'; |
| | | import Http from '@/utils/http'; |
| | | |
| | | const useStyles = createStyles(({ token, css }) => { |
| | | |
| | |
| | | const intl = useIntl(); |
| | | const { styles } = useStyles(); |
| | | const { curSprite } = props; |
| | | const [form] = Form.useForm(); |
| | | |
| | | useEffect(() => { |
| | | |
| | | }, []); |
| | | |
| | | useEffect(() => { |
| | | form.resetFields(); |
| | | form.setFieldsValue({ |
| | | ...props.values |
| | | }) |
| | | }, [form, props]) |
| | | |
| | | const handleCancel = () => { |
| | | props.onCancel(); |
| | | }; |
| | | |
| | | const handleOk = () => { |
| | | form.submit(); |
| | | } |
| | | |
| | | const handleFinish = async (values) => { |
| | | props.onSubmit({ ...values }); |
| | | } |
| | | |
| | | return ( |
| | | <> |
| | | <Drawer |
| | | open={props.open} |
| | | onClose={() => { |
| | | props.onCancel(); |
| | | }} |
| | | onClose={handleCancel} |
| | | getContainer={props.refCurr} |
| | | rootStyle={{ position: "absolute" }} |
| | | mask={false} |
| | | width={570} |
| | | extra={ |
| | | <Space> |
| | | <Button onClick={() => props.onCancel()}> |
| | | <Button onClick={handleCancel}> |
| | | <FormattedMessage id='common.cancel' defaultMessage='取消' /> |
| | | </Button> |
| | | <Button onClick={() => { }} type="primary"> |
| | | <Button onClick={handleOk} type="primary"> |
| | | <FormattedMessage id='common.submit' defaultMessage='保存' /> |
| | | </Button> |
| | | </Space> |
| | | } |
| | | > |
| | | <Card> |
| | | |
| | | <ProForm |
| | | form={form} |
| | | submitter={false} |
| | | onFinish={handleFinish} |
| | | layout="horizontal" |
| | | grid={true} |
| | | > |
| | | |
| | | </ProForm> |
| | | {/* |
| | | // position |
| | | // scale |