From 6055fa01416fc57ee33b291a8103ccc1a8edce44 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 20 七月 2021 23:21:14 +0800
Subject: [PATCH] 2021-07-20

---
 src/pc/bgcontroller/index.jsx |   24 ++++++++++++++++++++++--
 1 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/src/pc/bgcontroller/index.jsx b/src/pc/bgcontroller/index.jsx
index c9fcb37..b77b775 100644
--- a/src/pc/bgcontroller/index.jsx
+++ b/src/pc/bgcontroller/index.jsx
@@ -25,6 +25,7 @@
     backgroundImage: '',
     backgroundSize: '',
     backgroundRepeat: '',
+    backgroundPositon: '',
     opacity: '',
   }
 
@@ -42,7 +43,8 @@
       backgroundColor: config.style.backgroundColor,
       backgroundImage: bgImg,
       backgroundSize: config.style.backgroundSize || '100%',
-      backgroundRepeat: config.style.backgroundRepeat || 'repeat'
+      backgroundRepeat: config.style.backgroundRepeat || 'repeat',
+      backgroundPositon: config.style.backgroundPositon || 'center'
     })
   }
 
@@ -112,9 +114,20 @@
     this.props.updateConfig(config)
   }
 
+  backgroundPositonChange = (val) => {
+    this.setState({
+      backgroundPositon: val
+    })
+
+    let config = fromJS(this.props.config).toJS()
+    config.style.backgroundPositon = val
+
+    this.props.updateConfig(config)
+  }
+
   render () {
     const { config } = this.props
-    const { backgroundColor, backgroundImage, backgroundSize, backgroundRepeat } = this.state
+    const { backgroundColor, backgroundImage, backgroundSize, backgroundRepeat, backgroundPositon } = this.state
     const formItemLayout = {
       labelCol: {
         xs: { span: 24 },
@@ -158,6 +171,13 @@
               <Option value="repeat-y">repeat-y</Option>
             </Select>
           </Form.Item>
+          <Form.Item colon={false} label="浣嶇疆">
+            <Select defaultValue={backgroundPositon} onChange={this.backgroundPositonChange}>
+              <Option value="center">center</Option>
+              <Option value="top">top</Option>
+              <Option value="bottom">bottom</Option>
+            </Select>
+          </Form.Item>
           <p style={{borderBottom: '1px solid #eaeaea', color: '#40a9ff'}}>鍐呰竟璺�</p>
           <Form.Item
             colon={false}

--
Gitblit v1.8.0