From 3b2906156233535434a271350c18005c41d818dc Mon Sep 17 00:00:00 2001 From: red-deng-deng <1924913374@qq.com> Date: Mon, 13 Dec 2021 12:17:25 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=AF=BC=E8=88=AA=E4=B8=8E?= =?UTF-8?q?=E5=86=85=E5=AE=B9=E6=98=BE=E7=A4=BA=E5=86=B2=E7=AA=81bug?= =?UTF-8?q?=EF=BC=8C=E4=BC=98=E5=8C=96=E7=BB=86=E8=8A=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/pagination/main.js | 3 --- src/components/subnav/main.js | 27 ++++++++++++------- src/pages/home/home.js | 4 +-- src/pages/login/loginform.js | 8 +++--- src/pages/order/list/list.js | 2 +- .../account/add/adduserinfo/adduserinfo.js | 2 ++ 6 files changed, 27 insertions(+), 19 deletions(-) diff --git a/src/components/pagination/main.js b/src/components/pagination/main.js index 9494398b..572d8dc6 100644 --- a/src/components/pagination/main.js +++ b/src/components/pagination/main.js @@ -155,13 +155,10 @@ import _ from "lodash"; const { data} = this.props; let page_num =Math.ceil( data.count / this.state.count); - console.log(page_num) - let btnPages = [] for(let i = 1;i{ - if(item.level ===5){ - sessionStorage.setItem('pathname2',item.router); + item.children.forEach(it=>{ + if(it.level ===5){ + sessionStorage.setItem('pathname2',it.router); throw '终止循环' } }) }catch(e){ } self.setState({'linkshowname':item.title}); - self.setState({'menulinklist':item.child}); + self.setState({'menulinklist':item.children}); - // 防止刷新页面,导航签清空 - sessionStorage.setItem('menulinklist',JSON.stringify(item.child)); + sessionStorage.setItem('menulinklist',JSON.stringify(item.children)); sessionStorage.setItem('showflag',true); sessionStorage.setItem('linkshowname',item.title); } @@ -74,13 +73,23 @@ export default class topNav extends React.Component{ if(pathnamestr.includes('aid')){ breaknav=JSON.parse(sessionStorage.getItem('subbreaknav')) } + let accPath=null; return(
{ this.state.navlists.map((item,i)=>{ + try{ + item.children.forEach(it=>{ + if(it.level ===5){ + accPath=it.router; + throw '终止循环' + } + }) + }catch(e){ + } return ( - item.child&&item.child.length>0?this.showlinkmenu(e,item)} >{item.title}:null + item.children&&item.children.length>0?this.showlinkmenu(e,item)} >{item.title}:null ) }) @@ -95,7 +104,7 @@ export default class topNav extends React.Component{
{ this.state.menulinklist.map((item,key)=>{ - return(item.level==5?this.btnfn(item)} className={pathnameBreak==item.router&&item.child.length>=1?'menuactive':''}>{item.title}:null) + return(item.level==5?this.btnfn(item)} className={pathnameBreak==item.router&&item.children.length>=1?'menuactive':''}>{item.title}:null) }) }
数据最后更新时间:{window.timeshow} diff --git a/src/pages/home/home.js b/src/pages/home/home.js index 3c1e4602..b664c2e4 100644 --- a/src/pages/home/home.js +++ b/src/pages/home/home.js @@ -374,10 +374,10 @@ export default class App extends Component { - ( )}> - + */} {/* diff --git a/src/pages/login/loginform.js b/src/pages/login/loginform.js index 30c4bfee..b23f5aa0 100644 --- a/src/pages/login/loginform.js +++ b/src/pages/login/loginform.js @@ -57,10 +57,10 @@ function FormDom(props) { sessionStorage.setItem('activeMenu',JSON.stringify(response.menu)); try{ menuList.forEach(item=>{ - if(item.child&&item.child.length>0){ - let obj=item.child.filter(item=>item.level==5); + if(item.children&&item.children.length>0){ + let obj=item.children.filter(item=>item.level==5); sessionStorage.setItem('pathname2',obj[0].router); - sessionStorage.setItem('menulinklist',JSON.stringify(item.child)); + sessionStorage.setItem('menulinklist',JSON.stringify(item.children)); if(item.id==16){ sessionStorage.setItem('linkshowname',"营销计划管理"); setTimeout(()=>{ @@ -68,7 +68,7 @@ function FormDom(props) { },1000); throw '终止循环' }else{ - sessionStorage.setItem('linkshowname',obj[0].title); + sessionStorage.setItem('linkshowname',item.title); setTimeout(()=>{ props.history.push(obj[0].router) },1000); diff --git a/src/pages/order/list/list.js b/src/pages/order/list/list.js index 8ae646fb..944cd3bf 100644 --- a/src/pages/order/list/list.js +++ b/src/pages/order/list/list.js @@ -515,7 +515,7 @@ componentDidUpdate(prevProps,prevState){

- this.optiononChange(e)} disableSearch options={options} clearable placeholder="请选择查询分类" /> {/* */} { this.state.option?this.state.option.key=='1'? {this.setState({key_word:''})}} wordSearch={this.sureFn.bind(this)} onChange={(e)=>this.setState({key_word:e})} value={this.state.key_word} icon="search" placeholder={"请输入key进行搜索"} countShow={false} height={'36px'} width={'260px'} alignment={'left'}/>: diff --git a/src/pages/system/account/add/adduserinfo/adduserinfo.js b/src/pages/system/account/add/adduserinfo/adduserinfo.js index 7c7252c4..b4306b22 100644 --- a/src/pages/system/account/add/adduserinfo/adduserinfo.js +++ b/src/pages/system/account/add/adduserinfo/adduserinfo.js @@ -127,6 +127,7 @@ export default class adduserinfo extends React.Component{ Notify.success(msg); setTimeout(()=>{ window.history.back() + sessionStorage.setItem('pathname2','/home/system/account-list') },1000); },(err)=>{ Notify.error(err) @@ -142,6 +143,7 @@ export default class adduserinfo extends React.Component{ Notify.clear(); Notify.success(msg); setTimeout(()=>{ + sessionStorage.setItem('pathname2','/home/system/account-list') window.history.back() },1000); },(err)=>{