| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- import { UnityAction } from '@/utils/utils';
- import { CloseOutlined, LeftOutlined } from '@ant-design/icons';
- import { history } from '@umijs/max';
- import { ConfigProvider } from 'antd';
- import locale from 'antd/es/locale/zh_CN';
- import styles from './index.less';
- export default (props) => {
- const {
- children,
- style,
- closeable = true,
- returnable = false,
- tabs = false,
- } = props;
- const handleClose = () => {
- UnityAction.sendMsg('closePage');
- };
- const handleReturn = () => {
- history.back();
- };
- return (
- <ConfigProvider locale={locale}>
- <div className={styles.page} style={style}>
- {returnable && (
- <LeftOutlined
- onClick={handleReturn}
- className={styles.return}
- style={{ top: tabs ? 42.5 : '' }}
- />
- )}
- {closeable && (
- <CloseOutlined
- onClick={handleClose}
- className={styles.close}
- style={{ top: tabs ? 42.5 : '' }}
- />
- )}
- {children}
- </div>
- </ConfigProvider>
- );
- };
|