Commit 7221a837 authored by 崔佳豪's avatar 崔佳豪

Merge branch 'master' into dev

parents 0df0818d 89c0da7c
Pipeline #66528 waiting for manual action with stages
...@@ -107,16 +107,16 @@ ...@@ -107,16 +107,16 @@
"@babel/runtime": "^7.10.5", "@babel/runtime": "^7.10.5",
"@esri/calcite-colors": "6.0.3", "@esri/calcite-colors": "6.0.3",
"@wisdom-cesium/cesium": "^1.1.6", "@wisdom-cesium/cesium": "^1.1.6",
"@wisdom-cesium/krpano": "^1.0.29-2", "@wisdom-cesium/krpano": "1.0.29-17",
"@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.42", "@wisdom-map/amap": "1.1.0-beta.47",
"@wisdom-map/arcgismap": "1.4.0-88", "@wisdom-map/arcgismap": "1.4.0-114",
"@wisdom-map/basemap": "1.1.0-18", "@wisdom-map/basemap": "1.1.0-20",
"@wisdom-map/util": "^1.0.28-0", "@wisdom-map/util": "^1.0.28-0",
"@wisdom-utils/components": "0.1.283", "@wisdom-utils/components": "0.1.286",
"@wisdom-utils/runtime": "0.0.38", "@wisdom-utils/runtime": "0.0.38",
"@wisdom-utils/utils": "0.1.323", "@wisdom-utils/utils": "0.1.326",
"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",
......
...@@ -314,7 +314,7 @@ class NoticeIconView extends Component { ...@@ -314,7 +314,7 @@ class NoticeIconView extends Component {
this.renderSysPlatform(message); this.renderSysPlatform(message);
}; };
handlerUnknowDetail = message => { handlerUnknowDetail = (message, type) => {
// 需要有跳转路径 // 需要有跳转路径
if (!message.webPath) if (!message.webPath)
return notification.info({ message: '提示', duration: 3, description: '未配置跳转路径' }); return notification.info({ message: '提示', duration: 3, description: '未配置跳转路径' });
...@@ -343,6 +343,9 @@ class NoticeIconView extends Component { ...@@ -343,6 +343,9 @@ class NoticeIconView extends Component {
} }
params._source = '消息通知'; params._source = '消息通知';
params._target = message.webPath; params._target = message.webPath;
if (type) {
if (/civweb4/.test(targetMenuPath)) return true;
}
sessionStorage.setItem('routerParams', JSON.stringify(params)); sessionStorage.setItem('routerParams', JSON.stringify(params));
window.history.pushState(params, '', `/civbase/${targetMenuPath}?v=${Date.now()}`); window.history.pushState(params, '', `/civbase/${targetMenuPath}?v=${Date.now()}`);
} }
......
import React, { import React, { useRef, useState } from 'react';
useRef,
useState,
} from 'react';
import { import { message, Popover } from 'antd';
message,
Popover,
} from 'antd';
import _ from 'lodash'; import _ from 'lodash';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import Icon from '@ant-design/icons'; import Icon from '@ant-design/icons';
import { import { AvatarDropdown as Avatar, useIntl } from '@wisdom-utils/components';
AvatarDropdown as Avatar,
useIntl,
} from '@wisdom-utils/components';
import HeaderSearch from '@wisdom-utils/components/lib/layout/components/HeaderSearch'; import HeaderSearch from '@wisdom-utils/components/lib/layout/components/HeaderSearch';
import { useHistory } from '@wisdom-utils/runtime'; import { useHistory } from '@wisdom-utils/runtime';
...@@ -112,7 +103,7 @@ const GlobalHeaderRight = props => { ...@@ -112,7 +103,7 @@ const GlobalHeaderRight = props => {
const handleFeedback = event => { const handleFeedback = event => {
event.stopPropagation(); event.stopPropagation();
window.open(`https://mis.panda-water.cn/feedback/?site_code="${props.global.get('userInfo.site')}`); window.open(`https://work.panda-water.cn/feedback/?site_code=${props.global.get('userInfo.site')}`);
} }
const handlerFavitor = event => { const handlerFavitor = event => {
......
...@@ -42,7 +42,9 @@ const proxy = require('../../../../config/proxy'); ...@@ -42,7 +42,9 @@ const proxy = require('../../../../config/proxy');
const keywordStorage = new Storage(`__global_search_keywords__micro_${window.location.hostname}`); const keywordStorage = new Storage(`__global_search_keywords__micro_${window.location.hostname}`);
const recentVisitedStorage = new Storage(`__global_recent_visited__micro_${window.location.hostname}`); const recentVisitedStorage = new Storage(`__global_recent_visited__micro_${window.location.hostname}`);
const recentProductStorage = new Storage(`__global__recent_product__micro_${window.location.hostname}`); const recentProductStorage = new Storage(`__global__recent_product__micro_${window.location.hostname}`);
const currentProduct = new Store(`__global__recent_productIndex__micro_${window.location.hostname}`); const currentProduct = new Store(
`__global__recent_productIndex__micro_${window.location.hostname}_${sessionStorage.getItem('client') || 'city'}`,
);
Cookies.set('loginMode', Cookies.get('loginMode') || 'pdw'); Cookies.set('loginMode', Cookies.get('loginMode') || 'pdw');
export const initialState = fromJS({ export const initialState = fromJS({
globalConfig: {}, globalConfig: {},
......
...@@ -7,7 +7,9 @@ body, ...@@ -7,7 +7,9 @@ body,
height: 100%; height: 100%;
overflow: hidden; overflow: hidden;
} }
#app {
background: transparent!important;
}
* { * {
margin: 0; margin: 0;
padding: 0; padding: 0;
......
...@@ -17,7 +17,6 @@ export const MESSAGE_TYPE = { ...@@ -17,7 +17,6 @@ export const MESSAGE_TYPE = {
export const NEW_MESSAGE = 'NEW_MESSAGE'; export const NEW_MESSAGE = 'NEW_MESSAGE';
export const USERNAME = 'mao2080'; export const USERNAME = 'mao2080';
export const PASSWORD = '123'; export const PASSWORD = '123';
export const PLATFORM_LEVEL = '4'; export const PLATFORM_LEVEL = '4';
......
import React from 'react'; import React from 'react';
import { Badge, Button, ConfigProvider } from 'antd'; import { Badge, Button, ConfigProvider } from 'antd';
// eslint-disable-next-line import/no-unresolved
import classNames from 'classnames'; import classNames from 'classnames';
import useMergeValue from 'use-merge-value'; import useMergeValue from 'use-merge-value';
...@@ -40,8 +41,8 @@ const messageSvg = () => ( ...@@ -40,8 +41,8 @@ const messageSvg = () => (
/> />
</svg> </svg>
); );
const BellOutlined = (props) => <Icon component={messageSvg} {...props} />; const BellOutlined = props => <Icon component={messageSvg} {...props} />;
const NoticeIcon = (props) => { const NoticeIcon = props => {
const { getPrefixCls } = React.useContext(ConfigProvider.ConfigContext); const { getPrefixCls } = React.useContext(ConfigProvider.ConfigContext);
const prefixCls = props.prefixCls || getPrefixCls(); const prefixCls = props.prefixCls || getPrefixCls();
const btnPrefixCls = `${prefixCls}-head-notifier-button`; const btnPrefixCls = `${prefixCls}-head-notifier-button`;
...@@ -54,14 +55,12 @@ const NoticeIcon = (props) => { ...@@ -54,14 +55,12 @@ const NoticeIcon = (props) => {
} }
const panes = []; const panes = [];
React.Children.forEach(children, (child) => { React.Children.forEach(children, child => {
if (!child) { if (!child) {
return; return;
} }
const { list, title } = child.props; const { list, title } = child.props;
panes.push( panes.push(<NoticeList {...child.props} data={list} key={child} title={title} config={props.config} />);
<NoticeList {...child.props} data={list} key={child} title={title} config={props.config} />,
);
}); });
const childProps = panes.length === 1 ? panes[0].props : { list: [] }; const childProps = panes.length === 1 ? panes[0].props : { list: [] };
return ( return (
...@@ -72,7 +71,9 @@ const NoticeIcon = (props) => { ...@@ -72,7 +71,9 @@ const NoticeIcon = (props) => {
type="link" type="link"
onClick={() => (childProps.list.length > 0 ? confirmRead(true) : null)} onClick={() => (childProps.list.length > 0 ? confirmRead(true) : null)}
disabled={childProps.list.length === 0} disabled={childProps.list.length === 0}
>全部标记已读</Button> >
全部标记已读
</Button>
</div> </div>
{panes} {panes}
{renderFooter && renderFooter()} {renderFooter && renderFooter()}
......
import React from 'react'; import React from 'react';
import { List, Spin, ConfigProvider } from 'antd'; import { List, Spin, ConfigProvider } from 'antd';
// eslint-disable-next-line import/no-unresolved
import classNames from 'classnames'; import classNames from 'classnames';
import './style/list.less'; import './style/list.less';
import { Alarm, Case, Notice, Unknown } from './templates'; import { Alarm, Case, Notice, Unknown } from './templates';
...@@ -11,10 +12,7 @@ const Empty = ({ emptyText, ...props }) => { ...@@ -11,10 +12,7 @@ const Empty = ({ emptyText, ...props }) => {
const prefixCls = props.prefixCls || getPrefixCls(); const prefixCls = props.prefixCls || getPrefixCls();
return ( return (
<div className={`${prefixCls}-notFound`}> <div className={`${prefixCls}-notFound`}>
<img <img src="https://gw.alipayobjects.com/zos/rmsportal/sAuJeJzSKbUmHfBQRzmZ.svg" alt="not found" />
src="https://gw.alipayobjects.com/zos/rmsportal/sAuJeJzSKbUmHfBQRzmZ.svg"
alt="not found"
/>
<div>{emptyText}</div> <div>{emptyText}</div>
</div> </div>
); );
...@@ -113,11 +111,11 @@ class NoticeList extends React.Component { ...@@ -113,11 +111,11 @@ class NoticeList extends React.Component {
switch (item.infoClasses) { switch (item.infoClasses) {
case MESSAGE_TYPE.ALARM_TYPE: case MESSAGE_TYPE.ALARM_TYPE:
messageTemplate = ( messageTemplate = (
<Alarm message={item} confirmRead={this.confirmRead} config={this.props.config} /> <Alarm message={item} confirmRead={this.confirmRead} config={this.props.config} handlerUnknowDetail={this.handlerUnknowDetail} />
); );
break; break;
case MESSAGE_TYPE.CASE_TYPE: case MESSAGE_TYPE.CASE_TYPE:
messageTemplate = <Case message={item} confirmRead={this.confirmRead} />; messageTemplate = <Case message={item} confirmRead={this.confirmRead} handlerUnknowDetail={this.handlerUnknowDetail} />;
break; break;
case MESSAGE_TYPE.SYS_TYPE: case MESSAGE_TYPE.SYS_TYPE:
messageTemplate = ( messageTemplate = (
......
...@@ -12,6 +12,9 @@ class Message { ...@@ -12,6 +12,9 @@ class Message {
webConfig, webConfig,
webPath, webPath,
messType, messType,
defaultContent,
webIcon,
title,
infoClasses infoClasses
} = message) { } = message) {
this.id = id; this.id = id;
...@@ -23,6 +26,9 @@ class Message { ...@@ -23,6 +26,9 @@ class Message {
this.webConfig = webConfig; this.webConfig = webConfig;
this.webPath = webPath; this.webPath = webPath;
this.messType = messType; // 方案名称 - 大类型下细类型 this.messType = messType; // 方案名称 - 大类型下细类型
this.webIcon = webIcon; // 消息图标
this.title = title; // 消息标题
this.defaultContent = defaultContent;
this.infoClasses = infoClasses; this.infoClasses = infoClasses;
} }
} }
...@@ -64,6 +70,9 @@ export const createMessageFromHis = (hisMessage, options = {}) => { ...@@ -64,6 +70,9 @@ export const createMessageFromHis = (hisMessage, options = {}) => {
webConfig: hisMessage.web_config, webConfig: hisMessage.web_config,
webPath: hisMessage.web_path, webPath: hisMessage.web_path,
messType: hisMessage.messType, messType: hisMessage.messType,
defaultContent: (_.isString(hisMessage.defaultContent) && hisMessage.defaultContent.replace(new RegExp(/ /g), "").length > 0) ? hisMessage.defaultContent : null,
webIcon: (_.isString(hisMessage.webIcon) && hisMessage.webIcon.replace(new RegExp(/ /g), "").length > 0) ? hisMessage.webIcon : null,
title: (_.isString(hisMessage.title) && hisMessage.title.replace(new RegExp(/ /g), "").length > 0) ? hisMessage.title : null,
infoClasses, infoClasses,
}; };
return createMessage(template); return createMessage(template);
...@@ -90,9 +99,9 @@ export const createMessageFromReal = (realMesssage, options = {}) => { ...@@ -90,9 +99,9 @@ export const createMessageFromReal = (realMesssage, options = {}) => {
// 2.0 消息 // 2.0 消息
infoContent = JSON.parse(realMesssage.content || '{}'); infoContent = JSON.parse(realMesssage.content || '{}');
} }
const template = { const template = {
id: realMesssage.infoId, id: realMesssage.infoId || realMesssage.ID,
infoContent, infoContent,
time, time,
infoType: realMesssage.infoType, infoType: realMesssage.infoType,
...@@ -100,7 +109,10 @@ export const createMessageFromReal = (realMesssage, options = {}) => { ...@@ -100,7 +109,10 @@ export const createMessageFromReal = (realMesssage, options = {}) => {
dateTime: realMesssage.createTime, dateTime: realMesssage.createTime,
webConfig: realMesssage.web_config, webConfig: realMesssage.web_config,
webPath: realMesssage.web_path, webPath: realMesssage.web_path,
messType: realMesssage.messType, messType: realMesssage.messType || realMesssage.MessType,
defaultContent: (_.isString(realMesssage.defaultContent) && realMesssage.defaultContent.replace(new RegExp(/ /g), "").length > 0) ? realMesssage.defaultContent : null,
webIcon: (_.isString(realMesssage.webIcon) && realMesssage.webIcon.replace(new RegExp(/ /g), "").length > 0) ? realMesssage.webIcon : null,
title: (_.isString(realMesssage.title) && realMesssage.title.replace(new RegExp(/ /g), "").length > 0) ? realMesssage.title : null,
infoClasses, infoClasses,
} }
......
...@@ -351,6 +351,8 @@ class Notifier { ...@@ -351,6 +351,8 @@ class Notifier {
} }
} catch (e) { } catch (e) {
Logger.error(`收到消息处理异常:${e.message}`); Logger.error(`收到消息处理异常:${e.message}`);
} finally {
window?.share?.event?.emit?.('event:messageArrived', buffer);
} }
} }
...@@ -449,8 +451,8 @@ class Notifier { ...@@ -449,8 +451,8 @@ class Notifier {
const alarmType = message?.infoContent?.alarmType; // 报警类型:“状态报警” const alarmType = message?.infoContent?.alarmType; // 报警类型:“状态报警”
const content = message?.infoContent?.alarmContent; // 报警内容:“出水超压报警” const content = message?.infoContent?.alarmContent; // 报警内容:“出水超压报警”
const alarmValue = message?.infoContent?.alarmValue ?? ''; // 报警值 const alarmValue = message?.infoContent?.alarmValue ?? ''; // 报警值
const level = message?.infoLevel !== '1' ? '紧急报警,紧急报警,紧急报警:' : ''
let msg = `紧急报警:${device},${alarmType},${content},报警值:${isString(alarmValue) ? replaceSpeak(alarmValue) :'' },请注意!!!`; let msg = `${level}${device},${alarmType},${content},报警值:${isString(alarmValue) ? replaceSpeak(alarmValue) :'' },请注意!!!`;
this.speak(msg); this.speak(msg);
}; };
speakCase = message => { speakCase = message => {
...@@ -473,12 +475,13 @@ class Notifier { ...@@ -473,12 +475,13 @@ class Notifier {
}; };
speakOther = message => { speakOther = message => {
// 类型区分‘全员公告’ 还是 ‘个人消息’ // 类型区分‘全员公告’ 还是 ‘个人消息’
const type = isEmpty(message.tousers) || parseMessage.tousers === '' ? '公告' : '消息'; const type = message.title ?? (isEmpty(message.tousers) || parseMessage.tousers === '' ? '公告' : '消息');
// 构建语音消息内容 // 构建语音消息内容
const { infoContent, time } = message; const { infoContent, time } = message;
let content = replaceSpeak((infoContent?.content ?? '').replace(/\\n/g, ',')); let content = replaceSpeak((infoContent?.content ?? message.defaultContent ?? '').replace(/\\n/g, ','));
let msg = `您有新的${type}${content.substring(0, content.lastIndexOf(',')).replace(':', ',')} 时间:${time}`; const text = content.substring(0, content.lastIndexOf(',')).replace(':', ',');
let msg = `您有新的${type}${text !== '' ? text : content} 时间:${time}`;
this.speak(msg); this.speak(msg);
}; };
......
import React from 'react'; import React from 'react';
import _ from 'lodash'; import _ from 'lodash';
// eslint-disable-next-line import/no-unresolved
import classNames from 'classnames'; import classNames from 'classnames';
import { findPathByWidget, isJSON } from '@wisdom-utils/components/lib/AppLayout/helpers'; import { findPathByWidget, isJSON } from '@wisdom-utils/components/lib/AppLayout/helpers';
import '../styles/common.less'; import '../styles/common.less';
import './index.less'; import './index.less';
import { ConfigProvider } from 'antd'; import { ConfigProvider } from 'antd';
import { getMessageTypeIcon } from '../../utils';
/* eslint-disable */ /* eslint-disable */
export class AlarmContent { export class AlarmContent {
constructor({ constructor({
...@@ -26,7 +28,7 @@ export class AlarmContent { ...@@ -26,7 +28,7 @@ export class AlarmContent {
} }
} }
const Alarm = ({ message, confirmRead, config }) => { const Alarm = ({ message, confirmRead, config, handlerUnknowDetail }) => {
const { getPrefixCls } = React.useContext(ConfigProvider.ConfigContext); const { getPrefixCls } = React.useContext(ConfigProvider.ConfigContext);
const prefixCls = getPrefixCls(); const prefixCls = getPrefixCls();
...@@ -39,20 +41,22 @@ const Alarm = ({ message, confirmRead, config }) => { ...@@ -39,20 +41,22 @@ const Alarm = ({ message, confirmRead, config }) => {
const alarmThreshold = message?.infoContent?.alarmThreshold; const alarmThreshold = message?.infoContent?.alarmThreshold;
const goPath = (item) => { const goPath = (item) => {
if(handlerUnknowDetail && handlerUnknowDetail(message, 'alarm')) {
const widgetID = 'widget_city_综合运营_管网监控_实时监控_报警监控';
const webPath = 'product/scada/AlertMonitoring/AlertMonitoring';
const widget = findPathByWidget(
'productex/water/IOTMonitor/RealTimeAlarm/RealTimeAlarm',
config.widgets,
'',
'url',
);
window.share.event.emit('listenerMointer', {
widgetId: widgetID,
label: '实时报警',
url: widget.url || webPath,
});
}
confirmRead(false, [message.id]); confirmRead(false, [message.id]);
const widgetID = 'widget_city_综合运营_管网监控_实时监控_报警监控';
const webPath = 'product/scada/AlertMonitoring/AlertMonitoring';
const widget = findPathByWidget(
'productex/water/IOTMonitor/RealTimeAlarm/RealTimeAlarm',
config.widgets,
'',
'url',
);
window.share.event.emit('listenerMointer', {
widgetId: widgetID,
label: '实时报警',
url: widget.url || webPath,
});
}; };
...@@ -62,6 +66,7 @@ const Alarm = ({ message, confirmRead, config }) => { ...@@ -62,6 +66,7 @@ const Alarm = ({ message, confirmRead, config }) => {
className={classNames(`${prefixCls}-notifier-message_scada`, `${prefixCls}-notifier-message-container`)} className={classNames(`${prefixCls}-notifier-message_scada`, `${prefixCls}-notifier-message-container`)}
title="点击查看详情" title="点击查看详情"
onClick={() => goPath(message)} onClick={() => goPath(message)}
style={{ backgroundImage: `url(${getMessageTypeIcon(message)})` }}
> >
<div className={`${prefixCls}-notifier-message-title`}> <div className={`${prefixCls}-notifier-message-title`}>
<span>{alarmType}</span> <span>{alarmType}</span>
......
import React from 'react'; import React from 'react';
import { ConfigProvider } from 'antd'; import { ConfigProvider } from 'antd';
// eslint-disable-next-line import/no-unresolved
import classNames from 'classnames'; import classNames from 'classnames';
import '../styles/common.less'; import '../styles/common.less';
import './index.less'; import './index.less';
import { getMessageTypeIcon } from '../../utils';
// "caseType":"待办工单","flowName":"维修处理流程","nodeName":"审核关单","content":"请迅速到现场处理","time":"2020-11-03 09:11:12" // "caseType":"待办工单","flowName":"维修处理流程","nodeName":"审核关单","content":"请迅速到现场处理","time":"2020-11-03 09:11:12"
export class CaseContent { export class CaseContent {
...@@ -17,7 +19,7 @@ export class CaseContent { ...@@ -17,7 +19,7 @@ export class CaseContent {
} }
} }
const Case = ({ message, confirmRead }) => { const Case = ({ message, confirmRead, handlerUnknowDetail }) => {
const { getPrefixCls } = React.useContext(ConfigProvider.ConfigContext); const { getPrefixCls } = React.useContext(ConfigProvider.ConfigContext);
const prefixCls = getPrefixCls(); const prefixCls = getPrefixCls();
const caseType = message?.infoContent?.caseType; const caseType = message?.infoContent?.caseType;
...@@ -27,34 +29,36 @@ const Case = ({ message, confirmRead }) => { ...@@ -27,34 +29,36 @@ const Case = ({ message, confirmRead }) => {
const content = message?.infoContent?.content; const content = message?.infoContent?.content;
const goPath = item => { const goPath = item => {
confirmRead(false, [message.id]); if (handlerUnknowDetail && handlerUnknowDetail(message, 'case')) {
const messageType = item.messType; const messageType = item.messType;
let label = ''; let label = '';
let widgetID = ''; let widgetID = '';
switch (messageType) { switch (messageType) {
case '任务派发': case '任务派发':
label = '任务派发'; label = '任务派发';
widgetID = 'widget_city_综合运营_二供管理_维修管理_工单办理'; widgetID = 'widget_city_综合运营_二供管理_维修管理_工单办理';
break; break;
case '任务驳回': case '任务驳回':
label = '任务驳回'; label = '任务驳回';
widgetID = 'widget_city_综合运营_二供管理_维修管理_工单办理'; widgetID = 'widget_city_综合运营_二供管理_维修管理_工单办理';
// eslint-disable-next-line no-underscore-dangle,no-case-declarations // eslint-disable-next-line no-underscore-dangle,no-case-declarations
let _tab; let _tab;
// eslint-disable-next-line prefer-const // eslint-disable-next-line prefer-const
_tab = '任务驳回'; _tab = '任务驳回';
break; break;
default: default:
label = '工单办理'; label = '工单办理';
widgetID = 'widget_city_综合运营_二供管理_维修管理_工单办理'; widgetID = 'widget_city_综合运营_二供管理_维修管理_工单办理';
break; break;
}
const webPath = item.webPath || 'product/maintenance/CaseManage/CaseDoingBox/StardCaseDoingBoxView|isDelay=1';
window.share.event.emit('listenerMointer', {
widgetId: widgetID,
label,
url: webPath,
});
} }
const webPath = item.webPath || 'product/maintenance/CaseManage/CaseDoingBox/StardCaseDoingBoxView|isDelay=1'; confirmRead(false, [message.id]);
window.share.event.emit('listenerMointer', {
widgetId: widgetID,
label,
url: webPath,
});
}; };
return ( return (
...@@ -62,6 +66,7 @@ const Case = ({ message, confirmRead }) => { ...@@ -62,6 +66,7 @@ const Case = ({ message, confirmRead }) => {
className={classNames(`${prefixCls}-notifier-message_case`, `${prefixCls}-notifier-message-container`)} className={classNames(`${prefixCls}-notifier-message_case`, `${prefixCls}-notifier-message-container`)}
title="点击查看详情" title="点击查看详情"
onClick={() => goPath(message)} onClick={() => goPath(message)}
style={{ backgroundImage: `url(${getMessageTypeIcon(message)})` }}
> >
<div className={`${prefixCls}-notifier-message-title`}> <div className={`${prefixCls}-notifier-message-title`}>
<span>{caseType}</span> <span>{caseType}</span>
...@@ -72,7 +77,9 @@ const Case = ({ message, confirmRead }) => { ...@@ -72,7 +77,9 @@ const Case = ({ message, confirmRead }) => {
e.stopPropagation(); e.stopPropagation();
confirmRead(false, [message.id]); confirmRead(false, [message.id]);
}} }}
// eslint-disable-next-line global-require
src={require('../../images/oper/ok_line.png')} src={require('../../images/oper/ok_line.png')}
alt=""
/> />
</div> </div>
<div className={`${prefixCls}-notifier-message-content`}> <div className={`${prefixCls}-notifier-message-content`}>
......
import React from 'react'; import React from 'react';
import { ConfigProvider } from 'antd'; import { ConfigProvider } from 'antd';
// eslint-disable-next-line import/no-unresolved
import classNames from 'classnames'; import classNames from 'classnames';
import '../styles/common.less'; import '../styles/common.less';
import './index.less'; import './index.less';
import { getMessageTypeIcon } from '../../utils';
export class NoticeContent { export class NoticeContent {
// eslint-disable-next-line no-undef // eslint-disable-next-line no-undef
...@@ -15,7 +16,6 @@ export class NoticeContent { ...@@ -15,7 +16,6 @@ export class NoticeContent {
} }
} }
const Notice = ({ message, confirmRead, config, handlerSysDetail }) => { const Notice = ({ message, confirmRead, config, handlerSysDetail }) => {
const { getPrefixCls } = React.useContext(ConfigProvider.ConfigContext); const { getPrefixCls } = React.useContext(ConfigProvider.ConfigContext);
const prefixCls = getPrefixCls(); const prefixCls = getPrefixCls();
...@@ -25,26 +25,31 @@ const Notice = ({ message, confirmRead, config, handlerSysDetail }) => { ...@@ -25,26 +25,31 @@ const Notice = ({ message, confirmRead, config, handlerSysDetail }) => {
const noticeContent = message?.infoContent?.noticeContent ?? ''; const noticeContent = message?.infoContent?.noticeContent ?? '';
// const remark = message?.infoContent?.remark; // const remark = message?.infoContent?.remark;
const goPath = (item) => { const goPath = item => {
confirmRead(false, [message.id]); confirmRead(false, [message.id]);
handlerSysDetail && handlerSysDetail(message); handlerSysDetail && handlerSysDetail(message);
}; };
return ( return (
<div <div
className={classNames(`${prefixCls}-notifier-message_notice`, `${prefixCls}-notifier-message-container`)} className={classNames(`${prefixCls}-notifier-message_notice`, `${prefixCls}-notifier-message-container`)}
title="点击查看详情" title="点击查看详情"
onClick={() => goPath(message)} onClick={() => goPath(message)}
style={{ backgroundImage: `url(${getMessageTypeIcon(message)})` }}
> >
<div className={`${prefixCls}-notifier-message-title`}> <div className={`${prefixCls}-notifier-message-title`}>
<span>{noticeType}{noticeTitle ? `:${noticeTitle}` : ''}</span> <span>
{noticeType}
{noticeTitle ? `:${noticeTitle}` : ''}
</span>
<img <img
className={`${prefixCls}-notifier-message-confirm`} className={`${prefixCls}-notifier-message-confirm`}
title="点击标为已读" title="点击标为已读"
onClick={(e) => { onClick={e => {
e.stopPropagation(); e.stopPropagation();
confirmRead(false, [message.id]); confirmRead(false, [message.id]);
}} }}
// eslint-disable-next-line global-require
src={require('../../images/oper/ok_line.png')} src={require('../../images/oper/ok_line.png')}
alt="" alt=""
/> />
...@@ -52,7 +57,7 @@ const Notice = ({ message, confirmRead, config, handlerSysDetail }) => { ...@@ -52,7 +57,7 @@ const Notice = ({ message, confirmRead, config, handlerSysDetail }) => {
<div className={`${prefixCls}-notifier-message-content`}> <div className={`${prefixCls}-notifier-message-content`}>
<p>{noticeContent}</p> <p>{noticeContent}</p>
</div> </div>
<p className={`${prefixCls}-notifier-message-time`}>{message.time}</p> <p className={`${prefixCls}-notifier-message-time`}>{message.time}</p>
</div> </div>
); );
}; };
......
import React from 'react'; import React from 'react';
import { ConfigProvider } from 'antd'; import { ConfigProvider } from 'antd';
// eslint-disable-next-line import/no-unresolved
import classNames from 'classnames'; import classNames from 'classnames';
import '../styles/common.less'; import '../styles/common.less';
...@@ -11,24 +12,23 @@ const Unknown = ({ message, confirmRead, handlerUnknowDetail }) => { ...@@ -11,24 +12,23 @@ const Unknown = ({ message, confirmRead, handlerUnknowDetail }) => {
const prefixCls = getPrefixCls(); const prefixCls = getPrefixCls();
let content = ''; let content = '';
let noticeTitle = ''; let noticeTitle = '';
const { infoContent } = message;
try { try {
const type = typeof message.infoContent; const type = typeof message.infoContent;
switch (type) { switch (type) {
case 'object': case 'object':
let { infoContent } = message; noticeTitle = message.title || infoContent.title || '';
noticeTitle = infoContent.title || ''; content = infoContent.content || message.defaultContent || JSON.stringify(message.infoContent);
content = infoContent.content || JSON.stringify(message.infoContent);
break;
case 'string':
content = message.infoContent;
break; break;
default: default:
noticeTitle = message.title || '';
content = message.defaultContent || message.infoContent;
break; break;
} }
} catch (e) { } catch (e) {
// i // i
} }
const goPath = (item) => { const goPath = item => {
handlerUnknowDetail && handlerUnknowDetail(message); handlerUnknowDetail && handlerUnknowDetail(message);
confirmRead(false, [message.id]); confirmRead(false, [message.id]);
}; };
...@@ -37,17 +37,18 @@ const Unknown = ({ message, confirmRead, handlerUnknowDetail }) => { ...@@ -37,17 +37,18 @@ const Unknown = ({ message, confirmRead, handlerUnknowDetail }) => {
className={classNames(`${prefixCls}-notifier-message_unknown`, `${prefixCls}-notifier-message-container`)} className={classNames(`${prefixCls}-notifier-message_unknown`, `${prefixCls}-notifier-message-container`)}
title="点击查看详情" title="点击查看详情"
onClick={() => goPath(message)} onClick={() => goPath(message)}
style={{backgroundImage: `url(${getMessageTypeIcon(message.messType)})`}} style={{ backgroundImage: `url(${getMessageTypeIcon(message)})` }}
> >
<div className={`${prefixCls}-notifier-message-title`}> <div className={`${prefixCls}-notifier-message-title`}>
<span>{noticeTitle}</span> <span>{noticeTitle}</span>
<img <img
className={`${prefixCls}-notifier-message-confirm`} className={`${prefixCls}-notifier-message-confirm`}
title="点击标为已读" title="点击标为已读"
onClick={(e) => { onClick={e => {
e.stopPropagation(); e.stopPropagation();
confirmRead(false, [message.id]); confirmRead(false, [message.id]);
}} }}
// eslint-disable-next-line global-require
src={require('../../images/oper/ok_line.png')} src={require('../../images/oper/ok_line.png')}
alt="" alt=""
/> />
......
import { MESSAGE_TYPE } from '../constants'; import { MESSAGE_TYPE } from '../constants';
import parseMessageToJSON from './parse'; import parseMessageToJSON from './parse';
import alarm_icon from '../images/types/alarm.png'; import alarmIcon from '../images/types/alarm.png';
import approve_icon from '../images/types/approve.png'; import approveIcon from '../images/types/approve.png';
import meeting_icon from '../images/types/meeting.png'; import meetingIcon from '../images/types/meeting.png';
import notice_icon from '../images/types/notice.png'; import noticeIcon from '../images/types/notice.png';
import task_icon from '../images/types/task.png'; import taskIcon from '../images/types/task.png';
import work_icon from '../images/types/work.png'; import workIcon from '../images/types/work.png';
import write_icon from '../images/types/write.png'; import writeIcon from '../images/types/write.png';
import other_icon from '../images/types/other.png'; import otherIcon from '../images/types/other.png';
export const getMessageTypeIcon = messageType => { export const getMessageTypeIcon = message => {
let icon = other_icon; const { webIcon } = message;
if (webIcon) return `${window.location.origin}/${webIcon}`;
const { messageType, infoType } = message;
let icon = otherIcon;
if (infoType === '通用报警') {
icon = alarmIcon;
} else if (infoType === '系统通知') {
icon = noticeIcon;
} else if (infoType === '工单提醒') {
icon = workIcon;
}
if (!messageType) return icon; if (!messageType) return icon;
if (messageType === '工时填报') { if (messageType === '工时填报') {
icon = write_icon; icon = writeIcon;
} else if (messageType.indexOf('审批') > -1) { } else if (messageType.indexOf('审批') > -1) {
icon = approve_icon; icon = approveIcon;
} else if (messageType.indexOf('会议') > -1) { } else if (messageType.indexOf('会议') > -1) {
icon = meeting_icon; icon = meetingIcon;
} else if (messageType.indexOf('任务') > -1) { } else if (messageType.indexOf('任务') > -1) {
icon = task_icon; icon = taskIcon;
} }
return icon; return icon;
}; };
export const getMessageClasses = messageType => { export const getMessageClasses = messageType => {
let infoType = ''; let infoType = '';
switch (messageType) { switch (messageType) {
// 报警类 // 报警类
case 'SCADA报警': case 'SCADA报警':
case '通用报警': case '通用报警':
infoType = MESSAGE_TYPE.ALARM_TYPE; infoType = MESSAGE_TYPE.ALARM_TYPE;
break; break;
// 工单类 // 工单类
case '工单流程': case '工单流程':
case '工单提醒': case '工单提醒':
infoType = MESSAGE_TYPE.CASE_TYPE; infoType = MESSAGE_TYPE.CASE_TYPE;
break; break;
// 系统消息类 // 系统消息类
case '系统通知': case '系统通知':
case '系统消息': case '系统消息':
infoType = MESSAGE_TYPE.SYS_TYPE; infoType = MESSAGE_TYPE.SYS_TYPE;
break; break;
// 其他类 // 其他类
default: default:
infoType = MESSAGE_TYPE.UNKNOWN; infoType = MESSAGE_TYPE.UNKNOWN;
break; break;
} }
return infoType; return infoType;
}; };
/** /**
* 消息语音单位转换 * 消息语音单位转换
* 说明:消息通过语音播放时,需要将一些字母单位转换成文字,不然会当做字母播放。 * 说明:消息通过语音播放时,需要将一些字母单位转换成文字,不然会当做字母播放。
...@@ -76,16 +82,17 @@ export const replaceSpeak = msg => { ...@@ -76,16 +82,17 @@ export const replaceSpeak = msg => {
return msg; return msg;
}; };
// eslint-disable-next-line arrow-body-style
export const generatedId = () => { export const generatedId = () => {
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx' return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'
.replace(/[xy]/g, function(c) { .replace(/[xy]/g, function(c) {
// eslint-disable-next-line no-bitwise
const r = (Math.random() * 16) | 0; const r = (Math.random() * 16) | 0;
// eslint-disable-next-line no-bitwise
const v = c === 'x' ? r : (r & 0x3) | 0x8; const v = c === 'x' ? r : (r & 0x3) | 0x8;
return v.toString(16); return v.toString(16);
}) })
.toUpperCase(); .toUpperCase();
}; };
export { export { parseMessageToJSON };
parseMessageToJSON,
}
\ No newline at end of file
// @eslint-disable // @eslint-disable
import React, { import React, { Suspense, useEffect, useRef, useState } from 'react';
Suspense,
useEffect,
useRef,
useState,
} from 'react';
import { import { Anchor, Popover, Radio, Spin } from 'antd';
Anchor,
Popover,
Radio,
Spin,
} from 'antd';
import classNames from 'classnames'; import classNames from 'classnames';
import Cookies from 'js-cookie'; import Cookies from 'js-cookie';
import _ from 'lodash'; import _ from 'lodash';
...@@ -19,23 +9,16 @@ import memoized from 'nano-memoize'; ...@@ -19,23 +9,16 @@ import memoized from 'nano-memoize';
import KeepAlive from 'react-activation'; import KeepAlive from 'react-activation';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { matchRoutes } from 'react-router-dom'; import { matchRoutes } from 'react-router-dom';
import Loading from '../components/Loading';
import RightContent from '@/components/GlobalHeader/SimpleRiightContent'; import RightContent from '@/components/GlobalHeader/SimpleRiightContent';
import defaultSetting from '@wisdom-utils/components/lib/AppLayout/layouts/defaultSettings'; import defaultSetting from '@wisdom-utils/components/lib/AppLayout/layouts/defaultSettings';
// import SettingDrawer from '@wisdom-utils/components/lib/layout/components/SettingDrawer'; // import SettingDrawer from '@wisdom-utils/components/lib/layout/components/SettingDrawer';
import { actionCreators } from '@/containers/App/store'; import { actionCreators } from '@/containers/App/store';
import Icon, { LoadingOutlined } from '@ant-design/icons'; import Icon, { LoadingOutlined } from '@ant-design/icons';
import BasicLayout from '@wisdom-utils/components/lib/layout/BasicLayout'; import BasicLayout from '@wisdom-utils/components/lib/layout/BasicLayout';
import { import { useHistory, useLocation } from '@wisdom-utils/runtime';
useHistory, import { helpers, store, event } from '@wisdom-utils/utils';
useLocation,
} from '@wisdom-utils/runtime';
import {
helpers,
store,
event
} from '@wisdom-utils/utils';
import { Storeage as Store } from '@wisdom-utils/utils/lib/helpers'; import { Storeage as Store } from '@wisdom-utils/utils/lib/helpers';
import Loading from '../components/Loading';
import { waterMark } from '../utils/mark'; import { waterMark } from '../utils/mark';
import layoutStyles from './BasicLayout.less'; import layoutStyles from './BasicLayout.less';
...@@ -49,28 +32,26 @@ const { getParamsV1 } = params; ...@@ -49,28 +32,26 @@ const { getParamsV1 } = params;
// const AMap = React.lazy(() => import('../pages/map/amap')); // const AMap = React.lazy(() => import('../pages/map/amap'));
const CesiumMap = React.lazy(() => import('../pages/map/cesiumMap')); const CesiumMap = React.lazy(() => import('../pages/map/cesiumMap'));
const waitTime = (time = 100) =>
const waitTime = (time = 100) => { new Promise(resolve => {
return new Promise((resolve) => {
setTimeout(() => { setTimeout(() => {
resolve(true); resolve(true);
}, time); }, time);
}); });
};
const antIcon = <LoadingOutlined style={{ fontSize: 12 }} spin />; const antIcon = <LoadingOutlined style={{ fontSize: 12 }} spin />;
const arrowSvg = ({ fillColor = '#fff' }) => ( const arrowSvg = ({ fillColor = '#fff' }) => (
<svg <svg
t='1543324489942' t="1543324489942"
className='icon' className="icon"
viewBox='0 0 1024 1024' viewBox="0 0 1024 1024"
version='1.1' version="1.1"
xmlns='http://www.w3.org/2000/svg' xmlns="http://www.w3.org/2000/svg"
width='16' width="16"
height='16' height="16"
> >
<path <path
d='M511.700683 639.423111 191.917496 319.596945 319.830771 319.596945 511.700683 511.715521 703.570595 319.596945 831.48387 319.596945Z' d="M511.700683 639.423111 191.917496 319.596945 319.830771 319.596945 511.700683 511.715521 703.570595 319.596945 831.48387 319.596945Z"
p-id='8626' p-id="8626"
// fill={fillColor} // fill={fillColor}
/> />
</svg> </svg>
...@@ -102,9 +83,15 @@ const StationsItem = (item, action, onChangeVisible, actionRef, setMenuLoading) ...@@ -102,9 +83,15 @@ const StationsItem = (item, action, onChangeVisible, actionRef, setMenuLoading)
const OnlyFocusStations = props => { const OnlyFocusStations = props => {
const data = props.data.stations; const data = props.data.stations;
return ( return (
<Spin spinning={props.loading} tip='加载中' size='small'> <Spin spinning={props.loading} tip="加载中" size="small">
<div className={layoutStyles.focusStations} style={{ border: 'none' }}> <div className={layoutStyles.focusStations} style={{ border: 'none' }}>
<ul>{Array.isArray(data) ? data.map(item => StationsItem(item, props.action, props.setVisible, props.actionRef, props.setMenuLoading)) : null}</ul> <ul>
{Array.isArray(data)
? data.map(item =>
StationsItem(item, props.action, props.setVisible, props.actionRef, props.setMenuLoading),
)
: null}
</ul>
</div> </div>
</Spin> </Spin>
); );
...@@ -128,15 +115,21 @@ const AllStations = props => { ...@@ -128,15 +115,21 @@ const AllStations = props => {
setDefaultTab(event.target.value); setDefaultTab(event.target.value);
}; };
return ( return (
<Spin spinning={props.loading} tip='加载中'> <Spin spinning={props.loading} tip="加载中">
<div className={layoutStyles.focusStations}> <div className={layoutStyles.focusStations}>
<ul>{Array.isArray(data) ? data.map(item => StationsItem(item, props.action, props.setVisible, props.actionRef, props.setMenuLoading)) : null}</ul> <ul>
{Array.isArray(data)
? data.map(item =>
StationsItem(item, props.action, props.setVisible, props.actionRef, props.setMenuLoading),
)
: null}
</ul>
</div> </div>
<Radio.Group <Radio.Group
options={optionsWith} options={optionsWith}
optionType='button' optionType="button"
buttonStyle='solid' buttonStyle="solid"
size='small' size="small"
value={defaultTab} value={defaultTab}
onChange={handleTabChange} onChange={handleTabChange}
style={{ marginTop: '6px' }} style={{ marginTop: '6px' }}
...@@ -159,7 +152,7 @@ const AllStations = props => { ...@@ -159,7 +152,7 @@ const AllStations = props => {
</Anchor> </Anchor>
</div> </div>
) : ( ) : (
<div className='city_pane city_container'>{props.data.citySelector}</div> <div className="city_pane city_container">{props.data.citySelector}</div>
)} )}
</div> </div>
</Spin> </Spin>
...@@ -181,26 +174,32 @@ const renderSite = ({ data, config, loading, setLoading, action, actionRef, setM ...@@ -181,26 +174,32 @@ const renderSite = ({ data, config, loading, setLoading, action, actionRef, setM
if (config && config.userInfo && config.userInfo.site === '') { if (config && config.userInfo && config.userInfo.site === '') {
loaded = false; loaded = false;
} }
if (!data.allStation || !_.isArray(data.allStation) || data.allStation.length <= 1) if (!data.allStation || !_.isArray(data.allStation) || data.allStation.length <= 1) return <></>;
return <></>;
return ( return (
<> <>
<Spin <Spin
indicator={antIcon} indicator={antIcon}
spinning={loaded} spinning={loaded}
size='small' size="small"
style={{ marginLeft: '10px' }} style={{ marginLeft: '10px' }}
tip='' tip=""
wrapperClassName={layoutStyles.spinLoadding} wrapperClassName={layoutStyles.spinLoadding}
> >
<> <>
<Popover <Popover
placement='bottomLeft' placement="bottomLeft"
trigger='click' trigger="click"
visible={visible} visible={visible}
content={ content={
<Stations data={data} loading={loading} setLoading={setLoading} setVisible={setVisible} action={action} <Stations
actionRef={actionRef} setMenuLoading={setMenuLoading} /> data={data}
loading={loading}
setLoading={setLoading}
setVisible={setVisible}
action={action}
actionRef={actionRef}
setMenuLoading={setMenuLoading}
/>
} }
arrowPointAtCenter arrowPointAtCenter
overlayClassName={classNames(layoutStyles.stationsWrapper, layoutStyles.stationsTop)} overlayClassName={classNames(layoutStyles.stationsWrapper, layoutStyles.stationsTop)}
...@@ -228,7 +227,6 @@ const renderSite = ({ data, config, loading, setLoading, action, actionRef, setM ...@@ -228,7 +227,6 @@ const renderSite = ({ data, config, loading, setLoading, action, actionRef, setM
// 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 });
const routeConfig = matches ? matches[matches.length - 1].route : null; const routeConfig = matches ? matches[matches.length - 1].route : null;
...@@ -246,8 +244,10 @@ const transformFloatMenu = (routes, homepage) => { ...@@ -246,8 +244,10 @@ const transformFloatMenu = (routes, homepage) => {
return routes.concat(route); return routes.concat(route);
}; };
const Layout = (props) => { const Layout = props => {
const currentProduct = new Store(`__global__recent_productIndex__micro_${window.location.hostname}`); const currentProduct = new Store(
`__global__recent_productIndex__micro_${window.location.hostname}_${sessionStorage.getItem('client') || 'city'}`,
);
const menuState = sessionStorage.getItem('menuState') || 'open'; const menuState = sessionStorage.getItem('menuState') || 'open';
const [cityData, setCityData] = useState({}); const [cityData, setCityData] = useState({});
const [siteLoading, setSiteLoading] = useState(false); const [siteLoading, setSiteLoading] = useState(false);
...@@ -273,11 +273,10 @@ const Layout = (props) => { ...@@ -273,11 +273,10 @@ const Layout = (props) => {
}); });
}, []); }, []);
useEffect(() => { useEffect(() => {
siteAction.setGlobalConfig(props.global); siteAction.setGlobalConfig(props.global);
const tk = Cookies.get('token') || props.global.token; const tk = Cookies.get('token') || props.global.token;
const isLogin = tk !== null && tk !== 'undefined' && tk !== (void 0); const isLogin = tk !== null && tk !== 'undefined' && tk !== void 0;
if (!isLogin) { if (!isLogin) {
let client = props?.global?.client || sessionStorage.getItem('client') || null; let client = props?.global?.client || sessionStorage.getItem('client') || null;
client = client !== 'undefined' && !_.isNull(client) && !_.isUndefined(client) ? client : 'city'; client = client !== 'undefined' && !_.isNull(client) && !_.isUndefined(client) ? client : 'city';
...@@ -305,7 +304,6 @@ const Layout = (props) => { ...@@ -305,7 +304,6 @@ const Layout = (props) => {
} }
}, [cityData, props.global, props.global.userInfo, siteAction]); }, [cityData, props.global, props.global.userInfo, siteAction]);
useEffect(() => { useEffect(() => {
window.share.event.on('updateSite', res => { window.share.event.on('updateSite', res => {
setCityData(res); setCityData(res);
...@@ -333,8 +331,7 @@ const Layout = (props) => { ...@@ -333,8 +331,7 @@ const Layout = (props) => {
}); });
} }
}; };
}, [props.global.userInfo]); }, [props.global.isHaveMark, props.global.userInfo]);
const onMenuHeaderClick = event => { const onMenuHeaderClick = event => {
// 非云平台不做响应 // 非云平台不做响应
...@@ -359,8 +356,8 @@ const Layout = (props) => { ...@@ -359,8 +356,8 @@ const Layout = (props) => {
const logo = const logo =
props.global && _.isFunction(props.global.get) && props.global.get('bannerLogo') props.global && _.isFunction(props.global.get) && props.global.get('bannerLogo')
? props.global && ? props.global &&
_.isFunction(props.global.transformDevAssetsBaseURL) && _.isFunction(props.global.transformDevAssetsBaseURL) &&
props.global.transformDevAssetsBaseURL(props.global.get('bannerLogo')) props.global.transformDevAssetsBaseURL(props.global.get('bannerLogo'))
: defaultSetting.logo; : defaultSetting.logo;
// 添加一个路由跳转事件 // 添加一个路由跳转事件
...@@ -368,7 +365,7 @@ const Layout = (props) => { ...@@ -368,7 +365,7 @@ const Layout = (props) => {
const { share, history } = window; const { share, history } = window;
const findMenuPath = (flatMenu, url) => { const findMenuPath = (flatMenu, url) => {
const [path, param = ''] = url.split('|'); const [path, param = ''] = url.split('|');
let params = param.split('&').reduce((pre, item) => { const params = param.split('&').reduce((pre, item) => {
if (!item) return pre; if (!item) return pre;
const [key, value] = item.split('='); const [key, value] = item.split('=');
pre[key] = value; pre[key] = value;
...@@ -393,18 +390,13 @@ const Layout = (props) => { ...@@ -393,18 +390,13 @@ const Layout = (props) => {
return () => { return () => {
share && share.event && share.event.removeListener('route:pushState', skipHandler); share && share.event && share.event.removeListener('route:pushState', skipHandler);
}; };
}, []); }, [props.flatMenu]);
if(props.global && props.global.userInfo){ if (props.global && props.global.userInfo) {
if(!props.global.userInfo.site){ if (!props.global.userInfo.site) {
props.global.userInfo.site = ''; props.global.userInfo.site = '';
} }
} }
return ( return (
<SecurityLayout {...props}> <SecurityLayout {...props}>
<BasicLayout <BasicLayout
...@@ -412,7 +404,9 @@ const Layout = (props) => { ...@@ -412,7 +404,9 @@ const Layout = (props) => {
route={props.route} route={props.route}
location={location} location={location}
navTheme={props.global?.variableTheme?.navTheme ?? 'dark'} navTheme={props.global?.variableTheme?.navTheme ?? 'dark'}
mode='MDI' homepage={props.global?.homepage ?? ''}
redirect={props.global?.redirect ?? ''}
mode="MDI"
fixedHeader fixedHeader
headerHeight={52} headerHeight={52}
routeConfig={routeConfig} routeConfig={routeConfig}
...@@ -449,16 +443,15 @@ const Layout = (props) => { ...@@ -449,16 +443,15 @@ const Layout = (props) => {
} }
menuItemRender={(item, dom) => ( menuItemRender={(item, dom) => (
<a <a
onClick={(event) => { onClick={event => {
event.preventDefault(); event.preventDefault();
window.history.pushState(null, '', '/civbase' + item.path); window.history.pushState(null, '', `/civbase${item.path}`);
}} }}
> >
{dom} {dom}
</a> </a>
)} )}
> >
<Suspense fallback={<></>}> <Suspense fallback={<></>}>
{/* {window.location.pathname.startsWith('/civbase/civ_3d') ? ( */} {/* {window.location.pathname.startsWith('/civbase/civ_3d') ? ( */}
{/* <KeepAlive> */} {/* <KeepAlive> */}
...@@ -475,14 +468,13 @@ const Layout = (props) => { ...@@ -475,14 +468,13 @@ const Layout = (props) => {
<KeepAlive> <KeepAlive>
<CesiumMap /> <CesiumMap />
</KeepAlive> </KeepAlive>
) : ( ) : (
window.location.pathname.startsWith('/civbase/civ_webgis') && null window.location.pathname.startsWith('/civbase/civ_webgis') && null
)} )}
</Suspense> </Suspense>
{subLoading && <Loading loading={subLoading} />} {subLoading && <Loading loading={subLoading} />}
<div id='micro-container' className='subapp-container'> <div id="micro-container" className="subapp-container">
{props.children} {props.children}
</div> </div>
</BasicLayout> </BasicLayout>
......
/* eslint-disable import/no-unresolved */
/* eslint-disable no-underscore-dangle */
/* eslint-disable global-require */
/* eslint-disable eqeqeq */
/* /*
** 功能名称 ** 功能名称
** create by tuwei on 2022/2/20 ** create by tuwei on 2022/2/20
...@@ -8,16 +12,16 @@ import { connect } from 'react-redux'; ...@@ -8,16 +12,16 @@ import { connect } from 'react-redux';
import { List, message, Avatar, Skeleton, Divider, Select, notification } from 'antd'; import { List, message, Avatar, Skeleton, Divider, Select, notification } from 'antd';
import { CheckOutlined } from '@ant-design/icons'; import { CheckOutlined } from '@ant-design/icons';
import InfiniteScroll from 'react-infinite-scroll-component'; import InfiniteScroll from 'react-infinite-scroll-component';
// eslint-disable-next-line import/no-unresolved
import classnames from 'classnames'; import classnames from 'classnames';
import { noticeService } from '@/api'; import { noticeService } from '@/api';
import styles from './index.less'; import styles from './index.less';
import { formatDate } from './utils' import { formatDate } from './utils';
const findMenuPath = (flatMenu, url) => { const findMenuPath = (flatMenu, url) => {
const [path, param = ''] = url.split('|'); const [path, param = ''] = url.split('|');
let params = param.split('&').reduce((pre, item) => { const params = param.split('&').reduce((pre, item) => {
if(!item) return pre; if (!item) return pre;
const [key, value] = item.split('='); const [key, value] = item.split('=');
pre[key] = value; pre[key] = value;
return pre; return pre;
...@@ -31,17 +35,13 @@ const CheckAllMessage = props => { ...@@ -31,17 +35,13 @@ const CheckAllMessage = props => {
const { flatMenu } = props; const { flatMenu } = props;
const [loading, setLoading] = useState(false); const [loading, setLoading] = useState(false);
const [data, setData] = useState([]); const [data, setData] = useState([]);
const [sortType, setSortType] = useState(1); //排序类型 const [sortType, setSortType] = useState(1); // 排序类型
const [infoTypeList, setInfoTypeList] = useState([]); const [infoTypeList, setInfoTypeList] = useState([]);
const [isRes, setIsRes] = useState(false); const [isRes, setIsRes] = useState(false);
const total = useRef(0); const total = useRef(0);
const pageIndex = useRef(1); const pageIndex = useRef(1);
const pageSize = useRef(20); const pageSize = useRef(20);
const infoType = useRef('全部'); const infoType = useRef('全部');
useEffect(() => {
loadMoreData();
getTypeList();
}, []);
// 获取类型数据 // 获取类型数据
const getTypeList = () => { const getTypeList = () => {
noticeService.getCurrentInfoType({ userID: window.globalConfig.userInfo.OID }).then(res => { noticeService.getCurrentInfoType({ userID: window.globalConfig.userInfo.OID }).then(res => {
...@@ -49,38 +49,40 @@ const CheckAllMessage = props => { ...@@ -49,38 +49,40 @@ const CheckAllMessage = props => {
res.data?.unshift('全部'); res.data?.unshift('全部');
res.data && setInfoTypeList(res.data); res.data && setInfoTypeList(res.data);
} }
}) });
} };
// 加载数据 // 加载数据
const loadMoreData = () => { const loadMoreData = () => {
if (loading) { if (loading) {
return; return;
} }
setLoading(true); setLoading(true);
let obj = {} let obj = {};
if (infoType.current == '全部') { if (infoType.current === '全部') {
obj = { obj = {
userID: window.globalConfig.userInfo.OID, userID: window.globalConfig.userInfo.OID,
pageIndex: pageIndex.current, pageIndex: pageIndex.current,
pageSize: pageSize.current, pageSize: pageSize.current,
sort: sortType sort: sortType,
} };
} else { } else {
obj = { obj = {
type: infoType.current, type: infoType.current,
userID: window.globalConfig.userInfo.OID, userID: window.globalConfig.userInfo.OID,
pageIndex: pageIndex.current, pageIndex: pageIndex.current,
pageSize: pageSize.current, pageSize: pageSize.current,
sort: sortType sort: sortType,
} };
} }
// userID: window.globalConfig.userInfo.OID, // userID: window.globalConfig.userInfo.OID,
noticeService noticeService
.getAllInformationInfo(obj) .getAllInformationInfo(obj)
.then(res => { .then(res => {
if (res.code === 0) { if (res.code === 0) {
// eslint-disable-next-line no-plusplus
pageIndex.current++; pageIndex.current++;
total.current = res.data.totalCount; total.current = res.data.totalCount;
// eslint-disable-next-line no-use-before-define
res.data.list && setData([...data, ...deaflData(res.data.list)]); res.data.list && setData([...data, ...deaflData(res.data.list)]);
setIsRes(true); setIsRes(true);
setLoading(false); setLoading(false);
...@@ -89,27 +91,32 @@ const CheckAllMessage = props => { ...@@ -89,27 +91,32 @@ const CheckAllMessage = props => {
.catch(() => { .catch(() => {
setIsRes(true); setIsRes(true);
setLoading(false); setLoading(false);
}) });
}; };
useEffect(() => {
loadMoreData();
getTypeList();
}, []);
// eslint-disable-next-line no-shadow, arrow-body-style
const deaflData = (data = []) => { const deaflData = (data = []) => {
return data.map(item => { return data.map(item => {
let content = ''; let content = '';
try { try {
content = JSON.parse(item.infoContent) content = JSON.parse(item.infoContent);
content = item.infoContent; content = item.infoContent;
} catch (error) { } catch (error) {
content = '{}'; content = '{}';
} }
return { ...item, infoContent: content} return { ...item, infoContent: content };
}) });
} };
// 获取数据 // 获取数据
const getData = (obj) => { const getData = obj => {
noticeService noticeService
.getAllInformationInfo(obj) .getAllInformationInfo(obj)
.then(res => { .then(res => {
if (res.code === 0) { if (res.code === 0) {
// eslint-disable-next-line no-plusplus
pageIndex.current++; pageIndex.current++;
total.current = res.data.totalCount; total.current = res.data.totalCount;
res.data.list && setData(deaflData(res.data.list)); res.data.list && setData(deaflData(res.data.list));
...@@ -118,66 +125,67 @@ const CheckAllMessage = props => { ...@@ -118,66 +125,67 @@ const CheckAllMessage = props => {
}) })
.catch(() => { .catch(() => {
setLoading(false); setLoading(false);
}) });
};
}
// 监听选择类型 // 监听选择类型
const onChange = e => { const onChange = e => {
infoType.current = e; infoType.current = e;
pageIndex.current = 1 pageIndex.current = 1;
let obj = {} let obj = {};
if (infoType.current == '全部') { if (infoType.current === '全部') {
obj = { obj = {
userID: window.globalConfig.userInfo.OID, userID: window.globalConfig.userInfo.OID,
pageIndex: pageIndex.current, pageIndex: pageIndex.current,
pageSize: pageSize.current, pageSize: pageSize.current,
sort: sortType sort: sortType,
} };
} else { } else {
obj = { obj = {
type: infoType.current, type: infoType.current,
userID: window.globalConfig.userInfo.OID, userID: window.globalConfig.userInfo.OID,
pageIndex: pageIndex.current, pageIndex: pageIndex.current,
pageSize: pageSize.current, pageSize: pageSize.current,
sort: sortType sort: sortType,
} };
} }
getData(obj); getData(obj);
}; };
// title 回显 // title 回显
const messageTitle = (themeName, info) => { const messageTitle = (item, info) => {
var messInfo = ""; const { messType, title } = item;
switch (themeName) { let messInfo = '';
case "工单提醒": switch (messType) {
case '工单提醒':
messInfo = `${info.caseType}`; messInfo = `${info.caseType}`;
break; break;
case "通用报警": case '通用报警':
messInfo = `${info.title}`; messInfo = `${info.title}`;
break; break;
case "系统通知": case '系统通知':
messInfo = `${info.noticeType}`; messInfo = `${info.noticeType}`;
break; break;
default: default:
messInfo = info.title; messInfo = title || info.title;
break; break;
} }
return messInfo; return messInfo;
}; };
// content回显 // content回显
const messageContent = (themeName, info) => { const messageContent = (item, info) => {
var messInfo = ""; const { messType, defaultContent } = item;
switch (themeName) { let messInfo = '';
case "工单提醒": switch (messType) {
case '工单提醒':
messInfo = `${info.flowName},${info.nodeName},承办意见:${info.content}`; messInfo = `${info.flowName},${info.nodeName},承办意见:${info.content}`;
break; break;
case "通用报警": case '通用报警':
messInfo = `${info.content},${info.deviceCode}`; messInfo = `${info.content},${info.deviceCode}`;
break; break;
case "系统通知": case '系统通知':
messInfo = `${info.noticeTitle},${info.noticeContent}`; messInfo = `${info.noticeTitle},${info.noticeContent}`;
break; break;
default: default:
messInfo = info.content; messInfo = info.content || defaultContent;
break; break;
} }
return messInfo; return messInfo;
...@@ -190,26 +198,28 @@ const CheckAllMessage = props => { ...@@ -190,26 +198,28 @@ const CheckAllMessage = props => {
const difSeconds = (currentTime.getTime() - createTime.getTime()) / 1000; const difSeconds = (currentTime.getTime() - createTime.getTime()) / 1000;
let timeMsg = ''; let timeMsg = '';
if (difSeconds < 60) { if (difSeconds < 60) {
timeMsg = '刚刚' timeMsg = '刚刚';
} else if (difSeconds / 60 < 60) { } else if (difSeconds / 60 < 60) {
// eslint-disable-next-line radix
timeMsg = `${parseInt(difSeconds / 60)}分钟前`; timeMsg = `${parseInt(difSeconds / 60)}分钟前`;
} else if (difSeconds / 3600 < 24) { } else if (difSeconds / 3600 < 24) {
// eslint-disable-next-line radix
timeMsg = `${parseInt(difSeconds / 3600)}小时前`; timeMsg = `${parseInt(difSeconds / 3600)}小时前`;
} else { } else {
timeMsg = formatDate(createTime, 'yyyy-MM-dd'); timeMsg = formatDate(createTime, 'yyyy-MM-dd');
} }
return timeMsg; return timeMsg;
} };
const sortChange = value => { const sortChange = value => {
setSortType(value); setSortType(value);
pageIndex.current = 1; pageIndex.current = 1;
let obj = {}; let obj = {};
if (infoType.current == '全部') { if (infoType.current === '全部') {
obj = { obj = {
userID: window.globalConfig.userInfo.OID, userID: window.globalConfig.userInfo.OID,
pageIndex: pageIndex.current, pageIndex: pageIndex.current,
pageSize: pageSize.current, pageSize: pageSize.current,
sort: value sort: value,
}; };
} else { } else {
obj = { obj = {
...@@ -217,34 +227,35 @@ const CheckAllMessage = props => { ...@@ -217,34 +227,35 @@ const CheckAllMessage = props => {
userID: window.globalConfig.userInfo.OID, userID: window.globalConfig.userInfo.OID,
pageIndex: pageIndex.current, pageIndex: pageIndex.current,
pageSize: pageSize.current, pageSize: pageSize.current,
sort: value sort: value,
}; };
} }
getData(obj); getData(obj);
} };
// 渲染头像 // 渲染头像
const renderImg = val => { const renderImg = item => {
if (val == '通用报警') { const { messType, webIcon } = item;
return require('/src/assets/images/system/notifications/icon2.png'); if (webIcon) return `${window.location.origin}/${webIcon}`;
if (messType === '通用报警') {
return require('../../../assets/images/system/notifications/icon2.png');
} }
if (val == '工单提醒') { if (messType === '工单提醒') {
return require('/src/assets/images/system/notifications/icon4.png'); return require('../../../assets/images/system/notifications/icon4.png');
} }
if (val == '系统通知') { if (messType === '系统通知') {
return require('/src/assets/images/system/notifications/icon3.png'); return require('../../../assets/images/system/notifications/icon3.png');
} }
if (val == '工时审批') { if (messType === '工时审批') {
return require('/src/assets/images/system/notifications/icon1.png') return require('../../../assets/images/system/notifications/icon1.png');
} }
if (val.indexOf('工时填报') != -1) { if (messType.indexOf('工时填报') != -1) {
return require('/src/assets/images/system/notifications/icon6.png') return require('../../../assets/images/system/notifications/icon6.png');
} }
if (val.indexOf('会议') != -1) { if (messType.indexOf('会议') != -1) {
return require('/src/assets/images/system/notifications/icon7.png') return require('../../../assets/images/system/notifications/icon7.png');
} }
return require('/src/assets/images/system/notifications/icon3.png'); return require('../../../layouts/AppLayout/notifier/images/types/other.png');
};
}
// 标记为已读 // 标记为已读
const hasRead = () => { const hasRead = () => {
noticeService.postInformationStatus({ userID: window.globalConfig.userInfo.OID, isAll: 1 }).then(res => { noticeService.postInformationStatus({ userID: window.globalConfig.userInfo.OID, isAll: 1 }).then(res => {
...@@ -256,7 +267,7 @@ const CheckAllMessage = props => { ...@@ -256,7 +267,7 @@ const CheckAllMessage = props => {
userID: window.globalConfig.userInfo.OID, userID: window.globalConfig.userInfo.OID,
pageIndex: pageIndex.current, pageIndex: pageIndex.current,
pageSize: pageSize.current, pageSize: pageSize.current,
sort: sortType sort: sortType,
}; };
} else { } else {
obj = { obj = {
...@@ -264,26 +275,27 @@ const CheckAllMessage = props => { ...@@ -264,26 +275,27 @@ const CheckAllMessage = props => {
userID: window.globalConfig.userInfo.OID, userID: window.globalConfig.userInfo.OID,
pageIndex: pageIndex.current, pageIndex: pageIndex.current,
pageSize: pageSize.current, pageSize: pageSize.current,
sort: sortType sort: sortType,
}; };
} }
getData(obj); getData(obj);
} }
}) });
} };
// 获取参数 // 获取参数
const GetUrlParam = (url) => { const GetUrlParam = url => {
let arrObj = url.split("|"); let arrObj = url.split('|');
let params = Object.create(null); const params = Object.create(null);
if (arrObj.length > 1) { if (arrObj.length > 1) {
arrObj = arrObj[1].split("&"); arrObj = arrObj[1].split('&');
arrObj.forEach((item) => { arrObj.forEach(item => {
item = item.split("="); item = item.split('=');
// eslint-disable-next-line prefer-destructuring
params[item[0]] = item[1]; params[item[0]] = item[1];
}); });
} }
return params; return params;
} };
// 跳转链接 // 跳转链接
const toLink = val => { const toLink = val => {
if (!val.web_path) { if (!val.web_path) {
...@@ -297,7 +309,7 @@ const CheckAllMessage = props => { ...@@ -297,7 +309,7 @@ const CheckAllMessage = props => {
return; return;
} }
let targetMenuPath = findMenuPath(flatMenu, val.web_path); const targetMenuPath = findMenuPath(flatMenu, val.web_path);
if (targetMenuPath == '') { if (targetMenuPath == '') {
notification.error({ message: '提示', duration: 3, description: '你没有跳转菜单权限,请联系管理员添加权限' }); notification.error({ message: '提示', duration: 3, description: '你没有跳转菜单权限,请联系管理员添加权限' });
return; return;
...@@ -312,9 +324,9 @@ const CheckAllMessage = props => { ...@@ -312,9 +324,9 @@ const CheckAllMessage = props => {
sessionStorage.setItem('routerParams', JSON.stringify(params)); sessionStorage.setItem('routerParams', JSON.stringify(params));
noticeService.postInformationStatus({ userID: window.globalConfig.userInfo.OID, hisID: val.hisID }).then(res => { noticeService.postInformationStatus({ userID: window.globalConfig.userInfo.OID, hisID: val.hisID }).then(res => {
window.history.pushState(params, '', `/civbase/${targetMenuPath}`); window.history.pushState(params, '', `/civbase/${targetMenuPath}`);
}) });
} }
} };
return ( return (
<div className={styles.contentPage}> <div className={styles.contentPage}>
<div className={styles.messageBox}> <div className={styles.messageBox}>
...@@ -322,17 +334,15 @@ const CheckAllMessage = props => { ...@@ -322,17 +334,15 @@ const CheckAllMessage = props => {
<div className={styles.headerContent}> <div className={styles.headerContent}>
{/* 选择类型 */} {/* 选择类型 */}
<div className={styles.selectForm}> <div className={styles.selectForm}>
<div className={styles.lable}> <div className={styles.lable}>类型:</div>
类型:
</div>
<div className={styles.form}> <div className={styles.form}>
<Select <Select defaultValue="全部" placeholder="请选择类型" onChange={onChange} style={{ width: '154px' }}>
defaultValue="全部" {infoTypeList.map(item => (
placeholder="请选择类型" // eslint-disable-next-line react/jsx-no-undef
onChange={onChange} <Option value={item} key={item}>
style={{ width: '154px' }} {item}
> </Option>
{infoTypeList.map(item => <Option value={item} key={item}>{item}</Option>)} ))}
</Select> </Select>
</div> </div>
</div> </div>
...@@ -341,11 +351,20 @@ const CheckAllMessage = props => { ...@@ -341,11 +351,20 @@ const CheckAllMessage = props => {
<div className={styles.label}>排序:</div> <div className={styles.label}>排序:</div>
<div className={styles.form}> <div className={styles.form}>
<div className={styles.sortBox}> <div className={styles.sortBox}>
<div className={classnames(styles.tab, { [styles.tabActive]: sortType === 1 })} onClick={() => sortChange(1)}>未读通知在前</div> <div
<div className={classnames(styles.tab, { [styles.tabActive]: sortType === 0 })} onClick={() => sortChange(0)}>默认时间排序</div> className={classnames(styles.tab, { [styles.tabActive]: sortType === 1 })}
onClick={() => sortChange(1)}
>
未读通知在前
</div>
<div
className={classnames(styles.tab, { [styles.tabActive]: sortType === 0 })}
onClick={() => sortChange(0)}
>
默认时间排序
</div>
</div> </div>
</div> </div>
</div> </div>
<div className={styles.haveRead} onClick={hasRead}> <div className={styles.haveRead} onClick={hasRead}>
<CheckOutlined style={{ verticalAlign: 'middle', marginRight: '3px', marginTop: '-2px' }} /> <CheckOutlined style={{ verticalAlign: 'middle', marginRight: '3px', marginTop: '-2px' }} />
...@@ -353,40 +372,44 @@ const CheckAllMessage = props => { ...@@ -353,40 +372,44 @@ const CheckAllMessage = props => {
</div> </div>
</div> </div>
<div <div id="scrollableDiv" className={styles.msgContent}>
id="scrollableDiv"
className={styles.msgContent}
>
<InfiniteScroll <InfiniteScroll
dataLength={data.length} dataLength={data.length}
next={loadMoreData} next={loadMoreData}
hasMore={data.length < total.current} hasMore={data.length < total.current}
loader={<div className={styles.loaderTip}>正在加载更多...</div>} loader={<div className={styles.loaderTip}>正在加载更多...</div>}
endMessage={isRes ? (<div className={styles.loaderTip}>没有更多内容了</div>) : ''} endMessage={isRes ? <div className={styles.loaderTip}>没有更多内容了</div> : ''}
scrollableTarget="scrollableDiv" scrollableTarget="scrollableDiv"
> >
{data.map((item, index) => (<div className={classnames(styles.msgItem, { [styles.msgHasRead]: item.id == 0 })} key={index} onClick={() => toLink(item)}> {data.map((item, index) => (
<div className={styles.left}> <div
<img src={renderImg(item.messType)} alt="" /> className={classnames(styles.msgItem, { [styles.msgHasRead]: item.id == 0 })}
</div> // eslint-disable-next-line react/no-array-index-key
<div className={styles.msgCenter}> key={index}
<div className={styles.msgBox}> onClick={() => toLink(item)}
<div className={styles.title}>{messageTitle(item.messType, JSON.parse(item.infoContent))}</div> >
<div className={styles.msgDesc} title={messageContent(item.messType, JSON.parse(item.infoContent))}>{messageContent(item.messType, JSON.parse(item.infoContent))}</div> <div className={styles.left}>
<img src={renderImg(item)} alt="" />
</div> </div>
<div className={styles.msgCenter}>
<div className={styles.msgBox}>
<div className={styles.title}>{messageTitle(item, JSON.parse(item.infoContent))}</div>
<div className={styles.msgDesc} title={messageContent(item, JSON.parse(item.infoContent))}>
{messageContent(item, JSON.parse(item.infoContent))}
</div>
</div>
</div>
<div className={styles.right}>{renderTime(item.hisCreateTime || item.createTime)}</div>
</div> </div>
<div className={styles.right}>{renderTime(item.createTime || item.hisCreateTime)}</div> ))}
</div>))}
</InfiniteScroll> </InfiniteScroll>
</div> </div>
</div > </div>
</div>
</div >
); );
}; };
const mapStateToProps = state => ({ const mapStateToProps = state => ({
flatMenu: state.getIn(['global', 'flatMenu']) flatMenu: state.getIn(['global', 'flatMenu']),
}); });
export default connect( export default connect(
mapStateToProps, mapStateToProps,
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
import React, { useEffect } from 'react'; import React, { useEffect } from 'react';
import BaseLogin from './template/baseLogin'; import BaseLogin from './template/baseLogin';
import NewYear from './template/newYear'; import NewYear from './template/newYear';
import baseLoginNewYear from './template/baseLoginNewYear';
import InfoLogin from './template/infoLogin'; import InfoLogin from './template/infoLogin';
import Yulin from './template/yulin'; import Yulin from './template/yulin';
// import { useParams } from '@wisdom-utils/runtime'; // import { useParams } from '@wisdom-utils/runtime';
...@@ -28,6 +29,7 @@ import DazuLogin from './template/project/dazu'; ...@@ -28,6 +29,7 @@ import DazuLogin from './template/project/dazu';
import PanoramaLogin from './template/panorama'; import PanoramaLogin from './template/panorama';
import { AppInitState } from '../../../render'; import { AppInitState } from '../../../render';
const LoginTemplate = { const LoginTemplate = {
'新春.html': baseLoginNewYear,
'新春 - 智联.html': NewYear, '新春 - 智联.html': NewYear,
'Dark - IOTMultiLogin.html': BaseLogin, 'Dark - IOTMultiLogin.html': BaseLogin,
'Dark.html': BaseLogin, 'Dark.html': BaseLogin,
......
...@@ -98,25 +98,30 @@ class Login { ...@@ -98,25 +98,30 @@ class Login {
site: this.getLocalSiteBytoken(token), site: this.getLocalSiteBytoken(token),
'request.preventCache': Date.now(), 'request.preventCache': Date.now(),
ignoreSite: true, ignoreSite: true,
}).then(response => { })
if (response && response.code === 0) { .then(response => {
self.globalConfig.userInfo = window?.globalConfig?.transformUserInfo?.(response.data) ?? {}; if (response && response.code === 0) {
self.updateConfig && self.updateConfig(self.globalConfig); self.globalConfig.userInfo = window?.globalConfig?.transformUserInfo?.(response.data) ?? {};
self.getUserInfoAndConfig(); self.updateConfig && self.updateConfig(self.globalConfig);
} else { self.getUserInfoAndConfig();
self.logout && self.logout(); } else {
if (params.getParams('token')) { self.logout && self.logout();
// token免登录失败,回到登录页,防止reload造成死循环 if (params.getParams('token')) {
window.location.href = `${window.location.origin}`; // token免登录失败,回到登录页,防止reload造成死循环
return false; window.location.href = `${window.location.origin}`;
} return false;
if (self.globalConfig.style === 'ios' && self.globalConfig.loginTemplate === 'IOSCloud.html') { }
window.location.href = `${window.location.origin}`; if (self.globalConfig.style === 'ios' && self.globalConfig.loginTemplate === 'IOSCloud.html') {
return false; window.location.href = `${window.location.origin}`;
return false;
}
window.location.reload();
} }
window.location.reload(); })
} .catch(error => {
}); this.handleLoginError();
Logger.log('获取用户配置失败');
});
} }
writeLogs() { writeLogs() {
...@@ -182,7 +187,6 @@ class Login { ...@@ -182,7 +187,6 @@ class Login {
getWebConfig(token, getIndustry) { getWebConfig(token, getIndustry) {
const self = this; const self = this;
// eslint-disable-next-line no-undef // eslint-disable-next-line no-undef
// 获取网站配置的同时,预先获取到mqtt配置,注册进子应用 // 获取网站配置的同时,预先获取到mqtt配置,注册进子应用
Promise.all([ Promise.all([
noticeService.getMqttSiteCode({ 'request.preventCache': Date.now() }), noticeService.getMqttSiteCode({ 'request.preventCache': Date.now() }),
...@@ -701,11 +705,16 @@ class Login { ...@@ -701,11 +705,16 @@ class Login {
self.updateConfig && self.updateConfig(self.globalConfig); self.updateConfig && self.updateConfig(self.globalConfig);
} catch (error) { } catch (error) {
console.log(error); console.log(error);
message.error('登录失败');
if (self.goLogin()) { if (self.goLogin()) {
return false; return false;
} }
// self.handleLoginError(failCallback); // self.handleLoginError(failCallback);
} }
})
.catch(error => {
this.handleLoginError();
Logger.log('获取用户配置失败');
}); });
} else { } else {
self.handleLoginError(); self.handleLoginError();
......
/* eslint-disable no-empty */
/* eslint-disable react-hooks/exhaustive-deps */
/* eslint-disable no-undef */
import '@wisdom-utils/utils/lib/helpers/format'; import '@wisdom-utils/utils/lib/helpers/format';
import { params } from '@wisdom-utils/utils/lib/helpers'; import { params } from '@wisdom-utils/utils/lib/helpers';
import React, { forwardRef, useEffect, useRef, useState } from 'react'; import React, { forwardRef, useEffect, useRef, useState } from 'react';
...@@ -29,14 +32,23 @@ const Login = forwardRef((props, _ref) => { ...@@ -29,14 +32,23 @@ const Login = forwardRef((props, _ref) => {
action && action &&
action.events.on('loginSuccess', event => { action.events.on('loginSuccess', event => {
// http://127.0.0.1:8080/civbase/civweb4/ // http://127.0.0.1:8080/civbase/civweb4/
// props.updateConfig(Object.assign({}, props.global, { props.updateConfig(
// homepage: params.getParams('redirect') Object.assign({}, window.globalConfig, {
// })); redirect,
}),
);
let url = '';
try {
url =
_.isString(redirect) && redirect.replace(new RegExp(/ /g), '').length > 0
? redirect.replace('&skipHome=true', '')
: '';
} catch (error) {}
// props.history.push('/' + params.getParams('redirect')) // props.history.push('/' + params.getParams('redirect'))
props.history.push(`/?client=${props.global.client}`); props.history.push(`/?client=${props.global.client}`);
// window.share.event.emit('triggerMicro', props.global); // window.share.event.emit('triggerMicro', props.global);
// initMicroApps(); // initMicroApps();
defaultApp(redirect); defaultApp(url);
}); });
return () => { return () => {
action && action.events && action.events.removeAllListeners('loginSuccess'); action && action.events && action.events.removeAllListeners('loginSuccess');
......
import 'kit_utils/lib/format';
import React, { forwardRef, useEffect, useRef, useState } from 'react';
import { Modal } from 'antd';
// eslint-disable-next-line import/no-unresolved
import classNames from 'classnames';
import { dom } from '@wisdom-utils/utils/lib/helpers';
import { Helmet, HelmetProvider } from 'react-helmet-async';
import { connect } from 'react-redux';
import { useHistory } from '@wisdom-utils/runtime';
import { actionCreators } from '@/containers/App/store';
import Cookies from 'js-cookie';
import defaultSetting from '../../../../../config/defaultSetting';
import LoginAction from '../login';
import styles from '../style.less';
import useRenderQcode from '../js/useRenderQcode';
import Account from '../js/useAccount';
import IotComponent from '../js/useIOTComponent';
import { defaultApp } from '../../../../micro';
const Login = forwardRef((props, _ref) => {
const videoRef = useRef();
const loginRef = useRef();
const timeRef = useRef();
const loginWrapper = useRef();
const titleRef = useRef();
const sliVerify = useRef();
const loginFormRef = useRef();
const formRef = useRef(null);
const footerRef = useRef();
const [status, setStatus] = useState('normal');
const [autoLogin, setAutoLogin] = useState(false);
const [submitting, setSubmitting] = useState(false);
const [currentDate, setCurrentDate] = useState({});
const [type, setType] = useState('Account');
const [visible, setVisible] = useState(false);
const history = useHistory();
const [action, setAction] = useState(() => new LoginAction(Object.assign({}, props, { history }), setVisible, false));
const [showVideo, setShowVideo] = useState(false);
let { ddCode } = props.global;
const loginMode = Cookies.get('loginMode') || null;
if (loginMode && loginMode === 'iotWechat') ddCode = null;
// useEffect(() => {
// action.globalConfig = props.global;
// }, [props.global]);
const handleSubmit = values => {
/* eslint-disable */
action &&
(type === 'Account'
? action.loginHandler(
values.userName,
values.password,
null,
autoLogin,
sliVerify,
)
: type === 'Mobile'
? action.phoneLoginFormHandler(values.mobile, values.captcha)
: null);
setSubmitting(true);
props.updateCurrentIndex && props.updateCurrentIndex(-1);
};
useEffect(() => {
// if (props.loginMode === LOGIN_WAY.WeChart) {
action &&
action.events.on('loginSuccess', event => {
setSubmitting(false);
props.updateCurrentIndex && props.updateCurrentIndex(0);
props.history.push(`/?client=${props.global.client}`);
// window.share.event.emit('triggerMicro', props.global);
// initMicroApps();
defaultApp();
});
action &&
action.events.on('loginError', event => {
setVisible(false);
setSubmitting(false);
});
action &&
action.events.on('loginVisible', status => {
setVisible(status);
});
// }
return () => {
action && action.events && action.events.removeAllListeners('loginSuccess');
action && action.events && action.events.removeAllListeners('loginError');
action && action.events && action.events.removeAllListeners('loginVisible');
}
}, [props.loginMode]);
let loginTimeInterval = null;
let videoTimeout = null;
useEffect(() => {
if (loginTimeInterval)
clearInterval(loginTimeInterval), (loginTimeInterval = null);
loginTimeInterval = setInterval(() => {
const date = new Date();
const weekday = ['周日', '周一', '周二', '周三', '周四', '周五', '周六'];
const time = `${
date.getHours() < 10 ? `0${date.getHours()}` : date.getHours()
}:${
date.getMinutes() < 10 ? `0${date.getMinutes()}` : date.getMinutes()
}:${
date.getSeconds() < 10 ? `0${date.getSeconds()}` : date.getSeconds()
}`;
setCurrentDate({
time,
dayofweek: weekday[date.getDay()],
date: date.pattern('yyyy/MM/dd'),
});
}, 1000);
return () => {
loginTimeInterval && clearInterval(loginTimeInterval);
};
}, []);
useEffect(() => {
if(ddCode && loginMode === 'qywx') {
setShowVideo(false);
} else {
setShowVideo(true);
setTimeout(() => {
if (videoRef && videoRef.current) {
videoRef.current.addEventListener('ended', function() {
dom.removeClass(loginRef.current, styles.caseHide);
dom.addClass(loginRef.current, styles.loginTimeShow);
videoTimeout = setTimeout(() => {
dom.removeClass(timeRef.current, styles.caseHide);
dom.addClass(timeRef.current, 'animate__fadeIn');
dom.removeClass(loginFormRef.current, styles.caseHide);
dom.addClass(loginFormRef.current, 'animate__fadeInUp');
dom.removeClass(footerRef.current, styles.caseHide);
dom.addClass(footerRef.current, 'animate__slideInUp');
dom.removeClass(titleRef.current, styles.caseHide);
dom.addClass(titleRef.current, 'animte__fadeInUp');
dom.removeClass(loginWrapper.current, styles.caseHide);
dom.addClass(loginWrapper.current, 'animate__fadeInUp');
}, 500);
});
}
});
}
return () => {
videoTimeout && clearTimeout(videoTimeout);
videoRef && videoRef.current && videoRef.current.removeEventListener('ended', () => {});
};
}, [videoRef]);
useEffect(() => {
setSubmitting(false);
}, [visible]);
const renderAddons = useRenderQcode(props.global);
const renderPlatform = () => {
const template = props.global.loginTemplate;
const params = {
fromRef: formRef,
type,
setType,
status,
submitting,
autoLogin,
setAutoLogin,
action,
onSubmit: handleSubmit,
loginMode: props.loginMode,
updateLoginMode: props.updateLoginMode,
};
switch (template) {
case 'DarkCloud.html':
case 'Dark.html':
return <Account {...params} />;
case 'Dark - IOTMultiLogin.html':
return <IotComponent {...params} />;
default:
return <Account {...params} />;
}
};
/* eslint-disable */
return (
<HelmetProvider>
<Helmet>
<title>{props.global.title || defaultSetting.title}</title>
<meta name="description" content={props.global.title || defaultSetting.title} />
</Helmet>
<div className={styles.main}>
{showVideo && <video
src={require("../../../../assets/videos/001.mp4") }
className={styles.videLayer}
autoPlay="autoPlay"
muted
playsInline="playsinline"
ref={videoRef}
/>}
<div className={classNames(styles.inner, styles.newYearInner)}>
<div
className={classNames(styles.loginTime, styles.newYearLoginTime, styles.caseHide, 'animated')}
ref={loginRef}
>
<img
role="logo"
src={props.global && props.global.transformDevAssetsBaseURL && props.global.transformDevAssetsBaseURL(props.global.logo)}
/>
<div
className={classNames(
styles.titleCase,
styles.caseHide,
'animated',
)}
ref={titleRef}
>
<span className={styles.title}>{props.global.title}</span>
<span className={styles.subtitle}>
{window.globalConfig && window.globalConfig.subtitle}
</span>
</div>
</div>
<span
className={classNames(
styles.divider,
styles.caseHide,
'animate__animated',
)}
/>
<div
className={classNames(
styles.timeCase,
styles.caseHide,
'animate__animated',
)}
ref={timeRef}
>
<span className={styles.time}>{currentDate.time}</span>
<span className={styles.dayofweek}>{currentDate.dayofweek}</span>
<span className={styles.date}>{currentDate.date}</span>
</div>
<div className={classNames(
styles.loginBlockWrapper,
'animate__animated',
styles.caseHide,
)} ref={loginWrapper}>
<div
className={classNames(
styles['login-block'],
styles['login-newYear-block'],
styles.caseHide,
'animate__animated',
)}
ref={loginFormRef}
>
<div>
<img src="https://panda-water.cn/web4/assets/images/login/workflow/%E6%99%BA%E8%81%94%E6%96%B0%E6%98%A5%E5%9B%BE%E7%89%87.png" />
</div>
<div className={styles['login-form']} style={{marginTop: '20px'}}>{renderPlatform()}</div>
</div>
</div>
</div>
{/* <div
className={classNames(
styles.footerCase,
styles.caseHide,
'animate__animated',
)}
ref={footerRef}
>
<div className={classNames(styles.quickMark)}>{renderAddons}</div>
<span className={classNames(styles.copyright)}>
Copyright ©
<a target="_blank" href="https://panda-water.cn">
熊猫智慧水务
</a>
{new Date().getFullYear()} All Rights Reserved{' '}
<a target="_blank" id="IndexCaseNumber" href="https://beian.miit.gov.cn">
沪ICP备18045097号-1
</a>
<span className="addons">
<span className="split" />
<a id="qrcode">
<span
className="glyphicon glyphicon-qrcode"
role="button"
title="手持APP下载"
/>
</a>
</span>
</span>
</div> */}
<Modal
centered
visible={visible}
width={340}
footer={null}
closable={false}
bodyStyle={{ padding: '15px' }}
>
<div ref={sliVerify} />
</Modal>
</div>
</HelmetProvider>
);
});
const mapStateToProps = state => ({
global: state.getIn(['global', 'globalConfig']),
loginMode: state.getIn(['global', 'loginMode']),
});
const mapDispatchToProps = dispatch => ({
updateConfig(config) {
dispatch(actionCreators.getConfig(config));
},
createContext(data) {
dispatch(actionCreators.createContext(data));
},
updateLoginMode(mode) {
dispatch(actionCreators.changeLoginMode(mode));
},
updateCurrentIndex(index) {
dispatch(actionCreators.updateCurrentIndex(index));
},
});
export default connect(
mapStateToProps,
mapDispatchToProps,
)((Login));
import 'kit_utils/lib/format';
import React, { forwardRef, useEffect, useRef, useState } from 'react';
import { Modal } from 'antd';
// eslint-disable-next-line import/no-unresolved
import classNames from 'classnames';
import { dom } from '@wisdom-utils/utils/lib/helpers';
import { Helmet, HelmetProvider } from 'react-helmet-async';
import { connect } from 'react-redux';
import { useHistory } from '@wisdom-utils/runtime';
import { actionCreators } from '@/containers/App/store';
import defaultSetting from '../../../../../../config/defaultSetting';
import LoginAction from '../../login';
import styles from './style.less';
import useRenderQcode from '../../js/useRenderQcode';
import Account from '../../js/useAccount';
import IotComponent from '../../js/useIOTComponent';
import { defaultApp } from '../../../../../micro';
import Krpano from '../../components/Krpano';
const PanoBaseLogin = forwardRef((props, _ref) => {
const videoRef = useRef();
const loginRef = useRef();
const timeRef = useRef();
const titleRef = useRef();
const sliVerify = useRef();
const loginFormRef = useRef();
const formRef = useRef(null);
const footerRef = useRef();
const [status, setStatus] = useState('normal');
const [autoLogin, setAutoLogin] = useState(false);
const [submitting, setSubmitting] = useState(false);
const [currentDate, setCurrentDate] = useState({});
const [type, setType] = useState('Account');
const [visible, setVisible] = useState(false);
const history = useHistory();
const [action, setAction] = useState(() => new LoginAction(Object.assign({}, props, { history }), setVisible, false));
let { ddCode } = props.global;
const loginMode =props.loginMode;
const { projectName } = props.loginParams
if (loginMode && loginMode === 'iotWechat') ddCode = null;
// useEffect(() => {
// action.globalConfig = props.global;
// }, [props.global]);
const handleSubmit = values => {
/* eslint-disable */
action &&
(type === 'Account'
? action.loginHandler(
values.userName,
values.password,
null,
autoLogin,
sliVerify,
)
: type === 'Mobile'
? action.phoneLoginFormHandler(values.mobile, values.captcha)
: null);
setSubmitting(true);
props.updateCurrentIndex && props.updateCurrentIndex(-1);
};
useEffect(() => {
// if (props.loginMode === LOGIN_WAY.WeChart) {
action &&
action.events.on('loginSuccess', event => {
setSubmitting(false);
props.updateCurrentIndex && props.updateCurrentIndex(0);
props.history.push(`/?client=${props.global.client}`);
// window.share.event.emit('triggerMicro', props.global);
// initMicroApps();
defaultApp();
});
action &&
action.events.on('loginError', event => {
setVisible(false);
setSubmitting(false);
});
action &&
action.events.on('loginVisible', status => {
setVisible(status);
});
// }
return () => {
action && action.events && action.events.removeAllListeners('loginSuccess');
action && action.events && action.events.removeAllListeners('loginError');
action && action.events && action.events.removeAllListeners('loginVisible');
}
}, [props.loginMode]);
let loginTimeInterval = null;
useEffect(() => {
if (loginTimeInterval)
clearInterval(loginTimeInterval), (loginTimeInterval = null);
loginTimeInterval = setInterval(() => {
const date = new Date();
const weekday = ['周日', '周一', '周二', '周三', '周四', '周五', '周六'];
const time = `${date.getHours() < 10 ? `0${date.getHours()}` : date.getHours()
}:${date.getMinutes() < 10 ? `0${date.getMinutes()}` : date.getMinutes()
}:${date.getSeconds() < 10 ? `0${date.getSeconds()}` : date.getSeconds()
}`;
setCurrentDate({
time,
dayofweek: weekday[date.getDay()],
date: date.pattern('yyyy/MM/dd'),
});
}, 1000);
return () => {
loginTimeInterval && clearInterval(loginTimeInterval);
};
}, []);
useEffect(() => {
setSubmitting(false);
}, [visible]);
const renderAddons = useRenderQcode(props.global);
const renderPlatform = () => {
const template = props.global.loginTemplate;
const params = {
fromRef: formRef,
type,
setType,
status,
submitting,
autoLogin,
setAutoLogin,
action,
onSubmit: handleSubmit,
loginMode: props.loginMode,
updateLoginMode: props.updateLoginMode,
};
switch (template) {
case 'DarkCloud.html':
case 'Dark.html':
return <Account {...params} />;
case 'Dark - IOTMultiLogin.html':
return <IotComponent {...params} />;
default:
return <Account {...params} />;
}
};
/* eslint-disable */
return (
<HelmetProvider>
<Helmet>
<title>{props.global.title || defaultSetting.title}</title>
<meta name="description" content={props.global.title || defaultSetting.title} />
</Helmet>
<div className={styles.main}>
<div className={styles.inner}>
<div
className={classNames(styles.loginTime)}
ref={loginRef}
>
<img
role="logo"
src={props.global && props.global.transformDevAssetsBaseURL && props.global.transformDevAssetsBaseURL(props.global.logo)}
/>
<div
className={classNames(
styles.titleCase
)}
ref={titleRef}
>
<span className={styles.title}>{props.global.title}</span>
<span className={styles.subtitle}>
{window.globalConfig && window.globalConfig.subtitle}
</span>
</div>
</div>
<div
className={classNames(
styles.timeCase
)}
ref={timeRef}
>
<span className={styles.time}>{currentDate.time}</span>
<span className={styles.dayofweek}>{currentDate.dayofweek}</span>
<span className={styles.date}>{currentDate.date}</span>
</div>
<div
className={classNames(
styles['login-block']
)}
ref={loginFormRef}
>
<div>
<img src="https://panda-water.cn/web4/assets/images/login/dark/login.png" />
</div>
<div className={styles['login-form']}>{renderPlatform()}</div>
</div>
</div>
{projectName ? <div className={styles.krpano}>
<Krpano projectName={projectName} />
</div> : null}
<Modal
centered
visible={visible}
width={340}
footer={null}
closable={false}
bodyStyle={{ padding: '15px' }}
>
<div ref={sliVerify} />
</Modal>
</div>
</HelmetProvider>
);
});
const mapStateToProps = state => ({
global: state.getIn(['global', 'globalConfig']),
loginMode: state.getIn(['global', 'loginMode']),
});
const mapDispatchToProps = dispatch => ({
updateConfig(config) {
dispatch(actionCreators.getConfig(config));
},
createContext(data) {
dispatch(actionCreators.createContext(data));
},
updateLoginMode(mode) {
dispatch(actionCreators.changeLoginMode(mode));
},
updateCurrentIndex(index) {
dispatch(actionCreators.updateCurrentIndex(index));
},
});
export default connect(
mapStateToProps,
mapDispatchToProps,
)((PanoBaseLogin));
import BaseLogin from "../baseLogin" import PanoBaseLogin from "./PanoBaseLogin"
import TieShanLogin from "../project/tieshan" import TieShanLogin from "../project/tieshan"
import { useState , useEffect } from "react" import { useState , useEffect } from "react"
const LoginTemplate = { const LoginTemplate = {
"铁山" : TieShanLogin, "铁山" : TieShanLogin,
default : BaseLogin default : PanoBaseLogin
} }
const Panorama = props => { const Panorama = props => {
......
@import '~antd/es/style/themes/variable.less';
@userPageLogin-prefix-cls: ~'@{ant-prefix}-pro-pages-user-login';
@keyframes loginTimeShow {
0% {
opacity: 1;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
zoom: 2;
}
50% {
opacity: 1;
top: 28px;
left: 45px;
transform: translate(0, 0);
zoom: 1;
}
60% {
opacity: 1;
left: 45px;
top: 28px;
transform: translate(0, 0);
}
70% {
opacity: 1;
left: 45px;
top: 28px;
transform: translate(0, 0);
}
75% {
opacity: 1;
left: 45px;
top: 28px;
transform: translate(0, 0);
}
100% {
opacity: 1;
left: 45px;
top: 28px;
transform: translate(0, 0);
}
}
.main {
// width: 368px;
margin: 0 auto;
height: 100%;
width: 100%;
@media screen and (max-width: @screen-sm) {
width: 95%;
}
.icon {
margin-left: 16px;
color: rgba(0, 0, 0, 0.2);
font-size: 24px;
vertical-align: middle;
cursor: pointer;
transition: color 0.3s;
&:hover {
color: @primary-color;
}
}
.other {
margin-top: 24px;
line-height: 22px;
text-align: left;
.register {
float: right;
}
}
.videLayer {
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
object-fit: fill;
}
.inner {
position: absolute;
width: 100%;
height: 100%;
&.newYearInner {
height: 100%!important;
}
.loginTime {
position: absolute;
top: 25px;
left: 50px;
display: flex;
align-items: center;
justify-content: center;
opacity: 1;
z-index: 100;
&.newYearLoginTime {
position: absolute!important;
top: 28px!important;
left: 45px!important;
display: flex;
align-items: center;
justify-content: center;
z-index: 100;
transform: inherit!important;
}
img[role='logo'] {
height: 40px;
vertical-align: middle;
}
&.loginTimeShow {
animation-name: loginTimeShow;
animation-duration: 1s;
animation-iteration-count: 1;
animation-fill-mode: forwards;
}
.titleCase {
display: flex;
flex-direction: column;
margin: -5px 0 0 20px;
max-width: 570px;
.title,
.subtitle {
font-family: 'Microsoft YaHei';
text-align: left;
overflow-wrap: break-word;
color: #ffffff;
}
.title {
font-size: 28px;
}
.subtitle {
font-size: 12px;
line-height: 1;
}
}
}
.timeCase{
position: absolute;
width: 100%;
z-index: 200;
}
.timeCase {
.time,
.dayofweek,
.date {
position: absolute;
font-family: 'MicrosoftYaHeiUI';
color: rgba(255, 255, 255, 1);
}
.time {
top: 26px;
right: 170px;
font-size: 40px;
margin-right: 10px;
}
.dayofweek {
top: 32px;
right: 125px;
font-size: 16px;
}
.date {
top: 57px;
right: 95px;
font-size: 14px;
}
}
.loginBlockWrapper {
width: 100%;
height: 100%;
background-image: url(https://panda-water.com/web4/assets/images/login/workflow/智联新春背景.png);
background-size: 100% 100%;
background-repeat: no-repeat;
}
.login-block {
width: 800px;
position: absolute;
left: 50%;
top: 50%;
display: flex;
background:rgba(255,255,255,0.5);
transform: translate(-50%,-50%);
z-index: 100;
&.login-newYear-block {
width: 994px!important;
height: 424px!important;
margin-left: -497px!important;
margin-top: -212px!important;
background: url(https://panda-water.com/web4/assets/images/login/workflow/%E6%99%BA%E8%81%94%E6%96%B0%E6%98%A5%E8%83%8C%E6%99%AF%E6%A1%86.png)!important;
//width: 994px;
//height: 424px;
//position: absolute;
//left: 50%;
//top: 50%;
//margin-left: -497px;
//margin-top: -212px;
//display: flex;
background-size: 100% 100%;
background-repeat: no-repeat;
img {
margin-top: 90px;
margin-left: 168px;
}
.login-form {
display: flex;
align-items: center;
margin-left: 32px;
padding: 0;
background: transparent;
margin-top: -36px;
// :global {
// .ant-btn-primary {
// background: #ff9600 !important;
// border-color: #ff9600 !important;
// }
// }
}
}
img {
margin-top: 50px;
margin-bottom: 50px;
margin-left: 30px;
}
.login-form {
padding: 50px 50px 50px;
// background-color: #ffffff;
}
}
}
.footerCase {
width: 100%;
height: 16%;
background: #fff;
position: absolute;
bottom: 0;
left: 0;
.quickMark {
position: absolute;
bottom: 48px;
text-align: center;
width: 100%;
font-size: 12px;
min-height: 71px;
&-single {
text-align: center;
width: 120px;
display: inline-block;
span {
&.Android {
display: block;
background-image: url(https://panda-water.cn/web4/assets/images/login/dark/Android1.png);
width: 26px;
height: 32px;
margin: auto;
margin-bottom: 6px;
}
&.Wechat {
display: block;
background-image: url(https://panda-water.cn/web4/assets/images/login/dark/Wechat1.png);
width: 34px;
height: 32px;
margin: auto;
margin-bottom: 6px;
}
&.iphone {
display: block;
background-image: url(https://panda-water.cn/web4/assets/images/login/dark/iphone1.png);
width: 28px;
height: 32px;
margin: auto;
margin-bottom: 6px;
}
}
}
.Android-single .Android-code,
.iphone-single .iphone-code {
margin: 0px 0px 10px 0px;
width: 150px;
height: 150px;
background: #fff;
padding: 5px;
display: none;
transform: translateX(-15px);
}
.icon-Container {
height: 50px;
cursor: pointer;
}
}
.copyright {
position: absolute;
z-index: 2;
text-align: center;
width: 100%;
bottom: 10px;
font-size: 13pz;
color: #000000;
.frontIcon {
margin-top: -5px;
}
a {
color: #000000;
}
.addons {
display: none;
}
.split {
border-left: 1px solid #000000;
margin: 0 8px;
}
.glyphicon-qrcode {
vertical-align: text-top;
}
}
}
:global {
.antd-pro-login-submit {
width: 100%;
margin-top: 24px;
}
}
.wechatQRcode {
width: 250px;
height: 220px;
margin: 0 15px;
}
.loginDisplay {
width: 100%;
display: flex;
justify-content: space-between;
font-size: 12px;
a {
&:hover {
color: @primary-color;
transition: all 0.3s ease-in-out;
}
}
}
.captcha {
color: @primary-6;
font-weight: 400;
cursor: pointer;
font-size: 12px;
}
}
.krpano {
position: absolute;
left: 0;
top: 0;
right: 0;
bottom: 0;
}
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
import React, { forwardRef, useEffect, useRef, useState } from 'react'; /* eslint-disable */
/*
import { Modal } from 'antd'; * @Author: xule;
import { Helmet, HelmetProvider } from 'react-helmet-async'; * @Date: 2021-11-22
* @Description:榆林登录页;
*/
import React from 'react';
import styles from './index.less'
import classNames from 'classnames';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { useHistory, withRouter } from '@wisdom-utils/runtime'; import { CheckOutlined } from '@ant-design/icons';
import { actionCreators } from '@/containers/App/store'; import { withRouter } from '@wisdom-utils/runtime';
import defaultSetting from '../../../../../../../config/defaultSetting'; import LogoQ from './images/切换.png'
import LogoF from './images/电脑切换.png'
import qrcodeimg from './images/下载二维码.png'
import qrcodeS from './images/扫.png'
import Logo from './images/登录图标.png'
import Logoimg from './images/登录logo.png'
import Code from '@/assets/images/login/榆林/小程序@2x.png'
import MyHead from '@/assets/images/login/榆林/d-我的.png'
import PassWord from '@/assets/images/login/榆林/密码.png'
import Close from '@/assets/oa/login/close.png'
import Open from '@/assets/oa/login/open.png'
import LoginAction from '../../../login'; import LoginAction from '../../../login';
import styles from './index.less'; import { actionCreators } from '@/containers/App/store';
import Account from '../../../js/useAccount'; import Cookies from 'js-cookie';
import { defaultApp } from '../../../../../../micro';
import QRCode from 'qrcode.react'; import QRCode from 'qrcode.react';
import classnames from 'classnames'; import { defaultApp } from '../../../../../../micro';
const Logger = logger('login');
const renderQRCode = props => { // 、登录页
const qrcodes = props.qrcode.split('|') || []; class InfoLogin extends React.Component {
if (qrcodes.length > 0 && qrcodes[0]) { state = {
let value = qrcodes[0].replace(/{ip}/gi, props.ip || window.location.host).split('=')[1]; loginStyle: false, //true 账号密码登录 false 扫码登录
return <QRCode value={value} />; isOpen: false, //查看密码
isRember: false, //记住密码
ddOrWeixin: '',
qrcode: '',//二维码
codeLenth: 1,
time: '',
week: '',
date: '',
isQrcode: false
} }
return <span>手持APP下载未配置</span>; componentDidMount() {
}; let action = new LoginAction(this.props, false, true)
this.loginEvent(action);
const Login = forwardRef((props, _ref) => { this.renderQRcode();
const sliVerify = useRef(); this.renderTime();
const loginFormRef = useRef(); }
const formRef = useRef(null); renderQRcode() {
const [status, setStatus] = useState('normal'); var me = this;
var list = globalConfig.qrcode ? globalConfig.qrcode.split("|") : [];
const [autoLogin, setAutoLogin] = useState(false); let str = [];
const [submitting, setSubmitting] = useState(false); if (list.length) {
const [type, setType] = useState('Account'); list.forEach(function (val, index) {
const [visible, setVisible] = useState(false); if (val && val.replace(/ /g, "").length > 0) {
const history = useHistory(); str.push(me.creatCodeHtml(val, index));
const [action, setAction] = useState(() => new LoginAction(Object.assign({}, props, { history }), setVisible, false)); }
})
const handleSubmit = values => { } else {
/* eslint-disable */ str.push(<span>手持APP下载未配置</span>);
action && }
(type === 'Account' this.setState({
? action.loginHandler(values.userName, values.password, null, autoLogin, sliVerify) qrcode: str,
: type === 'Mobile' codeLenth: list.length
? action.phoneLoginFormHandler(values.mobile, values.captcha) })
: null); }
renderTime() {
setSubmitting(true); let me = this;
props.updateCurrentIndex && props.updateCurrentIndex(-1); setInterval(() => {
}; const date = new Date();
const weekday = ['周日', '周一', '周二', '周三', '周四', '周五', '周六'];
const time = `${date.getHours() < 10 ? `0${date.getHours()}` : date.getHours()
}:${date.getMinutes() < 10 ? `0${date.getMinutes()}` : date.getMinutes()}`;
me.setState({
time,
week: weekday[date.getDay()],
date: date.pattern('yyyy/MM/dd'),
})
}, 1000);
useEffect(() => { }
action && creatCodeHtml(val, index) {
action.events.on('loginSuccess', event => { return (
setSubmitting(false); <div className={('codeCase codeCase' + index)}>
props.updateCurrentIndex && props.updateCurrentIndex(0); <QRCode value={val.replace(/{ip}/ig, globalConfig.ip).split('=')[0]} />
props.history.push(`/?client=${props.global.client}`); <div className={styles.codeText}>{val.replace(/{ip}/ig, globalConfig.ip).split('=')[0]}</div>
// window.share.event.emit('triggerMicro', props.global); </div>);
// initMicroApps(); }
defaultApp(); // 切换登录方式
}); changeloginStyle = () => {
action && const { ddOrWeixin } = this.state
action.events.on('loginError', event => { this.setState({
setVisible(false); loginStyle: !this.state.loginStyle,
setSubmitting(false); ddOrWeixin: ddOrWeixin ? '' : 'dingding'
}); }, () => {
action && Cookies.set('loginMode', `${this.state.ddOrWeixin ? 'dingding' : 'pdw'}`, {
action.events.on('loginVisible', status => { path: '/',
setVisible(status);
}); });
return () => { if (this.state.ddOrWeixin === 'dingding') {
action && action.events && action.events.removeAllListeners('loginSuccess'); let action = new LoginAction(this.props, false, true)
action && action.events && action.events.removeAllListeners('loginError'); action.loginByDD()
action && action.events && action.events.removeAllListeners('loginVisible'); }
}; })
}, [props.loginMode]); }
// 查看密码
useEffect(() => { seePassWord = (e) => {
setSubmitting(false); this.setState({
}, [visible]); isOpen: !this.state.isOpen
})
}
// 记住密码
remberWord = () => {
this.setState({
isRember: !this.state.isRember
})
}
// 输入框变化
handleForm = (e) => {
const target = e.target
// 判断事件类型,如果是checkbox返回checked值,不是返回文本框的value值
const value = target.type == 'checkbox' ? target.checked : target.value;
// 获取文本框的name值
const name = target.name
this.setState({
[name]: value
})
}
onKeyDownchange(e){
if(e.keyCode == 13){
this.loginToWeb5();
}
}
//
checkLogType = () => {
this.setState({
isQrcode: !this.state.isQrcode
})
}
// 登录
loginToWeb5 = () => {
const { loginName, passWord, isRember } = this.state
let action = new LoginAction(this.props, false, true)
action.loginHandler(loginName, passWord, null, isRember, false)
this.loginEvent(action)
const renderPlatform = () => { }
const template = props.global.loginTemplate; // 登录成功事件
const params = { loginEvent(action) {
fromRef: formRef, action.globalConfig = this.props.global;
type, this.props.updateCurrentIndex && this.props.updateCurrentIndex(-1);
setType, action && action.events.on('loginSuccess', event => {
status, this.props.updateCurrentIndex && this.props.updateCurrentIndex(0);
submitting, this.props.history.push(`/?client=${this.props.global.client}`);
autoLogin, // window.share.event.emit('triggerMicro', this.props.global);
setAutoLogin, defaultApp();
action, });
onSubmit: handleSubmit, action && action.events.on('loginError', event => {
loginMode: props.loginMode,
updateLoginMode: props.updateLoginMode,
welcome: null,
};
return <Account {...params} />;
};
/* eslint-disable */
});
action && action.events.on('loginVisible', status => {
return ( });
<HelmetProvider> }
<Helmet> render() {
<title>{props.global.title || defaultSetting.title}</title> const { loginStyle, isOpen, isRember, loginName, passWord, qrcode, codeLenth, time, week, date, isQrcode } = this.state
<meta name="description" content={props.global.title || defaultSetting.title} /> return (
</Helmet> <div className={styles.InfoBg}>
<div className={styles.login}> <div className={styles.IBtimeBox}>
<div className={styles['inner-wrapper']}> <div className={styles.TitleCont}>
<div className={styles['inner-center']}> <img src={Logoimg} alt=""></img>
<div className={styles['img-wrapper']} /> </div>
<div className={classnames(styles['inner-bg'], styles['login-part'])} ref={loginFormRef}> <span className={styles.IBTtime}>{time}</span>
{renderPlatform()} <span className={styles.IBTweek}>{week}</span>
</div> <span className={styles.IBTdate}>{date}</span>
<div className={styles['APPcodeBox']}> </div>
<p className={styles['APPCtext']}>查看二维码,扫码下载APP</p> <div className={styles.loginBg}>
<div className={styles['APPCimg']}>{renderQRCode(props.global)}</div> {/* 标题 */}
{/* <div className={styles.IBtitle}>
<img src={Logo} alt="" />
</div> */}
<div className={styles.IBcenter}>
<div className={styles.IBCleft}></div>
<div className={styles.IBCright}>
<div className={styles.IBlogoc}>
<img src={isQrcode ? LogoF : LogoQ} alt='' onClick={() => this.checkLogType()}></img>
</div>
<div className={styles.IBLogoForm} style={{ display: isQrcode ? 'none' : '' }}>
<div className={styles.IBlogo}>
<img src={Logo} alt=''></img>
</div>
{/* 登录主题 */}
<form className={styles.loginForm} >
<div className={styles.formgroup}>
<img className={styles.IBCRimg} src={MyHead} alt="" />
<input type="text" className={styles.inputLg} id='loginName' name='loginName' value={loginName} onChange={this.handleForm} placeholder="请输入你的用户名" />
</div>
<div className={styles.formgroup}>
<img className={styles.IBCRimg} src={PassWord} alt="" />
<input type={isOpen ? 'text' : "password"} className={styles.inputLg} onKeyDown={e=> this.onKeyDownchange(e)} id='passWord' name='passWord' value={passWord} onChange={this.handleForm} placeholder="请输入你的密码" />
<img className={styles.eyes} src={isOpen ? Open : Close} alt="" onMouseDown={(e) => this.seePassWord(e)} onMouseUp={(e) => this.seePassWord(e)} />
</div>
<div className={styles.formgroup} style={{ position: 'relative', marginTop: '20px' }}>
<label className={classNames(isRember ? (styles.rmpwdInput, styles.active) : styles.rmpwdInput)} onClick={() => this.remberWord()}>
<CheckOutlined style={{ display: isRember ? '' : 'none' }} />
</label>
<span style={{ color: '#9FA8B3', marginLeft: '10px', fontSize: '14px' }}>记住密码</span>
</div>
<div className={styles.logoBtn}>
<div className={styles.submitBtn} onClick={this.loginToWeb5}>登录</div>
</div>
</form>
</div>
<div className={styles.IBLogoForm} style={{ display: isQrcode ? '' : 'none' }}>
<div className={styles.QrcodeCont}>
<img src={qrcodeimg} alt=''></img>
</div>
<div className={styles.qrcodedis}>
<img src={qrcodeS} alt=''></img>
<div className={styles.textCont}>
<p>打开手机扫一扫</p>
<p>
<span>下载</span>
<span className={styles.lastText}>熊猫掌天下</span>
</p>
</div>
</div>
</div>
</div> </div>
{/* <div className={styles.codeBox}>
<img className={styles.codeImg} src={Code} alt="" />
<div className={styles.codeBig} style={{ width: codeLenth * 148 + 'px' }}>
{qrcode}
</div>
</div> */}
</div> </div>
</div> </div>
<Modal centered visible={visible} width={340} footer={null} closable={false} bodyStyle={{ padding: '15px' }}>
<div ref={sliVerify} />
</Modal>
</div> </div>
</HelmetProvider>
);
});
)
}
}
const mapStateToProps = state => ({ const mapStateToProps = state => ({
global: state.getIn(['global', 'globalConfig']), global: state.getIn(['global', 'globalConfig']),
loginMode: state.getIn(['global', 'loginMode']), loginMode: state.getIn(['global', 'loginMode']),
...@@ -149,4 +262,5 @@ const mapDispatchToProps = dispatch => ({ ...@@ -149,4 +262,5 @@ const mapDispatchToProps = dispatch => ({
export default connect( export default connect(
mapStateToProps, mapStateToProps,
mapDispatchToProps, mapDispatchToProps,
)(withRouter(Login)); )(withRouter(InfoLogin));
.login {
width: 100%;
height: 100%;
background: url('./images/2.png') no-repeat center;
background-size: 100% 100%;
background-clip: border-box;
position: relative;
min-height: 7.0rem;
overflow: hidden;
}
.login .inner-bg { .InfoBg{
width: 100%; width: 100%;
height: 100%; height: 100%;
background-image: url('./images/背景.png');
background-size: cover;
&>div { background-repeat: no-repeat;
width: 70%; position: relative;
margin: 0 auto; .loginBg{
position: absolute;
top: 40%;
left: 40%;
margin-left: -385px;
margin-top: -226px;
width: 1101px;
height: 646px;
background-image: url('./images/标题.png');
background-size: 100% 100%;
background-repeat: no-repeat;
.IBcenter{
width: 100%;
height: 596px;
margin-top: 50px;
.IBCleft{
width: 682px;
height: 100%;
background-image: url('./images/左图.png');
background-size: 100% 100%;
background-repeat: no-repeat;
float: left;
}
.IBCright{
width: 419px;
height: 100%;
float: left;
background: rgba(255,255,255,0.8);
.IBlogoc{
height: 74px;
width: 100%;
text-align: end;
img{
height: 74px;
width: 74px;
cursor: pointer;
}
}
.IBLogoForm{
.IBlogo{
height: 100px;
width: 100%;
text-align: center;
img{
height: 100px;
width: 100px;
}
}
.QrcodeCont{
text-align: center;
height: 360px;
width: 100%;
padding-top: 80px;
img{
width: 211px;
height: 211px;
}
}
.qrcodedis{
display: flex;
padding: 0px 40px 0px 105px;
img{
width: 48px;
height: 40px;
margin-top: 10px;
}
.textCont{
margin-left: 25px;
font-size: 16px;
p{
margin-bottom: 5px;
color: #333333;
.lastText{
margin-left: 5px;
color: #1568BA;
}
}
}
}
}
}
}
.IBtitle{
width: 100%;
height: 10.5%;
text-align: center;
img{
width: 70%;
height: 100%;
}
}
.title{
font-family: SourceHanSansCN-Medium;
font-weight: bold;
color: #43484D;
position: absolute;
top: 21px;
right: 50%;
margin-right: -285px;
line-height: 1;
width: 570px;
text-align: center;
overflow-wrap: break-word;
font-size: 24px;
img{
margin-right: 14px;
}
}
.ddCode{
position: absolute;
top: 50px;
right: -9px;
cursor: pointer;
}
.titleImg {
position: absolute;
top: 132px;
right: 133px;
}
.loginForm{
width: 280px;
margin: 9% auto 25%;
.formgroup{
position: relative;
line-height: 1;
display: flex;
align-items: center;
.IBCRimg{
top: 33px;
}
img{
position: absolute;
left: 10px;
top: 50%;
}
.eyes{
left: 89%;
margin-top: 10px;
cursor: pointer;
}
input[type="checkbox"] {
width: 12px;
height: 12px;
}
input {
font-size: 16px;
outline: 0;
}
span {
position: relative;
top: 0px;
}
.formControl{
display: block;
width: 100%;
}
.inputLg{
padding-left: 42px;
color: #2D3033;
border: none;
box-shadow: none;
border-radius: 0;
padding: 10px 50px;
line-height: 1.3333333;
margin-top: 21px;
}
}
.logoBtn{
margin-top: 50px;
height: 45px;
width: 100%;
padding-left: 30px;
.submitBtn {
width: 220px;
background-color: #1568BA !important;
border: none !important;
color: #fff !important;
outline: none !important;
border-color: transparent !important;
height: 45px;
line-height: 45px;
font-size: 18px;
text-align: center;
cursor: pointer;
border-radius: 23px;
}
}
}
.login_container {
position: absolute;
top: 59%;
left: 52%;
margin-left: 150px;
margin-top: -219px;
width: 400px;
height: 500px;
} }
.wxlogin_container{
position: absolute;
top: 60%;
left: 55%;
margin-left: 150px;
margin-top: -219px;
width: 300px;
height: 300px;
background: #fff;
}
.changeCode {
position: absolute;
top: 80%;
left: 75%;
align-items: center;
font-size: 14px;
display: flex;
} }
.inner-wrapper {
width: 29.6%;
position: absolute;
top: 46%;
right: 0;
transform: translateY(-50%);
}
.img-wrapper {
width: 388px;
height: 134px;
background: url('./images/1.png') no-repeat center;
background-size: 100% 100%;
margin-bottom: 48px;
}
.login .inner-bg img[role="logo"] {
height: 40px;
}
.login .inner-bg .title {
font-size: 27px;
font-weight: bold;
color: rgba(255, 255, 255, 1);
letter-spacing: 2px;
}
@keyframes waving {
from {
top: 0;
} }
.IBCRnamec{
to { margin-top: 15%;
top: 10px; height: 22px;
font-size: 22px;
letter-spacing: 1px;
font-family: PingFang SC;
font-weight: bold;
color: #0599F4;
line-height: 37px;
text-align: center;
margin-bottom: 0;
} }
} .IBCRnameE{
height: 9px;
@keyframes waving2 { font-size: 1px;
from { color: #0599F4;
left: 0; line-height: 32px;
text-align: center;
} }
.rmpwdInput{
to { display: inline-block;
left: -9999px; width: 20px;
height: 20px;
border-radius: 10px;
border: 1px solid #0599F4;
position: relative;
cursor: pointer;
margin-left: 8px;
span{
font-size: 12px;
color: #fff;
visibility: hidden;
position: absolute;
top: 3px;
left: -7px;
}
} }
} .active{
display: inline-block;
.form-control:focus { width: 20px;
border-color: #66afe9; height: 20px;
outline: 0; border-radius: 10px;
-webkit-box-shadow: none; border: 1px solid #0599F4;
box-shadow: none; position: relative;
} cursor: pointer;
background-color: #0599F4;
margin-left: 10px;
.inner-center { span{
display: flex; visibility: visible;
flex-flow: column; color: #fff;
align-items: center; font-size: 15px;
} color: #fff;
position: absolute;
.formgroup2 { top: 3px;
display: flex; left: 1px;
align-items: center; font-weight: bold;
display: flex; }
margin: 0px 5.5%; }
margin-bottom: 10%; .codeBox{
align-items: center; width: 34px;
margin-bottom: 40px; height: 34px;
} position: absolute;
right: -34px;
.APPcodeBox { bottom: 0px;
width: 100%; background: rgba(255, 255, 255, 0.7);
display: flex; padding: 6px;
flex-flow: column; border-radius: 0 3px 3px 0;
align-items: center; cursor: pointer;
cursor: pointer; }
position: relative; .codeImg{
} width: 23px;
}
.APPCtext { .codeBig{
font-size: 14px; width: 128px;
font-family: Microsoft YaHei; height: 150px;
font-weight: 400; position: absolute;
color: #000000; bottom: 0;
line-height: 30px; left: 0px;
opacity: 0.75; background: rgba(255, 255, 255, 0.7);
} padding: 6px;
display: none;
.APPCimg { justify-content: space-around;
width: 138px; span{
height: 150px; font-size: 12px;
background: url('./images/3.png'); font-weight: 100;
background-size: 100% 100%; }
background-repeat: no-repeat; }
display: none; .codeBox:hover .codeBig{
position: absolute; display: block;
top: 20px; }
left: 50%; .codeBox:hover .codeImg{
transform: translateX(-50%); display: none;
padding: 23px 11px 12px; }
span { .codeText{
font-size: 12px; font-size: 14px;
opacity: 0.75; font-family: PingFang SC;
font-weight: bold;
color: #121F2B;
text-align: center;
line-height: 24px;
}
.codeBox:hover .codeBig {
display: flex;
}
.IBtimeBox{
.TitleCont{
padding: 24px 0px 0px 32px;
img{
width: 496px;
height: 56px;
}
}
}
.IBTtime{
position: absolute;
width: 88px;
height: 26px;
font-size: 32px;
font-family: Microsoft YaHei UI;
font-weight: 400;
color: #FFFFFF;
line-height: 34px;
top: 34px;
right: 130px;
}
.IBTweek{
position: absolute;
top: 25px;
right: 69px;
height: 15px;
font-size: 16px;
font-family: Source Han Sans CN;
font-weight: 200;
color: #FFFFFF;
line-height: 30px;
}
.IBTdate{
position: absolute;
top: 46px;
right: 36px;
width: 80px;
height: 13px;
font-size: 14px;
font-family: Microsoft YaHei UI;
font-weight: 300;
color: #FFFFFF;
line-height: 30px;
} }
}
.APPcodeBox:hover .APPCtext {
color: #1685FF;
}
.APPcodeBox:hover .APPCimg {
display: flex;
}
.APPCimg .codeCase {
text-align: center;
padding-top: 32px;
} }
\ No newline at end of file
...@@ -58,9 +58,17 @@ export const AppInitState = () => { ...@@ -58,9 +58,17 @@ export const AppInitState = () => {
const client = value && value !== 'undefined' ? value : 'city'; const client = value && value !== 'undefined' ? value : 'city';
return client; return client;
}; };
const getUrlToken = () => {
const value = params.getParams('token');
const token = value && value !== 'undefined' ? value : null;
return token;
};
const client = getClient(); const client = getClient();
const token = getUrlToken();
if (sessionStorage.getItem('client') !== client) {
sessionStorage.setItem('client', client);
}
let config = window.globalConfig || {}; let config = window.globalConfig || {};
// eslint-disable-next-line no-undef, no-restricted-globals // eslint-disable-next-line no-undef, no-restricted-globals
createStoreage.remove(`__PANDA_STORE__${location.hostname}`); createStoreage.remove(`__PANDA_STORE__${location.hostname}`);
...@@ -162,7 +170,8 @@ export const AppInitState = () => { ...@@ -162,7 +170,8 @@ export const AppInitState = () => {
initMicroApps(); initMicroApps();
} }
// eslint-disable-next-line no-new // eslint-disable-next-line no-new
if (getToken()) { // 增加免登判定
if (!token && getToken()) {
// eslint-disable-next-line no-new // eslint-disable-next-line no-new
const action = new Login( const action = new Login(
{ {
......
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