| | |
| | | let options = ['font', 'border', 'padding', 'margin', 'background'] |
| | | |
| | | if (element.eleType === 'button') { |
| | | options.push('width', 'float') |
| | | if (element.OpenType === 'form') { |
| | | options = ['margin', 'float'] |
| | | } else { |
| | | options.push('width', 'minHeight', 'float') |
| | | } |
| | | if (element.wrapStyle) { |
| | | _style.float = element.wrapStyle.textAlign || 'left' |
| | | } |
| | | } else if (element.eleType === 'picture') { |
| | | options = ['border', 'margin'] |
| | | } else if (element.eleType === 'slider') { |
| | |
| | | |
| | | if (comIds.length !== 3 || comIds[0] !== cards.uuid || comIds[1] !== cardCell.uuid || !card) return |
| | | |
| | | if (card.eleType === 'button') { |
| | | if ((style.paddingLeft || style.paddingRight) && !style.width) { |
| | | style.width = 'auto' |
| | | } |
| | | } |
| | | // if (card.eleType === 'button') { |
| | | // if ((style.paddingLeft || style.paddingRight) && !style.width) { |
| | | // style.width = 'auto' |
| | | // } |
| | | // } |
| | | |
| | | let _card = this.resetCardStyle(card, style) |
| | | |
| | |
| | | |
| | | _card.innerHeight = _card.barHeight + (_card.displayValue === 'true' ? fontSize + 2 : 0) |
| | | } else if (_card.eleType === 'button') { // 拆分style |
| | | _card.style = style |
| | | _card.style = fromJS(style).toJS() |
| | | |
| | | if (style.float) { |
| | | _card.wrapStyle = {textAlign: style.float} |
| | | delete _card.style.float |
| | | } |
| | | } else { |
| | | _card.style = style |
| | | } |
| | |
| | | } |
| | | |
| | | delete res.focus |
| | | let style = {} |
| | | |
| | | if (res.class !== cell.class || res.show !== cell.show || !res.style) { |
| | | if (res.OpenType === 'form') { |
| | | if (cell.OpenType !== 'form') { |
| | | res.style = {} |
| | | } |
| | | } else if (res.class !== cell.class || res.show !== cell.show || !res.style) { |
| | | let style = {} |
| | | if (res.show === 'link' || res.show === 'icon') { |
| | | style.color = color[res.class] |
| | | style.backgroundColor = 'transparent' |
| | |
| | | style.color = '#ffffff' |
| | | style.backgroundColor = color[res.class] |
| | | } |
| | | res.style = {...res.style, ...style} |
| | | } |
| | | res.style = {...res.style, ...style} |
| | | |
| | | return res |
| | | } |
| | |
| | | let btn = cards.action[index] |
| | | btn.eleType = 'button' |
| | | |
| | | if (!btn.width) { |
| | | btn.width = 12 |
| | | } |
| | | if (btn.color) { |
| | | btn.style = btn.style || {} |
| | | btn.style.color = '#ffffff' |
| | | if (btn.color === 'primary') { |
| | | btn.style.backgroundColor = '#1677ff' |
| | | } else if (btn.color === 'danger') { |
| | | btn.style.backgroundColor = '#ff3141' |
| | | } else if (btn.color === 'warning') { |
| | | btn.style.backgroundColor = '#ff8f1f' |
| | | } else if (btn.color === 'success') { |
| | | btn.style.backgroundColor = '#00b578' |
| | | } else if (btn.color === 'light') { |
| | | btn.style.backgroundColor = '#cccccc' |
| | | } |
| | | } |
| | | |
| | | let _elements = [...this.state.elements, btn] |
| | | |
| | | this.setState({ |
| | |
| | | <div onDoubleClick={(e) => e.stopPropagation()}> |
| | | {/* 编辑按钮:复制、编辑 */} |
| | | <Modal |
| | | title={'编辑元素'} |
| | | title="编辑元素" |
| | | visible={visible} |
| | | width={800} |
| | | width={850} |
| | | maskClosable={false} |
| | | onCancel={this.editModalCancel} |
| | | onOk={this.handleSubmit} |