From bdfec44c9f3a37dbbe05bf14a252ffec04132a86 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 06 九月 2022 21:24:28 +0800
Subject: [PATCH] Merge branch 'develop'

---
 src/menu/components/card/prop-card/index.jsx |   80 ++++++++++++++++++---------------------
 1 files changed, 37 insertions(+), 43 deletions(-)

diff --git a/src/menu/components/card/prop-card/index.jsx b/src/menu/components/card/prop-card/index.jsx
index 3dc9f8d..daf0cb9 100644
--- a/src/menu/components/card/prop-card/index.jsx
+++ b/src/menu/components/card/prop-card/index.jsx
@@ -109,7 +109,6 @@
   }
 
   componentDidMount () {
-    MKEmitter.addListener('submitStyle', this.getStyle)
     // MKEmitter.addListener('logButton', this.logButton)
     MKEmitter.addListener('submitComponentStyle', this.updateComponentStyle)
   }
@@ -125,7 +124,6 @@
     this.setState = () => {
       return
     }
-    MKEmitter.removeListener('submitStyle', this.getStyle)
     // MKEmitter.removeListener('logButton', this.logButton)
     MKEmitter.removeListener('submitComponentStyle', this.updateComponentStyle)
   }
@@ -185,7 +183,7 @@
     }
 
     if (card.wrap.datatype === 'static') {
-      let supModule = card.wrap.supModule ? card.wrap.supModule[card.wrap.supModule.length - 1] : ''
+      // let supModule = card.wrap.supModule ? card.wrap.supModule[card.wrap.supModule.length - 1] : ''
       card.subcards.forEach((item, i) => {
         let linkbtn = item.setting.linkbtn || ''
 
@@ -194,12 +192,12 @@
             if (cell.OpenType === 'pop' || (cell.OpenType === 'funcbutton' && cell.execMode === 'pop')) {
               if (!cell.modal || cell.modal.fields.length === 0) {
                 card.errors.push({ level: 1, detail: `鎸夐挳鈥�${cell.label}鈥濅腑琛ㄥ崟灏氭湭娣诲姞`})
-              } else if (!supModule) {
-                cell.modal.fields.forEach(m => {
-                  if (m.type === 'linkMain') {
-                    card.errors.push({ level: 1, detail: `鎸夐挳鈥�${cell.label}鈥濅腑鍏宠仈涓昏〃琛ㄥ崟鈥�${m.label}鈥濇棤鏁坄})
-                  }
-                })
+              // } else if (!supModule) {
+              //   cell.modal.fields.forEach(m => {
+              //     if (m.type === 'linkMain') {
+              //       card.errors.push({ level: 1, detail: `鎸夐挳鈥�${cell.label}鈥濅腑鍏宠仈涓昏〃琛ㄥ崟鈥�${m.label}鈥濇棤鏁坄})
+              //     }
+              //   })
               }
             }
             if (linkbtn && linkbtn === cell.uuid) {
@@ -216,12 +214,12 @@
               if (cell.OpenType === 'pop' || (cell.OpenType === 'funcbutton' && cell.execMode === 'pop')) {
                 if (!cell.modal || cell.modal.fields.length === 0) {
                   card.errors.push({ level: 1, detail: `鎸夐挳鈥�${cell.label}鈥濅腑琛ㄥ崟灏氭湭娣诲姞`})
-                } else if (!supModule) {
-                  cell.modal.fields.forEach(m => {
-                    if (m.type === 'linkMain') {
-                      card.errors.push({ level: 1, detail: `鎸夐挳鈥�${cell.label}鈥濅腑鍏宠仈涓昏〃琛ㄥ崟鈥�${m.label}鈥濇棤鏁坄})
-                    }
-                  })
+                // } else if (!supModule) {
+                //   cell.modal.fields.forEach(m => {
+                //     if (m.type === 'linkMain') {
+                //       card.errors.push({ level: 1, detail: `鎸夐挳鈥�${cell.label}鈥濅腑鍏宠仈涓昏〃琛ㄥ崟鈥�${m.label}鈥濇棤鏁坄})
+                //     }
+                //   })
                 }
               }
               if (linkbtn && linkbtn === cell.uuid) {
@@ -238,12 +236,12 @@
         }
       })
     } else {
-      let supModule = card.setting.supModule ? card.setting.supModule[card.setting.supModule.length - 1] || '' : ''
-      if (supModule === 'empty') {
-        supModule = ''
-      }
+      // let supModule = card.setting.supModule ? card.setting.supModule[card.setting.supModule.length - 1] || '' : ''
+      // if (supModule === 'empty') {
+      //   supModule = ''
+      // }
       let columns = card.columns.map(c => c.field)
-      let lowcols = card.columns.map(c => c.field.toLowerCase())
+      // let lowcols = card.columns.map(c => c.field.toLowerCase())
 
       if (card.setting.interType === 'system' && card.setting.execute !== 'false' && !card.setting.dataresource) {
         card.errors.push({ level: 0, detail: '鏈缃暟鎹簮锛�'})
@@ -264,14 +262,14 @@
             if (cell.OpenType === 'pop' || (cell.OpenType === 'funcbutton' && cell.execMode === 'pop')) {
               if (!cell.modal || cell.modal.fields.length === 0) {
                 card.errors.push({ level: 1, detail: `鎸夐挳鈥�${cell.label}鈥濅腑琛ㄥ崟灏氭湭娣诲姞`})
-              } else {
-                cell.modal.fields.forEach(m => {
-                  if (m.type === 'linkMain' && !supModule) {
-                    card.errors.push({ level: 1, detail: `鎸夐挳鈥�${cell.label}鈥濅腑鍏宠仈涓昏〃琛ㄥ崟鈥�${m.label}鈥濇棤鏁坄})
-                  } else if (m.field && !columns.includes(m.field) && lowcols.includes(m.field.toLowerCase())) {
-                    card.errors.push({ level: 1, detail: `鎸夐挳鈥�${cell.label}鈥濅腑琛ㄥ崟鈥�${m.label}鈥濆ぇ灏忓啓涓庡瓧娈甸泦涓嶄竴鑷碻})
-                  }
-                })
+              // } else {
+              //   cell.modal.fields.forEach(m => {
+              //     if (m.type === 'linkMain' && !supModule) {
+              //       card.errors.push({ level: 1, detail: `鎸夐挳鈥�${cell.label}鈥濅腑鍏宠仈涓昏〃琛ㄥ崟鈥�${m.label}鈥濇棤鏁坄})
+              //     } else if (m.field && !columns.includes(m.field) && lowcols.includes(m.field.toLowerCase())) {
+              //       card.errors.push({ level: 1, detail: `鎸夐挳鈥�${cell.label}鈥濅腑琛ㄥ崟鈥�${m.label}鈥濆ぇ灏忓啓涓庡瓧娈甸泦涓嶄竴鑷碻})
+              //     }
+              //   })
               }
             }
             if (linkbtn && linkbtn === cell.uuid) {
@@ -288,14 +286,14 @@
               if (cell.OpenType === 'pop' || (cell.OpenType === 'funcbutton' && cell.execMode === 'pop')) {
                 if (!cell.modal || cell.modal.fields.length === 0) {
                   card.errors.push({ level: 1, detail: `鎸夐挳鈥�${cell.label}鈥濅腑琛ㄥ崟灏氭湭娣诲姞`})
-                } else {
-                  cell.modal.fields.forEach(m => {
-                    if (m.type === 'linkMain' && !supModule) {
-                      card.errors.push({ level: 1, detail: `鎸夐挳鈥�${cell.label}鈥濅腑鍏宠仈涓昏〃琛ㄥ崟鈥�${m.label}鈥濇棤鏁坄})
-                    } else if (m.field && !columns.includes(m.field) && lowcols.includes(m.field.toLowerCase())) {
-                      card.errors.push({ level: 1, detail: `鎸夐挳鈥�${cell.label}鈥濅腑琛ㄥ崟鈥�${m.label}鈥濆ぇ灏忓啓涓庡瓧娈甸泦涓嶄竴鑷碻})
-                    }
-                  })
+                // } else {
+                //   cell.modal.fields.forEach(m => {
+                //     if (m.type === 'linkMain' && !supModule) {
+                //       card.errors.push({ level: 1, detail: `鎸夐挳鈥�${cell.label}鈥濅腑鍏宠仈涓昏〃琛ㄥ崟鈥�${m.label}鈥濇棤鏁坄})
+                //     } else if (m.field && !columns.includes(m.field) && lowcols.includes(m.field.toLowerCase())) {
+                //       card.errors.push({ level: 1, detail: `鎸夐挳鈥�${cell.label}鈥濅腑琛ㄥ崟鈥�${m.label}鈥濆ぇ灏忓啓涓庡瓧娈甸泦涓嶄竴鑷碻})
+                //     }
+                //   })
                 }
               }
               if (linkbtn && linkbtn === cell.uuid) {
@@ -379,15 +377,11 @@
   changeStyle = () => {
     const { card } = this.state
 
-    MKEmitter.emit('changeStyle', [card.uuid], ['background', 'border', 'padding', 'margin', 'shadow'], card.style)
+    MKEmitter.emit('changeStyle', ['background', 'border', 'padding', 'margin', 'shadow'], card.style, this.getStyle)
   }
 
-  getStyle = (comIds, style) => {
-    const { card } = this.state
-
-    if (comIds.length !== 1 || comIds[0] !== card.uuid) return
-
-    let _card = {...card, style}
+  getStyle = (style) => {
+    let _card = {...this.state.card, style}
     
     this.updateComponent(_card)
   }

--
Gitblit v1.8.0