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
f478a91c
Commit
f478a91c
authored
Sep 01, 2023
by
徐乐
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 修改
parent
d4bfdb79
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
164 additions
and
66 deletions
+164
-66
BasicLayout.js
src/layouts/BasicLayout.js
+155
-65
BasicLayout.less
src/layouts/BasicLayout.less
+1
-0
login.js
src/pages/user/login/login.js
+8
-1
No files found.
src/layouts/BasicLayout.js
View file @
f478a91c
...
...
@@ -226,73 +226,76 @@ const renderSite = ({ data, config, loading, setLoading, action, actionRef, setM
<
/
>
);
};
//切换集成站点
const
checkIntegration
=
(
val
,
loginAction
,
props
)
=>
{
if
(
val
.
subType
==
'外链'
)
{
window
.
open
(
val
.
url
,
"_blank"
);
}
else
{
let
cli
=
val
.
url
?.
indexOf
(
'client='
)
>=
0
?
val
.
url
.
split
(
'client='
)[
1
]
:
''
;
const
config
=
props
.
global
;
config
.
uiwidgets
=
[];
config
.
widgets
=
[];
config
.
allWidgets
=
[];
if
(
cli
)
{
config
.
client
=
cli
;
}
props
.
instance
&&
props
.
instance
.
updateConfig
(
config
);
loginAction
&&
loginAction
.
getUserInfoAndConfig
(
''
,
true
,
val
.
type
,
cli
);
props
.
history
.
push
(
`/?client=
${
cli
}
`
);
props
.
updateCurrentIndex
(
0
);
defaultApp
();
}
}
const
renderIntegration
=
(
inData
,
loginAction
,
props
)
=>
{
const
[
visible
,
setVisible
]
=
useState
(
false
);
if
(
inData
.
length
<=
1
)
{
return
<><
/
>
}
let
choiceOne
=
inData
?.
find
(
function
(
a
)
{
return
a
.
url
?.
indexOf
(
window
?.
globalConfig
?.
client
)
>=
0
})
return
(
<>
<
Popover
placement
=
"bottomLeft"
trigger
=
"click"
visible
=
{
visible
}
content
=
{
<
div
className
=
{
layoutStyles
.
integrationList
}
>
{
inData
&&
inData
.
map
((
val
)
=>
(
<
p
onClick
=
{()
=>
checkIntegration
(
val
,
loginAction
,
props
)}
>
{
val
.
name
}
<
/p
>
))
}
<
/div
>
}
arrowPointAtCenter
overlayClassName
=
{
classNames
(
layoutStyles
.
stationsWrapper
,
layoutStyles
.
stationsTop2
)}
onVisibleChange
=
{
visible
=>
setVisible
(
visible
)}
>
{
inData
.
length
>
1
?
(
<
div
className
=
{
layoutStyles
.
toggleSite
}
>
<
img
src
=
{
require
(
'../assets/basic/site.png'
)}
className
=
{
layoutStyles
.
site
}
/
>
<
span
className
=
{
layoutStyles
.
name
}
>
{
choiceOne
?.
name
??
''
}
<
/span
>
<
ArrowIcon
className
=
{
layoutStyles
.
arrow
}
style
=
{{
transform
:
!
visible
?
`rotate(0deg)`
:
`rotate(180deg)`
,
}}
/
>
<
/div
>
)
:
null
}
<
/Popover
>
<
/
>
)
}
// const renderIntegration = (inData, loginAction, props) => {
// const [visible, setVisible] = useState(false);
// if (inData.length <= 1) {
// return <></>
// }
// let choiceOne = inData?.find(function (a) {
// return a.url?.indexOf(window?.globalConfig?.client) >= 0
// })
// //切换集成站点
// const checkIntegration = (val, loginAction, props) => {
// if (val.subType == '外链') {
// window.open(val.url, "_blank");
// } else {
// let cli = val.url?.indexOf('client=') >= 0 ? val.url.split('client=')[1] : '';
// const config = props.global;
// config.uiwidgets = [];
// config.widgets = [];
// config.allWidgets = [];
// if (cli) {
// config.client = cli;
// }
// props.instance && props.instance.updateConfig(config);
// loginAction && loginAction.getUserInfoAndConfig('', true, val.type, cli);
// // props.history.push(`/?client=${cli}`);
// // props.updateCurrentIndex(0);
// // defaultApp();
// }
// }
// return (
// <>
// <Popover
// placement="bottomLeft"
// trigger="click"
// visible={visible}
// content={
// <div className={layoutStyles.integrationList}>
// {
// inData && inData.map((val) => (
// <p onClick={() => checkIntegration(val, loginAction, props)}>{val.name}</p>
// ))
// }
// </div>
// }
// arrowPointAtCenter
// overlayClassName={classNames(layoutStyles.stationsWrapper, layoutStyles.stationsTop2)}
// onVisibleChange={visible => setVisible(visible)}
// >
// {inData.length > 1 ? (
// <div className={layoutStyles.toggleSite}>
// <img src={require('../assets/basic/site.png')} className={layoutStyles.site} />
// <span className={layoutStyles.name}>{choiceOne?.name ?? ''}</span>
// <ArrowIcon
// className={layoutStyles.arrow}
// style={{
// transform: !visible ? `rotate(0deg)` : `rotate(180deg)`,
// }}
// />
// </div>
// ) : null}
// </Popover>
// </>
// )
// }
// import defaultProps from '../defaultProps';
const
pickRoutes
=
memoized
((
routes
,
pathname
,
locale
)
=>
{
...
...
@@ -334,6 +337,8 @@ const Layout = props => {
const
actionRef
=
useRef
();
const
history
=
useHistory
();
const
location
=
useLocation
();
const
[
visible
,
setVisible
]
=
useState
(
false
);
const
[
integrationLoading
,
setIntegrationLoading
]
=
useState
(
false
);
const
{
routeConfig
=
{},
matchPath
}
=
pickRoutes
(
props
.
flatMenu
,
location
.
pathname
);
// useEffect(() => {
...
...
@@ -397,8 +402,22 @@ const Layout = props => {
window
.
share
.
event
.
on
(
'updateSite'
,
res
=>
{
setCityData
(
res
);
});
const
handleToggleIndustry
=
event
=>
{
setVisible
(
false
);
setIntegrationLoading
(
false
);
props
.
history
.
push
(
`/?client=
${
window
.
globalConfig
.
homepage
.
client
}
`
);
props
.
updateCurrentIndex
(
0
);
defaultApp
();
};
if
(
window
?.
globalConfig
?.
isIntegration
>
1
)
{
loginAction
.
events
.
on
(
'toggleIndustry'
,
handleToggleIndustry
);
}
return
()
=>
{
window
.
share
.
event
.
removeAllListeners
(
'updateSite'
);
loginAction
.
events
.
removeListener
(
'toggleIndustry'
,
handleToggleIndustry
);
};
},
[]);
...
...
@@ -529,6 +548,77 @@ const Layout = props => {
}
return
false
;
};
//渲染集成站点切换弹框
const
renderIntegration
=
(
inData
,
loginAction
,
props
)
=>
{
if
(
inData
.
length
<=
1
)
{
return
<><
/
>
}
let
choiceOne
=
inData
?.
find
(
function
(
a
)
{
return
a
.
url
?.
indexOf
(
window
?.
globalConfig
?.
client
)
>=
0
})
//切换集成站点
const
checkIntegration
=
(
val
,
loginAction
,
props
)
=>
{
if
(
val
.
subType
==
'外链'
)
{
window
.
open
(
val
.
url
,
"_blank"
);
}
else
{
let
cli
=
val
.
url
?.
indexOf
(
'client='
)
>=
0
?
val
.
url
.
split
(
'client='
)[
1
]
:
''
;
setIntegrationLoading
(
true
);
const
config
=
props
.
global
;
config
.
uiwidgets
=
[];
config
.
widgets
=
[];
config
.
allWidgets
=
[];
if
(
cli
)
{
config
.
client
=
cli
;
}
props
.
instance
&&
props
.
instance
.
updateConfig
(
config
);
loginAction
&&
loginAction
.
getUserInfoAndConfig
(
''
,
true
,
val
.
type
,
cli
);
// props.history.push(`/?client=${cli}`);
// props.updateCurrentIndex(0);
// defaultApp();
}
}
return
(
<>
<
Popover
placement
=
"bottomLeft"
trigger
=
"click"
visible
=
{
visible
}
content
=
{
<
div
className
=
{
layoutStyles
.
integrationList
}
>
{
<
Loading
loading
=
{
integrationLoading
}
/
>
}
{
inData
&&
inData
.
map
((
val
)
=>
(
<
p
onClick
=
{()
=>
checkIntegration
(
val
,
loginAction
,
props
)}
>
{
val
.
name
}
<
/p
>
))
}
<
/div
>
}
arrowPointAtCenter
overlayClassName
=
{
classNames
(
layoutStyles
.
stationsWrapper
,
layoutStyles
.
stationsTop2
)}
onVisibleChange
=
{
visible
=>
setVisible
(
visible
)}
>
{
inData
.
length
>
1
?
(
<
div
className
=
{
layoutStyles
.
toggleSite
}
>
<
img
src
=
{
require
(
'../assets/basic/site.png'
)}
className
=
{
layoutStyles
.
site
}
/
>
<
span
className
=
{
layoutStyles
.
name
}
>
{
choiceOne
?.
name
??
''
}
<
/span
>
<
ArrowIcon
className
=
{
layoutStyles
.
arrow
}
style
=
{{
transform
:
!
visible
?
`rotate(0deg)`
:
`rotate(180deg)`
,
}}
/
>
<
/div
>
)
:
null
}
<
/Popover
>
<
/
>
)
}
return
(
<
SecurityLayout
{...
props
}
>
<
BasicLayout
...
...
src/layouts/BasicLayout.less
View file @
f478a91c
...
...
@@ -350,6 +350,7 @@
.integrationList{
display: flex;
position: relative;
}
.integrationList p{
margin: 0 10px;
...
...
src/pages/user/login/login.js
View file @
f478a91c
...
...
@@ -434,7 +434,11 @@ class Login {
hideFeedback,
// mapsettings: config.mapsettings
});
self.updateConfig && self.updateConfig(self.globalConfig);
if (this.globalConfig?.isIntegration >= 1) {
self.updateConfig && self.updateConfig(self.globalConfig);
}
self.getProjectItems().then(res => {
window.subSysCfg = {};
self.globalConfig = Object.assign(self.globalConfig, {
...
...
@@ -505,6 +509,9 @@ class Login {
// if (mainConf.productType)
// self.globalConfig.productType = mainConf.productType;
}
if
(
this
.
globalConfig
?.
isIntegration
>=
1
)
{
self
.
updateConfig
&&
self
.
updateConfig
(
self
.
globalConfig
);
}
this
.
isOpenYanshi
(
self
,
getIndustry
);
});
}
else
{
...
...
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