Commit 5bfed588 authored by 崔佳豪's avatar 崔佳豪

Merge branch 'dev' into 'master'

Dev See merge request !14
parents 6df982cf 7ad16387
Pipeline #61444 passed with stages
...@@ -22,6 +22,7 @@ import ChengmaiLogin from './template/project/chengmai'; ...@@ -22,6 +22,7 @@ import ChengmaiLogin from './template/project/chengmai';
import HuhehaoteLogin from './template/project/huhehaote'; import HuhehaoteLogin from './template/project/huhehaote';
import XinganLogin from './template/project/xingan'; import XinganLogin from './template/project/xingan';
import ErlianhaoteLogin from './template/project/erlianhaote'; import ErlianhaoteLogin from './template/project/erlianhaote';
import YixianLogin from './template/project/yixian';
import { AppInitState } from '../../../render'; import { AppInitState } from '../../../render';
const LoginTemplate = { const LoginTemplate = {
'新春 - 智联.html': NewYear, '新春 - 智联.html': NewYear,
...@@ -40,6 +41,7 @@ const LoginTemplate = { ...@@ -40,6 +41,7 @@ const LoginTemplate = {
'项目 - 呼和浩特.html': HuhehaoteLogin, '项目 - 呼和浩特.html': HuhehaoteLogin,
'项目 - 新干.html': XinganLogin, '项目 - 新干.html': XinganLogin,
'项目 - 二连浩特.html': ErlianhaoteLogin, '项目 - 二连浩特.html': ErlianhaoteLogin,
'项目 - 易县.html': YixianLogin,
default: BaseLogin, default: BaseLogin,
}; };
/* eslint-disable */ /* eslint-disable */
......
...@@ -204,18 +204,6 @@ ...@@ -204,18 +204,6 @@
} }
@keyframes waving { @keyframes waving {
from { from {
......
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<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"
width="57.468px" height="30px" viewBox="0 0 57.468 30" enable-background="new 0 0 57.468 30" xml:space="preserve">
<g>
<g>
<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="-0.0376" y1="9.8105" x2="48.2442" y2="34.4248">
<stop offset="0" style="stop-color:#1E99D7"/>
<stop offset="1" style="stop-color:#49AF86"/>
</linearGradient>
<path fill="url(#SVGID_1_)" d="M28.733,22.787c-0.76,0-1.485,0.1-2.144,0.271l0,0c-0.003,0-0.009,0.002-0.011,0.004
c-0.133,0.033-0.262,0.076-0.39,0.117c-2.221,0.521-5.448-1.268-2.83-4.58l-0.011-0.006c1.484-2.158,1.97-4.486,1.083-6.425
c-1.697-3.708-7.754-4.566-13.525-1.923c-5.772,2.648-9.072,7.797-7.375,11.502c1.698,3.707,7.753,4.568,13.525,1.918
c0.185-0.082,0.36-0.18,0.538-0.268v0.01c2.9-1.629,5.677,0.705,5.545,2.686c-0.014,0.1-0.023,0.199-0.023,0.303
c0,1.99,2.515,3.604,5.617,3.604c3.103,0,5.617-1.613,5.617-3.604C34.35,24.402,31.836,22.787,28.733,22.787z"/>
</g>
<g>
<linearGradient id="SVGID_2_" gradientUnits="userSpaceOnUse" x1="3.2749" y1="3.3135" x2="51.5636" y2="27.9313">
<stop offset="0" style="stop-color:#1E99D7"/>
<stop offset="1" style="stop-color:#49AF86"/>
</linearGradient>
<path fill="url(#SVGID_2_)" d="M7.842,8.285c3.108-1.636,4.775-4.581,3.721-6.576c-1.051-1.997-4.422-2.283-7.528-0.65
c-3.107,1.636-4.771,4.584-3.72,6.578C1.364,9.631,4.737,9.921,7.842,8.285z"/>
</g>
<g>
<linearGradient id="SVGID_3_" gradientUnits="userSpaceOnUse" x1="8.6138" y1="-7.1582" x2="56.8952" y2="17.4559">
<stop offset="0" style="stop-color:#1E99D7"/>
<stop offset="1" style="stop-color:#49AF86"/>
</linearGradient>
<path fill="url(#SVGID_3_)" d="M53.433,1.058c-3.106-1.633-6.479-1.346-7.531,0.65c-0.787,1.498-0.047,3.527,1.688,5.145l0,0
c1.232,1.51,0.55,3.728-1.991,2.99c-0.203-0.08-0.406-0.148-0.611-0.217c-0.037-0.018-0.071-0.026-0.11-0.044
c-0.32-0.144-0.554-0.21-0.739-0.231c-4.955-1.445-9.642-0.369-11.102,2.818c-1.699,3.709,1.603,8.855,7.373,11.498
c5.771,2.65,11.827,1.789,13.525-1.918c1.195-2.605-0.09-5.921-2.959-8.583c-0.004-0.002-0.007-0.009-0.012-0.013
c-1.701-1.924-1.368-4.611,0.33-4.18c0.058,0.018,0.117,0.036,0.176,0.053c0.02,0.009,0.04,0.009,0.061,0.018V9.04
c2.475,0.688,4.787,0.188,5.624-1.404C58.205,5.642,56.54,2.694,53.433,1.058z"/>
</g>
</g>
</svg>
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';
import { Modal, Popover } from 'antd';
import { Helmet, HelmetProvider } from 'react-helmet-async';
import { connect } from 'react-redux';
import { useHistory, withRouter } from '@wisdom-utils/runtime';
import { actionCreators } from '@/containers/App/store';
import QRCode from 'qrcode.react';
import classnames from 'classnames';
import moment from 'moment';
import defaultSetting from '../../../../../../../config/defaultSetting';
import LoginAction from '../../../login';
import styles from './index.less';
import Account from '../../../js/useAccount';
import { defaultApp } from '../../../../../../micro';
import logo from './images/5.png';
import loginTitlePng from './images/9.png'
const Login = forwardRef((props, _ref) => {
const sliVerify = useRef();
const loginFormRef = useRef();
const formRef = useRef(null);
const [status, setStatus] = useState('normal');
const [autoLogin, setAutoLogin] = useState(false);
const [submitting, setSubmitting] = useState(false);
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 [dateObj, setDateObj] = useState({});
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}`);
// 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]);
useEffect(() => {
setSubmitting(false);
}, [visible]);
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,
welcome: null,
};
return <Account {...params} />;
};
/* eslint-disable */
const handleWeek =() => {
const weekOfDay = Number(moment().format('E'));
console.log(weekOfDay, "weekOfDay")
let weekDayName = ''
switch(weekOfDay){
case 1:
weekDayName = '周一'
break
case 2:
weekDayName = '周二'
break
case 3:
weekDayName = '周三'
break
case 4:
weekDayName = '周四'
break
case 5:
weekDayName = '周五'
break
case 6:
weekDayName = '周六'
break
case 7:
weekDayName = '周日'
break
default:
weekDayName = ''
}
return weekDayName
}
useEffect(()=>{
const timer = setInterval(() => {
setDateObj({
curTime: moment().format('HH:mm:ss'),
week: handleWeek(),
date: moment().format('YYYY/MM/DD')
});
}, 1000);
return () => {
clearInterval(timer);
};
}, [])
return (
<HelmetProvider>
<Helmet>
<title>{props.global.title || defaultSetting.title}</title>
<meta name="description" content={props.global.title || defaultSetting.title} />
</Helmet>
<div className={classnames(styles.xinganlogin)}>
<div className={styles['inner-wrapper']}>
{/* <div className={styles['left-imgbox']}></div> */}
<div className={styles['inner-center']}>
<div className={styles['welcome-title']}>
<img src={loginTitlePng} alt="login-title"/>
</div>
<div className={classnames(styles['inner-bg'], styles['login-part'])} ref={loginFormRef}>
{renderPlatform()}
</div>
</div>
</div>
<div className={styles['login-header']}>
<div className={styles['left-title']}>
<div>
<img src={logo} alt="logo"/>
</div>
<div className={styles['cn-title']}>河北易县水利局自来水公司</div>
</div>
<div className={styles['right-timebox']}>
<div className={styles['curr-time']}>{dateObj.curTime}</div>
<div className={styles['curr-week-date']}>
<div className={styles['curr-week']}>{dateObj.week}</div>
<div className={styles['curr-date']}>{dateObj.date}</div>
</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,
)(withRouter(Login));
@font-face {
font-family: PingFang SC;
src: url('@/assets/fonts/PingFang.ttf');
}
.xinganlogin {
width: 100%;
height: 100%;
background: url('./images/8.png') no-repeat;
background-size: 100% 100%;
background-clip: border-box;
position: relative;
min-height: 7.0rem;
overflow: hidden;
display: flex;
justify-content: center;
align-items: center;
.inner-bg {
width: 100%;
height: 100%;
&>div {
width: 80%;
margin: 10%;
}
}
.inner-wrapper {
position: absolute;
display: flex;
justify-content: center;
align-items: center;
top: 43%;
margin-top: -190px;
// top: 46%;
// right: 0;
// transform: translateY(-50%);
}
.inner-bg .title {
font-size: 27px;
font-weight: bold;
color: rgba(255, 255, 255, 1);
letter-spacing: 2px;
}
.form-control:focus {
border-color: #66afe9;
outline: 0;
-webkit-box-shadow: none;
box-shadow: none;
}
.inner-center {
position: relative;
width: 480px;
height: 380px;
background: rgba(255,255,255,0.9);
border: 1px solid #FFFFFF;
box-shadow: 1px 1px 12px -3px #22222277;
border-radius: 8px 10px 10px 10px;
}
.welcome-title{
background: linear-gradient(0deg, rgba(9, 128, 238, 1) 0%, rgba(0, 182, 251, 1) 100%);
height: 100px;
border-radius: 8px 8px 0px 0px;
text-align: center;
line-height: 70px;
padding: 16px;
}
.formgroup2 {
display: flex;
align-items: center;
display: flex;
margin: 0px 5.5%;
margin-bottom: 10%;
align-items: center;
margin-bottom: 40px;
}
.APPcodeBox {
width: 100%;
display: flex;
flex-flow: column;
align-items: center;
cursor: pointer;
position: relative;
}
.APPCtext {
font-size: 14px;
font-family: Microsoft YaHei;
font-weight: 400;
color: #000000;
line-height: 30px;
opacity: 0.75;
}
.login-header{
width: 100%;
position: absolute;
top: 30px;
padding: 0 38px;
display: flex;
justify-content: space-between;
align-items: center;
.left-title{
display: flex;
justify-content: flex-start;
align-items: center;
.cn-title{
font-size: 26px;
font-family: Microsoft YaHei;
font-weight: 400;
color: #FFFFFF;
margin-left: 10px;
}
.en-title{
font-size: 12px;
font-family: Microsoft YaHei;
font-weight: 400;
color: #FFFFFF;
opacity: 0.65;
}
}
.right-timebox{
display: flex;
justify-content: center;
align-items: center;
height: 60px;
.curr-time{
width: 140px;
font-size: 36px;
font-family: Microsoft YaHei;
font-weight: 300;
color: #FFFFFF;
}
.curr-week-date{
margin-left: 10px;
.curr-week{
font-size: 16px;
font-family: Microsoft YaHei;
font-weight: 400;
color: #FFFFFF;
}
.curr-date{
font-size: 14px;
font-family: Microsoft YaHei;
font-weight: 400;
color: #FFFFFF;
}
}
}
}
.copyright{
position: absolute;
bottom: 7%;
width: 100%;
margin: 0 auto;
font-size: 12px;
font-family: Microsoft YaHei;
font-weight: 400;
color: #F1F6FD;
text-align: center;
}
.qrcode-box{
position: absolute;
bottom: 0;
right: -35px;
width: 35px;
height: 35px;
background: #FFFFFF;
opacity: 0.8;
cursor: pointer;
}
}
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