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
d6fb955c
Commit
d6fb955c
authored
Mar 10, 2025
by
程恺文
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:'演示页面支持视频配置videoName='CityTemp/视频/CAD中文乱码操作.mp4''
parent
94d283ac
Pipeline
#96053
waiting for manual action with stages
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
70 additions
and
5 deletions
+70
-5
index.less
src/pages/system/previews/index.less
+46
-1
preview.js
src/pages/system/previews/preview.js
+24
-4
No files found.
src/pages/system/previews/index.less
View file @
d6fb955c
...
@@ -3,7 +3,44 @@
...
@@ -3,7 +3,44 @@
height: 100%;
height: 100%;
position: relative;
position: relative;
z-index: 9;
z-index: 9;
video{
width: 100%;
height: 100%;
}
video::-webkit-media-controls-fullscreen-button {
display: none;
}
//播放按钮
video::-webkit-media-controls-play-button {
display: none;
}
//进度条
video::-webkit-media-controls-timeline {
display: none;
}
//观看的当前时间
video::-webkit-media-controls-current-time-display{
display: none;
}
//剩余时间
video::-webkit-media-controls-time-remaining-display {
display: none;
}
//音量按钮
video::-webkit-media-controls-mute-button {
display: none;
}
video::-webkit-media-controls-toggle-closed-captions-button {
display: none;
}
//音量的控制条
video::-webkit-media-controls-volume-slider {
display: none;
}
//所有控件
video::-webkit-media-controls-enclosure{
display: none;
}
.oper-wrap {
.oper-wrap {
top: 0;
top: 0;
right: 0;
right: 0;
...
@@ -37,6 +74,10 @@
...
@@ -37,6 +74,10 @@
width: 100%;
width: 100%;
height: 100%;
height: 100%;
}
}
video{
width: 100%;
height: 100%;
}
}
}
.tab-preview.long-img {
.tab-preview.long-img {
...
@@ -46,4 +87,8 @@
...
@@ -46,4 +87,8 @@
width: 100%;
width: 100%;
height: auto;
height: auto;
}
}
video{
width: 100%;
height: auto;
}
}
}
src/pages/system/previews/preview.js
View file @
d6fb955c
/*
* @Author: 634665781 634665781@qq.com
* @Date: 2023-07-13 13:52:47
* @LastEditors: 634665781 634665781@qq.com
* @LastEditTime: 2025-03-10 14:01:31
* @FilePath: \CivWeb\src\pages\system\previews\preview.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import
React
,
{
useEffect
,
useState
,
useCallback
}
from
'react'
;
import
React
,
{
useEffect
,
useState
,
useCallback
}
from
'react'
;
import
{
FullscreenExitOutlined
,
FullscreenOutlined
}
from
'@ant-design/icons'
;
import
{
FullscreenExitOutlined
,
FullscreenOutlined
}
from
'@ant-design/icons'
;
import
{
notification
}
from
'antd'
;
import
{
notification
}
from
'antd'
;
...
@@ -11,11 +19,16 @@ const PrevieView = props => {
...
@@ -11,11 +19,16 @@ const PrevieView = props => {
fullscreen
:
props
.
params
!==
undefined
&&
props
.
params
.
fullscreen
===
'true'
,
fullscreen
:
props
.
params
!==
undefined
&&
props
.
params
.
fullscreen
===
'true'
,
canScroll
:
props
.
params
!==
undefined
&&
props
.
params
.
longImg
===
'true'
,
canScroll
:
props
.
params
!==
undefined
&&
props
.
params
.
longImg
===
'true'
,
});
});
const
{
imgName
,
accountName
,
fullscreen
,
canScroll
}
=
params
;
const
{
imgName
,
accountName
,
fullscreen
,
canScroll
,
videoName
}
=
params
;
const
[
ref
,
isFullscreen
,
handleFullScreen
,
handleExitFullScreen
]
=
useFullScreen
(
fullscreen
);
const
[
ref
,
isFullscreen
,
handleFullScreen
,
handleExitFullScreen
]
=
useFullScreen
(
fullscreen
);
const
[
imgUrl
,
setImgUrl
]
=
useState
(
''
);
const
[
imgUrl
,
setImgUrl
]
=
useState
(
''
);
const
{
userInfo
=
{}
}
=
props
.
global
;
const
{
userInfo
=
{}
}
=
props
.
global
;
const
getImgUrl
=
useCallback
(()
=>
{
const
getImgUrl
=
useCallback
(()
=>
{
if
(
videoName
){
return
}
getAccountPageListSite
(
getAccountPageListSite
(
{
{
pageIndex
:
1
,
pageIndex
:
1
,
...
@@ -41,8 +54,8 @@ const PrevieView = props => {
...
@@ -41,8 +54,8 @@ const PrevieView = props => {
.
catch
(
err
=>
{
.
catch
(
err
=>
{
// notification.error({ message: '提示', duration: 3, description: '获取图片信息错误' });
// notification.error({ message: '提示', duration: 3, description: '获取图片信息错误' });
});
});
},
[
accountName
,
imgName
,
props
.
global
,
userInfo
.
site
]);
},
[
accountName
,
imgName
,
props
.
global
,
userInfo
.
site
,
videoName
]);
//CityTemp\\视频\\大背景.png
useEffect
(()
=>
{
useEffect
(()
=>
{
getImgUrl
();
getImgUrl
();
},
[
getImgUrl
]);
},
[
getImgUrl
]);
...
@@ -51,7 +64,7 @@ const PrevieView = props => {
...
@@ -51,7 +64,7 @@ const PrevieView = props => {
<
div
className
=
{
classnames
(
styles
[
'tab-preview'
],
canScroll
?
styles
[
'long-img'
]
:
styles
[
'normal-img'
])}
ref
=
{
ref
}
>
<
div
className
=
{
classnames
(
styles
[
'tab-preview'
],
canScroll
?
styles
[
'long-img'
]
:
styles
[
'normal-img'
])}
ref
=
{
ref
}
>
<
div
className
=
{
styles
[
'oper-wrap'
]}
>
<
div
className
=
{
styles
[
'oper-wrap'
]}
>
<
div
className
=
{
styles
[
'oper-btn'
]}
>
<
div
className
=
{
styles
[
'oper-btn'
]}
>
{
isFullscreen
?
(
{
(
isFullscreen
)
?
(
<
FullscreenExitOutlined
className
=
{
styles
[
'btn-fullscreen_exit'
]}
onClick
=
{
handleExitFullScreen
}
/
>
<
FullscreenExitOutlined
className
=
{
styles
[
'btn-fullscreen_exit'
]}
onClick
=
{
handleExitFullScreen
}
/
>
)
:
(
)
:
(
<
FullscreenOutlined
className
=
{
styles
[
'btn-fullscreen'
]}
onClick
=
{
handleFullScreen
}
/
>
<
FullscreenOutlined
className
=
{
styles
[
'btn-fullscreen'
]}
onClick
=
{
handleFullScreen
}
/
>
...
@@ -60,6 +73,13 @@ const PrevieView = props => {
...
@@ -60,6 +73,13 @@ const PrevieView = props => {
<
/div
>
<
/div
>
{
imgUrl
&&
<
img
src
=
{
imgUrl
}
display
=
"block"
position
=
"relative"
alt
=
"演示图片"
/>
}
{
imgUrl
&&
<
img
src
=
{
imgUrl
}
display
=
"block"
position
=
"relative"
alt
=
"演示图片"
/>
}
{
videoName
&&
<
video
style
=
{{
// width: "100%",
// height: "100%",
position
:
"relative"
,
display
:
"block"
,
userSelect
:
"none"
}}
src
=
{
`
${
props
.
global
.
transformDevAssetsBaseURL
(
`
${
videoName
}
`
)}
`
}
controls
autoPlay
=
{
"autoPlay"
}
loop
=
{
"loop"
}
/>
}
<
/div
>
<
/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