king
2023-06-29 48db4d4b22331f32bf6c6a0956a7cd4245ad6fde
src/tabviews/custom/index.jsx
@@ -1,7 +1,7 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { is, fromJS } from 'immutable'
import { notification, Spin, Row, Col } from 'antd'
import { notification, Spin, Row, Col, Modal } from 'antd'
import Api from '@/api'
import zhCN from '@/locales/zh-CN/main.js'
@@ -40,6 +40,7 @@
const CustomChart = asyncComponent(() => import('./components/chart/custom-chart'))
const TimeLine = asyncComponent(() => import('./components/timeline/normal-timeline'))
const AntvG6 = asyncComponent(() => import('./components/chart/antv-G6'))
const AntvX6 = asyncComponent(() => import('./components/chart/antv-X6'))
const Voucher = asyncComponent(() => import('./components/module/voucher'))
const Account = asyncComponent(() => import('./components/module/account'))
const Iframe = asyncComponent(() => import('./components/iframe'))
@@ -52,7 +53,6 @@
    param: PropTypes.any,        // 其他页面传递的参数
    Tab: PropTypes.string,       // 弹窗标签
    MenuID: PropTypes.string,    // 菜单Id
    MenuNo: PropTypes.string,    // 菜单参数
    MenuName: PropTypes.string,  // 菜单名称
    changeTemp: PropTypes.func
  }
@@ -80,7 +80,7 @@
   * @description 获取页面配置信息
   */
  async loadconfig () {
    const { MenuID } = this.props
    const { MenuID, MenuName } = this.props
    let _param = {
      func: 'sPC_Get_LongParam',
@@ -97,6 +97,7 @@
        config = config.replace(/@mywebsite@\//ig, window.GLOB.baseurl)
        config = JSON.parse(config)
        config.MenuID = MenuID
        config.MenuName = MenuName || config.MenuName
      } catch (e) {
        console.warn('Parse Failure')
        config = ''
@@ -207,7 +208,7 @@
      let initInters = []
      config.interfaces = this.formatInterSetting(config.interfaces, regs, MenuID, initInters)
      config.components = this.filterComponent(config.components, roleId, window.GLOB.mkActions, balMap, skip, param, MenuID, config.interfaces, popview, config.$cache)
      config.components = this.filterComponent(config.components, roleId, window.GLOB.mkActions, balMap, skip, param, MenuID, config.interfaces, popview, config.$cache, config.MenuName)
      
      // 获取主搜索条件
      let mainSearch = []
@@ -336,7 +337,7 @@
    }
  }
  filterComponent = (components, roleId, permAction, balMap, skip, urlparam, pageId, interfaces, popview, cache) => {
  filterComponent = (components, roleId, permAction, balMap, skip, urlparam, pageId, interfaces, popview, cache, MenuName) => {
    return components.filter(item => {
      item.$pageId = pageId
      item.$cache = cache
@@ -348,7 +349,7 @@
        delete item.style.shadowColor
      }
      item.$menuname = (this.props.MenuName || '') + '-' + (item.name || '')
      item.$menuname = (MenuName || '') + '-' + (item.name || '')
      if (item.type === 'tabs') {
        if (
@@ -423,7 +424,7 @@
        item.subtabs = item.subtabs.map(tab => {
          tab.$pageId = pageId
          tab.components = this.filterComponent(tab.components, roleId, permAction, balMap, skip, urlparam, pageId, interfaces, popview, cache)
          tab.components = this.filterComponent(tab.components, roleId, permAction, balMap, skip, urlparam, pageId, interfaces, popview, cache, MenuName)
          return tab
        })
@@ -436,10 +437,10 @@
          return false
        }
        item.components = this.filterComponent(item.components, roleId, permAction, balMap, skip, urlparam, pageId, interfaces, popview, cache)
        item.components = this.filterComponent(item.components, roleId, permAction, balMap, skip, urlparam, pageId, interfaces, popview, cache, MenuName)
        return true
      } else if (['pie', 'bar', 'line', 'dashboard', 'scatter', 'chart'].includes(item.type)) {
      } else if (['pie', 'bar', 'line', 'dashboard', 'scatter', 'chart', 'antvG6', 'antvX6'].includes(item.type)) {
        if (
          item.plot.blacklist && item.plot.blacklist.length > 0 &&
          item.plot.blacklist.filter(v => roleId.indexOf(v) > -1).length > 0
@@ -1087,6 +1088,20 @@
    Api.genericInterface(param).then(result => {
      if (result.status) {
        if (result.message) {
          if (result.ErrCode === 'Y') {
            Modal.success({
              title: result.message
            })
          } else if (result.ErrCode === 'S') {
            notification.success({
              top: 92,
              message: result.message,
              duration: 2
            })
          }
        }
        delete result.status
        delete result.message
        delete result.ErrMesg
@@ -1111,11 +1126,19 @@
          data: '',
          loading: false
        })
        notification.error({
          top: 92,
          message: result.message,
          duration: 10
        })
        if (!result.message) return
        if (result.ErrCode === 'N') {
          Modal.error({
            title: result.message,
          })
        } else if (result.ErrCode !== '-2') {
          notification.error({
            top: 92,
            message: result.message,
            duration: 10
          })
        }
      }
    })
  }
@@ -1408,6 +1431,12 @@
            <AntvG6 config={item} data={data} mainSearch={mainSearch}/>
          </Col>
        )
      } else if (item.type === 'antvX6') {
        return (
          <Col span={item.width} style={style} key={item.uuid}>
            <AntvX6 config={item}/>
          </Col>
        )
      } else if (item.type === 'module' && item.subtype === 'voucher') {
        return (
          <Col span={item.width} style={style} key={item.uuid}>