Commit b67e62aa authored by 张帆's avatar 张帆

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

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