1616 */
1717
1818import React , { PureComponent } from "react" ;
19- import {
20- Button ,
21- Dropdown ,
22- Form ,
23- Icon ,
24- Input ,
25- Menu ,
26- message ,
27- Modal ,
28- } from "antd" ;
19+ import { Button , Dropdown , Form , Icon , Input , Menu , Modal } from "antd" ;
2920import { connect } from "dva" ;
3021import { withRouter } from "dva/router" ;
3122import ImportModal from "./ImportModal" ;
@@ -299,6 +290,13 @@ class GlobalHeader extends PureComponent {
299290 < Icon type = "form" /> { " " }
300291 { getIntlContent ( "SHENYU.GLOBALHEADER.CHANGE.PASSWORD" ) }
301292 </ Menu . Item >
293+ < Menu . Item key = "0" onClick = { onLogout } >
294+ < Icon type = "logout" /> { getIntlContent ( "SHENYU.GLOBALHEADER.LOGOUT" ) }
295+ </ Menu . Item >
296+ </ Menu >
297+ ) ;
298+ const importMenu = (
299+ < Menu >
302300 { this . checkAuth ( "system:manager:exportConfig" ) && (
303301 < Menu . Item key = "2" onClick = { this . exportConfigClick } >
304302 < Icon type = "export" /> { getIntlContent ( "SHENYU.COMMON.EXPORT" ) }
@@ -309,9 +307,6 @@ class GlobalHeader extends PureComponent {
309307 < Icon type = "import" /> { getIntlContent ( "SHENYU.COMMON.IMPORT" ) }
310308 </ Menu . Item >
311309 ) }
312- < Menu . Item key = "0" onClick = { onLogout } >
313- < Icon type = "logout" /> { getIntlContent ( "SHENYU.GLOBALHEADER.LOGOUT" ) }
314- </ Menu . Item >
315310 </ Menu >
316311 ) ;
317312 return (
@@ -354,18 +349,15 @@ class GlobalHeader extends PureComponent {
354349 </ Dropdown >
355350 </ div >
356351 ) }
357- { this . checkAuth ( "system:manager:importConfig" ) && (
352+ { ( this . checkAuth ( "system:manager:importConfig" ) ||
353+ this . checkAuth ( "system:manager:exportConfig" ) ) && (
358354 < div className = { styles . item } >
359- < Button onClick = { this . importConfigClick } >
360- < Icon type = "import" /> { getIntlContent ( "SHENYU.COMMON.IMPORT" ) }
361- </ Button >
362- </ div >
363- ) }
364- { this . checkAuth ( "system:manager:exportConfig" ) && (
365- < div className = { styles . item } >
366- < Button onClick = { this . exportConfigClick } >
367- < Icon type = "export" /> { getIntlContent ( "SHENYU.COMMON.EXPORT" ) }
368- </ Button >
355+ < Dropdown overlay = { importMenu } >
356+ < Button >
357+ < Icon type = "import" /> { " " }
358+ { getIntlContent ( "SHENYU.COMMON.IMPORT_EXPORT" ) }
359+ </ Button >
360+ </ Dropdown >
369361 </ div >
370362 ) }
371363 < div className = { styles . item } >
0 commit comments