From fa381753ef2a2b25b1c0722549ac17e333da79be Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 06 九月 2022 22:50:54 +0800
Subject: [PATCH] 2022-09-06

---
 src/menu/components/form/formaction/index.jsx |   37 +++++++++++++++++++++----------------
 1 files changed, 21 insertions(+), 16 deletions(-)

diff --git a/src/menu/components/form/formaction/index.jsx b/src/menu/components/form/formaction/index.jsx
index 35ebf53..10b6797 100644
--- a/src/menu/components/form/formaction/index.jsx
+++ b/src/menu/components/form/formaction/index.jsx
@@ -32,10 +32,6 @@
     profVisible: false,  // 楠岃瘉淇℃伅缂栬緫
   }
 
-  componentDidMount () {
-    MKEmitter.addListener('submitStyle', this.getStyle)
-  }
-
   shouldComponentUpdate (nextProps, nextState) {
     return !is(fromJS(this.props.group), fromJS(nextProps.group)) || !is(fromJS(this.state), fromJS(nextState))
   }
@@ -47,12 +43,9 @@
     this.setState = () => {
       return
     }
-    MKEmitter.removeListener('submitStyle', this.getStyle)
   }
 
   handleStyle = (element) => {
-    const { group } = this.props
-
     let _style = element.style ? fromJS(element.style).toJS() : {}
     let options = ['font', 'border', 'padding', 'margin', 'backgroundColor', 'width']
 
@@ -60,19 +53,18 @@
       card: element
     })
 
-    MKEmitter.emit('changeStyle', [group.uuid, element.type], options, _style)
+    MKEmitter.emit('changeStyle', options, _style, this.getStyle)
   }
 
-  getStyle = (comIds, style) => {
+  getStyle = (style) => {
+    const { card } = this.state
     let group = fromJS(this.props.group).toJS()
 
-    if (comIds.length !== 2 || comIds[0] !== group.uuid) return
-
-    if (comIds[1] === 'prev') {
+    if (card.type === 'prev') {
       group.prevButton.style = style
-    } else if (comIds[1] === 'submit') {
+    } else if (card.type === 'submit') {
       group.subButton.style = style
-    } else if (comIds[1] === 'next') {
+    } else if (card.type === 'next') {
       group.nextButton.style = style
     }
 
@@ -101,8 +93,17 @@
       <p style={{marginBottom: '5px'}}>{this.state.dict['model.tooltip.func.innerface'].replace('@ableField', ableField)}</p>
     </div>
 
-    let modules = MenuUtils.getSubModules(window.GLOB.customMenu.components, config.uuid) || []
+    let supId = ''
+    if (config.wrap.linkType === 'sup') {
+      supId = config.wrap.supModule[config.wrap.supModule.length - 1]
+    }
+
+    let modules = MenuUtils.getSubModules(window.GLOB.customMenu.components, config.uuid, supId) || []
     let anchors = MenuUtils.getAnchors(window.GLOB.customMenu.components, config.uuid) || []
+
+    if (card.type === 'submit' && !card.Ot) {
+      card.Ot = config.wrap.datatype === 'static' ? 'notRequired' : 'requiredSgl'
+    }
 
     this.setState({
       visible: true,
@@ -158,6 +159,7 @@
     this.setState({
       profVisible: true
     })
+    MKEmitter.emit('modalStatus', '楠岃瘉淇℃伅')
   }
 
   /**
@@ -173,6 +175,7 @@
         profVisible: false
       })
       this.props.updateconfig(group)
+      MKEmitter.emit('modalStatus', false)
     })
   }
 
@@ -226,7 +229,7 @@
         <Modal
           title={dict['model.edit']}
           visible={visible}
-          width={800}
+          width={920}
           maskClosable={false}
           onCancel={this.editModalCancel}
           footer={[
@@ -257,9 +260,11 @@
             if (this.verifyRef.handleCancel) {
               this.verifyRef.handleCancel().then(() => {
                 this.setState({ profVisible: false })
+                MKEmitter.emit('modalStatus', false)
               })
             } else {
               this.setState({ profVisible: false })
+              MKEmitter.emit('modalStatus', false)
             }
           }}
           destroyOnClose

--
Gitblit v1.8.0