| | |
| | | font-style: inherit; |
| | | font-weight: inherit; |
| | | text-decoration: inherit; |
| | | font-family: inherit; |
| | | } |
| | | .ant-mk-text:not(.line1):not(.line) { |
| | | word-break: break-word; |
| | |
| | | } else { |
| | | options.push('width', 'minHeight', 'float') |
| | | _style.minHeight = _style.minHeight || '28px' |
| | | _style.textAlign = _style.textAlign || 'center' |
| | | } |
| | | |
| | | if (element.wrapStyle) { |
| | | _style.float = element.wrapStyle.textAlign || 'left' |
| | | } else { |
| | | _style.float = _style.float || 'center' |
| | | } |
| | | } else if (element.eleType === 'picture') { |
| | | options = ['background', 'border', 'margin'] |
| | |
| | | options = ['padding', 'margin'] |
| | | } else if (element.eleType === 'splitline') { |
| | | options = ['padding', 'margin'] |
| | | } |
| | | if (['text', 'number', 'formula', 'currentDate'].includes(element.eleType)) { |
| | | options.push('fontFamily') |
| | | _style.fontFamily = _style.fontFamily ? _style.fontFamily.split(',') : [] |
| | | } |
| | | |
| | | if (element.eleType !== 'button' && element.eleType !== 'tag') { |
| | |
| | | let _card = fromJS(card).toJS() |
| | | |
| | | if (['text', 'number', 'formula', 'currentDate', 'sequence', 'icon'].includes(_card.eleType)) { |
| | | _card.style = style |
| | | _card.style = fromJS(style).toJS() |
| | | let line = _card.height || null |
| | | |
| | | if (style.fontFamily) { |
| | | if (style.fontFamily.length === 0) { |
| | | delete _card.style.fontFamily |
| | | } else { |
| | | _card.style.fontFamily = style.fontFamily.join(',') |
| | | } |
| | | } |
| | | |
| | | if (['currentDate', 'sequence'].includes(_card.eleType) || (_card.eleType === 'icon' && _card.tipType !== 'text')) { |
| | | line = 1 |
| | |
| | | } else if (_card.eleType === 'button') { // 拆分style |
| | | _card.style = fromJS(style).toJS() |
| | | |
| | | if (style.float) { |
| | | if (style.float === 'center') { |
| | | delete _card.style.float |
| | | } else if (style.float) { |
| | | _card.wrapStyle = {textAlign: style.float} |
| | | delete _card.style.float |
| | | } |
| | | if (style.textAlign === 'center') { |
| | | delete _card.style.textAlign |
| | | } |
| | | if (style.minHeight === '28px') { |
| | | delete _card.style.minHeight |
| | | } |
| | | } else if (_card.eleType === 'picture') { |
| | | _card.style = style |
| | |
| | | if (!['text', 'number', 'icon'].includes(res.eleType)) { |
| | | delete res.style.display |
| | | } |
| | | if (!['text', 'number', 'formula', 'currentDate'].includes(res.eleType)) { |
| | | delete res.style.fontFamily |
| | | } |
| | | |
| | | if (res.eleType === 'splitline' && (cell.eleType !== 'splitline' || cell.focus)) { |
| | | res.style.paddingTop = '5px' |
| | |
| | | const { card, actionlist } = this.state |
| | | |
| | | let _card = fromJS(card).toJS() |
| | | _card.style = style |
| | | _card.style = fromJS(style).toJS() |
| | | |
| | | if (_card.style.paddingLeft === '15px') { |
| | | delete _card.style.paddingLeft |
| | | } |
| | | if (_card.style.paddingRight === '15px') { |
| | | delete _card.style.paddingRight |
| | | } |
| | | if (_card.style.minHeight === '28px') { |
| | | delete _card.style.minHeight |
| | | } |
| | | |
| | | let _actionlist = actionlist.map(cell => { |
| | | if (cell.uuid === _card.uuid) return _card |
| | |
| | | let _style = element.style ? fromJS(element.style).toJS() : {} |
| | | let options = ['font', 'border', 'background', 'margin', 'padding', 'minHeight'] |
| | | |
| | | _style.paddingLeft = _style.paddingLeft || '15px' |
| | | _style.paddingRight = _style.paddingRight || '15px' |
| | | _style.minHeight = _style.minHeight || '28px' |
| | | |
| | | this.setState({ |
| | | card: element |
| | | }) |
| | |
| | | } |
| | | |
| | | getStyle = (style) => { |
| | | if (!style.borderBottomWidth) { |
| | | style.borderBottomWidth = '0px' |
| | | let _style = fromJS(style).toJS() |
| | | if (!_style.borderBottomWidth) { |
| | | _style.borderBottomWidth = '0px' |
| | | } |
| | | if (_style.fontFamily) { |
| | | if (_style.fontFamily.length === 0) { |
| | | delete _style.fontFamily |
| | | } else { |
| | | _style.fontFamily = _style.fontFamily.join(',') |
| | | } |
| | | } |
| | | if (_style.lineHeight === 2.8) { |
| | | delete _style.lineHeight |
| | | } |
| | | |
| | | let _config = {...this.props.config, headerStyle: style} |
| | | let _config = {...this.props.config, headerStyle: _style} |
| | | |
| | | this.props.updateComponent(_config) |
| | | } |
| | |
| | | changeStyle = () => { |
| | | const { config } = this.props |
| | | |
| | | let options = ['font', 'border', 'background', 'padding'] |
| | | let _style = config.headerStyle ? fromJS(config.headerStyle).toJS() : {} |
| | | let options = ['font', 'border', 'background', 'padding', 'fontFamily'] |
| | | |
| | | MKEmitter.emit('changeStyle', options, config.headerStyle, this.getStyle) |
| | | _style.fontFamily = _style.fontFamily ? _style.fontFamily.split(',') : [] |
| | | _style.lineHeight = _style.lineHeight || 2.8 |
| | | |
| | | MKEmitter.emit('changeStyle', options, _style, this.getStyle) |
| | | } |
| | | |
| | | render() { |
| | |
| | | text-decoration: inherit; |
| | | font-weight: inherit; |
| | | font-style: inherit; |
| | | font-family: inherit; |
| | | float: left; |
| | | line-height: inherit; |
| | | margin-left: 10px; |
| | |
| | | import React, {Component} from 'react' |
| | | import { is, fromJS } from 'immutable' |
| | | import { Collapse, Form, Col, InputNumber, Input, Select, Radio, Drawer, Button, message } from 'antd' |
| | | import { Collapse, Form, Col, InputNumber, Input, Select, Radio, Drawer, Button, message, Checkbox } from 'antd' |
| | | import { |
| | | ColumnHeightOutlined, |
| | | FontSizeOutlined, |
| | |
| | | </Radio.Group> |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {options.includes('fontFamily') ? <Col span={24}> |
| | | <Form.Item |
| | | colon={false} |
| | | label=" " |
| | | labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 20 }} } |
| | | > |
| | | <Checkbox.Group options={[ |
| | | { label: '微软雅黑', value: 'Microsoft YaHei' }, |
| | | { label: '宋体', value: 'Simsun' }, |
| | | { label: '黑体', value: 'Simhei' }, |
| | | { label: '仿宋', value: 'FangSong' }, |
| | | { label: '楷体', value: 'KaiTi' }, |
| | | // { label: 'Helvetica', value: 'Helvetica' }, |
| | | // { label: 'Arial', value: 'Arial' }, |
| | | // { label: 'Verdana', value: 'Verdana' }, |
| | | // { label: 'Georgia', value: 'Georgia' }, |
| | | ]} defaultValue={card.fontFamily} onChange={(val) => this.changeNormalStyle(val, 'fontFamily')} /> |
| | | </Form.Item> |
| | | </Col> : null} |
| | | </Panel> : null} |
| | | {options.includes('background') || options.includes('backgroundColor') ? <Panel header="背景" key="background"> |
| | | <Col span={24} className="bg-color-panel"> |
| | |
| | | label={<SwapOutlined title="对齐"/>} |
| | | labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 20 }} } |
| | | > |
| | | <Radio.Group style={{whiteSpace: 'nowrap'}} defaultValue={card.float || (type === 'mk-button' ? 'center' : 'left')} onChange={(e) => this.changeNormalStyle(e.target.value, 'float')}> |
| | | <Radio.Group style={{whiteSpace: 'nowrap'}} defaultValue={card.float || 'left'} onChange={(e) => this.changeNormalStyle(e.target.value, 'float')}> |
| | | <Radio value="left">左</Radio> |
| | | <Radio value="center">居中</Radio> |
| | | <Radio value="right">右</Radio> |
| | |
| | | } |
| | | } |
| | | } |
| | | .ant-checkbox-group { |
| | | margin-top: 10px; |
| | | .ant-checkbox-wrapper { |
| | | color: rgba(255, 255, 255, 0.85); |
| | | margin-right: 4px; |
| | | margin-bottom: 2px; |
| | | .ant-checkbox + span { |
| | | padding-left: 6px; |
| | | } |
| | | .ant-checkbox:not(.ant-checkbox-checked) { |
| | | .ant-checkbox-inner { |
| | | background-color: rgba(255, 255, 255, 0.85); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | font-style: inherit; |
| | | font-weight: inherit; |
| | | text-decoration: inherit; |
| | | font-family: inherit; |
| | | color: inherit; |
| | | .anticon-copy { |
| | | color: var(--mk-sys-color); |
| | |
| | | font-style: inherit; |
| | | font-weight: inherit; |
| | | text-decoration: inherit; |
| | | font-family: inherit; |
| | | .sequence-wrap { |
| | | display: inline-block; |
| | | width: 21px; |
| | |
| | | font-style: inherit; |
| | | font-weight: inherit; |
| | | text-decoration: inherit; |
| | | font-family: inherit; |
| | | } |
| | | } |
| | | .ant-mk-text:not(.line1):not(.line) { |
| | |
| | | text-decoration: inherit; |
| | | font-weight: inherit; |
| | | font-style: inherit; |
| | | font-family: inherit; |
| | | float: left; |
| | | line-height: inherit; |
| | | margin-left: 10px; |
| | |
| | | font-weight: inherit; |
| | | font-style: inherit; |
| | | line-height: inherit; |
| | | font-family: inherit; |
| | | margin-left: 10px; |
| | | position: relative; |
| | | z-index: 1; |
| | |
| | | text-decoration: inherit; |
| | | font-weight: inherit; |
| | | font-style: inherit; |
| | | font-family: inherit; |
| | | float: left; |
| | | line-height: inherit; |
| | | margin-left: 10px; |
| | |
| | | text-decoration: inherit; |
| | | font-weight: inherit; |
| | | font-style: inherit; |
| | | font-family: inherit; |
| | | float: left; |
| | | line-height: 45px; |
| | | margin-left: 10px; |
| | |
| | | width: 100%; |
| | | border-radius: 0px; |
| | | border: 0px !important; |
| | | color: rgba(0, 0, 0, 0.85)!important; |
| | | background: transparent !important; |
| | | // color: rgba(0, 0, 0, 0.85)!important; |
| | | // background: transparent !important; |
| | | min-height: 36px; |
| | | } |
| | | button:not(:last-child) { |