king
2020-04-15 0c1c59933e95c4c691d6ba3d11bf4aef98fe9e8d
src/templates/subtableconfig/index.jsx
@@ -25,6 +25,7 @@
import GridBtnForm from '@/templates/zshare/gridbtnform'
import EditCard from '@/templates/zshare/editcard'
import VerifyCard from '@/templates/zshare/verifycard'
import VerifyCardPrint from '@/templates/zshare/verifycardprint'
import VerifyCardExcelIn from '@/templates/zshare/verifycardexcelin'
import VerifyCardExcelOut from '@/templates/zshare/verifycardexcelout'
import MenuForm from '@/templates/zshare/menuform'
@@ -1067,67 +1068,11 @@
    const { card } = this.state
    let config = JSON.parse(JSON.stringify(this.state.config))
    
    if (card.OpenType === 'excelIn') {
      this.verifyRef.handleConfirm().then(res => {
        config.action = config.action.map(item => {
          if (item.uuid === card.uuid) {
            item.verify = res
          }
          return item
        })
        this.setState({
          profileVisible: false,
          config: config,
          card: ''
        })
      })
    } else if (card.execMode) {
      this.verifyRef.handleConfirm().then(res => {
        config.action = config.action.map(item => {
          if (item.uuid === card.uuid) {
            item.verify = res
          }
          return item
        })
        this.setState({
          profileVisible: false,
          config: config,
          card: '',
        })
      })
    } else {
      let _verify = this.verifyRef.state.verify
      if (card.OpenType !== 'excelOut' && _verify.default === 'false' && _verify.scripts.length === 0) {
        notification.warning({
          top: 92,
          message: '不执行默认sql时,必须设置自定义脚本!',
          duration: 10
        })
        return
      } else if (card.OpenType === 'excelOut') {
        let _cols = _verify.columns.map(col => col.Column)
        let _vcols = Array.from(new Set(_cols))
        if (_cols.length > _vcols.length) {
          notification.warning({
            top: 92,
            message: 'Excel列字段名,不可重复!',
            duration: 10
          })
          return
        }
      }
    this.verifyRef.handleConfirm().then(res => {
      config.action = config.action.map(item => {
        if (item.uuid === card.uuid) {
          item.verify = _verify
          item.verify = res
        }
  
        return item
@@ -1138,7 +1083,7 @@
        config: config,
        card: ''
      })
    }
    })
  }
  /**
@@ -2646,7 +2591,7 @@
          onCancel={() => { this.setState({ profileVisible: false }) }}
          destroyOnClose
        >
          {this.state.card && this.state.card.OpenType !== 'excelIn' ?
          {this.state.card && !this.state.card.execMode && this.state.card.OpenType !== 'excelIn' && this.state.card.OpenType !== 'excelOut' ?
            <VerifyCard
              floor="subtable"
              card={this.state.card}
@@ -2655,6 +2600,14 @@
              wrappedComponentRef={(inst) => this.verifyRef = inst}
            /> : null
          }
          {this.state.card && this.state.card.execMode ?
            <VerifyCardPrint
              card={this.state.card}
              dict={this.state.dict}
              columns={config.columns}
              wrappedComponentRef={(inst) => this.verifyRef = inst}
            /> : null
          }
          {this.state.card && this.state.card.OpenType === 'excelIn' ?
            <VerifyCardExcelIn
              card={this.state.card}