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
77b8a7ad
Commit
77b8a7ad
authored
Dec 19, 2024
by
杨思琦
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: iframe添加自定义参数
parent
9b70963d
Pipeline
#94756
passed with stages
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
3 deletions
+23
-3
TabWidget.js
src/pages/system/iframe/TabWidget.js
+23
-3
No files found.
src/pages/system/iframe/TabWidget.js
View file @
77b8a7ad
...
...
@@ -10,12 +10,32 @@ import styles from './index.less';
import
Hoc
from
'./HocContainer'
;
import
useFullScreen
from
'./useFullScreen'
;
const
TabWidget
=
props
=>
{
function
addParamToUrl
(
url
,
params
)
{
if
(
params
.
length
)
{
try
{
params
.
forEach
((
item
)
=>
{
const
value
=
_
.
get
(
window
,
item
);
if
(
value
)
{
var
regex
=
new
RegExp
(
'([?&])'
+
item
+
'=.*?(&|$)'
,
'i'
);
if
(
url
.
match
(
regex
))
{
url
=
url
.
replace
(
regex
,
'$1'
+
item
+
'='
+
value
+
'$2'
);
}
else
{
url
+=
(
url
.
indexOf
(
'?'
)
===
-
1
?
'?'
:
'&'
)
+
item
+
'='
+
value
;
}
}
})
}
catch
(
error
)
{
}
}
return
url
;
}
const
params
=
Object
.
assign
({},
props
.
params
,
{
fullscreen
:
!
(
props
.
params
!==
undefined
&&
props
.
params
.
fullscreen
===
'true'
),
});
const
{
linkUrl
,
fullscreen
,
bgColor
}
=
params
;
const
{
linkUrl
,
fullscreen
,
bgColor
,
extraParams
=
''
}
=
params
;
const
newLink
=
linkUrl
.
replaceAll
(
'@'
,
'#'
).
replaceAll
(
'*'
,
'?'
).
replaceAll
(
'$'
,
'|'
).
replaceAll
(
'!'
,
'&'
);
const
link
=
extraParams
!==
''
&&
extraParams
.
split
?
addParamToUrl
(
newLink
,
extraParams
.
split
(
','
))
:
newLink
;
const
[
ref
,
isFullscreen
,
handleFullScreen
,
handleExit
]
=
useFullScreen
(
fullscreen
);
const
goToPath
=
(
name
,
data
,
widgetId
)
=>
{
try
{
...
...
@@ -90,9 +110,9 @@ const TabWidget = props => {
)}
<
/div
>
<
/div
>
{
newL
ink
?
(
{
l
ink
?
(
<
Iframe
url
=
{
newL
ink
}
url
=
{
l
ink
}
width
=
"100%"
height
=
"100%"
display
=
"block"
...
...
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