| | |
| | | 'line-through': '中划线', |
| | | 'icon': '图标', |
| | | 'iconfront': '图标', |
| | | 'iconback': '图标', |
| | | 'iconback': '图标' |
| | | } |
| | | |
| | | if (text[0] === 'indent') { |
| | | return ( |
| | | <div>缩进/{text[1]}个字符</div> |
| | | ) |
| | | } else if (text[0] === 'pointfront') { |
| | | return ( |
| | | <div><span style={{display: 'inline-block', width: '8px', height: '8px', borderRadius: '14px', background: 'black', verticalAlign: 'middle'}}></span> 点(前)</div> |
| | | ) |
| | | } else if (text[0] === 'pointback') { |
| | | return ( |
| | | <div>点(后) <span style={{display: 'inline-block', width: '8px', height: '8px', borderRadius: '14px', background: 'black', verticalAlign: 'middle'}}></span></div> |
| | | ) |
| | | } |
| | | |
| | | return ( |
| | |
| | | }) |
| | | } |
| | | ] |
| | | |
| | | let signs = [ |
| | | { |
| | | value: 'font', |
| | |
| | | label: '中划线' |
| | | }, |
| | | { |
| | | value: 'pointfront', |
| | | label: '点(前)' |
| | | }, |
| | | { |
| | | value: 'pointback', |
| | | label: '点(后)' |
| | | }, |
| | | { |
| | | value: 'iconfront', |
| | | label: '图标(前)', |
| | | children: icons |
| | |
| | | value: 'iconback', |
| | | label: '图标(后)', |
| | | children: icons |
| | | }, |
| | | { |
| | | value: 'indent', |
| | | label: '缩进', |
| | | children: [{ |
| | | value: 2, |
| | | label: '2个字符' |
| | | }, { |
| | | value: 4, |
| | | label: '4个字符' |
| | | }, { |
| | | value: 6, |
| | | label: '6个字符' |
| | | }, { |
| | | value: 8, |
| | | label: '8个字符' |
| | | }] |
| | | } |
| | | ] |
| | | |
| | | if (type === 'line' || type === 'sequence') { |
| | | signs.pop() |
| | | signs.pop() |
| | | signs.pop() |
| | | signs.pop() |
| | | signs.pop() |
| | | } else if (type === 'slider') { |
| | | markColumns = markColumns.filter(col => { |
| | | col.width = '20%' |
| | |
| | | </div> : null} |
| | | <Modal |
| | | visible={!!visible} |
| | | width={visible !== 'system' ? 600 : 1000} |
| | | width={visible !== 'system' ? 650 : 1000} |
| | | closable={false} |
| | | maskClosable={false} |
| | | okText="确定" |
| | |
| | | |
| | | return ( |
| | | <div className="mk-source-pop-wrap"> |
| | | {keyword === 'input' ? <Form.Item label="地址" labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={{xs: { span: 24 }, sm: { span: 20 }}}> |
| | | {keyword === 'input' ? <Form.Item label="地址" help="可使用@mywebsite@代替域名(含虚拟目录),如:@mywebsite@/Content/images/xxx.jpg" labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={{xs: { span: 24 }, sm: { span: 20 }}}> |
| | | <TextArea id="source-input" value={url} rows={4} onChange={this.changeValue}/> |
| | | </Form.Item> : null} |
| | | {keyword === 'upload' ? <Form.Item label="上传" labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={{xs: { span: 24 }, sm: { span: 20 }}}> |
| | |
| | | position: relative; |
| | | top: -15px; |
| | | } |
| | | .ant-form-explain { |
| | | margin-top: 5px; |
| | | word-break: break-all; |
| | | } |
| | | } |
| | | .picture-edit-model { |
| | | .ant-modal { |
| | |
| | | } else { |
| | | val = <span>{val} <MkIcon style={mark.innerStyle} type={mark.icon} /></span> |
| | | } |
| | | } else if (mark.space) { |
| | | val = <><span style={{float: 'left'}} dangerouslySetInnerHTML={{__html: mark.space}}></span>{val}</> |
| | | } else if (mark.point) { |
| | | if (mark.position === 'front') { |
| | | val = <>{mark.point}{val}</> |
| | | } else { |
| | | val = <>{val}{mark.point}</> |
| | | } |
| | | } |
| | | className = mark.signType |
| | | } |
| | |
| | | val = <span><MkIcon style={mark.innerStyle} type={mark.icon} /> {val}</span> |
| | | } else { |
| | | val = <span>{val} <MkIcon style={mark.innerStyle} type={mark.icon} /></span> |
| | | } |
| | | } else if (mark.space) { |
| | | val = <><span style={{float: 'left'}} dangerouslySetInnerHTML={{__html: mark.space}}></span>{val}</> |
| | | } else if (mark.point) { |
| | | if (mark.position === 'front') { |
| | | val = <>{mark.point}{val}</> |
| | | } else { |
| | | val = <>{val}{mark.point}</> |
| | | } |
| | | } |
| | | className = mark.signType |
| | |
| | | } else { |
| | | val = <span>{val} <MkIcon style={mark.innerStyle} type={mark.icon} /></span> |
| | | } |
| | | } else if (mark.space) { |
| | | val = <><span style={{float: 'left'}} dangerouslySetInnerHTML={{__html: mark.space}}></span>{val}</> |
| | | } else if (mark.point) { |
| | | if (mark.position === 'front') { |
| | | val = <>{mark.point}{val}</> |
| | | } else { |
| | | val = <>{val}{mark.point}</> |
| | | } |
| | | } |
| | | className = mark.signType |
| | | } |
| | |
| | | } |
| | | } else if (mark.innerStyle) { |
| | | content = <span style={mark.innerStyle}>{content}</span> |
| | | } else if (mark.space) { |
| | | content = <><span dangerouslySetInnerHTML={{__html: mark.space}}></span>{content}</> |
| | | } else if (mark.point) { |
| | | if (mark.position === 'front') { |
| | | content = <>{mark.point}{content}</> |
| | | } else { |
| | | content = <>{content}{mark.point}</> |
| | | } |
| | | } |
| | | } |
| | | if (col.blur) { |
| | |
| | | } |
| | | } else if (mark.innerStyle) { |
| | | content = <span style={mark.innerStyle}>{content}</span> |
| | | } else if (mark.space) { |
| | | content = <><span dangerouslySetInnerHTML={{__html: mark.space}}></span>{content}</> |
| | | } else if (mark.point) { |
| | | if (mark.position === 'front') { |
| | | content = <>{mark.point}{content}</> |
| | | } else { |
| | | content = <>{content}{mark.point}</> |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | } else if (mark.innerStyle) { |
| | | content = <span style={mark.innerStyle}>{content}</span> |
| | | } else if (mark.space) { |
| | | content = <><span dangerouslySetInnerHTML={{__html: mark.space}}></span>{content}</> |
| | | } else if (mark.point) { |
| | | if (mark.position === 'front') { |
| | | content = <>{mark.point}{content}</> |
| | | } else { |
| | | content = <>{content}{mark.point}</> |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | } else if (mark.innerStyle) { |
| | | content = <span style={mark.innerStyle}>{content}</span> |
| | | } else if (mark.space) { |
| | | content = <><span dangerouslySetInnerHTML={{__html: mark.space}}></span>{content}</> |
| | | } else if (mark.point) { |
| | | if (mark.position === 'front') { |
| | | content = <>{mark.point}{content}</> |
| | | } else { |
| | | content = <>{content}{mark.point}</> |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | } else if (mark.innerStyle) { |
| | | content = <span style={mark.innerStyle}>{content}</span> |
| | | } else if (mark.space) { |
| | | content = <><span dangerouslySetInnerHTML={{__html: mark.space}}></span>{content}</> |
| | | } else if (mark.point) { |
| | | if (mark.position === 'front') { |
| | | content = <>{mark.point}{content}</> |
| | | } else { |
| | | content = <>{content}{mark.point}</> |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | } else if (mark.innerStyle) { |
| | | content = <span style={mark.innerStyle}>{content}</span> |
| | | } else if (mark.space) { |
| | | content = <><span dangerouslySetInnerHTML={{__html: mark.space}}></span>{content}</> |
| | | } else if (mark.point) { |
| | | if (mark.position === 'front') { |
| | | content = <>{mark.point}{content}</> |
| | | } else { |
| | | content = <>{content}{mark.point}</> |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | } else if (mark.innerStyle) { |
| | | content = <span style={mark.innerStyle}>{content}</span> |
| | | } else if (mark.space) { |
| | | content = <><span dangerouslySetInnerHTML={{__html: mark.space}}></span>{content}</> |
| | | } else if (mark.point) { |
| | | if (mark.position === 'front') { |
| | | content = <>{mark.point}{content}</> |
| | | } else { |
| | | content = <>{content}{mark.point}</> |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | } else if (mark.innerStyle) { |
| | | content = <span style={mark.innerStyle}>{content}</span> |
| | | } else if (mark.space) { |
| | | content = <><span dangerouslySetInnerHTML={{__html: mark.space}}></span>{content}</> |
| | | } else if (mark.point) { |
| | | if (mark.position === 'front') { |
| | | content = <>{mark.point}{content}</> |
| | | } else { |
| | | content = <>{content}{mark.point}</> |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | } else if (mark.innerStyle) { |
| | | content = <span style={mark.innerStyle}>{content}</span> |
| | | } else if (mark.space) { |
| | | content = <><span dangerouslySetInnerHTML={{__html: mark.space}}></span>{content}</> |
| | | } else if (mark.point) { |
| | | if (mark.position === 'front') { |
| | | content = <>{mark.point}{content}</> |
| | | } else { |
| | | content = <>{content}{mark.point}</> |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | import React from 'react' |
| | | import moment from 'moment' |
| | | import md5 from 'md5' |
| | | |
| | |
| | | * @description 获取标记信息 |
| | | */ |
| | | export function getMark (marks, record, style = {}) { |
| | | let icon = null |
| | | let innerStyle = null |
| | | let position = null |
| | | let signType = '' |
| | | let res = {} |
| | | style = JSON.parse(JSON.stringify(style)) |
| | | |
| | | marks.some(mark => { |
| | |
| | | |
| | | if (type === 'font') { |
| | | style.color = mark.color |
| | | innerStyle = {color: mark.color} |
| | | signType = ' sign-font' |
| | | res.innerStyle = {color: mark.color} |
| | | res.signType = ' sign-font' |
| | | } else if (type === 'background') { |
| | | style.backgroundColor = mark.color |
| | | if (mark.fontColor) { |
| | | style.color = mark.fontColor |
| | | innerStyle = {color: mark.fontColor} |
| | | res.innerStyle = {color: mark.fontColor} |
| | | } |
| | | } else if (type === 'underline') { |
| | | style.textDecoration = 'underline' |
| | | style.color = mark.color |
| | | innerStyle = {color: mark.color, textDecoration: 'underline'} |
| | | res.innerStyle = {color: mark.color, textDecoration: 'underline'} |
| | | } else if (type === 'line-through') { |
| | | style.textDecoration = 'line-through' |
| | | style.color = mark.color |
| | | innerStyle = {color: mark.color, textDecoration: 'line-through'} |
| | | res.innerStyle = {color: mark.color, textDecoration: 'line-through'} |
| | | } else if (type.indexOf('icon') > -1) { |
| | | icon = mark.signType[mark.signType.length - 1] |
| | | innerStyle = {color: mark.color} |
| | | res.icon = mark.signType[mark.signType.length - 1] |
| | | res.innerStyle = {color: mark.color} |
| | | if (type === 'iconfront' || mark.signType[1] === 'front') { |
| | | position = 'front' |
| | | res.position = 'front' |
| | | } else { |
| | | position = 'back' |
| | | res.position = 'back' |
| | | } |
| | | } else if (type === 'indent') { |
| | | style.color = mark.color |
| | | res.space = Array(mark.signType[1] + 1).join(' ') |
| | | } else if (type === 'pointfront') { |
| | | res.position = 'front' |
| | | res.point = <span style={{display: 'inline-block', marginRight: '3px', width: '8px', height: '8px', borderRadius: '14px', background: mark.color, verticalAlign: 'middle'}}></span> |
| | | } else if (type === 'pointback') { |
| | | res.position = 'back' |
| | | res.point = <span style={{display: 'inline-block', marginLeft: '3px', width: '8px', height: '8px', borderRadius: '14px', background: mark.color, verticalAlign: 'middle'}}></span> |
| | | } |
| | | |
| | | return true |
| | | }) |
| | | |
| | | return { |
| | | style, |
| | | icon, |
| | | innerStyle, |
| | | position, |
| | | signType |
| | | } |
| | | return res |
| | | } |
| | | |
| | | /** |