Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
CivWeb
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ReactWeb5
CivWeb
Commits
55ee816b
Commit
55ee816b
authored
Apr 26, 2024
by
程恺文
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
通用登录页面
parent
6b46f0eb
Pipeline
#87820
failed with stages
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
483 additions
and
0 deletions
+483
-0
index.js
src/pages/user/login/index.js
+4
-0
FormLogin.js
src/pages/user/login/template/current/FormLogin.js
+69
-0
index.js
src/pages/user/login/template/current/index.js
+226
-0
index.less
src/pages/user/login/template/current/index.less
+184
-0
No files found.
src/pages/user/login/index.js
View file @
55ee816b
...
...
@@ -45,6 +45,8 @@ import YongjiLogin from './template/project/yongji';
import
GaoyaoLogin
from
'./template/project/gaoyao'
;
import
JianzhaLogin
from
'./template/project/jianzha'
;
import
ChinaShuiwu
from
'./template/project/chinaShuiwu'
;
import
current
from
'./template/current/index'
;
import
{
AppInitState
}
from
'../../../render'
;
const
LoginTemplate
=
{
'新春.html'
:
baseLoginNewYear
,
...
...
@@ -57,6 +59,8 @@ const LoginTemplate = {
'项目 - 榆林.html'
:
Yulin
,
'能源-定额平台.html'
:
EnergyQuota
,
'项目-新都排水.html'
:
drainageXindu
,
'通用登录页.html'
:
current
,
'节水主题一.html'
:
EnergGz
,
'广州登录页.html'
:
EnergGzV2
,
'DarkNoEffect.html'
:
DarkNoEffect
,
...
...
src/pages/user/login/template/current/FormLogin.js
0 → 100644
View file @
55ee816b
/* eslint-disable */
import
{
Checkbox
}
from
'antd'
;
import
React
from
'react'
;
import
{
useIntl
}
from
'@wisdom-utils/components'
;
import
LoginForm
from
'../../components/Login'
;
import
{
Form
}
from
'antd'
;
import
LoginMessage
from
'../../js/loginMessage'
;
import
LoginContext
from
'../../components/Login/LoginContext'
;
import
styles
from
'./index.less'
;
const
{
UserName
,
Password
,
Submit
}
=
LoginForm
;
const
FormLogin
=
props
=>
(
<
div
className
=
{
styles
.
form_login
}
>
<
LoginContext
.
Provider
>
<
Form
form
=
{
props
.
form
}
onFinish
=
{
values
=>
{
if
(
props
.
onSubmit
)
{
props
.
onSubmit
(
values
);
}
}}
>
{
props
.
status
===
'error'
&&
props
.
type
===
'account'
&&
!
props
.
submitting
&&
(
<
LoginMessage
content
=
{
useIntl
().
formatMessage
({
id
:
'pages.login.accountLogin.errorMessage'
,
})}
/
>
)}
<
UserName
name
=
"userName"
placeholder
=
{
useIntl
().
formatMessage
({
id
:
'pages.login.username.placeholder'
,
})}
rules
=
{[
{
required
:
true
,
message
:
useIntl
().
formatMessage
({
id
:
'pages.login.username.required'
,
}),
},
]}
/
>
<
Password
name
=
"password"
placeholder
=
{
useIntl
().
formatMessage
({
id
:
'pages.login.password.placeholder'
,
})}
rules
=
{[
{
required
:
true
,
message
:
useIntl
().
formatMessage
({
id
:
'pages.login.password.required'
,
}),
},
]}
/
>
<
div
className
=
{
styles
.
checkbox_wrap
}
>
<
Checkbox
checked
=
{
props
.
autoLogin
}
onChange
=
{
e
=>
props
.
setAutoLogin
(
e
.
target
.
checked
)}
>
{
'记住密码'
}
<
/Checkbox
>
<
a
href
=
"#"
>
忘记密码
?
<
/a
>
<
/div
>
<
Submit
loading
=
{
props
.
submitting
}
>
{
useIntl
().
formatMessage
({
id
:
'pages.login.submit'
})}
<
/Submit
>
<
/Form
>
<
/LoginContext.Provider
>
<
/div
>
);
export
default
FormLogin
;
src/pages/user/login/template/current/index.js
0 → 100644
View file @
55ee816b
/* eslint-disable */
/*
* @Author: hujinjie;
* @Date: 2022-4-14
* @Description: 华农登录页;
*/
import
React
,
{
Component
}
from
'react'
;
import
{
connect
}
from
'react-redux'
;
import
{
withRouter
}
from
'@wisdom-utils/runtime'
;
import
{
Modal
}
from
'antd'
;
import
{
HelmetProvider
,
Helmet
}
from
'react-helmet-async'
;
import
FormLogin
from
'./FormLogin'
;
import
{
actionCreators
}
from
'@/containers/App/store'
;
import
LoginAction
from
'../../login'
;
import
styles
from
'./index.less'
;
import
{
defaultApp
}
from
'@/micro'
;
import
大背景
from
'@/assets/images/login/排水/新都.jpg'
let
bigBg
=
''
let
titleBg
=
''
class
HuaNongLogin
extends
Component
{
constructor
(
props
)
{
super
(
props
);
console
.
log
(
props
.
loginParams
,
this
.
props
.
global
.
logo
,
' props.loginParams'
);
this
.
state
=
{
time
:
'16:00'
,
week
:
'星期一'
,
date
:
'2020-04-14'
,
title
:
'华中农业大学二级单位定额与建筑能耗管理系统'
,
type
:
'Account'
,
status
:
'normal'
,
submitting
:
false
,
autoLogin
:
false
,
visible
:
false
,
action
:
new
LoginAction
(
Object
.
assign
({},
props
,
{
history
:
props
.
history
}),
this
.
setVisible
,
true
),
};
this
.
fromRef
=
React
.
createRef
();
this
.
sliVerify
=
React
.
createRef
();
props
.
loginParams
.
map
(
v
=>
{
let
item
=
v
.
split
(
'='
)
if
(
item
.
length
>
0
){
if
(
item
[
0
]
==
'bigBg'
){
bigBg
=
item
[
1
]
}
if
(
item
[
0
]
==
'titleBg'
){
titleBg
=
item
[
1
]
}
}
})
}
handleSubmit
=
values
=>
{
const
{
action
,
type
,
autoLogin
}
=
this
.
state
;
action
&&
(
type
===
'Account'
?
action
.
loginHandler
(
values
.
userName
,
values
.
password
,
null
,
autoLogin
,
this
.
sliVerify
)
:
type
===
'Mobile'
?
action
.
phoneLoginFormHandler
(
values
.
mobile
,
values
.
captcha
)
:
null
);
this
.
setSubmitting
(
true
);
this
.
props
.
updateCurrentIndex
(
-
1
);
};
onActinoChange
=
action
=>
{
action
&&
action
.
events
.
on
(
'loginSuccess'
,
event
=>
{
this
.
setSubmitting
(
false
);
this
.
props
.
updateCurrentIndex
&&
this
.
props
.
updateCurrentIndex
(
0
);
this
.
props
.
history
.
push
(
`/?client=
${
this
.
props
.
global
.
client
}
`
);
defaultApp
();
});
action
&&
action
.
events
.
on
(
'loginError'
,
event
=>
{
this
.
setVisible
(
false
);
this
.
setSubmitting
(
false
);
});
action
&&
action
.
events
.
on
(
'loginVisible'
,
status
=>
{
this
.
setVisible
(
status
);
});
};
setSubmitting
=
submitting
=>
{
this
.
setState
({
submitting
});
};
setVisible
=
visible
=>
{
this
.
setState
({
visible
,
});
};
setType
=
type
=>
{
this
.
setState
({
type
,
});
};
setAutoLogin
=
autoLogin
=>
{
this
.
setState
({
autoLogin
,
});
};
renderPlatform
()
{
const
params
=
{
fromRef
:
this
.
formRef
,
type
:
this
.
state
.
type
,
setType
:
this
.
setType
,
status
:
this
.
state
.
status
,
submitting
:
this
.
state
.
submitting
,
autoLogin
:
this
.
state
.
autoLogin
,
setAutoLogin
:
this
.
setAutoLogin
,
action
:
this
.
state
.
action
,
onSubmit
:
this
.
handleSubmit
,
loginMode
:
this
.
props
.
loginMode
,
updateLoginMode
:
this
.
props
.
updateLoginMode
,
};
return
<
FormLogin
{...
params
}
/>
;
}
getCurrentTime
(
callback
)
{
const
date
=
new
Date
();
const
week
=
[
'星期日'
,
'星期一'
,
'星期二'
,
'星期三'
,
'星期四'
,
'星期五'
,
'星期六'
];
let
minutes
=
date
.
getMinutes
();
if
(
minutes
<
10
)
{
minutes
=
'0'
+
minutes
;
}
let
second
=
date
.
getSeconds
();
const
time
=
`
${
date
.
getHours
()}
:
${
minutes
}
`
;
const
weekDay
=
week
[
date
.
getDay
()];
const
dateStr
=
`
${
date
.
getFullYear
()}
-
${
date
.
getMonth
()
+
1
}
-
${
date
.
getDate
()}
`
;
const
dateObj
=
{
time
,
week
:
weekDay
,
date
:
dateStr
,
second
,
};
callback
&&
callback
(
dateObj
);
}
showTime
=
(
date
)
=>
{
this
.
clearTime
();
this
.
setState
({
...
date
,
});
const
interval
=
60
-
date
.
second
;
this
.
timeTimer
=
setInterval
(()
=>
{
this
.
getCurrentTime
(
this
.
showTime
);
},
interval
*
1000
);
}
// 清除时间定时器
clearTime
()
{
this
.
timeTimer
&&
clearInterval
(
this
.
timeTimer
);
}
componentDidMount
()
{
console
.
log
(
this
.
props
);
console
.
log
(
this
);
this
.
onActinoChange
(
this
.
state
.
action
);
this
.
getCurrentTime
(
this
.
showTime
);
}
componentWillUnmount
()
{
this
.
clearTime
();
}
render
()
{
return
(
<
HelmetProvider
>
<
div
className
=
{
styles
.
quota
}
style
=
{{
'background'
:
`url(
${
bigBg
?
this
.
props
.
global
.
transformDevAssetsBaseURL
(
bigBg
):
require
(
'@/assets/images/login/排水/新都.jpg'
)}
) no-repeat `
,
backgroundSize
:
'cover'
}}
>
<
div
className
=
{
styles
.
head
}
>
<
div
className
=
{
styles
.
title
}
>
<
img
src
=
{
this
.
props
.
global
&&
this
.
props
.
global
.
transformDevAssetsBaseURL
&&
this
.
props
.
global
.
transformDevAssetsBaseURL
(
this
.
props
.
global
.
logo
)}
alt
=
""
/>
{
/* <img src={require('@/assets/images/login/能源-定额/华农logo.png')} alt="" /> */
}
<
span
>
{
this
.
props
.
global
.
title
||
this
.
state
.
title
}
<
/span
>
<
/div
>
<
div
className
=
{
styles
.
time_and_date
}
>
<
div
className
=
{
styles
.
time
}
>
{
this
.
state
.
time
}
<
/div
>
<
div
className
=
{
styles
.
date
}
>
<
span
>
{
this
.
state
.
week
}
<
/span
>
<
span
>
{
this
.
state
.
date
}
<
/span
>
<
/div
>
<
/div
>
<
/div
>
<
div
className
=
{
styles
.
wrap_content
}
>
<
div
className
=
{
styles
.
from
}
>
<
div
className
=
{
styles
.
slogan
}
>
<
div
className
=
{
styles
.
slogan_back
}
style
=
{{
'background'
:
`url(
${
titleBg
?
this
.
props
.
global
.
transformDevAssetsBaseURL
(
titleBg
):
require
(
'@/assets/images/login/排水/宣传语.png'
)}
) no-repeat`
,
backgroundPosition
:
'center'
}}
/
>
<
/div
>
<
div
className
=
{
styles
.
login
}
>
{
this
.
renderPlatform
()}
<
/div
>
<
/div
>
<
/div
>
<
Modal
centered
visible
=
{
this
.
state
.
visible
}
width
=
{
340
}
footer
=
{
null
}
closable
=
{
false
}
bodyStyle
=
{{
padding
:
'15px'
}}
>
<
div
ref
=
{
this
.
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
(
HuaNongLogin
));
src/pages/user/login/template/current/index.less
0 → 100644
View file @
55ee816b
@import '~antd/es/style/themes/default.less';
/* 0.5px */
.borderSlender(@color) {
position: absolute;
bottom: 0;
width: 100%;
height: 1px;
background-color: @color;
-webkit-transform: scaleY(0.5);
-moz-transform: scaleY(0.5);
transform: scaleY(0.5);
content: '';
}
.quota {
position: relative;
width: 100%;
height: 100%;
//background: url('@/assets/images/login/排水/新都.jpg') no-repeat;
background-size: cover;
.head {
position: absolute;
top: 0;
width: 100%;
height: 66px;
display: flex;
justify-content: space-between;
z-index: 10;
.title {
padding-left: 20px;
font-size: 24px;
font-weight: bold;
color: #FFFFFF;
text-shadow: 0px 0px 2px rgba(2, 49, 21, 0.51);
line-height: 66px;
}
.time_and_date {
padding-right: 50px;
display: flex;
align-items: center;
.time {
padding: 5px;
font-size: 34px;
font-weight: 400;
color: #FFFFFF;
text-shadow: 0px 0px 2px rgba(2, 49, 21, 0.8);
}
.date {
padding: 5px;
font-size: 16px;
font-weight: 500;
color: #FFFFFF;
text-shadow: 0px 0px 2px rgba(2, 49, 21, 0.51);
display: flex;
flex-direction: column;
line-height: 1.1;
}
}
}
.head::after {
.borderSlender(@color: rgb(255, 255, 255, 0.32));
}
.wrap_content {
position: relative;
width: 100%;
height: 100%;
.from {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
display: flex;
flex-direction: column;
width: 620px;
height: 429px;
margin: auto;
overflow: hidden;
// background: rgba(255, 255, 255, 0.8);
background: #FFFFFF;
border-radius: 15px;
.slogan {
height: 118px;
background: linear-gradient(0deg, #00712f 0%, #0dae50 100%);
.slogan_back{
width: 100%;
height: 100%;
// background: url('@/assets/images/login/排水/宣传语.png') no-repeat;
background-position: center;
}
}
.login {
// flex: 1;
height: calc(100% - 118px);
padding: 50px 60px;
}
}
}
}
.form_login {
width: 100%;
height: 100%;
.checkbox_wrap {
margin-bottom: @margin-md;
color: #376149;
a {
float: right;
}
}
:global {
.panda-console-base-input-affix-wrapper:focus, .panda-console-base-input-affix-wrapper-focused {
box-shadow: none;
}
.panda-console-base-input-affix-wrapper {
color: #037633;
background: none;
}
.panda-console-base-input {
background: none;
}
.panda-console-base-input-affix-wrapper-status-error:not(.panda-console-base-input-affix-wrapper-disabled):not(.panda-console-base-input-affix-wrapper-borderless).panda-console-base-input-affix-wrapper:focus, .panda-console-base-input-affix-wrapper-status-error:not(.panda-console-base-input-affix-wrapper-disabled):not(.panda-console-base-input-affix-wrapper-borderless).panda-console-base-input-affix-wrapper-focused {
box-shadow: none;
}
.panda-console-base-input-affix-wrapper:focus .panda-console-base-input-affix-wrapper-lg {
border-color: #00a854 !important;
}
.panda-console-base-input-affix-wrapper:not(.panda-console-base-input-affix-wrapper-disabled):hover {
z-index: 1;
border-color: #00a854;
border-right-width: 1px;
}
.panda-console-base-input-affix-wrapper-status-error:not(.panda-console-base-input-affix-wrapper-disabled):not(.panda-console-base-input-affix-wrapper-borderless).panda-console-base-input-affix-wrapper,
.panda-console-base-input-affix-wrapper-status-error:not(.panda-console-base-input-affix-wrapper-disabled):not(.panda-console-base-input-affix-wrapper-borderless).panda-console-base-input-affix-wrapper:hover {
border-color: #ff4d4f;
}
.panda-console-base-input-affix-wrapper-focused,
.panda-console-base-input-affix-wrapper:focus {
z-index: 0;
}
.panda-console-base-input-affix-wrapper-lg {
background-color: none;
border: none;
border-bottom-color: #376149;
border-bottom-width: 1px;
border-bottom-style: solid;
}
.panda-console-base-input-affix-wrapper > input.panda-console-base-input {
background-color: none;
}
.panda-console-base-form {
width: 100%;
height: 100%;
}
.panda-console-base-checkbox-wrapper {
color: #376149;
}
.panda-console-base-checkbox-wrapper:hover .panda-console-base-checkbox::after {
border-color: #00a854;
}
.panda-console-base-checkbox-wrapper:hover .panda-console-base-checkbox-inner,
.panda-console-base-checkbox:hover .panda-console-base-checkbox-inner,
.panda-console-base-checkbox-input:focus + .panda-console-base-checkbox-inner {
border-color: #037633;
}
.panda-console-base-checkbox-wrapper {
.panda-console-base-checkbox-checked .panda-console-base-checkbox-inner {
background-color: #037633;
border-color: #037633;
}
.panda-console-base-checkbox-inner {
border-color: #037633;
border-radius: 50%;
}
}
.panda-console-base-btn-lg {
width: 100%;
}
.panda-console-base-btn-primary {
background: #037633;
border-color: #037633;
border-radius: 23px;
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment