From f895e8af9e6a393f71fec0dc26fdf1b9b6616cb4 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期五, 11 十二月 2020 18:53:04 +0800
Subject: [PATCH] 2020-12-11

---
 src/views/menudesign/index.jsx |   82 ++++++++++++++++++++++++++++++-----------
 1 files changed, 60 insertions(+), 22 deletions(-)

diff --git a/src/views/menudesign/index.jsx b/src/views/menudesign/index.jsx
index 4d27f54..3c0331d 100644
--- a/src/views/menudesign/index.jsx
+++ b/src/views/menudesign/index.jsx
@@ -221,6 +221,18 @@
             buttons.push(`select '${btn.uuid}' as menuid, '${item.name + '-' + btn.label}' as menuname, '${_sort * 10}' as Sort`)
             _sort++
           })
+        } else if (item.type === 'table' && item.subtype === 'normaltable') {
+          item.action && item.action.forEach(btn => {
+            buttons.push(`select '${btn.uuid}' as menuid, '${item.name + '-' + btn.label}' as menuname, '${_sort * 10}' as Sort`)
+            _sort++
+          })
+          item.cols && item.cols.forEach(col => {
+            if (col.type !== 'action') return
+            col.elements.forEach(btn => {
+              buttons.push(`select '${btn.uuid}' as menuid, '${item.name + '-' + btn.label}' as menuname, '${_sort * 10}' as Sort`)
+              _sort++
+            })
+          })
         }
       })
     }
@@ -300,7 +312,6 @@
 
     if (config.MenuType !== 'billPrint') {
       btnParam.LText = this.getMenuMessage()
-
       btnParam.LText = btnParam.LText.join(' union all ')
       btnParam.LText = Utils.formatOptions(btnParam.LText)
       btnParam.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
@@ -358,29 +369,56 @@
       }).then(res => {
         if (!res) return
 
-        Api.getSystemConfig(param).then(response => {
-          if (response.status) {
-            this.setState({
-              oriConfig: fromJS(_config).toJS(),
-              openEdition: response.open_edition || '',
-              menuloading: false
-            })
-            notification.success({
-              top: 92,
-              message: '淇濆瓨鎴愬姛',
-              duration: 2
-            })
+        return Api.getSystemConfig(param)
+      }).then(res => {
+        if (!res) return
+
+        if (res.status) {
+          this.setState({
+            oriConfig: fromJS(_config).toJS(),
+            openEdition: res.open_edition || ''
+          })
+
+          if (btnParam.LText) {
+            return Api.getSystemConfig(btnParam)
           } else {
-            this.setState({
-              menuloading: false
-            })
-            notification.warning({
-              top: 92,
-              message: response.message,
-              duration: 5
-            })
+            return {
+              status: true
+            }
           }
-        })
+        } else {
+          this.setState({
+            menuloading: false
+          })
+          notification.warning({
+            top: 92,
+            message: res.message,
+            duration: 5
+          })
+          return false
+        }
+      }).then(res => {
+        if (!res) return
+        
+        if (res.status) {
+          this.setState({
+            menuloading: false
+          })
+          notification.success({
+            top: 92,
+            message: '淇濆瓨鎴愬姛',
+            duration: 2
+          })
+        } else {
+          this.setState({
+            menuloading: false
+          })
+          notification.warning({
+            top: 92,
+            message: res.message,
+            duration: 5
+          })
+        }
       })
     })
   }

--
Gitblit v1.8.0