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
b122d3d9
Commit
b122d3d9
authored
1 year ago
by
杨思琦
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 站点修改
parent
502148b5
master
devNew
soundai
test
Pipeline
#86084
passed with stages
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
12 deletions
+13
-12
BasicLayout.js
src/layouts/BasicLayout.js
+6
-4
Site.js
src/layouts/Site.js
+7
-8
No files found.
src/layouts/BasicLayout.js
View file @
b122d3d9
...
...
@@ -180,9 +180,11 @@ const Stations = props => {
const
renderSite
=
({
data
,
config
,
loading
,
setLoading
,
action
,
actionRef
,
setMenuLoading
})
=>
{
const
[
visible
,
setVisible
]
=
useState
(
false
);
const
[
stationName
,
setStationName
]
=
useState
(
''
);
useEffect
(()
=>
{
window
.
share
.
event
.
on
(
'changeSiteVisible'
,
res
=>
{
setVisible
(
res
);
window
.
share
.
event
.
on
(
'changeSiteVisible'
,
(
res
)
=>
{
setStationName
(
res
.
currentStationName
);
setVisible
(
res
.
visible
);
});
return
()
=>
{
window
.
share
.
event
.
removeAllListeners
(
'changeSiteVisible'
);
...
...
@@ -226,7 +228,7 @@ const renderSite = ({ data, config, loading, setLoading, action, actionRef, setM
{
Array
.
isArray
(
data
.
stations
)
?
(
<
div
className
=
{
layoutStyles
.
toggleSite
}
>
<
img
src
=
{
require
(
'../assets/basic/site.png'
)}
className
=
{
layoutStyles
.
site
}
alt
=
""
/>
<
span
className
=
{
layoutStyles
.
name
}
>
{
data
.
currentS
tationName
}
<
/span
>
<
span
className
=
{
layoutStyles
.
name
}
>
{
stationName
===
''
?
data
.
currentStationName
:
s
tationName
}
<
/span
>
<
ArrowIcon
className
=
{
layoutStyles
.
arrow
}
// fillColor="#fff"
...
...
@@ -403,7 +405,7 @@ const Layout = props => {
GetIntegrationConfig
();
}
window
.
share
.
event
.
on
(
'updateSite'
,
res
=>
{
setCityData
(
{...
cityData
,
...
res
}
);
setCityData
(
res
);
});
const
handleToggleIndustry
=
event
=>
{
...
...
This diff is collapsed.
Click to expand it.
src/layouts/Site.js
View file @
b122d3d9
...
...
@@ -288,7 +288,7 @@ class Site {
return
arr
;
}
writeCookie
(
token
,
site
,
onChangeVisible
,
actionRef
,
accessToken
)
{
writeCookie
(
token
,
site
,
onChangeVisible
,
actionRef
,
accessToken
,
item
)
{
const
date
=
new
Date
();
date
.
setTime
(
date
.
getTime
()
+
24
*
60
*
60
*
1000
);
// date = date.toGMTString();
...
...
@@ -348,7 +348,7 @@ class Site {
self
.
props
.
history
&&
self
.
props
.
history
.
push
(
url
);
self
.
props
&&
self
.
props
.
updateCollapsed
&&
self
.
props
.
updateCollapsed
(
false
);
window
.
share
.
event
.
emit
(
'triggerMicro'
,
this
.
props
.
global
);
onChangeVisible
?
onChangeVisible
(
false
)
:
window
.
share
.
event
.
emit
(
'changeSiteVisible'
,
false
);
window
.
share
.
event
.
emit
(
'changeSiteVisible'
,
{
currentStationName
:
item
.
groupName
,
visible
:
false
}
);
});
login
.
init
();
}
...
...
@@ -359,15 +359,14 @@ class Site {
const
{
token
}
=
this
.
globalConfig
.
userInfo
;
this
.
setLoading
(
true
);
if
(
token
)
{
window
.
share
.
event
.
emit
(
'updateSite'
,
{
...
item
,
currentStationName
:
item
.
groupName
});
this
.
beforeChangeCheck
(
token
,
site
,
onChangeVisible
,
actionRef
);
this
.
beforeChangeCheck
(
token
,
site
,
onChangeVisible
,
actionRef
,
item
);
}
else
{
this
.
setLoading
(
false
);
message
.
warning
(
'切换企业失败'
);
}
}
beforeChangeCheck
(
token
,
site
,
onChangeVisible
,
actionRef
)
{
beforeChangeCheck
(
token
,
site
,
onChangeVisible
,
actionRef
,
item
)
{
const
userParam
=
{
token
,
subOID
:
'subOID'
,
...
...
@@ -405,17 +404,17 @@ class Site {
const
accessToken
=
tokenRes
.
data
?.
access_token
??
null
;
config
.
access_token
=
accessToken
;
localStorage
.
setItem
(
'access_token'
,
accessToken
);
this
.
writeCookie
(
token
,
site
,
onChangeVisible
,
actionRef
,
accessToken
);
this
.
writeCookie
(
token
,
site
,
onChangeVisible
,
actionRef
,
accessToken
,
item
);
})
.
catch
(
err
=>
{
this
.
setLoading
(
false
);
config
.
access_token
=
null
;
this
.
writeCookie
(
token
,
site
,
onChangeVisible
,
actionRef
,
null
);
this
.
writeCookie
(
token
,
site
,
onChangeVisible
,
actionRef
,
null
,
item
);
});
}
else
{
config
.
access_token
=
null
;
localStorage
.
setItem
(
'access_token'
,
null
);
this
.
writeCookie
(
token
,
site
,
onChangeVisible
,
actionRef
,
null
);
this
.
writeCookie
(
token
,
site
,
onChangeVisible
,
actionRef
,
null
,
item
);
}
})
.
catch
(
err
=>
{
...
...
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