king
2022-10-02 2e271a6b02a2f82bc0e3a36e05c00731bad99358
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