king
2024-03-07 cdd5b449130ea4d7223fde4f414a11a7d0c33d6d
src/menu/components/card/cardcellcomponent/dragaction/card.jsx
@@ -65,8 +65,14 @@
  }
  if (card.eleType === 'picture' && card.maxWidth) {
    _style.maxWidth = card.maxWidth
    let left = _style.marginLeft && _style.marginLeft !== '0px' ? _style.marginLeft : 'auto'
    let right = _style.marginRight && _style.marginRight !== '0px' ? _style.marginRight : 'auto'
    let left = _style.marginLeft || 'auto'
    let right = _style.marginRight || 'auto'
    if (_style.marginLeft === '0px' && _style.marginRight === '0px') {
      left = 'auto'
      right = 'auto'
    }
    _style.margin = (_style.marginTop || 0) + ' ' + right + ' ' + (_style.marginBottom || 0) + ' ' + left
    delete _style.marginLeft
    delete _style.marginRight
@@ -77,7 +83,7 @@
  const getContent = () => {
    if (card.eleType === 'sequence') {
      return (
        <div style={{height: card.innerHeight || 'auto'}} className="ant-mk-text">1</div>
        <div style={{height: card.innerHeight || 'auto'}} className="ant-mk-text">{card.prefix || ''}1{card.postfix || ''}</div>
      )
    } else if (card.eleType === 'text' || card.eleType === 'number') {
      let val = `${card.prefix || ''}${card.datatype === 'static' ? (card.value || '') : (card.field || '')}${card.postfix || ''}`
@@ -215,11 +221,15 @@
  if (card.style && card.style.clear === 'left') {
    _style_ = {clear: 'left'}
  } else if (card.style && card.style.clear === 'right') {
    _style_ = {float: 'right'}
  }
  let tableHCell = false
  let mark = ['text', 'number', 'slider', 'sequence', 'formula'].includes(card.eleType)
  if (parent.setting && parent.setting.cardRole === 'header') {
    tableHCell = true
    mark = false
  } else if (card.eleType === 'formula' && card.eval === 'func') {
    mark = false
  }
  return (
@@ -229,7 +239,7 @@
        <CopyOutlined className="copy" title="复制" onClick={() => copyCard(id)} />
        <CloseOutlined className="close" title="删除" onClick={() => delCard(id)} />
        <FontColorsOutlined className="style" title="调整样式" onClick={() => changeStyle(id)}/>
        {['text', 'number', 'slider', 'sequence', 'formula'].includes(card.eleType) && !tableHCell ? <MarkColumn field={card.field || ''} columns={fields} type={card.eleType} marks={card.marks} onSubmit={(vals) => updateMarks({...card, marks: vals})} /> : null }
        {mark ? <MarkColumn field={card.field || ''} columns={fields} type={card.eleType} marks={card.marks} onSubmit={(vals) => updateMarks({...card, marks: vals})} /> : null }
      </div>
    } trigger="hover">
      <div ref={node => drag(drop(node))} style={_style_} className={'ant-col card-cell ant-col-' + card.width}>