Commit 6a5e9f34 authored by 杨思琦's avatar 杨思琦

fix: 懒加载逻辑修改

parent eb3b68a5
......@@ -59,7 +59,10 @@ module.exports = require('./webpack.base.babel')({
test: /[\\/]node_modules[\\/]/,
name(module) {
const packageName = module.context.match(/[\\/]node_modules[\\/](.*?)([\\/]|$)/)[1];
// @ts-ignore
if (module.type !== 'css/mini-extract') {
return `npm.${packageName.replace('@', '')}`;
}
},
},
bizComponent: {
......
/* eslint-disable global-require */
import React, { useEffect } from 'react';
import React, { useEffect, Suspense } from 'react';
import { Helmet } from 'react-helmet';
import { connect } from 'react-redux';
......@@ -37,6 +37,7 @@ const App = props => {
<Router basename={config.base || pkg.name.toLocaleLowerCase() || ''}>
{window?.qiankunIsCache ? (
<AliveScope>
<Suspense fallback={<></>}>
<Switch>
{renderRoutes(
'panda-console-base',
......@@ -47,8 +48,10 @@ const App = props => {
).routes,
)}
</Switch>
</Suspense>
</AliveScope>
) : (
<Suspense fallback={<></>}>
<Switch>
{renderRoutes(
'panda-console-base',
......@@ -59,6 +62,7 @@ const App = props => {
).routes,
)}
</Switch>
</Suspense>
)}
</Router>
</>
......
......@@ -8,7 +8,7 @@
/* eslint-disable react-hooks/rules-of-hooks */
/* eslint-disable global-require */
// @eslint-disable
import React, { Suspense, useEffect, useRef, useState, useContext } from 'react';
import React, { useEffect, useRef, useState, useContext } from 'react';
import { ConfigProvider, Anchor, Modal, Popover, Radio, Spin, notification, Button } from 'antd';
import classNames from 'classnames';
......@@ -773,28 +773,6 @@ const Layout = props => {
: <></>
)}
>
{/* <Suspense fallback={<></>}> */}
{/* {window.location.pathname.startsWith('/civbase/civ_3d') ? ( */}
{/* <KeepAlive> */}
{/* <CesiumMap /> */}
{/* </KeepAlive> */}
{/* ) : window.location.pathname.startsWith('/civbase/civ_webgis') ? ( */}
{/* mapMode === 'AMap' ? ( */}
{/* <AMap /> */}
{/* ) : ( */}
{/* <ArcgisMap options={{ type: 'ArcgisMap' }} /> */}
{/* ) */}
{/* ) : null} */}
{/* <AliveScope> */}
{/* {window.location.pathname.startsWith('/civbase/civ_drainage/map') || isHaveMap() ? (
<KeepAlive when={true}>
<CesiumMap />
</KeepAlive>
) : (
window.location.pathname.startsWith('/civbase/civ_webgis') && null
)} */}
{/* </AliveScope> */}
{/* </Suspense> */}
<div id="micro-container" className="subapp-container">
{props.children}
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -6,54 +6,53 @@
* @FilePath: \CivWeb\src\pages\user\login\index.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import React, { useEffect, Suspense } from 'react';
import { AppInitState } from '../../../render';
import React, { useEffect } from 'react';
import BaseLogin from './template/baseLogin';
import ChangShuiJiChang from './template/changShuiJiChang';
import NewYear from './template/newYear';
import baseLoginNewYear from './template/baseLoginNewYear';
import InfoLogin from './template/infoLogin';
import Yulin from './template/yulin';
// import { useParams } from '@wisdom-utils/runtime';
import EnergyQuota from './template/energy_quota/index';
import drainageXindu from './template/drainage_xindu/index';
import EnergGz from './template/energy_GZ/index';
import EnergGzV2 from './template/energy_GZV2/index'; // 广州单点登录跳转
import EnergJS2 from './template/energy_JS2/index';
import DarkNoEffect from './template/noEffect/DarkNoEffect';
import CloudLogin from './template/cloud';
import CloudNewLogin from './template/cloudNew';
import WaterLogin from './template/water';
import JSZHLogin from './template/project/JSZH';
import ChengmaiLogin from './template/project/chengmai';
import HuhehaoteLogin from './template/project/huhehaote';
import XinganLogin from './template/project/xingan';
import LvchengLogin from './template/project/lvcheng';
import PukouLogin from './template/project/pukou';
import JiLinDaXueLogin from './template/project/JiLinDaXue';
import ErlianhaoteLogin from './template/project/erlianhaote';
import YixianLogin from './template/project/yixian';
import LixianLogin from './template/project/lixian';
import DazuLogin from './template/project/dazu';
import WeixinLogin from './template/project/weixin';
import PanoramaLogin from './template/panorama';
import JiangXi from './template/project/jiangxi';
import JiangXiNew from './template/project/jiangxiNew';
const BaseLogin = React.lazy(() => import('./template/baseLogin'));
const ChangShuiJiChang = React.lazy(() => import('./template/changShuiJiChang'));
const NewYear = React.lazy(() => import('./template/newYear'));
const baseLoginNewYear = React.lazy(() => import('./template/baseLoginNewYear'));
const InfoLogin = React.lazy(() => import('./template/infoLogin'));
const Yulin = React.lazy(() => import('./template/yulin'));
const EnergyQuota = React.lazy(() => import('./template/energy_quota/index'));
const drainageXindu = React.lazy(() => import('./template/drainage_xindu/index'));
const EnergGz = React.lazy(() => import('./template/energy_GZ/index'));
const EnergGzV2 = React.lazy(() => import('./template/energy_GZV2/index')); // 广州单点登录跳转
const EnergJS2 = React.lazy(() => import('./template/energy_JS2/index'));
const DarkNoEffect = React.lazy(() => import('./template/noEffect/DarkNoEffect'));
const CloudLogin = React.lazy(() => import('./template/cloud'));
const CloudNewLogin = React.lazy(() => import('./template/cloudNew'));
const WaterLogin = React.lazy(() => import('./template/water'));
const JSZHLogin = React.lazy(() => import('./template/project/JSZH'));
const ChengmaiLogin = React.lazy(() => import('./template/project/chengmai'));
const HuhehaoteLogin = React.lazy(() => import('./template/project/huhehaote'));
const XinganLogin = React.lazy(() => import('./template/project/xingan'));
const LvchengLogin = React.lazy(() => import('./template/project/lvcheng'));
const PukouLogin = React.lazy(() => import('./template/project/pukou'));
const JiLinDaXueLogin = React.lazy(() => import('./template/project/JiLinDaXue'));
const ErlianhaoteLogin = React.lazy(() => import('./template/project/erlianhaote'));
const YixianLogin = React.lazy(() => import('./template/project/yixian'));
const LixianLogin = React.lazy(() => import('./template/project/lixian'));
const DazuLogin = React.lazy(() => import('./template/project/dazu'));
const WeixinLogin = React.lazy(() => import('./template/project/weixin'));
const JiangXi = React.lazy(() => import('./template/project/jiangxi'));
const Queshan = React.lazy(() => import('./template/project/queshan'));
const Queshansl = React.lazy(() => import('./template/project/queshansl'));
const PiZhouLogin = React.lazy(() => import('./template/project/pizhou'));
const JieshouLogin = React.lazy(() => import('./template/project/jieshou'));
const YongjiLogin = React.lazy(() => import('./template/project/yongji'));
const DanlingLogin = React.lazy(() => import('./template/project/danling'));
const PulandianLogin = React.lazy(() => import('./template/project/pulandian'));
const HeilongjiangzhixiaoLogin = React.lazy(() => import('./template/project/heilongjiang'));
const GaoyaoLogin = React.lazy(() => import('./template/project/gaoyao'));
const JianzhaLogin = React.lazy(() => import('./template/project/jianzha'));
const ChinaShuiwu = React.lazy(() => import('./template/project/chinaShuiwu'));
const current = React.lazy(() => import('./template/current/index'));
const Linyou = React.lazy(() => import('./template/project/linyou'));
const FengqiuLogin = React.lazy(() => import('./template/project/fengqiu'));
import Queshan from './template/project/queshan';
import Queshansl from './template/project/queshansl';
import PiZhouLogin from './template/project/pizhou';
import JieshouLogin from './template/project/jieshou';
import YongjiLogin from './template/project/yongji';
import DanlingLogin from './template/project/danling';
import PulandianLogin from './template/project/pulandian';
import HeilongjiangzhixiaoLogin from './template/project/heilongjiang';
import GaoyaoLogin from './template/project/gaoyao';
import JianzhaLogin from './template/project/jianzha';
import ChinaShuiwu from './template/project/chinaShuiwu';
import current from './template/current/index';
import Linyou from './template/project/linyou';
import FengqiuLogin from './template/project/fengqiu';
import { AppInitState } from '../../../render';
const LoginTemplate = {
'新春.html': baseLoginNewYear,
'新春 - 智联.html': NewYear,
......@@ -128,9 +127,5 @@ export default props => {
template += '.html';
}
const RenderComponent = LoginTemplate[template] ? LoginTemplate[template] : LoginTemplate['default'];
return(
<Suspense fallback={<></>}>
<RenderComponent {...props} loginParams={loginParams} />
</Suspense>
)
return <RenderComponent {...props} loginParams={loginParams} />;
};
......@@ -10,7 +10,6 @@ import UsingAnalysis from '../pages/cloud/analysis/using';
import NewProducts from '../pages/cloud/introduction/newproducts';
import CommonMenu from '../pages/commonMenu';
import Iframe from '../pages/iframe';
import Login from '../pages/user/login';
import NoSecret from '../pages/user/login/noSecret';
import Notifications from '../pages/system/notifications';
import TabIframe from '../pages/system/iframe/TabWidget';
......@@ -20,6 +19,7 @@ import IntegratedLoginPage from '../pages/integratedLogin'; // 集成登录管
import ThirdParty from '../pages/thirdParty'; // 集成登录自定义跳转
import PrevieView from '../pages/system/previews/preview';
const Login = React.lazy(() => import('../pages/user/login'));
export const dyRoutes = (routes, layout, theme) => {
// eslint-disable-next-line no-shadow
const dyRoutes = routes || [];
......
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