king
2022-07-14 c9e46b9fa50396d4001d8b195dc485d431e8d590
2022-07-14
4个文件已修改
92 ■■■■■ 已修改文件
src/tabviews/zshare/mutilform/index.jsx 51 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/mutilform/mkCascader/index.jsx 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/formconfig.jsx 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/modalform/index.jsx 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/mutilform/index.jsx
@@ -393,7 +393,7 @@
      let item = fieldMap.get(cell.field)
      // 下级表单控制-字段写入
      if ((['select', 'radio', 'link'].includes(item.type) || (item.type === 'checkcard' && item.multiple !== 'true')) && item.linkSubField) {
      if ((['select', 'radio', 'link'].includes(item.type) || (item.type === 'checkcard' && item.multiple !== 'true') || (item.type === 'cascader' && item.resourceType !== '2')) && item.linkSubField) {
        item.subFields = []
        item.linkSubField.forEach(m => {
          let n = fieldMap.get(m)
@@ -418,9 +418,6 @@
          item.options = fromJS(item.oriOptions).toJS()
        }
        item.linkSubField = null
      } else if (item.type === 'cascader' && item.fillField) {
        let n = fieldMap.get(item.fillField)
        item.fillFieldId = n ? n.uuid : ''
      }
      // if (item.type === 'link') {
@@ -463,31 +460,18 @@
      }
      if (item.subFields && item.options.length > 0) {
        let initval = item.initval
        if (item.type === 'cascader' && item.separator) {
          initval = initval.split(item.separator).pop()
        }
        // eslint-disable-next-line
        let option = item.options.filter(cell => item.initval == cell.value)[0]
        let option = item.options.filter(cell => initval == cell.value)[0]
        if (option) {
          reFieldsVal = reFieldsVal || {}
          item.subFields.forEach(n => {
            reFieldsVal[n.field] = option[n.field]
          })
        }
      } else if (item.fillField && item.initval && item.separator && item.options.length > 0) {
        let initvals = item.initval.split(item.separator)
        let label = []
        initvals.forEach(m => {
          // eslint-disable-next-line
          let option = item.options.filter(cell => m == cell.value)[0]
          if (option) {
            label.push(option.label)
          }
        })
        label = label.join(item.separator)
        if (label) {
          reFieldsVal = reFieldsVal || {}
          reFieldsVal[item.fillField] = label
        }
      }
      
@@ -737,31 +721,18 @@
        }
        if (item.subFields && item.options.length > 0) {
          let initval = item.initval
          if (item.type === 'cascader' && item.separator) {
            initval = initval.split(item.separator).pop()
          }
          // eslint-disable-next-line
          let option = item.options.filter(cell => item.initval == cell.value)[0]
          let option = item.options.filter(cell => initval == cell.value)[0]
  
          if (option) {
            reFieldsVal = reFieldsVal || {}
            item.subFields.forEach(n => {
              reFieldsVal[n.field] = option[n.field]
            })
          }
        } else if (item.fillField && item.initval && item.separator && item.options.length > 0) {
          let initvals = item.initval.split(item.separator)
          let label = []
          initvals.forEach(m => {
            // eslint-disable-next-line
            let option = item.options.filter(cell => m == cell.value)[0]
            if (option) {
              label.push(option.label)
            }
          })
          label = label.join(item.separator)
          if (label) {
            reFieldsVal = reFieldsVal || {}
            reFieldsVal[item.fillField] = label
          }
        }
      }
src/tabviews/zshare/mutilform/mkCascader/index.jsx
@@ -66,10 +66,7 @@
    options = options.filter(option => {
      if (option.ParentID === config.topmark) {
        _options.push({
          label: option.label,
            value: option.value
        })
        _options.push(option)
        return false
      }
      return true
@@ -84,10 +81,7 @@
      options = options.filter(option => {
        if (option.ParentID === parent.value) {
          parent.children.push({
            label: option.label,
            value: option.value
          })
          parent.children.push(option)
          return false
        }
        return true
@@ -108,11 +102,15 @@
    let other = {}
    let _value = val.join(config.separator)
    let _option = option[option.length - 1]
    
    if (config.fillFieldId) {
      let _label = option.map(m => m.label).join(config.separator)
      other[config.fillField] = _label
      MKEmitter.emit('mkFC', 'input', config.fillFieldId, _label)
    if (config.subFields && _option) {
      config.subFields.forEach((n, i) => {
        other[n.field] = _option[n.field]
        setTimeout(() => {
          MKEmitter.emit('mkFC', 'input', n.uuid, _option[n.field])
        }, i * 5)
      })
    }
    this.props.onChange(_value, other)
src/templates/zshare/formconfig.jsx
@@ -3590,14 +3590,6 @@
      initVal: card.linkSubField || [],
      options: inputfields
    },
    {
      type: 'select',
      key: 'fillField',
      label: '填充表单',
      tooltip: '在切换选项时会把级联菜单的文本自动填入关联的表单中。',
      initVal: card.fillField || '',
      options: inputfields
    },
    // {
    //   type: 'number',
    //   key: 'marginTop',
src/templates/zshare/modalform/index.jsx
@@ -33,7 +33,7 @@
  datemonth: ['initval', 'readonly', 'required', 'hidden', 'readin', 'span', 'labelwidth', 'tooltip', 'extra', 'declareType', 'splitline', 'marginTop', 'marginBottom'],
  datetime: ['initval', 'readonly', 'required', 'hidden', 'readin', 'span', 'labelwidth', 'tooltip', 'extra', 'declareType', 'mode', 'splitline', 'marginTop', 'marginBottom', 'minDate', 'maxDate'],
  textarea: ['initval', 'readonly', 'required', 'hidden', 'readin', 'fieldlength', 'span', 'labelwidth', 'maxRows', 'encryption', 'interception', 'tooltip', 'extra', 'count', 'placeholder', 'marginTop', 'marginBottom', 'enterReplace'],
  cascader: ['readonly', 'required', 'hidden', 'readin', 'resourceType', 'fieldlength', 'span', 'labelwidth', 'tooltip', 'extra', 'splitline', 'marginTop', 'marginBottom', 'separator', 'fillField'],
  cascader: ['readonly', 'required', 'hidden', 'readin', 'resourceType', 'fieldlength', 'span', 'labelwidth', 'tooltip', 'extra', 'splitline', 'marginTop', 'marginBottom', 'separator'],
  color: ['initval', 'readonly', 'required', 'hidden', 'readin', 'span', 'labelwidth', 'tooltip', 'extra', 'marginTop', 'marginBottom'],
  rate: ['initval', 'readonly', 'required', 'hidden', 'readin', 'span', 'labelwidth', 'splitline', 'tooltip', 'extra', 'marginTop', 'marginBottom', 'allowHalf', 'rateCount', 'character', 'place'],
  hint: ['label', 'field', 'type', 'blacklist', 'message', 'span', 'labelwidth', 'splitline', 'marginTop', 'marginBottom'],
@@ -237,9 +237,9 @@
    if (type === 'cascader') {
      if (this.record.resourceType === '0') {        // 自定义资源
        shows.push('options', 'topmark')
        shows.push('options', 'topmark', 'linkSubField')
      } else if (this.record.resourceType === '1') { // 数据源
        shows.push('dataSource', 'valueField', 'valueText', 'orderBy', 'orderType', 'disableField', 'database', 'topmark', 'linkField')
        shows.push('dataSource', 'valueField', 'valueText', 'orderBy', 'orderType', 'disableField', 'database', 'topmark', 'linkField', 'linkSubField')
      }
      reTypes.linkField = 'text'
      reTooltip.linkField = '用于构建数据结构。'
@@ -641,13 +641,16 @@
        let linkSubFields = this.record.linkSubField || []
        
        if (type !== 'checkcard') {
          if (!['select', 'radio', 'link'].includes(type)) {
          if (!['select', 'radio', 'link', 'cascader'].includes(type)) {
            linkSubFields = []
          }
          if (type === 'radio' && this.record.linkField) {
            type = 'link'
          } else if (type === 'cascader') {
            type = 'link'
            if (this.record.resourceType === '2') {        // 自定义资源
              linkSubFields = []
            }
          }
          content = <EditTable type={type} module="form" transfield={transfield} linkSubFields={linkSubFields} onChange={this.changeOptions}/>
        } else {