From 2ae980243b7ad705dea575eadcfc4cf4e24073bd Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 17 五月 2022 22:57:19 +0800
Subject: [PATCH] Merge branch 'master' into positec

---
 src/menu/components/table/edit-table/index.jsx |   36 +++++++++++++++++++++++++++++++-----
 1 files changed, 31 insertions(+), 5 deletions(-)

diff --git a/src/menu/components/table/edit-table/index.jsx b/src/menu/components/table/edit-table/index.jsx
index 933ea98..ed2e7f9 100644
--- a/src/menu/components/table/edit-table/index.jsx
+++ b/src/menu/components/table/edit-table/index.jsx
@@ -194,7 +194,12 @@
   changeStyle = () => {
     const { card } = this.state
 
-    MKEmitter.emit('changeStyle', [card.uuid], ['background', 'border', 'padding', 'margin', 'shadow'], card.style)
+    let style = {...card.style}
+    style.color = card.wrap.color || 'rgba(0, 0, 0, 0.65)'
+    style.fontSize = card.wrap.fontSize || 14
+    style.fontWeight = card.wrap.fontWeight || 'normal'
+
+    MKEmitter.emit('changeStyle', [card.uuid], ['font1', 'background', 'border', 'padding', 'margin', 'shadow'], style)
   }
 
   getStyle = (comIds, style) => {
@@ -202,7 +207,21 @@
 
     if (comIds[0] !== card.uuid || comIds.length !== 1) return
 
-    let _card = {...card, style}
+    let _card = fromJS(card).toJS()
+    let _style = fromJS(style).toJS()
+
+    let color = style.color
+    let fontSize = style.fontSize
+    let fontWeight = style.fontWeight
+
+    delete _style.color
+    delete _style.fontSize
+    delete _style.fontWeight
+
+    _card.style = _style
+    _card.wrap.color = color
+    _card.wrap.fontSize = fontSize
+    _card.wrap.fontWeight = fontWeight
 
     this.setState({
       card: _card
@@ -310,13 +329,19 @@
   }
 
   updateWrap = (res) => {
-    let card = {...this.state.card, wrap: res}
+    const { card } = this.state
+
+    res.color = card.wrap.color
+    res.fontSize = card.wrap.fontSize
+    res.fontWeight = card.wrap.fontWeight
+
+    let _card = {...card, wrap: res}
 
     if (res.tableType) {
-      card.switchable = true
+      _card.switchable = true
     }
     
-    this.updateComponent(card)
+    this.updateComponent(_card)
   }
 
   clickComponent = (e) => {
@@ -354,6 +379,7 @@
         <SearchComponent config={card} updatesearch={this.updateconfig}/>
         <ActionComponent type="editable" config={card} setSubConfig={this.setSubConfig} updateaction={this.updateComponent}/>
         <ColumnComponent config={card} updatecolumn={this.updateconfig}/>
+        <div className="component-name"><div className="center">{card.name}</div></div>
       </div>
     )
   }

--
Gitblit v1.8.0