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
1fc14c54
Commit
1fc14c54
authored
Feb 21, 2024
by
周宏民
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修改演示功能入口
parent
30946ab0
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
29 deletions
+33
-29
index.js
src/pages/bootpage/demonstration/index.js
+16
-4
index.js
src/pages/bootpage/index.js
+15
-13
index.js
src/pages/bootpage/panda/index.js
+2
-12
No files found.
src/pages/bootpage/demonstration/index.js
View file @
1fc14c54
...
...
@@ -19,6 +19,7 @@ import { actionCreators } from '@/containers/App/store';
import
{
connect
}
from
'react-redux'
;
import
LoginAction
from
'@/pages/user/login/login'
;
import
classNames
from
'classnames'
;
import
{
defaultApp
}
from
'@/micro'
;
import
useFullScreen
from
'./components/useFullScreen'
;
import
styles
from
'./index.less'
;
import
LeftItem
from
'./components/Left'
;
...
...
@@ -26,7 +27,6 @@ import VideoItem from './components/VideoItem';
import
RightItem
from
'./components/Right'
;
import
BottomItem
from
'./components/Bottom'
;
import
{
platformData
}
from
'./components/configData'
;
const
boxWidth
=
1920
;
const
boxHeight
=
911
;
const
projectType
=
[
'供水'
,
'排水'
,
'能源'
,
'水利'
];
...
...
@@ -34,6 +34,7 @@ const Demonstration = props => {
const
onLineUrl
=
window
.
globalConfig
?.
mainserver
||
'https://panda-water.cn/'
;
const
showFullScreen
=
true
;
const
videoRef
=
useRef
(
null
);
const
[
loginAction
,
setAction
]
=
useState
(()
=>
new
LoginAction
(
props
));
const
[
loading
,
setLoading
]
=
useState
(
true
);
const
[
jumpLoading
,
setJumpLoading
]
=
useState
(
false
);
const
[
selectKey
,
setSelectKey
]
=
useState
(
'供水产品'
);
...
...
@@ -77,13 +78,13 @@ const Demonstration = props => {
config
.
widgets
=
[];
config
.
allWidgets
=
[];
props
.
instance
&&
props
.
instance
.
updateConfig
(
config
);
const
loginAction
=
new
LoginAction
({
...
props
,
global
:
config
});
loginAction
&&
loginAction
.
getUserInfoAndConfig
(
failCallback
,
true
,
type
);
};
const
updateConfig
=
(
config
,
data
)
=>
{
// props.instance && props.instance.updateConfig(config);
props
.
updateConfig
&&
props
.
updateConfig
(
config
);
const
l
oginAction
=
new
LoginAction
({
...
props
,
global
:
config
});
loginAction
&&
l
oginAction
.
getUserInfoAndConfig
(
failCallback
,
true
,
data
.
industry
);
const
newL
oginAction
=
new
LoginAction
({
...
props
,
global
:
config
});
newLoginAction
&&
newL
oginAction
.
getUserInfoAndConfig
(
failCallback
,
true
,
data
.
industry
);
};
// 新产品跳转
...
...
@@ -295,6 +296,17 @@ const Demonstration = props => {
setLoading
(
false
);
});
};
useEffect
(()
=>
{
const
handleToggleIndustry
=
event
=>
{
props
.
history
&&
props
.
history
.
push
(
`/?client=
${
props
.
global
.
client
}
`
);
props
.
updateCurrentIndex
(
0
);
defaultApp
();
};
window
.
share
.
event
.
on
(
'toggleIndustry'
,
handleToggleIndustry
);
return
()
=>
{
window
.
share
.
event
.
removeListener
(
'toggleIndustry'
,
handleToggleIndustry
);
};
},
[
props
]);
useEffect
(()
=>
{
getData
();
window
.
addEventListener
(
'resize'
,
debounce
(
onResize
,
300
));
...
...
src/pages/bootpage/index.js
View file @
1fc14c54
...
...
@@ -5,15 +5,14 @@ import { appService } from '@/api';
import
{
SERVICE_INTERFACE_SUCCESS_CODE
}
from
'@/constants'
;
import
PandaBootPage
from
'./panda'
;
import
IntegrationPage
from
'./integration'
;
import
Demonstration
from
'./demonstration'
;
const
systemItemName
=
'引导页模板'
;
// 系统配置项名称
const
BootPageTemplate
=
{
default
:
PandaBootPage
,
integration
:
IntegrationPage
integration
:
IntegrationPage
,
demonstration
:
Demonstration
,
};
const
BootPage
=
props
=>
{
const
[
info
,
setInfo
]
=
useState
({
first
:
true
,
...
...
@@ -21,17 +20,18 @@ const BootPage = props => {
error
:
false
,
});
const
[
template
,
setTemplate
]
=
useState
(
'default'
);
const
[
pattern
,
setPattern
]
=
useState
(
true
);
// 是否进入演示模式
const
RenderComponent
=
useMemo
(()
=>
{
if
(
window
?.
globalConfig
?.
isIntegration
>=
1
)
{
//集成登录
return
BootPageTemplate
.
integration
}
else
{
//云平台
return
BootPageTemplate
[
template
]
||
BootPageTemplate
.
default
//
集成登录
return
BootPageTemplate
.
integration
;
}
if
(
pattern
&&
template
!==
'integration'
)
{
return
BootPageTemplate
.
demonstration
;
}
},
[
template
]);
// 云平台
return
BootPageTemplate
[
template
]
||
BootPageTemplate
.
default
;
},
[
template
,
pattern
]);
useEffect
(()
=>
{
if
(
window
?.
globalConfig
?.
isIntegration
>=
1
)
{
...
...
@@ -61,7 +61,9 @@ const BootPage = props => {
},
[]);
return
(
<
SecurityLayout
>
{
info
.
loading
?
<
Spin
/>
:
info
.
error
?
<
Empty
/>
:
<
RenderComponent
{...
props
}
/>}</
SecurityLayout
>
<
SecurityLayout
>
{
info
.
loading
?
<
Spin
/>
:
info
.
error
?
<
Empty
/>
:
<
RenderComponent
setPattern
=
{
setPattern
}
{...
props
}
/>
}
<
/SecurityLayout
>
);
};
...
...
src/pages/bootpage/panda/index.js
View file @
1fc14c54
...
...
@@ -17,7 +17,6 @@ import { defaultApp } from '@/micro';
import
usingIcon
from
'@/assets/bootPage/using-icon.png'
;
import
{
appService
}
from
'@/api'
;
import
styles
from
'./index.less'
;
import
Demonstration
from
'../demonstration'
;
const
industries
=
[
{
name
:
'供水'
,
type
:
'供水'
,
subTitle
:
'WATER SUPPLY'
,
color
:
'rgb(16,104,239)'
},
{
name
:
'农饮水'
,
type
:
'农饮水'
,
subTitle
:
'RURAL POTABLE WATER'
,
color
:
'rgb(4,142,101)'
},
...
...
@@ -36,6 +35,7 @@ const industries = [
const
BootPage
=
props
=>
{
const
dataRef
=
useRef
();
const
process
=
useRef
();
const
{
setPattern
}
=
props
;
const
[
Industries
]
=
useState
(
props
.
global
.
userInfo
.
Industries
);
const
[
percentBottom
,
setPercentBottom
]
=
useState
(
-
40
);
const
[
percentNum
,
setPercentNum
]
=
useState
(
0
);
...
...
@@ -45,7 +45,6 @@ const BootPage = props => {
const
[
scale
,
setScale
]
=
useState
(
1
);
const
[
loginAction
,
setAction
]
=
useState
(()
=>
new
LoginAction
(
props
));
const
[
num
]
=
useState
(
Industries
.
filter
(
item
=>
!!
industries
.
find
(
d
=>
d
.
type
===
item
)).
length
);
const
[
pattern
,
setPattern
]
=
useState
(
true
);
// 是否进入演示模式
// const history = useHistory();
useDocumentTitle
(
{
title
:
defaultSetting
.
title
,
id
:
''
,
pageName
:
'行业切换'
},
...
...
@@ -177,9 +176,6 @@ const BootPage = props => {
return
(
<>
{
pattern
?
(
<
Demonstration
setPattern
=
{
setPattern
}
/
>
)
:
(
<
div
className
=
{
styles
.
bootPage
}
>
<
div
className
=
{
styles
.
b_top_l
}
>
<
div
className
=
{
styles
.
b_top_l_btn
}
onClick
=
{()
=>
setPattern
(
true
)}
>
...
...
@@ -196,12 +192,7 @@ const BootPage = props => {
<
/div
>
<
/header
>
<
section
className
=
{
classNames
(
styles
.
bootPageSection
,
'animate__fadeInDown'
,
'animate__animated'
,
'duration-500ms'
,
)}
className
=
{
classNames
(
styles
.
bootPageSection
,
'animate__fadeInDown'
,
'animate__animated'
,
'duration-500ms'
)}
// style={{
// width: `${scale < 1 ? 1280 : Math.ceil(1280 * scale)}px`,
// }}
...
...
@@ -274,7 +265,6 @@ const BootPage = props => {
<
/div
>
)
:
null
}
<
/div
>
)}
<
/
>
);
};
...
...
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