king
2023-06-14 08cce3334a2dc81d690b518136b0aaea64e48b0b
src/templates/modalconfig/index.jsx
@@ -126,6 +126,7 @@
  }
  componentDidMount() {
    window.GLOB.formId = ''
    MKEmitter.addListener('submitStyle', this.getStyle)
    document.onkeydown = (event) => {
      let e = event || window.event
@@ -249,38 +250,28 @@
    let index = null
    uniq.set(card.field, true)
    let _inputIndex = 1
    let _tabIndex = 1
    let _linkIndex = 1
    config.fields.forEach((item, i) => {
      if (card.uuid === item.uuid) {
        index = i
      }
      let label = item.label || ''
      if (item.field && item.field.toLowerCase() !== label.toLowerCase()) {
        label = label + ' (' + item.field + ')'
      }
      if (['text', 'number', 'textarea', 'color'].includes(item.type) && card.field !== item.field) {
        _inputfields.push({
          field: item.field,
          label: _inputIndex + '、' + label
          label: item.label
        })
        _inputIndex++
      }
      if (card.field !== item.field && item.hidden !== 'true' && ['text', 'number', 'select', 'link'].includes(item.type)) {
        _tabfields.push({
          field: item.field,
          label: _tabIndex + '、' + label
          label: item.label
        })
        _tabIndex++
      }
      if (item.type === 'switch') {
      if (item.type === 'switch' || item.type === 'check') {
        _linksupFields.push({
          field: item.field,
          label: _linkIndex + '、' + label
          label: item.label
        })
      }
@@ -291,17 +282,14 @@
        _linkableFields.push({
          field: item.field,
          label: _linkIndex + '、' + item.label + ' (表单)'
          label: item.label + '-表单'
        })
        _linksupFields.push({
          field: item.field,
          label: _linkIndex + '、' + label
          label: item.label
        })
        _linkIndex++
      }
    })
    _tabfields.unshift({field: '', label: '原表单'})
    if (index !== null) {
      if (index === 0) {
@@ -318,9 +306,8 @@
          _linkableFields.push({
            field: col.field,
            label: _linkIndex + '、' + col.label + ' (显示列)'
            label: col.label + '-显示列'
          })
          _linkIndex++
        }
      })
    } else if (tabConfig) {
@@ -330,9 +317,8 @@
          _linkableFields.push({
            field: col.field,
            label: _linkIndex + '、' + col.label + ' (显示列)'
            label: col.label + '-显示列'
          })
          _linkIndex++
        }
      })
    } else if (menu.LongParam) {
@@ -342,9 +328,8 @@
          _linkableFields.push({
            field: col.field,
            label: _linkIndex + '、' + col.label + ' (显示列)'
            label: col.label + '-显示列'
          })
          _linkIndex++
        }
      })
    }
@@ -407,6 +392,8 @@
      _config.fields = _config.fields.filter(item => !item.origin)
      window.GLOB.formId = res.uuid
      if (['select', 'multiselect', 'link', 'checkbox', 'radio', 'checkcard'].includes(res.type) && res.resourceType === '1' && /\s/.test(res.dataSource)) {
        this.setState({
          sqlVerifing: true
@@ -415,7 +402,7 @@
        let param = {
          func: 's_debug_sql',
          exec_type: 'y',
          LText: `declare @mk_organization nvarchar(512)
          LText: `declare @mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20)
            ${res.dataSource}`
        }
@@ -749,7 +736,6 @@
    })
  }
  render () {
    const { editAction } = this.props
    const { config, openEdition } = this.state
@@ -786,7 +772,7 @@
                <Button type="danger" onClick={this.clearConfig}>清空</Button>
                <Versions MenuId={editAction.uuid} open_edition={openEdition} updateConfig={this.refreshConfig}/>
                <ReplaceField type="form" config={config} updateConfig={this.updateconfig}/>
                <EditComponent options={['form']} config={this.state.config} plusFields={this.plusFields}/>
                <EditComponent options={['form']} type="formboard" config={this.state.config} plusFields={this.plusFields}/>
                <Button type="primary" id="save-config" onClick={this.submitConfig} loading={this.state.menuloading}>保存</Button>
                <Button onClick={this.cancelConfig}>返回</Button>
              </div>