king
2020-01-08 669d7cc31eb3728ad09bfb7ce6e615f5c571c14e
src/templates/modalconfig/modalform/index.jsx
@@ -11,8 +11,7 @@
  static propTpyes = {
    dict: PropTypes.object, // 字典项
    formlist: PropTypes.any,
    card: PropTypes.object,
    billCodes: PropTypes.array
    card: PropTypes.object
  }
  state = {
@@ -23,7 +22,7 @@
  UNSAFE_componentWillMount () {
    let formlist = JSON.parse(JSON.stringify(this.props.formlist))
    console.log(formlist)
    let type = formlist.filter(cell => cell.key === 'type')[0].initVal
    let resourceType = formlist.filter(cell => cell.key === 'resourceType')[0].initVal
    let _options = ['label', 'field', 'initval', 'type', 'readonly', 'required'] // 默认显示项
@@ -45,9 +44,9 @@
    if (type === 'link') { // 关联类型、增加关联字段
      _options = [..._options, 'linkField']
    }
    console.log(type)
    if (type === 'funcvar') {
      _options = ['label', 'field', 'linkfield']
    if (type === 'funcvar') { // 设置为函数变量时,不需要其他信息
      _options = ['label', 'field', 'type']
    }
    
    this.setState({
@@ -103,7 +102,7 @@
      }
      if (value === 'funcvar') {
        _options = ['label', 'field', 'linkfield']
        _options = ['label', 'field', 'type']
      }
      
      this.setState({
@@ -341,12 +340,10 @@
            }
          } else if ((values.type === 'multiselect' || values.type === 'select' || values.type === 'link') && values.resourceType === '1') {
            values.options = []
          }
          if (!values.type) {
            values.type = 'funcvar'
          } else if (values.type === 'funcvar') { // 函数变量为只读元素
            values.readonly = 'true'
          }
          if (isvalid) {
            resolve(values)
          } else {