From e2afee71874538e31ed57032e3ad1bba1188ab4b Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 20 十月 2022 15:31:41 +0800
Subject: [PATCH] 2022-10-20

---
 src/menu/components/share/actioncomponent/index.jsx |   38 ++++++++++++++++++++++++++++----------
 1 files changed, 28 insertions(+), 10 deletions(-)

diff --git a/src/menu/components/share/actioncomponent/index.jsx b/src/menu/components/share/actioncomponent/index.jsx
index cbddcc2..4a6ebd9 100644
--- a/src/menu/components/share/actioncomponent/index.jsx
+++ b/src/menu/components/share/actioncomponent/index.jsx
@@ -4,7 +4,7 @@
 import { Modal, notification, Button } from 'antd'
 
 import Utils, { FuncUtils } from '@/utils/utils.js'
-import { getActionForm } from './formconfig'
+import { getActionForm, getBaseTableActionForm } from './formconfig'
 import asyncSpinComponent from '@/utils/asyncSpinComponent'
 
 import MKEmitter from '@/utils/events.js'
@@ -169,6 +169,15 @@
       functip = ''
     }
 
+    if (config.subtype === 'basetable') {
+      this.setState({
+        visible: true,
+        card: card,
+        formlist: getBaseTableActionForm(card, functip, config, usefulFields)
+      })
+      return
+    }
+
     let supId = ''
     if (config.setting && config.setting.supModule) {
       let pid = config.setting.supModule[config.setting.supModule.length - 1]
@@ -218,7 +227,7 @@
    */
   handleSubmit = () => {
     const { config } = this.props
-    let color = { primary: '#1890ff', yellow: '#c49f47', orange: 'orange', danger: '#ff4d4f', green: '#26C281', dgreen: '#32c5d2', purple: '#8E44AD', cyan: '#13c2c2', gray: '#666666' }
+    let color = { primary: '#1890ff', yellow: '#c49f47', orange: 'orange', danger: '#ff4d4f', green: '#26C281', dgreen: '#32c5d2', purple: '#8E44AD', cyan: '#13c2c2', gray: '#666666', default: '#333333' }
     let _actionlist = fromJS(this.state.actionlist).toJS()
     
     this.actionFormRef.handleConfirm().then(btn => {
@@ -231,14 +240,23 @@
         }
 
         if (item.uuid === btn.uuid) {
-          btn.style = item.style || {}
-          if (btn.class !== item.class || btn.show !== item.show || !btn.style.color || item.focus) {
-            if (btn.show === 'icon') {
-              btn.style.color = color[btn.class]
-              btn.style.backgroundColor = 'transparent'
+          if (config.subtype === 'basetable') {
+            let _c = btn.class.replace('border-', '')
+            if (btn.class.indexOf('border') > -1 || btn.class === 'default') {
+              btn.style = {color: color[_c], backgroundColor: '#fff', borderColor: color[_c]}
             } else {
-              btn.style.color = '#ffffff'
-              btn.style.backgroundColor = color[btn.class]
+              btn.style = {color: '#fff', backgroundColor: color[_c], borderColor: color[_c]}
+            }
+          } else {
+            btn.style = item.style || {}
+            if (btn.class !== item.class || btn.show !== item.show || !btn.style.color || item.focus) {
+              if (btn.show === 'icon') {
+                btn.style.color = color[btn.class]
+                btn.style.backgroundColor = 'transparent'
+              } else {
+                btn.style.color = '#ffffff'
+                btn.style.backgroundColor = color[btn.class]
+              }
             }
           }
           return btn
@@ -491,7 +509,7 @@
       <div className={'model-menu-action-list length' + actionlist.length}>
         <DragElement
           list={actionlist}
-          type={appType === 'mob' ? config.subtype : ''}
+          type={appType === 'mob' || config.subtype === 'basetable' ? config.subtype : ''}
           handleList={this.handleList}
           dropButton={this.dropButton}
           handleMenu={this.handleAction}

--
Gitblit v1.8.0