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/mob/modalconfig/index.jsx |   31 +++++++++++++++++++++++++------
 1 files changed, 25 insertions(+), 6 deletions(-)

diff --git a/src/mob/modalconfig/index.jsx b/src/mob/modalconfig/index.jsx
index 2aaddfc..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
+    })
   }
 
   /**
@@ -198,11 +218,6 @@
       card.linkSubField = card.linkSubField.filter(item => fields.includes(item))
     }
 
-    if (!card.span && standardform && standardform.span) {
-      card.span = standardform.span
-      card.labelwidth = standardform.labelwidth
-    }
-
     this.setState({
       standardform,
       visible: true,
@@ -228,6 +243,9 @@
         }
 
         if (item.uuid === res.uuid) {
+          if (item.style) {
+            res.style = item.style
+          }
           return res
         } else {
           return item
@@ -470,7 +488,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