Commit fa99b894 authored by 张帆's avatar 张帆

站点修改控制显示

parent e1f44abd
Pipeline #79144 passed with stages
...@@ -112,7 +112,7 @@ ...@@ -112,7 +112,7 @@
"@wisdom-components/basictable": "^1.5.16", "@wisdom-components/basictable": "^1.5.16",
"@wisdom-components/empty": "^1.4.1", "@wisdom-components/empty": "^1.4.1",
"@wisdom-map/amap": "1.1.0-beta.56", "@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/basemap": "1.1.0-29",
"@wisdom-map/util": "^1.0.28-0", "@wisdom-map/util": "^1.0.28-0",
"@wisdom-utils/components": "0.1.322", "@wisdom-utils/components": "0.1.322",
......
...@@ -252,34 +252,36 @@ const GlobalHeaderRight = props => { ...@@ -252,34 +252,36 @@ const GlobalHeaderRight = props => {
}; };
useEffect(() => { useEffect(() => {
if (global.userInfo) { if (global.userInfo) {
roleStationArr.current = global.userInfo.roles.filter(item => item.name.includes('站点_')); if(window._changeStation){
if (roleStationArr.current.length) { roleStationArr.current = global.userInfo.roles.filter(item => item.name.includes('站点_'));
let stationname=roleStationArr.current[0].description?roleStationArr.current[0]:roleStationArr.current[0].name if (roleStationArr.current.length) {
let saveOption=roleStationArr.current[0] let stationname=roleStationArr.current[0].description?roleStationArr.current[0]:roleStationArr.current[0].name
if(global.mapsettings&&global.mapsettings.layers){ let saveOption=roleStationArr.current[0]
global.mapsettings.layers.forEach((item)=>{ if(global.mapsettings&&global.mapsettings.layers){
if(item.layerType=="PipenetLayer"){ global.mapsettings.layers.forEach((item)=>{
let roalarr = item.roleNames?item.roleNames.split(","):[] if(item.layerType=="PipenetLayer"){
if(roalarr.length){ let roalarr = item.roleNames?item.roleNames.split(","):[]
roalarr.forEach((result)=>{ if(roalarr.length){
if(result.includes('站点_')){ roalarr.forEach((result)=>{
// stationname=result if(result.includes('站点_')){
roleStationArr.current.forEach((respon)=>{ // stationname=result
if(respon.name==result){ roleStationArr.current.forEach((respon)=>{
saveOption=respon if(respon.name==result){
stationname=respon.description?respon.description:respon.name 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]); }, [global.userInfo]);
......
...@@ -110,7 +110,8 @@ ...@@ -110,7 +110,8 @@
} }
.@{ant-prefix}-select-selection-item{ .@{ant-prefix}-select-selection-item{
color: #FEFEFE; color: #FEFEFE;
max-width: 120px; // max-width: 120px;
width: 100%;
overflow: hidden; overflow: hidden;
white-space: nowrap; white-space: nowrap;
text-overflow: ellipsis; text-overflow: ellipsis;
......
...@@ -323,6 +323,13 @@ class Login { ...@@ -323,6 +323,13 @@ class Login {
]) ])
.then(results => { .then(results => {
const promise = results[0]; 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 = { const mqttConfig = {
mqtt_mess: {}, mqtt_mess: {},
mqtt_path: DEFAULT_MQTT_PATH, mqtt_path: DEFAULT_MQTT_PATH,
...@@ -368,7 +375,6 @@ class Login { ...@@ -368,7 +375,6 @@ class Login {
mqttConfig.mqtt_iotIP = `${mqttConfig.mqtt_mess.TcpIP}:${ mqttConfig.mqtt_iotIP = `${mqttConfig.mqtt_mess.TcpIP}:${
mqttConfig.mqtt_mess.TcpPort ? mqttConfig.mqtt_mess.TcpPort : '443' mqttConfig.mqtt_mess.TcpPort ? mqttConfig.mqtt_mess.TcpPort : '443'
}`; }`;
self.globalConfig = Object.assign(self.globalConfig, { self.globalConfig = Object.assign(self.globalConfig, {
...mqttConfig, ...mqttConfig,
}); });
...@@ -582,15 +588,22 @@ class Login { ...@@ -582,15 +588,22 @@ class Login {
} else { } else {
layer.layerType = 'PipenetLayer'; layer.layerType = 'PipenetLayer';
} }
let flag = false;
if (layers && layers.length > 1 && widgetIndex === -1) { this.globalConfig.uiwidgets.forEach(item => {
this.globalConfig.uiwidgets.push({ if (item.label == '图层管理') {
bottom: isScale ? MAX_BOTTOM + 70 : MAX_BOTTOM + 35, flag = true;
config: '', }
label: '方案切换', });
right: 15, if (!flag) {
url: 'product/webgisPanda/ToggleProject/ToggleProject', 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) { if (layer.areaName) {
this.globalConfig.mapsettings.areasettings.areaName = 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