Commit fa99b894 authored by 张帆's avatar 张帆

站点修改控制显示

parent e1f44abd
Pipeline #79144 passed with stages
......@@ -112,7 +112,7 @@
"@wisdom-components/basictable": "^1.5.16",
"@wisdom-components/empty": "^1.4.1",
"@wisdom-map/amap": "1.1.0-beta.56",
"@wisdom-map/arcgismap": "1.4.0-192",
"@wisdom-map/arcgismap": "1.4.0-193",
"@wisdom-map/basemap": "1.1.0-29",
"@wisdom-map/util": "^1.0.28-0",
"@wisdom-utils/components": "0.1.322",
......
......@@ -252,34 +252,36 @@ const GlobalHeaderRight = props => {
};
useEffect(() => {
if (global.userInfo) {
roleStationArr.current = global.userInfo.roles.filter(item => item.name.includes('站点_'));
if (roleStationArr.current.length) {
let stationname=roleStationArr.current[0].description?roleStationArr.current[0]:roleStationArr.current[0].name
let saveOption=roleStationArr.current[0]
if(global.mapsettings&&global.mapsettings.layers){
global.mapsettings.layers.forEach((item)=>{
if(item.layerType=="PipenetLayer"){
let roalarr = item.roleNames?item.roleNames.split(","):[]
if(roalarr.length){
roalarr.forEach((result)=>{
if(result.includes('站点_')){
// stationname=result
roleStationArr.current.forEach((respon)=>{
if(respon.name==result){
saveOption=respon
stationname=respon.description?respon.description:respon.name
}
})
}
})
if(window._changeStation){
roleStationArr.current = global.userInfo.roles.filter(item => item.name.includes('站点_'));
if (roleStationArr.current.length) {
let stationname=roleStationArr.current[0].description?roleStationArr.current[0]:roleStationArr.current[0].name
let saveOption=roleStationArr.current[0]
if(global.mapsettings&&global.mapsettings.layers){
global.mapsettings.layers.forEach((item)=>{
if(item.layerType=="PipenetLayer"){
let roalarr = item.roleNames?item.roleNames.split(","):[]
if(roalarr.length){
roalarr.forEach((result)=>{
if(result.includes('站点_')){
// stationname=result
roleStationArr.current.forEach((respon)=>{
if(respon.name==result){
saveOption=respon
stationname=respon.description?respon.description:respon.name
}
})
}
})
}
}
}
})
})
}
window._menuStation = saveOption;
setStationList(roleStationArr.current)
localStorage.setItem('globMenuStation',JSON.stringify(saveOption))
setStationValue(stationname);
}
window._menuStation = saveOption;
setStationList(roleStationArr.current)
localStorage.setItem('globMenuStation',JSON.stringify(saveOption))
setStationValue(stationname);
}
}
}, [global.userInfo]);
......
......@@ -110,7 +110,8 @@
}
.@{ant-prefix}-select-selection-item{
color: #FEFEFE;
max-width: 120px;
// max-width: 120px;
width: 100%;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
......
......@@ -323,6 +323,13 @@ class Login {
])
.then(results => {
const promise = results[0];
const site = results[1];
if (site.status == 'fulfilled') {
const respon = site.value;
if (respon.code == 0 && respon.data.length) {
window._changeStation = respon.data[0].changeStation;
}
}
const mqttConfig = {
mqtt_mess: {},
mqtt_path: DEFAULT_MQTT_PATH,
......@@ -368,7 +375,6 @@ class Login {
mqttConfig.mqtt_iotIP = `${mqttConfig.mqtt_mess.TcpIP}:${
mqttConfig.mqtt_mess.TcpPort ? mqttConfig.mqtt_mess.TcpPort : '443'
}`;
self.globalConfig = Object.assign(self.globalConfig, {
...mqttConfig,
});
......@@ -582,15 +588,22 @@ class Login {
} else {
layer.layerType = 'PipenetLayer';
}
if (layers && layers.length > 1 && widgetIndex === -1) {
this.globalConfig.uiwidgets.push({
bottom: isScale ? MAX_BOTTOM + 70 : MAX_BOTTOM + 35,
config: '',
label: '方案切换',
right: 15,
url: 'product/webgisPanda/ToggleProject/ToggleProject',
});
let flag = false;
this.globalConfig.uiwidgets.forEach(item => {
if (item.label == '图层管理') {
flag = true;
}
});
if (!flag) {
if (layers && layers.length > 1 && widgetIndex === -1) {
this.globalConfig.uiwidgets.push({
bottom: isScale ? MAX_BOTTOM + 70 : MAX_BOTTOM + 35,
config: '',
label: '方案切换',
right: 15,
url: 'product/webgisPanda/ToggleProject/ToggleProject',
});
}
}
if (layer.areaName) {
this.globalConfig.mapsettings.areasettings.areaName = layer.areaName;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment