Commit ad69cebd authored by 邓超's avatar 邓超

fix: 修改路由为按需加载

parent 28a5aebf
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
} }
.ant-layout .ant-layout-content { .ant-layout .ant-layout-content {
margin: 0px !important; margin: 12px;
} }
.ant-pro-page-container { .ant-pro-page-container {
......
...@@ -12,6 +12,11 @@ body, ...@@ -12,6 +12,11 @@ body,
.ant-layout { .ant-layout {
min-height: 100vh; min-height: 100vh;
overflow: auto;
.ant-layout-content {
margin: 12px;
}
} }
canvas { canvas {
...@@ -38,12 +43,15 @@ iframe { ...@@ -38,12 +43,15 @@ iframe {
.ant-table { .ant-table {
width: 100%; width: 100%;
overflow-x: auto; overflow-x: auto;
&-thead > tr,
&-tbody > tr { &-thead>tr,
> th, &-tbody>tr {
> td {
>th,
>td {
white-space: pre; white-space: pre;
> span {
>span {
display: block; display: block;
} }
} }
...@@ -52,19 +60,82 @@ iframe { ...@@ -52,19 +60,82 @@ iframe {
} }
// 兼容IE11 // 兼容IE11
@media screen and(-ms-high-contrast: active), (-ms-high-contrast: none) { @media screen and(-ms-high-contrast: active),
body .ant-design-pro > .ant-layout { (-ms-high-contrast: none) {
body .ant-design-pro>.ant-layout {
min-height: 100vh; min-height: 100vh;
} }
} }
.ant-pro-global-header-layout-side>div:first-child /deep/{
.ant-pro-global-header-layout-side>div:first-child /deep/ {
flex: 0 !important; flex: 0 !important;
} }
iframe{
iframe {
border: none !important; border: none !important;
} }
:global{
.ant-tree-node-content-wrapper .anticon-folder, .ant-tree-icon__customize, .ant-tree-switcher-icon{ :global {
.ant-tree-node-content-wrapper .anticon-folder,
.ant-tree-icon__customize,
.ant-tree-switcher-icon {
color: #1890ff !important; color: #1890ff !important;
} }
} }
:global {
::-webkit-scrollbar {
height: 6px; //x轴滚动条粗细
width: 6px; //y轴滚动条粗细
border-bottom: 2px solid white;
}
//滚动条里面的小方块,能上下左右移动(取决于是垂直滚动条还是水平滚动条)
::-webkit-scrollbar-thumb {
border-radius: 10px;
box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.1);
background: rgba(74, 74, 75, 0.3);
margin-bottom: 10px;
}
//滚动条的轨道(里面装有thumb)滚动槽
::-webkit-scrollbar-track {
box-shadow: 0;
border-radius: 0;
background: white; //滚动槽背景色
border-radius: 10px; //滚动条边框半径设置
}
.ant-table-body {
overflow: auto !important;
border-right: 1px solid rgb(240, 240, 240);
}
.ant-table-cell {
overflow: hidden;
white-space: nowrap;
}
.ant-tree.ant-tree-block-node .ant-tree-list-holder-inner .ant-tree-node-content-wrapper {
line-height: 28px;
width: 0;
}
.ant-tree-drop-indicator {
bottom: 3px;
margin-left: 6px;
}
.ant-tree-draggable-icon {
display: none;
}
.ant-tree-switcher-icon svg {
font-size: 14px;
color: #767777;
}
}
\ No newline at end of file
...@@ -431,6 +431,7 @@ const ManagementDataBase = () => { ...@@ -431,6 +431,7 @@ const ManagementDataBase = () => {
return ( return (
<> <>
<PageContainer> <PageContainer>
<div className={styles.pageContent}>
<Card> <Card>
<div className={styles.tableTitle}> <div className={styles.tableTitle}>
<span style={{ marginRight: '100px' }}>升级详情</span> <span style={{ marginRight: '100px' }}>升级详情</span>
...@@ -438,7 +439,11 @@ const ManagementDataBase = () => { ...@@ -438,7 +439,11 @@ const ManagementDataBase = () => {
<> <>
<span>升级类型:</span> <span>升级类型:</span>
<div style={{ display: 'inline-block' }}> <div style={{ display: 'inline-block' }}>
<Checkbox.Group options={repairTypeList} value={keepValue} onChange={onChange} /> <Checkbox.Group
options={repairTypeList}
value={keepValue}
onChange={onChange}
/>
</div> </div>
</> </>
)} )}
...@@ -497,6 +502,7 @@ const ManagementDataBase = () => { ...@@ -497,6 +502,7 @@ const ManagementDataBase = () => {
size="small" size="small"
/> />
</Card> </Card>
</div>
</PageContainer> </PageContainer>
<Modal <Modal
......
.tableTitle{ .tableTitle {
font-size: 16px; font-size: 16px;
} }
.mgTop20{
.mgTop20 {
margin-top: 20px !important; margin-top: 20px !important;
} }
.tCenter{
.tCenter {
text-align: center; text-align: center;
} }
.btnBox{
.btnBox {
text-align: center; text-align: center;
margin-top: 10px; margin-top: 10px;
} }
.pageContent {
height: 100%;
width: 100%;
overflow-y: scroll;
}
\ No newline at end of file
...@@ -92,6 +92,7 @@ const DatabaseConnectConfig = props => { ...@@ -92,6 +92,7 @@ const DatabaseConnectConfig = props => {
return ( return (
<PageContainer> <PageContainer>
<div style={{ width: '100%', height: '100%', overflowY: 'scroll' }}>
<Card> <Card>
{/* <Tabs activeKey={active} onChange={e => handleChange(e)}> {/* <Tabs activeKey={active} onChange={e => handleChange(e)}>
{dataArr.map(item => ( {dataArr.map(item => (
...@@ -100,17 +101,21 @@ const DatabaseConnectConfig = props => { ...@@ -100,17 +101,21 @@ const DatabaseConnectConfig = props => {
</TabPane> </TabPane>
))} ))}
</Tabs> */} </Tabs> */}
<div style={{ marginBottom: '15px' }}>
<SQLServerTable /> <SQLServerTable />
</div>
<div style={{ marginBottom: '15px' }}>
<OracleTable /> <OracleTable />
</div>
<div style={{ marginBottom: '15px' }}>
<MongDBTable /> <MongDBTable />
</div>
<div style={{ marginBottom: '15px' }}>
<MySQLTable /> <MySQLTable />
</div>
<MasterTable /> <MasterTable />
</Card> </Card>
</div>
</PageContainer> </PageContainer>
); );
}; };
......
...@@ -87,17 +87,17 @@ ...@@ -87,17 +87,17 @@
border: 1px solid #eee; border: 1px solid #eee;
padding: 10px; padding: 10px;
} }
.ant-tree.ant-tree-block-node .ant-tree-list-holder-inner .ant-tree-node-content-wrapper { // .ant-tree.ant-tree-block-node .ant-tree-list-holder-inner .ant-tree-node-content-wrapper {
line-height: 28px !important; // line-height: 28px !important;
width: 0; // width: 0;
} // }
.ant-tree-drop-indicator { // .ant-tree-drop-indicator {
bottom: 3px !important; // bottom: 3px !important;
margin-left: 6px; // margin-left: 6px;
} // }
.ant-tree-draggable-icon { // .ant-tree-draggable-icon {
display: none; // display: none;
} // }
// .modal{ // .modal{
// .ant-modal-body{ // .ant-modal-body{
// padding: 0 !important; // padding: 0 !important;
......
:global { :global {
::-webkit-scrollbar { // ::-webkit-scrollbar {
height: 6px; //x轴滚动条粗细 // height: 6px; //x轴滚动条粗细
width: 6px; //y轴滚动条粗细 // width: 6px; //y轴滚动条粗细
border-bottom: 2px solid white; // border-bottom: 2px solid white;
} // }
//滚动条里面的小方块,能上下左右移动(取决于是垂直滚动条还是水平滚动条) // //滚动条里面的小方块,能上下左右移动(取决于是垂直滚动条还是水平滚动条)
::-webkit-scrollbar-thumb { // ::-webkit-scrollbar-thumb {
border-radius: 10px; // border-radius: 10px;
box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.1); // box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.1);
background: rgba(74, 74, 75, 0.3); // background: rgba(74, 74, 75, 0.3);
margin-bottom: 10px; // margin-bottom: 10px;
} // }
//滚动条的轨道(里面装有thumb)滚动槽 // //滚动条的轨道(里面装有thumb)滚动槽
::-webkit-scrollbar-track { // ::-webkit-scrollbar-track {
box-shadow: 0; // box-shadow: 0;
border-radius: 0; // border-radius: 0;
background: white; //滚动槽背景色 // background: white; //滚动槽背景色
border-radius: 10px; //滚动条边框半径设置 // border-radius: 10px; //滚动条边框半径设置
} // }
.ant-tree-node-content-wrapper { // .ant-tree-node-content-wrapper {
width: 100%; // width: 100%;
// overflow: hidden !important; // // overflow: hidden !important;
.ant-tree-title { // .ant-tree-title {
overflow: hidden; // overflow: hidden;
text-overflow: ellipsis; // text-overflow: ellipsis;
white-space: nowrap; // white-space: nowrap;
display: flex !important; // display: flex !important;
justify-content: space-between; // justify-content: space-between;
} // }
} // }
.ant-pagination-prev, // .ant-pagination-prev,
.ant-pagination-next { // .ant-pagination-next {
line-height: 8px !important; // line-height: 8px !important;
} // }
.ant-input-search-button { // .ant-input-search-button {
line-height: 1; // line-height: 1;
} // }
.ant-dropdown-menu-item>.anticon:first-child { // .ant-dropdown-menu-item>.anticon:first-child {
vertical-align: 0.15em !important; // vertical-align: 0.15em !important;
} // }
.ant-table-tbody { // .ant-table-tbody {
.ant-table-row:hover>td { // .ant-table-row:hover>td {
background: #aed8fa !important; // background: #aed8fa !important;
} // }
} // }
.ant-modal-close-icon { // .ant-modal-close-icon {
vertical-align: 0.3em; // vertical-align: 0.3em;
} // }
.ant-notification-close-icon { // .ant-notification-close-icon {
vertical-align: 0.2em; // vertical-align: 0.2em;
} // }
.ant-tree-switcher-icon svg { // .ant-tree-switcher-icon svg {
font-size: 14px; // font-size: 14px;
color: #767777 !important; // color: #767777 !important;
} // }
.ant-card-body { // .ant-card-body {
padding: 12px 24px 24px 10px; // padding: 12px 24px 24px 10px;
} // }
} }
.redText { .redText {
...@@ -76,19 +76,19 @@ ...@@ -76,19 +76,19 @@
cursor: pointer; cursor: pointer;
} }
.ant-layout { // .ant-layout {
overflow: auto; // overflow: auto;
.ant-layout-content { // .ant-layout-content {
margin: 12px !important; // margin: 12px !important;
} // }
} // }
.ant-btn>.anticon+span, // .ant-btn>.anticon+span,
.ant-btn>span+.anticon { // .ant-btn>span+.anticon {
margin-left: 8px; // margin-left: 8px;
vertical-align: middle; // vertical-align: middle;
} // }
.siteTitle { .siteTitle {
font-size: 16px; font-size: 16px;
...@@ -100,6 +100,7 @@ ...@@ -100,6 +100,7 @@
.userManageContainer { .userManageContainer {
height: 100%; height: 100%;
.ant-modal-footer { .ant-modal-footer {
border: none; border: none;
padding: 28px 40px; padding: 28px 40px;
...@@ -181,7 +182,6 @@ ...@@ -181,7 +182,6 @@
} }
.orgContainer { .orgContainer {
// height: calc(100vh - 74px);
height: 100%; height: 100%;
width: 320px; width: 320px;
padding-right: 10px; padding-right: 10px;
...@@ -193,9 +193,11 @@ ...@@ -193,9 +193,11 @@
transition-property: width; transition-property: width;
transition-duration: 0.5s; transition-duration: 0.5s;
white-space: nowrap; white-space: nowrap;
.ant-card-body { .ant-card-body {
height: 100%; height: 100%;
} }
.ant-tree { .ant-tree {
padding-top: 6px; padding-top: 6px;
...@@ -274,7 +276,6 @@ ...@@ -274,7 +276,6 @@
} }
.userContainer { .userContainer {
// height: calc(100vh - 74px) !important;
height: 100%; height: 100%;
z-index: 999; z-index: 999;
background: white; background: white;
...@@ -327,9 +328,10 @@ ...@@ -327,9 +328,10 @@
.ant-table-body { .ant-table-body {
// height: calc(100vh - 210px); // height: calc(100vh - 210px);
// height: 100%; height: 100%;
border-right: white; border-right: white;
// overflow: auto !important;
} }
.clickRowStyle { .clickRowStyle {
...@@ -377,41 +379,41 @@ ...@@ -377,41 +379,41 @@
} }
} }
.ant-modal-content { // .ant-modal-content {
border-radius: 5px; // border-radius: 5px;
} // }
.ant-modal-header { // .ant-modal-header {
border-radius: 5px 5px 0 0; // border-radius: 5px 5px 0 0;
padding: 28px 40px; // padding: 28px 40px;
} // }
.ant-modal-close { // .ant-modal-close {
top: 14px; // top: 14px;
right: 20px; // right: 20px;
} // }
.ant-modal-footer .ant-btn+.ant-btn:not(.ant-dropdown-trigger) { // .ant-modal-footer .ant-btn+.ant-btn:not(.ant-dropdown-trigger) {
margin-bottom: 0; // margin-bottom: 0;
margin-left: 15px; // margin-left: 15px;
} // }
// .ant-form-horizontal .ant-form-item-control { // .ant-form-horizontal .ant-form-item-control {
// margin-left: 10px; // margin-left: 10px;
// } // }
.ant-popover-inner { // .ant-popover-inner {
border-radius: 10px; // border-radius: 10px;
background-color: rgba(255, 255, 255, 0.788); // background-color: rgba(255, 255, 255, 0.788);
} // }
.ant-popover-inner-content { // .ant-popover-inner-content {
padding: 10px 10px; // padding: 10px 10px;
} // }
.ant-popover-message>.anticon { // .ant-popover-message>.anticon {
top: 7.0005px; // top: 7.0005px;
} // }
// .ant-tree { // .ant-tree {
// overflow-y: scroll; // overflow-y: scroll;
......
...@@ -12,62 +12,145 @@ import { ...@@ -12,62 +12,145 @@ import {
FundProjectionScreenOutlined, FundProjectionScreenOutlined,
ReadOutlined, ReadOutlined,
} from '@ant-design/icons'; } from '@ant-design/icons';
import asyncComponent from './importComponent';
// 菜单 // 菜单
import UserLayout from '@/layouts/UserLayout'; // import UserLayout from '@/layouts/UserLayout';
import BasicLayout from '@/layouts/BasicLayout'; // import BasicLayout from '@/layouts/BasicLayout';
import BlankLayout from '@/layouts/BlankLayout'; // import BlankLayout from '@/layouts/BlankLayout';
// 登录 // 登录
import Login from '@/pages/user/login'; // import Login from '@/pages/user/login';
// 解决方案管理 // 解决方案管理
import CurrentSolution from '@/pages/currentSolution/CurrentSolution'; // import CurrentSolution from '@/pages/currentSolution/CurrentSolution';
// 数据库管理 // 数据库管理
import InitDataBase from '@/pages/database/InitDataBase/InitDataBase'; // import InitDataBase from '@/pages/database/InitDataBase/InitDataBase';
import DatabaseInitialization from '@/pages/database/databaseInitialization/DatabaseInitialization'; // import DatabaseInitialization from '@/pages/database/databaseInitialization/DatabaseInitialization';
import ManagementDataBase from '@/pages/database/ManagementDataBase/ManagementDataBase'; // import ManagementDataBase from '@/pages/database/ManagementDataBase/ManagementDataBase';
import DatabaseConnectConfig from '@/pages/database/databaseConfig/DatabaseConfig'; // import DatabaseConnectConfig from '@/pages/database/databaseConfig/DatabaseConfig';
// 用户中心 // 用户中心
import UserManage from '@/pages/userCenter/userManage/UserManage'; // import UserManage from '@/pages/userCenter/userManage/UserManage';
import RoleManage from '@/pages/userCenter/roleManage/RoleManage'; // import UserManage from '@/pages/userCenter/userManage/UserManage';
import SiteManage from '@/pages/userCenter/siteManage/SiteManage';
// import RoleManage from '@/pages/userCenter/roleManage/RoleManage';
// import SiteManage from '@/pages/userCenter/siteManage/SiteManage';
// 数据中心 // 数据中心
import Dictionary from '@/pages/dataCenter/dictionary'; // import Dictionary from '@/pages/dataCenter/dictionary';
// 组态平台 // 组态平台
// 平台中心 // 平台中心
import SchemeConfig from '@/pages/platformCenter/gis/schemeConfig/SchemeConfig'; // import SchemeConfig from '@/pages/platformCenter/gis/schemeConfig/SchemeConfig';
import DimensionsConfig from '@/pages/platformCenter/gis/dimensionsConfig/dimensionsConfig'; // import DimensionsConfig from '@/pages/platformCenter/gis/dimensionsConfig/dimensionsConfig';
import MessageManager from '@/pages/platformCenter/messageManage'; // import MessageManager from '@/pages/platformCenter/messageManage';
import SchemeDetail from '@/pages/platformCenter/messageManage/schemeDetail/schemeDetail'; // import SchemeDetail from '@/pages/platformCenter/messageManage/schemeDetail/schemeDetail';
import HostManager from '@/pages/platformCenter/hostmanager'; // import HostManager from '@/pages/platformCenter/hostmanager';
import VideoManager from '@/pages/platformCenter/videoManager'; // import VideoManager from '@/pages/platformCenter/videoManager';
import BaseFrameContainer from '@/pages/platformCenter/baseFrameContainer'; // import BaseFrameContainer from '@/pages/platformCenter/baseFrameContainer';
import IntegratedLogin from '@/pages/platformCenter/integratedLogin/integrate'; // import IntegratedLogin from '@/pages/platformCenter/integratedLogin/integrate';
// 业务中心 // 业务中心
import TableManager from '@/pages/bsmanager/base/tablemanager'; // import TableManager from '@/pages/bsmanager/base/tablemanager';
import FiledConfig from '@/pages/bsmanager/base/tablemanager/filedConfig/filedConfig'; // import FiledConfig from '@/pages/bsmanager/base/tablemanager/filedConfig/filedConfig';
import StandingBook from '@/pages/bsmanager/base/standingBook/standingBook'; // import StandingBook from '@/pages/bsmanager/base/standingBook/standingBook';
import Incident from '@/pages/bsmanager/workOrder/incident/incident'; // import Incident from '@/pages/bsmanager/workOrder/incident/incident';
import IncidentFlow from '@/pages/bsmanager/workOrder/incident/incidentFlow'; // import IncidentFlow from '@/pages/bsmanager/workOrder/incident/incidentFlow';
import IncidentView from '@/pages/bsmanager/workOrder/incident/incidentView'; // import IncidentView from '@/pages/bsmanager/workOrder/incident/incidentView';
import Flow from '@/pages/bsmanager/workOrder/workFlow/flow'; // import Flow from '@/pages/bsmanager/workOrder/workFlow/flow';
import FlowNode from '@/pages/bsmanager/workOrder/workFlow/flowNode/flowNode'; // import FlowNode from '@/pages/bsmanager/workOrder/workFlow/flowNode/flowNode';
import Workflow from '@/pages/bsmanager/workOrder/workflowEdit/Workflow'; // import Workflow from '@/pages/bsmanager/workOrder/workflowEdit/Workflow';
import Maintenance from '@/pages/bsmanager/patrolMaintenance/maintenance/maintenance'; // import Maintenance from '@/pages/bsmanager/patrolMaintenance/maintenance/maintenance';
import PatrolFeedback from '@/pages/bsmanager/patrolMaintenance/patrolFeedback/patrolFeedback'; // import PatrolFeedback from '@/pages/bsmanager/patrolMaintenance/patrolFeedback/patrolFeedback';
// 应用中心 // 应用中心
import ProductConfig from '@/pages/productCenter/productConfig/productConfig'; // import ProductConfig from '@/pages/productCenter/productConfig/productConfig';
import WebConfigPage from '@/pages/productCenter/webConfig'; // import WebConfigPage from '@/pages/productCenter/webConfig';
import MobileConfigPage from '@/pages/productCenter/mobileConfig'; // import MobileConfigPage from '@/pages/productCenter/mobileConfig';
// 系统日志 // 系统日志
import ServiceLog from '@/pages/log/serviceLog'; // import ServiceLog from '@/pages/log/serviceLog';
import LoginLog from '@/pages/log/loginLog'; // import LoginLog from '@/pages/log/loginLog';
import OmsLog from '@/pages/log/omsLog'; // import OmsLog from '@/pages/log/omsLog';
import { USER_MODE } from '@/utils/constants'; import { USER_MODE } from '@/utils/constants';
// 菜单
const UserLayout = asyncComponent(() => import('@/layouts/UserLayout'));
const BasicLayout = asyncComponent(() => import('@/layouts/BasicLayout'));
const BlankLayout = asyncComponent(() => import('@/layouts/BlankLayout'));
// 登录
const Login = asyncComponent(() => import('@/pages/user/login'));
// 解决方案管理
const CurrentSolution = asyncComponent(() => import('@/pages/currentSolution/CurrentSolution'));
// 数据库管理
const InitDataBase = asyncComponent(() => import('@/pages/database/InitDataBase/InitDataBase'));
const DatabaseInitialization = asyncComponent(() =>
import('@/pages/database/databaseInitialization/DatabaseInitialization'),
);
const ManagementDataBase = asyncComponent(() =>
import('@/pages/database/ManagementDataBase/ManagementDataBase'),
);
const DatabaseConnectConfig = asyncComponent(() =>
import('@/pages/database/databaseConfig/DatabaseConfig'),
);
// 用户中心
const UserManage = asyncComponent(() => import('@/pages/userCenter/userManage/UserManage'));
const Workflow = asyncComponent(() => import('@/pages/bsmanager/workOrder/workflowEdit/Workflow'));
const RoleManage = asyncComponent(() => import('@/pages/userCenter/roleManage/RoleManage'));
const SiteManage = asyncComponent(() => import('@/pages/userCenter/siteManage/SiteManage'));
// 数据中心
const Dictionary = asyncComponent(() => import('@/pages/dataCenter/dictionary'));
// 平台中心
const SchemeConfig = asyncComponent(() =>
import('@/pages/platformCenter/gis/schemeConfig/SchemeConfig'),
);
const DimensionsConfig = asyncComponent(() =>
import('@/pages/platformCenter/gis/dimensionsConfig/dimensionsConfig'),
);
const MessageManager = asyncComponent(() => import('@/pages/platformCenter/messageManage'));
const SchemeDetail = asyncComponent(() =>
import('@/pages/platformCenter/messageManage/schemeDetail/schemeDetail'),
);
const HostManager = asyncComponent(() => import('@/pages/platformCenter/hostmanager'));
const VideoManager = asyncComponent(() => import('@/pages/platformCenter/videoManager'));
const BaseFrameContainer = asyncComponent(() =>
import('@/pages/platformCenter/baseFrameContainer'),
);
const IntegratedLogin = asyncComponent(() =>
import('@/pages/platformCenter/integratedLogin/integrate'),
);
// 业务中心
const TableManager = asyncComponent(() => import('@/pages/bsmanager/base/tablemanager'));
const FiledConfig = asyncComponent(() =>
import('@/pages/bsmanager/base/tablemanager/filedConfig/filedConfig'),
);
const StandingBook = asyncComponent(() =>
import('@/pages/bsmanager/base/standingBook/standingBook'),
);
const Incident = asyncComponent(() => import('@/pages/bsmanager/workOrder/incident/incident'));
const IncidentFlow = asyncComponent(() =>
import('@/pages/bsmanager/workOrder/incident/incidentFlow'),
);
const IncidentView = asyncComponent(() =>
import('@/pages/bsmanager/workOrder/incident/incidentView'),
);
const Flow = asyncComponent(() => import('@/pages/bsmanager/workOrder/workFlow/flow'));
const FlowNode = asyncComponent(() =>
import('@/pages/bsmanager/workOrder/workFlow/flowNode/flowNode'),
);
const Maintenance = asyncComponent(() =>
import('@/pages/bsmanager/patrolMaintenance/maintenance/maintenance'),
);
const PatrolFeedback = asyncComponent(() =>
import('@/pages/bsmanager/patrolMaintenance/patrolFeedback/patrolFeedback'),
);
// 应用中心
const ProductConfig = asyncComponent(() =>
import('@/pages/productCenter/productConfig/productConfig'),
);
const WebConfigPage = asyncComponent(() => import('@/pages/productCenter/webConfig'));
const MobileConfigPage = asyncComponent(() => import('@/pages/productCenter/mobileConfig'));
// 系统日志
const ServiceLog = asyncComponent(() => import('@/pages/log/serviceLog'));
const LoginLog = asyncComponent(() => import('@/pages/log/loginLog'));
const OmsLog = asyncComponent(() => import('@/pages/log/omsLog'));
const superAuthority = [USER_MODE.SUPER]; const superAuthority = [USER_MODE.SUPER];
const adminAuthority = [...superAuthority, USER_MODE.ADMIN]; const adminAuthority = [...superAuthority, USER_MODE.ADMIN];
const iconStyle = { verticalAlign: 'middle' }; const iconStyle = { verticalAlign: 'middle' };
......
import React from 'react';
export default function asyncComponent(importComponent) {
class AsyncComponent extends React.Component {
constructor(props) {
super(props);
this.state = { component: null };
}
componentDidMount() {
importComponent().then(mod => {
this.setState({
component: mod.default ? mod.default : mod,
});
});
}
render() {
const C = this.state.component;
return C ? <C {...this.props} /> : null;
}
}
return AsyncComponent;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment