From 783ab4e467c95e26f7f031151507bd7ad8333a63 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期五, 08 九月 2023 17:34:47 +0800
Subject: [PATCH] 2023-09-08

---
 src/tabviews/custom/components/card/cardItem/index.jsx |   35 +++++++++++------------------------
 1 files changed, 11 insertions(+), 24 deletions(-)

diff --git a/src/tabviews/custom/components/card/cardItem/index.jsx b/src/tabviews/custom/components/card/cardItem/index.jsx
index d7d8a72..b601bc9 100644
--- a/src/tabviews/custom/components/card/cardItem/index.jsx
+++ b/src/tabviews/custom/components/card/cardItem/index.jsx
@@ -1,7 +1,6 @@
 import React, {Component} from 'react'
 import PropTypes from 'prop-types'
 import { is, fromJS } from 'immutable'
-import { notification } from 'antd'
 
 import asyncComponent from '@/utils/asyncComponent'
 import MKEmitter from '@/utils/events.js'
@@ -15,8 +14,6 @@
     card: PropTypes.object,     // 鍗$墖閰嶇疆淇℃伅
     data: PropTypes.object,
   }
-
-  state = {}
 
   shouldComponentUpdate (nextProps, nextState) {
     return !is(fromJS(this.props.data), fromJS(nextProps.data))
@@ -55,7 +52,6 @@
       let newtab = {
         MenuID: menu.MenuID,
         MenuName: menu.MenuName,
-        MenuNo: menu.MenuNo || '',
         type: menu.tabType,
         param: {}
       }
@@ -72,43 +68,34 @@
 
       MKEmitter.emit('modifyTabs', newtab, true)
     } else if (card.setting.click === 'menu') {
-      let menuId = card.setting.MenuID || card.setting.menu.slice(-1)[0]
-      let menu = window.GLOB.mkThdMenus.filter(m => m.MenuID === menuId)[0]
+      let menuId = card.setting.menu.slice(-1)[0]
+      let menu = null
 
-      if (!menu && card.setting.MenuName && card.setting.tabType) {
+      if (window.GLOB.mkThdMenus.has(menuId)) {
+        menu = {...window.GLOB.mkThdMenus.get(menuId)}
+      } else if (card.setting.MenuID) {
         menu = {
-          MenuID: menuId,
+          MenuID: card.setting.MenuID,
           MenuName: card.setting.MenuName,
-          MenuNo: card.setting.MenuNo || '',
           type: card.setting.tabType
         }
       }
 
-      if (!menu) {
-        notification.warning({
-          top: 92,
-          message: '鑿滃崟宸插垹闄ゆ垨娌℃湁璁块棶鏉冮檺锛�',
-          duration: 5
-        })
-        return
-      }
+      if (!menu) return
 
-      let newtab = {
-        ...menu,
-        param: {}
-      }
+      menu.param = {}
 
       if (card.setting.joint === 'true') {
-        newtab.param.$BID = data.$$uuid || ''
+        menu.param.$BID = data.$$uuid || ''
         
         Object.keys(data).forEach(key => {
           if (/^\$/.test(key)) return
           if (key === 'children') return
-          newtab.param[key] = data[key]
+          menu.param[key] = data[key]
         })
       }
 
-      MKEmitter.emit('modifyTabs', newtab, true)
+      MKEmitter.emit('modifyTabs', menu, true)
     } else if (card.setting.click === 'link') {
       let src = card.setting.linkurl
 

--
Gitblit v1.8.0