From ea34e669b45f86793017621a0dc3f9a71aa3276b Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 23 二月 2021 18:23:26 +0800 Subject: [PATCH] 2021-02-23 --- src/components/tabview/index.jsx | 55 ++++++++++++++++--------------------------------------- 1 files changed, 16 insertions(+), 39 deletions(-) diff --git a/src/components/tabview/index.jsx b/src/components/tabview/index.jsx index faf1a35..ce5a0e8 100644 --- a/src/components/tabview/index.jsx +++ b/src/components/tabview/index.jsx @@ -2,7 +2,7 @@ import PropTypes from 'prop-types' import {connect} from 'react-redux' import { is, fromJS } from 'immutable' -import {Tabs, Icon, Button, message, BackTop} from 'antd' +import {Tabs, Icon, BackTop} from 'antd' import moment from 'moment' import 'moment/locale/zh-cn' @@ -36,7 +36,7 @@ service = window.GLOB.location + '/' + window.GLOB.service + 'zh-CN/' } -class Header extends Component { +class TabViews extends Component { static propTpyes = { collapse: PropTypes.bool, tabviews: PropTypes.array // 鏍囩椤垫暟缁� @@ -47,7 +47,6 @@ tabviews: null, // 鏍囩闆� iFrameHeight: 0, dict: localStorage.getItem('lang') !== 'en-US' ? mzhCN : menUS, - debug: sessionStorage.getItem('debug') === 'true' } handleTabview = (e, menu) => { @@ -141,22 +140,10 @@ } else if (view.type === 'FormTab') { return (<FormTab MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID} param={view.param}/>) } else if (view.type === 'iframe') { - return (<Iframe key={view.MenuID} title={view.MenuName} MenuName={view.MenuName} url={service + view.LinkUrl}/>) + return (<Iframe key={view.MenuID} MenuID={view.MenuID} MenuNo={view.MenuNo} title={view.MenuName} MenuName={view.MenuName} url={service + view.LinkUrl}/>) } else { return (<NotFount key={view.MenuID} />) } - } - - copyMenuNo = (e) => { - e.stopPropagation() - let oInput = document.createElement('input') - oInput.value = e.target.dataset.menuno || '' - document.body.appendChild(oInput) - oInput.select() - document.execCommand('Copy') - oInput.className = 'oInput' - oInput.style.display = 'none' - message.success(this.state.dict['main.copy.success']) } UNSAFE_componentWillMount () { @@ -171,13 +158,15 @@ } componentDidMount () { - let home = { - MenuID: 'home_page_id', - MenuName: '棣栭〉', - selected: true, - type: 'Home' + if (sessionStorage.getItem('isEditState') !== 'true') { + let home = { + MenuID: 'home_page_id', + MenuName: this.state.dict['main.homepage'], + selected: true, + type: 'Home' + } + this.props.modifyTabview([home]) } - this.props.modifyTabview([home]) } UNSAFE_componentWillReceiveProps (nextProps) { @@ -224,11 +213,10 @@ } render () { - const { menuType } = this.props - const { tabviews, activeId, debug } = this.state + const { tabviews, activeId } = this.state return ( - <section className={'flex-container content-box' + (this.props.collapse ? ' collapsed' : '')}> + <section id="mk-tabview-wrap" className={'mk-tabview-wrap' + (this.props.collapse ? ' collapsed' : '')}> <div className="content-header"> {tabviews && tabviews.length > 0 && <Tabs activeKey={activeId}> @@ -237,9 +225,7 @@ <Tabs.TabPane tab={ <span className="tab-control"> - {['CommonTable', 'FormTab', 'TreePage', 'CalendarPage', 'CustomPage', 'ManageTable', 'VerupTable'].includes(view.type) ? - <Icon type="redo" onClick={(e) => {this.refreshTabview(e, view)}}/> : null - } + <Icon type="redo" onClick={(e) => {this.refreshTabview(e, view)}}/> <span className="tab-name" onClick={(e) => {this.changeTab(e, view)}}> {view.MenuName} </span> @@ -251,15 +237,6 @@ key={view.MenuID} > {this.selectcomponent(view)} - {debug && options.sysType !== 'cloud' && menuType !== 'HS' && !['CommonTable', 'TreePage', 'ManageTable', 'CalendarPage', 'Home'].includes(view.type) ? - <Button - icon="copy" - shape="circle" - className={'main-copy ' + (view.type === 'iframe' ? 'ifr-copy' : '')} - data-menuno={view.MenuNo} - onClick={this.copyMenuNo} - /> : null - } <BackTop> <div className="ant-back-top"> <div className="ant-back-top-content"> @@ -267,6 +244,7 @@ </div> </div> </BackTop> + {options.sysType === 'local' && window.GLOB.systemType !== 'production' ? <div className="mk-water-mark">娴嬭瘯绯荤粺</div> : null} </Tabs.TabPane> ) })} @@ -280,7 +258,6 @@ const mapStateToProps = (state) => { return { - menuType: state.editLevel, tabviews: state.tabviews, collapse: state.collapse, isiframe: state.isiframe @@ -294,4 +271,4 @@ } } -export default connect(mapStateToProps, mapDispatchToProps)(Header) \ No newline at end of file +export default connect(mapStateToProps, mapDispatchToProps)(TabViews) \ No newline at end of file -- Gitblit v1.8.0