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/commontable/index.jsx |   52 +++++++++++++++++++++++++++-------------------------
 1 files changed, 27 insertions(+), 25 deletions(-)

diff --git a/src/tabviews/commontable/index.jsx b/src/tabviews/commontable/index.jsx
index b861521..940775d 100644
--- a/src/tabviews/commontable/index.jsx
+++ b/src/tabviews/commontable/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 { notification, Spin, Tabs, Switch, Row, Col } from 'antd'
 
@@ -28,6 +27,7 @@
 const ChartComponent = asyncSpinComponent(() => import('@/tabviews/zshare/chartcomponent'))
 const PagemsgComponent = asyncComponent(() => import('@/tabviews/zshare/pageMessage'))
 const AutoMatic = asyncComponent(() => import('@/tabviews/zshare/automatic'))
+const DebugTable = asyncComponent(() => import('@/tabviews/debugtable'))
 
 const { TabPane } = Tabs
 
@@ -69,14 +69,15 @@
     absFields: [],        // 缁濆鍊煎瓧娈�
     loadCustomApi: true,  // 鍔犺浇澶栭儴璧勬簮
     hasReqFields: false,
-    autoMatic: null
+    autoMatic: null,
+    visible: false
   }
 
   /**
    * @description 鑾峰彇椤甸潰閰嶇疆淇℃伅
    */
   async loadconfig () {
-    const { permAction, permMenus, param, MenuName, MenuID } = this.props
+    const { param, MenuName, MenuID } = this.props
 
     let _param = {
       func: 'sPC_Get_LongParam',
@@ -159,13 +160,13 @@
 
       // 鏉冮檺杩囨护
       if (!window.GLOB.mkHS) {
-        config.action = config.action.filter(item => item.hidden !== 'true' && permAction[item.uuid])
+        config.action = config.action.filter(item => item.hidden !== 'true' && window.GLOB.mkActions[item.uuid])
         config.tabgroups.forEach(group => {
           group.sublist = group.sublist.filter(tab => {
             if (tab.supMenu === 'mainTable') {
               tab.supMenu = MenuID
             }
-            return permAction[tab.linkTab]
+            return window.GLOB.mkActions[tab.linkTab]
           })
         })
       } else {
@@ -336,7 +337,7 @@
 
           if (col.linkmenu && col.linkmenu.length > 0) {
             let menu_id = col.linkmenu.slice(-1)[0]
-            col.linkThdMenu = permMenus.filter(m => m.MenuID === menu_id)[0] || ''
+            col.linkThdMenu = window.GLOB.mkThdMenus.filter(m => m.MenuID === menu_id)[0] || ''
           } else {
             col.linkThdMenu = ''
           }
@@ -432,7 +433,7 @@
         chartId,
         config,
         statFields,
-        shortcuts,
+        shortcuts: shortcuts.length > 0 ? shortcuts : null,
         setting: config.setting,
         searchlist: config.search,
         actions: _actions,
@@ -463,11 +464,6 @@
   setShortcut = () => {
     const { shortcuts } = this.state
 
-    if (!shortcuts || shortcuts.length === 0) {
-      document.onkeydown = () => {}
-      return
-    }
-
     document.onkeydown = (event) => {
       let e = event || window.event
       let keyCode = e.keyCode || e.which || e.charCode
@@ -484,6 +480,16 @@
       if (!preKey || !keyCode) return
 
       let _shortcut = `${preKey}+${keyCode}`
+
+      if (window.GLOB.breakpoint && _shortcut === 'ctrl+67') {
+        window.debugger = false
+        window.GLOB.breakpoint = false
+        sessionStorage.removeItem('breakpoint')
+        
+        MKEmitter.emit('debugChange')
+      }
+
+      if (!shortcuts) return
 
       shortcuts.some(item => {
         if (item.$shortcut === _shortcut) {
@@ -1090,6 +1096,10 @@
     }
   }
 
+  debugChange = () => {
+    this.setState({visible: !this.state.visible})
+  }
+
   UNSAFE_componentWillMount () {
     // 缁勪欢鍔犺浇鏃讹紝鑾峰彇鑿滃崟鏁版嵁
     this.loadconfig()
@@ -1101,6 +1111,7 @@
 
   componentDidMount () {
     MKEmitter.addListener('reloadData', this.reloadData)
+    MKEmitter.addListener('debugChange', this.debugChange)
     MKEmitter.addListener('reloadMenuView', this.reloadMenuView)
     MKEmitter.addListener('changeTableLine', this.changeTableLine)
     MKEmitter.addListener('resetActiveMenu', this.resetActiveMenu)
@@ -1117,6 +1128,7 @@
     }
     document.onkeydown = () => {}
     MKEmitter.removeListener('reloadData', this.reloadData)
+    MKEmitter.removeListener('debugChange', this.debugChange)
     MKEmitter.removeListener('reloadMenuView', this.reloadMenuView)
     MKEmitter.removeListener('changeTableLine', this.changeTableLine)
     MKEmitter.removeListener('resetActiveMenu', this.resetActiveMenu)
@@ -1273,24 +1285,14 @@
             })}
           </Tabs>))
         }
+        {setting && window.GLOB.breakpoint ? <DebugTable /> : null}
         {!window.GLOB.mkHS && autoMatic ? <AutoMatic autoMatic={autoMatic} config={config} /> : null}
         {!window.GLOB.mkHS && window.GLOB.systemType !== 'production' ? <PagemsgComponent menu={{MenuName: this.props.MenuName, MenuNo: this.props.MenuNo}} config={config} dict={this.state.dict} /> : null}
-        {!window.GLOB.mkHS && shortcuts ? <SettingComponent config={config} dict={this.state.dict} shortcuts={shortcuts} permAction={this.props.permAction}/> : null}
+        {!window.GLOB.mkHS && setting ? <SettingComponent config={config} dict={this.state.dict} shortcuts={shortcuts || []}/> : null}
         {viewlost ? <NotFount msg={this.state.lostmsg} /> : null}
       </div>
     )
   }
 }
 
-const mapStateToProps = (state) => {
-  return {
-    permAction: state.permAction,
-    permMenus: state.permMenus
-  }
-}
-
-const mapDispatchToProps = () => {
-  return {}
-}
-
-export default connect(mapStateToProps, mapDispatchToProps)(NormalTable)
\ No newline at end of file
+export default NormalTable
\ No newline at end of file

--
Gitblit v1.8.0