From 5902ba5c3ff85efc78c95364196cd6ab5d2d1601 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期日, 11 十月 2020 12:21:17 +0800 Subject: [PATCH] 2020-10-11 --- src/menu/stylecontroller/index.jsx | 39 +++++++++++++++++++++++++-------------- 1 files changed, 25 insertions(+), 14 deletions(-) diff --git a/src/menu/stylecontroller/index.jsx b/src/menu/stylecontroller/index.jsx index 82faa61..2e80909 100644 --- a/src/menu/stylecontroller/index.jsx +++ b/src/menu/stylecontroller/index.jsx @@ -260,11 +260,7 @@ this.updateStyle({height: _val}) } - changeBorderRadius = (val) => { - this.updateStyle({borderRadius: val}) - } - - changeMarginOrPadding = (val, type) => { + changeNormalStyle = (val, type) => { this.updateStyle({[type]: val}) } @@ -502,7 +498,7 @@ label={<Icon title="鍦嗚" type="radius-setting" />} labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 20 }} } > - <StyleInput defaultValue={card.borderRadius || ''} options={['px', '%']} onChange={this.changeBorderRadius}/> + <StyleInput defaultValue={card.borderRadius || ''} options={['px', '%']} onChange={(val) => this.changeNormalStyle(val, 'borderRadius')}/> </Form.Item> </Col> </Panel> : null} @@ -512,7 +508,7 @@ colon={false} label={<Icon title="涓婅竟璺�" type="arrow-up"/>} > - <StyleInput defaultValue={card.marginTop} options={['px', 'vh', 'vw']} onChange={(val) => this.changeMarginOrPadding(val, 'marginTop')}/> + <StyleInput defaultValue={card.marginTop} options={['px', 'vh', 'vw']} onChange={(val) => this.changeNormalStyle(val, 'marginTop')}/> </Form.Item> </Col> <Col span={12}> @@ -520,7 +516,7 @@ colon={false} label={<Icon title="涓嬭竟璺�" type="arrow-down"/>} > - <StyleInput defaultValue={card.marginBottom} options={['px', 'vh', 'vw']} onChange={(val) => this.changeMarginOrPadding(val, 'marginBottom')}/> + <StyleInput defaultValue={card.marginBottom} options={['px', 'vh', 'vw']} onChange={(val) => this.changeNormalStyle(val, 'marginBottom')}/> </Form.Item> </Col> <Col span={12}> @@ -528,7 +524,7 @@ colon={false} label={<Icon title="宸﹁竟璺�" type="arrow-left"/>} > - <StyleInput defaultValue={card.marginLeft} options={['px', 'vh', 'vw']} onChange={(val) => this.changeMarginOrPadding(val, 'marginLeft')}/> + <StyleInput defaultValue={card.marginLeft} options={['px', 'vh', 'vw']} onChange={(val) => this.changeNormalStyle(val, 'marginLeft')}/> </Form.Item> </Col> <Col span={12}> @@ -536,7 +532,7 @@ colon={false} label={<Icon title="鍙宠竟璺�" type="arrow-right"/>} > - <StyleInput defaultValue={card.marginRight} options={['px', 'vh', 'vw']} onChange={(val) => this.changeMarginOrPadding(val, 'marginRight')}/> + <StyleInput defaultValue={card.marginRight} options={['px', 'vh', 'vw']} onChange={(val) => this.changeNormalStyle(val, 'marginRight')}/> </Form.Item> </Col> </Panel> : null} @@ -546,7 +542,7 @@ colon={false} label={<Icon title="涓婅竟璺�" type="arrow-up"/>} > - <StyleInput defaultValue={card.paddingTop} options={['px', 'vh', 'vw']} onChange={(val) => this.changeMarginOrPadding(val, 'paddingTop')}/> + <StyleInput defaultValue={card.paddingTop} options={['px', 'vh', 'vw']} onChange={(val) => this.changeNormalStyle(val, 'paddingTop')}/> </Form.Item> </Col> <Col span={12}> @@ -554,7 +550,7 @@ colon={false} label={<Icon title="涓嬭竟璺�" type="arrow-down"/>} > - <StyleInput defaultValue={card.paddingBottom} options={['px', 'vh', 'vw']} onChange={(val) => this.changeMarginOrPadding(val, 'paddingBottom')}/> + <StyleInput defaultValue={card.paddingBottom} options={['px', 'vh', 'vw']} onChange={(val) => this.changeNormalStyle(val, 'paddingBottom')}/> </Form.Item> </Col> <Col span={12}> @@ -562,7 +558,7 @@ colon={false} label={<Icon title="宸﹁竟璺�" type="arrow-left"/>} > - <StyleInput defaultValue={card.paddingLeft} options={['px', 'vh', 'vw']} onChange={(val) => this.changeMarginOrPadding(val, 'paddingLeft')}/> + <StyleInput defaultValue={card.paddingLeft} options={['px', 'vh', 'vw']} onChange={(val) => this.changeNormalStyle(val, 'paddingLeft')}/> </Form.Item> </Col> <Col span={12}> @@ -570,7 +566,22 @@ colon={false} label={<Icon title="鍙宠竟璺�" type="arrow-right"/>} > - <StyleInput defaultValue={card.paddingRight} options={['px', 'vh', 'vw']} onChange={(val) => this.changeMarginOrPadding(val, 'paddingRight')}/> + <StyleInput defaultValue={card.paddingRight} options={['px', 'vh', 'vw']} onChange={(val) => this.changeNormalStyle(val, 'paddingRight')}/> + </Form.Item> + </Col> + </Panel> : null} + {options.includes('float') ? <Panel header="娴姩" key="float"> + <Col span={24}> + <Form.Item + colon={false} + label={<Icon title="娴姩" type="swap" />} + labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 20 }} } + > + <Radio.Group defaultValue={card.float || 'left'} onChange={(e) => this.changeNormalStyle(e.target.value, 'float')}> + <Radio value="left">宸︽诞鍔�</Radio> + <Radio value="right">鍙虫诞鍔�</Radio> + <Radio value="none">涓嶆诞鍔�</Radio> + </Radio.Group> </Form.Item> </Col> </Panel> : null} -- Gitblit v1.8.0