From b8aa5da1b2873bea760483cc5ab335fde9fb6de6 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 12 五月 2022 18:15:56 +0800
Subject: [PATCH] 2022-05-12

---
 src/menu/components/table/normal-table/index.jsx |   39 ++++++++++++++++++++++++++++++---------
 1 files changed, 30 insertions(+), 9 deletions(-)

diff --git a/src/menu/components/table/normal-table/index.jsx b/src/menu/components/table/normal-table/index.jsx
index 39da770..30c4592 100644
--- a/src/menu/components/table/normal-table/index.jsx
+++ b/src/menu/components/table/normal-table/index.jsx
@@ -248,20 +248,34 @@
   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) => {
     const { card } = this.state
 
-    if (comIds[0] !== card.uuid) return
+    if (comIds[0] !== card.uuid || comIds.length !== 1) return
 
-    let _card = {}
-    if (comIds.length === 1) {
-      _card = {...card, style}
-    } else {
-      return
-    }
+    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
@@ -416,7 +430,13 @@
   }
 
   updateWrap = (res) => {
-    this.updateComponent({...this.state.card, wrap: res})
+    const { card } = this.state
+
+    res.color = card.wrap.color
+    res.fontSize = card.wrap.fontSize
+    res.fontWeight = card.wrap.fontWeight
+
+    this.updateComponent({...card, wrap: res})
   }
 
   clickComponent = (e) => {
@@ -460,6 +480,7 @@
         <SearchComponent config={card} updatesearch={this.updateconfig}/>
         <ActionComponent 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