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/table-card/index.jsx |   50 ++++++++++++++++++++------------------------------
 1 files changed, 20 insertions(+), 30 deletions(-)

diff --git a/src/menu/components/card/table-card/index.jsx b/src/menu/components/card/table-card/index.jsx
index 919af41..1c498ad 100644
--- a/src/menu/components/card/table-card/index.jsx
+++ b/src/menu/components/card/table-card/index.jsx
@@ -2,7 +2,7 @@
 import PropTypes from 'prop-types'
 import { is, fromJS } from 'immutable'
 import { Popover, Modal, Pagination } from 'antd'
-import { PlusOutlined, PlusCircleOutlined, PlusSquareOutlined, EditOutlined, ToolOutlined, DeleteOutlined, FontColorsOutlined } from '@ant-design/icons'
+import { PlusOutlined, PlusCircleOutlined, PlusSquareOutlined, EditOutlined, ToolOutlined, DeleteOutlined, FontColorsOutlined, DownOutlined } from '@ant-design/icons'
 
 import asyncComponent from '@/utils/asyncComponent'
 import asyncIconComponent from '@/utils/asyncIconComponent'
@@ -136,11 +136,6 @@
     }
   }
 
-  componentDidMount () {
-    MKEmitter.addListener('submitStyle', this.getStyle)
-    // MKEmitter.addListener('logButton', this.logButton)
-  }
-
   shouldComponentUpdate (nextProps, nextState) {
     return !is(fromJS(this.state), fromJS(nextState))
   }
@@ -152,8 +147,6 @@
     this.setState = () => {
       return
     }
-    MKEmitter.removeListener('submitStyle', this.getStyle)
-    // MKEmitter.removeListener('logButton', this.logButton)
   }
 
   // logButton = (id, item) => {
@@ -186,12 +179,12 @@
 
     card.errors = []
 
-    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.subcards.length === 0) {
       card.errors.push({ level: 0, detail: '鍗$墖涓嶅彲涓虹┖锛�'})
@@ -216,14 +209,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) {
@@ -300,15 +293,11 @@
   changeStyle = () => {
     const { card } = this.state
 
-    MKEmitter.emit('changeStyle', [card.uuid], ['height', 'background', 'border', 'padding', 'margin', 'shadow'], card.style)
+    MKEmitter.emit('changeStyle', ['height', 'background', 'border', 'padding', 'margin', 'shadow'], card.style, this.getStyle)
   }
 
-  getStyle = (comIds, style) => {
-    const { card } = this.state
-
-    if (comIds[0] !== card.uuid || comIds.length > 1) return
-
-    let _card = {...card, style}
+  getStyle = (style) => {
+    let _card = {...this.state.card, style}
 
     this.updateComponent(_card)
   }
@@ -611,8 +600,9 @@
         <div style={{minHeight: 'calc(100% - 90px)'}}>
           {card.subcards.map(subcard => (<CardSimpleComponent key={subcard.uuid} cards={card} card={subcard} updateElement={this.updateCard} move={this.move} deleteElement={this.deleteCard}/>))}
         </div>
-        {card.setting.laypage === 'true' && card.wrap.pagestyle !== 'slide' && appType !== 'mob' ? <Pagination size="small" total={50} /> : null}
-        {card.setting.laypage === 'true' && card.wrap.pagestyle !== 'slide' && appType === 'mob' ? <MobPagination /> : null}
+        {card.setting.laypage === 'true' && card.wrap.pagestyle === 'page' && appType !== 'mob' ? <Pagination size="small" total={50} /> : null}
+        {card.setting.laypage === 'true' && card.wrap.pagestyle === 'page' && appType === 'mob' ? <MobPagination /> : null}
+        {card.setting.laypage === 'true' && card.wrap.pagestyle === 'more' ? <div className="mk-more">鏌ョ湅鏇村<DownOutlined/></div> : null}
         <div className="component-name">
           <div className="center">
             <div className="title">{card.name}</div>

--
Gitblit v1.8.0