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 |   56 +++++++++++++++++---------------------------------------
 1 files changed, 17 insertions(+), 39 deletions(-)

diff --git a/src/components/tabview/index.jsx b/src/components/tabview/index.jsx
index 7829c68..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'
 
@@ -33,10 +33,10 @@
 if (process.env.NODE_ENV === 'production') {
   service = document.location.origin + '/' + window.GLOB.service + 'zh-CN/'
 } else {
-  service = window.GLOB.location + window.GLOB.service + 'zh-CN/'
+  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 // 鏍囩椤垫暟缁�
@@ -46,7 +46,7 @@
     activeId: '',
     tabviews: null, // 鏍囩闆�
     iFrameHeight: 0,
-    dict: localStorage.getItem('lang') !== 'en-US' ? mzhCN : menUS
+    dict: localStorage.getItem('lang') !== 'en-US' ? mzhCN : menUS,
   }
 
   handleTabview = (e, menu) => {
@@ -140,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 () {
@@ -170,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) {
@@ -223,11 +213,10 @@
   }
 
   render () {
-    const { menuType } = this.props
     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}>
@@ -236,9 +225,7 @@
                   <Tabs.TabPane
                     tab={
                       <span className="tab-control">
-                        {['CommonTable', 'FormTab', 'TreePage', 'CalendarPage', 'CustomPage'].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>
@@ -250,15 +237,6 @@
                     key={view.MenuID}
                   >
                     {this.selectcomponent(view)}
-                    {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">
@@ -266,6 +244,7 @@
                         </div>
                       </div>
                     </BackTop>
+                    {options.sysType === 'local' && window.GLOB.systemType !== 'production' ? <div className="mk-water-mark">娴嬭瘯绯荤粺</div> : null}
                   </Tabs.TabPane>
                 )
               })}
@@ -279,7 +258,6 @@
 
 const mapStateToProps = (state) => {
   return {
-    menuType: state.editLevel,
     tabviews: state.tabviews,
     collapse: state.collapse,
     isiframe: state.isiframe
@@ -293,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