king
2024-05-24 96916ae2777d63b008435dd83d89f77e2485f51d
src/menu/modalconfig/formfork/index.jsx
@@ -15,7 +15,6 @@
    visible: false,
    empty: false,
    ctrlFields: [],
    ctrlRFields: [],
    subFields: [],
    subRFields: [],
    linkFields: [],
@@ -169,14 +168,6 @@
        delete item.tabField
      }
      if (item.supField) {
        if (!fieldMap.has(item.supField)) {
          delete item.supField
          delete item.supvalue
        } else {
          item.supLabel = fieldMap.get(item.supField).label
        }
      }
      if (item.linkField) {
        if (!fieldMap.has(item.linkField)) {
          item.linkLabel = '字段集'
@@ -186,6 +177,7 @@
      }
      delete item.enter
      delete item.supField
      delete item.multiple
      delete item.linkSubField
@@ -215,7 +207,6 @@
    let _n = [...fieldMap.values()]
    let ctrlFields = []
    let ctrlRFields = []
    let subFields = []
    let subRFields = []
    let _linkFields = []
@@ -233,17 +224,6 @@
              tail: `${m.values}`
            }
          })
        })
      }
      if (cell.supField) {
        ctrlRFields.push({
          field: ['hint', 'split', 'formula'].includes(cell.type) ? '' : cell.field,
          label: cell.label,
          children: [{
            field: cell.supField,
            label: cell.supLabel,
            tail: `${cell.supvalue}`
          }]
        })
      }
@@ -296,7 +276,6 @@
      forward: 'true',
      empty: type === '',
      ctrlFields,
      ctrlRFields,
      subFields,
      subRFields,
      linkFields: _linkFields,
@@ -306,7 +285,7 @@
  }
  getcontent = () => {
    const { ctrlFields, ctrlRFields, subFields, subRFields, linkFields, tabFields, visible, type, forward } = this.state
    const { ctrlFields, subFields, subRFields, linkFields, tabFields, visible, type, forward } = this.state
    if (!visible) return null
@@ -320,11 +299,7 @@
    let items = []
    if (type === 'ctrl') {
      if (forward === 'true') {
        items = ctrlFields
      } else {
        items = ctrlRFields
      }
    } else if (type === 'input') {
      if (forward === 'true') {
        items = subFields
@@ -349,7 +324,7 @@
          {item.children.map((cell, n) => <div className="fork-item" key={n}>
            <span>{cell.label}</span>
            <span>{cell.field}</span>
            {cell.tail ? <span className="fork-tail">{cell.tail}</span> : null}
            {cell.tail ? <span title={cell.tail} className="fork-tail">{cell.tail}</span> : null}
          </div>)}
        </div>
      </div>
@@ -357,11 +332,17 @@
    return <div>
      {header}
      {type === 'ctrl' || type === 'input' ? <div className="forward-wrap"><Radio.Group value={forward} onChange={(e) => this.setState({forward: e.target.value})}>
      <div className="forward-wrap">
        {type === 'ctrl' ? <div className="legend"><span>主表单</span><span>受控表单</span></div> : null}
        {type === 'input' ? <div className="legend"><span>主表单</span><span>被填入表单</span></div> : null}
        {type === 'link' ? <div className="legend"><span>上级表单</span><span>下级表单</span></div> : null}
        {type === 'switch' ? <div className="legend"><span>源表单</span><span>跳转表单</span></div> : null}
        {type === 'input' ? <Radio.Group value={forward} onChange={(e) => this.setState({forward: e.target.value})}>
        <Radio value="true">正向</Radio>
        <Radio value="false">反向</Radio>
      </Radio.Group></div> : null}
      <div className="fork-wrap">
        </Radio.Group> : null}
      </div>
      <div className={'fork-wrap fork-' + forward}>
        {content}
      </div>
    </div>