From 0472ec32cadb4f9bca6dbab82ac33a42e76f37ed Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 28 六月 2022 16:24:15 +0800
Subject: [PATCH] 菜单栏&时间轴

---
 src/menu/stylecontroller/index.jsx |   34 +++++++++++++++++++++++++++++++++-
 1 files changed, 33 insertions(+), 1 deletions(-)

diff --git a/src/menu/stylecontroller/index.jsx b/src/menu/stylecontroller/index.jsx
index 1cd4572..a98c24b 100644
--- a/src/menu/stylecontroller/index.jsx
+++ b/src/menu/stylecontroller/index.jsx
@@ -1,7 +1,7 @@
 import React, {Component} from 'react'
 import PropTypes from 'prop-types'
 import { is, fromJS } from 'immutable'
-import { Collapse, Form, Col, InputNumber, Select, Radio, Drawer, Button } from 'antd'
+import { Collapse, Form, Col, InputNumber, Input, Select, Radio, Drawer, Button } from 'antd'
 import {
   ColumnHeightOutlined,
   FontSizeOutlined,
@@ -259,6 +259,29 @@
    */
   changeBackgroundColor = (val) => {
     this.updateStyle({backgroundColor: val})
+  }
+
+  changeBackground = (val) => {
+    const { comIds, card } = this.state
+
+    let _style = { ...card }
+
+    _style.background = val
+
+    delete _style.backgroundColor
+    delete _style.backgroundImage
+
+    if (!val) {
+      delete _style.background
+    }
+
+    this.setState({
+      card: _style,
+    })
+
+    if (!val || /(^linear-gradient|^radial-gradient)\(.*\)$/.test(val)) {
+      MKEmitter.emit('submitStyle', comIds, _style)
+    }
   }
 
   /**
@@ -578,6 +601,15 @@
                     <ColorSketch value={card.backgroundColor || '#ffffff'} onChange={this.changeBackgroundColor} />
                   </Form.Item>
                 </Col>
+                {window.develop === true ? <Col span={24}>
+                  <Form.Item
+                    colon={false}
+                    label={<BgColorsOutlined title="鑳屾櫙棰滆壊"/>}
+                    labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 20 }} }
+                  >
+                    <Input value={card.background || ''} onChange={(e) => this.changeBackground(e.target.value)} />
+                  </Form.Item>
+                </Col> : null}
                 {!options.includes('backgroundColor') ? <Col span={24}>
                   <Form.Item
                     colon={false}

--
Gitblit v1.8.0