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
8548779f
Commit
8548779f
authored
Mar 14, 2024
by
周宏民
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修改项目简介在切换 站点时,图片显示错误的问题
parent
bf2331e2
Pipeline
#85986
waiting for manual action with stages
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
8 deletions
+11
-8
preview.js
src/pages/system/previews/preview.js
+11
-8
No files found.
src/pages/system/previews/preview.js
View file @
8548779f
import
React
,
{
useEffect
,
useState
}
from
'react'
;
import
React
,
{
useEffect
,
useState
,
useCallback
}
from
'react'
;
import
{
FullscreenExitOutlined
,
FullscreenOutlined
}
from
'@ant-design/icons'
;
import
{
notification
}
from
'antd'
;
import
classnames
from
'classnames'
;
import
{
cloudService
}
from
'@/api'
;
import
{
connect
}
from
'react-redux'
;
import
useFullScreen
from
'../iframe/useFullScreen'
;
import
styles
from
'./index.less'
;
...
...
@@ -14,8 +15,8 @@ const PrevieView = props => {
const
{
imgName
,
accountName
,
fullscreen
,
canScroll
}
=
params
;
const
[
ref
,
isFullscreen
,
handleFullScreen
,
handleExitFullScreen
]
=
useFullScreen
(
fullscreen
);
const
[
imgUrl
,
setImgUrl
]
=
useState
(
''
);
const
getImgUrl
=
()
=>
{
const
userInfo
=
props
.
global
?.
userInfo
;
const
getImgUrl
=
useCallback
(
()
=>
{
cloudService
.
getAccountPageList
({
pageIndex
:
1
,
...
...
@@ -30,18 +31,18 @@ const PrevieView = props => {
if
(
configData
.
length
>
0
&&
configData
[
0
][
'演示图片'
])
{
const
url
=
`
${
window
.
location
.
origin
}
/PandaWorkFlow/WorkFlow/AccountManage/DownloadFiles?filePath=
${
configData
[
0
][
'演示图片'
]
}
&_site=
${
window
.
globalConfig
?.
userInfo
?.
site
}
`;
}
&_site=
${
userInfo
?.
site
}
`;
setImgUrl(url);
}
})
.catch(err => {
notification.error({ message: '提示', duration: 3, description: '获取图片信息错误' });
});
};
}
)
;
useEffect(() => {
getImgUrl();
}, []);
}, [
getImgUrl, userInfo
]);
return (
<div className={classnames(styles['tab-preview'], canScroll ? styles['long-img'] : styles['normal-img'])} ref={ref}>
...
...
@@ -59,5 +60,7 @@ const PrevieView = props => {
</div>
);
};
export default PrevieView;
const mapStateToProps = state => ({
global: state.getIn(['global', 'globalConfig']),
});
export default connect(mapStateToProps)(PrevieView);
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