From 4677982c003e357cff8f2544be44706bf31ea6de Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 05 五月 2022 19:12:19 +0800
Subject: [PATCH] 2022-05-05

---
 src/templates/sharecomponent/actioncomponent/index.jsx |   80 +++++++++++++++++++++++----------------
 1 files changed, 47 insertions(+), 33 deletions(-)

diff --git a/src/templates/sharecomponent/actioncomponent/index.jsx b/src/templates/sharecomponent/actioncomponent/index.jsx
index 8a0a704..da66039 100644
--- a/src/templates/sharecomponent/actioncomponent/index.jsx
+++ b/src/templates/sharecomponent/actioncomponent/index.jsx
@@ -24,6 +24,7 @@
 const VerifyCard = asyncSpinComponent(() => import('@/templates/zshare/verifycard'))
 const VerifyPrint = asyncSpinComponent(() => import('@/templates/sharecomponent/actioncomponent/verifyprint'))
 const VerifyExcelIn = asyncSpinComponent(() => import('@/templates/sharecomponent/actioncomponent/verifyexcelin'))
+const VerifyMegvii = asyncSpinComponent(() => import('@/templates/sharecomponent/actioncomponent/verifymegvii'))
 const VerifyExcelOut = asyncSpinComponent(() => import('@/templates/sharecomponent/actioncomponent/verifyexcelout'))
 
 class ActionComponent extends Component {
@@ -858,6 +859,51 @@
     MKEmitter.removeListener('pasteButton', this.pasteButton)
   }
 
+  getVerify = (card) => {
+    const { config } = this.props
+    const { dict } = this.state
+
+    if (!card) return null
+
+    if (['pop', 'prompt', 'exec'].includes(card.OpenType)) {
+      return <VerifyCard
+        card={card}
+        dict={dict}
+        config={config}
+        columns={config.columns}
+        wrappedComponentRef={(inst) => this.verifyRef = inst}
+      />
+    } else if (card.OpenType === 'excelIn') {
+      return <VerifyExcelIn
+        card={card}
+        dict={dict}
+        columns={config.columns}
+        wrappedComponentRef={(inst) => this.verifyRef = inst}
+      />
+    } else if (card.OpenType === 'excelOut') {
+      return <VerifyExcelOut
+        card={card}
+        dict={dict}
+        config={config}
+        wrappedComponentRef={(inst) => this.verifyRef = inst}
+      />
+    } else if (card.OpenType === 'funcbutton' && card.funcType === 'print') {
+      return <VerifyPrint
+        card={card}
+        dict={dict}
+        columns={config.columns}
+        wrappedComponentRef={(inst) => this.verifyRef = inst}
+      />
+    } else if (card.OpenType === 'funcbutton' && card.funcType === 'megvii') {
+      return <VerifyMegvii
+        card={card}
+        dict={dict}
+        columns={config.columns}
+        wrappedComponentRef={(inst) => this.verifyRef = inst}
+      />
+    }
+  }
+
   render() {
     const { config } = this.props
     const { actionlist, visible, card, dict, copying, profVisible } = this.state
@@ -921,39 +967,7 @@
           }}
           destroyOnClose
         >
-          {card && !card.execMode && card.OpenType !== 'excelIn' && card.OpenType !== 'excelOut' ?
-            <VerifyCard
-              card={card}
-              dict={dict}
-              config={config}
-              columns={config.columns}
-              wrappedComponentRef={(inst) => this.verifyRef = inst}
-            /> : null
-          }
-          {card && card.execMode ?
-            <VerifyPrint
-              card={card}
-              dict={dict}
-              columns={config.columns}
-              wrappedComponentRef={(inst) => this.verifyRef = inst}
-            /> : null
-          }
-          {card && card.OpenType === 'excelIn' ?
-            <VerifyExcelIn
-              card={card}
-              dict={dict}
-              columns={config.columns}
-              wrappedComponentRef={(inst) => this.verifyRef = inst}
-            /> : null
-          }
-          {card && card.OpenType === 'excelOut' ?
-            <VerifyExcelOut
-              card={card}
-              dict={dict}
-              config={config}
-              wrappedComponentRef={(inst) => this.verifyRef = inst}
-            /> : null
-          }
+          {this.getVerify(card)}
         </Modal>
       </div>
     )

--
Gitblit v1.8.0