Commit 619e0958 authored by 杨思琦's avatar 杨思琦

Merge branch 'dev' into 'master'

Dev See merge request !22
parents 96a8a85c ec309ca1
Pipeline #75535 passed with stages
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 25.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="图层_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 25 26" style="enable-background:new 0 0 25 26;" xml:space="preserve">
<style type="text/css">
.st0{fill:#FFFFFF;}
</style>
<g>
<g>
<path class="st0" d="M19.82,3.9c-0.67-0.57-1.5-0.57-2.09-0.16c-0.67,0.41-0.92,1.06-0.75,1.79c0,0.65,0.5,0.98,1,1.3
c3.51,2.68,4.51,7.15,2.42,11.05c-1.84,3.41-6.01,5.28-9.85,4.47c-3.92-0.81-6.93-4.31-7.01-8.21c-0.08-3.01,1.08-5.44,3.59-7.31
c0.92-0.73,1.09-1.79,0.42-2.52C6.89,3.49,5.88,3.41,4.88,4.14c-4.17,3.17-5.93,8.69-4.26,13.41C2.3,22.59,7.05,26,12.48,26
C19.32,26,25,20.64,25,13.89C25.08,9.75,23.24,6.42,19.82,3.9L19.82,3.9z M19.82,3.9"/>
</g>
<path class="st0" d="M11.89,13.73c1.25,0.41,2.34-0.41,2.34-1.79V1.95C14.31,0.73,13.56,0,12.48,0c-1,0-1.75,0.73-1.84,1.79v10.24
C10.73,12.92,11.23,13.49,11.89,13.73L11.89,13.73z M11.89,13.73"/>
</g>
</svg>
This diff was suppressed by a .gitattributes entry.
...@@ -18,9 +18,13 @@ const TabWidget = props => { ...@@ -18,9 +18,13 @@ const TabWidget = props => {
<div className={styles['oper-wrap']}> <div className={styles['oper-wrap']}>
<div className={styles['oper-btn']}> <div className={styles['oper-btn']}>
{isFullscreen ? ( {isFullscreen ? (
<FullscreenExitOutlined className={styles['btn-fullscreen_exit']} onClick={handleExitFullScreen} /> <span className={styles['btn-fullscreen_exit']} onClick={handleExitFullScreen} />
) : ( ) : (
<FullscreenOutlined className={styles['btn-fullscreen']} onClick={handleFullScreen} /> <FullscreenOutlined
className={styles['btn-fullscreen']}
style={{ width: '1.2rem', height: '1.2rem' }}
onClick={handleFullScreen}
/>
)} )}
</div> </div>
</div> </div>
......
...@@ -22,13 +22,21 @@ ...@@ -22,13 +22,21 @@
color: #FFF; color: #FFF;
position: absolute; position: absolute;
top: 10px; top: 10px;
right: -100%; right: 15px;
transition: right ease-in-out 0.8s; transition: right ease-in-out 0.8s;
} }
&:hover { .btn-fullscreen_exit {
.oper-btn { display: block;
right: 20px; width: 1.2rem;
height: 1.2rem;
background-image: url('../../../assets/images/commonMenu/退出.svg');
}
.btn-fullscreen {
svg {
width: 1.2rem;
height: 1.2rem;
} }
} }
} }
......
import React, { useEffect, useState } from 'react'; import React, { useEffect, useState } from 'react';
import { FullscreenExitOutlined, FullscreenOutlined } from '@ant-design/icons'; import { FullscreenExitOutlined, FullscreenOutlined } from '@ant-design/icons';
import { notification } from 'antd'; import { notification } from 'antd';
import Empty from '@wisdom-components/empty';
import classnames from 'classnames'; import classnames from 'classnames';
import { cloudService } from '@/api'; import { cloudService } from '@/api';
import useFullScreen from '../iframe/useFullScreen'; import useFullScreen from '../iframe/useFullScreen';
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
*/ */
import React, { useEffect } from 'react'; import React, { useEffect } from 'react';
import BaseLogin from './template/baseLogin'; import BaseLogin from './template/baseLogin';
import ChangShuiJiChang from './template/changShuiJiChang';
import NewYear from './template/newYear'; import NewYear from './template/newYear';
import baseLoginNewYear from './template/baseLoginNewYear'; import baseLoginNewYear from './template/baseLoginNewYear';
import InfoLogin from './template/infoLogin'; import InfoLogin from './template/infoLogin';
...@@ -60,6 +61,7 @@ const LoginTemplate = { ...@@ -60,6 +61,7 @@ const LoginTemplate = {
'项目 - 威信.html': WeixinLogin, '项目 - 威信.html': WeixinLogin,
'全景图.html': PanoramaLogin, '全景图.html': PanoramaLogin,
'项目 - 江西.html': JiangXi, '项目 - 江西.html': JiangXi,
'项目 - 长水机场.html': ChangShuiJiChang,
default: BaseLogin, default: BaseLogin,
}; };
/* eslint-disable */ /* eslint-disable */
......
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';
import bgImg from '../../../../assets/images/login/背景.png';
const Login = forwardRef((props, _ref) => {
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));
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(() => {
action &&
action.events.on('loginSuccess', event => {
setSubmitting(false);
props.updateCurrentIndex && props.updateCurrentIndex(0);
props.history.push(`/?client=${props.global.client}`);
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(() => {
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');
}, 500);
}, []);
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} style={{ background: 'url(' + bgImg + ')' }}>
<div className={styles.inner}>
<div
className={classNames(styles.loginTime, styles.caseHide)}
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['login-block'],
styles.caseHide,
'animate__animated',
)}
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>
<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));
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