From f6626b05f1275cc2f8ca77f773d4f6a6af1b0a89 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期一, 21 十一月 2022 16:11:55 +0800
Subject: [PATCH] 2022-11-21

---
 src/templates/zshare/unattended/index.jsx |   21 +++++++++++++++------
 1 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/src/templates/zshare/unattended/index.jsx b/src/templates/zshare/unattended/index.jsx
index 4b6b8f5..abb8018 100644
--- a/src/templates/zshare/unattended/index.jsx
+++ b/src/templates/zshare/unattended/index.jsx
@@ -27,12 +27,20 @@
     const { config } = this.props
     let actions = []
 
-    config.action.forEach(item => {
-      if (item.position !== 'toolbar') return
-      if (['pop', 'prompt', 'exec'].includes(item.OpenType) || (item.OpenType === 'funcbutton' && item.funcType === 'print')) {
-        actions.push(item)
-      }
-    })
+    if (config.components) {
+      config.components[0].action.forEach(item => {
+        if (['pop', 'prompt', 'exec'].includes(item.OpenType) || (item.OpenType === 'funcbutton' && item.funcType === 'print')) {
+          actions.push(item)
+        }
+      })
+    } else {
+      config.action.forEach(item => {
+        if (item.position !== 'toolbar') return
+        if (['pop', 'prompt', 'exec'].includes(item.OpenType) || (item.OpenType === 'funcbutton' && item.funcType === 'print')) {
+          actions.push(item)
+        }
+      })
+    }
 
     this.setState({
       actions,
@@ -48,6 +56,7 @@
       this.setState({
         visible: false
       })
+
       this.props.updateConfig({...config, autoMatic: res})
     })
   }

--
Gitblit v1.8.0