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
c1a561c9
Commit
c1a561c9
authored
Mar 30, 2022
by
邓晓峰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修复mapsetting
parent
cd7ae4fb
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
72 additions
and
37 deletions
+72
-37
reducer.js
src/containers/App/store/reducer.js
+2
-0
index.js
src/pages/map/index.js
+37
-9
login.js
src/pages/user/login/login.js
+33
-28
No files found.
src/containers/App/store/reducer.js
View file @
c1a561c9
...
...
@@ -82,6 +82,7 @@ const appReducer = (state = initialState, action) => {
case
GET_CONFIG
:
// eslint-disable-next-line no-debugger
// eslint-disable-next-line no-underscore-dangle
window
.
__INITIAL_STATE__
=
Object
.
assign
(
{},
// eslint-disable-next-line no-underscore-dangle
...
...
@@ -99,6 +100,7 @@ const appReducer = (state = initialState, action) => {
window
.
__INITIAL_STATE__
.
mdi
=
'SDI'
;
window
.
__INITIAL_STATE__
.
menu
=
'banner-left'
;
window
.
globalConfig
=
AppConfig
(
window
.
__INITIAL_STATE__
);
// eslint-disable-next-line no-undef
createStoreage
.
set
(
'globalConfig'
,
window
.
globalConfig
);
// eslint-disable-next-line no-undef,no-case-declarations
...
...
src/pages/map/index.js
View file @
c1a561c9
import
React
from
'react'
;
import
{
Spin
}
from
'antd'
;
import
_
from
'lodash'
import
{
connect
}
from
'react-redux'
;
import
{
actionCreators
}
from
'@/containers/App/store'
;
import
MapComponent
from
'@/components/mapView'
;
...
...
@@ -11,26 +10,55 @@ class CreateMap extends React.Component {
this
.
mapManganerRef
=
React
.
createRef
();
}
state
=
{
loading
:
true
,
config
:
window
.
globalConfig
.
mapsettings
,
widgets
:
window
.
globalConfig
.
uiwidgets
,
};
// state = {
// loading: true,
// config: this.props.global.mapsettings,
// widgets: this.props.global.uiwidgets,
// };
// componentWillReceiveProps(nextProps) {
// if(nextProps.global.mapsettings !== this.props.global.mapsettings) {
// this.setState(Object.assign({}, this.state, {
// config: nextProps.global.mapsettings
// }))
// }
// if(nextProps.global.uiwidgets !== this.props.global.uiwidgets) {
// this.setState(Object.assign({}, this.state, {
// widgets: nextProps.global.uiwidgets
// }))
// }
// }
getView
=
view
=>
{
console
.
log
(
view
)
this
.
props
.
updageMapView
(
view
);
};
render
()
{
if
(
_
.
isNull
(
this
.
props
.
global
.
mapsettings
.
areasettings
))
{
return
null
;
}
const
props
=
{
loading
:
true
,
config
:
this
.
props
.
global
.
mapsettings
,
widgets
:
this
.
props
.
global
.
uiwidgets
,
}
return
(
<>
<
MapComponent
{...
this
.
state
}
getMapInfo
=
{
this
.
getView
}
/
>
<
MapComponent
{...
props
}
getMapInfo
=
{
this
.
getView
}
/
>
<
/
>
);
}
}
const
mapStateToProps
=
state
=>
({});
const
mapStateToProps
=
state
=>
({
global
:
state
.
getIn
([
'global'
,
'globalConfig'
])
});
const
mapDispatchToProps
=
dispatch
=>
({
updageMapView
(
mapView
)
{
...
...
src/pages/user/login/login.js
View file @
c1a561c9
...
...
@@ -214,27 +214,18 @@ class Login {
})
.
then
(
response
=>
{
const
result
=
response
&&
response
.
code
===
SERVICE_INTERFACE_SUCCESS_CODE
?
Array
.
isArray
(
response
.
data
)
?
response
.
data
:
[]
:
response
;
const
result
=
response
&&
response
.
code
===
SERVICE_INTERFACE_SUCCESS_CODE
?
Array
.
isArray
(
response
.
data
)?
response
.
data
:
[]
:
response
;
if
(
result
&&
result
.
length
>
0
)
{
const
config
=
result
.
shift
();
const
homeType
=
config
.
productType
||
'civweb4'
;
// 产品类型和首页路径同时有才行
const
homepage
=
homeType
&&
(
params
.
getParams
(
'redirect'
)
||
config
.
homepage
)
?
homeType
+
'/'
+
(
params
.
getParams
(
'redirect'
)
||
config
.
homepage
)
:
''
;
const
homepage
=
homeType
&&
(
params
.
getParams
(
'redirect'
)
||
config
.
homepage
)
?
homeType
+
'/'
+
(
params
.
getParams
(
'redirect'
)
||
config
.
homepage
)
:
''
;
self
.
globalConfig
=
Object
.
assign
(
self
.
globalConfig
,
config
,
{
theme
:
self
.
globalConfig
.
theme
,
menu
:
self
.
globalConfig
.
menu
,
style
:
self
.
globalConfig
.
style
,
homepage
:
homepage
,
homepage
:
homepage
// mapsettings: config.mapsettings
});
if
(
self
.
globalConfig
.
hasOwnProperty
(
'webConfig'
))
{
...
...
@@ -246,8 +237,11 @@ class Login {
}
self
.
updateConfig
&&
self
.
updateConfig
(
self
.
globalConfig
);
self
.
getProjectItems
().
then
(()
=>
{
self
.
getProjectItems
().
then
((
res
)
=>
{
window
.
subSysCfg
=
{};
self
.
globalConfig
=
Object
.
assign
(
self
.
globalConfig
,
{
mapsettings
:
res
})
result
.
forEach
(
item
=>
{
window
.
subSysCfg
[
item
.
client
]
=
item
;
});
...
...
@@ -261,11 +255,7 @@ class Login {
// this.events.removeAllListeners('loginSuccess')
// this.events.removeAllListeners('toggleIndustry')
// window.share.event = this.events;
if
(
self
.
globalConfig
.
userInfo
&&
self
.
globalConfig
.
userInfo
.
site
&&
self
.
globalConfig
.
userInfo
.
site
.
length
>
0
)
{
if
(
self
.
globalConfig
.
userInfo
&&
self
.
globalConfig
.
userInfo
.
site
&&
self
.
globalConfig
.
userInfo
.
site
.
length
>
0
)
{
// eslint-disable-next-line no-undef,no-underscore-dangle
getWebSiteConfig
(
...
...
@@ -311,6 +301,8 @@ class Login {
});
}
else
{
// loginSuccess
self
.
updateConfig
&&
self
.
updateConfig
(
self
.
globalConfig
);
// console.log("===loginSuccess===")
getIndustry
...
...
@@ -380,16 +372,24 @@ class Login {
url
:
'product/webgisPanda/ToggleProject/ToggleProject'
,
});
}
if
(
layer
.
areaName
)
debugger
if
(
layer
.
areaName
)
{
this
.
globalConfig
.
mapsettings
.
areasettings
.
areaName
=
layer
.
areaName
;
if
(
layer
.
backgroundColor
)
}
if
(
layer
.
backgroundColor
)
{
this
.
globalConfig
.
mapsettings
.
areasettings
.
backgroundColor
=
layer
.
backgroundColor
;
if
(
layer
.
boundColor
)
layer
.
backgroundColor
;
}
if
(
layer
.
boundColor
)
{
this
.
globalConfig
.
mapsettings
.
areasettings
.
boundColor
=
layer
.
boundColor
;
if
(
layer
.
boundWidth
)
}
if
(
layer
.
boundWidth
)
{
this
.
globalConfig
.
mapsettings
.
areasettings
.
boundWidth
=
layer
.
boundWidth
;
}
// eslint-disable-next-line radix
if
(
Number
.
isInteger
(
parseInt
(
layer
.
backgroundOpacity
)))
{
this
.
globalConfig
.
mapsettings
.
areasettings
.
backgroundOpacity
=
...
...
@@ -397,10 +397,15 @@ class Login {
}
if
(
layer
.
extent
)
this
.
globalConfig
.
mapsettings
.
areasettings
.
extent
=
layer
.
extent
;
if
(
layer
.
basemaps
&&
layer
.
basemaps
.
length
>
0
)
if
(
layer
.
basemaps
&&
layer
.
basemaps
.
length
>
0
)
{
this
.
globalConfig
.
mapsettings
.
basemaps
=
layer
.
basemaps
;
this
.
updateConfig
&&
this
.
updateConfig
(
this
.
globalConfig
);
return
Promise
.
resolve
({});
}
// this.updateConfig && this.updateConfig(Object.assign({}, this.globalConfig, {
// mapsettings: this.globalConfig.mapsettings
// }));
// console.log("mapsettings", this.globalConfig.mapsettings)
return
Promise
.
resolve
(
this
.
globalConfig
.
mapsettings
);
}
handleLoginError
(
callback
)
{
...
...
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