From 1da6506bf58270bacc2a4345002c6b082835580e Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 21 十月 2021 23:17:08 +0800 Subject: [PATCH] 2021-10-21 --- src/views/design/header/index.jsx | 58 +++++++++++++++++++++++++++++++++++++++++++++++----------- 1 files changed, 47 insertions(+), 11 deletions(-) diff --git a/src/views/design/header/index.jsx b/src/views/design/header/index.jsx index 5b14744..80eec5c 100644 --- a/src/views/design/header/index.jsx +++ b/src/views/design/header/index.jsx @@ -8,7 +8,6 @@ import { modifyMenuTree, modifyMainMenu, - modifyTabview, resetEditLevel, logout } from '@/store/action' @@ -19,9 +18,11 @@ import Utils from '@/utils/utils.js' import avatar from '@/assets/img/avatar.jpg' import MainLogo from '@/assets/img/main-logo.png' +import MKEmitter from '@/utils/events.js' import './index.scss' const EditMenu = asyncComponent(() => import('@/templates/menuconfig/editfirstmenu')) +const VersionsUp = asyncComponent(() => import('./versions')) const { confirm } = Modal class Header extends Component { @@ -91,6 +92,7 @@ getMenulist = (result) => { let iframes = ['Main/Index', 'bda/rdt', 'Home/rdt'] let menulist = [] + let thdMenuList = [] result.fst_menu && result.fst_menu.forEach(fst => { let fstItem = { MenuID: fst.MenuID, @@ -156,6 +158,8 @@ } } + thdMenuList.push(trdItem) + return trdItem }) } @@ -167,6 +171,7 @@ menulist.push(fstItem) }) + sessionStorage.setItem('thdMenuList', JSON.stringify(thdMenuList)) return { menulist } } @@ -209,7 +214,8 @@ this.props.modifyMainMenu(menulist[0] || null) this.props.resetEditLevel(false) - this.props.modifyTabview([]) + + MKEmitter.emit('modifyTabs', null, 'replace') } exitEdit = () => { @@ -323,18 +329,47 @@ } {editLevel === 'HS' ? <Button className="level4-close" type="primary" onClick={this.exitManage}>閫�鍑�</Button> : null} {/* 杩涘叆缂栬緫鎸夐挳 */} - {!editLevel ? <Icon onClick={this.enterEdit} className="edit-check" type="edit" /> : null} + {!editLevel && menulist ? <Icon onClick={this.enterEdit} className="edit-check" type="edit" /> : null} {!editLevel && options.sysType === 'local' && window.GLOB.systemType !== 'production' && this.props.memberLevel >= 20 ? - <span onClick={() => {window.open('#/appmanage')}} className="mobile" type="edit"> 搴旂敤绠$悊 <Icon type="arrow-right" /></span> : null + <div className="app-entrance entrance"> + <div className="icon"><Icon type="appstore" /></div> + <div className="title">搴旂敤绠$悊</div> + <div className="detail">鍙垱寤哄強绠$悊PC銆乸ad鍙婄Щ鍔ㄧ绛変笉鍚岃澶囩殑搴旂敤锛屽疄鐜版槑绉戜簯APP銆佸井淇″叕浼楀彿銆佸皬绋嬪簭绛夊骞冲彴鐨勫簲鐢ㄥ叡浜��</div> + <Button type="primary" onClick={() => {window.open('#/appmanage')}}> + 缂栬緫 + </Button> + </div> : null + } + {editLevel === 'HS' && options.sysType === 'local' && window.GLOB.systemType === 'production' && this.props.memberLevel >= 20 ? + <div className="app-prod-entrance entrance"> + <div className="icon"><Icon type="appstore" /></div> + <div className="title">搴旂敤绠$悊</div> + <div className="detail">鍙垱寤哄強绠$悊PC銆乸ad鍙婄Щ鍔ㄧ绛変笉鍚岃澶囩殑搴旂敤锛屽疄鐜版槑绉戜簯APP銆佸井淇″叕浼楀彿銆佸皬绋嬪簭绛夊骞冲彴鐨勫簲鐢ㄥ叡浜��</div> + <Button type="primary" onClick={() => {window.open('#/appcheck')}}> + 鏌ョ湅 + </Button> + </div> : null } {!editLevel && options.sysType === 'local' && this.props.memberLevel >= 20 ? - <span onClick={() => {window.open('#/interface')}} className="interface" type="edit"> 鎺ュ彛璋冭瘯 <Icon type="arrow-right" /></span> : null + <div className="api-entrance entrance"> + <div className="icon"><Icon type="api" /></div> + <div className="title">鎺ュ彛璋冭瘯</div> + <div className="detail">鍙嚜鍔ㄥ鐞嗙櫥褰曟帴鍙g殑鍙傛暟鍔犲瘑锛屼互鍙婁笟鍔℃帴鍙g殑绛惧悕璁$畻锛屾柟渚垮紑鍙戜汉鍛樼殑鎺ュ彛娴嬭瘯宸ヤ綔銆�</div> + <Button type="primary" onClick={() => {window.open('#/interface')}}> + 缂栬緫 + </Button> + </div> : null } {/* window.btoa(window.encodeURIComponent(JSON.stringify({ MenuType: 'home', MenuId: 'home_page_id', MenuName: '棣栭〉' }))) */} {!editLevel && window.GLOB.systemType !== 'production' && this.props.memberLevel >= 20 ? - <span className="home-edit" onClick={() => {window.open('#/menudesign/JTdCJTIyTWVudVR5cGUlMjIlM0ElMjJob21lJTIyJTJDJTIyTWVudUlkJTIyJTNBJTIyaG9tZV9wYWdlX2lkJTIyJTJDJTIyTWVudU5hbWUlMjIlM0ElMjIlRTklQTYlOTYlRTklQTElQjUlMjIlN0Q=')}}> - 棣栭〉 <Icon type="arrow-right" /> - </span> : null + <div className="home-entrance entrance"> + <div className="icon"><Icon type="home" /></div> + <div className="title">棣栭〉</div> + <div className="detail">鍩轰簬鑷畾涔夐〉闈㈢殑棣栭〉璁捐锛屽彲瀹炵幇鐏垫椿鐨勫厓绱犻厤缃強鏍峰紡璋冩暣锛屽睍鐜板綋鍓嶇郴缁熺殑椋庢牸銆�</div> + <Button type="primary" onClick={() => {window.open('#/menudesign/JTdCJTIyTWVudVR5cGUlMjIlM0ElMjJob21lJTIyJTJDJTIyTWVudUlkJTIyJTNBJTIyaG9tZV9wYWdlX2lkJTIyJTJDJTIyTWVudU5hbWUlMjIlM0ElMjIlRTklQTYlOTYlRTklQTElQjUlMjIlN0Q=')}}> + 缂栬緫 + </Button> + </div> : null } {/* 缂栬緫鑿滃崟 */} {editLevel === 'level1' ? <EditMenu menulist={this.state.menulist} reload={this.reload} exitEdit={this.exitEdit}/> : null} @@ -346,10 +381,13 @@ <Switch size="small" style={{marginLeft: '7px'}} disabled={!!editLevel} checked={true} onChange={this.changeEditState} /> </Menu.Item> <Menu.Item key="doc" onClick={this.gotoDoc}>{this.state.dict['main.doc']}</Menu.Item> + {options.sysType !== 'cloud' ? <Menu.Item style={{padding: 0}} key="verup"> + <VersionsUp /> + </Menu.Item> : null} <Menu.Item key="logout" onClick={this.logout}>{this.state.dict['main.logout']}</Menu.Item> </Menu> }> - <div> + <div style={{zIndex: 1, position: 'relative'}}> <img src={this.state.avatar || avatar} alt=""/> <span> <span className="username">{this.state.userName}</span> <Icon type="down" /> @@ -363,7 +401,6 @@ const mapStateToProps = (state) => { return { - tabviews: state.tabviews, menuTree: state.menuTree, mainMenu: state.mainMenu, editLevel: state.editLevel, @@ -374,7 +411,6 @@ const mapDispatchToProps = (dispatch) => { return { - modifyTabview: (tabviews) => dispatch(modifyTabview(tabviews)), modifyMenuTree: (menuTree) => dispatch(modifyMenuTree(menuTree)), modifyMainMenu: (mainMenu) => dispatch(modifyMainMenu(mainMenu)), resetEditLevel: (level) => dispatch(resetEditLevel(level)), -- Gitblit v1.8.0