From 5046d0d13dc6a8563b8e54e31913bc44cfa1072f Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 26 四月 2022 19:23:18 +0800
Subject: [PATCH] 2022-04-26

---
 src/menu/modalconfig/index.jsx |   26 +++++++++++++++++++++++++-
 1 files changed, 25 insertions(+), 1 deletions(-)

diff --git a/src/menu/modalconfig/index.jsx b/src/menu/modalconfig/index.jsx
index 2d63246..659bbbb 100644
--- a/src/menu/modalconfig/index.jsx
+++ b/src/menu/modalconfig/index.jsx
@@ -66,6 +66,7 @@
 
   componentDidMount () {
     MKEmitter.addListener('completeSave', this.completeSave)
+    MKEmitter.addListener('submitStyle', this.getStyle)
   }
 
   /**
@@ -76,6 +77,7 @@
       return
     }
     MKEmitter.removeListener('completeSave', this.completeSave)
+    MKEmitter.removeListener('submitStyle', this.getStyle)
   }
 
   /**
@@ -207,6 +209,24 @@
     })
   }
 
+  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
+    })
+  }
+
   /**
    * @description 缂栬緫鍚庢彁浜�
    * 1銆佽幏鍙栫紪杈戝悗鐨勮〃鍗曚俊鎭�
@@ -224,6 +244,9 @@
         }
 
         if (item.uuid === res.uuid) {
+          if (item.style) {
+            res.style = item.style
+          }
           return res
         } else {
           return item
@@ -518,7 +541,8 @@
         <Modal
           title={this.state.dict['model.edit']}
           visible={this.state.visible}
-          width={850}
+          width={950}
+          maskClosable={false}
           onCancel={this.editModalCancel}
           onOk={this.handleSubmit}
           confirmLoading={this.state.sqlVerifing}

--
Gitblit v1.8.0