king
2024-05-07 2aa5ab63b4bbce5c36dbb3511b205b3b5f6af9bd
src/menu/components/form/step-form/index.jsx
@@ -89,6 +89,10 @@
    }
  }
  componentDidMount () {
    MKEmitter.addListener('mkUpdateInter', this.mkUpdateInter)
  }
  shouldComponentUpdate (nextProps, nextState) {
    return !is(fromJS(this.state), fromJS(nextState))
  }
@@ -99,6 +103,21 @@
  componentWillUnmount () {
    this.setState = () => {
      return
    }
    MKEmitter.removeListener('mkUpdateInter', this.mkUpdateInter)
  }
  mkUpdateInter = (inter, split) => {
    const { card } = this.state
    if (card.wrap.datatype === 'public' && card.wrap.publicId === inter.uuid) {
      let _card = {...card, columns: fromJS(inter.columns).toJS()}
      split.delay = split.delay + 10
      setTimeout(() => {
        this.updateComponent(_card)
      }, split.delay)
    }
  }
@@ -111,7 +130,7 @@
    card.errors = []
    let idCtrl = false
    if (card.wrap.datatype !== 'static') {
    if (card.wrap.datatype === 'dynamic') {
      let supModule = card.setting.supModule ? card.setting.supModule[card.setting.supModule.length - 1] || '' : ''
      if (supModule === 'empty') {
        supModule = ''
@@ -125,6 +144,16 @@
      }
      card.subcards.forEach(item => {
        if (item.subButton.intertype === 'system' && !item.subButton.sqlType) {
          card.errors.push({ level: 0, detail: `${item.subButton.label} 按钮请设置操作类型`})
        }
        if (item.subButton.verify && !item.subButton.output) {
          if (item.subButton.verify.noteEnable === 'true') {
            card.errors.push({ level: 0, detail: `${item.subButton.label} 按钮未设置返回值短信发送无效!`})
          } else if (item.subButton.verify.emailEnable === 'true') {
            card.errors.push({ level: 0, detail: `${item.subButton.label} 按钮未设置返回值邮件发送无效!`})
          }
        }
        item.fields.forEach(m => {
          if (m.dataSource && /@ID@/ig.test(m.dataSource)) {
            idCtrl = true
@@ -135,16 +164,29 @@
        })
      })
    } else {
      let supModule = card.wrap.supModule ? card.wrap.supModule[card.wrap.supModule.length - 1] : ''
      let supModule = ''
      if (card.wrap.datatype === 'static') {
        supModule = card.wrap.supModule ? card.wrap.supModule[card.wrap.supModule.length - 1] : ''
      }
      card.$tables = getTables(card)
      card.subcards.forEach(item => {
        if (item.subButton.intertype === 'system' && !item.subButton.sqlType) {
          card.errors.push({ level: 0, detail: `${item.subButton.label} 按钮请设置操作类型`})
        }
        if (item.subButton.verify && !item.subButton.output) {
          if (item.subButton.verify.noteEnable === 'true') {
            card.errors.push({ level: 0, detail: `${item.subButton.label} 按钮未设置返回值短信发送无效!`})
          } else if (item.subButton.verify.emailEnable === 'true') {
            card.errors.push({ level: 0, detail: `${item.subButton.label} 按钮未设置返回值邮件发送无效!`})
          }
        }
        item.fields.forEach(m => {
          if (m.dataSource && /@ID@/ig.test(m.dataSource)) {
            idCtrl = true
          }
          if (m.type === 'linkMain' && !supModule) {
          if (m.type === 'linkMain' && !supModule && card.wrap.datatype === 'static') {
            card.errors.push({ level: 1, detail: `请检查分组“${item.setting.title}”中关联主表“${m.label}”是否有效`})
          }
        })
@@ -196,7 +238,7 @@
      style: {},
      fields: [],
      prevButton: {label: '上一步', type: 'prev', enable: 'false', style: {marginRight: '15px', paddingTop: '5px', paddingBottom: '5px'}},
      subButton: {label: '提交', type: 'submit', intertype: 'system', reload: 'false', sqlType: 'update', sql: '', Ot: 'notRequired', enable: 'true', style: {backgroundColor: '#1890ff', color: '#ffffff', paddingLeft: '25px', paddingRight: '25px', paddingTop: '5px', paddingBottom: '5px'}},
      subButton: {label: '提交', type: 'submit', intertype: 'system', reload: 'false', sqlType: '', sql: '', Ot: 'notRequired', execSuccess: 'never', enable: 'true', style: {backgroundColor: '#1890ff', color: '#ffffff', paddingLeft: '25px', paddingRight: '25px', paddingTop: '5px', paddingBottom: '5px'}},
      nextButton: {label: '跳过', type: 'next', enable: 'false', style: {paddingTop: '5px', paddingBottom: '5px'}}
    }
@@ -435,7 +477,7 @@
        })
      }
      if (item.type === 'switch' || item.type === 'check') {
      if (['switch', 'check', 'popSelect'].includes(item.type)) {
        _linksupFields.push({
          field: item.field,
          label: item.label
@@ -550,6 +592,7 @@
    res.fields.forEach(item => {
      item.uuid = Utils.getuuid()
      delete item.focus
    })
    if (!res.prevButton) {
@@ -585,6 +628,17 @@
        _card.setting.supModule = res.supModule
      } else {
        _card.setting.supModule = ''
      }
    } else if (res.datatype === 'public') {
      let interfaces = window.GLOB.customMenu.interfaces || []
      let d = interfaces.filter(m => m.uuid === res.publicId && m.status === 'true')[0]
      if (d) {
        _card.columns = fromJS(d.columns).toJS()
        _card.setting = { interType: 'system' }
        _card.scripts = []
      }
    }
@@ -670,8 +724,7 @@
            <PasteComponent config={card} options={['formgroup', 'simpleform']} updateConfig={this.pasteForm} />
            <FontColorsOutlined className="style" title="调整样式" onClick={this.changeStyle}/>
            <DeleteOutlined className="close" title="删除组件" onClick={() => this.props.deletecomponent(card.uuid)} />
            {card.wrap.datatype !== 'static' ? <SettingComponent config={card} updateConfig={this.updateComponent} /> : null}
            {card.wrap.datatype === 'static' ? <SettingOutlined style={{color: '#eeeeee', cursor: 'not-allowed'}}/> : null}
            {card.wrap.datatype === 'dynamic' ? <SettingComponent config={card} updateConfig={this.updateComponent} /> : <SettingOutlined style={{color: '#eeeeee', cursor: 'not-allowed'}}/>}
          </div>
        } trigger="hover">
          <ToolOutlined />