From 1ea9fe09a611dea3a05131e349a8e8dd46adcf6a Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期五, 01 四月 2022 22:50:33 +0800
Subject: [PATCH] 2022-04-01

---
 src/mob/modalconfig/index.jsx |   23 +++++++++++++++++++++++
 1 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/src/mob/modalconfig/index.jsx b/src/mob/modalconfig/index.jsx
index 5c4aceb..6c60904 100644
--- a/src/mob/modalconfig/index.jsx
+++ b/src/mob/modalconfig/index.jsx
@@ -65,6 +65,7 @@
   }
 
   componentDidMount () {
+    MKEmitter.addListener('submitStyle', this.getStyle)
     MKEmitter.addListener('completeSave', this.completeSave)
   }
 
@@ -75,11 +76,30 @@
     this.setState = () => {
       return
     }
+    MKEmitter.removeListener('submitStyle', this.getStyle)
     MKEmitter.removeListener('completeSave', this.completeSave)
   }
 
   completeSave = () => {
     this.setState({saving: false})
+  }
+
+  getStyle = (comIds, style) => {
+    const { config } = this.state
+
+    if (comIds[0] !== 'form') return
+
+    let Index = config.fields.findIndex(n => n.uuid === comIds[1])
+
+    if (Index === -1) return
+    
+    let _config = fromJS(config).toJS()
+
+    _config.fields[Index].style = style
+
+    this.setState({
+      config: _config
+    })
   }
 
   /**
@@ -223,6 +243,9 @@
         }
 
         if (item.uuid === res.uuid) {
+          if (item.style) {
+            res.style = item.style
+          }
           return res
         } else {
           return item

--
Gitblit v1.8.0