From fa381753ef2a2b25b1c0722549ac17e333da79be Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 06 九月 2022 22:50:54 +0800 Subject: [PATCH] 2022-09-06 --- src/templates/modalconfig/dragelement/card.jsx | 15 +++++++++------ 1 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/templates/modalconfig/dragelement/card.jsx b/src/templates/modalconfig/dragelement/card.jsx index bbd5db0..d4dc506 100644 --- a/src/templates/modalconfig/dragelement/card.jsx +++ b/src/templates/modalconfig/dragelement/card.jsx @@ -16,7 +16,7 @@ const ColorSketch = asyncComponent(() => import('@/mob/colorsketch')) const CheckCard = asyncComponent(() => import('../checkCard')) -const Card = ({ id, card, moveCard, findCard, editCard, closeCard, copyCard, showField }) => { +const Card = ({ id, card, moveCard, findCard, editCard, closeCard, copyCard, showField, setStyle }) => { const originalIndex = findCard(id).index const [{ isDragging }, drag] = useDrag({ item: { type: 'form', id, originalIndex }, @@ -38,7 +38,7 @@ } } }) - const opacity = isDragging ? 0 : 1 + const opacity = isDragging ? 0.5 : 1 const edit = () => { editCard(id) @@ -53,9 +53,9 @@ } const changeStyle = () => { - let options = ['font'] + let options = ['font1'] - MKEmitter.emit('changeStyle', ['form', card.uuid], options, card.style || {}) + MKEmitter.emit('changeStyle', options, card.style || {}, (s) => {setStyle(s, id)}) } let selectval = '' @@ -78,7 +78,7 @@ formItem = (<Input style={{marginTop: '4px'}} placeholder={card.placeholder || ''} value={card.initval} />) } else if (card.type === 'number') { formItem = (<InputNumber value={card.initval} precision={card.decimal} />) - } else if (card.type === 'multiselect' || card.type === 'select' || card.type === 'link') { + } else if (card.type === 'multiselect' || card.type === 'select' || card.type === 'link' || card.type === 'cascader') { formItem = (<Select value={selectval}></Select>) } else if (card.type === 'color') { formItem = (<ColorSketch value={card.initval || 'transparent'}/>) @@ -130,7 +130,9 @@ <Checkbox value="D">D</Checkbox> </Checkbox.Group>) } else if (card.type === 'hint') { - formItem = <div style={{marginTop: '10px', color: 'rgba(0, 0, 0, 0.85)', lineHeight: '1.5', ...card.style}}>{card.message}</div> + formItem = <div style={{marginTop: '8px', color: 'rgba(0, 0, 0, 0.85)', lineHeight: '1.5', ...card.style}}>{card.message}</div> + } else if (card.type === 'formula') { + formItem = <div style={{marginTop: '8px', color: 'rgba(0, 0, 0, 0.85)', lineHeight: '1.5', ...card.style}}>{card.formula}{card.postfix || ''}</div> } else if (card.type === 'split') { formItem = <div className="split-line" style={card.style}>{card.label}</div> } else if (card.type === 'checkcard') { @@ -146,6 +148,7 @@ if (card.type === 'brafteditor' && card.hidelabel === 'true') { _label = null } else if (card.type === 'hint' && !card.label) { + className += ' no-label' _label = ' ' } -- Gitblit v1.8.0