From a1a52f94207e8b0e11750e4edc3681221ff1c53a Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 10 十月 2023 16:31:06 +0800 Subject: [PATCH] 2023-10-10 --- src/menu/components/share/sourcecomponent/inputform/index.scss | 4 + src/tabviews/custom/components/card/cardcellList/index.jsx | 24 ++++++ src/menu/components/share/sourcecomponent/inputform/index.jsx | 2 src/tabviews/custom/components/share/normalTable/index.jsx | 24 ++++++ src/menu/components/share/markcomponent/index.jsx | 45 +++++++++++ src/menu/components/share/sourcecomponent/index.jsx | 2 src/utils/utils.js | 41 +++++----- src/tabviews/custom/components/table/edit-table/normalTable/index.jsx | 48 ++++++++++++ 8 files changed, 167 insertions(+), 23 deletions(-) diff --git a/src/menu/components/share/markcomponent/index.jsx b/src/menu/components/share/markcomponent/index.jsx index 246f2ea..f198d58 100644 --- a/src/menu/components/share/markcomponent/index.jsx +++ b/src/menu/components/share/markcomponent/index.jsx @@ -118,7 +118,21 @@ '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 ( @@ -249,6 +263,7 @@ }) } ] + let signs = [ { value: 'font', @@ -267,6 +282,14 @@ label: '涓垝绾�' }, { + value: 'pointfront', + label: '鐐癸紙鍓嶏級' + }, + { + value: 'pointback', + label: '鐐癸紙鍚庯級' + }, + { value: 'iconfront', label: '鍥炬爣锛堝墠锛�', children: icons @@ -275,12 +298,32 @@ 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%' diff --git a/src/menu/components/share/sourcecomponent/index.jsx b/src/menu/components/share/sourcecomponent/index.jsx index bf42033..fe17598 100644 --- a/src/menu/components/share/sourcecomponent/index.jsx +++ b/src/menu/components/share/sourcecomponent/index.jsx @@ -88,7 +88,7 @@ </div> : null} <Modal visible={!!visible} - width={visible !== 'system' ? 600 : 1000} + width={visible !== 'system' ? 650 : 1000} closable={false} maskClosable={false} okText="纭畾" diff --git a/src/menu/components/share/sourcecomponent/inputform/index.jsx b/src/menu/components/share/sourcecomponent/inputform/index.jsx index 5f552ce..0a06300 100644 --- a/src/menu/components/share/sourcecomponent/inputform/index.jsx +++ b/src/menu/components/share/sourcecomponent/inputform/index.jsx @@ -174,7 +174,7 @@ 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@浠f浛鍩熷悕锛堝惈铏氭嫙鐩綍锛夛紝濡傦細@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 }}}> diff --git a/src/menu/components/share/sourcecomponent/inputform/index.scss b/src/menu/components/share/sourcecomponent/inputform/index.scss index 576da5d..fc5b77f 100644 --- a/src/menu/components/share/sourcecomponent/inputform/index.scss +++ b/src/menu/components/share/sourcecomponent/inputform/index.scss @@ -50,6 +50,10 @@ position: relative; top: -15px; } + .ant-form-explain { + margin-top: 5px; + word-break: break-all; + } } .picture-edit-model { .ant-modal { diff --git a/src/tabviews/custom/components/card/cardcellList/index.jsx b/src/tabviews/custom/components/card/cardcellList/index.jsx index 4661704..fed3d09 100644 --- a/src/tabviews/custom/components/card/cardcellList/index.jsx +++ b/src/tabviews/custom/components/card/cardcellList/index.jsx @@ -426,6 +426,14 @@ } 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 } @@ -507,6 +515,14 @@ 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 @@ -876,6 +892,14 @@ } 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 } diff --git a/src/tabviews/custom/components/share/normalTable/index.jsx b/src/tabviews/custom/components/share/normalTable/index.jsx index 849c996..be531d2 100644 --- a/src/tabviews/custom/components/share/normalTable/index.jsx +++ b/src/tabviews/custom/components/share/normalTable/index.jsx @@ -144,6 +144,14 @@ } } 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) { @@ -208,6 +216,14 @@ } } 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}</> + } } } @@ -385,6 +401,14 @@ } } 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}</> + } } } diff --git a/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx b/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx index 5f5eb04..0f95fec 100644 --- a/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx +++ b/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx @@ -309,6 +309,14 @@ } } 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}</> + } } } @@ -397,6 +405,14 @@ } } 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}</> + } } } @@ -494,6 +510,14 @@ } } 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}</> + } } } @@ -746,6 +770,14 @@ } } 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}</> + } } } @@ -813,6 +845,14 @@ } } 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}</> + } } } @@ -899,6 +939,14 @@ } } 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}</> + } } } diff --git a/src/utils/utils.js b/src/utils/utils.js index a3f7acc..7da4357 100644 --- a/src/utils/utils.js +++ b/src/utils/utils.js @@ -1,3 +1,4 @@ +import React from 'react' import moment from 'moment' import md5 from 'md5' @@ -2394,10 +2395,7 @@ * @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 => { @@ -2434,42 +2432,45 @@ 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 } /** -- Gitblit v1.8.0