From eabede786184b634bb7fc0344262ae040732e03b Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期日, 05 二月 2023 22:27:05 +0800
Subject: [PATCH] 2023-02-05

---
 src/menu/stylecombcontroller/styleInput/index.jsx |    2 +-
 src/menu/stylecontroller/syscolorsketch/index.jsx |    2 +-
 src/menu/stylecombcontroller/index.jsx            |   52 ++++++++++++++++++++++++++++++++++++++++++++++++----
 3 files changed, 50 insertions(+), 6 deletions(-)

diff --git a/src/menu/stylecombcontroller/index.jsx b/src/menu/stylecombcontroller/index.jsx
index e47bdd3..5d83165 100644
--- a/src/menu/stylecombcontroller/index.jsx
+++ b/src/menu/stylecombcontroller/index.jsx
@@ -30,6 +30,7 @@
 
 import MKEmitter from '@/utils/events.js'
 import ColorSketch from '@/mob/colorsketch'
+import SysColorSketch from '@/menu/stylecontroller/syscolorsketch'
 import StyleInput from './styleInput'
 import './index.scss'
 
@@ -242,6 +243,7 @@
   }
 
   render () {
+    const { style, borposition } = this.state
     const formItemLayout = {
       labelCol: {
         xs: { span: 24 },
@@ -251,6 +253,20 @@
         xs: { span: 24 },
         sm: { span: 16 }
       }
+    }
+
+    let borderColor = ''
+
+    if (borposition === 'outer') {
+      borderColor = style.borderColor || ''
+    } else if (borposition === 'left') {
+      borderColor = style.borderLeftColor || ''
+    } else if (borposition === 'right') {
+      borderColor = style.borderRightColor || ''
+    } else if (borposition === 'top') {
+      borderColor = style.borderTopColor || ''
+    } else if (borposition === 'bottom') {
+      borderColor = style.borderBottomColor || ''
     }
 
     return (
@@ -312,7 +328,14 @@
                     label={<FontColorsOutlined title="瀛椾綋棰滆壊"/>}
                     labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 20 }} }
                   >
-                    <ColorSketch onChange={this.changeFontColor} />
+                    <ColorSketch value={style.color || ''} onChange={this.changeFontColor} />
+                  </Form.Item>
+                  <Form.Item
+                    colon={false}
+                    label={<BgColorsOutlined title="绯荤粺鑹�"/>}
+                    labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 20 }} }
+                  >
+                    <SysColorSketch onChange={this.changeFontColor} />
                   </Form.Item>
                 </Col>
                 <Col span={24}>
@@ -363,7 +386,14 @@
                     label={<BgColorsOutlined title="鑳屾櫙棰滆壊"/>}
                     labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 20 }} }
                   >
-                    <ColorSketch onChange={this.changeBackgroundColor} />
+                    <ColorSketch value={style.backgroundColor || ''} onChange={this.changeBackgroundColor} />
+                  </Form.Item>
+                  <Form.Item
+                    colon={false}
+                    label={<BgColorsOutlined title="绯荤粺鑹�"/>}
+                    labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 20 }} }
+                  >
+                    <SysColorSketch onChange={this.changeBackgroundColor} />
                   </Form.Item>
                 </Col>
               </Panel>
@@ -412,7 +442,14 @@
                     label={<BgColorsOutlined title="杈规棰滆壊"/>}
                     labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 20 }} }
                   >
-                    <ColorSketch onChange={this.changeBorderColor} />
+                    <ColorSketch value={borderColor} onChange={this.changeBorderColor} />
+                  </Form.Item>
+                  <Form.Item
+                    colon={false}
+                    label={<BgColorsOutlined title="绯荤粺鑹�"/>}
+                    labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 20 }} }
+                  >
+                    <SysColorSketch onChange={this.changeBorderColor} />
                   </Form.Item>
                 </Col>
                 <Col span={24}>
@@ -432,7 +469,14 @@
                     label={<BgColorsOutlined title="闃村奖棰滆壊"/>}
                     labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 20 }} }
                   >
-                    <ColorSketch onChange={this.changeShadowColor} />
+                    <ColorSketch value={style.shadow || ''} onChange={this.changeShadowColor} />
+                  </Form.Item>
+                  <Form.Item
+                    colon={false}
+                    label={<BgColorsOutlined title="绯荤粺鑹�"/>}
+                    labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 20 }} }
+                  >
+                    <SysColorSketch onChange={this.changeShadowColor} />
                   </Form.Item>
                 </Col>
               </Panel>
diff --git a/src/menu/stylecombcontroller/styleInput/index.jsx b/src/menu/stylecombcontroller/styleInput/index.jsx
index 1a2c00c..7426b2d 100644
--- a/src/menu/stylecombcontroller/styleInput/index.jsx
+++ b/src/menu/stylecombcontroller/styleInput/index.jsx
@@ -140,7 +140,7 @@
       <div className="style-input-box">
         <Input value={value} addonAfter={
           options.length > 1 ?
-          <Select value={<span>{unit}</span>} onChange={this.changeUnit}>
+          <Select value={unit} onChange={this.changeUnit}>
             {options.map(item => <Option key={item} value={item}>{item}</Option>)}
           </Select> :
           <div className="single-unit">{unit}</div>
diff --git a/src/menu/stylecontroller/syscolorsketch/index.jsx b/src/menu/stylecontroller/syscolorsketch/index.jsx
index 20c35fc..e596a77 100644
--- a/src/menu/stylecontroller/syscolorsketch/index.jsx
+++ b/src/menu/stylecontroller/syscolorsketch/index.jsx
@@ -35,7 +35,7 @@
 
     return (
       <div className="sys-color-sketch-block">
-        {colors.map(color => <span onClick={() => this.handleChange(color)} style={ {background: color} }></span>)}
+        {colors.map(color => <span key={color} onClick={() => this.handleChange(color)} style={ {background: color} }></span>)}
       </div>
     )
   }

--
Gitblit v1.8.0