king
2020-11-13 8190d6e5ac14616d85e3992169ecef6d99d03b76
src/tabviews/commontable/index.jsx
@@ -2,27 +2,31 @@
import PropTypes from 'prop-types'
import {connect} from 'react-redux'
import { is, fromJS } from 'immutable'
import { notification, Spin, Tabs, Icon, Switch, Modal, Button, message, Tree, Typography, Col } from 'antd'
import moment from 'moment'
import { notification, Spin, Tabs, Icon, Switch, Modal, Button, message, Tree, Typography, Row, Col } 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'
import asyncLoadComponent from '@/utils/asyncLoadComponent'
import {refreshTabView, modifyTabview} from '@/store/action'
import UtilsDM from '@/utils/utils-datamanage.js'
import UtilsUpdate from '@/utils/utils-update.js'
import asyncComponent from '@/utils/asyncComponent'
import asyncSpinComponent from '@/utils/asyncSpinComponent'
import { refreshTabView } from '@/store/action'
import MKEmitter from '@/utils/events.js'
import ChartComponent from '@/tabviews/zshare/chartcomponent'
import MainTable from '@/tabviews/zshare/normalTable'
import MainSearch from '@/tabviews/zshare/topSearch'
import NotFount from '@/components/404'
import './index.scss'
const VerifyCard = asyncLoadComponent(() => import('@/tabviews/zshare/verifycard'))
const MainAction = asyncLoadComponent(() => import('@/tabviews/zshare/actionList'))
const SubTable = asyncLoadComponent(() => import('@/tabviews/subtable'))
const SubTabTable = asyncLoadComponent(() => import('@/tabviews/subtabtable'))
const FormTab = asyncLoadComponent(() => import('@/tabviews/formtab'))
// 通用组件
const MainAction = asyncSpinComponent(() => import('@/tabviews/zshare/actionList'))
const MainTable = asyncSpinComponent(() => import('@/tabviews/zshare/normalTable'))
const SettingComponent = asyncComponent(() => import('@/tabviews/zshare/settingcomponent'))
const SubTable = asyncSpinComponent(() => import('@/tabviews/subtable'))
const CardComponent = asyncSpinComponent(() => import('@/tabviews/zshare/cardcomponent'))
const ChartComponent = asyncSpinComponent(() => import('@/tabviews/zshare/chartcomponent'))
const { TabPane } = Tabs
const { TreeNode } = Tree
@@ -39,13 +43,12 @@
  state = {
    dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS,
    ContainerId: Utils.getuuid(), // 菜单外层html Id
    view: 'commontable',  // 当前页面默认为主表
    BID: null,            // 页面跳转时携带ID
    loadingview: true,    // 页面加载中
    viewlost: false,      // 页面丢失:1、未获取到配置-页面丢失;2、页面未启用
    lostmsg: '',          // 页面丢失时的提示信息
    config: {},           // 页面配置信息,包括按钮、搜索、显示列、标签等
    userConfig: null,     // 用户自定义设置
    userParam: null,      // 保存用户编辑中的配置
    searchlist: null,     // 搜索条件
    actions: null,        // 按钮集
    columns: null,        // 显示列
@@ -53,6 +56,7 @@
    arr_field: '',        // 使用 sPC_Get_TableData 时的查询字段集
    setting: null,        // 页面全局设置:数据源、按钮及显示列固定、主键等
    data: null,           // 列表数据集
    selectedData: [],     // 已选表格数据
    total: 0,             // 总数
    loading: false,       // 列表数据加载中
    pageIndex: 1,         // 页码
@@ -61,18 +65,12 @@
    search: '',           // 搜索条件数组,使用时需分场景处理
    BIDs: {},             // 上级表id
    pickup: false,        // 主表数据隐藏显示切换
    popAction: false,     // 弹框页面,按钮信息
    popData: false,       // 弹框页面,所选的表格数据
    visible: false,       // 弹框显示隐藏控制
    treevisible: false,   // 菜单结构树弹框显示隐藏控制
    tabBtn: null,         // 表单标签按钮
    tabParam: null,       // 表单标签参数
    refreshtabs: null,    // 需要刷新的标签集
    confirmLoading: false,// 自定义设置模态框加载中
    revertLoading: false, // 恢复默认设置
    settingVisible: false,// 自定义设置模态框
    triggerBtn: null,     // 点击表格中或快捷键触发的按钮
    tabActive: null       // 标签页展开控制
    tabActive: null,      // 标签页展开控制
    chartId: '',          // 展开图表ID
    statFields: [],       // 合计字段
    statFValue: []        // 合计值
  }
  /**
@@ -85,7 +83,7 @@
      func: 'sPC_Get_LongParam',
      MenuID: this.props.MenuID
    }
    let result = await Api.getSystemCacheConfig(_param)
    let result = await Api.getCacheConfig(_param)
    if (result.status) {
      let config = ''
@@ -99,7 +97,8 @@
        config = ''
      }
      
      if (result.LongParamUser) {
      // HS不使用自定义设置
      if (result.LongParamUser && this.props.menuType !== 'HS') {
        try { // 配置信息解析
          userConfig = JSON.parse(window.decodeURIComponent(window.atob(result.LongParamUser)))
          _curUserConfig = userConfig[this.props.MenuID]
@@ -128,47 +127,22 @@
        return
      }
      // 兼容标签
      if (!config.tabgroups) {
        config.tabgroups = [{ uuid: 'tabs', sublist: [] }]
      } else if (typeof(config.tabgroups[0]) === 'string') {
        let _tabgroups = []
        config.tabgroups.forEach(groupId => {
          let _group = {
            uuid: groupId,
            sublist: fromJS(config[groupId]).toJS()
          }
          delete config[groupId]
          _tabgroups.push(_group)
        })
        config.tabgroups = _tabgroups
      }
      // 兼容图表
      if (!config.charts) {
        config.expand = false
        config.charts = [{
          uuid: Utils.getuuid(),
          label: '',
          title: '',
          chartType: 'table',
          icon: 'table',
          Hide: 'false',
          blacklist: []
        }]
      }
      // 版本兼容
      config = UtilsUpdate.updateCommonTable(config)
      // 权限过滤
      config.action = config.action.filter(item => permAction[item.uuid])
      config.tabgroups.forEach(group => {
        group.sublist = group.sublist.filter(tab => permAction[tab.linkTab])
      })
      if (this.props.menuType !== 'HS') {
        config.action = config.action.filter(item => permAction[item.uuid])
        config.tabgroups.forEach(group => {
          group.sublist = group.sublist.filter(tab => permAction[tab.linkTab])
        })
      }
      // 去除空行标签
      config.tabgroups = config.tabgroups.filter(group => group.sublist.length > 0)
      // 视图权限
      config.charts = config.charts.filter(item => {
        if (item.Hide === 'true') return false
        if (!item.blacklist || item.blacklist.length === 0) return true
        let _black = item.blacklist.filter(v => {
@@ -185,35 +159,87 @@
      if (config.charts.length <= 1) {
        config.expand = true
      }
      let chartId = config.charts[0] ? config.charts[0].uuid : ''
      // 字段权限黑名单
      config.search = config.search.filter(item => {
        if (!item.blacklist || item.blacklist.length === 0) return true
      config.search = config.search.map(item => {
        item.oriInitval = item.initval
        if (['text', 'select', 'link'].includes(item.type) && param) {
          if (param.searchkey === item.field) {
            item.initval = param.searchval
          } else if (param.BID && item.field.toLowerCase() === 'bid') {
            item.initval = param.BID
          } else if (param.data && param.data[item.field]) {
            item.initval = param.data[item.field]
          }
        }
        if (!item.blacklist || item.blacklist.length === 0) return item
        let _black = item.blacklist.filter(v => {
          return this.props.permRoles.indexOf(v) !== -1
        })
        if (_black.length > 0) {
          return false
        } else {
          return true
          item.Hide = 'true'
        }
        return item
      })
      config.columns = config.columns.filter(col => {
        if (!col.field || !col.blacklist || col.blacklist.length === 0 || config.setting.primaryKey === col.field) return true
      config.columns = config.columns.map(col => {
        if (!col.field || !col.blacklist || col.blacklist.length === 0 || config.setting.primaryKey === col.field) return col
        let _black = col.blacklist.filter(v => {
          return this.props.permRoles.indexOf(v) !== -1
        })
        if (_black.length > 0) {
          return false
        } else {
          return true
          col.Hide = 'true'
        }
        return col
      })
      // 标记主页面,用于按钮固定及表单挂载设置
      config.setting.tabType = 'main'
      // 数据源信息预处理
      config.setting.laypage = config.setting.laypage !== 'false'     // 是否分页,转为boolean 统一格式
      config.setting.execute = config.setting.default !== 'false'     // 默认sql是否执行,转为boolean 统一格式
      config.setting.customScript = ''                                // 自定义脚本
      if (config.setting.interType === 'system') {
        if (config.setting.scripts && config.setting.scripts.length > 0) {
          let _customScript = ''
          config.setting.scripts.forEach(item => {
            if (item.status === 'false') return
            _customScript += `
              ${item.sql}
            `
          })
          config.setting.customScript = _customScript
        }
        if (!config.setting.execute) { // 默认sql 不执行时 置空
          config.setting.dataresource = ''
        } else {
          config.setting.dataresource = config.setting.dataresource || ''
        }
        if (/\s/.test(config.setting.dataresource)) {
          config.setting.dataresource = '(' + config.setting.dataresource + ') tb'
        }
        if (this.props.dataManager) { // 数据权限
          config.setting.dataresource = config.setting.dataresource.replace(/\$@/ig, '/*')
          config.setting.dataresource = config.setting.dataresource.replace(/@\$/ig, '*/')
          config.setting.customScript = config.setting.customScript.replace(/\$@/ig, '/*')
          config.setting.customScript = config.setting.customScript.replace(/@\$/ig, '*/')
        } else {
          config.setting.dataresource = config.setting.dataresource.replace(/@\$|\$@/ig, '')
          config.setting.customScript = config.setting.customScript.replace(/@\$|\$@/ig, '')
        }
      }
      if (_curUserConfig) {
        config.setting = {...config.setting, ..._curUserConfig.setting}
@@ -247,7 +273,6 @@
      let _tabActive = {} // 筛选展开的tab页
      config.tabgroups.forEach(group => {
        if (group.sublist.length === 0) return
        _tabActive[group.uuid] = group.sublist[0].uuid
      })
@@ -256,6 +281,7 @@
      let _logcolumns = []   // 日志显示列
      let _hideCol = []      // 隐藏及合并列中字段的uuid集
      let colMap = new Map() // 用于字段过滤
      let statFields = []    // 合计字段信息
      let _actions = []      // 工具栏按钮
      let _operations = []   // 操作列按钮(存在时)
@@ -276,8 +302,12 @@
      config.columns.forEach(col => {
        if (col.field) {
          _arrField.push(col.field)
          _logcolumns.push(col)
          col.nameField && _arrField.push(col.nameField) // 链接名字段
          if (col.Hide !== 'true' && col.type === 'number' && col.sum === 'true') {
            statFields.push(col)
          }
        }
        if (col.type === 'colspan' && col.sublist) { // 筛选隐藏列
          _hideCol = _hideCol.concat(col.sublist)
@@ -298,7 +328,7 @@
        col.sort = index
        if (col.type === 'colspan' && col.sublist) {
          let _col = JSON.parse(JSON.stringify(col))
          let _col = fromJS(col).toJS()
          let subColumn = []
          _col.sublist.forEach(sub => {
            if (colMap.has(sub)) {
@@ -311,20 +341,15 @@
          _columns.push(col)
        }
      })
      if (config.gridBtn && config.gridBtn.display && _operations.length > 0) {
        _columns.push({
          ...config.gridBtn,
          operations: _operations
        })
        config.gridBtn.operations = _operations
        _columns.push(config.gridBtn)
      }
      let valid = true // 搜索条件必填验证, 初始搜索条件
      let valid = true // 搜索条件必填验证, 初始搜索条件, 如通过上级透视,写入搜索条件
      let initSearch = config.search.map(item => {
        let _item = JSON.parse(JSON.stringify(item))
        if (_item.type === 'text' && param && param.searchkey === _item.field) {
          _item.initval = param.searchval
        }
        let _item = fromJS(item).toJS()
        if (_item.required === 'true' && !_item.initval) {
          valid = false
@@ -348,8 +373,11 @@
      }
      this.setState({
        BID: param && param.BID ? param.BID : '',
        loadingview: false,
        chartId: chartId,
        config: config,
        statFields: statFields,
        tabActive: _tabActive,
        userConfig: userConfig,
        setting: config.setting,
@@ -360,9 +388,9 @@
        arr_field: _arrField.join(','),
        search: Utils.initMainSearch(initSearch) // 搜索条件初始化(含有时间格式,需要转化)
      }, () => {
        this.improveSearch()
        if (config.setting.onload !== 'false' && valid) { // 初始化可加载
          this.loadmaindata()
          this.getStatFieldsValue()
        }
        this.setShortcut()
      })
@@ -398,176 +426,77 @@
      if (!preKey) return
      let istrigger = false
      let triggerId = ''
      actions.forEach(item => {
        if (!item.shortcut || typeof(item.shortcut) !== 'object' || item.shortcut.length === 0 || istrigger) return
        if (preKey === item.shortcut[0] && keyCode === item.shortcut[1]) {
      actions.some(item => {
        if (Array.isArray(item.shortcut) && preKey === item.shortcut[0] && keyCode === item.shortcut[1]) {
          e.preventDefault()
          istrigger = true
          this.setState({
            triggerBtn: {
              uuid: new Date().getTime(),
              parentId: this.props.MenuID,
              button: item,
              data: null
            }
          })
          triggerId = item.uuid
          return true
        }
        return false
      })
      if (istrigger) return
      if (triggerId) {
        MKEmitter.emit('triggerBtnId', triggerId)
        return
      }
      Object.keys(userConfig).forEach(key => {
        if (key === this.props.MenuID || !userConfig[key].action || istrigger) return
      Object.keys(userConfig).some(key => {
        if (key === this.props.MenuID || !userConfig[key].action) return false
        let _actions = userConfig[key].action
        Object.keys(_actions).forEach(btnkey => {
        Object.keys(_actions).some(btnkey => {
          let item = _actions[btnkey]
          if (!item.shortcut || typeof(item.shortcut) !== 'object' || item.shortcut.length === 0 || istrigger) return
          if (preKey === item.shortcut[0] && keyCode === item.shortcut[1]) {
          if (Array.isArray(item.shortcut) && preKey === item.shortcut[0] && keyCode === item.shortcut[1]) {
            e.preventDefault()
            istrigger = true
            triggerId = btnkey
            let _groupId = ''
            let _ActiveTabId = ''
            config.tabgroups.forEach(group => {
              if (group.sublist.length === 0) return
              let _tab = group.sublist.filter(tab => tab.uuid === key)[0]
              if (_tab) {
                _groupId = group.uuid
                _ActiveTabId = _tab.uuid
              }
              if (!_tab) return
              _groupId = group.uuid
              _ActiveTabId = _tab.uuid
            })
            if (this.state.tabActive[_groupId] === _ActiveTabId) {
              this.setState({
                triggerBtn: {
                  uuid: new Date().getTime(),
                  parentId: key,
                  button: {...item, uuid: btnkey},
                  data: null
                }
              })
            } else {
              this.setState({
                tabActive: {...this.state.tabActive, [_groupId]: _ActiveTabId}
              }, () => {
                this.setState({
                  triggerBtn: {
                    uuid: new Date().getTime(),
                    parentId: key,
                    button: {...item, uuid: btnkey},
                    data: null
                  }
                })
              })
            }
            this.setState({
              tabActive: {...this.state.tabActive, [_groupId]: _ActiveTabId}
            }, () => {
              MKEmitter.emit('triggerBtnId', triggerId)
            })
            return true
          }
          return false
        })
        if (triggerId) return true
        return false
      })
    }
  }
  /**
   * @description 搜索条件下拉选项预加载
   */
  improveSearch = () => {
    let searchlist = JSON.parse(JSON.stringify(this.state.searchlist))
    let deffers = []
    searchlist.forEach(item => {
      if (item.type !== 'multiselect' && item.type !== 'select' && item.type !== 'link') return
      if (item.setAll === 'true') {
        item.options.unshift({
          key: Utils.getuuid(),
          Value: '',
          Text: this.state.dict['main.all']
        })
      }
      if (item.resourceType === '1' && item.dataSource) {
        let _option = Utils.getSelectQueryOptions(item)
        let _sql = Utils.formatOptions(_option.sql)
        let isSSO = item.database === 'sso'
        let param = {
          func: 'sPC_Get_SelectedList',
          LText: _sql,
          obj_name: 'data',
          arr_field: _option.field
        }
        param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000'
        param.secretkey = Utils.encrypt(param.LText, param.timestamp)
        let defer = new Promise(resolve => {
          Api.getSystemCacheConfig(param, isSSO).then(res => {
            res.search = item
            resolve(res)
          })
        })
        deffers.push(defer)
      } else if (item.resourceType === '1' && !item.dataSource) {
        notification.warning({
          top: 92,
          message: item.label + ': ' + this.state.dict['main.datasource.settingerror'],
          duration: 5
        })
      }
    })
    if (deffers.length === 0) {
      this.setState({searchlist: JSON.parse(JSON.stringify(searchlist))})
      return
    }
    Promise.all(deffers).then(result => {
      result.forEach(res => {
        if (res.status) {
          searchlist = searchlist.map(item => {
            if (item.uuid === res.search.uuid) {
              res.data.forEach(cell => {
                let _item = {
                  key: Utils.getuuid(),
                  Value: cell[res.search.valueField],
                  Text: cell[res.search.valueText]
                }
                if (res.search.type === 'link') {
                  _item.parentId = cell[res.search.linkField]
                }
                item.options.push(_item)
              })
            }
            return item
          })
        } else {
          notification.warning({
            top: 92,
            message: res.search.label + ':' + res.message,
            duration: 5
          })
        }
      })
      this.setState({searchlist})
    })
  }
  /**
   * @description 主表数据加载
   */ 
  async loadmaindata () {
    const { setting, BIDs, search } = this.state
    let param = ''
    const { setting, arr_field, BIDs, search, orderBy, BID, pageIndex, pageSize } = this.state
    let requireFields = search.filter(item => item.required && (!item.value || item.value.length === 0))
    this.setState({
      selectedData: [],
      BIDs: {
        ...BIDs,
        mainTable: '',
        mainTabledata: ''
      }
    })
    if (requireFields.length > 0) {
      let labels = requireFields.map(item => item.label)
@@ -585,16 +514,11 @@
      loading: true
    })
    if (setting.interType !== 'inner' || (setting.interType === 'inner' && setting.innerFunc)) {
      param = this.getCustomParam()
    } else {
      param = this.getDefaultParam()
    }
    let _orderBy = orderBy || setting.order
    let param = UtilsDM.getQueryDataParams(setting, arr_field, search, _orderBy, pageIndex, pageSize, BID, this.props.menuType, this.props.dataManager)
    this.handleTableId('mainTable', '', '')
    if (!param) { // 未获取参数时,不发请求
      return
    if (param.func === 'sPC_Get_TableData') {
      param.menuname = this.props.MenuName || ''
    }
    let result = await Api.genericInterface(param)
@@ -606,11 +530,7 @@
        }),
        total: result.total,
        loading: false,
        pickup: false,
        BIDs: {
          ...BIDs,
          mainTable: ''
        }
        pickup: false
      })
    } else {
      this.setState({
@@ -625,129 +545,56 @@
  }
  /**
   * @description 获取用户自定义存储过程传参
   * @description 获取合计字段值
   */
  getCustomParam = () => {
    const { pageIndex, pageSize, orderBy, search, setting } = this.state
  getStatFieldsValue = () => {
    const { setting, search, BID, orderBy, statFields } = this.state
    let _search = Utils.formatCustomMainSearch(search)
    if (statFields.length === 0 || setting.interType !== 'system' || !setting.dataresource) return
    let param = {
      OrderCol: orderBy || setting.order,
      ..._search
    let requireFields = search.filter(item => item.required && (!item.value || item.value.length === 0))
    if (requireFields.length > 0) {
      return
    }
    if (setting.laypage !== 'false') {
      param.PageIndex = pageIndex
      param.PageSize = pageSize
    }
    if (setting.interType === 'inner') {
      param.func = setting.innerFunc
    } else {
      if (setting.sysInterface === 'true' && window.GLOB.mainSystemApi) {
        param.rduri = window.GLOB.mainSystemApi
      } else if (setting.sysInterface !== 'true') {
        param.rduri = setting.interface
      }
      if (setting.outerFunc) {
        param.func = setting.outerFunc
      }
    }
    return param
  }
  /**
   * @description 获取系统存储过程 sPC_Get_TableData 的参数
   */
  getDefaultParam = () => {
    const { arr_field, pageIndex, pageSize, orderBy, search, setting } = this.state
    if (!arr_field) {
      notification.warning({
        top: 92,
        message: '未设置显示列!',
        duration: 5
      })
      return null
    }
    let _search = Utils.joinMainSearchkey(search)
    _search = _search ? 'where ' + _search : ''
    let param = {
      func: 'sPC_Get_TableData',
      obj_name: 'data',
      arr_field: arr_field,
      custom_script: setting.customScript || '',
      default_sql: setting.default || 'true'
    }
    let _orderBy = orderBy || setting.order
    let _dataresource = setting.dataresource
    let param = UtilsDM.getStatQueryDataParams(setting, statFields, search, _orderBy, BID, this.props.menuType, this.props.dataManager)
    if (/\s/.test(_dataresource)) {
      _dataresource = '(' + _dataresource + ') tb'
    if (param.func === 'sPC_Get_TableData') {
      param.menuname = this.props.MenuName || ''
    }
    let regoptions = null
    if (setting.queryType === 'statistics' || param.custom_script) {
      let allSearch = Utils.getAllSearchOptions(search)
    Api.genericInterface(param).then(res => {
      if (res.status) {
        let _data = res.data[0]
        let values = []
      regoptions = allSearch.map(item => {
        return {
          reg: new RegExp('@' + item.key + '@', 'ig'),
          value: `'${item.value}'`
        if (_data) {
          statFields.forEach(item => {
            if (_data[item.field] || _data[item.field] === 0) {
              let val = +_data[item.field]
              if (isNaN(val)) {
                val = 0
              }
              val = val.toFixed(item.decimal)
              values.push({label: item.label, value: val})
            }
          })
        }
      })
    }
    if (setting.queryType === 'statistics') { // 统计数据源,内容替换
      regoptions.forEach(item => {
        _dataresource = _dataresource.replace(item.reg, item.value)
      })
      _search = ''
    }
    let LText = `select top ${pageSize} ${arr_field} from (select ${arr_field} ,ROW_NUMBER() over(order by ${_orderBy}) as rows from ${_dataresource} ${_search}) tmptable where rows > ${pageSize * (pageIndex - 1)} order by tmptable.rows`
    let DateCount = `select count(1) as total from ${_dataresource} ${_search}`
    if (setting.laypage === 'false') {
      LText = `select ${arr_field} from (select ${arr_field} ,ROW_NUMBER() over(order by ${_orderBy}) as rows from ${_dataresource} ${_search}) tmptable order by tmptable.rows`
      DateCount = ''
    }
    if (param.custom_script) {
      regoptions.push({
        reg: new RegExp('@orderBy@', 'ig'),
        value: _orderBy
      })
      if (setting.laypage !== 'false') {
        regoptions.push({
          reg: new RegExp('@pageSize@', 'ig'),
          value: pageSize
        }, {
          reg: new RegExp('@pageIndex@', 'ig'),
          value: pageIndex
        this.setState({
          statFValue: values
        })
      } else {
        this.setState({
          statFValue: []
        })
        notification.error({
          top: 92,
          message: res.message,
          duration: 10
        })
      }
      regoptions.forEach(item => {
        param.custom_script = param.custom_script.replace(item.reg, item.value)
      })
      param.custom_script = Utils.formatOptions(param.custom_script)
    }
    param.LText = Utils.formatOptions(LText)
    param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000'
    param.secretkey = Utils.encrypt(param.LText, param.timestamp)
    param.DateCount = Utils.formatOptions(DateCount)
    return param
    })
  }
  /**
@@ -764,15 +611,16 @@
        setting: {...setting, onload: 'true'}
      }, () => {
        this.loadmaindata()
        this.getStatFieldsValue()
      })
    } else {
      this.refs.mainTable.resetTable()
      MKEmitter.emit('resetTable', this.props.MenuID + 'mainTable') // 列表重置
      this.setState({
        pageIndex: 1,
        search: searches
      }, () => {
        this.loadmaindata()
        this.getStatFieldsValue()
      })
    }
  }
@@ -802,11 +650,12 @@
   * @description 表格刷新
   */
  reloadtable = () => {
    this.refs.mainTable.resetTable()
    MKEmitter.emit('resetTable', this.props.MenuID + 'mainTable') // 列表重置
    this.setState({
      pageIndex: 1
    }, () => {
      this.loadmaindata()
      this.getStatFieldsValue()
    })
  }
@@ -814,28 +663,9 @@
   * @description 页面刷新,重新获取配置
   */
  reloadview = () => {
    this.setState({
      view: 'commontable',
      loadingview: true,
      viewlost: false,
      lostmsg: '',
      config: {},
      userConfig: null,
      userParam: null,
      searchlist: null,
      actions: null,
      columns: null,
      arr_field: '',
      setting: null,
      data: null,
      total: 0,
      loading: false,
      pageIndex: 1,
      pageSize: 10,
      orderBy: '',
      search: '',
      BIDs: {},
      pickup: false
    this.setState({ loadingview: true, viewlost: false, lostmsg: '',
      data: null, total: 0, loading: false, pageIndex: 1,
      pageSize: 10, orderBy: '', search: '', BIDs: {}, pickup: false
    }, () => {
      this.loadconfig()
    })
@@ -844,37 +674,12 @@
  /**
   * @description 按钮操作完成后(成功或失败),页面刷新,重置页码及选择项
   */
  refreshbyaction = (btn, type) => {
    if (btn.execSuccess === 'grid' && type === 'success') {
  refreshbyaction = (position) => {
    if (position === 'grid') {
      this.reloadtable()
    } else if (btn.execError === 'grid' && type === 'error') {
      this.reloadtable()
    } else if (btn.execSuccess === 'view' && type === 'success') {
    } else if (position === 'view') {
      this.reloadview()
    } else if (btn.execError === 'view' && type === 'error') {
      this.reloadview()
    } else if (btn.popClose === 'view' && type === 'pop') {
      this.reloadview()
    } else if (btn.popClose === 'grid' && type === 'pop') {
      this.reloadtable()
    }
  }
  /**
   * @description 表单操作完成后刷新主页面
   */
  refreshbyformtab = (type) => {
    this.setState({
      view: 'commontable',
      tabBtn: null,
      tabParam: null
    }, () => {
      if (type === 'grid') {
        this.reloadtable()
      } else if (type === 'view') {
        this.reloadview()
      }
    })
  }
  /**
@@ -883,9 +688,11 @@
  handleMainTable = (type, tab) => {
    if (type === 'maingrid' && tab.supMenu === 'mainTable') {
      this.reloadtable()
    } else if (type === 'maingrid' && tab.supMenu) {
    } else if (type === 'mainline' && tab.supMenu === 'mainTable') {
      this.reloadtable()
    } else if ((type === 'maingrid' || type === 'mainline') && tab.supMenu) {
      this.setState({
        refreshtabs: [tab.supMenu]
        refreshtabs: [type, tab.supMenu]
      }, () => {
        this.setState({
          refreshtabs: null
@@ -918,28 +725,10 @@
  }
  /**
   * @description 获取表格选择项
   * @description 表格选择项切换
   */
  gettableselected = () => {
    let data = []
    this.refs.mainTable.state.selectedRowKeys.forEach(item => {
      data.push(this.refs.mainTable.props.data[item])
    })
    return data
  }
  /**
   * @description 表格中,按钮触发事件传递
   */
  buttonTrigger = (btn, record) => {
    this.setState({
      triggerBtn: {
        uuid: new Date().getTime(),
        parentId: this.props.MenuID,
        button: btn,
        data: record
      }
    })
  changeSelectedData = (selectedData) => {
    this.setState({selectedData})
  }
  /**
@@ -965,84 +754,6 @@
    this.setState({
      pickup: !pickup
    })
  }
  /**
   * @description 触发按钮弹窗(标签页)
   */
  triggerPopview = (btn, data) => {
    const { setting } = this.state
    let _primaryId = ''
    if (data && data[0] && setting.primaryKey) {
      _primaryId = data[0][setting.primaryKey] || ''
    }
    if (btn.OpenType === 'popview') {
      this.setState({
        popAction: btn,
        popData: data[0] || null,
        visible: true
      })
    } else if (btn.OpenType === 'tab') {
      const { tabviews, MenuNo, MenuID } = this.props
      let newtab = {
        MenuNo: MenuNo,
        MenuID: btn.uuid,
        MenuName: btn.label,
        type: btn.tabTemplate,
        selected: true,
        param: {
          menuType: 'main',
          parentId: this.props.MenuID,
          btn: btn,
          data: data[0] || null,
          primaryId: btn.Ot !== 'notRequired' ? _primaryId : '',
          arr_field: this.state.arr_field
        }
      }
      let index = 0
      let isexit = false
      let tabs = tabviews.map((tab, i) => {
        tab.selected = false
        if (tab.MenuID === MenuID) {
          index = i
        } else if (tab.MenuID === btn.uuid) {
          tab.selected = true
          isexit = true
        }
        return tab
      })
      if (!isexit) {
        tabs.splice(index + 1, 0, newtab)
      }
      this.props.modifyTabview(tabs)
    } else if (btn.OpenType === 'blank') {
      this.setState({
        view: 'formtab',
        tabBtn: btn,
        tabParam: {
          menuType: 'main',
          btn: btn,
          data: data[0] || null,
          primaryId: btn.Ot !== 'notRequired' ? _primaryId : '',
          arr_field: this.state.arr_field
        }
      })
    }
  }
  popclose = () => {
    this.setState({
      visible: false
    })
    this.refreshbyaction(this.state.popAction, 'pop')
  }
  handleviewconfig = (e) => {
@@ -1104,125 +815,11 @@
    })
  }
  controlCustomSetting = () => {
    this.setState({
      settingVisible: true,
      confirmLoading: false,
      revertLoading: false
    })
  }
  changeMenuParam = (param) => {
    this.setState({userParam: param})
  }
  linkTrigger = (menu) => {
    const { tabviews, MenuID } = this.props
    menu.selected = true
    let index = 0
    let isexit = false
    let tabs = tabviews.map((tab, i) => {
      tab.selected = false
      if (tab.MenuID === MenuID) {
        index = i
      } else if (tab.MenuID === menu.MenuID) {
        tab.param = menu.param
        tab.selected = true
        isexit = true
      }
      return tab
    })
    if (!isexit) {
      tabs.splice(index + 1, 0, menu)
    }
    this.props.modifyTabview(tabs)
  }
  settingRevert = () => {
    let param = {
      func: 's_TrdMenu_UserParam_del',
      MenuID: this.props.MenuID
    }
    this.setState({
      revertLoading: true
    })
    Api.getSystemConfig(param).then(result => {
      if (!result.status) {
        this.setState({
          revertLoading: false
        })
        notification.warning({
          top: 92,
          message: result.message,
          duration: 5
        })
        return
      }
      this.setState({
        settingVisible: false,
        revertLoading: false
      }, () => {
        window.GLOB.CacheMap = new Map()
        this.reloadview()
      })
    })
  }
  settingSubmit = () => {
    const { userParam } = this.state
    let _LongParam = ''
    try {
      _LongParam = window.btoa(window.encodeURIComponent(JSON.stringify(userParam)))
    } catch (e) {
      notification.warning({
        top: 92,
        message: '编译错误',
        duration: 5
      })
      return
    }
    let easyCode = userParam[this.props.MenuID] ? userParam[this.props.MenuID].easyCode : ''
    let param = {
      func: 'sPC_TrdMenu_UserParam',
      MenuID: this.props.MenuID,
      EasyCode: easyCode || '',
      LongParam: _LongParam
    }
    this.setState({
      confirmLoading: true
    })
    Api.getSystemConfig(param).then(result => {
      if (!result.status) {
        this.setState({
          confirmLoading: false
        })
        notification.warning({
          top: 92,
          message: result.message,
          duration: 5
        })
        return
      }
      this.setState({
        settingVisible: false,
        confirmLoading: false
      }, () => {
        window.GLOB.CacheMap = new Map()
        this.reloadview()
      })
    })
  /**
   * @description 图表视图切换
   */
  changeChart = (uuid) => {
    this.setState({chartId: uuid})
  }
  UNSAFE_componentWillMount () {
@@ -1232,11 +829,7 @@
  UNSAFE_componentWillReceiveProps(nextProps) {
    if (nextProps.refreshTab && nextProps.refreshTab.MenuID === this.props.MenuID) {
      if (nextProps.refreshTab.position === 'grid') {
        this.reloadtable()
      } else if (nextProps.refreshTab.position === 'view') {
        this.reloadview()
      }
      this.reloadview()
      this.props.refreshTabView('')
    } else if (!is(fromJS(this.props.tabviews), fromJS(nextProps.tabviews))) {
      let selectTab = nextProps.tabviews.filter(tab => tab.selected)[0]
@@ -1248,7 +841,6 @@
        if (item.type === 'text' && item.key === nextProps.param.searchkey) {
          item.value = nextProps.param.searchval
        }
        return item
      })
      this.refreshbysearch(search)
@@ -1270,265 +862,185 @@
  }
  render() {
    const { view, setting, searchlist, actions, columns, loadingview, viewlost, pickup, config, triggerBtn, userConfig, tabActive, search } = this.state
    const { menuType, MenuName } = this.props
    const { BID, setting, searchlist, pageSize, actions, columns, loadingview, viewlost, pickup, config, userConfig, tabActive, chartId, search, selectedData } = this.state
    return (
      <div>
        {view === 'commontable' ? <div className="commontable pick-control" id={this.state.ContainerId}>
          {loadingview && <Spin size="large" />}
          {searchlist && searchlist.length > 0 ?
            <MainSearch
              ref="mainSearch"
              dict={this.state.dict}
              searchlist={searchlist}
              refreshdata={this.refreshbysearch}
            /> : null
          }
          {setting && setting.onload !== 'false' ? <div className="chart-view">
            {/* 视图组 */}
            {!config.expand ? <Tabs>
              {config.charts.map(item => (
                <TabPane tab={
                  <Icon type={item.icon} />
                } key={item.uuid}>
                  {item.chartType === 'table' ?
                    <Col span={item.width || 24} key={item.uuid}>
                      {config.charts.length > 1 ? <p className="chart-table chart-title">{item.title}</p> : null}
                      <div style={{minHeight: '25px'}}>
                        <MainAction
                          BID=""
                          type="main"
                          menuType="main"
                          setting={setting}
                          actions={actions}
                          triggerBtn={triggerBtn}
                          dict={this.state.dict}
                          MenuID={this.props.MenuID}
                          permRoles={this.props.permRoles}
                          logcolumns={this.state.logcolumns}
                          ContainerId={this.state.ContainerId}
                          refreshdata={this.refreshbyaction}
                          triggerPopview={this.triggerPopview}
                          getexceloutparam={this.getexceloutparam}
                          gettableselected={this.gettableselected}
                        />
                      </div>
                      <div className="main-table-box">
                        <Icon className="custom-control" type="setting" onClick={this.controlCustomSetting} />
                        {this.state.data && this.state.data.length > 0 ?
                          <Switch title="收起" className="main-pickup" checkedChildren="开" unCheckedChildren="关" defaultChecked={pickup} onChange={this.pickupChange} /> : null
                        }
                        <MainTable
                          ref="mainTable"
                          tableId="mainTable"
                          pickup={pickup}
                          setting={setting}
                          columns={columns}
                          dict={this.state.dict}
                          data={this.state.data}
                          total={this.state.total}
                          MenuID={this.props.MenuID}
                          loading={this.state.loading}
                          pagination={setting.laypage !== 'false'}
                          refreshdata={this.refreshbytable}
                          buttonTrigger={this.buttonTrigger}
                          linkTrigger={this.linkTrigger}
                          handleTableId={this.handleTableId}
                        />
                      </div>
                    </Col> : null
                  }
                  {item.chartType !== 'table' ?
                    <Col span={item.width} key={item.uuid}>
                      <ChartComponent
                        plot={item}
                        data={this.state.data}
                        config={config}
                      />
                    </Col> : null
                  }
                </TabPane>
              ))}
            </Tabs> : null}
            {config.expand && config.charts.map(item => {
              if (item.chartType === 'table') {
                return (
                  <Col span={item.width || 24} key={item.uuid}>
                    {config.charts.length > 1 && item.title ? <p className="chart-table chart-title">{item.title}</p> : null}
                    <div style={{minHeight: '25px'}}>
                      <MainAction
                        BID=""
                        type="main"
                        menuType="main"
                        setting={setting}
                        actions={actions}
                        triggerBtn={triggerBtn}
                        dict={this.state.dict}
                        MenuID={this.props.MenuID}
                        permRoles={this.props.permRoles}
                        logcolumns={this.state.logcolumns}
                        ContainerId={this.state.ContainerId}
                        refreshdata={this.refreshbyaction}
                        triggerPopview={this.triggerPopview}
                        getexceloutparam={this.getexceloutparam}
                        gettableselected={this.gettableselected}
                      />
                    </div>
                    <div className="main-table-box">
                      <Icon className="custom-control" type="setting" onClick={this.controlCustomSetting} />
                      {this.state.data && this.state.data.length > 0 ?
                        <Switch title="收起" className="main-pickup" checkedChildren="开" unCheckedChildren="关" defaultChecked={pickup} onChange={this.pickupChange} /> : null
                      }
                      <MainTable
                        ref="mainTable"
                        tableId="mainTable"
                        pickup={pickup}
                        setting={setting}
                        columns={columns}
                        dict={this.state.dict}
                        data={this.state.data}
                        total={this.state.total}
                        MenuID={this.props.MenuID}
                        loading={this.state.loading}
                        pagination={setting.laypage !== 'false'}
                        refreshdata={this.refreshbytable}
                        buttonTrigger={this.buttonTrigger}
                        linkTrigger={this.linkTrigger}
                        handleTableId={this.handleTableId}
                      />
                    </div>
                  </Col>
                )
              } else {
                return (
                  <Col span={item.width} key={item.uuid}>
                    <ChartComponent
                      plot={item}
                      data={this.state.data}
                      config={config}
                    />
                  </Col>
                )
              }
            })}
          </div> : null }
          {setting && setting.onload !== 'false' &&
            config.tabgroups.map(group => {
              if (group.sublist.length === 0) return null
      <div className="commontable" id={this.state.ContainerId}>
        {loadingview && <Spin size="large" />}
        {searchlist && searchlist.length > 0 ?
          <MainSearch
            BID={BID}
            dict={this.state.dict}
            searchlist={searchlist}
            menuType={this.props.menuType}
            dataManager={this.props.dataManager}
            refreshdata={this.refreshbysearch}
          /> : null
        }
        {setting && setting.onload !== 'false' ? <Row className="chart-view" gutter={16}>
          {/* 视图组 */}
          {!config.expand ? <Tabs activeKey={chartId} onChange={this.changeChart}>
            {config.charts.map(item => (
              <TabPane tab={<Icon type={item.icon} />} key={item.uuid}></TabPane>
            ))}
          </Tabs> : null}
          {config.charts.map(item => {
            if (!config.expand && chartId !== item.uuid) return null
            if (item.chartType === 'table') {
              return (
                <Tabs activeKey={tabActive[group.uuid]} key={group.uuid} onChange={(key) => this.setState({tabActive: {...tabActive, [group.uuid]: key}})}>
                  {group.sublist.map(_tab => {
                    return (
                      <TabPane tab={
                        <span>
                          {_tab.icon ? <Icon type={_tab.icon} /> : null}
                          {_tab.label}
                        </span>
                      } key={_tab.uuid}>
                        {_tab.type === 'SubTable' ?
                          <SubTable
                            Tab={_tab}
                            menuType="main"
                            MenuID={_tab.linkTab}
                            mainSearch={_tab.searchPass === 'true' ? search : null}
                            userConfig={userConfig ? userConfig[_tab.uuid] : null}
                            triggerBtn={triggerBtn}
                            SupMenuID={this.props.MenuID}
                            refreshtabs={this.state.refreshtabs}
                            ContainerId={this.state.ContainerId}
                            BID={this.state.BIDs[_tab.supMenu] || ''}
                            BData={this.state.BIDs[_tab.supMenu + 'data'] || ''}
                            handleTableId={this.handleTableId}
                            handleMainTable={(type) => this.handleMainTable(type, _tab)}
                          /> : null}
                      </TabPane>
                    )
                  })}
                </Tabs>
                <Col span={item.width || 24} key={item.uuid}>
                  {config.charts.length > 1 && item.title ? <p className="chart-table chart-title">{item.title}</p> : null}
                  <div className="commontable-main-action">
                    <MainAction
                      BID={BID}
                      setting={setting}
                      actions={actions}
                      MenuName={MenuName}
                      dict={this.state.dict}
                      MenuID={this.props.MenuID}
                      selectedData={selectedData}
                      logcolumns={this.state.logcolumns}
                      ContainerId={this.state.ContainerId}
                      refreshdata={this.refreshbyaction}
                      getexceloutparam={this.getexceloutparam}
                    />
                  </div>
                  <div className="main-table-box">
                    {this.props.menuType !== 'HS' ? <SettingComponent
                      config={config}
                      columns={columns}
                      MenuName={MenuName}
                      dict={this.state.dict}
                      MenuID={this.props.MenuID}
                      permAction={this.props.permAction}
                      permRoles={this.props.permRoles}
                      userConfig={this.state.userConfig}
                      reloadview={this.reloadview}
                    /> : null}
                    {(setting.tableType === 'radio' || setting.tableType === 'checkbox') && this.state.data && this.state.data.length > 0 ?
                      <Switch title="收起" className="main-pickup" checkedChildren="开" unCheckedChildren="关" defaultChecked={pickup} onChange={this.pickupChange} /> : null
                    }
                    <MainTable
                      tableId="mainTable"
                      BID={BID}
                      pickup={pickup}
                      config={config}
                      setting={setting}
                      columns={columns}
                      MenuName={MenuName}
                      pageSize={pageSize}
                      dict={this.state.dict}
                      data={this.state.data}
                      total={this.state.total}
                      MenuID={this.props.MenuID}
                      loading={this.state.loading}
                      refreshdata={this.refreshbytable}
                      logcolumns={this.state.logcolumns}
                      statFValue={this.state.statFValue}
                      handleTableId={this.handleTableId}
                      ContainerId={this.state.ContainerId}
                      refreshbyaction={this.refreshbyaction}
                      chgSelectData={this.changeSelectedData}
                    />
                  </div>
                </Col>
              )
            })
          }
          <Button
            icon="copy"
            shape="circle"
            className="common-table-copy"
            onClick={this.handleviewconfig}
          />
          <Modal
            className="popview-modal"
            title={this.state.popAction.label}
            width={'80vw'}
            maskClosable={false}
            visible={this.state.visible}
            onCancel={this.popclose}
            footer={[
              <Button key="close" onClick={this.popclose}>{this.state.dict['main.close']}</Button>
            ]}
            destroyOnClose
          >
            {<SubTabTable
              BID={''}
              menuType="main"
              SupMenuID={this.props.MenuID}
              MenuID={this.state.popAction.linkTab}
              BData={this.state.BIDs['mainTabledata'] || ''}
              ContainerId={this.state.ContainerId}
              ID={this.state.popData ? this.state.popData[setting.primaryKey] : ''}
              refreshSupView={this.reloadtable}
            />}
          </Modal>
          <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>
          {/* 按钮使用系统存储过程时,验证信息模态框 */}
          <Modal
            wrapClassName="common-table-custom-modal"
            title={'自定义设置'}
            maskClosable={false}
            width={950}
            visible={this.state.settingVisible}
            onCancel={() => { this.setState({ settingVisible: false }) }}
            footer={[
              <Button key="revert" type="danger" loading={this.state.revertLoading} onClick={this.settingRevert}>{this.state.dict['main.revert.default']}</Button>,
              <Button key="cancel" onClick={() => { this.setState({ settingVisible: false }) }}>{this.state.dict['main.cancel']}</Button>,
              <Button key="confirm" type="primary" loading={this.state.confirmLoading} onClick={this.settingSubmit}>{this.state.dict['main.submit']}</Button>
            ]}
            destroyOnClose
          >
            {this.state.settingVisible ?
              <VerifyCard
                MenuID={this.props.MenuID}
                MenuName={this.props.MenuName}
                permAction={this.props.permAction}
                permRoles={this.props.permRoles}
                config={this.state.config}
                userConfig={this.state.userConfig}
                columns={this.state.columns}
                handleParam={this.changeMenuParam}
              /> : null
            } else if (item.chartType === 'card') {
              return (
                <Col className="card-view" span={item.width} key={item.uuid}>
                  <CardComponent
                    BID={BID}
                    plot={item}
                    config={config}
                    MenuName={MenuName}
                    tableId="mainTable"
                    data={this.state.data}
                    MenuID={this.props.MenuID}
                    loading={this.state.loading}
                    logcolumns={this.state.logcolumns}
                    ContainerId={this.state.ContainerId}
                    refreshdata={this.refreshbyaction}
                    getexceloutparam={this.getexceloutparam}
                    handleTableId={this.handleTableId}
                  />
                </Col>
              )
            } else {
              return (
                <Col span={item.width} key={item.uuid}>
                  <ChartComponent
                    BID={BID}
                    plot={item}
                    config={config}
                    MenuName={MenuName}
                    data={this.state.data}
                    getexceloutparam={this.getexceloutparam}
                    loading={this.state.loading}
                  />
                </Col>
              )
            }
          </Modal>
          {viewlost ? <NotFount msg={this.state.lostmsg} /> : null}
        </div> : null}
        {view === 'formtab' ? <FormTab MenuID={this.state.tabBtn.uuid} param={this.state.tabParam} refresh={this.refreshbyformtab}/> : null}
          })}
        </Row> : null }
        {setting && setting.onload !== 'false' &&
          config.tabgroups.map(group => (
            <Tabs activeKey={tabActive[group.uuid]} key={group.uuid} onChange={(key) => this.setState({tabActive: {...tabActive, [group.uuid]: key}})}>
              {group.sublist.map(_tab => {
                return (
                  <TabPane tab={
                    <span>
                      {_tab.icon ? <Icon type={_tab.icon} /> : null}
                      {_tab.label}
                    </span>
                  } key={_tab.uuid}>
                    <SubTable
                      Tab={_tab}
                      MenuID={_tab.linkTab}
                      mainSearch={_tab.searchPass === 'true' ? search : null}
                      userConfig={userConfig ? userConfig[_tab.uuid] : null}
                      SupMenuID={this.props.MenuID}
                      refreshtabs={this.state.refreshtabs}
                      ContainerId={this.state.ContainerId}
                      BID={this.state.BIDs[_tab.supMenu] || ''}
                      BData={this.state.BIDs[_tab.supMenu + 'data'] || ''}
                      handleTableId={this.handleTableId}
                      handleMainTable={(type) => this.handleMainTable(type, _tab)}
                    />
                  </TabPane>
                )
              })}
            </Tabs>)
          )
        }
        {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>
        {viewlost ? <NotFount msg={this.state.lostmsg} /> : null}
      </div>
    )
  }
@@ -1536,18 +1048,19 @@
const mapStateToProps = (state) => {
  return {
    menuType: state.editLevel,
    tabviews: state.tabviews,
    refreshTab: state.refreshTab,
    permAction: state.permAction,
    permMenus: state.permMenus,
    permRoles: state.permRoles
    permRoles: state.permRoles,
    dataManager: state.dataManager
  }
}
const mapDispatchToProps = (dispatch) => {
  return {
    refreshTabView: (refreshTab) => dispatch(refreshTabView(refreshTab)),
    modifyTabview: (tabviews) => dispatch(modifyTabview(tabviews))
    refreshTabView: (refreshTab) => dispatch(refreshTabView(refreshTab))
  }
}