From 2e271a6b02a2f82bc0e3a36e05c00731bad99358 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期日, 02 十月 2022 01:46:25 +0800
Subject: [PATCH] 2022-10-02

---
 src/views/menudesign/index.jsx |   39 ++++++++++++++++++++++++++++++++++-----
 1 files changed, 34 insertions(+), 5 deletions(-)

diff --git a/src/views/menudesign/index.jsx b/src/views/menudesign/index.jsx
index 063842e..d0a1225 100644
--- a/src/views/menudesign/index.jsx
+++ b/src/views/menudesign/index.jsx
@@ -7,6 +7,7 @@
 import { ConfigProvider, notification, Modal, Collapse, Card, Switch, Button, Typography } from 'antd'
 import { DoubleLeftOutlined, DoubleRightOutlined, EyeOutlined, EyeInvisibleOutlined } from '@ant-design/icons'
 import html2canvas from 'html2canvas'
+import md5 from 'md5'
 
 import Api from '@/api'
 import options from '@/store/options.js'
@@ -483,13 +484,16 @@
     })
   }
 
-  getMenuMessage = (delButtons) => {
+  getMenuMessage = (delButtons, tbs) => {
     const { config } = this.state
     let buttons = []
     let _sort = 1
 
     let traversal = (components) => {
       components.forEach(item => {
+        if (item.$tables) {
+          tbs.push(...item.$tables)
+        }
         if (item.type === 'tabs') {
           item.subtabs.forEach(tab => {
             traversal(tab.components)
@@ -621,6 +625,29 @@
         config.enabled = false
       }
 
+      let tbs = []
+      let delButtons = fromJS(this.state.delButtons).toJS()
+      let btns = this.getMenuMessage(delButtons, tbs)
+      tbs = Array.from(new Set(tbs))
+      tbs.sort()
+      if (tbs.length && sessionStorage.getItem('mk_tb_names')) {
+        let names = sessionStorage.getItem('mk_tb_names')
+        tbs = tbs.filter(tb => names.indexOf(',' + tb.toLowerCase() + ',') > -1)
+      }
+      tbs = tbs.join(';')
+
+      let key = md5(config.uuid + window.GLOB.appkey + tbs)
+      let url = ''
+
+      if (config.tbkey === key) {
+        key = ''
+      } else {
+        let urlparam = JSON.parse(window.decodeURIComponent(window.atob(this.props.match.params.param)))
+        urlparam.type = 'admin'
+        url = window.btoa(window.encodeURIComponent(JSON.stringify(urlparam)))
+        config.tbkey = key
+      }
+
       let param = {
         func: 'sPC_TrdMenu_AddUpt',
         FstID: config.fstMenuId || '',
@@ -632,10 +659,13 @@
         Template: 'CustomPage',
         MenuName: config.MenuName || '',
         PageParam: JSON.stringify({Template: 'CustomPage', OpenType: config.OpenType || 'newtab', hidden: config.hidden || 'false'}),
-        LongParam: window.btoa(window.encodeURIComponent(JSON.stringify(config))),
         open_edition: config.open_edition,
         LText: '',
-        LTexttb: ''
+        LTexttb: '',
+        debug_md5: key,
+        debug_url: url,
+        debug_list: window.btoa(window.encodeURIComponent(tbs)),
+        LongParam: window.btoa(window.encodeURIComponent(JSON.stringify(config)))
       }
 
       param.LText = Utils.formatOptions(param.LText)
@@ -653,10 +683,9 @@
         LText: []
       }
 
-      let delButtons = fromJS(this.state.delButtons).toJS()
       let btnIds = '' // 鐢ㄤ簬澶嶅埗鎸夐挳鐨勮繃婊�
       if (MenuType !== 'billPrint') {
-        btnParam.LText = this.getMenuMessage(delButtons)
+        btnParam.LText = btns
         btnParam.LText = btnParam.LText.join(' union all ')
 
         btnIds = btnParam.LText

--
Gitblit v1.8.0