From efc427d1e8e082ea1c8584d3832f0578741ee2e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AE=B8=E7=BA=A2=E6=A2=85?= <1924913374@qq.com> Date: Tue, 24 May 2022 17:53:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9table=E5=B0=81=E8=A3=85?= =?UTF-8?q?=E7=9A=84border=E6=A0=B7=E5=BC=8F=EF=BC=8C=E8=A7=A3=E5=86=B3?= =?UTF-8?q?=E8=B7=AF=E7=94=B1=E4=B8=8E=E9=9D=A2=E5=8C=85=E5=AF=BC=E8=88=AA?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E4=B8=8D=E4=B8=80=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/gird/main.css | 6 +- src/components/mouseMenu/main.js | 105 ++++++++++++++++++------------- src/components/subnav/main.js | 4 +- 3 files changed, 69 insertions(+), 46 deletions(-) diff --git a/src/components/gird/main.css b/src/components/gird/main.css index ba00cc8b..70c4a740 100644 --- a/src/components/gird/main.css +++ b/src/components/gird/main.css @@ -9,6 +9,7 @@ height: 48px; display: inline-flex; min-width: 100%; + border-bottom: 1px solid #ddd; } .th-td { @@ -42,7 +43,6 @@ padding: 28px 0; color: rgba(0, 0, 0, .6); font-size: 12px; - border-top: 1px solid #dfe1e6; } @@ -86,7 +86,9 @@ border: none; } - +.th-body .tr:first-child .td{ + border-top: 0; +} .td { display: flex; min-height: 40px; diff --git a/src/components/mouseMenu/main.js b/src/components/mouseMenu/main.js index a59a4b6f..9054deaa 100644 --- a/src/components/mouseMenu/main.js +++ b/src/components/mouseMenu/main.js @@ -1,49 +1,70 @@ import React from "react" import ReactDOM from "react-dom" import "./main.less" -import {Icon} from "zent" +import { Icon } from "zent" import { HashRouter as Router, Route, Link } from "react-router-dom"; import Bus from "../../assets/eventBus.js"; -export default class MouseMenu extends React.Component{ - constructor(props){ - super(props); - this.state={ - activeMenuList:[]//总动态路由数据 +export default class MouseMenu extends React.Component { + constructor(props) { + super(props); + this.state = { + activeMenuList: []//总动态路由数据 + } + } + componentDidMount() { + let activeMenuList = JSON.parse(sessionStorage.getItem("activeMenu")); + this.setState({ activeMenuList }); + } + closeMenuMask() { + this.props.mouseLeaveFn(); + } + //点击菜单 + clickMenuItem(e, it) { + if (it.router == '/home/distributor-add') { + sessionStorage.setItem('pathname2', '/home/system/distributor-add') + let activerou = [{ + 'pagetitle': '新建', items: [ + { + "path": "distributor-list", + "name": "分销商管理" + }, + { + "path": "distributor-add", + "name": "新建分销商" + } + ] + }] + sessionStorage.setItem('breaknav', JSON.stringify(activerou)); + + } + this.props.mouseLeaveFn(); + } + render() { + let menuList = this.state.activeMenuList;//路由表 + const pathname = window.location.href.lastIndexOf('\/'); + const pathnamestr = window.location.href.substr(pathname); + return ( +
+
+
+ { + menuList.map((item, i) => { + return ( +
+ { + item.children.map((childItem, childI) => { + return ( + childItem.level == 5 ? = 1 ? 'mouse_menuactive menu_items' : 'menu_items'} onClick={(e) => this.clickMenuItem(e, childItem)}>{childItem.title} : null + ) + }) + } +
+ ) + }) + } +
+ +
+
) } - } - componentDidMount(){ - let activeMenuList = JSON.parse(sessionStorage.getItem("activeMenu")); - this.setState({activeMenuList}); - } - closeMenuMask(){ - this.props.mouseLeaveFn(); - } - render(){ - let menuList=this.state.activeMenuList;//路由表 - const pathname=window.location.href.lastIndexOf('\/'); - const pathnamestr=window.location.href.substr(pathname); - return( -
-
-
- { - menuList.map((item,i)=>{ - return( -
- { - item.children.map((childItem,childI)=>{ - return( - childItem.level==5?=1?'mouse_menuactive menu_items':'menu_items'} onClick={this.closeMenuMask.bind(this)}>{childItem.title}:null - ) - }) - } -
- ) - }) - } -
- -
-
) - } } \ No newline at end of file diff --git a/src/components/subnav/main.js b/src/components/subnav/main.js index 73b51ca4..4b40990d 100644 --- a/src/components/subnav/main.js +++ b/src/components/subnav/main.js @@ -80,11 +80,11 @@ export default class topNav extends React.Component{ let pathnameBreak=sessionStorage.getItem('pathname2') const pathname=window.location.href.lastIndexOf('\/'); const pathnamestr=window.location.href.substr(pathname); - let breakflag=pathnamestr.includes('add')||pathnamestr.includes('aid')||pathnamestr.includes('key-list')||pathnamestr.includes('key-detail')||pathnamestr.includes('key-edit')||pathnamestr.includes('exchangecode-edit')||pathnamestr.includes('plan-edit')||pathnamestr.includes('product-edit'); + let breakflag=pathnamestr.includes('add')||pathnamestr.includes('aid')||pathnamestr.includes('distributor-edit')||pathnamestr.includes('key-list')||pathnamestr.includes('key-detail')||pathnamestr.includes('key-edit')||pathnamestr.includes('exchangecode-edit')||pathnamestr.includes('plan-edit')||pathnamestr.includes('product-edit'); let sedcbreakflag=pathnamestr.includes('plan-create'); let planbreakflag = pathnamestr.includes('mytempMould') let editbreakflag = pathnamestr.includes('edittemplate') - let backshow=pathnamestr.includes('account-add')||pathnamestr.includes('role-add')||pathnamestr.includes('subaccount-add')||pathnamestr.includes('distributor-add')||pathnamestr.includes('exchangecode-edit')||pathnamestr.includes('plan-edit')||pathnamestr.includes('key-list')||pathnamestr.includes('exchange-addcommodity'); + let backshow=pathnamestr.includes('account-add')||pathnamestr.includes('role-add')||pathnamestr.includes('subaccount-add')||pathnamestr.includes('exchangecode-edit')||pathnamestr.includes('plan-edit')||pathnamestr.includes('key-list')||pathnamestr.includes('exchange-addcommodity'); let breakchange = pathnamestr.includes('exchangecode-add')|| pathnamestr.includes('key-edit')||pathnamestr.includes('key-detail')||pathnamestr.includes('product-edit')||pathnamestr.includes('plan-edit'); if(breakchange){ breaknav=JSON.parse(sessionStorage.getItem('breakchangenav'))