From 8f394e7ef20cc0abba3f47c23a63b069e9dd0e45 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期三, 19 十月 2022 15:09:30 +0800
Subject: [PATCH] 2022-10-19

---
 src/menu/components/card/prop-card/index.jsx |   29 +++++++----------------------
 1 files changed, 7 insertions(+), 22 deletions(-)

diff --git a/src/menu/components/card/prop-card/index.jsx b/src/menu/components/card/prop-card/index.jsx
index d379bfc..0bec608 100644
--- a/src/menu/components/card/prop-card/index.jsx
+++ b/src/menu/components/card/prop-card/index.jsx
@@ -44,8 +44,6 @@
       let _card = {
         uuid: card.uuid,
         type: card.type,
-        tabId: card.tabId || '',
-        parentId: card.parentId || '',
         format: 'object',   // 缁勪欢灞炴�� - 鏁版嵁鏍煎紡
         pageable: false,    // 缁勪欢灞炴�� - 鏄惁鍙垎椤�
         switchable: true,  // 缁勪欢灞炴�� - 鏁版嵁鏄惁鍙垏鎹�
@@ -107,7 +105,6 @@
 
   componentDidMount () {
     MKEmitter.addListener('mkUpdateInter', this.mkUpdateInter)
-    MKEmitter.addListener('submitComponentStyle', this.updateComponentStyle)
   }
 
   shouldComponentUpdate (nextProps, nextState) {
@@ -122,24 +119,6 @@
       return
     }
     MKEmitter.removeListener('mkUpdateInter', this.mkUpdateInter)
-    MKEmitter.removeListener('submitComponentStyle', this.updateComponentStyle)
-  }
-
-  updateComponentStyle = (parentId, keys, style) => {
-    const { card } = this.state
-
-    if (card.uuid !== parentId) return
-
-    let subcards = card.subcards.map(item => {
-      if (keys.includes(item.uuid)) {
-        item.style = {...item.style, ...style}
-      }
-      return item
-    })
-
-    this.setState({card: {...card, subcards: []}}, () => {
-      this.updateComponent({...card, subcards: subcards})
-    })
   }
 
   mkUpdateInter = (inter, split) => {
@@ -540,7 +519,13 @@
   clickComponent = (e) => {
     if (sessionStorage.getItem('style-control') === 'true' || sessionStorage.getItem('style-control') === 'component') {
       e.stopPropagation()
-      MKEmitter.emit('clickComponent', this.state.card)
+      MKEmitter.emit('clickComponent', this.state.card.uuid, null, (style) => {
+        let _card = {...this.state.card}
+        _card.style = {..._card.style, ...style}
+
+        this.setState({ card: _card })
+        this.props.updateConfig(_card)
+      })
     }
   }
 

--
Gitblit v1.8.0