From a94b0a4d15b26ecf8fe99f0a1c3e60d60b97766d Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 15 八月 2023 14:22:03 +0800
Subject: [PATCH] 2023-08-15

---
 src/views/systemproc/proc/index.jsx                                   |    8 
 src/views/design/index.jsx                                            |    1 
 src/utils/utils-datamanage.js                                         |    6 
 src/components/header/index.jsx                                       |    8 
 src/tabviews/zshare/topSearch/index.jsx                               |    2 
 src/views/main/index.jsx                                              |   44 +++-
 src/views/mkiframe/index.jsx                                          |   41 +++++
 src/views/menudesign/menuform/index.jsx                               |    1 
 src/views/menudesign/printmenuform/index.jsx                          |  129 +++++++--------
 src/tabviews/zshare/actionList/exceloutbutton/index.jsx               |    2 
 src/tabviews/basetable/index.jsx                                      |    1 
 src/tabviews/custom/components/share/normalTable/index.jsx            |    4 
 src/tabviews/zshare/actionList/newpagebutton/index.jsx                |    6 
 src/views/billprint/index.jsx                                         |  103 ++++++++++--
 src/tabviews/commontable/index.jsx                                    |    1 
 src/tabviews/zshare/actionList/normalbutton/index.jsx                 |    6 
 src/views/menudesign/index.jsx                                        |    2 
 src/utils/utils.js                                                    |    6 
 src/index.js                                                          |   28 ++-
 src/tabviews/custom/components/card/cardcellList/index.jsx            |    6 
 src/menu/components/share/actioncomponent/formconfig.jsx              |    2 
 src/templates/sharecomponent/actioncomponent/actionform/index.jsx     |   12 -
 src/router/index.js                                                   |    1 
 src/tabviews/custom/components/table/edit-table/normalTable/index.jsx |   10 
 src/tabviews/zshare/actionList/printbutton/index.jsx                  |    2 
 src/tabviews/zshare/mutilform/index.jsx                               |    5 
 src/menu/components/share/actioncomponent/actionform/index.jsx        |   15 -
 src/tabviews/custom/index.jsx                                         |    1 
 src/views/systemproc/index.jsx                                        |    5 
 29 files changed, 277 insertions(+), 181 deletions(-)

diff --git a/src/components/header/index.jsx b/src/components/header/index.jsx
index 7885a02..c9d7275 100644
--- a/src/components/header/index.jsx
+++ b/src/components/header/index.jsx
@@ -470,8 +470,12 @@
       } else if (e.key === 'getSysPermission' && e.newValue === window.GLOB.appkey) {
         localStorage.setItem('sysPermissions', JSON.stringify({mkThdMenus: window.GLOB.mkThdMenus, mkActions: window.GLOB.mkActions}))
       } else if (e.key === 'menuUpdate') {
-        let menuId = e.newValue.split(',')[1]
-        if (menuId) {
+        let vals = e.newValue.split(',')
+        let menuId = vals[1]
+        let position = vals[2] || ''
+        if (position === 'menu') {
+          MKEmitter.emit('reloadMenuView', menuId)
+        } else if (menuId) {
           Api.getAppVersion(menuId).then(() => {
             MKEmitter.emit('reloadMenuView', menuId)
           })
diff --git a/src/index.js b/src/index.js
index b798947..206bf3e 100644
--- a/src/index.js
+++ b/src/index.js
@@ -248,13 +248,6 @@
     GLOB.mkThdMenus = [] // 涓夌骇鑿滃崟
     GLOB.mkActions = {}  // 鎸夐挳鏉冮檺闆�
 
-    if (sessionStorage.getItem('breakpoint')) {
-      window.debugger = true
-      GLOB.breakpoint = sessionStorage.getItem('breakpoint')
-    } else {
-      GLOB.breakpoint = false
-    }
-
     Object.defineProperty(GLOB, 'appId', {
       writable: false,
       value: GLOB.appId
@@ -266,10 +259,6 @@
     Object.defineProperty(GLOB, 'systemType', {
       writable: false,
       value: GLOB.systemType
-    })
-    Object.defineProperty(GLOB, 'debugger', {
-      writable: false,
-      value: GLOB.debugger
     })
     Object.defineProperty(GLOB, 'mainSystemApi', {
       writable: false,
@@ -287,6 +276,23 @@
       writable: false,
       value: GLOB.cloudServiceApi || ''
     })
+
+    if (GLOB.sysType === 'cloud') {
+      Object.defineProperty(GLOB, 'debugger', {
+        writable: false,
+        value: GLOB.debugger
+      })
+
+      GLOB.breakpoint = false
+    } else {
+      if (sessionStorage.getItem('breakpoint')) {
+        GLOB.debugger = true
+        GLOB.breakpoint = sessionStorage.getItem('breakpoint')
+      } else {
+        GLOB.breakpoint = false
+      }
+    }
+
     Object.defineProperty(window, 'GLOB', {
       writable: false,
       value: GLOB
diff --git a/src/menu/components/share/actioncomponent/actionform/index.jsx b/src/menu/components/share/actioncomponent/actionform/index.jsx
index b79847b..4a4bd91 100644
--- a/src/menu/components/share/actioncomponent/actionform/index.jsx
+++ b/src/menu/components/share/actioncomponent/actionform/index.jsx
@@ -1,7 +1,7 @@
 import React, {Component} from 'react'
 import PropTypes from 'prop-types'
 import { fromJS } from 'immutable'
-import { Form, Row, Col, Input, Select, Radio, Tooltip, InputNumber, Cascader, Checkbox, Typography } from 'antd'
+import { Form, Row, Col, Input, Select, Radio, Tooltip, InputNumber, Cascader, Checkbox } from 'antd'
 import { QuestionCircleOutlined } from '@ant-design/icons'
 import { formRule } from '@/utils/option.js'
 
@@ -10,7 +10,6 @@
 import './index.scss'
 
 const { TextArea } = Input
-const { Paragraph } = Typography
 const MkEditIcon = asyncComponent(() => import('@/components/mkIcon'))
 const MKTable = asyncComponent(() => import('@/components/normalform/modalform/mkTable'))
 const acTyOptions = {
@@ -937,7 +936,7 @@
       fields.push(
         <Col span={span} key={index}>
           <Form.Item className={className} help={item.help} label={item.tooltip ?
-            <Tooltip placement="topLeft" title={item.tooltip}>
+            <Tooltip placement="topLeft" overlayStyle={{maxWidth: item.tooltip.length > 25 ? 350 : 250 }} title={<span onClick={(e) => e.stopPropagation()}>{item.tooltip}</span>}>
               <QuestionCircleOutlined className="mk-form-tip" />
               {item.label}
             </Tooltip> : item.label
@@ -950,16 +949,6 @@
         </Col>
       )
     })
-
-    if (window.debugger && this.props.card.uuid) {
-      fields.push(
-        <Col span={12} key="uuid">
-          <Form.Item label="鎸夐挳ID">
-            <Paragraph copyable>{this.props.card.uuid}</Paragraph>
-          </Form.Item>
-        </Col>
-      )
-    }
 
     return fields
   }
diff --git a/src/menu/components/share/actioncomponent/formconfig.jsx b/src/menu/components/share/actioncomponent/formconfig.jsx
index 92fd479..bbc1515 100644
--- a/src/menu/components/share/actioncomponent/formconfig.jsx
+++ b/src/menu/components/share/actioncomponent/formconfig.jsx
@@ -259,6 +259,7 @@
       key: 'label',
       label: '鎸夐挳鍚嶇О',
       initVal: card.label,
+      tooltip: card.uuid ? '鎸夐挳ID锛�' + card.uuid : '',
       required: true,
     },
     {
@@ -1385,6 +1386,7 @@
       key: 'label',
       label: '鎸夐挳鍚嶇О',
       initVal: card.label,
+      tooltip: card.uuid ? '鎸夐挳ID锛�' + card.uuid : '',
       required: true,
     },
     {
diff --git a/src/router/index.js b/src/router/index.js
index efa1c0c..b66adb6 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -48,6 +48,7 @@
   {path: '/role/:param', name: 'role', component: RoleManage},
   {path: '/hs', name: 'hs', component: SystemFunc},
   {path: '/proc', name: 'proc', component: SystemProc},
+  {path: '/proc/:func', name: 'proc', component: SystemProc},
   {path: '/iframe/:menuId/:loginUid', name: 'iframe', component: MkIframe},
   {path: '/iframe/:menuId/:loginUid/:bid', name: 'iframe', component: MkIframe},
   {path: '/view/:menuId', name: 'iframe', component: MkIframe},
diff --git a/src/tabviews/basetable/index.jsx b/src/tabviews/basetable/index.jsx
index 0540563..a64ab5f 100644
--- a/src/tabviews/basetable/index.jsx
+++ b/src/tabviews/basetable/index.jsx
@@ -245,7 +245,6 @@
       let _shortcut = `${preKey}+${keyCode}`
 
       if (window.GLOB.breakpoint && _shortcut === 'ctrl+67') {
-        window.debugger = false
         window.GLOB.breakpoint = false
         sessionStorage.removeItem('breakpoint')
         
diff --git a/src/tabviews/commontable/index.jsx b/src/tabviews/commontable/index.jsx
index b4da9d1..43da736 100644
--- a/src/tabviews/commontable/index.jsx
+++ b/src/tabviews/commontable/index.jsx
@@ -496,7 +496,6 @@
       let _shortcut = `${preKey}+${keyCode}`
 
       if (window.GLOB.breakpoint && _shortcut === 'ctrl+67') {
-        window.debugger = false
         window.GLOB.breakpoint = false
         sessionStorage.removeItem('breakpoint')
         
diff --git a/src/tabviews/custom/components/card/cardcellList/index.jsx b/src/tabviews/custom/components/card/cardcellList/index.jsx
index 63376f0..493a682 100644
--- a/src/tabviews/custom/components/card/cardcellList/index.jsx
+++ b/src/tabviews/custom/components/card/cardcellList/index.jsx
@@ -774,7 +774,7 @@
             let func = new Function('data', card.formula)
             val = func(_data)
           } catch (e) {
-            if (window.debugger) {
+            if (window.GLOB.debugger === true) {
               console.warn(e)
             }
             val = ''
@@ -794,7 +794,7 @@
                 // eslint-disable-next-line
                 _val = eval(_val)
               } catch (e) {
-                if (window.debugger) {
+                if (window.GLOB.debugger === true) {
                   console.info(_val)
                   console.warn(e)
                 }
@@ -820,7 +820,7 @@
               // eslint-disable-next-line
               _val = eval(_val)
             } catch (e) {
-              if (window.debugger) {
+              if (window.GLOB.debugger === true) {
                 console.info(_val)
                 console.warn(e)
               }
diff --git a/src/tabviews/custom/components/share/normalTable/index.jsx b/src/tabviews/custom/components/share/normalTable/index.jsx
index d27e52b..90c6088 100644
--- a/src/tabviews/custom/components/share/normalTable/index.jsx
+++ b/src/tabviews/custom/components/share/normalTable/index.jsx
@@ -337,7 +337,7 @@
           let func = new Function('data', col.formula)
           content = func([record])
         } catch (e) {
-          if (window.debugger) {
+          if (window.GLOB.debugger === true) {
             console.warn(e)
           }
           content = ''
@@ -352,7 +352,7 @@
             // eslint-disable-next-line
             content = eval(content)
           } catch (e) {
-            if (window.debugger) {
+            if (window.GLOB.debugger === true) {
               console.info(content)
               console.warn(e)
             }
diff --git a/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx b/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx
index 8835f6b..b7e5af0 100644
--- a/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx
+++ b/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx
@@ -440,7 +440,7 @@
           let func = new Function('data', col.formula)
           content = func([record])
         } catch (e) {
-          if (window.debugger) {
+          if (window.GLOB.debugger === true) {
             console.warn(e)
           }
           content = ''
@@ -456,7 +456,7 @@
             // eslint-disable-next-line
             content = eval(content)
           } catch (e) {
-            if (window.debugger) {
+            if (window.GLOB.debugger === true) {
               console.info(content)
               console.warn(e)
             }
@@ -849,7 +849,7 @@
           let func = new Function('data', col.formula)
           content = func([record])
         } catch (e) {
-          if (window.debugger) {
+          if (window.GLOB.debugger === true) {
             console.warn(e)
           }
           content = ''
@@ -865,7 +865,7 @@
             // eslint-disable-next-line
             content = eval(content)
           } catch (e) {
-            if (window.debugger) {
+            if (window.GLOB.debugger === true) {
               console.info(content)
               console.warn(e)
             }
@@ -1159,7 +1159,7 @@
     let mainItems = []  // 浜戠鎴栧崟鐐规暟鎹�
     let localItems = [] // 鏈湴鏁版嵁
     let cache = setting.cache !== 'false'
-    let debug = window.GLOB.debugger === true || window.debugger === true
+    let debug = window.GLOB.debugger === true
     let _sql = `Declare @mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20)  select @mk_departmentcode='${sessionStorage.getItem('departmentcode') || ''}',@mk_organization='${sessionStorage.getItem('organization') || ''}',@mk_user_type='${sessionStorage.getItem('mk_user_type') || ''}'\n`
     let _sso = _sql
 
diff --git a/src/tabviews/custom/index.jsx b/src/tabviews/custom/index.jsx
index 4d233b0..c859a83 100644
--- a/src/tabviews/custom/index.jsx
+++ b/src/tabviews/custom/index.jsx
@@ -316,7 +316,6 @@
       let _shortcut = `${preKey}+${keyCode}`
 
       if (window.GLOB.breakpoint && _shortcut === 'ctrl+67') {
-        window.debugger = false
         window.GLOB.breakpoint = false
         sessionStorage.removeItem('breakpoint')
         
diff --git a/src/tabviews/zshare/actionList/exceloutbutton/index.jsx b/src/tabviews/zshare/actionList/exceloutbutton/index.jsx
index a0b84fa..d5489f8 100644
--- a/src/tabviews/zshare/actionList/exceloutbutton/index.jsx
+++ b/src/tabviews/zshare/actionList/exceloutbutton/index.jsx
@@ -1081,7 +1081,7 @@
     param.custom_script = param.custom_script.replace(/@typename@/ig, `'admin'`)
 
     // 娴嬭瘯绯荤粺鎵撳嵃鏌ヨ璇彞
-    if (window.GLOB.debugger === true || (window.debugger === true && window.GLOB.sysType !== 'cloud')) {
+    if (window.GLOB.debugger === true) {
       param.custom_script && console.info(`${LText ? '' : '/*涓嶆墽琛岄粯璁ql*/\n'}${param.custom_script}`)
       LText && console.info(LText)
     }
diff --git a/src/tabviews/zshare/actionList/newpagebutton/index.jsx b/src/tabviews/zshare/actionList/newpagebutton/index.jsx
index 373ea78..756c068 100644
--- a/src/tabviews/zshare/actionList/newpagebutton/index.jsx
+++ b/src/tabviews/zshare/actionList/newpagebutton/index.jsx
@@ -155,15 +155,15 @@
       if (btn.Ot === 'required') {
         data.forEach(item => {
           let _id = item.$$uuid || ''
-          let url = '#/billprint/' + window.btoa(window.encodeURIComponent(JSON.stringify({ id: _id, tempId: btn.printTemp, dataM: sessionStorage.getItem('dataM') })))
+          let url = '#/billprint/' + window.btoa(window.encodeURIComponent(JSON.stringify({ id: _id, tempId: btn.printTemp, pageId: btn.$MenuID || '', dataM: sessionStorage.getItem('dataM') })))
           window.open(url)
         })
       } else if (btn.Ot === 'requiredOnce') {
         Id = data.map(item => item.$$uuid).filter(Boolean).join(',')
 
-        window.open('#/billprint/' + window.btoa(window.encodeURIComponent(JSON.stringify({ id: Id, tempId: btn.printTemp, dataM: sessionStorage.getItem('dataM') }))))
+        window.open('#/billprint/' + window.btoa(window.encodeURIComponent(JSON.stringify({ id: Id, tempId: btn.printTemp, pageId: btn.$MenuID || '', dataM: sessionStorage.getItem('dataM') }))))
       } else {
-        window.open('#/billprint/' + window.btoa(window.encodeURIComponent(JSON.stringify({ id: Id, tempId: btn.printTemp, dataM: sessionStorage.getItem('dataM') }))))
+        window.open('#/billprint/' + window.btoa(window.encodeURIComponent(JSON.stringify({ id: Id, tempId: btn.printTemp, pageId: btn.$MenuID || '', dataM: sessionStorage.getItem('dataM') }))))
       }
     } else if (btn.pageTemplate === 'billprintTemp') {
       let src = '#/menudesign/' + window.btoa(window.encodeURIComponent(JSON.stringify({ MenuType: 'billPrint', MenuId: Id, MenuNo: MenuNo, MenuName: name || '鎵撳嵃', Remark: Remark })))
diff --git a/src/tabviews/zshare/actionList/normalbutton/index.jsx b/src/tabviews/zshare/actionList/normalbutton/index.jsx
index 21b4dc9..7dfd165 100644
--- a/src/tabviews/zshare/actionList/normalbutton/index.jsx
+++ b/src/tabviews/zshare/actionList/normalbutton/index.jsx
@@ -1602,7 +1602,7 @@
       sql = sql.replace(/@Appkey@/ig, `'${window.GLOB.appkey || ''}'`)
       sql = sql.replace(/@typename@/ig, `'admin'`)
 
-      if (window.GLOB.debugger === true || (window.debugger === true && window.GLOB.sysType !== 'cloud')) {
+      if (window.GLOB.debugger === true) {
         console.info(sql.replace(/\n\s{8}/ig, '\n'))
       }
 
@@ -1638,7 +1638,7 @@
         Sort: index + 1
       }))
 
-      if (window.GLOB.debugger === true || (window.debugger === true && window.GLOB.sysType !== 'cloud')) {
+      if (window.GLOB.debugger === true) {
         let sql = [...lineMap.values()].map(item => (`
           ${item.insert}
           ${item.selects.join(` union all
@@ -2256,7 +2256,7 @@
     if (!id) return
 
     setTimeout(() => {
-      window.open('#/billprint/' + window.btoa(window.encodeURIComponent(JSON.stringify({ id: id, tempId: btn.verify.printTempId, dataM: sessionStorage.getItem('dataM') }))))
+      window.open('#/billprint/' + window.btoa(window.encodeURIComponent(JSON.stringify({ id: id, tempId: btn.verify.printTempId, pageId: btn.$MenuID || '', dataM: sessionStorage.getItem('dataM') }))))
     }, 500)
   }
 
diff --git a/src/tabviews/zshare/actionList/printbutton/index.jsx b/src/tabviews/zshare/actionList/printbutton/index.jsx
index 2e24601..9654827 100644
--- a/src/tabviews/zshare/actionList/printbutton/index.jsx
+++ b/src/tabviews/zshare/actionList/printbutton/index.jsx
@@ -1144,7 +1144,7 @@
     }
 
     // 娴嬭瘯绯荤粺鎵撳嵃鏌ヨ璇彞
-    if (window.GLOB.debugger === true || (window.debugger === true && window.GLOB.sysType !== 'cloud')) {
+    if (window.GLOB.debugger === true) {
       _customScript && console.info(`${btn.logLabel ? `/*${btn.logLabel} 鑷畾涔夎剼鏈�*/\n` : ''}${LText ? '' : '/*涓嶆墽琛岄粯璁ql*/\n'}${_customScript}`)
       LText && console.info(`${btn.logLabel ? `/*${btn.logLabel} 鏁版嵁婧�*/\n` : ''}` + LText.replace(/\n\s{8}/ig, '\n'))
     }
diff --git a/src/tabviews/zshare/mutilform/index.jsx b/src/tabviews/zshare/mutilform/index.jsx
index 50058a4..43ac759 100644
--- a/src/tabviews/zshare/mutilform/index.jsx
+++ b/src/tabviews/zshare/mutilform/index.jsx
@@ -619,7 +619,7 @@
     let mainItems = []  // 浜戠鎴栧崟鐐规暟鎹�
     let localItems = [] // 鏈湴鏁版嵁
     let cache = action.setting.cache !== 'false'
-    let debug = window.GLOB.debugger === true || (window.debugger === true && window.GLOB.sysType !== 'cloud')
+    let debug = window.GLOB.debugger === true
 
     let _sql = `Declare @mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20)  select @mk_departmentcode='${sessionStorage.getItem('departmentcode') || ''}',@mk_organization='${sessionStorage.getItem('organization') || ''}',@mk_user_type='${sessionStorage.getItem('mk_user_type') || ''}'\n`
     let _sso = _sql
@@ -748,7 +748,6 @@
    */
   improveSimpleActionForm = (deForms) => {
     let cache = this.props.action.setting.cache !== 'false'
-    let debug = window.GLOB.debugger === true || (window.debugger === true && window.GLOB.sysType !== 'cloud')
     let _sql = `Declare @mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20)  select @mk_departmentcode='${sessionStorage.getItem('departmentcode') || ''}',@mk_organization='${sessionStorage.getItem('organization') || ''}',@mk_user_type='${sessionStorage.getItem('mk_user_type') || ''}'\n`
 
     let deffers = deForms.map((form, index) => {
@@ -762,7 +761,7 @@
       param.LText = param.LText.replace(/@ID@/ig, `'${this.state.ID || ''}'`)
       param.LText = param.LText.replace(/@BID@/ig, `'${this.props.BID || ''}'`)
 
-      if (debug) {
+      if (window.GLOB.debugger) {
         console.info(param.LText)
       }
   
diff --git a/src/tabviews/zshare/topSearch/index.jsx b/src/tabviews/zshare/topSearch/index.jsx
index 1928e6a..c45413d 100644
--- a/src/tabviews/zshare/topSearch/index.jsx
+++ b/src/tabviews/zshare/topSearch/index.jsx
@@ -153,7 +153,7 @@
         if (item.resourceType === '1' && item.dataSource) {
           let _option = Utils.getSelectQueryOptions(item)
 
-          if (window.GLOB.debugger === true || (window.debugger === true && window.GLOB.sysType !== 'cloud')) {
+          if (window.GLOB.debugger === true) {
             console.info(_option.sql)
           }
 
diff --git a/src/templates/sharecomponent/actioncomponent/actionform/index.jsx b/src/templates/sharecomponent/actioncomponent/actionform/index.jsx
index 0661538..227e56b 100644
--- a/src/templates/sharecomponent/actioncomponent/actionform/index.jsx
+++ b/src/templates/sharecomponent/actioncomponent/actionform/index.jsx
@@ -1,7 +1,7 @@
 import React, {Component} from 'react'
 import PropTypes from 'prop-types'
 import { fromJS } from 'immutable'
-import { Form, Row, Col, Input, Select, Radio, Tooltip, InputNumber, Cascader, Typography } from 'antd'
+import { Form, Row, Col, Input, Select, Radio, Tooltip, InputNumber, Cascader } from 'antd'
 import { QuestionCircleOutlined } from '@ant-design/icons'
 
 import { formRule } from '@/utils/option.js'
@@ -12,7 +12,6 @@
 const MkEditIcon = asyncComponent(() => import('@/components/mkIcon'))
 
 const { TextArea } = Input
-const { Paragraph } = Typography
 const actionTypeOptions = {
   pop: ['label', 'position', 'OpenType', 'intertype', 'Ot', 'icon', 'class', 'execSuccess', 'execError', 'openmenu', 'output', 'tipTitle', 'hidden'],
   prompt: ['label', 'position', 'OpenType', 'intertype', 'Ot', 'icon', 'class', 'execSuccess', 'execError', 'openmenu', 'output', 'tipTitle', 'hidden'],
@@ -665,15 +664,6 @@
       )
     })
 
-    if (window.debugger && this.props.card.uuid) {
-      fields.push(
-        <Col span={12} key="uuid">
-          <Form.Item label="鎸夐挳ID">
-            <Paragraph copyable>{this.props.card.uuid}</Paragraph>
-          </Form.Item>
-        </Col>
-      )
-    }
     return fields
   }
 
diff --git a/src/utils/utils-datamanage.js b/src/utils/utils-datamanage.js
index 13412b2..5be52b3 100644
--- a/src/utils/utils-datamanage.js
+++ b/src/utils/utils-datamanage.js
@@ -255,7 +255,7 @@
     }
 
     // 娴嬭瘯绯荤粺鎵撳嵃鏌ヨ璇彞
-    if (window.GLOB.debugger === true || (window.debugger === true && window.GLOB.sysType !== 'cloud')) {
+    if (window.GLOB.debugger === true) {
       _customScript && console.info(`${setting.$name ? `/*${setting.$name} 鑷畾涔夎剼鏈�*/\n` : ''}${LText ? '' : '/*涓嶆墽琛岄粯璁ql*/\n'}${_customScript}`)
       LText && console.info(`${setting.$name ? `/*${setting.$name} 鏁版嵁婧�*/\n` : ''}` + LText.replace(/\n\s{8}/ig, '\n'))
     }
@@ -405,7 +405,7 @@
     }
 
     // 娴嬭瘯绯荤粺鎵撳嵃鏌ヨ璇彞
-    if (window.GLOB.debugger === true || (window.debugger === true && window.GLOB.sysType !== 'cloud')) {
+    if (window.GLOB.debugger === true) {
       _customScript &&  console.info(`${setting.$name ? `/*${setting.$name} 鑷畾涔夎剼鏈� 缁熻鏌ヨ*/\n` : ''}${LText ? '' : '/*涓嶆墽琛岄粯璁ql*/\n'}${_customScript}`)
       LText &&  console.info(`${setting.$name ? `/*${setting.$name} 鏁版嵁婧� 缁熻鏌ヨ*/\n` : ''}` + LText.replace(/\n\s{8}/ig, '\n'))
     }
@@ -556,7 +556,7 @@
     _script = _script.replace(/@typename@/ig, `'admin'`)
 
     // 娴嬭瘯绯荤粺鎵撳嵃鏌ヨ璇彞
-    if (window.GLOB.debugger === true || (window.debugger === true && window.GLOB.sysType !== 'cloud')) {
+    if (window.GLOB.debugger === true) {
       _script && console.info(`${item.$name ? `/*${item.$name} 鑷畾涔夎剼鏈紙鍚屾鏌ヨ锛�*/\n` : ''}${_sql ? '' : '/*涓嶆墽琛岄粯璁ql*/\n'}${_script}`)
       _sql && console.info(`${item.$name ? `/*${item.$name} 鏁版嵁婧愶紙鍚屾鏌ヨ锛�*/\n` : ''}` + _sql)
     }
diff --git a/src/utils/utils.js b/src/utils/utils.js
index 369abde..566ced2 100644
--- a/src/utils/utils.js
+++ b/src/utils/utils.js
@@ -1160,7 +1160,7 @@
       _sqlBottom = _sqlBottom.replace(/@\$|\$@/ig, '').replace(/@datam@/ig, '\'\'')
     }
 
-    if (window.GLOB.debugger === true || (window.debugger === true && window.GLOB.sysType !== 'cloud')) {
+    if (window.GLOB.debugger === true) {
       let fsql = `
       ${_sql}
       ${_sqlInsert}
@@ -1395,7 +1395,7 @@
       _sqlBottom = _sqlBottom.replace(/@\$|\$@/ig, '').replace(/@datam@/ig, '\'\'')
     }
 
-    if (window.GLOB.debugger === true || (window.debugger === true && window.GLOB.sysType !== 'cloud')) {
+    if (window.GLOB.debugger === true) {
       let fsql = `
       ${_sql}
       ${_sqlInsert}
@@ -2186,7 +2186,7 @@
     _sql = _sql.replace(/@datam@/ig, '\'\'')
   }
 
-  if (window.GLOB.debugger === true || (window.debugger === true && window.GLOB.sysType !== 'cloud')) {
+  if (window.GLOB.debugger === true) {
     // _sql = _sql.replace(/\n\s{8}/ig, '\n')
     console.info(_sql)
   }
diff --git a/src/views/billprint/index.jsx b/src/views/billprint/index.jsx
index b260195..cca0591 100644
--- a/src/views/billprint/index.jsx
+++ b/src/views/billprint/index.jsx
@@ -38,10 +38,12 @@
     BID: '',
     data: '',
     tempId: '',
+    pageId: '',
     config: null,
     urlParam: null,
     visible: false,
     rePos: false,
+    loading: false,
     auto: true
   }
 
@@ -63,7 +65,8 @@
         this.setState({
           BID: param.id || '',
           tempId: param.tempId,
-          urlParam: param
+          urlParam: param,
+          pageId: param.pageId || ''
         }, () => {
           setTimeout(() => {
             this.getMenuParam()
@@ -86,22 +89,36 @@
   componentDidMount() {
     const _this = this
 
-    Object.defineProperty(window, 'debug', {
-      configurable: true,
-      enumerable: true,
-      set(value) {
-        if (value + '' === 'false') {
-          window.debugger = false
-          window.GLOB.breakpoint = false
-          sessionStorage.removeItem('breakpoint')
-        } else {
-          window.debugger = true
-          window.GLOB.breakpoint = value + ''
-          sessionStorage.setItem('breakpoint', value)
+    if (window.GLOB.sysType !== 'cloud') {
+      Object.defineProperty(window, 'debugger', {
+        configurable: true,
+        enumerable: true,
+        set(value) {
+          if (value + '' === 'false') {
+            window.GLOB.debugger = false
+          } else {
+            window.GLOB.debugger = true
+          }
         }
-        _this.debugChange()
-      }
-    })
+      })
+
+      Object.defineProperty(window, 'debug', {
+        configurable: true,
+        enumerable: true,
+        set(value) {
+          if (value + '' === 'false') {
+            window.GLOB.debugger = false
+            window.GLOB.breakpoint = false
+            sessionStorage.removeItem('breakpoint')
+          } else {
+            window.GLOB.debugger = true
+            window.GLOB.breakpoint = value + ''
+            sessionStorage.setItem('breakpoint', value)
+          }
+          _this.debugChange()
+        }
+      })
+    }
 
     document.onkeydown = (event) => {
       let e = event || window.event
@@ -121,7 +138,6 @@
       let _shortcut = `${preKey}+${keyCode}`
 
       if (window.GLOB.breakpoint && _shortcut === 'ctrl+67') {
-        window.debugger = false
         window.GLOB.breakpoint = false
         sessionStorage.removeItem('breakpoint')
         
@@ -593,7 +609,7 @@
     }
 
     // 娴嬭瘯绯荤粺鎵撳嵃鏌ヨ璇彞
-    if (window.GLOB.debugger === true || (window.debugger === true && window.GLOB.sysType !== 'cloud')) {
+    if (window.GLOB.debugger === true) {
       _customScript &&  console.info(`${_dataresource ? '' : '/*涓嶆墽琛岄粯璁ql*/\n'}${_customScript}`)
       _dataresource &&  console.info(_dataresource)
     }
@@ -845,9 +861,52 @@
   }
 
   print = () => {
-    const { config, printing } = this.state
+    const { config, printing, BID, tempId, pageId } = this.state
     
     if (printing) return
+
+    this.setState({printing: true})
+    
+    if (config.callback === 'true') {
+      this.setState({loading: true})
+
+      Api.genericInterface({
+        func: 's_print_proc',
+        username: sessionStorage.getItem('User_Name') || '',
+        fullname: sessionStorage.getItem('Full_Name') || '',
+        BID: BID || '',
+        print_type: config.callNo || '',
+        MenuNo: config.MenuNo || '',
+        Menuid: tempId || ''
+      }).then(res => {
+        if (!res.status) {
+          notification.warning({
+            top: 92,
+            message: res.message,
+            duration: 5
+          })
+
+          this.setState({printing: false, loading: false})
+          return
+        }
+
+        this.setState({loading: false})
+
+        if (pageId) {
+          localStorage.setItem('menuUpdate', new Date().getTime() + ',' + pageId + ',menu')
+        }
+
+        setTimeout(() => {
+          this.execPrint()
+        }, 300)
+      })
+    } else {
+      this.execPrint()
+    }
+  }
+
+  execPrint = () => {
+    const { config } = this.state
 
     let qrcodes = document.getElementsByClassName('qrcode-box')
 
@@ -878,8 +937,6 @@
     }
 
     let jubuData = document.getElementById('bill-print').innerHTML
-
-    this.setState({printing: true})
     
     try {
       let iframe = document.createElement('IFRAME')
@@ -1038,11 +1095,11 @@
   }
 
   render() {
-    const { loadingview, viewlost, config, pages, auto, rePos } = this.state
+    const { loadingview, viewlost, config, pages, auto, rePos, loading } = this.state
 
     return (
       <div className="bill-print-wrap" >
-        {loadingview && <Spin size="large" />}
+        {loadingview || loading ? <Spin size="large" /> : null}
         {pages ? <div id="bill-print">
           {pages.map((components, index) => (<div className={'print-page' + (auto ? ' auto' : '') + (rePos ? ' reset-position' : '')} key={index} style={{...config.style, overflow: 'hidden', boxSizing: 'border-box'}}><Row className="component-wrap">{this.getComponents(components)}</Row></div>))}
         </div> : null}
diff --git a/src/views/design/index.jsx b/src/views/design/index.jsx
index 4417706..d357a7f 100644
--- a/src/views/design/index.jsx
+++ b/src/views/design/index.jsx
@@ -21,7 +21,6 @@
       window.location.reload()
     } else {
       sessionStorage.setItem('isEditState', 'true')
-      window.debugger = false
       window.GLOB.breakpoint = false
       window.GLOB.designView = true
       sessionStorage.removeItem('breakpoint')
diff --git a/src/views/main/index.jsx b/src/views/main/index.jsx
index 2f20d4d..8f64b52 100644
--- a/src/views/main/index.jsx
+++ b/src/views/main/index.jsx
@@ -29,22 +29,36 @@
   componentDidMount () {
     MKEmitter.addListener('resetSelectLine', this.resetParentParam)
 
-    Object.defineProperty(window, 'debug', {
-      configurable: true,
-      enumerable: true,
-      set(value) {
-        if (value + '' === 'false') {
-          window.debugger = false
-          window.GLOB.breakpoint = false
-          sessionStorage.removeItem('breakpoint')
-        } else {
-          window.debugger = true
-          window.GLOB.breakpoint = value + ''
-          sessionStorage.setItem('breakpoint', value)
+    if (window.GLOB.sysType !== 'cloud') {
+      Object.defineProperty(window, 'debugger', {
+        configurable: true,
+        enumerable: true,
+        set(value) {
+          if (value + '' === 'false') {
+            window.GLOB.debugger = false
+          } else {
+            window.GLOB.debugger = true
+          }
         }
-        MKEmitter.emit('debugChange')
-      }
-    })
+      })
+
+      Object.defineProperty(window, 'debug', {
+        configurable: true,
+        enumerable: true,
+        set(value) {
+          if (value + '' === 'false') {
+            window.GLOB.debugger = false
+            window.GLOB.breakpoint = false
+            sessionStorage.removeItem('breakpoint')
+          } else {
+            window.GLOB.debugger = true
+            window.GLOB.breakpoint = value + ''
+            sessionStorage.setItem('breakpoint', value)
+          }
+          MKEmitter.emit('debugChange')
+        }
+      })
+    }
   }
 
   componentWillUnmount () {
diff --git a/src/views/menudesign/index.jsx b/src/views/menudesign/index.jsx
index 060153f..6d94c54 100644
--- a/src/views/menudesign/index.jsx
+++ b/src/views/menudesign/index.jsx
@@ -817,7 +817,7 @@
   checkBase = () => {
     const { MenuType, config } = this.state
 
-    if (MenuType === 'billPrint' && config.printPage === 'page' && !config.everyPCount) {
+    if (MenuType === 'billPrint' && ((config.printPage === 'page' && !config.everyPCount) || (config.callback === 'true' && !config.callNo))) {
       return false
     } else if (MenuType === 'home' && (config.cacheUseful === 'true' && !config.cacheTime)) {
       return false
diff --git a/src/views/menudesign/menuform/index.jsx b/src/views/menudesign/menuform/index.jsx
index bb9801c..0a0e3ba 100644
--- a/src/views/menudesign/menuform/index.jsx
+++ b/src/views/menudesign/menuform/index.jsx
@@ -172,7 +172,6 @@
     })
   }
 
-  // 涓�浜岀骇鑿滃崟鍒囨崲
   selectChange = (key, value) => {
     const { config } = this.props
     const { menulist } = this.state
diff --git a/src/views/menudesign/printmenuform/index.jsx b/src/views/menudesign/printmenuform/index.jsx
index be3c97d..09dfdf1 100644
--- a/src/views/menudesign/printmenuform/index.jsx
+++ b/src/views/menudesign/printmenuform/index.jsx
@@ -1,7 +1,7 @@
 import React, {Component} from 'react'
 import PropTypes from 'prop-types'
-import { Form, Row, Col, InputNumber, Select, Radio, Tooltip } from 'antd'
-import { QuestionCircleOutlined } from '@ant-design/icons'
+import { Form, Row, Col, InputNumber, Select, Radio, Tooltip, Input } from 'antd'
+import { QuestionCircleOutlined, EditOutlined } from '@ant-design/icons'
 
 // import './index.scss'
 
@@ -11,49 +11,24 @@
     updateConfig: PropTypes.func
   }
 
-  changeCount = (val) => {
-    if (typeof(val) !== 'number') {
-      val = ''
+  selectChange = (key, value) => {
+    const { config } = this.props
+
+    if (['everyPCount', 'printWidth', 'printHeight'].includes(key)) {
+      if (typeof(value) !== 'number') {
+        value = ''
+      }
+    } else if (key === 'callNo') {
+      if (!/^[a-zA-Z0-9_]+$/.test(value)) {
+        value = ''
+      }
     }
-    this.props.updateConfig({...this.props.config, everyPCount: val})
-  }
 
-  changePrintWidth = (val) => {
-    if (typeof(val) !== 'number') {
-      val = ''
+    this.props.updateConfig({...config, [key]: value})
+
+    if (['pageSize', 'pageLayout', 'pagePadding', 'printCustom'].includes(key)) {
+      this.resetPage()
     }
-    this.props.updateConfig({...this.props.config, printWidth: val})
-  }
-
-  changePrintHeight = (val) => {
-    if (typeof(val) !== 'number') {
-      val = ''
-    }
-    this.props.updateConfig({...this.props.config, printHeight: val})
-  }
-
-  onPrintPageChange = (val) => {
-    this.props.updateConfig({...this.props.config, printPage: val})
-  }
-
-  pageSizeChange = (val) => {
-    this.props.updateConfig({...this.props.config, pageSize: val})
-    this.resetPage()
-  }
-
-  onLayoutChange = (val) => {
-    this.props.updateConfig({...this.props.config, pageLayout: val})
-    this.resetPage()
-  }
-  
-  onPaddingChange = (val) => {
-    this.props.updateConfig({...this.props.config, pagePadding: val})
-    this.resetPage()
-  }
-
-  onPrintCustomChange = (val) => {
-    this.props.updateConfig({...this.props.config, printCustom: val})
-    this.resetPage()
   }
 
   resetPage = () => {
@@ -143,7 +118,7 @@
                   }
                 ]
               })(
-                <Select onChange={this.pageSizeChange}>
+                <Select onChange={(val) => this.selectChange('pageSize', val)}>
                   <Select.Option value="A3">A3</Select.Option>
                   <Select.Option value="A4">A4</Select.Option>
                   <Select.Option value="A5">A5</Select.Option>
@@ -162,7 +137,7 @@
                   }
                 ]
               })(
-                <Radio.Group onChange={(e) => {this.onLayoutChange(e.target.value)}}>
+                <Radio.Group onChange={(e) => this.selectChange('pageLayout', e.target.value)}>
                   <Radio value="vertical">绾靛悜</Radio>
                   <Radio value="horizontal">妯悜</Radio>
                 </Radio.Group>
@@ -180,7 +155,7 @@
                   }
                 ]
               })(
-                <Radio.Group onChange={(e) => {this.onPaddingChange(e.target.value)}}>
+                <Radio.Group onChange={(e) => this.selectChange('pagePadding', e.target.value)}>
                   <Radio value="default">榛樿</Radio>
                   <Radio value="without">鏃�</Radio>
                 </Radio.Group>
@@ -192,26 +167,13 @@
               {getFieldDecorator('printPage', {
                 initialValue: config.printPage || 'auto'
               })(
-                <Radio.Group onChange={(e) => {this.onPrintPageChange(e.target.value)}}>
+                <Radio.Group onChange={(e) => this.selectChange('printPage', e.target.value)}>
                   <Radio value="auto">鑷�傚簲</Radio>
                   <Radio value="page">鍒嗛〉</Radio>
                 </Radio.Group>
               )}
             </Form.Item>
           </Col>
-          {/* <Col span={24}>
-            <Form.Item label="棣栭〉鏁�(鏉�)">
-              {getFieldDecorator('firstCount', {
-                initialValue: config.firstCount,
-                rules: [
-                  {
-                    required: true,
-                    message: '璇疯緭鍏ラ椤垫暟!'
-                  }
-                ]
-              })(<InputNumber min={1} max={1000} precision={1} onChange={this.changeFirstCount}/>)}
-            </Form.Item>
-          </Col> */}
           {config.printPage === 'page' ? <Col span={24}>
             <Form.Item label="姣忛〉鏁�(鏉�)">
               {getFieldDecorator('everyPCount', {
@@ -222,16 +184,9 @@
                     message: '璇疯緭鍏ユ瘡椤垫暟!'
                   }
                 ]
-              })(<InputNumber min={1} max={1000} precision={1} onChange={this.changeCount}/>)}
+              })(<InputNumber min={1} max={1000} precision={1} onChange={(val) => this.selectChange('everyPCount', val)}/>)}
             </Form.Item>
           </Col> : null}
-          {/* <Col span={24}>
-            <Form.Item label="灏鹃〉鏁�(鏉�)">
-              {getFieldDecorator('lastCount', {
-                initialValue: config.lastCount
-              })(<InputNumber min={1} max={1000} precision={1} onChange={this.changeLastCount}/>)}
-            </Form.Item>
-          </Col> */}
           <Col span={24}>
             <Form.Item label={
               <Tooltip placement="topLeft" title="閽堝涓嶈鍒欑焊寮狅紝鍙嚜瀹氫箟璁剧疆鎵撳嵃楂樺害鍜屽搴︼紝娉細鍚屾椂璁剧疆鎵撳嵃瀹藉害鍜岄珮搴﹀悗鏂瑰彲鐢熸晥銆�">
@@ -242,7 +197,7 @@
               {getFieldDecorator('printCustom', {
                 initialValue: config.printCustom || 'false'
               })(
-                <Radio.Group onChange={(e) => {this.onPrintCustomChange(e.target.value)}}>
+                <Radio.Group onChange={(e) => this.selectChange('printCustom', e.target.value)}>
                   <Radio value="false">涓嶅惎鐢�</Radio>
                   <Radio value="true">鍚敤</Radio>
                 </Radio.Group>
@@ -253,14 +208,48 @@
             <Form.Item label="鎵撳嵃瀹藉害">
               {getFieldDecorator('printWidth', {
                 initialValue: config.printWidth || ''
-              })(<InputNumber min={10} max={9999} precision={0} onChange={this.changePrintWidth}/>)}
+              })(<InputNumber min={10} max={9999} precision={0} onChange={(val) => this.selectChange('printWidth', val)}/>)}
             </Form.Item>
           </Col> : null}
           {config.printCustom === 'true' ? <Col span={24}>
             <Form.Item label="鎵撳嵃楂樺害">
               {getFieldDecorator('printHeight', {
                 initialValue: config.printHeight || ''
-              })(<InputNumber min={10} max={9999} precision={0} onChange={this.changePrintHeight}/>)}
+              })(<InputNumber min={10} max={9999} precision={0} onChange={(val) => this.selectChange('printHeight', val)}/>)}
+            </Form.Item>
+          </Col> : null}
+          <Col span={24}>
+            <Form.Item label="鍥炶皟">
+              {getFieldDecorator('callback', {
+                initialValue: config.callback || 'false'
+              })(
+                <Radio.Group onChange={(e) => this.selectChange('callback', e.target.value)}>
+                  <Radio value="false">涓嶅惎鐢�</Radio>
+                  <Radio value="true">鍚敤</Radio>
+                </Radio.Group>
+              )}
+            </Form.Item>
+          </Col>
+          {config.callback === 'true' ? <Col span={24}>
+            <Form.Item label="鍥炶皟鍑芥暟">
+              s_print_proc <EditOutlined style={{cursor: 'pointer'}} onClick={() => {window.open('#/proc/s_print_proc')}}/>
+            </Form.Item>
+          </Col> : null}
+          {config.callback === 'true' ? <Col span={24}>
+            <Form.Item label="鍥炶皟鍙傛暟">
+              {getFieldDecorator('callNo', {
+                initialValue: config.callNo || '',
+                rules: [
+                  {
+                    required: true,
+                    message: '璇峰~鍐欏洖璋冨弬鏁�!'
+                  },
+                  {
+                    pattern: /^[a-zA-Z0-9_]+$/,
+                    message: '鍥炶皟鍙傛暟鍙彲浣跨敤瀛楁瘝銆佹暟瀛椾互鍙奯'
+                  }
+                ]
+              })(<Input onChange={(e) => this.selectChange('callNo', e.target.value)}/>)}
             </Form.Item>
           </Col> : null}
         </Row>
diff --git a/src/views/mkiframe/index.jsx b/src/views/mkiframe/index.jsx
index 7923874..3f11727 100644
--- a/src/views/mkiframe/index.jsx
+++ b/src/views/mkiframe/index.jsx
@@ -25,6 +25,7 @@
 
     if (/^\/view\//.test(path)) {
       localStorage.setItem('getSysPermission', window.GLOB.appkey)
+      const that = this
     
       window.addEventListener('storage', function(event) {
         if (event.key === 'sysPermissions' && event.newValue) {
@@ -33,6 +34,15 @@
 
           window.GLOB.mkThdMenus = values.mkThdMenus
           window.GLOB.mkActions = values.mkActions
+        } else if (event.key === 'menuUpdate') {
+          let vals = event.newValue.split(',')
+          let MenuId = vals[1]
+          let position = vals[2] || ''
+          if (position === 'menu' && menuId === MenuId) {
+            that.setState({loading: true}, () => {
+              that.setState({loading: false})
+            })
+          }
         }
       })
 
@@ -79,6 +89,37 @@
   componentDidMount () {
     MKEmitter.addListener('modifyTabs', this.modifyTabs)
     MKEmitter.addListener('closeTabView', this.closeTabView)
+
+    if (window.GLOB.sysType !== 'cloud') {
+      Object.defineProperty(window, 'debugger', {
+        configurable: true,
+        enumerable: true,
+        set(value) {
+          if (value + '' === 'false') {
+            window.GLOB.debugger = false
+          } else {
+            window.GLOB.debugger = true
+          }
+        }
+      })
+
+      Object.defineProperty(window, 'debug', {
+        configurable: true,
+        enumerable: true,
+        set(value) {
+          if (value + '' === 'false') {
+            window.GLOB.debugger = false
+            window.GLOB.breakpoint = false
+            sessionStorage.removeItem('breakpoint')
+          } else {
+            window.GLOB.debugger = true
+            window.GLOB.breakpoint = value + ''
+            sessionStorage.setItem('breakpoint', value)
+          }
+          MKEmitter.emit('debugChange')
+        }
+      })
+    }
   }
 
   /**
diff --git a/src/views/systemproc/index.jsx b/src/views/systemproc/index.jsx
index 6d48c4c..07d4919 100644
--- a/src/views/systemproc/index.jsx
+++ b/src/views/systemproc/index.jsx
@@ -8,11 +8,14 @@
 
 class SysProc extends Component {
   render () {
+    const { params } = this.props.match
+    let func = params && params.func ? params.func : ''
+
     return (
       <div className="mk-proc-view">
         <ConfigProvider locale={zhCN}>
           <Header key="header"/>
-          <Proc />
+          <Proc func={func} />
         </ConfigProvider>
       </div>
     )
diff --git a/src/views/systemproc/proc/index.jsx b/src/views/systemproc/proc/index.jsx
index d9be6a9..73dd12e 100644
--- a/src/views/systemproc/proc/index.jsx
+++ b/src/views/systemproc/proc/index.jsx
@@ -13,7 +13,7 @@
 
 class ProcControl extends Component {
   state = {
-    procName: '',
+    procName: this.props.func || '',
     content: '',
     loading: false,
     visible: false,
@@ -57,6 +57,12 @@
         }
       })
     }
+
+    if (this.props.func) {
+      setTimeout(() => {
+        this.search(this.props.func)
+      }, 500)
+    }
   }
 
   search = (value) => {

--
Gitblit v1.8.0