From cc810edac6aec3c858fb352091ad8c11332447a5 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期日, 10 十二月 2023 19:12:53 +0800 Subject: [PATCH] Merge branch 'develop' --- src/menu/stylecontroller/index.jsx | 42 +++++++++++++++++++++++++++++++++++------- 1 files changed, 35 insertions(+), 7 deletions(-) diff --git a/src/menu/stylecontroller/index.jsx b/src/menu/stylecontroller/index.jsx index b60a0b0..89f5ca9 100644 --- a/src/menu/stylecontroller/index.jsx +++ b/src/menu/stylecontroller/index.jsx @@ -29,7 +29,8 @@ ArrowRightOutlined, SwapOutlined, EnterOutlined, - DragOutlined + DragOutlined, + EyeOutlined } from '@ant-design/icons' import MKEmitter from '@/utils/events.js' @@ -56,6 +57,7 @@ } callback = null + timer = null shouldComponentUpdate (nextProps, nextState) { return !is(fromJS(this.state), fromJS(nextState)) @@ -96,6 +98,8 @@ } this.callback = callback + this.timer = null + let card = fromJS(style).toJS() let borposition = 'outer' @@ -163,7 +167,7 @@ this.callback = null } - updateStyle = (style) => { + updateStyle = (style, delay) => { const { card } = this.state let _style = { @@ -191,7 +195,15 @@ card: _style, }) - this.callback && this.callback(_style) + this.timer && clearTimeout(this.timer) + + if (delay) { + this.timer = setTimeout(() => { + this.callback && this.callback(_style) + }, 300) + } else { + this.callback && this.callback(_style) + } } /** @@ -208,7 +220,7 @@ value = 300 } - this.updateStyle({fontSize: `${value}px`}) + this.updateStyle({fontSize: `${value}px`}, true) } /** @@ -219,7 +231,7 @@ if (isNaN(value) || value < 1 || value > 10) return - this.updateStyle({lineHeight: value}) + this.updateStyle({lineHeight: value}, true) } /** @@ -230,7 +242,7 @@ if (isNaN(value) || value < 0 || value > 100) return - this.updateStyle({letterSpacing: `${value}px`}) + this.updateStyle({letterSpacing: `${value}px`}, true) } /** @@ -241,7 +253,7 @@ if (isNaN(value) || value < 0 || value > 100) return - this.updateStyle({textIndent: `${value}px`}) + this.updateStyle({textIndent: `${value}px`}, true) } changeBackground = (val) => { @@ -510,6 +522,8 @@ delete style.right } else if (n === 'transform') { delete style.transform + } else if (n === 'overflow') { + delete style.overflow } }) } @@ -1064,6 +1078,20 @@ </Form.Item> </Col> </Panel> : null} + {options.includes('overflow') ? <Panel header="婧㈠嚭" key="overflow"> + <Col span={24}> + <Form.Item + colon={false} + label={<EyeOutlined title="婧㈠嚭"/>} + labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 20 }} } + > + <Radio.Group style={{whiteSpace: 'nowrap'}} defaultValue={card.overflow || 'hidden'} onChange={(e) => this.changeNormalStyle(e.target.value, 'overflow')}> + <Radio value="hidden">闅愯棌</Radio> + <Radio value="visible">鏄剧ず</Radio> + </Radio.Group> + </Form.Item> + </Col> + </Panel> : null} {options.includes('position') ? <Panel header="瀹氫綅" key="position"> <div style={{paddingLeft: '35px', fontSize: '12px'}}>娉細瀹氫綅鏁堟灉璇峰湪杩愯鐜涓煡鐪嬨��</div> <Col span={24}> -- Gitblit v1.8.0