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
507cedfc
Commit
507cedfc
authored
Jan 18, 2022
by
邓晓峰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 集成报表菜单
parent
0443c331
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
77 additions
and
2 deletions
+77
-2
BasicLayout1.js
src/layouts/BasicLayout1.js
+13
-1
index.js
src/pages/iframe/index.js
+19
-0
config.js
src/routes/config.js
+5
-0
routes.js
src/utils/routes.js
+40
-1
No files found.
src/layouts/BasicLayout1.js
View file @
507cedfc
...
...
@@ -400,6 +400,7 @@ const BasicLayout = props => {
},
[]);
const
handlerSecond
=
(
item
,
index
)
=>
{
let
current
=
void
0
;
if
(
item
&&
item
.
routes
)
{
setChildrenRoutes
(
item
.
routes
);
...
...
@@ -414,10 +415,18 @@ const BasicLayout = props => {
setSelectedKeys
([
current
.
routes
[
0
].
href
]);
window
.
history
.
pushState
(
null
,
''
,
`/civbase
${
current
.
routes
[
0
].
path
}
`
);
}
else
{
if
(
/iframe/
.
test
(
current
.
path
))
{
history
.
push
({
pathname
:
'/iframe'
,
state
:
current
.
params
})
}
else
{
window
.
history
.
pushState
(
null
,
''
,
`/civbase
${
current
.
path
}
`
);
}
}
}
...
...
@@ -434,6 +443,7 @@ const BasicLayout = props => {
}
const
handleSelectMenuItem
=
(
item
)
=>
{
debugger
setTabActiveKey
(
item
);
if
(
item
.
indexOf
(
'web_console'
)
===
-
1
)
{
window
.
history
.
pushState
(
null
,
''
,
`/civbase
${
item
}
`
);
...
...
@@ -441,6 +451,7 @@ const BasicLayout = props => {
}
const
handlerSelectMenu
=
({
item
,
key
,
keyPath
,
domEvent
})
=>
{
debugger
setSelectedKeys
([
key
]);
window
.
history
.
pushState
(
null
,
''
,
`/civbase
${
key
}
`
);
}
...
...
@@ -498,7 +509,7 @@ const BasicLayout = props => {
}
// const logo = props.global && props.global.get('bannerLogo')? window.globalConfig.transformDevAssetsBaseURL(props.global.get('bannerLogo')): defaultSetting.logo;
console
.
log
(
"children"
,
props
.
children
,
props
);
return
(
<
SecurityLayout
loading
>
{
...
...
@@ -654,6 +665,7 @@ const BasicLayout = props => {
{
/*<CreateBaseMap/>*/
}
{
props
.
children
}
<
/div
>
{
props
.
children
}
<
/PageContainer
>
<
/div
>
<
/div
>
...
...
src/pages/iframe/index.js
0 → 100644
View file @
507cedfc
import
React
from
'react'
;
import
Iframe
from
'react-iframe'
;
export
default
props
=>
{
const
state
=
props
.
location
.
state
||
{};
if
(
!
state
.
linkUrl
)
{
return
null
;
}
return
(
<
Iframe
url
=
{
`
${
state
.
linkUrl
}
?token=
${
window
.
globalConfig
.
token
}
`
}
width
=
"100%"
height
=
"100%"
id
=
"myId"
frameBorder
=
"0"
className
=
"myClassname"
display
=
"initial"
position
=
"relative"
/>
)
}
src/routes/config.js
View file @
507cedfc
...
...
@@ -4,6 +4,7 @@ import { dynamic } from '@wisdom-utils/runtime';
import
BasicLayout
from
'../layouts/BasicLayout1'
;
import
UserLayout
from
'../layouts/UserLayout'
;
import
BootPage
from
'../pages/bootpage'
;
import
Iframe
from
'../pages/iframe'
;
import
Login
from
'../pages/user/login'
;
import
CommonMenu
from
'../pages/commonMenu'
;
import
NoSecret
from
'../pages/user/login/noSecret'
;
...
...
@@ -43,6 +44,10 @@ export const dyRoutes = (routes, layout) => {
component
:
CommonMenu
,
name
:
'菜单收藏'
},
{
path
:
'/iframe'
,
component
:
Iframe
},
{
path
:
'/404'
,
component
:
dynamic
({
...
...
src/utils/routes.js
View file @
507cedfc
import
{
transformURL
}
from
'./utils'
;
import
LoadingComponent
from
'@ant-design/pro-layout/es/PageLoading'
;
import
{
dynamic
}
from
'@wisdom-utils/runtime'
;
import
{
matchPath
,
Route
,
Switch
}
from
'react-router'
;
import
React
,
{
Suspense
,
Fragment
}
from
'react'
;
export
const
isURL
=
function
(
url
)
{
...
...
@@ -24,6 +27,19 @@ export const guid = function(prefix) {
return
prefix
+
uuid
.
replace
(
/-/g
,
'.'
)
+
new
Date
().
getTime
();
};
function
getParams
(
pathname
)
{
let
ret
=
{};
const
url
=
pathname
?
pathname
:
decodeURIComponent
(
window
.
location
.
pathname
);
if
(
url
.
indexOf
(
'|'
)
>
-
1
)
{
const
params
=
url
.
split
(
'|'
)[
1
];
params
.
split
(
'&'
).
map
(
item
=>
ret
[
item
.
split
(
"="
)[
0
]]
=
item
.
split
(
"="
)[
1
])
return
ret
;
}
return
ret
;
}
function
isAbsoluteURL
(
url
)
{
return
/^
([
a-z
][
a-z
\d\+\-\.]
*:
)?\/\/
/i
.
test
(
url
);
};
...
...
@@ -111,6 +127,29 @@ const generRotes = (widgets, parent, level = 0) => {
},
parent
,
};
if
(
/iframe/
.
test
(
url
))
{
url
=
url
.
replace
(
/
\/
report/
,
''
);
console
.
log
(
"url"
,
url
);
ret
.
push
({
name
:
item
.
label
,
level
:
l
,
component
:
dynamic
({
loader
:
()
=>
import
(
/* webpackChunkName: "p__[request]" */
`@/pages/
${
component
}
.js`
),
loading
:
LoadingComponent
}),
path
:
baseURL
!==
''
?
transformURL
(
url
)
:
''
,
href
:
url
,
target
:
isURL
(
url
)
?
'_blank'
:
''
,
key
:
guid
(
'panda'
),
hideInMenu
:
item
.
label
===
'系统菜单组'
?
true
:
item
.
hideInMenu
,
//l > 3 ? true: item.hideInMenu || false,
alias
:
item
.
product
||
DEFAULT_APPLICATION
,
extData
:
{
...
item
,
icon
,
},
params
:
getParams
(
url
),
parent
,
})
}
ret
.
push
(
common
);
}
});
...
...
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