king
2021-01-11 191d6d48a282479c02ea212ca33789ad34137361
2021-01-11
14个文件已修改
1419 ■■■■ 已修改文件
src/api/index.js 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/calendar/index.jsx 117 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/calendar/index.scss 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/commontable/index.jsx 81 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/commontable/index.scss 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/index.jsx 36 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/formtab/index.jsx 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/treepage/index.jsx 95 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/treepage/index.scss 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/pageMessage/index.jsx 346 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/pageMessage/index.scss 66 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/comtableconfig/index.jsx 101 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/settingcomponent/settingform/index.scss 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/treepageconfig/index.jsx 463 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/index.js
@@ -604,6 +604,46 @@
  }
  /**
   * @description 获取本地系统配置
   * @param {Object}  param   请求参数
   */
  getLocalCacheConfig (param) {
    param.userid = sessionStorage.getItem('UserID') || ''
    param.lang = localStorage.getItem('lang') || ''
    param.SessionUid = localStorage.getItem('SessionUid') || ''
    param.LoginUID = sessionStorage.getItem('LoginUID') || ''
    param.appkey = window.GLOB.appkey || ''
    if (window.GLOB.mainSystemApi) {
      param.rduri = window.GLOB.mainSystemApi
    }
    let _param  = md5(JSON.stringify(param))
    if (mkDataBase) {
      return new Promise(resolve => {
        mkDataBase.transaction(tx => {
          tx.executeSql(`SELECT * FROM CONFIGS WHERE menuid='${param.MenuID}' and userid='${param.userid}'`, [], (tx, results) => {
            let paramItem = results.rows[0]
            if (paramItem) {
              resolve({ ErrCode: 'S', ErrMesg: '', LongParam: paramItem.LongParam, message: '', status: true })
            } else {
              resolve({ ErrCode: 'S', ErrMesg: '', LongParam: '', message: '', status: false })
            }
          }, (tx, results) => {
            mkDataBase = null
            resolve({ErrCode: 'S', ErrMesg: '', LongParam: '', message: '', status: false})
          })
        })
      })
    } else if (window.GLOB.CacheMap.has(_param)) {
      return Promise.resolve(window.GLOB.CacheMap.get(_param))
    } else {
      return Promise.resolve({ErrCode: 'S', ErrMesg: '', LongParam: '', message: '', status: false})
    }
  }
  /**
   * @description 将数据写入websql
   */
  writeInWebSql (data) {
src/tabviews/calendar/index.jsx
@@ -2,7 +2,7 @@
import PropTypes from 'prop-types'
import {connect} from 'react-redux'
import { is, fromJS } from 'immutable'
import { notification, Spin, Modal, Button, message, Tree, Typography } from 'antd'
import { notification, Spin, Modal, Button } from 'antd'
import moment from 'moment'
import Api from '@/api'
@@ -20,9 +20,7 @@
const MainSearch = asyncComponent(() => import('@/tabviews/zshare/topSearch'))
const CalendarComponent = asyncSpinComponent(() => import('@/tabviews/zshare/calendar'))
const SubTabTable = asyncSpinComponent(() => import('@/tabviews/subtabtable'))
const { TreeNode } = Tree
const { Paragraph } = Typography
const PagemsgComponent = asyncComponent(() => import('@/tabviews/zshare/pageMessage'))
class NormalTable extends Component {
  static propTpyes = {
@@ -49,9 +47,7 @@
    search: '',           // 搜索条件数组,使用时需分场景处理
    visible: false,       // 标签页控制
    triggerTime: '',      // 点击时间
    treevisible: false,   // 菜单结构树弹框显示隐藏控制
    calendarYear: moment().format('YYYY'), // 日历年份
    debug: sessionStorage.getItem('debug') === 'true'
  }
  /**
@@ -113,6 +109,9 @@
        if (config.tab && !permAction[config.tab.linkTab]) {
          config.tab = null
        }
      }
      if (config.tab) {
        config.tab.uuid = Utils.getuuid()
      }
      if (_curUserConfig) {
@@ -454,65 +453,6 @@
    })
  }
  handleviewconfig = (e) => {
    e.stopPropagation()
    const { MenuNo } = this.props
    const { config } = this.state
    if (config && config.funcs && config.funcs.length > 0) {
      this.setState({
        treevisible: true
      })
    } else {
      let oInput = document.createElement('input')
      oInput.value = MenuNo || ''
      document.body.appendChild(oInput)
      oInput.select()
      document.execCommand('Copy')
      document.body.removeChild(oInput)
      message.success(this.state.dict['main.copy.success'])
    }
  }
  getTreeNode = (data) => {
    let _type = {
      view: '页面',
      btn: '按钮',
      tab: '标签'
    }
    return data.map(item => {
      let _title = _type[item.subtype]
      let _others = []
      _others.push(
        (item.menuNo ? item.menuNo + '(菜单参数)' : ''),
        (item.tableName ? item.tableName + '(表名) ' : ''),
        (item.innerFunc ? item.innerFunc + '(内部函数) ' : ''),
        (item.outerFunc ? item.outerFunc + '(外部函数)' : '')
      )
      _others = _others.filter(Boolean)
      _others = _others.join('、')
      if (item.label) {
        _title = _title + '(' + item.label + ')'
      }
      if (_others) {
        _title = _title + ': ' + _others
      }
      if (item.subfuncs && item.subfuncs.length > 0) {
        return (
          <TreeNode title={_title} key={item.uuid} dataRef={item} selectable={false}>
            {this.getTreeNode(item.subfuncs)}
          </TreeNode>
        )
      }
      return <TreeNode key={item.uuid} title={_title} isLeaf selectable={false} />
    })
  }
  reloadMenuView = (menuId) => {
    const { MenuID } = this.props
@@ -543,7 +483,9 @@
  }
  componentDidMount () {
    MKEmitter.addListener('openNewTab', this.closeTab)
    MKEmitter.addListener('reloadMenuView', this.reloadMenuView)
    MKEmitter.addListener('refreshPopButton', this.refreshPopButton)
  }
  /**
@@ -553,13 +495,17 @@
    this.setState = () => {
      return
    }
    MKEmitter.removeListener('openNewTab', this.closeTab)
    MKEmitter.removeListener('reloadMenuView', this.reloadMenuView)
    MKEmitter.removeListener('refreshPopButton', this.refreshPopButton)
  }
  changeDate = (value) => {
    this.setState({calendarYear: value}, () => {
      this.loadmaindata()
    })
  refreshPopButton = (tabId) => {
    const { config } = this.props
    if (!config.tab || config.tab.uuid !== tabId) return
    this.loadmaindata()
  }
  triggerDate = (item) => {
@@ -582,7 +528,7 @@
  render() {
    const { menuType } = this.props
    const { debug, BID, searchlist, loadingview, viewlost, config, loading, data, triggerTime } = this.state
    const { BID, searchlist, loadingview, viewlost, config, loading, data, triggerTime } = this.state
    return (
      <div className="calendar-page" id={this.state.ContainerId}>
@@ -591,32 +537,7 @@
          <MainSearch BID={BID} searchlist={searchlist} menuType={menuType} refreshdata={this.refreshbysearch}/> : null
        }
        {config && config.calendar ? <CalendarComponent calendar={config.calendar} loading={loading} data={data} triggerDate={this.triggerDate} changeDate={this.changeDate}/> : null}
        {debug && options.sysType !== 'cloud' && menuType !== 'HS' ? <Button
          icon="copy"
          shape="circle"
          className="common-table-copy"
          onClick={this.handleviewconfig}
        /> : null}
        <Modal
          className="menu-tree-modal"
          title={'菜单结构树'}
          width={'650px'}
          maskClosable={false}
          visible={this.state.treevisible}
          onCancel={() => this.setState({treevisible: false})}
          footer={[
            <Button key="close" onClick={() => this.setState({treevisible: false})}>{this.state.dict['main.close']}</Button>
          ]}
          destroyOnClose
        >
          <div className="menu-header">
            <span>菜单名称:{this.props.MenuName}</span>
            <span>菜单参数:{<Paragraph copyable>{this.props.MenuNo}</Paragraph>}</span>
          </div>
          {this.state.treevisible ? <Tree defaultExpandAll showLine={true}>
            {this.getTreeNode(config.funcs)}
          </Tree> : null}
        </Modal>
        {menuType !== 'HS' ? <PagemsgComponent menu={{MenuName: this.props.MenuName, MenuNo: this.props.MenuNo}} config={config} dict={this.state.dict} /> : null}
        <Modal
          title={config.tab ? config.tab.label : ''}
          width={'80vw'}
@@ -631,10 +552,8 @@
          {config.tab ? <SubTabTable
            BID={triggerTime}
            Tab={config.tab}
            SupMenuID={this.props.MenuID}
            MenuID={config.tab.linkTab}
            refreshSupView={() => this.loadmaindata()}
            closeModalView={this.closeTab}
            SupMenuID={this.props.MenuID}
          /> : null}
        </Modal>
        {viewlost ? <NotFount msg={this.state.lostmsg} /> : null}
src/tabviews/calendar/index.scss
@@ -41,22 +41,4 @@
  }
}
.menu-tree-modal {
  .ant-modal-body {
    min-height: 300px;
    .menu-header {
      text-align: center;
      span {
        font-weight: 600;
        margin-right: 20px;
      }
      .ant-typography {
        font-weight: 600;
        display: inline-block;
      }
    }
    .ant-tree li .ant-tree-node-content-wrapper {
      cursor: default;
    }
  }
}
src/tabviews/commontable/index.jsx
@@ -2,7 +2,7 @@
import PropTypes from 'prop-types'
import {connect} from 'react-redux'
import { is, fromJS } from 'immutable'
import { notification, Spin, Tabs, Icon, Switch, Modal, Button, message, Typography, Row, Col } from 'antd'
import { notification, Spin, Tabs, Icon, Switch, Row, Col } from 'antd'
import Api from '@/api'
import zhCN from '@/locales/zh-CN/main.js'
@@ -24,9 +24,9 @@
const SubTable = asyncSpinComponent(() => import('@/tabviews/subtable'))
const CardComponent = asyncSpinComponent(() => import('@/tabviews/zshare/cardcomponent'))
const ChartComponent = asyncSpinComponent(() => import('@/tabviews/zshare/chartcomponent'))
const PagemsgComponent = asyncComponent(() => import('@/tabviews/zshare/pageMessage'))
const { TabPane } = Tabs
const { Paragraph } = Typography
class NormalTable extends Component {
  static propTpyes = {
@@ -60,7 +60,6 @@
    search: '',           // 搜索条件数组,使用时需分场景处理
    BIDs: {},             // 上级表id
    pickup: false,        // 主表数据隐藏显示切换
    treevisible: false,   // 菜单结构树弹框显示隐藏控制
    tabActive: null,      // 标签页展开控制
    chartId: '',          // 展开图表ID
    statFields: [],       // 合计字段
@@ -778,57 +777,6 @@
    })
  }
  handleviewconfig = (e) => {
    e.stopPropagation()
    const { MenuNo } = this.props
    const { config } = this.state
    if (config && config.funcs && config.funcs.length > 0) {
      this.setState({
        treevisible: true
      })
    } else {
      let oInput = document.createElement('input')
      oInput.value = MenuNo || ''
      document.body.appendChild(oInput)
      oInput.select()
      document.execCommand('Copy')
      document.body.removeChild(oInput)
      message.success(this.state.dict['main.copy.success'])
    }
  }
  getTreeNode = (data) => {
    let _type = {
      view: '页面',
      btn: '按钮',
      tab: '标签'
    }
    return data.map(item => {
      let _title = _type[item.subtype]
      let _others = []
      _others.push(
        (item.menuNo ? item.menuNo + '(菜单参数)' : ''),
        (item.tableName ? item.tableName + '(表名) ' : ''),
        (item.innerFunc ? item.innerFunc + '(内部函数) ' : ''),
        (item.outerFunc ? item.outerFunc + '(外部函数)' : '')
      )
      _others = _others.filter(Boolean)
      _others = _others.join('、')
      if (item.label) {
        _title = _title + '(' + item.label + ')'
      }
      if (_others) {
        _title = _title + ': ' + _others
      }
      return <p key={item.uuid}>{_title}</p>
    })
  }
  /**
   * @description 图表视图切换
   */
@@ -1061,30 +1009,7 @@
            })}
          </Tabs>))
        }
        {menuType !== 'HS' ? <Button
          icon="copy"
          shape="circle"
          className="common-table-copy"
          onClick={this.handleviewconfig}
        /> : null}
        <Modal
          className="menu-tree-modal"
          title={'菜单信息'}
          width={'650px'}
          maskClosable={false}
          visible={this.state.treevisible}
          onCancel={() => this.setState({treevisible: false})}
          footer={[
            <Button key="close" onClick={() => this.setState({treevisible: false})}>{this.state.dict['main.close']}</Button>
          ]}
          destroyOnClose
        >
          <div className="menu-header">
            <span>菜单名称:{this.props.MenuName}</span>
            <span>菜单参数:{<Paragraph copyable>{this.props.MenuNo}</Paragraph>}</span>
          </div>
          {this.state.treevisible ? this.getTreeNode(config.funcs) : null}
        </Modal>
        {menuType !== 'HS' ? <PagemsgComponent menu={{MenuName: this.props.MenuName, MenuNo: this.props.MenuNo}} config={config} dict={this.state.dict} /> : null}
        {viewlost ? <NotFount msg={this.state.lostmsg} /> : null}
      </div>
    )
src/tabviews/commontable/index.scss
@@ -91,14 +91,6 @@
      cursor: default;
    }
  }
  .page-message {
    position: fixed;
    z-index: 2;
    bottom: 65px;
    right: 30px;
    width: 40px;
    height: 40px;
  }
  .ant-table-fixed-left, .ant-table-fixed-right {
    z-index: 1;
  }
@@ -152,26 +144,6 @@
    }
    .canvas {
      clear: both;
    }
  }
}
.menu-tree-modal {
  .ant-modal-body {
    min-height: 300px;
    .menu-header {
      text-align: center;
      span {
        font-weight: 600;
        margin-right: 20px;
      }
      .ant-typography {
        font-weight: 600;
        display: inline-block;
      }
    }
    .ant-tree li .ant-tree-node-content-wrapper {
      cursor: default;
    }
  }
}
src/tabviews/custom/index.jsx
@@ -2,7 +2,7 @@
import PropTypes from 'prop-types'
import { connect } from 'react-redux'
import { is, fromJS } from 'immutable'
import { notification, Spin, Row, Col, Button, message } from 'antd'
import { notification, Spin, Row, Col } from 'antd'
import moment from 'moment'
import md5 from 'md5'
@@ -26,6 +26,7 @@
const MainSearch = asyncComponent(() => import('@/tabviews/zshare/topSearch'))
const NormalTable = asyncComponent(() => import('./components/table/normal-table'))
const NormalGroup = asyncComponent(() => import('./components/group/normal-group'))
const PagemsgComponent = asyncComponent(() => import('@/tabviews/zshare/pageMessage'))
class CustomPage extends Component {
  static propTpyes = {
@@ -50,7 +51,6 @@
    loading: false,       // 列表数据加载中
    visible: false,       // 标签页控制
    treevisible: false,   // 菜单结构树弹框显示隐藏控制
    debug: sessionStorage.getItem('debug') === 'true'
  }
  /**
@@ -612,27 +612,6 @@
    })
  }
  handleviewconfig = (e) => {
    e.stopPropagation()
    const { MenuNo } = this.props
    const { config } = this.state
    if (config && config.funcs && config.funcs.length > 0) {
      this.setState({
        treevisible: true
      })
    } else {
      let oInput = document.createElement('input')
      oInput.value = MenuNo || ''
      document.body.appendChild(oInput)
      oInput.select()
      document.execCommand('Copy')
      document.body.removeChild(oInput)
      message.success(this.state.dict['main.copy.success'])
    }
  }
  reloadMenuView = (menuId) => {
    const { MenuID } = this.props
@@ -755,19 +734,14 @@
  }
  render() {
    const { menuType, MenuNo } = this.props
    const { debug, loadingview, viewlost, config, loading } = this.state
    const { menuType } = this.props
    const { loadingview, viewlost, config, loading } = this.state
    return (
      <div className={'custom-page-wrap ' + (loadingview || loading ? 'loading' : '')} id={this.state.ContainerId} style={config ? config.style : null}>
        {(loadingview || loading) ? <Spin className="view-spin" size="large" /> : null}
        <Row>{this.getComponents()}</Row>
        {debug && MenuNo && options.sysType !== 'cloud' && menuType !== 'HS' ? <Button
          icon="copy"
          shape="circle"
          className="common-table-copy"
          onClick={this.handleviewconfig}
        /> : null}
        {menuType !== 'HS' ? <PagemsgComponent menu={{MenuName: this.props.MenuName, MenuNo: this.props.MenuNo}} config={config} dict={this.state.dict} /> : null}
        {viewlost ? <NotFount msg={this.state.lostmsg} /> : null}
      </div>
    )
src/tabviews/formtab/index.jsx
@@ -16,11 +16,12 @@
import FormGroup from './formgroup'
import FormAction from './actionList'
import NotFount from '@/components/404'
import {modifyTabview} from '@/store/action'
import { modifyTabview } from '@/store/action'
import './index.scss'
const { TabPane } = Tabs
const SubTable = asyncComponent(() => import('@/tabviews/subtable'))
const PagemsgComponent = asyncComponent(() => import('@/tabviews/zshare/pageMessage'))
class NormalTable extends Component {
  static propTpyes = {
@@ -689,6 +690,7 @@
            )
          })
        }
        {this.props.menuType !== 'HS' ? <PagemsgComponent menu={{MenuName: this.props.MenuName, MenuNo: this.props.MenuNo}} config={config} dict={this.state.dict} /> : null}
        {viewlost ? <NotFount msg={this.state.lostmsg} /> : null}
      </div>
    )
src/tabviews/treepage/index.jsx
@@ -2,10 +2,9 @@
import PropTypes from 'prop-types'
import {connect} from 'react-redux'
import { is, fromJS } from 'immutable'
import { notification, Spin, Tabs, Icon, Modal, Button, message, Tree, Typography, Row, Col, Card, Input, Empty } from 'antd'
import { notification, Spin, Tabs, Icon, Modal, Button, Tree, Row, Col, Card, Input, Empty } from 'antd'
import Api from '@/api'
import options from '@/store/options.js'
import zhCN from '@/locales/zh-CN/main.js'
import enUS from '@/locales/en-US/main.js'
import Utils from '@/utils/utils.js'
@@ -18,11 +17,11 @@
const VerifyCard = asyncComponent(() => import('@/tabviews/zshare/verifycard'))
const SubTable = asyncSpinComponent(() => import('@/tabviews/subtable'))
const PagemsgComponent = asyncComponent(() => import('@/tabviews/zshare/pageMessage'))
const { TabPane } = Tabs
const { TreeNode } = Tree
const { Search } = Input
const { Paragraph } = Typography
class TreePage extends Component {
  static propTpyes = {
@@ -48,14 +47,12 @@
    loading: false,       // 列表数据加载中
    BIDs: {},             // 上级表id
    visible: false,       // 弹框显示隐藏控制
    treevisible: false,   // 菜单结构树弹框显示隐藏控制
    confirmLoading: false,// 自定义设置模态框加载中
    revertLoading: false, // 恢复默认设置
    settingVisible: false,// 自定义设置模态框
    tabActive: null,      // 标签页展开控制
    expandedKeys: [],     // 展开的树节点
    selectedKeys: [],     // 选中的树节点
    debug: sessionStorage.getItem('debug') === 'true'
  }
  /**
@@ -495,65 +492,6 @@
    })
  }
  handleviewconfig = (e) => {
    e.stopPropagation()
    const { MenuNo } = this.props
    const { config } = this.state
    if (config && config.funcs && config.funcs.length > 0) {
      this.setState({
        treevisible: true
      })
    } else {
      let oInput = document.createElement('input')
      oInput.value = MenuNo || ''
      document.body.appendChild(oInput)
      oInput.select()
      document.execCommand('Copy')
      document.body.removeChild(oInput)
      message.success(this.state.dict['main.copy.success'])
    }
  }
  getTreeNode = (data) => {
    let _type = {
      view: '页面',
      btn: '按钮',
      tab: '标签'
    }
    return data.map(item => {
      let _title = _type[item.subtype]
      let _others = []
      _others.push(
        (item.menuNo ? item.menuNo + '(菜单参数)' : ''),
        (item.tableName ? item.tableName + '(表名) ' : ''),
        (item.innerFunc ? item.innerFunc + '(内部函数) ' : ''),
        (item.outerFunc ? item.outerFunc + '(外部函数)' : '')
      )
      _others = _others.filter(Boolean)
      _others = _others.join('、')
      if (item.label) {
        _title = _title + '(' + item.label + ')'
      }
      if (_others) {
        _title = _title + ': ' + _others
      }
      if (item.subfuncs && item.subfuncs.length > 0) {
        return (
          <TreeNode title={_title} key={item.uuid} dataRef={item} selectable={false}>
            {this.getTreeNode(item.subfuncs)}
          </TreeNode>
        )
      }
      return <TreeNode key={item.uuid} title={_title} isLeaf selectable={false} />
    })
  }
  controlCustomSetting = () => {
    this.setState({
      settingVisible: true,
@@ -730,7 +668,7 @@
  render() {
    const { menuType } = this.props
    const { debug, setting, loadingview, viewlost, config, userConfig, tabActive, tabgroups, treeNodes, treedata, expandedKeys, selectedKeys } = this.state
    const { setting, loadingview, viewlost, config, userConfig, tabActive, tabgroups, treeNodes, treedata, expandedKeys, selectedKeys } = this.state
    return (
      <div className="tree-page" id={this.state.ContainerId}>
@@ -795,32 +733,7 @@
            )}
          </Col>
        </Row> : null}
        {debug && options.sysType !== 'cloud' && menuType !== 'HS' ? <Button
          icon="copy"
          shape="circle"
          className="tree-page-copy"
          onClick={this.handleviewconfig}
        /> : null}
        <Modal
          className="menu-tree-modal"
          title={'菜单结构树'}
          width={'650px'}
          maskClosable={false}
          visible={this.state.treevisible}
          onCancel={() => this.setState({treevisible: false})}
          footer={[
            <Button key="close" onClick={() => this.setState({treevisible: false})}>{this.state.dict['main.close']}</Button>
          ]}
          destroyOnClose
        >
          <div className="menu-header">
            <span>菜单名称:{this.props.MenuName}</span>
            <span>菜单参数:{<Paragraph copyable>{this.props.MenuNo}</Paragraph>}</span>
          </div>
          {this.state.treevisible ? <Tree defaultExpandAll showLine={true}>
            {this.getTreeNode(config.funcs)}
          </Tree> : null}
        </Modal>
        {menuType !== 'HS' ? <PagemsgComponent menu={{MenuName: this.props.MenuName, MenuNo: this.props.MenuNo}} config={config} dict={this.state.dict} /> : null}
        {/* 按钮使用系统存储过程时,验证信息模态框 */}
        <Modal
          wrapClassName="common-table-custom-modal"
src/tabviews/treepage/index.scss
@@ -149,25 +149,6 @@
  }
}
.menu-tree-modal {
  .ant-modal-body {
    min-height: 300px;
    .menu-header {
      text-align: center;
      span {
        font-weight: 600;
        margin-right: 20px;
      }
      .ant-typography {
        font-weight: 600;
        display: inline-block;
      }
    }
    .ant-tree li .ant-tree-node-content-wrapper {
      cursor: default;
    }
  }
}
.common-table-custom-modal {
  .ant-modal {
    top: 50px;
src/tabviews/zshare/pageMessage/index.jsx
@@ -1,28 +1,352 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { Button } from 'antd'
import { is, fromJS } from 'immutable'
import { Button, Modal, Typography, Tree } from 'antd'
import Api from '@/api'
import Utils from '@/utils/utils.js'
import options from '@/store/options.js'
import './index.scss'
const { TreeNode } = Tree
const { Paragraph } = Typography
class PageMessage extends Component {
  static propTpyes = {
    BID: PropTypes.any,          // 父级Id,用于查询下拉选择项
    menuType: PropTypes.any,     // 菜单权限,是否为HS
    dict: PropTypes.object,      // 字典
  }
  state = {
    debug: sessionStorage.getItem('debug') === 'true'
    debug: sessionStorage.getItem('debug') === 'true',
    visible: false,
    key: '',        // 更新指针
    data: []
  }
  render() {
    const { debug } = this.state
  shouldComponentUpdate (nextProps, nextState) {
    return !is(fromJS(this.state), fromJS(nextState))
  }
    return (debug && options.sysType !== 'cloud' ? <Button
      icon="copy"
      shape="circle"
      className="page-message"
      onClick={this.handleviewconfig}
    /> : null)
  /**
   * @description 组件销毁,清除state更新
   */
  componentWillUnmount () {
    this.setState = () => {
      return
    }
  }
  handleviewconfig = (e) => {
    const { config } = this.props
    let data = []
    e.stopPropagation()
    if (config.Template === 'CustomPage') {
      data = this.getCusData(config)
    } else {
      data = this.getData(config)
    }
    this.setState({
      visible: true,
      data: data
    })
  }
  getBtnCell = (cell, item) => {
    let _cell = { uuid: cell.uuid, title: `按钮(${cell.label}):` }
    let _others = []
    let tablename = cell.OpenType === 'excelIn' ? (cell.sheet || '') : (cell.sql || '')
    if (cell.OpenType === 'excelOut' && cell.intertype === 'system') {
      tablename = item.setting.tableName || ''
    }
    if (['pop', 'prompt', 'exec', 'excelIn', 'excelOut'].includes(cell.OpenType)) {
      if (tablename) {
        _others.push(`${tablename}(表名)`)
      }
      if (cell.innerFunc) {
        _others.push(`${cell.innerFunc}(内部函数)`)
      }
      if (cell.outerFunc) {
        _others.push(`${cell.outerFunc}(外部函数)`)
      }
    } else if (cell.OpenType === 'popview') {
      _cell.sublist = []
      Api.getLocalCacheConfig({
        func: 'sPC_Get_LongParam',
        MenuID: cell.uuid
      }).then(res => {
        if (res.LongParam) {
          let _config
          try { // 配置信息解析
            _config = JSON.parse(window.decodeURIComponent(window.atob(res.LongParam)))
          } catch (e) {
            _config = ''
          }
          if (_config) {
            _cell.sublist = this.getCusData(_config)
            this.setState({key: cell.uuid})
          }
        }
      })
    }
    _cell.title = _cell.title + _others.join('、')
    return _cell
  }
  getCusData = (config) => {
    let data = []
    config.components.forEach(item => {
      let _item = { uuid: item.uuid, title: item.name, sublist: [] }
      if (item.type === 'tabs') {
        item.subtabs.forEach(tab => {
          let cell = { uuid: tab.uuid, title: tab.label }
          cell.sublist = this.getCusData(tab)
          _item.sublist.push(cell)
        })
      } else if (item.type === 'group') {
        _item.sublist = this.getCusData(item)
      } else if (item.type === 'search' || (item.type === 'card' && item.subtype === 'propcard' && item.wrap.datatype === 'static')) {
        let cell = { uuid: Utils.getuuid(), title: '数据源:(无)' }
        _item.sublist.push(cell)
      } else if (item.setting) {
        let cell = { uuid: Utils.getuuid(), title: '数据源:' }
        let _others = []
        if (item.setting.tableName) {
          _others.push(`${item.setting.tableName}(表名)`)
        }
        if (item.setting.innerFunc) {
          _others.push(`${item.setting.innerFunc}(内部函数)`)
        }
        if (item.setting.outerFunc) {
          _others.push(`${item.setting.outerFunc}(外部函数)`)
        }
        cell.title = cell.title + _others.join('、')
        _item.sublist.push(cell)
      }
      if (item.action) {
        item.action.forEach(cell => {
          let _cell = this.getBtnCell(cell, item)
          _item.sublist.push(_cell)
        })
      }
      if (item.type === 'card' || (item.type === 'table' && item.subtype === 'tablecard')) {
        item.subcards.forEach(card => {
          card.elements && card.elements.forEach(cell => {
            if (cell.eleType === 'button') {
              let _cell = this.getBtnCell(cell, item)
              _item.sublist.push(_cell)
            }
          })
          card.backElements && card.backElements.forEach(cell => {
            if (cell.eleType === 'button') {
              let _cell = this.getBtnCell(cell, item)
              _item.sublist.push(_cell)
            }
          })
        })
      } else if (item.type === 'table' && item.subtype === 'normaltable') {
        item.cols.forEach(col => {
          if (col.type !== 'action') return
          col.elements = col.elements.forEach(cell => {
            let _cell = this.getBtnCell(cell, item)
            _item.sublist.push(_cell)
          })
        })
      }
      data.push(_item)
    })
    return data
  }
  getData = (config) => {
    let data = []
    let item = {uuid: Utils.getuuid(), title: '数据源:'}
    let _others = []
    if (config.Template === 'SubTable') {
      if (config.tabNo) {
        _others.push(`${config.tabNo}(菜单参数)`)
      }
    }
    if (config.setting.tableName) {
      _others.push(`${config.setting.tableName}(表名)`)
    }
    if (config.setting.innerFunc) {
      _others.push(`${config.setting.innerFunc}(内部函数)`)
    }
    if (config.setting.outerFunc) {
      _others.push(`${config.setting.outerFunc}(外部函数)`)
    }
    item.title = item.title + _others.join('、')
    data.push(item)
    // 按钮
    config.action && config.action.forEach(item => {
      let _item = {uuid: Utils.getuuid(), title: `按钮(${item.label}):`}
      let _others = []
      let tablename = item.OpenType === 'excelIn' ? (item.sheet || '') : (item.sql || '')
      if (item.OpenType === 'excelOut' && item.intertype === 'system') {
        tablename = config.setting.tableName || ''
      }
      if (item.OpenType === 'popview') {
        _item.sublist = []
        Api.getLocalCacheConfig({
          func: 'sPC_Get_LongParam',
          MenuID: item.linkTab
        }).then(res => {
          if (res.LongParam) {
            let _config
            try { // 配置信息解析
              _config = JSON.parse(window.decodeURIComponent(window.atob(res.LongParam)))
            } catch (e) {
              _config = ''
            }
            if (_config) {
              _item.sublist = this.getData(_config)
              this.setState({key: item.uuid})
            }
          }
        })
      } else if (['pop', 'prompt', 'exec', 'excelIn', 'excelOut'].includes(item.OpenType)) {
        if (tablename) {
          _others.push(`${tablename}(表名)`)
        }
        if (item.innerFunc) {
          _others.push(`${item.innerFunc}(内部函数)`)
        }
        if (item.outerFunc) {
          _others.push(`${item.outerFunc}(外部函数)`)
        }
      }
      _item.title = _item.title + _others.join('、')
      data.push(_item)
    })
    // 标签页
    config.tabgroups && config.tabgroups.forEach(group => {
      group.sublist.forEach(tab => {
        let _item = {uuid: Utils.getuuid(), title: `标签(${tab.label}):`, sublist: []}
        Api.getLocalCacheConfig({
          func: 'sPC_Get_LongParam',
          MenuID: tab.linkTab
        }).then(res => {
          if (res.LongParam) {
            let _config
            try { // 配置信息解析
              _config = JSON.parse(window.decodeURIComponent(window.atob(res.LongParam)))
            } catch (e) {
              _config = ''
            }
            if (_config) {
              _item.sublist = this.getData(_config)
              this.setState({key: tab.uuid})
            }
          }
        })
        data.push(_item)
      })
    })
    if (config.Template === 'CalendarPage' && config.tab) {
      let _item = {uuid: Utils.getuuid(), title: `标签(${config.tab.label}):`, sublist: []}
      Api.getLocalCacheConfig({
        func: 'sPC_Get_LongParam',
        MenuID: config.tab.linkTab
      }).then(res => {
        if (res.LongParam) {
          let _config
          try { // 配置信息解析
            _config = JSON.parse(window.decodeURIComponent(window.atob(res.LongParam)))
          } catch (e) {
            _config = ''
          }
          if (_config) {
            _item.sublist = this.getData(_config)
            this.setState({key: config.tab.linkTab})
          }
        }
      })
      data.push(_item)
    }
    return data
  }
  getTreeNode = (data) => {
    return data.map(item => {
      if (item.sublist && item.sublist.length) {
        return (
          <TreeNode title={item.title} key={item.uuid} selectable={false}>
            {this.getTreeNode(item.sublist)}
          </TreeNode>
        )
      }
      return <TreeNode key={item.uuid} title={item.title} isLeaf selectable={false} />
    })
  }
  render() {
    const { menu, dict } = this.props
    const { debug, visible, data } = this.state
    return (
      <div className="page-message-wrap">
        {debug && options.sysType !== 'cloud' ? <Button
          icon="copy"
          shape="circle"
          className="page-message"
          onClick={this.handleviewconfig}
        /> : null}
        <Modal
          className="menu-tree-modal"
          title={'菜单信息'}
          width={'850px'}
          maskClosable={false}
          visible={visible}
          onCancel={() => this.setState({visible: false})}
          footer={[
            <Button key="close" onClick={() => this.setState({visible: false})}>{dict['main.close']}</Button>
          ]}
          destroyOnClose
        >
          <div className="menu-header">
            <span>菜单名称:{menu.MenuName}</span>
            {menu.MenuNo ? <span>菜单参数:<Paragraph copyable>{menu.MenuNo}</Paragraph></span> : null}
          </div>
          {visible ? <Tree defaultExpandAll showLine={true}>
            {this.getTreeNode(data)}
          </Tree> : null}
        </Modal>
      </div>
    )
  }
}
src/tabviews/zshare/pageMessage/index.scss
@@ -1,46 +1,30 @@
.top-search {
  background: #ffffff;
  .ant-form-item {
    display: flex;
    margin-bottom: 0px;
    min-height: 60px;
    .ant-form-explain {
      white-space: nowrap;
    }
  }
  .ant-form-item-control-wrapper {
    flex: 1;
    width: calc(100% - 100px);
  }
  .ant-form-item-label {
    text-overflow: ellipsis;
  }
  .daterange .ant-calendar-picker-input {
    padding: 4px 20px 4px 5px;
    font-size: 13px;
  }
  .ant-select-dropdown {
    z-index: 10 !important;
  }
  .ant-calendar-picker-container {
    z-index: 10 !important;
  }
  .group-required {
    label::before {
      display: inline-block;
      margin-right: 4px;
      color: #f5222d;
      font-size: 14px;
      font-family: SimSun, sans-serif;
      line-height: 1;
      content: '*';
    }
.page-message-wrap {
  .page-message {
    position: fixed;
    z-index: 2;
    bottom: 65px;
    right: 30px;
    width: 40px;
    height: 40px;
  }
}
.top-search.right {
  >.ant-row {
    >.ant-col {
      float: right;
.ant-modal.menu-tree-modal {
  top: 60px;
  .ant-modal-body {
    min-height: 300px;
    .menu-header {
      text-align: center;
      span {
        font-weight: 600;
        margin-right: 20px;
      }
      .ant-typography {
        font-weight: 600;
        display: inline-block;
      }
    }
    .ant-tree li .ant-tree-node-content-wrapper {
      cursor: default;
    }
  }
}
src/templates/comtableconfig/index.jsx
@@ -202,20 +202,37 @@
    })
  }
  getFuncNames = (data) => {
  getFuncNames = (config) => {
    let funcNames = []
    let tableNames = []
    data.forEach(item => {
      if (item.tableName) {
        tableNames.push(item.tableName)
      }
      if (item.innerFunc) {
        funcNames.push({func: item.innerFunc, label: item.label || ''})
    if (config.setting.tableName) {
      tableNames.push(config.setting.tableName)
    }
    if (config.setting.innerFunc) {
      funcNames.push({func: config.setting.innerFunc, label: config.MenuName || ''})
    }
    if (config.setting.outerFunc) {
      funcNames.push({func: config.setting.outerFunc, label: config.MenuName || ''})
    }
    config.action.forEach(item => {
      let tablename = item.OpenType === 'excelIn' ? (item.sheet || '') : (item.sql || '')
      if (item.OpenType === 'excelOut' && item.intertype === 'system') {
        tablename = config.setting.tableName || ''
      }
      if (item.callbackFunc) {
        funcNames.push({func: item.callbackFunc, label: item.label || ''})
      if (['pop', 'prompt', 'exec', 'excelIn', 'excelOut', 'funcbutton'].includes(item.OpenType)) {
        if (tablename) {
          tableNames.push(tablename)
        }
        if (item.innerFunc) {
          funcNames.push({func: item.innerFunc, label: item.label || ''})
        }
        if (item.callbackFunc) {
          funcNames.push({func: item.callbackFunc, label: item.label || ''})
        }
      }
    })
@@ -279,70 +296,6 @@
    if (vresult !== true) {
      _config.enabled = false
    }
    _config.funcs = [] // 页面及子页面存储过程集
    _config.funcs.push({
      type: 'view',
      subtype: 'view',
      uuid: menu.MenuID,
      intertype: _config.setting.interType || 'system',
      interface: _config.setting.interface || '',
      tableName: _config.setting.tableName || '',
      innerFunc: _config.setting.innerFunc || '',
      outerFunc: _config.setting.outerFunc || ''
    })
    _config.action.forEach(item => {
      let tablename = item.OpenType === 'excelIn' ? (item.sheet || '') : (item.sql || '')
      if (item.OpenType === 'excelOut' && item.intertype === 'system') {
        tablename = _config.setting.tableName || ''
      }
      if (item.OpenType === 'tab' || item.OpenType === 'blank') {
        _config.funcs.push({
          type: 'tab',
          subtype: 'btn',
          uuid: item.uuid,
          label: item.label,
          linkTab: item.uuid
        })
      } else if (item.OpenType === 'popview') {
        _config.funcs.push({
          type: 'tab',
          subtype: 'btn',
          uuid: item.uuid,
          label: item.label,
          linkTab: item.linkTab
        })
      } else if (['pop', 'prompt', 'exec', 'excelIn', 'excelOut'].includes(item.OpenType)) {
        _config.funcs.push({
          type: 'button',
          subtype: 'btn',
          uuid: item.uuid,
          label: item.label,
          tableName: tablename,
          intertype: item.intertype,
          interface: item.interface || '',
          innerFunc: item.innerFunc || '',
          outerFunc: item.outerFunc || '',
          callbackFunc: item.callbackFunc || ''
        })
      }
    })
    _config.tabgroups.forEach(group => {
      group.sublist.forEach(tab => {
        _config.funcs.push({
          type: 'tab',
          subtype: 'tab',
          uuid: tab.uuid,
          label: tab.label,
          linkTab: tab.linkTab
        })
      })
    })
    if (this.state.closeVisible) { // 显示关闭对话框时,模态框中保存按钮,显示保存中状态
      this.setState({
@@ -436,7 +389,7 @@
    tabParam.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
    tabParam.secretkey = Utils.encrypt(tabParam.LText, tabParam.timestamp)
    let _vals = this.getFuncNames(_config.funcs)
    let _vals = this.getFuncNames(_config)
    let param = {
      func: 'sPC_TrdMenu_AddUpt',
src/templates/sharecomponent/settingcomponent/settingform/index.scss
@@ -59,4 +59,7 @@
    border: 0;
    box-shadow: unset;
  }
  .ant-tabs-nav-wrap {
    text-align: center;
  }
}
src/templates/treepageconfig/index.jsx
@@ -164,30 +164,6 @@
    })
  }
  getFuncNames = (data, funcNames, tableNames) => {
    data.forEach(item => {
      // if (item.subfuncs) {
      //   this.getFuncNames(item.subfuncs, funcNames, tableNames)
      //   return
      // }
      if (item.tableName) {
        tableNames.push(item.tableName)
      }
      if (item.innerFunc) {
        funcNames.push({func: item.innerFunc, label: item.label || ''})
      }
      if (item.callbackFunc) {
        funcNames.push({func: item.callbackFunc, label: item.label || ''})
      }
    })
    return {
      func: funcNames,
      table: tableNames
    }
  }
  /**
   * @description 三级菜单保存
   */
@@ -231,31 +207,6 @@
      _config.enabled = false
    }
    _config.funcs = [] // 页面及子页面存储过程集
    _config.funcs.push({
      type: 'view',
      subtype: 'view',
      uuid: menu.MenuID,
      intertype: _config.setting.interType || 'inner',
      interface: _config.setting.interface || '',
      tableName: _config.setting.tableName || '',
      innerFunc: _config.setting.innerFunc || '',
      outerFunc: _config.setting.outerFunc || ''
    })
    _config.tabgroups.forEach(group => {
      group.sublist.forEach(tab => {
        _config.funcs.push({
          type: 'tab',
          subtype: 'tab',
          uuid: tab.uuid,
          label: tab.label,
          linkTab: tab.linkTab
        })
      })
    })
    if (this.state.closeVisible) { // 显示关闭对话框时,模态框中保存按钮,显示保存中状态
      this.setState({
        menucloseloading: true
@@ -266,258 +217,224 @@
      })
    }
    new Promise(resolve => {
      // let deffers = []
      // _config.funcs.forEach(item => {
      //   if (item.type === 'tab') {
      //     let deffer = new Promise(resolve => {
      //       Api.getSystemConfig({
      //         func: 'sPC_Get_LongParam',
      //         MenuID: item.linkTab
      //       }).then(result => {
      //         if (result.status && result.LongParam) {
      //           let _LongParam = ''
      //           if (result.LongParam) {
      //             try {
      //               _LongParam = JSON.parse(window.decodeURIComponent(window.atob(result.LongParam)))
      //             } catch (e) {
      //               console.warn('Parse Failure')
      //               _LongParam = ''
      //             }
      //           }
    // 保存时删除配置类型,system 、user
    delete _config.type
    delete _config.isAdd
    let _LongParam = ''
    try {
      _LongParam = window.btoa(window.encodeURIComponent(JSON.stringify(_config)))
    } catch (e) {
      notification.warning({
        top: 92,
        message: '编译错误',
        duration: 5
      })
      this.setState({
        menucloseloading: false,
        menuloading: false
      })
      return
    }
    let _sort = 0
    let btntabs = []
    
      //           if (_LongParam) {
      //             item.menuNo = _LongParam.tabNo || ''
      //             item.subfuncs = _LongParam.funcs || []
      //           }
      //         }
      //         resolve()
      //       })
      //     })
    let tabParam = { // 添加菜单tab页
      func: 'sPC_sMenusTab_AddUpt',
      MenuID: menu.MenuID
    }
      //     deffers.push(deffer)
      //   }
      // })
    let _LText = []
      // if (deffers.length === 0) {
      //   resolve()
      // } else {
      //   Promise.all(deffers).then(() => {
      //     resolve()
      //   })
      // }
      resolve()
    }).then(() => {
      // 保存时删除配置类型,system 、user
      delete _config.type
      delete _config.isAdd
      let _LongParam = ''
      try {
        _LongParam = window.btoa(window.encodeURIComponent(JSON.stringify(_config)))
      } catch (e) {
        notification.warning({
          top: 92,
          message: '编译错误',
          duration: 5
        })
        this.setState({
          menucloseloading: false,
          menuloading: false
        })
        return
      }
      let _sort = 0
      let btntabs = []
      let tabParam = { // 添加菜单tab页
        func: 'sPC_sMenusTab_AddUpt',
        MenuID: menu.MenuID
      }
      let _LText = []
      btntabs.forEach(item => {
        _LText.push(`select '${item.uuid}' as MenuID ,'${item.linkTab}' as Tabid,'${item.label}' as TabName ,'${item.sort * 10}' as Sort`)
    btntabs.forEach(item => {
      _LText.push(`select '${item.uuid}' as MenuID ,'${item.linkTab}' as Tabid,'${item.label}' as TabName ,'${item.sort * 10}' as Sort`)
    })
    _config.tabgroups.forEach(group => {
      group.sublist.forEach(item => {
        _sort++
        _LText.push(`select '${menu.MenuID}' as MenuID ,'${item.linkTab}' as Tabid,'${item.label}' as TabName ,'${_sort * 10}' as Sort`)
      })
      _config.tabgroups.forEach(group => {
        group.sublist.forEach(item => {
          _sort++
          _LText.push(`select '${menu.MenuID}' as MenuID ,'${item.linkTab}' as Tabid,'${item.label}' as TabName ,'${_sort * 10}' as Sort`)
        })
      })
    })
      _LText = _LText.join(' union all ')
    _LText = _LText.join(' union all ')
      tabParam.LText = Utils.formatOptions(_LText)
      tabParam.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
      tabParam.secretkey = Utils.encrypt(tabParam.LText, tabParam.timestamp)
    tabParam.LText = Utils.formatOptions(_LText)
    tabParam.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
    tabParam.secretkey = Utils.encrypt(tabParam.LText, tabParam.timestamp)
      let _vals = this.getFuncNames(_config.funcs, [], [])
      let _tables = Array.from(new Set(_vals.table))
    let _funcs = []
    let _tables = []
      let param = {
        func: 'sPC_TrdMenu_AddUpt',
        FstID: _config.fstMenuId,
        SndID: _config.ParentId,
        ParentID: _config.ParentId,
        MenuID: menu.MenuID,
        MenuNo: _config.MenuNo,
        EasyCode: _config.easyCode,
        Template: _config.Template,
        MenuName: _config.MenuName,
        PageParam: JSON.stringify({...menu.PageParam, Template: _config.Template, OpenType: _config.OpenType}),
        LongParam: _LongParam,
        LText: _vals.func.map(item => `select '${menu.MenuID}' as MenuID,'${item.func}' as ProcName,'${item.label}' as MenuName`),
        LTexttb: _tables.map(item => `select '${menu.MenuID}' as MenuID,'${item}' as tbName`)
      }
    if (_config.setting.tableName) {
      _tables.push(_config.setting.tableName)
    }
    if (_config.setting.innerFunc) {
      _funcs.push({func: _config.setting.innerFunc, label: _config.MenuName || ''})
    }
    if (_config.setting.outerFunc) {
      _funcs.push({func: _config.setting.outerFunc, label: _config.MenuName || ''})
    }
      if (menu.menuSort) { // 菜单新建时设置排序
        param.Sort = menu.menuSort
      }
    let param = {
      func: 'sPC_TrdMenu_AddUpt',
      FstID: _config.fstMenuId,
      SndID: _config.ParentId,
      ParentID: _config.ParentId,
      MenuID: menu.MenuID,
      MenuNo: _config.MenuNo,
      EasyCode: _config.easyCode,
      Template: _config.Template,
      MenuName: _config.MenuName,
      PageParam: JSON.stringify({...menu.PageParam, Template: _config.Template, OpenType: _config.OpenType}),
      LongParam: _LongParam,
      LText: _funcs.map(item => `select '${menu.MenuID}' as MenuID,'${item.func}' as ProcName,'${item.label}' as MenuName`),
      LTexttb: _tables.map(item => `select '${menu.MenuID}' as MenuID,'${item}' as tbName`)
    }
      param.LText = param.LText.join(' union all ')
      param.LText = Utils.formatOptions(param.LText)
      param.LTexttb = param.LTexttb.join(' union all ')
      param.LTexttb = Utils.formatOptions(param.LTexttb)
      param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
      param.secretkey = Utils.encrypt(param.LText, param.timestamp)
    if (menu.menuSort) { // 菜单新建时设置排序
      param.Sort = menu.menuSort
    }
      if (openEdition) { // 版本管理
        param.open_edition = openEdition
      }
    param.LText = param.LText.join(' union all ')
    param.LText = Utils.formatOptions(param.LText)
    param.LTexttb = param.LTexttb.join(' union all ')
    param.LTexttb = Utils.formatOptions(param.LTexttb)
    param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
    param.secretkey = Utils.encrypt(param.LText, param.timestamp)
      // 有按钮或标签删除时,先进行删除操作
      // 删除成功后,保存页面配置
      new Promise(resolve => {
        if (delTabs.length > 0) {
          let deffers = delTabs.map(item => {
            let _param = {
              func: 'sPC_MainMenu_Del',
              MenuID: item.uuid
            }
    if (openEdition) { // 版本管理
      param.open_edition = openEdition
    }
            return new Promise(resolve => {
              Api.getSystemConfig(_param).then(response => {
                resolve(response)
              })
    // 有按钮或标签删除时,先进行删除操作
    // 删除成功后,保存页面配置
    new Promise(resolve => {
      if (delTabs.length > 0) {
        let deffers = delTabs.map(item => {
          let _param = {
            func: 'sPC_MainMenu_Del',
            MenuID: item.uuid
          }
          return new Promise(resolve => {
            Api.getSystemConfig(_param).then(response => {
              resolve(response)
            })
          })
          Promise.all(deffers).then(result => {
            let error = null
            result.forEach(response => {
              if (!response.status) {
                error = response
              }
            })
            if (error) {
              this.setState({
                menuloading: false,
                menucloseloading: false
              })
              notification.warning({
                top: 92,
                message: error.message,
                duration: 5
              })
              resolve(false)
            } else {
              this.setState({
                delTabs: []
              })
              resolve(true)
        })
        Promise.all(deffers).then(result => {
          let error = null
          result.forEach(response => {
            if (!response.status) {
              error = response
            }
          })
        } else if (delTabs.length === 0) {
          resolve(true)
        }
      }).then(resp => {
        if (resp === false) return
        let localParam = fromJS(param).toJS()
        localParam.func = 'sPC_TrdMenu_AddUpt_For_Local'
        delete localParam.LongParam
        delete localParam.PageParam
        delete localParam.Template
        delete localParam.Sort
        delete localParam.EasyCode
        delete localParam.open_edition
        Api.getSystemConfig(param).then(response => {
          if (response.status) {
            this.setState({
              config: _config,
              openEdition: response.open_edition || '',
              originMenu: fromJS(_config).toJS()
            })
            // 存在标签页时
            if (tabParam.LText) {
              Api.getSystemConfig(tabParam).then(result => {
                if (result.status) {
                  notification.success({
                    top: 92,
                    message: '保存成功',
                    duration: 2
                  })
                  this.props.reloadmenu()
                  Api.getLocalConfig(localParam)
                  if (this.state.closeVisible) {
                    this.props.handleView()
                  } else {
                    this.setState({
                      menuloading: false,
                      menucloseloading: false
                    })
                  }
                } else {
                  notification.warning({
                    top: 92,
                    message: result.message,
                    duration: 5
                  })
                  this.setState({
                    menuloading: false,
                    menucloseloading: false
                  })
                }
              })
            } else {
              notification.success({
                top: 92,
                message: '保存成功',
                duration: 2
              })
              this.props.reloadmenu()
              Api.getLocalConfig(localParam)
              if (this.state.closeVisible) {
                this.props.handleView()
              } else {
                this.setState({
                  menuloading: false,
                  menucloseloading: false
                })
              }
            }
          } else {
          if (error) {
            this.setState({
              menuloading: false,
              menucloseloading: false
            })
            notification.warning({
              top: 92,
              message: response.message,
              message: error.message,
              duration: 5
            })
            resolve(false)
          } else {
            this.setState({
              delTabs: []
            })
            resolve(true)
          }
        })
      } else if (delTabs.length === 0) {
        resolve(true)
      }
    }).then(resp => {
      if (resp === false) return
      let localParam = fromJS(param).toJS()
      localParam.func = 'sPC_TrdMenu_AddUpt_For_Local'
      delete localParam.LongParam
      delete localParam.PageParam
      delete localParam.Template
      delete localParam.Sort
      delete localParam.EasyCode
      delete localParam.open_edition
      Api.getSystemConfig(param).then(response => {
        if (response.status) {
          this.setState({
            config: _config,
            openEdition: response.open_edition || '',
            originMenu: fromJS(_config).toJS()
          })
          // 存在标签页时
          if (tabParam.LText) {
            Api.getSystemConfig(tabParam).then(result => {
              if (result.status) {
                notification.success({
                  top: 92,
                  message: '保存成功',
                  duration: 2
                })
                this.props.reloadmenu()
                Api.getLocalConfig(localParam)
                if (this.state.closeVisible) {
                  this.props.handleView()
                } else {
                  this.setState({
                    menuloading: false,
                    menucloseloading: false
                  })
                }
              } else {
                notification.warning({
                  top: 92,
                  message: result.message,
                  duration: 5
                })
                this.setState({
                  menuloading: false,
                  menucloseloading: false
                })
              }
            })
          } else {
            notification.success({
              top: 92,
              message: '保存成功',
              duration: 2
            })
            this.props.reloadmenu()
            Api.getLocalConfig(localParam)
            if (this.state.closeVisible) {
              this.props.handleView()
            } else {
              this.setState({
                menuloading: false,
                menucloseloading: false
              })
            }
          }
        } else {
          this.setState({
            menuloading: false,
            menucloseloading: false
          })
          notification.warning({
            top: 92,
            message: response.message,
            duration: 5
          })
        }
      })
    })
  }