king
2024-05-24 96916ae2777d63b008435dd83d89f77e2485f51d
2024-05-24
6个文件已修改
155 ■■■■ 已修改文件
src/menu/components/form/simple-form/index.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/form/step-form/index.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/form/tab-form/index.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/modalconfig/formfork/index.jsx 43 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/modalconfig/formfork/index.scss 96 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/modalconfig/index.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/form/simple-form/index.jsx
@@ -19,7 +19,7 @@
const CardComponent = asyncComponent(() => import('@/templates/modalconfig/dragelement'))
const MobCardComponent = asyncComponent(() => import('@/mob/components/formdragelement'))
const FormAction = asyncComponent(() => import('../formaction'))
// const FormFork = asyncComponent(() => import('@/menu/modalconfig/formfork'))
const FormFork = asyncComponent(() => import('@/menu/modalconfig/formfork'))
const NormalHeader = asyncComponent(() => import('@/menu/components/share/normalheader'))
const CopyComponent = asyncIconComponent(() => import('@/menu/components/share/copycomponent'))
const PasteForms = asyncIconComponent(() => import('@/menu/components/share/pasteforms'))
@@ -562,7 +562,7 @@
            } trigger="hover">
              <SwapOutlined />
            </Popover> : null}
            {/* <FormFork forms={card.subcards[0].fields}/> */}
            <FormFork forms={card.subcards[0].fields}/>
            {/* <CopyOutlined title="复制" onClick={this.triggerCopy} /> */}
            <Switch checkedChildren="开" unCheckedChildren="关" defaultChecked={this.state.showField} onChange={(val) => this.setState({showField: val})} />
          </div>
src/menu/components/form/step-form/index.jsx
@@ -20,7 +20,7 @@
const MobCardComponent = asyncComponent(() => import('@/mob/components/formdragelement'))
const FormTitle = asyncComponent(() => import('../dragtitle'))
const FormAction = asyncComponent(() => import('../formaction'))
// const FormFork = asyncComponent(() => import('@/menu/modalconfig/formfork'))
const FormFork = asyncComponent(() => import('@/menu/modalconfig/formfork'))
const CopyComponent = asyncIconComponent(() => import('@/menu/components/share/copycomponent'))
const PasteComponent = asyncIconComponent(() => import('@/menu/components/share/pastecomponent'))
const FieldsComponent = asyncComponent(() => import('@/templates/sharecomponent/fieldscomponent'))
@@ -677,7 +677,7 @@
            } trigger="hover">
              <SwapOutlined />
            </Popover> : null}
            {/* <FormFork forms={group.fields}/> */}
            <FormFork forms={group.fields}/>
            {/* <CopyOutlined title="复制" onClick={this.triggerCopy} /> */}
            <Switch checkedChildren="开" unCheckedChildren="关" defaultChecked={this.state.showField} onChange={(val) => this.setState({showField: val})} />
          </div>
src/menu/components/form/tab-form/index.jsx
@@ -20,7 +20,7 @@
const MobCardComponent = asyncComponent(() => import('@/mob/components/formdragelement'))
const FormTitle = asyncComponent(() => import('../dragtitle'))
const FormAction = asyncComponent(() => import('../formaction'))
// const FormFork = asyncComponent(() => import('@/menu/modalconfig/formfork'))
const FormFork = asyncComponent(() => import('@/menu/modalconfig/formfork'))
const CopyComponent = asyncIconComponent(() => import('@/menu/components/share/copycomponent'))
const PasteComponent = asyncIconComponent(() => import('@/menu/components/share/pastecomponent'))
const FieldsComponent = asyncComponent(() => import('@/templates/sharecomponent/fieldscomponent'))
@@ -680,7 +680,7 @@
            } trigger="hover">
              <SwapOutlined />
            </Popover> : null}
            {/* <FormFork forms={group.fields}/> */}
            <FormFork forms={group.fields}/>
            {/* <CopyOutlined title="复制" onClick={this.triggerCopy} /> */}
            <Switch checkedChildren="开" unCheckedChildren="关" defaultChecked={this.state.showField} onChange={(val) => this.setState({showField: val})} />
          </div>
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>
src/menu/modalconfig/formfork/index.scss
@@ -29,33 +29,114 @@
      }
    }
    .forward-wrap {
      text-align: right;
      position: relative;
      padding: 5px;
      .ant-radio-group {
        position: absolute;
        top: 5px;
        right: 0px;
      }
      .legend {
        span {
          display: inline-block;
          margin-right: 20px;
          position: relative;
          margin-left: 60px;
        }
        span::before {
          content: ' ';
          display: block;
          position: absolute;
          width: 50px;
          height: 6px;
          left: -55px;
          top: 10px;
        }
        span:first-child::before {
          background: #8E44AD;
        }
        span:last-child::before {
          background: rgb(38, 194, 129);
        }
      }
    }
    .fork-wrap {
      padding-top: 15px;
    }
    .fork-wrap.fork-false {
      .fork-item-wrap {
        .fork-left {
          .fork-item {
            border-color: rgb(38, 194, 129);
            color: #26c281;
          }
        }
        .fork-right {
          .fork-item {
            border-color: #8E44AD;
            color: #8E44AD;
          }
        }
      }
    }
    .fork-item-wrap {
      display: inline-flex;
      width: 50%;
      margin-bottom: 15px;
      margin-bottom: 20px;
      .fork-left {
        position: relative;
        display: flex;
        width: 50%;
        align-items: center;
        .fork-item {
          border-color: #8E44AD;
          color: #8E44AD;
        }
        .fork-item::before {
          content: '';
          display: block;
          border-top: 1px solid #bcbcbc;
          position: absolute;
          top: 28px;
          width: 58px;
          right: -58px;
        }
      }
      .fork-right {
        position: relative;
        display: inline-block;
        width: 50%;
        padding-left: 30px;
        .fork-item {
          border-color: rgb(38, 194, 129);
          color: #26c281;
        }
        .fork-item:not(:last-child) {
          margin-bottom: 10px;
        }
        .fork-item::before {
          content: '';
          display: block;
          border-top: 1px solid #bcbcbc;
          position: absolute;
          top: 28px;
          width: 56px;
          left: -56px;
        }
      }
      .fork-right::before {
        content: '';
        display: block;
        border-left: 1px solid #bcbcbc;
        position: absolute;
        top: 29px;
        bottom: 27px;
        left: -26px;
      }
      .fork-item {
@@ -64,9 +145,8 @@
        width: 130px;
        border: 1px solid #bcbcbc;
        padding: 5px 10px;
        height: 55px;
        height: 56px;
        border-radius: 4px;
        color: rgba(0, 0, 0, 0.85);
        span:not(.fork-tail) {
          display: block;
          white-space: nowrap;
@@ -76,8 +156,14 @@
        .fork-tail {
          display: inline-block;
          position: absolute;
          color: rgba(0, 0, 0, 0.85);
          top: 10px;
          right: 140px;
          right: 135px;
          max-width: 45px;
          display: block;
          white-space: nowrap;
          overflow: hidden;
          text-overflow: ellipsis;
        }
      }
    }
src/menu/modalconfig/index.jsx
@@ -21,7 +21,7 @@
const TableComponent = asyncComponent(() => import('./tablecomponent'))
const ModalForm = asyncComponent(() => import('@/templates/zshare/modalform'))
const PasteForms = asyncComponent(() => import('@/menu/components/share/pasteforms'))
// const FormFork = asyncComponent(() => import('@/menu/modalconfig/formfork'))
const FormFork = asyncComponent(() => import('@/menu/modalconfig/formfork'))
const DragElement = asyncComponent(() => import('@/templates/modalconfig/dragelement'))
const FieldsComponent = asyncComponent(() => import('@/templates/sharecomponent/fieldscomponent'))
@@ -413,7 +413,7 @@
                    } trigger="hover">
                      <SwapOutlined />
                    </Popover>
                    {/* <FormFork forms={config.fields}/> */}
                    <FormFork forms={config.fields}/>
                    <CopyOutlined title="复制" onClick={this.triggerCopy} />
                    <Switch checkedChildren="开" unCheckedChildren="关" defaultChecked={this.state.showField} onChange={(val) => this.setState({showField: val})} />
                  </div>