From 9c6795fd3c44e46cf3955fbfd8f8eeca23acb7a9 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期六, 08 十月 2022 00:31:51 +0800
Subject: [PATCH] 2022-10-08

---
 src/components/breadview/index.jsx |   47 +++++++++++++----------------------------------
 1 files changed, 13 insertions(+), 34 deletions(-)

diff --git a/src/components/breadview/index.jsx b/src/components/breadview/index.jsx
index 1faf3c1..62ae100 100644
--- a/src/components/breadview/index.jsx
+++ b/src/components/breadview/index.jsx
@@ -1,40 +1,29 @@
 import React, {Component} from 'react'
-import {connect} from 'react-redux'
-import { BackTop, Breadcrumb, Icon, notification} from 'antd'
+import { BackTop, Breadcrumb, notification} from 'antd'
+import { HomeOutlined, RightOutlined, RedoOutlined } from '@ant-design/icons'
 import moment from 'moment'
 import 'moment/locale/zh-cn'
 
 import asyncComponent from '@/utils/asyncLoadComponent'
 import NotFount from '@/components/404'
 import options from '@/store/options.js'
-import mzhCN from '@/locales/zh-CN/main.js'
-import menUS from '@/locales/en-US/main.js'
 import MKEmitter from '@/utils/events.js'
-import { initActionPermission } from '@/store/action'
 import Api from '@/api'
 import './index.scss'
 
 const Home = asyncComponent(() => import('@/tabviews/home'))
 const CustomPage = asyncComponent(() => import('@/tabviews/custom'))
 const CommonTable = asyncComponent(() => import('@/tabviews/commontable'))
+// const BaseTable = asyncComponent(() => import('@/tabviews/basetable'))
 const CalendarPage = asyncComponent(() => import('@/tabviews/calendar'))
 const TreePage = asyncComponent(() => import('@/tabviews/treepage'))
 const Iframe = asyncComponent(() => import('@/tabviews/iframe'))
 const RoleManage = asyncComponent(() => import('@/tabviews/rolemanage'))
 const FormTab = asyncComponent(() => import('@/tabviews/formtab'))
 
-let service = ''
-
-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/'
-}
-
 class BreadView extends Component {
   state = {
     tabview: null, // 鏍囩
-    dict: sessionStorage.getItem('lang') !== 'en-US' ? mzhCN : menUS,
     hasNavBar: window.GLOB.navBar === 'linkage_navigation'
   }
 
@@ -66,7 +55,7 @@
               })
             }
   
-            this.props.initActionPermission(_permAction)
+            window.GLOB.mkActions = _permAction
           }
 
           resolve()
@@ -94,8 +83,10 @@
     // 鏍规嵁tab椤典腑鑿滃崟淇℃伅锛岄�夋嫨鎵�闇�鐨勭粍浠�
     if (view.type === 'Home') {
       return (<Home MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID}/>)
-    } else if (view.type === 'CommonTable' || view.type === 'ManageTable') {
+    } else if (view.type === 'CommonTable') {
       return (<CommonTable MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID} param={view.param}/>)
+    // } else if (view.type === 'BaseTable') {
+    //   return (<BaseTable MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID} param={view.param}/>)
     } else if (view.type === 'CustomPage') {
       return (<CustomPage MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID} param={view.param}/>)
     } else if (view.type === 'TreePage') {
@@ -107,7 +98,7 @@
     } 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} MenuID={view.MenuID} MenuNo={view.MenuNo} 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={window.GLOB.baseurl + 'zh-CN/' + view.LinkUrl}/>)
     } else {
       return (<NotFount key={view.MenuID} />)
     }
@@ -123,7 +114,6 @@
     let home = {
       MenuID: 'home_page_id',
       MenuName: '棣栭〉',
-      selected: true,
       type: 'Home'
     }
     this.setState({tabview: home})
@@ -133,7 +123,6 @@
     let home = {
       MenuID: 'home_page_id',
       MenuName: '棣栭〉',
-      selected: true,
       type: 'Home'
     }
     this.setState({tabview: home})
@@ -173,17 +162,17 @@
       <section id="mk-breadview-wrap" className="mk-breadview-wrap">
         {hasNavBar && tabview ? <Breadcrumb separator="">
           <Breadcrumb.Item>
-            <Icon type="home" onClick={this.gotoHome} />
+            <HomeOutlined onClick={this.gotoHome} />
           </Breadcrumb.Item>
           {tabview.ParentNames && tabview.ParentNames[0] ?
             <Breadcrumb.Item>{tabview.ParentNames[0]}</Breadcrumb.Item> : null}
           {tabview.ParentNames && tabview.ParentNames[0] ?
-              <Breadcrumb.Separator children={<Icon type="right" />} /> : null}
+              <Breadcrumb.Separator children={<RightOutlined />} /> : null}
           {tabview.ParentNames && tabview.ParentNames[1] ?
             <Breadcrumb.Item>{tabview.ParentNames[1]}</Breadcrumb.Item> : null}
           {tabview.ParentNames && tabview.ParentNames[1] ?
-              <Breadcrumb.Separator children={<Icon type="right" />} /> : null}
-          <Breadcrumb.Item><Icon type="redo" onClick={this.refreshTabview}/>{tabview.MenuName}</Breadcrumb.Item>
+              <Breadcrumb.Separator children={<RightOutlined />} /> : null}
+          <Breadcrumb.Item><RedoOutlined onClick={this.refreshTabview}/>{tabview.MenuName}</Breadcrumb.Item>
         </Breadcrumb> : null}
         {tabview ? this.selectcomponent(tabview) : null}
         <BackTop>
@@ -198,14 +187,4 @@
   }
 }
 
-const mapStateToProps = () => {
-  return {}
-}
-
-const mapDispatchToProps = (dispatch) => {
-  return {
-    initActionPermission: (permAction) => dispatch(initActionPermission(permAction)),
-  }
-}
-
-export default connect(mapStateToProps, mapDispatchToProps)(BreadView)
\ No newline at end of file
+export default BreadView
\ No newline at end of file

--
Gitblit v1.8.0