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/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