Commit 8ff386b2 authored by 杨思琦's avatar 杨思琦

fix: 登录页懒加载修改

parent c4b34aaf
......@@ -69,6 +69,13 @@ module.exports = require('./webpack.base.babel')({
test: /[\\/]src[\\/]components[\\/]/,
name: 'biz-component',
},
layouts: {
chunks: 'all',
minSize: 0,
maxInitialRequests: 10,
test: /[\\/]src[\\/]layouts[\\/]/,
name: 'layouts',
},
arcgis_views: {
chunks: 'all',
minSize: 0,
......
......@@ -108,7 +108,6 @@
"@babel/runtime": "^7.10.5",
"@congcongcai/jieba.js": "0.0.3",
"@esri/calcite-colors": "6.0.3",
"@wisdom-cesium/cesium": "^1.1.49",
"@wisdom-cesium/krpano": "1.0.29-60",
"@wisdom-components/basictable": "^1.5.16",
"@wisdom-components/empty": "^1.4.1",
......
......@@ -452,7 +452,7 @@ window.app.define('js-base64', require.context('../node_modules/js-base64', true
/**
* cesiumMap
*/
window.app.define('@wisdom-cesium/cesium', require.context('../node_modules/@wisdom-cesium/cesium/es', true, /^.\/(es\/)?[^\/]+\.js$/), 'index.js');
// window.app.define('@wisdom-cesium/cesium', require.context('../node_modules/@wisdom-cesium/cesium/es', true, /^.\/(es\/)?[^\/]+\.js$/), 'index.js');
// window.app.define('@wisdom-map/arcgismap', require.context('../node_modules/@wisdom-map/arcgismap/lib', true, /^.\/(lib\/)?[^\/]+\.js$/), 'index.js');
// // window.app.define('@wisdom-map/arcgismap/lib/widgets', require.context('../node_modules/@wisdom-map/arcgismap/lib/widgets', true, /^.\/(lib\/)?[^\/]+\.js$/));
// window.app.define('@wisdom-map/arcgismap/lib/arcgisapi/4.20/@arcgis/core', require.context('../node_modules/@wisdom-map/arcgismap/lib/arcgisapi/4.20/@arcgis/core', true, /^.\/(arcgisapi\/)?[^\/]+\.js$/));
......
import { PdRender, parseScheme } from '@wisdom-cesium/cesium';
import { useRef, useEffect } from 'react';
import { connect } from 'react-redux';
import { actionCreators } from '@/containers/App/store';
const cesiumMap = props => {
// eslint-disable-next-line react-hooks/rules-of-hooks
const ref = useRef(null);
// eslint-disable-next-line react-hooks/rules-of-hooks
const storeRef = useRef(null);
// eslint-disable-next-line react-hooks/rules-of-hooks
useEffect(() => {
const mapConfig3d = props.globalConfig?.mapConfig3d;
if (
!(
props.globalConfig.mapsettings?.areasettings &&
// eslint-disable-next-line no-undef
globalConfig.mapsettings?.basemaps?.length > 0
)
)
return;
if (storeRef.current) return;
const { widgets } = mapConfig3d;
const schemes = parseScheme.parseSchemes(mapConfig3d);
const schemeData = parseScheme.parseDatas(schemes);
const pdView = new PdRender({
el: ref.current,
widgets,
prefixCls: 'panda-console-base',
...schemeData,
});
storeRef.current = pdView;
props.updatePdCesiumView(pdView);
}, [props]);
return (
// eslint-disable-next-line react/react-in-jsx-scope
<div
style={{
inset: 0,
position: 'absolute',
}}
ref={ref}
/>
);
};
const mapStateToProps = state => ({
globalConfig: state.getIn(['global', 'globalConfig']),
});
const mapDispatchToProps = dispatch => ({
updatePdCesiumView(pdView) {
dispatch(actionCreators.updatePdCesiumView(pdView));
},
});
export default connect(
mapStateToProps,
mapDispatchToProps,
)(cesiumMap);
import ArcgisMap from './arcgis';
import AMap from './amap';
import CesiumMap from './cesiumMap';
export { ArcgisMap, AMap, CesiumMap };
export { ArcgisMap, AMap };
......@@ -2,7 +2,6 @@
import React, { useEffect, useRef, useState } from 'react';
import Iframe from 'react-iframe';
import { appService } from '@/api';
import Empty from '@wisdom-components/empty';
import axios from 'axios';
import { Message, Spin, notification } from 'antd';
import styles from './index.less';
......
......@@ -6,53 +6,54 @@
* @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 } 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 React, { useEffect, Suspense } from 'react';
import { AppInitState } from '../../../render';
import PanoramaLogin from './template/panorama';
import JiangXi from './template/project/jiangxi';
import JiangXiNew from './template/project/jiangxiNew';
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 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'));
const LoginTemplate = {
'新春.html': baseLoginNewYear,
'新春 - 智联.html': NewYear,
......@@ -127,5 +128,9 @@ export default props => {
template += '.html';
}
const RenderComponent = LoginTemplate[template] ? LoginTemplate[template] : LoginTemplate['default'];
return <RenderComponent {...props} loginParams={loginParams} />;
return(
<Suspense fallback={<></>}>
<RenderComponent {...props} loginParams={loginParams} />
</Suspense>
)
};
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