| | |
| | | import React, { useState, useRef, useEffect } from 'react'; |
| | | import { Col, Form, Input, Row, Checkbox, Slider, Select, Drawer, Space, Button, InputNumber, Card } from 'antd'; |
| | | import { FormattedMessage, useIntl, useModel } from '@umijs/max'; |
| | | import { |
| | | BranchesOutlined, |
| | | BorderOuterOutlined, |
| | | } from '@ant-design/icons'; |
| | | import { createStyles } from 'antd-style'; |
| | | import * as Utils from '../utils' |
| | | import Http from '@/utils/http'; |
| | |
| | | const intl = useIntl(); |
| | | const { styles } = useStyles(); |
| | | const [activeTabKey, setActiveTabKey] = useState('map'); |
| | | |
| | | const [mapForm] = Form.useForm(); |
| | | const [configForm] = Form.useForm(); |
| | | |
| | |
| | | }; |
| | | |
| | | const handleOk = () => { |
| | | mapForm.submit(); |
| | | if (activeTabKey === 'map') { |
| | | mapForm.submit(); |
| | | } |
| | | if (activeTabKey === 'config') { |
| | | configForm.submit(); |
| | | } |
| | | } |
| | | |
| | | return ( |
| | |
| | | <Button onClick={handleCancel}> |
| | | <FormattedMessage id='common.cancel' defaultMessage='取消' /> |
| | | </Button> |
| | | <Button onClick={handleOk} type="primary"> |
| | | <Button hidden={activeTabKey === 'map' || activeTabKey === 'config'} onClick={handleOk} type="primary"> |
| | | <FormattedMessage id='common.submit' defaultMessage='保存' /> |
| | | </Button> |
| | | </Space> |
| | |
| | | <Card |
| | | hoverable |
| | | bordered={false} |
| | | type='inner' |
| | | tabList={[ |
| | | { |
| | | key: 'map', |
| | | tab: '地图参数', |
| | | tab: intl.formatMessage({ id: 'map.settings.map.param', defaultMessage: '地图参数' }), |
| | | icon: <BorderOuterOutlined /> |
| | | |
| | | }, |
| | | { |
| | | key: 'config', |
| | | tab: '配置参数', |
| | | tab: intl.formatMessage({ id: 'map.settings.config.param', defaultMessage: '系统参数' }), |
| | | icon: <BranchesOutlined /> |
| | | }, |
| | | ]} |
| | | activeTabKey={activeTabKey} |