king
2020-11-13 8190d6e5ac14616d85e3992169ecef6d99d03b76
src/tabviews/custom/index.jsx
@@ -36,12 +36,12 @@
  state = {
    dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS,
    ContainerId: Utils.getuuid(), // 菜单外层html Id
    BID: null,            // 页面跳转时携带ID
    BID: '',              // 页面跳转时携带ID
    loadingview: true,    // 页面加载中
    viewlost: false,      // 页面丢失:1、未获取到配置-页面丢失;2、页面未启用
    lostmsg: '',          // 页面丢失时的提示信息
    config: null,         // 页面配置信息,包括组件等
    mainSearch: null,
    mainSearch: null,     // 主搜索
    userConfig: null,     // 用户自定义设置
    data: null,           // 列表数据集
    loading: false,       // 列表数据加载中
@@ -81,7 +81,7 @@
          userConfig = null
        }
      }
      // 页面配置解析错误时提示
      if (!config) {
        this.setState({
@@ -141,7 +141,7 @@
      let params = []
      let BID = param && param.BID ? param.BID : ''
      config.components = this.formatSetting(config.components, params, mainSearch, permAction, BID)
      config.components = this.formatSetting(config.components, params, mainSearch, permAction)
      this.setState({
        BID: BID,
@@ -209,7 +209,7 @@
  }
  // 格式化默认设置
  formatSetting = (components, params, mainSearch, permAction, BID) => {
  formatSetting = (components, params, mainSearch, permAction) => {
    return components.map(component => {
      if (component.type === 'tabs') {
        component.subtabs = component.subtabs.map(tab => {
@@ -268,7 +268,7 @@
      // dataName 系统生成的数据源名称
      // pageable 是否分页,组件属性,不分页的组件才可以统一查询
      if (component.floor === 1 && component.dataName && (!component.pageable || (component.pageable && !component.setting.laypage)) && component.setting.onload === 'true' && component.setting.sync === 'true') {
        let param = this.getDefaultParam(component, mainSearch, BID)
        let param = this.getDefaultParam(component, mainSearch)
        params.push(param)
      } else if (component.floor === 1) {
        component.setting.sync = 'false'
@@ -281,7 +281,7 @@
  /**
   * @description 获取系统存储过程 sPC_Get_TableData 的参数
   */
  getDefaultParam = (component, mainSearch, BID) => {
  getDefaultParam = (component, mainSearch) => {
    const { columns, search, setting, dataName, format } = component
    
    let searchlist = []
@@ -318,9 +318,6 @@
        }
        _customScript = _customScript.replace(item.reg, item.value)
      })
      _dataresource = _dataresource.replace(/@BID@/ig, BID)
      _customScript = _customScript.replace(/@BID@/ig, BID)
    }
    let _search = ''
@@ -377,7 +374,8 @@
    let param = {
      func: 'sPC_Get_structured_data',
      LText: LText.join(' union all '),
      LText_field: LText_field.join(' union all ')
      LText_field: LText_field.join(' union all '),
      BID: this.state.BID || ''
    }
    param.LText = Utils.formatOptions(param.LText)
@@ -439,7 +437,10 @@
  }
  UNSAFE_componentWillReceiveProps(nextProps) {
    if (nextProps.refreshTab && nextProps.refreshTab.MenuID === this.props.MenuID) {
      this.reloadview()
      this.props.refreshTabView('')
    }
  }
  shouldComponentUpdate (nextProps, nextState) {
@@ -453,6 +454,18 @@
    this.setState = () => {
      return
    }
  }
  reloadview = () => {
    this.setState({
      BID: '',              // 页面跳转时携带ID
      loadingview: true,    // 页面加载中
      viewlost: false,      // 页面丢失:1、未获取到配置-页面丢失;2、页面未启用
      config: null,         // 页面配置信息,包括组件等
      loading: false        // 列表数据加载中
    }, () => {
      this.loadconfig()
    })
  }
  resetSearch = (search) => {
@@ -537,7 +550,6 @@
const mapStateToProps = (state) => {
  return {
    menuType: state.editLevel,
    tabviews: state.tabviews,
    refreshTab: state.refreshTab,
    permAction: state.permAction,
    permRoles: state.permRoles,