Commit 7a207452 authored by 程恺文's avatar 程恺文
parents 255430bf 6c8a556a
Pipeline #78588 waiting for manual action with stages
/* eslint-disable */ /* eslint-disable */
// const proxyURL = process.env.NODE_ENV !== 'production' ? 'http://192.168.10.150:8777' : window.location.origin; // const proxyURL = process.env.NODE_ENV !== 'production' ? 'http://192.168.10.150:8777' : window.location.origin;
// const proxyURL = 'https://work.panda-water.cn'; // const proxyURL = 'https://work.panda-water.cn';
const proxyURL = 'http://192.168.12.3:8082'; const proxyURL = 'http://192.168.8.27:8023';
// const proxyURL = 'https://panda-water.cn' // const proxyURL = 'https://panda-water.cn'
//const proxyURL = 'http://192.168.12.189:8816/' //const proxyURL = 'http://192.168.12.189:8816/'
module.exports = { module.exports = {
...@@ -81,6 +81,16 @@ module.exports = { ...@@ -81,6 +81,16 @@ module.exports = {
'/Cityinterface': '/CityInterface', '/Cityinterface': '/CityInterface',
}, },
}, },
'/center': {
target: proxyURL,
changeOrigin: true,
headers: {
'Access-Control-Allow-Origin': '*',
},
pathRewrite: {
'/center': '/center',
},
},
'/cityjson': { '/cityjson': {
target: 'https://pv.sohu.com', target: 'https://pv.sohu.com',
// target: 'http://192.168.19.102:8055', // target: 'http://192.168.19.102:8055',
......
...@@ -112,12 +112,12 @@ ...@@ -112,12 +112,12 @@
"@wisdom-components/basictable": "^1.5.16", "@wisdom-components/basictable": "^1.5.16",
"@wisdom-components/empty": "^1.4.1", "@wisdom-components/empty": "^1.4.1",
"@wisdom-map/amap": "1.1.0-beta.56", "@wisdom-map/amap": "1.1.0-beta.56",
"@wisdom-map/arcgismap": "1.4.0-184", "@wisdom-map/arcgismap": "1.4.0-189",
"@wisdom-map/basemap": "1.1.0-29", "@wisdom-map/basemap": "1.1.0-29",
"@wisdom-map/util": "^1.0.28-0", "@wisdom-map/util": "^1.0.28-0",
"@wisdom-utils/components": "0.1.316", "@wisdom-utils/components": "0.1.319",
"@wisdom-utils/runtime": "0.0.46", "@wisdom-utils/runtime": "0.0.46",
"@wisdom-utils/utils": "0.1.356", "@wisdom-utils/utils": "0.1.359",
"animate.css": "^4.1.1", "animate.css": "^4.1.1",
"antd": "4.21.2", "antd": "4.21.2",
"compression": "1.7.4", "compression": "1.7.4",
......
...@@ -37,6 +37,7 @@ export const API = { ...@@ -37,6 +37,7 @@ export const API = {
GET_InOnLine: '/PandaEnergy/GZshuiwuju/GuangZhou/InOnLine', // 广州登陆接口 GET_InOnLine: '/PandaEnergy/GZshuiwuju/GuangZhou/InOnLine', // 广州登陆接口
GET_UserMobile: '/PandaEnergy/GZshuiwuju/SingleLogin/SingleLoginByAccess_token', // 获取登录手机号 GET_UserMobile: '/PandaEnergy/GZshuiwuju/SingleLogin/SingleLoginByAccess_token', // 获取登录手机号
GET_JIANGXI_MANAGE: '/PandaWorkFlow/WorkFlow/JiangXiManage/Login', // 江西登录接口 GET_JIANGXI_MANAGE: '/PandaWorkFlow/WorkFlow/JiangXiManage/Login', // 江西登录接口
GET_INTEGRATION_CONFIG: '/PandaCore/GCK/IntegrationAuth/GetIntegrationConfig', // 获取集成站点数据
GET_YANSHI_AUTHORITY: '/PandaCore/GCK/Demonstrate/GetYanshiAuthority', // 获取当前用户开始演示模式的所有菜单ID GET_YANSHI_AUTHORITY: '/PandaCore/GCK/Demonstrate/GetYanshiAuthority', // 获取当前用户开始演示模式的所有菜单ID
IS_OPEN_YANSHI: '/PandaCore/GCK/Demonstrate/IsOpenYanshi', // 获取是否开启演示模式服务 IS_OPEN_YANSHI: '/PandaCore/GCK/Demonstrate/IsOpenYanshi', // 获取是否开启演示模式服务
GET_WEB_CONFIG: '/PandaOMS/OMS/GetIntegratedLoginbyName', GET_WEB_CONFIG: '/PandaOMS/OMS/GetIntegratedLoginbyName',
...@@ -54,6 +55,11 @@ const services = { ...@@ -54,6 +55,11 @@ const services = {
method: constants.REQUEST_METHOD_GET, method: constants.REQUEST_METHOD_GET,
type: constants.REQUEST_HTTP, type: constants.REQUEST_HTTP,
}, },
GetIntegrationConfig: {
url: API.GET_INTEGRATION_CONFIG,
method: constants.REQUEST_METHOD_GET,
type: constants.REQUEST_HTTP,
},
getUserMobile: { getUserMobile: {
url: API.GET_UserMobile, url: API.GET_UserMobile,
method: constants.REQUEST_METHOD_GET, method: constants.REQUEST_METHOD_GET,
......
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
...@@ -216,6 +216,9 @@ export function logout(data) { ...@@ -216,6 +216,9 @@ export function logout(data) {
Cookies.set('site', '', { Cookies.set('site', '', {
path: '/', path: '/',
}); });
Cookies.set('singleToken', '', {
path: '/',
});
localStorage.removeItem('access_token'); localStorage.removeItem('access_token');
localStorage.removeItem('password_token'); localStorage.removeItem('password_token');
localStorage.removeItem('password_pwdRegex'); localStorage.removeItem('password_pwdRegex');
......
...@@ -188,9 +188,10 @@ class Notifier { ...@@ -188,9 +188,10 @@ class Notifier {
const userName = USERNAME; const userName = USERNAME;
const password = PASSWORD; const password = PASSWORD;
const path = this._siteConfig.mqtt_path; const path = this._siteConfig.mqtt_path;
const siteCode = this._siteConfig.site_code ?? '';
this.MQTTCount = 0; this.MQTTCount = 0;
if (hostname) { if (hostname) {
this.MQTTClient = new MqttClient.Client(hostname, port, path, clientId); this.MQTTClient = new MqttClient.Client(hostname, port, `${path}?_site=${siteCode}`, clientId);
this.MQTTOptions = { this.MQTTOptions = {
invocationContext: { invocationContext: {
host: hostname, host: hostname,
......
...@@ -23,6 +23,9 @@ import { waterMark } from '../utils/mark'; ...@@ -23,6 +23,9 @@ import { waterMark } from '../utils/mark';
import layoutStyles from './BasicLayout.less'; import layoutStyles from './BasicLayout.less';
import SecurityLayout from './SecurityLayout'; import SecurityLayout from './SecurityLayout';
import Site from './Site'; import Site from './Site';
import { defaultApp } from '@/micro';
import { appService } from '@/api';
import LoginAction from '@/pages/user/login/login';
const { params } = helpers; const { params } = helpers;
...@@ -94,15 +97,16 @@ const OnlyFocusStations = props => { ...@@ -94,15 +97,16 @@ const OnlyFocusStations = props => {
</Spin> </Spin>
); );
}; };
const AllStations = props => { const AllStations = props => {
const data = props.data.stations; const data = props.data.stations;
const [targetOffset, setTargetOffset] = useState(undefined); const [targetOffset, setTargetOffset] = useState(undefined);
const cityPane = useRef(null); const cityPane = useRef(null);
const cityContent = useRef(null); const cityContent = useRef(null);
const [defaultTab, setDefaultTab] = useState('site'); const [defaultTab, setDefaultTab] = useState('site');
useEffect(() => { useEffect(() => {
setTargetOffset(cityPane.current.clientHeight / 2); setTargetOffset(cityPane.current.clientHeight / 2);
}, []); }, []);
const handleClick = (event, link) => { const handleClick = (event, link) => {
...@@ -223,6 +227,76 @@ const renderSite = ({ data, config, loading, setLoading, action, actionRef, setM ...@@ -223,6 +227,76 @@ const renderSite = ({ data, config, loading, setLoading, action, actionRef, setM
); );
}; };
// const renderIntegration = (inData, loginAction, props) => {
// const [visible, setVisible] = useState(false);
// if (inData.length <= 1) {
// return <></>
// }
// let choiceOne = inData?.find(function (a) {
// return a.url?.indexOf(window?.globalConfig?.client) >= 0
// })
// //切换集成站点
// const checkIntegration = (val, loginAction, props) => {
// if (val.subType == '外链') {
// window.open(val.url, "_blank");
// } else {
// let cli = val.url?.indexOf('client=') >= 0 ? val.url.split('client=')[1] : '';
// const config = props.global;
// config.uiwidgets = [];
// config.widgets = [];
// config.allWidgets = [];
// if (cli) {
// config.client = cli;
// }
// props.instance && props.instance.updateConfig(config);
// loginAction && loginAction.getUserInfoAndConfig('', true, val.type, cli);
// // props.history.push(`/?client=${cli}`);
// // props.updateCurrentIndex(0);
// // defaultApp();
// }
// }
// return (
// <>
// <Popover
// placement="bottomLeft"
// trigger="click"
// visible={visible}
// content={
// <div className={layoutStyles.integrationList}>
// {
// inData && inData.map((val) => (
// <p onClick={() => checkIntegration(val, loginAction, props)}>{val.name}</p>
// ))
// }
// </div>
// }
// arrowPointAtCenter
// overlayClassName={classNames(layoutStyles.stationsWrapper, layoutStyles.stationsTop2)}
// onVisibleChange={visible => setVisible(visible)}
// >
// {inData.length > 1 ? (
// <div className={layoutStyles.toggleSite}>
// <img src={require('../assets/basic/site.png')} className={layoutStyles.site} />
// <span className={layoutStyles.name}>{choiceOne?.name ?? ''}</span>
// <ArrowIcon
// className={layoutStyles.arrow}
// style={{
// transform: !visible ? `rotate(0deg)` : `rotate(180deg)`,
// }}
// />
// </div>
// ) : null}
// </Popover>
// </>
// )
// }
// import defaultProps from '../defaultProps'; // import defaultProps from '../defaultProps';
const pickRoutes = memoized((routes, pathname, locale) => { const pickRoutes = memoized((routes, pathname, locale) => {
const matches = matchRoutes(routes, { pathname }); const matches = matchRoutes(routes, { pathname });
...@@ -255,12 +329,16 @@ const Layout = props => { ...@@ -255,12 +329,16 @@ const Layout = props => {
const [menuLoading, setMenuLoading] = useState(true); const [menuLoading, setMenuLoading] = useState(true);
const [subLoading, setSubLoading] = useState(true); const [subLoading, setSubLoading] = useState(true);
const [initWebContent, setInitWebContent] = useState(false); const [initWebContent, setInitWebContent] = useState(false);
const [integrationData, setIntegrationData] = useState([]);
const [loginAction, setAction] = useState(() => new LoginAction(props));
// const [settings, setSetting] = useState({}); // const [settings, setSetting] = useState({});
// const [routeConfig, setRouteConfig] = useState(null); // const [routeConfig, setRouteConfig] = useState(null);
// const [matchPath, setMatchPath] = useState(''); // const [matchPath, setMatchPath] = useState('');
const actionRef = useRef(); const actionRef = useRef();
const history = useHistory(); const history = useHistory();
const location = useLocation(); const location = useLocation();
const [visible, setVisible] = useState(false);
const [integrationLoading, setIntegrationLoading] = useState(false);
const { routeConfig = {}, matchPath } = pickRoutes(props.flatMenu, location.pathname); const { routeConfig = {}, matchPath } = pickRoutes(props.flatMenu, location.pathname);
// useEffect(() => { // useEffect(() => {
...@@ -318,11 +396,28 @@ const Layout = props => { ...@@ -318,11 +396,28 @@ const Layout = props => {
}, [cityData, props.global, props.global.userInfo, siteAction]); }, [cityData, props.global, props.global.userInfo, siteAction]);
useEffect(() => { useEffect(() => {
if (window?.globalConfig?.isIntegration >= 1) {
GetIntegrationConfig();
}
window.share.event.on('updateSite', res => { window.share.event.on('updateSite', res => {
setCityData(res); setCityData(res);
}); });
const handleToggleIndustry = event => {
setVisible(false);
setIntegrationLoading(false);
props.history.push(`/?client=${window.globalConfig.homepage.client}`);
props.updateCurrentIndex(0);
defaultApp();
};
if (window?.globalConfig?.isIntegration >= 1) {
loginAction.events.on('toggleIndustry', handleToggleIndustry);
}
return () => { return () => {
window.share.event.removeAllListeners('updateSite'); window.share.event.removeAllListeners('updateSite');
loginAction.events.removeListener('toggleIndustry', handleToggleIndustry);
}; };
}, []); }, []);
...@@ -339,14 +434,35 @@ const Layout = props => { ...@@ -339,14 +434,35 @@ const Layout = props => {
return () => { return () => {
const marks = document.querySelectorAll('.pandawatermark_mask_div'); const marks = document.querySelectorAll('.pandawatermark_mask_div');
if (marks && marks.length) { if (marks && marks.length) {
Array.prototype.forEach.call(marks, function(dom, index) { Array.prototype.forEach.call(marks, function (dom, index) {
document.body.removeChild(dom); document.body.removeChild(dom);
}); });
} }
}; };
}, [props.global.isHaveMark, props.global.userInfo]); }, [props.global.isHaveMark, props.global.userInfo]);
const GetIntegrationConfig = () => {
appService
.GetIntegrationConfig({
type: '集成登录',
userId: window.globalConfig.userInfo?.OID ?? null,
isEnable: true,
})
.then(res => {
const { code, data } = res;
if (code == '0') {
setIntegrationData(data);
} else {
setIntegrationData([]);
}
})
}
const onMenuHeaderClick = event => { const onMenuHeaderClick = event => {
//集成网站
if (window.globalConfig.isIntegration > 1 || integrationData.length > 1) {
// window.qiankunIsCache = false;
history.push('/Industry');
}
// 非云平台不做响应 // 非云平台不做响应
if (!props.global.get('userInfo.site')) return; if (!props.global.get('userInfo.site')) return;
...@@ -417,7 +533,7 @@ const Layout = props => { ...@@ -417,7 +533,7 @@ const Layout = props => {
if (url.indexOf('|') > -1) { if (url.indexOf('|') > -1) {
const params = url.split('|')[1]; const params = url.split('|')[1];
params.split('&').map(function(item) { params.split('&').map(function (item) {
return (ret[item.split('=')[0]] = item.split('=')[1]); return (ret[item.split('=')[0]] = item.split('=')[1]);
}); });
return ret; return ret;
...@@ -432,6 +548,112 @@ const Layout = props => { ...@@ -432,6 +548,112 @@ const Layout = props => {
} }
return false; return false;
}; };
//渲染集成站点切换弹框
const renderIntegration = (inData, loginAction, props) => {
if (inData.length <= 1) {
return <></>
}
let choiceOne = inData?.find(function (a) {
return a.url?.indexOf(window?.globalConfig?.client) >= 0
})
//切换集成站点
const checkIntegration = (val, loginAction, props) => {
if (val.subType == '外链') {
window.open(val.url, "_blank");
} else {
let cli = val.url?.indexOf('client=') >= 0 ? val.url.split('client=')[1] : '';
setIntegrationLoading(true);
const config = props.global;
config.uiwidgets = [];
config.widgets = [];
config.allWidgets = [];
if (cli) {
config.client = cli;
}
props.instance && props.instance.updateConfig(config);
loginAction && loginAction.getUserInfoAndConfig('', true, val.type, cli);
// props.history.push(`/?client=${cli}`);
// props.updateCurrentIndex(0);
// defaultApp();
}
}
return (
<>
<Popover
placement="bottomLeft"
trigger="click"
visible={visible}
content={
<div className={layoutStyles.integrationList}>
{
<Loading loading={integrationLoading} />
}
{
inData && inData.map((val) => (
<p onClick={() => checkIntegration(val, loginAction, props)}>{val.name}</p>
))
}
</div>
}
arrowPointAtCenter
overlayClassName={classNames(layoutStyles.stationsWrapper, layoutStyles.stationsTop2)}
onVisibleChange={visible => setVisible(visible)}
>
{inData.length > 1 ? (
<div className={layoutStyles.toggleSite}>
<img src={require('../assets/basic/site.png')} className={layoutStyles.site} />
<span className={layoutStyles.name}>{choiceOne?.name ?? ''}</span>
<ArrowIcon
className={layoutStyles.arrow}
style={{
transform: !visible ? `rotate(0deg)` : `rotate(180deg)`,
}}
/>
</div>
) : null}
</Popover>
</>
)
}
// 菜单比对方法
const querySkipUrl = (data, url) => {
let res = null;
// eslint-disable-next-line no-plusplus
for (let i = 0; i < data.length; i++) {
if (url.indexOf(data[i].url) > -1) {
res = data[i];
return data[i];
}
if (data[i].widgets && data[i].widgets.length > 0) {
res = querySkipUrl(data[i].widgets, url);
}
if (res) break;
}
return res;
};
// 功能访问记录
const menuJumpLogs = data => {
const { pathname = '' } = data;
const pathList = querySkipUrl(window?.globalConfig?.widgets || [], pathname);
if (pathname && pathList) {
appService.pvLogs({
origin: window.location.origin,
client: window?.globalConfig.client,
site: window?.globalConfig?.userInfo?.site || '',
widgetUrl: pathList?.url || '',
widgetRoute: pathList?.widgetId || '',
widgetName: pathList?.label || '',
isHomepage: 'false',
userName: window?.globalConfig?.userInfo?.fullName || '',
});
}
};
return ( return (
<SecurityLayout {...props}> <SecurityLayout {...props}>
<BasicLayout <BasicLayout
...@@ -455,7 +677,12 @@ const Layout = props => { ...@@ -455,7 +677,12 @@ const Layout = props => {
logo={logo} logo={logo}
topMenuActiveKey={Number(sessionStorage.getItem(currentProduct)) || 0} topMenuActiveKey={Number(sessionStorage.getItem(currentProduct)) || 0}
rightContentRender={() => <RightContent />} rightContentRender={() => <RightContent />}
onPageChange={() => { onPageChange={data => {
try {
menuJumpLogs(data);
} catch (err) {
// console.log(err);
}
// if(!props.global.token) { // if(!props.global.token) {
// history.push('/user/login') // history.push('/user/login')
// } // }
...@@ -467,6 +694,10 @@ const Layout = props => { ...@@ -467,6 +694,10 @@ const Layout = props => {
popupOffset: [0, 15], popupOffset: [0, 15],
}} }}
headerSiteRender={() => headerSiteRender={() =>
window?.globalConfig?.isIntegration >= 1
?
renderIntegration(integrationData, loginAction, props)
:
renderSite({ renderSite({
data: cityData, data: cityData,
config: props.global, config: props.global,
...@@ -525,6 +756,7 @@ const mapStateToProps = state => ({ ...@@ -525,6 +756,7 @@ const mapStateToProps = state => ({
global: state.getIn(['global', 'globalConfig']), global: state.getIn(['global', 'globalConfig']),
menu: state.getIn(['global', 'menu']), menu: state.getIn(['global', 'menu']),
flatMenu: state.getIn(['global', 'flatMenu']), flatMenu: state.getIn(['global', 'flatMenu']),
instance: state.getIn(['global', 'instance']),
currentMenuIndex: state.getIn(['global', 'currentMenuIndex']), currentMenuIndex: state.getIn(['global', 'currentMenuIndex']),
}); });
const mapDispatchToProps = dispatch => ({ const mapDispatchToProps = dispatch => ({
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
padding-left: 16px; padding-left: 16px;
padding-right: 16px; padding-right: 16px;
cursor: pointer; cursor: pointer;
margin-top: 3px;
// transition: all .3s; // transition: all .3s;
.site { .site {
width: 16px; width: 16px;
...@@ -347,6 +348,21 @@ ...@@ -347,6 +348,21 @@
} }
} }
.integrationList{
display: flex;
position: relative;
}
.integrationList p{
margin: 0 10px;
cursor: pointer;
color: #40a9ff;
}
.integrationList p:hover{
color: #096dd9;
}
.stationsTop2{
padding-top: 0!important;
}
.stationsWrapper { .stationsWrapper {
padding: 20px 10px 0 10px; padding: 20px 10px 0 10px;
max-width: 520px; max-width: 520px;
...@@ -359,6 +375,14 @@ ...@@ -359,6 +375,14 @@
} }
} }
} }
&.stationsTop {
top: 34px!important;
:global {
.ant-popover-arrow {
display: none;
}
}
}
.focusStations { .focusStations {
display: block; display: block;
// padding: 5px 0px; // padding: 5px 0px;
......
...@@ -4,13 +4,16 @@ import SecurityLayout from '@/layouts/SecurityLayout'; ...@@ -4,13 +4,16 @@ import SecurityLayout from '@/layouts/SecurityLayout';
import { appService } from '@/api'; import { appService } from '@/api';
import { SERVICE_INTERFACE_SUCCESS_CODE } from '@/constants'; import { SERVICE_INTERFACE_SUCCESS_CODE } from '@/constants';
import PandaBootPage from './panda'; import PandaBootPage from './panda';
import IntegrationPage from './integration';
const systemItemName = '引导页模板'; // 系统配置项名称 const systemItemName = '引导页模板'; // 系统配置项名称
const BootPageTemplate = { const BootPageTemplate = {
default: PandaBootPage, default: PandaBootPage,
}; integration: IntegrationPage
};
let first = true;
const BootPage = props => { const BootPage = props => {
const [info, setInfo] = useState({ const [info, setInfo] = useState({
first: true, first: true,
...@@ -18,9 +21,23 @@ const BootPage = props => { ...@@ -18,9 +21,23 @@ const BootPage = props => {
error: false, error: false,
}); });
const [template, setTemplate] = useState('default'); const [template, setTemplate] = useState('default');
const RenderComponent = useMemo(() => BootPageTemplate[template] || BootPageTemplate.default, [template]);
const RenderComponent = useMemo(() => {
if (window?.globalConfig?.isIntegration >= 1 && first) {
first = false;
//集成登录
return BootPageTemplate.integration
} else {
//云平台
return BootPageTemplate[template] || BootPageTemplate.default
}
}, [template]);
useEffect(() => { useEffect(() => {
if (window?.globalConfig?.isIntegration >= 1) {
setInfo({ first: false, loading: false, error: false });
return false;
}
appService appService
.sysConfiguration({ .sysConfiguration({
moduleName: systemItemName, moduleName: systemItemName,
......
/* eslint-disable global-require */
// 集成登录引导页
import React, { useCallback, useEffect, useMemo, useState, useRef } from 'react';
import { notification } from 'antd';
import classNames from 'classnames';
import { connect } from 'react-redux';
import { useDocumentTitle } from '@ant-design/pro-utils';
import defaultSetting from '@wisdom-utils/components/lib/AppLayout/layouts/defaultSettings';
import { actionCreators } from '@/containers/App/store';
import LoginAction from '@/pages/user/login/login';
import { defaultApp } from '@/micro';
import { appService } from '@/api';
import { SERVICE_INTERFACE_SUCCESS_CODE } from '@/constants';
import styles from './index.less';
const Integration = props => {
const dataRef = useRef();
const [percentBottom, setPercentBottom] = useState(-40);
const [currentType, setCurrentType] = useState('');
const [scale, setScale] = useState(1);
const [loginAction, setAction] = useState(() => new LoginAction(props));
const [num, setNum] = useState(0);
const [dataList, setDataList] = useState([]);
const [client, setClient] = useState('');
const handlePage = (item, loginAction) => {
let count = 1;
setPercentBottom(-40 + Math.ceil(Math.random() * 8 * count));
process.current = setInterval(() => {
setTimeout(() => {
const perBottom = -40 + 8 * count + Math.ceil(Math.random() * 8);
const perNum = 10 * count + Math.ceil(Math.random() * 10);
if (perNum >= 80 || dataRef.current >= 80 || count === 10) {
return clearInterval(process.current);
}
setPercentBottom(perBottom);
count += 1;
}, 0);
}, 3000);
if (item.subType == '外链') {
window.open(item.url, "_blank");
} else {
let cli = item.url?.indexOf('client=') >= 0 ? item.url.split('client=')[1] : '';
setClient(cli);
setCurrentType(item.name);
const config = props.global;
config.uiwidgets = [];
config.widgets = [];
config.allWidgets = [];
if (cli) {
config.client = cli
}
props.instance && props.instance.updateConfig(config);
loginAction && loginAction.getUserInfoAndConfig('', true, item.type, cli);
}
};
useEffect(() => {
const handleToggleIndustry = event => {
setPercentBottom(38);
clearInterval(process.current);
props.history.push(`/?client=${client ? client : props.global.client}`);
props.updateCurrentIndex(0);
defaultApp();
};
loginAction.events.on('toggleIndustry', handleToggleIndustry);
return () => {
loginAction.events.removeListener('toggleIndustry', handleToggleIndustry);
};
}, [loginAction.events, props, currentType]);
//获取集成站点数据
useEffect(() => {
appService
.GetIntegrationConfig({
type: '集成登录',
userId: window.globalConfig.userInfo?.OID ?? null,
isEnable: true,
})
.then(res => {
const { code, data } = res;
if (code !== SERVICE_INTERFACE_SUCCESS_CODE) {
notification.error({ message: '提示', duration: 3, description: '集成站点配置错误' });
return;
} else {
setNum(data.length);
setDataList(data);
const config = props.global;
config.isIntegration = data.length;
props.updateConfig && props.updateConfig(config);
if (data.length == 1) {
handlePage(data[0], loginAction)
}
}
})
.catch(err => {
notification.error({ message: '提示', duration: 3, description: '集成站点配置错误' });
});
}, [props.global.token]);
return (
<div className={styles.bootPage}>
<div className={styles.bootPageMain}>
<header className={styles.bootPageHead}>
<img src={require(`@/assets/bootPage/熊猫图标.png`)} />
<div className={styles.bootPageTitle}>
<span className={styles.bootPageZh}>熊猫智慧水务一体化解决方案</span>
<span className={styles.bootPageEn}>Panda Smart Water Integration Platform & Solution</span>
</div>
</header>
<section className={classNames(styles.bootPageSection, 'animate__fadeInDown', 'animate__animated', 'duration-500ms')} >
<ul className={classNames(styles.bootPageUl, 'animate__animated')}
style={{ transform: `scale(${scale})`, left: '300px', bottom: '105px', opacity: 1, width: num === 5 ? 960 : num === 9 || num === 10 ? 1600 : 1280, }} >
{dataList.length > 1 ? dataList.map(item => (
<li className={styles.bootPageLi} key={item.name} onClick={event => handlePage(item, loginAction)} >
<div className={styles.bootPageList}>
<div className={styles.listMain}>
{/* <img src={require(`@/assets/bootPage/供水.png`)} alt="" /> */}
<img src={window.location.origin + '/' + (item.icon ? item.icon : 'center/images/科技风/二供.png')} alt="" />
<span className={styles.bootPageName}>{item.name}</span>
</div>
</div>
{currentType === item.name && (
<div className={styles.bootProgress}>
<div className={styles.inner} style={{ bottom: percentBottom }}>
<svg className={styles.wave} xmlns="http://www.w3.org/2000/svg" xmlnsXlink="http://www.w3.org/1999/xlink" viewBox="0 24 150 68" preserveAspectRatio="none" >
<defs>
<path id="gentle-wave" d="M-160 44c30 0 58-18 88-18s 58 18 88 18 58-18 88-18 58 18 88 18 v44h-352z" />
</defs>
<g className={styles.parallax}>
<use xlinkHref="#gentle-wave" x="50" y="0" fill={'rgb(16,104,239)'} opacity="0.1" />
<use xlinkHref="#gentle-wave" x="50" y="-1" fill={'rgb(16,104,239)'} opacity="0.2" />
</g>
</svg>
</div>
</div>
)}
</li>
),
) : ''}
</ul>
</section>
</div>
</div>
);
};
const mapStateToProps = state => ({
global: state.getIn(['global', 'globalConfig']),
instance: state.getIn(['global', 'instance']),
});
const mapDispatchToProps = dispatch => ({
updateConfig(config) {
dispatch(actionCreators.getConfig(config));
},
createContext(data) {
dispatch(actionCreators.createContext(data));
},
updateCurrentIndex(index) {
dispatch(actionCreators.updateCurrentIndex(index));
},
});
export default connect(
mapStateToProps,
mapDispatchToProps,
)(Integration);
@import '~antd/es/style/themes/default.less';
@-webkit-keyframes move {
0% {
-webkit-transform: translate(-90px, 0%);
transform: translate(-90px, 0%);
}
100% {
-webkit-transform: translate(85px, 0%);
transform: translate(85px, 0%);
}
}
@keyframes move {
0% {
-webkit-transform: translate(-90px, 0%);
transform: translate(-90px, 0%);
}
100% {
-webkit-transform: translate(85px, 0%);
transform: translate(85px, 0%);
}
}
.bootPage {
width: 100%;
height: 100%;
position: relative;
overflow: hidden;
background: url('https://panda-water.cn/web4/assets/images/bootPage/背景.jpg') no-repeat top center;
background-size: cover;
.bootPageMain {
display: flex;
align-items: center;
flex-direction: column;
height: 100%;
width: 100%;
.bootPageHead {
height: 150px;
display: flex;
align-items: center;
justify-content: center;
color: #ffffff;
flex: none;
padding-top: 50px;
.bootPageTitle {
display: flex;
flex-direction: column;
margin-left: 20px;
.bootPageZh,
.bootPageEn {
font-weight: 500;
}
.bootPageZh {
font-size: 34px;
letter-spacing: 5px;
}
.bootPageEn {
font-size: 16px;
font-family: -webkit-body;
letter-spacing: 1px;
}
}
}
.bootPageSection {
display: flex;
align-items: center;
justify-content: center;
flex: 1;
height: calc(100% - 160px);
margin: 20px 0;
&::-webkit-scrollbar {
width: 0px;
height: 0px;
}
.bootPageUl {
display: flex;
width: 1280px;
flex-wrap: wrap;
justify-content: center;
list-style: none;
transition: all .5s ease-out;
margin-top: -120px;
.bootPageLi {
position: relative;
width: 298px;
height: 268.8px;
margin: 10px;
&:hover {
.listMain {
transform: scale(1.1);
}
.bootProgress {
transform: scale(1.1);
bottom: -10px;
}
}
.bootPageList {
width: 100%;
height: 100%;
border-radius: 4px;
transition: all .2s ease-out;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
font-size: 24px;
cursor: pointer;
position: relative;
span {
margin-top: 20px;
font-weight: 500;
color: #fff;
}
.listMain {
transition: all 0.2s ease-out;
display: flex;
align-items: center;
flex-direction: column;
background: url('@/assets/bootPage/bg.png');
background-size: 100%;
background-repeat: no-repeat;
padding: 30px 54px 48px 43px;
img {
// width: 298px;
// height: 269px;
width: 110px;
height: 110px;
border-radius: 20px;
vertical-align: middle;
}
span {
font-weight: 500;
color: #fff;
}
.bootPageName {
// position: absolute;
// bottom: 31px;
font-weight: 500;
font-size: 22px;
margin-top: -4px;
}
.bootPageNameEng {
font-size: 14px;
position: absolute;
bottom: 11px;
}
}
}
}
&.bootPageUl_5 {
width: 960px;
}
&.bootPageUl_9,
&.bootPageUl_10 {
width: 1600px;
}
}
}
}
.abs {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.cloudMonitorBtns {
position: fixed;
height: 120px;
width: 100%;
bottom: 0px;
padding: 0 20px;
display: flex;
justify-content: end;
:global {
.cloud-using-anaylysis-btn {
cursor: pointer;
width: 100px;
display: flex;
flex-direction: column;
justify-content: center;
&>img {
width: 50px;
margin: 0 25px;
}
&>span {
color: #fff;
font-size: 14px;
width: 100%;
text-align: center;
}
}
}
}
:global {
.@{ant-prefix}-spin-nested-loading,
.@{ant-prefix}-spin-container {
height: 100%;
}
}
.bootProgress {
transition: all .2s ease-out;
position: absolute;
height: 80px;
margin: 0;
width: 100%;
border-radius: 0 0 14% 14%;
overflow: hidden;
bottom: 0px;
}
.bootProgress .inner {
transition: all .2s ease-out;
position: absolute;
height: 100%;
width: 100%;
bottom: 10%;
}
.bootProgress .wave {
display: block;
width: 100%;
height: 10em;
max-height: 100vh;
margin: 0;
}
.bootProgress .wave .parallax>use {
animation: move 2s linear infinite;
}
.bootProgress .wave .parallax>use:nth-child(2) {
animation-delay: -0.1s;
}
}
@media screen and (max-width: 1440px) {
.bootPage {
.bootPageHead {
.bootPageZh {
font-size: 26px;
}
.bootPageEn {
font-size: 12px;
}
}
}
}
@media screen and (min-width: 1440px) and (max-width: 1600px) {
.bootPage {
.bootPageHead {
.bootPageZh {
font-size: 30px;
}
.bootPageEn {
font-size: 14px;
}
}
}
}
\ No newline at end of file
...@@ -269,18 +269,18 @@ class Login { ...@@ -269,18 +269,18 @@ class Login {
} }
}); });
} }
if ( // eslint-disable-next-line prettier/prettier
!flag && if (!flag && this.isSignIn && this.globalConfig.userInfo.Industries.length && this.globalConfig.userInfo.Industries.length > 1) {
this.isSignIn &&
this.globalConfig.userInfo.Industries.length &&
this.globalConfig.userInfo.Industries.length > 1
) {
this.createContext(this); this.createContext(this);
// console.log('云平台');
this.updateConfig && this.updateConfig(this.globalConfig); this.updateConfig && this.updateConfig(this.globalConfig);
this.history.push('/industry'); this.history.push('/industry');
return false; return false;
} }
// 跳转到集成登录引导页_xule_2023-08-28
if (!flag && this.isSignIn && this.globalConfig.isIntegration >= 1) {
this.history.push('/industry');
return false;
}
this.initGateWay(token, getIndustry); this.initGateWay(token, getIndustry);
} }
...@@ -293,7 +293,7 @@ class Login { ...@@ -293,7 +293,7 @@ class Login {
.getWateWayConfig(gateWayParam) .getWateWayConfig(gateWayParam)
.then(res => { .then(res => {
// eslint-disable-next-line prettier/prettier, no-undef // eslint-disable-next-line prettier/prettier, no-undef
const hasGateWay =!res || !res.data? false: _.isString(res.data)? JSON.parse(res.data): typeof res.data === 'boolean'? res.data: false; const hasGateWay = !res || !res.data ? false : _.isString(res.data) ? JSON.parse(res.data) : typeof res.data === 'boolean' ? res.data : false;
self.globalConfig.hasGateWay = hasGateWay; self.globalConfig.hasGateWay = hasGateWay;
self.globalConfig.apiGatewayDomain = `${window.location.origin}${hasGateWay ? '/PandaCore/GateWay' : ''}`; self.globalConfig.apiGatewayDomain = `${window.location.origin}${hasGateWay ? '/PandaCore/GateWay' : ''}`;
if (hasGateWay) { if (hasGateWay) {
...@@ -337,6 +337,7 @@ class Login { ...@@ -337,6 +337,7 @@ class Login {
noticeService.getMqttSiteCode({ 'request.preventCache': Date.now() }), noticeService.getMqttSiteCode({ 'request.preventCache': Date.now() }),
getWebSiteConfig({ getWebSiteConfig({
client: self.globalConfig.client, client: self.globalConfig.client,
// client: window.globalConfig.client,
token, token,
'request.preventCache': Date.now(), 'request.preventCache': Date.now(),
}), }),
...@@ -430,6 +431,11 @@ class Login { ...@@ -430,6 +431,11 @@ class Login {
hideFeedback, hideFeedback,
// mapsettings: config.mapsettings // mapsettings: config.mapsettings
}); });
if (this.globalConfig?.isIntegration >= 1) {
self.updateConfig && self.updateConfig(self.globalConfig);
}
self.getProjectItems().then(res => { self.getProjectItems().then(res => {
window.subSysCfg = {}; window.subSysCfg = {};
self.globalConfig = Object.assign(self.globalConfig, { self.globalConfig = Object.assign(self.globalConfig, {
...@@ -452,6 +458,8 @@ class Login { ...@@ -452,6 +458,8 @@ class Login {
self.globalConfig.userInfo.site && self.globalConfig.userInfo.site &&
self.globalConfig.userInfo.site.length > 0 self.globalConfig.userInfo.site.length > 0
) { ) {
// 云模式关闭缓存
window.qiankunIsCache = false;
// eslint-disable-next-line no-undef,no-underscore-dangle // eslint-disable-next-line no-undef,no-underscore-dangle
getWebSiteConfig( getWebSiteConfig(
{ {
...@@ -500,6 +508,9 @@ class Login { ...@@ -500,6 +508,9 @@ class Login {
// if (mainConf.productType) // if (mainConf.productType)
// self.globalConfig.productType = mainConf.productType; // self.globalConfig.productType = mainConf.productType;
} }
if (this.globalConfig?.isIntegration >= 1) {
self.updateConfig && self.updateConfig(self.globalConfig);
}
this.isOpenYanshi(self, getIndustry); this.isOpenYanshi(self, getIndustry);
}); });
} else { } else {
...@@ -921,11 +932,20 @@ class Login { ...@@ -921,11 +932,20 @@ class Login {
}); });
} }
getUserInfoAndConfig(failCallback, flag, industry) { getUserInfoAndConfig(failCallback, flag, industry, client) {
const { token: tk } = this.globalConfig; const { token: tk } = this.globalConfig;
const token = tk || Cookies.get('token'); const token = tk || Cookies.get('token');
const site = Cookies.get('site'); const site = Cookies.get('site');
const self = this; const self = this;
if (client) {
self.globalConfig.client = client;
Cookies.set('client', client, {
expires: 86400000 / (24 * 60 * 60 * 1000),
path: '/',
});
sessionStorage.setItem('client', client);
}
/* eslint-disable */ /* eslint-disable */
let _industrySite = null; let _industrySite = null;
if (industry) { if (industry) {
...@@ -1217,6 +1237,7 @@ class Login { ...@@ -1217,6 +1237,7 @@ class Login {
message.error('登录服务异常'); message.error('登录服务异常');
}); });
} }
phoneLoginFormHandler(userPhone, captcha) { phoneLoginFormHandler(userPhone, captcha) {
this.login('', '', userPhone, '', SERVICE_APP_LOGIN_MODE.phone); this.login('', '', userPhone, '', SERVICE_APP_LOGIN_MODE.phone);
} }
......
@font-face {
font-family: PingFang SC;
src: url('@/assets/fonts/PingFang.ttf');
}
.lvchenglogin { .lvchenglogin {
width: 100%; width: 100%;
height: 100%; height: 100%;
...@@ -85,7 +80,6 @@ ...@@ -85,7 +80,6 @@
.title-name { .title-name {
font-size: 36px; font-size: 36px;
font-family: PingFang SC;
font-weight: 500; font-weight: 500;
color: #000000; color: #000000;
text-shadow: 0px 1px 5px rgba(6, 27, 54, 0.8); text-shadow: 0px 1px 5px rgba(6, 27, 54, 0.8);
...@@ -207,7 +201,6 @@ ...@@ -207,7 +201,6 @@
.cn-title { .cn-title {
font-size: 28px; font-size: 28px;
font-family: PingFang SC;
font-weight: 400; font-weight: 400;
color: #FFFFFF; color: #FFFFFF;
} }
......
...@@ -45,7 +45,7 @@ function getStyle(prefixCls, theme) { ...@@ -45,7 +45,7 @@ function getStyle(prefixCls, theme) {
`.trim(); `.trim();
} }
const registerTheme = function(prefixCls, theme) { const registerTheme = function (prefixCls, theme) {
const style = getStyle(prefixCls, theme); const style = getStyle(prefixCls, theme);
if (canUseDom()) { if (canUseDom()) {
updateCSS(style, `${dynamicStyleMark}-dynamic-theme`); updateCSS(style, `${dynamicStyleMark}-dynamic-theme`);
...@@ -139,6 +139,10 @@ export const AppInitState = () => { ...@@ -139,6 +139,10 @@ export const AppInitState = () => {
} else { } else {
localStorage.removeItem('password_pwdRegexTip'); localStorage.removeItem('password_pwdRegexTip');
} }
if (data.webState === '1' || data.webState === '3') {
data.isIntegration = '1';
}
store.dispatch( store.dispatch(
actionCreators.getConfig( actionCreators.getConfig(
Object.assign( Object.assign(
...@@ -229,7 +233,7 @@ export const AppInitState = () => { ...@@ -229,7 +233,7 @@ export const AppInitState = () => {
// 语音播报全局拦截 // 语音播报全局拦截
const initMessageVoice = () => { const initMessageVoice = () => {
const rawSpeak = window.speechSynthesis.speak; const rawSpeak = window.speechSynthesis.speak;
window.speechSynthesis.speak = function(...args) { window.speechSynthesis.speak = function (...args) {
if ( if (
window.globalConfig && window.globalConfig &&
// eslint-disable-next-line no-prototype-builtins // eslint-disable-next-line no-prototype-builtins
...@@ -256,9 +260,9 @@ export const AppInitState = () => { ...@@ -256,9 +260,9 @@ export const AppInitState = () => {
return true; return true;
}; };
store.subscribe( store.subscribe(
(function() { (function () {
const preVariableTheme = store.getState().toJS().global?.globalConfig?.variableTheme; const preVariableTheme = store.getState().toJS().global?.globalConfig?.variableTheme;
return function() { return function () {
// if (!preVariableTheme) // if (!preVariableTheme)
const variableTheme = store.getState().toJS().global?.globalConfig?.variableTheme; const variableTheme = store.getState().toJS().global?.globalConfig?.variableTheme;
if (!hasThemeChanged(preVariableTheme, variableTheme)) return false; if (!hasThemeChanged(preVariableTheme, variableTheme)) return false;
......
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