umi-tablayout
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
import { Redirect, Route } from 'umi';
|
||||
import { Redirect, Route } from '@umijs/max';
|
||||
|
||||
import React from 'react';
|
||||
import Authorized from './Authorized';
|
||||
|
@ -2,6 +2,7 @@ import React from 'react';
|
||||
import { Spin } from 'antd';
|
||||
import isEqual from 'lodash/isEqual';
|
||||
import { isComponentClass } from './Secured';
|
||||
import { Outlet } from '@umijs/max';
|
||||
// eslint-disable-next-line import/no-cycle
|
||||
|
||||
interface PromiseRenderProps<T, K> {
|
||||
@ -65,7 +66,7 @@ export default class PromiseRender<T, K> extends React.Component<
|
||||
return (props: any) => <Target {...props} />;
|
||||
}
|
||||
if (React.isValidElement(target)) {
|
||||
return (props: any) => React.cloneElement(target, props);
|
||||
return (props: any) => <Outlet context={props} />;
|
||||
}
|
||||
return () => target as React.ReactNode & null;
|
||||
};
|
||||
|
@ -1,4 +1,5 @@
|
||||
import React from 'react';
|
||||
import { Outlet } from '@umijs/max';
|
||||
import CheckPermissions from './CheckPermissions';
|
||||
|
||||
/**
|
||||
@ -24,7 +25,7 @@ const checkIsInstantiation = (target: React.ComponentClass | React.ReactNode) =>
|
||||
return (props: any) => <Target {...props} />;
|
||||
}
|
||||
if (React.isValidElement(target)) {
|
||||
return (props: any) => React.cloneElement(target, props);
|
||||
return (props: any) => <Outlet context={props} />;
|
||||
}
|
||||
return () => target;
|
||||
};
|
||||
|
@ -1,7 +1,7 @@
|
||||
import React, { useEffect, useRef, useState } from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import { Modal, Input, Button, Tabs, message, Form, Upload, Image, Card, Tooltip } from 'antd';
|
||||
import { useIntl } from 'umi';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { getGroupList, getChartList, getChartList01, upDataChartCont, upLoad } from '../service';
|
||||
import '../index.less';
|
||||
import { isRegExp } from 'lodash';
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { Divider, Button, Form, Card, Tabs, Table, Tooltip, Input, Select, Row, Col, message, Modal, Avatar, Tag } from 'antd';
|
||||
import { Link, history } from 'umi';
|
||||
import { Divider, Button, Form, Card, Tabs, Table, Tooltip, Input, Select, Row, Col, message, Modal, Avatar, Tag, } from 'antd';
|
||||
import { Link, history } from '@umijs/max';
|
||||
import './index.less';
|
||||
import styles from './index.less';
|
||||
import { connect } from "dva";
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { LogoutOutlined, SettingOutlined, UserOutlined } from '@ant-design/icons';
|
||||
import { Avatar, Menu, Spin } from 'antd';
|
||||
import React from 'react';
|
||||
import { history, ConnectProps, connect } from 'umi';
|
||||
import { history, ConnectProps, connect } from '@umijs/max';
|
||||
import { ConnectState } from '@/models/connect';
|
||||
import { CurrentUser } from '@/models/user';
|
||||
import HeaderDropdown from '../HeaderDropdown';
|
||||
|
@ -1,5 +1,5 @@
|
||||
import React, { Component } from 'react';
|
||||
import { connect, ConnectProps } from 'umi';
|
||||
import { connect, ConnectProps } from '@umijs/max';
|
||||
import { Tag, message } from 'antd';
|
||||
import groupBy from 'lodash/groupBy';
|
||||
import moment from 'moment';
|
||||
|
@ -2,7 +2,7 @@ import { Avatar, Dropdown, Menu, message, Modal } from 'antd';
|
||||
import { DownOutlined, UserOutlined, UserSwitchOutlined, CarryOutOutlined, HomeOutlined, ImportOutlined } from '@ant-design/icons';
|
||||
import React, { useEffect, useRef } from 'react';
|
||||
import moment from 'moment'
|
||||
import { connect, history } from 'umi';
|
||||
import { connect, history, KeepAliveContext } from '@umijs/max';
|
||||
import { ConnectState } from '@/models/connect';
|
||||
import logo from '@/assets/logo.svg';
|
||||
import './index.less';
|
||||
@ -15,6 +15,7 @@ import shutdownIcon from '@/assets/shutdown.svg';
|
||||
import { logout } from './services';
|
||||
import cookie from 'react-cookies';
|
||||
import divider from '@/assets/divider.png';
|
||||
import useGoHome from '@/utils/useGoHome';
|
||||
|
||||
const theme = JSON.parse(PROJECT_THEME);
|
||||
|
||||
@ -24,6 +25,7 @@ const GlobalHeaderRight: React.FC<{}> = (props) => {
|
||||
const roleData = getSessionRoleData();
|
||||
const [dataMenu, setDataMenu] = React.useState<any>([]);
|
||||
const urlRef = useRef(null);
|
||||
const goHome = useGoHome()
|
||||
const handelRole = (item: any) => {
|
||||
sessionStorage.setItem('roleData', JSON.stringify(item));
|
||||
sessionStorage.setItem('roleAuthority', JSON.stringify([item.roleCode]));
|
||||
@ -132,7 +134,9 @@ const GlobalHeaderRight: React.FC<{}> = (props) => {
|
||||
</Dropdown>
|
||||
</li>
|
||||
<li>
|
||||
<img src={homeIcon} style={{width: 13, cursor: 'pointer'}} alt="dashboard" onClick={() => history.push('/Dashboard')}/>
|
||||
<img src={homeIcon} style={{width: 13, cursor: 'pointer'}} alt="dashboard" onClick={() => {
|
||||
goHome()
|
||||
}} />
|
||||
</li>
|
||||
<li style={{ paddingRight: 16 }}>
|
||||
<img src={shutdownIcon} style={{width: 14, cursor: 'pointer' }} alt="shutdown" onClick={() => toLogout()}/>
|
||||
|
@ -1,4 +1,4 @@
|
||||
@import '~antd/es/style/themes/default.less';
|
||||
|
||||
|
||||
.top-menu {
|
||||
.left-logo {
|
||||
|
@ -1,4 +1,4 @@
|
||||
@import '~antd/es/style/themes/default.less';
|
||||
|
||||
|
||||
.container > * {
|
||||
background-color: @popover-bg;
|
||||
|
@ -1,4 +1,4 @@
|
||||
@import '~antd/es/style/themes/default.less';
|
||||
|
||||
|
||||
.headerSearch {
|
||||
.input {
|
||||
|
@ -1,5 +1,5 @@
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import { history } from 'umi';
|
||||
import { history } from '@umijs/max';
|
||||
import {
|
||||
getLeftMenu,
|
||||
getBtnText,
|
||||
|
@ -1,4 +1,4 @@
|
||||
@import '~antd/es/style/themes/default.less';
|
||||
|
||||
|
||||
.list {
|
||||
max-height: 400px;
|
||||
|
@ -1,4 +1,4 @@
|
||||
@import '~antd/es/style/themes/default.less';
|
||||
|
||||
|
||||
.popover {
|
||||
position: relative;
|
||||
|
@ -3,7 +3,7 @@ import { makeStyles, Theme } from '@material-ui/core/styles';
|
||||
import AppBar from '@material-ui/core/AppBar';
|
||||
import Tabs from '@material-ui/core/Tabs';
|
||||
import { PageHeader, Button, message, Steps, Space, Card, Dropdown, Menu } from 'antd';
|
||||
import { Link, history } from 'umi';
|
||||
import { Link, history } from '@umijs/max';
|
||||
import './index.less';
|
||||
import { getReadInfo, menuList, updateReadStatus } from './service/service';
|
||||
import { getProName, getSessionRoleData, getProTypeCode, getDefId, getPurchaseCanOperate, getReturnURL, getProId, getProMethod } from '@/utils/session';
|
||||
|
@ -1,6 +1,6 @@
|
||||
import React from 'react';
|
||||
import { Button, Modal } from 'antd';
|
||||
import { history } from 'umi';
|
||||
import { history } from '@umijs/max';
|
||||
|
||||
interface RiskModalProps {
|
||||
modalVisible: boolean;
|
||||
|
Reference in New Issue
Block a user