king
2023-08-27 da64ab0923bf8817fc8599a6e37b953ce38f64c8
src/menu/components/form/simple-form/index.jsx
@@ -24,7 +24,6 @@
const NormalHeader = asyncComponent(() => import('@/menu/components/share/normalheader'))
const CopyComponent = asyncIconComponent(() => import('@/menu/components/share/copycomponent'))
const PasteForms = asyncIconComponent(() => import('@/menu/components/share/pasteforms'))
const UserComponent = asyncIconComponent(() => import('@/menu/components/share/usercomponent'))
const FieldsComponent = asyncComponent(() => import('@/templates/sharecomponent/fieldscomponent'))
const { confirm } = Modal
@@ -69,33 +68,13 @@
        scripts: [],
        subcards: [{
          uuid: Utils.getuuid(),
          setting: {title: '空', align: 'left_right', enable: 'true'},
          setting: {title: '', align: 'left_right', enable: 'true'},
          style: {},
          fields: [],
          subButton: {label: '提交', type: 'submit', intertype: 'system', reload: 'false', sqlType: 'update', sql: '', Ot: 'notRequired', execSuccess: 'never', enable: 'true', style: {backgroundColor: '#1890ff', color: '#ffffff', paddingLeft: '25px', paddingRight: '25px', paddingTop: '5px', paddingBottom: '5px'}},
        }]
      }
      if (card.config) {
        let config = fromJS(card.config).toJS()
        _card.wrap = config.wrap
        _card.wrap.name = card.name
        _card.style = config.style
        _card.setting = config.setting
        _card.columns = config.columns
        _card.scripts = config.scripts
        _card.subcards = config.subcards.map(scard => {
          scard.uuid = Utils.getuuid()
          scard.fields = scard.fields.map(elem => {
            elem.uuid = Utils.getuuid()
            return elem
          })
          return scard
        })
      }
      this.updateComponent(_card)
    } else {
      let _card = fromJS(card).toJS()
@@ -334,23 +313,22 @@
    let _linkableFields = []
    let _linksupFields = []
    let standardform = null
    let uniq = new Map()
    let index = null
    uniq.set(_form.field, true)
    card.subcards[0].fields.forEach((item, i) => {
      if (_form.uuid === item.uuid) {
        index = i
      }
      if (['text', 'number', 'textarea', 'color'].includes(item.type) && _item.field !== item.field) {
      if (!item.field || _form.field === item.field) return
      if (['text', 'number', 'textarea', 'color'].includes(item.type)) {
        _inputfields.push({
          field: item.field,
          label: item.label
        })
      }
      if (_form.field !== item.field && item.hidden !== 'true' && ['text', 'number', 'select', 'link'].includes(item.type)) {
      if (item.hidden !== 'true' && ['text', 'number', 'select', 'link'].includes(item.type)) {
        _tabfields.push({
          field: item.field,
          label: item.label
@@ -364,20 +342,19 @@
        })
      }
      
      if (!['select', 'link', 'radio', 'checkcard'].includes(item.type)) return
      if (item.type === 'checkcard' && item.multiple === 'true') return // 选项卡多选
      if (item.field && !uniq.has(item.field)) {
        uniq.set(item.field, true)
      if (!['select', 'link', 'radio', 'checkcard', 'multiselect'].includes(item.type)) return
      _linksupFields.push({
        field: item.field,
        label: item.label
      })
      if (item.type === 'multiselect' || (item.type === 'checkcard' && item.multiple === 'true')) return
        _linkableFields.push({
          field: item.field,
          label: item.label + '-表单'
        })
        _linksupFields.push({
          field: item.field,
          label: item.label
        })
      }
    })
    if (index !== null) {
@@ -388,10 +365,9 @@
      }
    }
    let _fields = _linkableFields.map(cell => cell.field)
    card.columns.forEach(col => {
      if (col.field && !uniq.has(col.field)) {
        uniq.set(col.field, true)
      if (col.field && !_fields.includes(col.field)) {
        _linkableFields.push({
          field: col.field,
          label: col.label + '-显示列'
@@ -624,7 +600,6 @@
            <CopyComponent type="simpleform" card={card}/>
            <PasteForms config={card.subcards[0]} update={this.pasteForm} />
            <FontColorsOutlined className="style" title="调整样式" onClick={this.changeStyle}/>
            <UserComponent config={card}/>
            <DeleteOutlined className="close" title="删除组件" onClick={() => this.props.deletecomponent(card.uuid)} />
            {card.wrap.datatype !== 'static' ? <SettingComponent config={card} updateConfig={this.updateComponent} /> : null}
            {card.wrap.datatype === 'static' ? <SettingOutlined style={{color: '#eeeeee', cursor: 'not-allowed'}}/> : null}
@@ -683,6 +658,7 @@
        </div>
        <Modal
          title="编辑"
          wrapClassName="mk-scroll-modal"
          visible={this.state.visible}
          width={950}
          maskClosable={false}