From 3b103caa6bfc9ed410e67156c3ca1785bf1cecc9 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期五, 19 八月 2022 01:15:31 +0800
Subject: [PATCH] 2022-08-19

---
 src/menu/components/share/actioncomponent/index.jsx |   12 +++---------
 1 files changed, 3 insertions(+), 9 deletions(-)

diff --git a/src/menu/components/share/actioncomponent/index.jsx b/src/menu/components/share/actioncomponent/index.jsx
index f7e1175..f64746e 100644
--- a/src/menu/components/share/actioncomponent/index.jsx
+++ b/src/menu/components/share/actioncomponent/index.jsx
@@ -65,7 +65,6 @@
 
   componentDidMount () {
     MKEmitter.addListener('addButton', this.addButton)
-    MKEmitter.addListener('submitStyle', this.getStyle)
   }
 
   /**
@@ -90,14 +89,11 @@
       return
     }
     MKEmitter.removeListener('addButton', this.addButton)
-    MKEmitter.removeListener('submitStyle', this.getStyle)
   }
 
-  getStyle = (comIds, style) => {
+  getStyle = (style) => {
     const { config } = this.props
     const { card, actionlist } = this.state
-
-    if (comIds[0] !== config.uuid || comIds[1] !== 'actionlist') return
 
     let _card = fromJS(card).toJS()
     _card.style = style
@@ -115,8 +111,6 @@
   }
 
   changeBtnStyle = (element) => {
-    const { config } = this.props
-
     let _style = element.style ? fromJS(element.style).toJS() : {}
     let options = ['font', 'border', 'background', 'margin', 'padding']
 
@@ -124,7 +118,7 @@
       card: element
     })
 
-    MKEmitter.emit('changeStyle', [config.uuid, 'actionlist', element.uuid], options, _style)
+    MKEmitter.emit('changeStyle', options, _style, this.getStyle)
   }
 
   addButton = (cardId, element) => {
@@ -517,7 +511,7 @@
     const { actionlist, visible, appType, card, dict, profVisible, record } = this.state
 
     return (
-      <div className={'model-menu-action-list'}>
+      <div className={'model-menu-action-list length' + actionlist.length}>
         <DragElement
           list={actionlist}
           type={appType === 'mob' ? (type || '') : ''}

--
Gitblit v1.8.0