king
2020-03-20 bc4ee6130db80f8f2020bb3bb7248b6e55ae90cc
src/tabviews/subtabtable/index.jsx
@@ -118,7 +118,7 @@
        })
  
        config.columns = config.columns.filter(col => {
          if (!col.field || !col.blacklist || col.blacklist.length === 0) return true
          if (!col.field || !col.blacklist || col.blacklist.length === 0 || config.setting.primaryKey === col.field) return true
  
          let _black = col.blacklist.filter(v => {
            return this.props.permRoles.indexOf(v) !== -1
@@ -188,6 +188,13 @@
        })
      }
      let valid = true // 搜索条件必填验证
      config.search.forEach(field => {
        if (field.required === 'true' && !field.initval) {
          valid = false
        }
      })
      this.setState({
        loadingview: false,
        config: config,
@@ -197,11 +204,13 @@
        columns: _columns,
        logcolumns: _logcolumns,
        arr_field: _arrField.join(','),
        search: Utils.initMainSearch(config.search), // 搜索条件初始化(含有时间格式,需要转化)
        loading: true
        search: Utils.initMainSearch(config.search) // 搜索条件初始化(含有时间格式,需要转化)
      }, () => {
        this.improveSearch()
        if (config.setting.onload !== 'false' && valid) { // 初始化可加载
        this.loadmaindata()
        }
      })
    } else {
      this.setState({
@@ -302,8 +311,23 @@
   * @description 子表数据加载
   */
  async loadmaindata () {
    const { setting } = this.state
    const { setting, search } = this.state
    let param = ''
    let requireFields = search.filter(item => item.required && !item.value)
    if (requireFields.length > 0) {
      notification.warning({
        top: 92,
        message: this.state.dict['form.required.input'] + requireFields.map(item => item.label).join('、') + ' !',
        duration: 3
      })
      return
    }
    this.setState({
      loading: true
    })
    if (setting.interType !== 'inner' || (setting.interType === 'inner' && setting.innerFunc)) {
      param = this.getCustomParam()
@@ -444,7 +468,6 @@
    this.refs.subTable.resetTable()
    this.setState({
      loading: true,
      pageIndex: 1,
      search: searches
    }, () => {
@@ -465,7 +488,6 @@
    }
    this.setState({
      loading: true,
      pageIndex: pagination.current,
      pageSize: pagination.pageSize,
      orderBy: (sorter.field && sorter.order) ? `${sorter.field} ${sorter.order}` : ''
@@ -480,7 +502,6 @@
  reloadtable = () => {
    this.refs.subTable.resetTable()
    this.setState({
      loading: true,
      pageIndex: 1
    }, () => {
      this.loadmaindata()