Commit b67e62aa authored by 张帆's avatar 张帆

修改站点切换未判断站点名称问题

parent c7d05665
Pipeline #78989 passed with stages
......@@ -255,7 +255,7 @@ const GlobalHeaderRight = props => {
if(global.mapsettings&&global.mapsettings.layers){
global.mapsettings.layers.forEach((item)=>{
if(item.layerType=="PipenetLayer"){
let roalarr = item.roleNames.split(",")
let roalarr = item.roleNames?item.roleNames.split(","):[]
if(roalarr.length){
roalarr.forEach((result)=>{
if(result.includes('站点_')){
......@@ -282,51 +282,53 @@ const GlobalHeaderRight = props => {
<div className={className}>
{renderTopMenu()}
{
<div className={styles.curentPersonStationWriper}>
<span>站点:</span>
<div className={styles.currentPersonStationSlect}>
<Select
style={{ width: '100%' }}
ref={slectDom}
bordered={false}
onSearch={stationSerach}
onChange={currentStationChange}
onFocus={()=>{stationOpen.current=true;setUpdate(stationOpen.current)}}
onBlur={()=>{
setTimeout(()=>{
stationOpen.current=false
setUpdate(stationOpen.current)
},200)
}}
open={stationOpen.current}
value={stationvalue}
showSearch
dropdownRender={(menu) => {
return (
<>
<ul className={styles.scalnameSlectMenu}>
{
showStationList.map((item)=>{
return (
<li style={{background:item.name==stationvalue?"#1685ff47":""}} onClick={()=>{closePan(item.name)}}>
<img src={item.name==stationvalue?stationChoose:stationNotChoose}></img>
<span style={{
color:item.name==stationvalue?"#1685ff":"#000",
fontWeight:item.name==stationvalue?"600":"400",
}}>{item.name}</span>
</li>
)
})
}
</ul>
</>
)
}}
>
</Select>
roleStationArr.current.length>1&&(
<div className={styles.curentPersonStationWriper}>
<span>站点:</span>
<div className={styles.currentPersonStationSlect}>
<Select
style={{ width: '100%' }}
ref={slectDom}
bordered={false}
onSearch={stationSerach}
onChange={currentStationChange}
onFocus={()=>{stationOpen.current=true;setUpdate(stationOpen.current)}}
onBlur={()=>{
setTimeout(()=>{
stationOpen.current=false
setUpdate(stationOpen.current)
},200)
}}
open={stationOpen.current}
value={stationvalue}
showSearch
dropdownRender={(menu) => {
return (
<>
<ul className={styles.scalnameSlectMenu}>
{
showStationList.map((item)=>{
return (
<li style={{background:item.name==stationvalue?"#1685ff47":""}} onClick={()=>{closePan(item.name)}}>
<img src={item.name==stationvalue?stationChoose:stationNotChoose}></img>
<span style={{
color:item.name==stationvalue?"#1685ff":"#000",
fontWeight:item.name==stationvalue?"600":"400",
}}>{item.name}</span>
</li>
)
})
}
</ul>
</>
)
}}
>
</Select>
</div>
</div>
</div>
)
}
<Avatar menu config={props.global} updateCurrentIndex={props.updateCurrentIndex} updateConfig={props.updateConfig} logout={logout} />
</div>
......
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