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
95e6307f
Commit
95e6307f
authored
Sep 05, 2024
by
赵瑞
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:定制临渭全景登录页
parent
48dd70e1
Pipeline
#92374
passed with stages
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
481 additions
and
0 deletions
+481
-0
index.js
src/pages/user/login/template/panorama/index.js
+2
-0
index.js
src/pages/user/login/template/project/linwei/index.js
+227
-0
index.less
src/pages/user/login/template/project/linwei/index.less
+252
-0
No files found.
src/pages/user/login/template/panorama/index.js
View file @
95e6307f
...
...
@@ -2,12 +2,14 @@ import PanoBaseLogin from "./PanoBaseLogin"
import
TieShanLogin
from
"../project/tieshan"
import
LinTao
from
'../project/linTao'
import
MiLe
from
"../project/miLe"
import
Linwei
from
"../project/linwei"
import
{
useState
,
useEffect
}
from
"react"
const
LoginTemplate
=
{
"铁山"
:
TieShanLogin
,
"临洮"
:
LinTao
,
"弥勒"
:
MiLe
,
"临渭"
:
Linwei
,
default
:
PanoBaseLogin
}
...
...
src/pages/user/login/template/project/linwei/index.js
0 → 100644
View file @
95e6307f
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
defaultSetting
from
'../../../../../../../config/defaultSetting'
;
import
LoginAction
from
'../../../login'
;
import
styles
from
'./index.less'
;
import
Account
from
'../../../js/useAccount'
;
import
{
defaultApp
}
from
'../../../../../../micro'
;
import
QRCode
from
'qrcode.react'
;
import
classnames
from
'classnames'
;
import
moment
from
'moment'
;
import
Krpano
from
'../../../components/Krpano'
;
const
PopOvercontent
=
()
=>
{
const
qrcodes
=
window
.
globalConfig
&&
window
.
globalConfig
.
qrcode
;
if
(
qrcodes
)
{
return
<
QRCode
value
=
{
qrcodes
}
/>
;
}
return
<
span
>
手持
APP
下载未配置
<
/span>
;
}
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
{
projectName
}
=
props
.
loginParams
const
logoImage
=
props
?.
global
?.
logo
?.
indexOf
(
'CityTemp'
)
>
-
1
?
props
?.
global
?.
logo
:
`civweb4/
${
props
?.
global
?.
logo
}
`;
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'));
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 0:
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.linweiLogin, "linwei")}>
<div className={styles['inner-wrapper']}>
{/* <div className={styles['left-imgbox']}></div> */}
<div className={styles['inner-center']}>
<div className={styles['welcome-title']}>
总量控制、定额管理、统一调度、分级负责
</div>
<div className={classnames(styles['inner-bg'], styles['login-part'])} ref={loginFormRef}>
{renderPlatform()}
</div>
</div>
{/* <Popover content={PopOvercontent} title="扫码下载APP" trigger="click" overlayClassName={'popover-style'}>
<img src={qrcodePng} alt="APP" className={styles['qrcode-box']} />
</Popover> */}
</div>
<div className={styles['login-header']}>
<div className={styles['left-title']}>
<img src={`
$
{
window
.
location
.
origin
}
/${logoImage}`} alt='logo' className={styles
[
'logo-png'
]
} /
>
<
div
className
=
{
styles
[
'cn-title'
]}
>
{
props
.
global
.
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
>
<
div
className
=
{
styles
[
'copyright'
]}
>
Copyright
©熊猫智慧水务
2024
All
Rights
Reserved
<
/div
>
{
projectName
?
<
div
className
=
{
styles
[
'krpano'
]}
>
<
Krpano
projectName
=
{
projectName
}
/
>
<
/div> : nul
l
}
<
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
));
src/pages/user/login/template/project/linwei/index.less
0 → 100644
View file @
95e6307f
.linweiLogin {
width: 100%;
height: 100%;
background-clip: border-box;
position: relative;
min-height: 7.0rem;
overflow: hidden;
display: flex;
justify-content: center;
align-items: center;
.bg-image {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.inner-bg {
width: 100%;
height: 100%;
&>div {
width: 70%;
margin: 0 auto;
}
}
.inner-wrapper {
// width: 800px;
// height: 400px;
display: flex;
justify-content: center;
align-items: center;
border-radius: 10px;
position: absolute;
bottom: 20%;
z-index: 100;
// 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: 482px;
height: 316px;
background: rgba(255, 255, 255, 0.3);
border: 1px solid #FFFFFF;
box-shadow: 0px 15px 15px 3px rgba(140, 142, 145, 0.52);
border-radius: 15px;
}
.welcome-title {
border-radius: 8px 8px 0 0;
text-align: center;
line-height: 100px;
font-size: 24px;
font-weight: bolder;
color: #008efe;
text-shadow: #fff 1.5px 0 0, #fff 0 1.5px 0, #fff -1.5px 0 0, #fff 0 -1.5px 0;
font-family: "楷体";
height: 100px;
}
.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: 4%;
display: flex;
justify-content: center;
align-items: center;
margin: 0 auto;
z-index: 100;
.left-title {
display: flex;
justify-content: center;
align-items: center;
.cn-title {
font-size: 48px;
font-weight: bold;
color: #A6D1FF;
background: linear-gradient(180deg, #70b9f8 0%, #2193f5 100%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
margin-bottom: 15px;
letter-spacing: 4px;
}
.logo-png {
width: 90px;
margin-right: 5px;
}
}
.right-timebox {
display: flex;
justify-content: center;
align-items: center;
height: 60px;
position: absolute;
right: 20px;
.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;
}
.krpano {
position: absolute;
left: 0;
top: 0;
right: 0;
bottom: 0;
}
}
:global {
.popover-style {
.@{ant-prefix}-popover-inner-content {
display: flex;
justify-content: center;
align-items: center;
}
.@{ant-prefix}-popover-title {
display: flex;
justify-content: center;
align-items: center;
}
}
}
@keyframes waving {
from {
top: 0;
}
to {
top: 10px;
}
}
@keyframes waving2 {
from {
left: 0;
}
to {
left: -9999px;
}
}
\ No newline at end of file
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