king
2020-03-04 54f2a3e1e54a6d8289ccb8d5de158f23150d7a5e
2020-03-04
6个文件已修改
118 ■■■■ 已修改文件
src/tabviews/formtab/formgroup/index.jsx 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/tableshare/mutilform/index.jsx 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/formtabconfig/index.jsx 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/modalconfig/index.jsx 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/tableshare/formconfig.js 41 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/ushare/modalform/index.jsx 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/formtab/formgroup/index.jsx
@@ -139,6 +139,10 @@
          item.initval = data[item.field]
        }
        if (item.supvalue) {
          item.supvalue = item.supvalue.split(',')
        }
        _formlist.push(item)
        return item
@@ -198,6 +202,7 @@
    
            subfields.push(item)
          }
          return item
        })
        return group
@@ -287,6 +292,8 @@
    formlist.forEach((item, index) => {
      if (item.hidden === 'true') return
      if (item.supField && !item.supvalue.includes(this.props.form.getFieldValue(item.supField))) return
      
      if (item.type === 'text') {
        fields.push(
src/tabviews/tableshare/mutilform/index.jsx
@@ -118,6 +118,10 @@
        item.initval = this.props.data[item.field]
      }
      if (item.supvalue) {
        item.supvalue = item.supvalue.split(',')
      }
      return item
    })
@@ -259,6 +263,8 @@
    this.state.formlist.forEach((item, index) => {
      if ((!item.field && item.type !== 'title') || item.hidden === 'true') return
      if (item.supField && !item.supvalue.includes(this.props.form.getFieldValue(item.supField))) return
      
      if (item.type === 'title') {
        fields.push(
src/templates/formtabconfig/index.jsx
@@ -375,6 +375,10 @@
    const { config } = this.state
    let _inputfields = []
    let _linkableFields = []
    let _linksupFields = [{
      value: '',
      text: '空'
    }]
    let _formfields = []
    // 设置下拉菜单可关联字段
@@ -392,6 +396,8 @@
    }
    let uniq = new Map()
    uniq.set(card.field, true)
    _formfields.forEach(item => {
      if (item.field && !uniq.has(item.field)) {
        uniq.set(item.field, true)
@@ -399,6 +405,10 @@
        _linkableFields.push({
          value: item.field,
          text: item.label + ' (表单)'
        })
        _linksupFields.push({
          value: item.field,
          text: item.label
        })
      }
    })
@@ -419,7 +429,7 @@
    this.setState({
      modaltype: 'search',
      card: card,
      formlist: getModalForm(card, _inputfields, _linkableFields)
      formlist: getModalForm(card, _inputfields, _linkableFields, _linksupFields)
    })
  }
src/templates/modalconfig/index.jsx
@@ -386,6 +386,10 @@
    const { config } = this.state
    let _inputfields = []
    let _linkableFields = []
    let _linksupFields = [{
      value: '',
      text: '空'
    }]
    let _formfields = []
    // 设置下拉菜单可关联字段(上级与下级)
@@ -404,6 +408,7 @@
    }
    let uniq = new Map()
    uniq.set(card.field, true)
    _formfields.forEach(item => {
      if (item.field && !uniq.has(item.field)) {
        uniq.set(item.field, true)
@@ -411,6 +416,10 @@
        _linkableFields.push({
          value: item.field,
          text: item.label + ' (表单)'
        })
        _linksupFields.push({
          value: item.field,
          text: item.label
        })
      }
    })
@@ -459,7 +468,7 @@
      visible: true,
      modalType: type,
      card: card,
      formlist: getModalForm(card, _inputfields, _linkableFields, !!this.props.editTab)
      formlist: getModalForm(card, _inputfields, _linkableFields, _linksupFields, !!this.props.editTab)
    })
  }
src/templates/tableshare/formconfig.js
@@ -788,7 +788,7 @@
 * @param {*} card 
 * @param {*} inputfields 
 */
export function getModalForm (card, inputfields, linkableFields, subtable = false) {
export function getModalForm (card, inputfields, linkableFields, linksupFields, subtable = false) {
  let _openType = []
  let _fieldlength = 50
@@ -1073,11 +1073,30 @@
      }]
    },
    {
      type: 'multiselect',
      key: 'linkSubField',
      label: Formdict['header.form.linkForm'],
      initVal: card.linkSubField || [],
      options: inputfields
      type: 'number',
      key: 'maxRows',
      label: Formdict['header.form.maxRows'],
      initVal: card.maxRows || 6,
      required: false
    },
    {
      type: 'select',
      key: 'supField',
      label: '上级表单',
      tooltip: '上级表单为下拉选择或关联菜单,设置上级表单后,该表单受控于上级菜单,注:受控关系在该表单隐藏时失效。',
      initVal: card.supField || '',
      required: false,
      readonly: false,
      options: linksupFields
    },
    {
      type: 'text',
      key: 'supvalue',
      label: '显示值',
      tooltip: '选择上级表单后,填写显示值,只有上级表单值与显示值相同时,该表单才会显示,注:多个值用逗号分隔。',
      initVal: card.supvalue || '',
      required: true,
      readonly: false
    },
    {
      type: 'select',
@@ -1088,11 +1107,11 @@
      options: []
    },
    {
      type: 'number',
      key: 'maxRows',
      label: Formdict['header.form.maxRows'],
      initVal: card.maxRows || 6,
      required: false
      type: 'multiselect',
      key: 'linkSubField',
      label: Formdict['header.form.linkForm'],
      initVal: card.linkSubField || [],
      options: inputfields
    }
  ]
}
src/templates/ushare/modalform/index.jsx
@@ -20,6 +20,7 @@
  state = {
    openType: null,
    resourceType: null,
    supField: '',
    formlist: null,
    linkSubFields: null
  }
@@ -30,6 +31,7 @@
    let type = ''
    let resourceType = ''
    let supField = ''
    let linkSubFields = []
    formlist.forEach(cell => {
@@ -47,6 +49,8 @@
            return false
          }
        })
      } else if (cell.key === 'supField') {
        supField = cell.initVal
      }
    })
    
@@ -78,8 +82,17 @@
      _options = ['label', 'field', 'type', 'readonly', 'required', 'hidden', 'fieldlength']
    }
    if (type !== 'funcvar' && type !== 'linkMain') {
      if (supField) {
        _options.push('supField', 'supvalue')
      } else {
        _options.push('supField')
      }
    }
    this.setState({
      openType: type,
      supField: supField,
      resourceType: resourceType,
      linkSubFields: linkSubFields,
      formlist: formlist.map(form => {
@@ -148,6 +161,14 @@
      } else if (value === 'linkMain') {
        _options = ['label', 'field', 'type', 'readonly', 'required', 'hidden', 'fieldlength']
      }
      if (value !== 'funcvar' && value !== 'linkMain') {
        if (this.state.supField) {
          _options.push('supField', 'supvalue')
        } else {
          _options.push('supField')
        }
      }
      
      this.setState({
        openType: value,
@@ -199,6 +220,19 @@
        formlist: this.state.formlist.map(form => {
          if (form.key === 'options') {
            form.initVal = option.options
          }
          return form
        })
      })
    } else if (key === 'supField') {
      this.setState({
        supField: value,
        formlist: this.state.formlist.map(form => {
          if (form.key === 'supvalue' && value) {
            form.show = true
          } else if (form.key === 'supvalue' && !value) {
            form.show = false
          }
          return form
@@ -381,7 +415,12 @@
      } else if (item.type === 'select') { // 下拉搜索
        fields.push(
          <Col span={12} key={index}>
            <Form.Item label={item.label}>
            <Form.Item label={item.tooltip ?
              <Tooltip placement="topLeft" title={item.tooltip}>
                <Icon type="question-circle" />
                {item.label}
              </Tooltip> : item.label
            }>
              {getFieldDecorator(item.key, {
                initialValue: item.initVal || '',
                rules: [