king
2019-12-10 bd06958321afa706f32287c71bd219eb0622c86c
src/tabviews/commontable/index.jsx
@@ -38,17 +38,16 @@
    orderColumn: '',
    orderType: 'asc',
    search: '',
    fixed: {}
    configMap: {}
  }
  async loadconfig () {
    // 获取主菜单
    let param = {
      func: 'sPC_Get_LongParam',
      MenuID: this.props.MenuID,
      isCache: true
      MenuID: this.props.MenuID
    }
    let result = await Api.getSystemConfig(param)
    let result = await Api.getSystemCacheConfig(param)
    if (result.status && result.LongParam) {
      let config = window.decodeURIComponent(window.atob(result.LongParam))
@@ -132,6 +131,7 @@
        loading: true
      }, () => {
        this.improveSearch()
        this.improveAction()
        this.loadmaindata()
      })
    } else {
@@ -153,8 +153,6 @@
    searchlist.forEach(item => {
      if (item.type !== 'select' && item.type !== 'link') return
      let unloaded = item.options.length === 0
      if (item.setAll === 'true') {
        item.options.unshift({
          key: Utils.getuuid(),
@@ -163,7 +161,7 @@
        })
      }
      if (item.resourceType === '1' && item.dataSource && unloaded) {
      if (item.resourceType === '1' && item.dataSource) {
        let param = {
          func: 'sPC_Get_SelectedList',
          LText: item.dataSourceSql,
@@ -175,7 +173,7 @@
        param.secretkey = Utils.encrypt(param.LText, param.timestamp)
        let defer = new Promise(resolve => {
          Api.getSystemConfig(param).then(res => {
          Api.getSystemCacheConfig(param).then(res => {
            res.search = item
            resolve(res)
          })
@@ -218,6 +216,40 @@
        }
      })
      this.setState({searchlist})
    })
  }
  improveAction = () => {
    const { config } = this.state
    config.action.forEach(item => {
      if (item.OpenType !== 'pop' && item.OpenType !== 'tab' && item.OpenType !== 'blank') return
      Api.getSystemCacheConfig({
        func: 'sPC_Get_LongParam',
        MenuID: item.uuid
      }).then(res => {
        if (res.status) {
          let _LongParam = ''
          if (res.LongParam) {
            _LongParam = window.decodeURIComponent(window.atob(res.LongParam))
            try {
              _LongParam = JSON.parse(_LongParam)
            } catch (e) {
              _LongParam = ''
            }
          }
          this.setState({
            configMap: {...this.state.configMap, [item.uuid]: _LongParam}
          })
        } else {
          notification.warning({
            top: 92,
            message: res.message,
            duration: 10
          })
        }
      })
    })
  }
@@ -350,6 +382,7 @@
          <MainAction
            MenuID={this.props.MenuID}
            setting={setting}
            configMap={this.state.configMap}
            refreshdata={this.refreshbyaction}
            gettableselected={this.gettableselected}
            actions={actions}