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
45ee5344
Commit
45ee5344
authored
5 months ago
by
周宏民
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修改跳转子站指定功能时,有时不成功的bug
parent
658fdcd6
Pipeline
#93716
passed with stages
Changes
6
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
82 additions
and
19 deletions
+82
-19
index.js
src/components/IntegratedSwitch/index.js
+17
-2
index.less
src/components/IntegratedSwitch/index.less
+10
-3
BasicLayout.js
src/layouts/BasicLayout.js
+9
-1
index.js
src/pages/bootpage/template/integrationNew/index.js
+9
-7
index.js
src/pages/bootpage/template/project/qinzhou/index.js
+9
-6
utils.js
src/utils/utils.js
+28
-0
No files found.
src/components/IntegratedSwitch/index.js
View file @
45ee5344
...
...
@@ -15,7 +15,7 @@ import { defaultApp } from '@/micro';
import
{
useHistory
}
from
'@wisdom-utils/runtime'
;
import
LoadPage
from
'@/components/LoadPage'
;
import
{
getUserInfo
,
getWebSiteConfig
}
from
'@/api/service/base'
;
import
{
goToPath
}
from
'@/utils/utils'
;
import
{
goToPath
,
searchUrl
}
from
'@/utils/utils'
;
import
styles
from
'./index.less'
;
const
IntegratedSwitch
=
props
=>
{
...
...
@@ -105,6 +105,10 @@ const IntegratedSwitch = props => {
// 子站跳转
// eslint-disable-next-line no-shadow
const
handlePage
=
useCallback
((
item
,
loginAction
)
=>
{
if
(
window
.
clientInfo
)
{
window
.
clientInfo
=
null
;
}
if
(
item
.
subType
===
'外链'
)
{
setJumpLoading
(
true
);
jumpProgressStart
();
...
...
@@ -181,6 +185,7 @@ const IntegratedSwitch = props => {
setClient(cli);
clientRef.current = cli;
window.clientInfo = item;
const config = props.global;
config.uiwidgets = [];
config.widgets = [];
...
...
@@ -224,9 +229,19 @@ const IntegratedSwitch = props => {
const handleToggleIndustry = event => {
setJumpLoading(false);
jumpProgressEnd();
let url = '';
const { pathname } = window.location;
if (window.clientInfo?.url && window.clientInfo.subType === '内链') {
if (pathname.indexOf('/civbase/thirdParty') === -1) {
// 上一个也是站内跳转,则可直接用 BasicLayout 里的跳转
return;
}
// 上个子站不是站外链接,可直接用跳转
url = searchUrl(window.clientInfo.url);
}
history.push(`
/
?
client
=
$
{
clientRef
.
current
||
props
.
global
.
client
||
''
}
`);
props.updateCurrentIndex(0);
defaultApp();
defaultApp(
url
);
};
const handleError = () => {
setJumpLoading(false);
...
...
This diff is collapsed.
Click to expand it.
src/components/IntegratedSwitch/index.less
View file @
45ee5344
...
...
@@ -33,14 +33,17 @@
border-radius: 14px;
overflow: hidden;
height: 8px;
width: 80px;
// width: 80px;
width: auto;
background: rgba(94, 121, 143, .65);
transition:
height .5
s ease;
transition:
width .3s ease, height .3
s ease;
margin: 0 0 6px 0;
transition-delay: 0.5s;
&:hover {
height: 50px;
width: auto;
transition-delay: 0s;
.switchPageLi {
display: flex;
...
...
@@ -50,13 +53,17 @@
.switchPageLi {
padding: 10px;
display: none;
// display: none;
display: flex;
height: 100%;
overflow: hidden;
opacity: 0.8;
transition: all .3s ease;
transition-delay: 0.5s;
&:hover {
opacity: 1;
transition-delay: 0s;
}
}
...
...
This diff is collapsed.
Click to expand it.
src/layouts/BasicLayout.js
View file @
45ee5344
...
...
@@ -31,6 +31,7 @@ import { defaultApp } from '@/micro';
import
{
appService
}
from
'@/api'
;
import
LoginAction
from
'@/pages/user/login/login'
;
import
IntegratedSwitch
from
'@/components/IntegratedSwitch'
;
import
{
searchUrl
}
from
'@/utils/utils'
;
import
Loading
from
'../components/Loading'
;
import
{
waterMark
}
from
'../utils/mark'
;
import
layoutStyles
from
'./BasicLayout.less'
;
...
...
@@ -428,9 +429,16 @@ const Layout = props => {
const
handleToggleIndustry
=
event
=>
{
setVisible
(
false
);
setIntegrationLoading
(
false
);
let
url
=
''
;
if
(
window
.
clientInfo
?.
url
&&
window
.
clientInfo
.
subType
===
'内链'
)
{
url
=
searchUrl
(
window
.
clientInfo
.
url
);
}
props
.
history
.
push
(
`/?client=
${
window
.
globalConfig
.
client
}
`
);
props
.
updateCurrentIndex
(
0
);
defaultApp
();
defaultApp
(
url
);
if
(
window
.
clientInfo
){
window
.
clientInfo
=
null
}
};
if
(
window
?.
globalConfig
?.
isIntegration
>=
1
)
{
...
...
This diff is collapsed.
Click to expand it.
src/pages/bootpage/template/integrationNew/index.js
View file @
45ee5344
...
...
@@ -8,7 +8,7 @@ import { appService } from '@/api';
import
{
connect
}
from
'react-redux'
;
import
{
actionCreators
}
from
'@/containers/App/store'
;
import
axios
from
'axios'
;
import
{
getImageUrl
,
goToPath
}
from
'@/utils/utils'
;
import
{
getImageUrl
,
searchUrl
}
from
'@/utils/utils'
;
import
{
getUserInfo
,
getWebSiteConfig
}
from
'@/api/service/base'
;
import
{
FullscreenExitOutlined
,
FullscreenOutlined
}
from
'@ant-design/icons'
;
...
...
@@ -234,7 +234,9 @@ const IntegrationNew = props => {
return;
}
const { url, client } = item;
if (window.clientInfo) {
window.clientInfo = null;
}
if (item.subType === '内链' && client) {
toClient(item, loginA);
} else {
...
...
@@ -345,14 +347,14 @@ const IntegrationNew = props => {
setJumpLoading(false);
jumpProgressEnd();
window.jumpLoadingProgress = 0;
let url = '';
if (window.clientInfo?.url && window.clientInfo.subType === '内链') {
goToPath(window.clientInfo?
.url);
url = searchUrl(window.clientInfo
.url);
window.clientInfo = null;
} else {
props.history.push(`
/
?
client
=
$
{
clientRef
.
current
||
props
.
global
.
client
}
`);
props.updateCurrentIndex && props.updateCurrentIndex(0);
defaultApp();
}
props.history.push(`
/
?
client
=
$
{
clientRef
.
current
||
props
.
global
.
client
}
`);
props.updateCurrentIndex && props.updateCurrentIndex(0);
defaultApp(url);
};
const handleError = () => {
...
...
This diff is collapsed.
Click to expand it.
src/pages/bootpage/template/project/qinzhou/index.js
View file @
45ee5344
...
...
@@ -3,7 +3,7 @@ import { FullscreenExitOutlined, FullscreenOutlined } from '@ant-design/icons';
import
{
message
,
Button
}
from
'antd'
;
import
classNames
from
'classnames'
;
import
{
debounce
}
from
'lodash'
;
import
{
getImageUrl
,
goToPath
}
from
'@/utils/utils'
;
import
{
getImageUrl
,
goToPath
,
searchUrl
}
from
'@/utils/utils'
;
import
React
,
{
useRef
,
useEffect
,
useState
,
useMemo
}
from
'react'
;
import
backImg
from
'@/assets/images/demonstration/返回.png'
;
...
...
@@ -232,6 +232,9 @@ const IntegrationQinzhou = props => {
};
const onLink = (item, loginA) => {
if (!item) return;
if (window.clientInfo) {
window.clientInfo = null;
}
const token = props.global?.token || Cookies.get('token');
if (!token) {
history.push(`
/
user
/
login
?
client
=
$
{
integrationClient
}
`, { reload: true });
...
...
@@ -282,14 +285,14 @@ const IntegrationQinzhou = props => {
setJumpLoading(false);
jumpProgressEnd();
window.jumpLoadingProgress = 0;
let url = '';
if (window.clientInfo?.url && window.clientInfo.subType === '内链') {
goToPath(window.clientInfo?
.url);
url = searchUrl(window.clientInfo
.url);
window.clientInfo = null;
} else {
props.history.push(`
/
?
client
=
$
{
clientRef
.
current
||
props
.
global
.
client
}
`);
props.updateCurrentIndex && props.updateCurrentIndex(0);
defaultApp();
}
props.history.push(`
/
?
client
=
$
{
clientRef
.
current
||
props
.
global
.
client
}
`);
props.updateCurrentIndex && props.updateCurrentIndex(0);
defaultApp(url);
};
const handleError = () => {
setJumpLoading(false);
...
...
This diff is collapsed.
Click to expand it.
src/utils/utils.js
View file @
45ee5344
...
...
@@ -158,3 +158,31 @@ export const goToPath = (path, data, widgetId, mode) => {
console
.
log
(
params
,
url
);
window
.
history
.
pushState
(
params
,
''
,
url
);
};
/**
* 查找功能的跳转地址
* @param {*} path 功能地址
*/
export
const
searchUrl
=
path
=>
{
const
routes
=
window
.
globalConfig
?.
widgets
||
[];
let
url
=
''
;
if
(
!
path
||
!
routes
.
length
)
return
url
;
const
target
=
path
.
substr
(
0
,
1
)
===
'/'
?
path
.
slice
(
1
)
:
path
;
function
urlSearch
(
arr
)
{
arr
.
forEach
(
a
=>
{
if
(
a
.
url
)
{
if
(
a
.
url
.
indexOf
(
target
)
>
-
1
)
{
url
=
a
.
url
.
substr
(
0
,
1
)
===
'/'
?
a
.
url
:
`/
${
a
.
url
}
`
;
url
=
`/civbase/
${
a
.
product
}${
url
}
`
;
}
}
if
(
a
.
widgets
)
{
urlSearch
(
a
.
widgets
);
}
});
}
urlSearch
(
routes
);
if
(
!
url
)
return
url
;
return
url
;
};
This diff is collapsed.
Click to expand it.
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