From 78eed586f6a0d15162c89878c53a301e7b142a8a Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期一, 10 十月 2022 00:07:06 +0800
Subject: [PATCH] Merge branch 'master' into positec

---
 src/tabviews/custom/components/card/table-card/index.jsx |   48 +++++++++++++++++-------------------------------
 1 files changed, 17 insertions(+), 31 deletions(-)

diff --git a/src/tabviews/custom/components/card/table-card/index.jsx b/src/tabviews/custom/components/card/table-card/index.jsx
index 40dce07..f2616d8 100644
--- a/src/tabviews/custom/components/card/table-card/index.jsx
+++ b/src/tabviews/custom/components/card/table-card/index.jsx
@@ -1,6 +1,5 @@
 import React, {Component} from 'react'
 import PropTypes from 'prop-types'
-import { connect } from 'react-redux'
 import { is, fromJS } from 'immutable'
 import { Spin, notification, Row, Col, Empty, Pagination } from 'antd'
 import { DownOutlined } from '@ant-design/icons'
@@ -348,29 +347,26 @@
   }
 
   openView = (card, data) => {
-    if (card.setting.click === 'menu') {
-      let menu = null
+    if (card.setting.click === 'menu' && card.setting.menu) {
+      let menuId = card.setting.MenuID || card.setting.menu.slice(-1)[0]
+      let menu = window.GLOB.mkThdMenus.filter(m => m.MenuID === menuId)[0]
 
-      if (card.setting.MenuID) {
-        let _menu = this.props.permMenus.filter(m => m.MenuID === card.setting.MenuID)[0] || ''
+      if (!menu && card.setting.MenuName && card.setting.tabType) {
         menu = {
-          MenuID: card.setting.MenuID,
-          MenuName: _menu ? _menu.MenuName : card.setting.MenuName,
-          MenuNo: card.setting.MenuNo,
-          type: _menu ? _menu.type : card.setting.tabType
+          MenuID: menuId,
+          MenuName: card.setting.MenuName,
+          MenuNo: card.setting.MenuNo || '',
+          type: card.setting.tabType
         }
-      } else if (card.setting.menu && card.setting.menu.length > 0) {
-        let menu_id = card.setting.menu.slice(-1)[0]
-        menu = this.props.permMenus.filter(m => m.MenuID === menu_id)[0] || ''
+      }
 
-        if (!menu) {
-          notification.warning({
-            top: 92,
-            message: '鑿滃崟宸插垹闄ゆ垨娌℃湁璁块棶鏉冮檺锛�',
-            duration: 5
-          })
-          return
-        }
+      if (!menu) {
+        notification.warning({
+          top: 92,
+          message: '鑿滃崟宸插垹闄ゆ垨娌℃湁璁块棶鏉冮檺锛�',
+          duration: 5
+        })
+        return
       }
 
       let newtab = {
@@ -496,14 +492,4 @@
   }
 }
 
-const mapStateToProps = (state) => {
-  return {
-    permMenus: state.permMenus,
-  }
-}
-
-const mapDispatchToProps = () => {
-  return {}
-}
-
-export default connect(mapStateToProps, mapDispatchToProps)(TableCard)
\ No newline at end of file
+export default TableCard
\ No newline at end of file

--
Gitblit v1.8.0