Browse Source

修复顶部导航过多重叠问题

HW 3 years ago
parent
commit
c7766d6ee6

+ 1 - 1
js/component/account/services/evaluate/info.jsx

@@ -504,4 +504,4 @@ const evaluateInfo = React.createClass({
   }
 });
 
-export default evaluateInfo;
+export default evaluateInfo;

+ 1 - 1
js/component/account/services/evaluate/steps/step1.jsx

@@ -284,4 +284,4 @@ const EvaluateStep1 = Form.create({})(React.createClass({
   },
 }));
 
-export default EvaluateStep1;
+export default EvaluateStep1;

+ 18 - 24
js/component/manageCenter/topTab.jsx

@@ -7,6 +7,8 @@ import $ from 'jquery/src/ajax';
 import logo from '../../../image/acc-logo.png';
 import FollowDetail from "./customer/NEW/intentionCustomer/followDetail";
 
+const TabPane = Tabs.TabPane;
+
 const MessageModal = React.createClass({
     getInitialState() {
         return {
@@ -465,6 +467,8 @@ const TopTab = React.createClass({
     getInitialState() {
         return {
             username: '请登录!',
+            defaultActiveKey:'1',
+            htmlMenus:[],
         };
     },
     logOut() {
@@ -505,19 +509,10 @@ const TopTab = React.createClass({
 	            };
 	            let menu=data.data;
 	            var htmlMenu=[];
-	            for(var i=0;i<menu.length;i++){
-	            	if(menu.length>7){
-	            		 htmlMenu.push(
-		            		<Col key={i} className={this.props.active === getActives(menu[i].name) ? 'active' : ''} span={2}><a href={globalConfig.context + menu[i].url+'?rid='+menu[i].id}>{menu[i].name}</a></Col>
-		            	)
-	            	}else{
-	            		htmlMenu.push(
-		            		<Col key={i} className={this.props.active === getActives(menu[i].name) ? 'active' : ''} span={3}><a href={globalConfig.context + menu[i].url+'?rid='+menu[i].id}>{menu[i].name}</a></Col>
-		            	)
-	            	}
-                }
+                let index = menu.findIndex(v=>getActives(v.name) === this.props.active);
 	            this.setState({
-	            	htmlMenus:htmlMenu
+	            	htmlMenus:menu,
+                    defaultActiveKey:index+''
 	            })
             }.bind(this),
     	}).always(function(data){
@@ -591,18 +586,17 @@ const TopTab = React.createClass({
                     <span><a href={globalConfig.context + "/admin/index.html"}>管理中心首页</a></span>
                 </div>
                 <div className="acc-top-tab">
-                    <Row>
-                       {/*<Col style={{ display: window.showUserManage ? 'block' : 'none' }} className={this.props.active === 'userManage' ? 'active' : ''} span={2}><a href={globalConfig.context + "/admin/userManage.html"}>用户管理</a></Col>*/}
-                        {/*<Col style={{ display: window.showCustomer ? 'block' : 'none' }} className={this.props.active === 'myClient' ? 'active' : ''} span={3}><a href={globalConfig.context + "/admin/customer.html" }>客户管理</a></Col>
-                        <Col style={{ display: window.showServices ? 'block' : 'none' }} className={this.props.active === 'services' ? 'active' : ''} span={3}><a href={globalConfig.context + "/admin/servicesManage/contract.html"}>科技服务管理</a></Col>
-                        <Col style={{ display: window.showAchievement ? 'block' : 'none' }} className={this.props.active === 'achievement' ? 'active' : ''} span={3}><a href={globalConfig.context + "/admin/achievement.html"}>科技成果管理</a></Col>
-                        <Col style={{ display: window.showDemand ? 'block' : 'none' }} className={this.props.active === 'demand' ? 'active' : ''} span={3}><a href={globalConfig.context + "/admin/demand.html"}>科技需求管理</a></Col>
-                        <Col style={{ display: window.showIdea ? 'block' : 'none' }} className={this.props.active === 'idea' ? 'active' : ''} span={3}><a href={globalConfig.context + "/admin/idea.html"}>科技思想管理</a></Col>
-                        <Col style={{ display: window.showUserOrderList ? 'block' : 'none' }} className={this.props.active === 'userOrder' ? 'active' : ''} span={3}><a href={globalConfig.context + "/admin/userOrder.html"}>用户订单管理</a></Col>
-                        <Col style={{ display: window.showSystem ? 'block' : 'none' }} className={this.props.active === 'system' ? 'active' : ''} span={3}><a href={globalConfig.context + "/admin/set.html"}>系统设置</a></Col>
-                   */}
-    				{this.state.htmlMenus}
-                    </Row>
+                    {this.state.htmlMenus.length > 0 ? <Tabs
+                        defaultActiveKey={this.state.defaultActiveKey}
+                        tabPosition='top'
+                        onChange={v=>{
+                            window.location.href=globalConfig.context + this.state.htmlMenus[parseInt(v)].url+'?rid='+this.state.htmlMenus[parseInt(v)].id;
+                        }}
+                    >
+                        {this.state.htmlMenus.map((v,k)=>(
+                            <TabPane key={k} tab={v.name}/>
+                        ))}
+                    </Tabs> : null}
                 </div>
                 <UserModal showDesc={this.state.userModalShow} closeDesc={this.closeUserModal} />
                 <MessageModal showDesc={this.state.messageModalShow} closeDesc={this.closeMessageModal} />

+ 24 - 1
js/component/manageCenter/topTab.less

@@ -122,4 +122,27 @@
                 width: 200px;
             }
         }
-    }
+    }
+
+    .account-top{
+        font-weight: inherit !important;
+        .ant-tabs-tab{
+            font-size: 16px;
+            line-height: 34px;
+            color: #fff;
+            font-weight: inherit !important;
+        }
+        .ant-tabs-tab-active{
+            font-size: 18px;
+        }
+        .ant-tabs-ink-bar{
+            height: 3px;
+        }
+        .ant-tabs-bar{
+            border-bottom: 0;
+        }
+        .acc-top-tab{
+            text-align: left;
+        }
+    }
+