From 1ba430d58ea3fd662d09b99f6e22ed3b3564a356 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期五, 03 二月 2023 14:15:31 +0800
Subject: [PATCH] 2023-02-03

---
 src/menu/stylecontroller/index.jsx |   30 ++++++++++++++++++++++--------
 1 files changed, 22 insertions(+), 8 deletions(-)

diff --git a/src/menu/stylecontroller/index.jsx b/src/menu/stylecontroller/index.jsx
index 053ee15..397fa05 100644
--- a/src/menu/stylecontroller/index.jsx
+++ b/src/menu/stylecontroller/index.jsx
@@ -435,12 +435,20 @@
   }
 
   changeWidth = (val) => {
-    let _val = val
-    if (_val === '0px') {
-      _val = 'auto'
+    const { card } = this.state
+    let _style = {...card}
+
+    if (val === '0px') {
+      delete _style.width
+    } else {
+      _style.width = val
     }
 
-    this.updateStyle({width: _val})
+    this.setState({
+      card: _style
+    })
+
+    this.callback && this.callback(_style)
   }
 
   changeHeight = (val) => {
@@ -495,7 +503,7 @@
                     label={<ColumnWidthOutlined title="瀹藉害"/>}
                     labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 20 }} }
                   >
-                    <StyleInput defaultValue={card.width || ''} options={['px', 'vh', 'vw', '%']} onChange={this.changeWidth}/>
+                    <StyleInput defaultValue={card.width || ''} options={['px', 'vh', 'vw', '%', 'auto']} onChange={this.changeWidth}/>
                   </Form.Item>
                 </Col>
               </Panel> : null}
@@ -675,8 +683,14 @@
                   >
                     <Select defaultValue={card.backgroundPosition || 'center'} onChange={this.changeBackgroundPositon}>
                       <Option value="center">center</Option>
-                      <Option value="top">top</Option>
-                      <Option value="bottom">bottom</Option>
+                      <Option value="center top">center top</Option>
+                      <Option value="center bottom">center bottom</Option>
+                      <Option value="left top">left top</Option>
+                      <Option value="left center">left center</Option>
+                      <Option value="left bottom">left bottom</Option>
+                      <Option value="right top">right top</Option>
+                      <Option value="right center">right center</Option>
+                      <Option value="right bottom">right bottom</Option>
                     </Select>
                   </Form.Item>
                 </Col> : null}
@@ -907,7 +921,7 @@
                     label={<ColumnHeightOutlined title="鏈�灏忛珮搴�"/>}
                     labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 20 }} }
                   >
-                    <StyleInput defaultValue={card.minHeight || '28px'} options={['px']} onChange={(val) => this.changeNormalStyle(val, 'minHeight')}/>
+                    <StyleInput defaultValue={card.minHeight || ''} options={['px', 'vh', 'vw']} onChange={(val) => this.changeNormalStyle(val, 'minHeight')}/>
                   </Form.Item>
                 </Col>
               </Panel> : null}

--
Gitblit v1.8.0