From b223552a0c4bc787ad251add025a93d77527ffbe Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期六, 18 十二月 2021 23:36:28 +0800
Subject: [PATCH] 2021-12-18

---
 src/menu/components/share/actioncomponent/actionform/index.jsx |   46 +++++++++++++++++++++++++++++++++-------------
 1 files changed, 33 insertions(+), 13 deletions(-)

diff --git a/src/menu/components/share/actioncomponent/actionform/index.jsx b/src/menu/components/share/actioncomponent/actionform/index.jsx
index e703f77..0b3f850 100644
--- a/src/menu/components/share/actioncomponent/actionform/index.jsx
+++ b/src/menu/components/share/actioncomponent/actionform/index.jsx
@@ -11,15 +11,15 @@
 const { TextArea } = Input
 const MkIcon = asyncComponent(() => import('@/components/mkIcon'))
 const actionTypeOptions = {
-  pop: ['label', 'OpenType', 'intertype', 'Ot', 'show', 'icon', 'class', 'execSuccess', 'execError', 'resetPageIndex', 'syncComponent', 'switchTab', 'width', 'openmenu', 'open', 'output', 'refreshTab', 'reload'],
-  prompt: ['label', 'OpenType', 'intertype', 'Ot', 'show', 'icon', 'class', 'execSuccess', 'execError', 'resetPageIndex', 'syncComponent', 'switchTab', 'width', 'openmenu', 'open', 'output', 'refreshTab', 'reload'],
-  exec: ['label', 'OpenType', 'intertype', 'Ot', 'show', 'icon', 'class', 'execSuccess', 'execError', 'resetPageIndex', 'syncComponent', 'switchTab', 'width', 'openmenu', 'open', 'output', 'refreshTab', 'reload'],
-  excelIn: ['label', 'Ot', 'OpenType', 'intertype', 'show', 'icon', 'class', 'sheet', 'execSuccess', 'execError', 'resetPageIndex', 'syncComponent', 'switchTab', 'width'],
-  excelOut: ['label', 'OpenType', 'intertype', 'show', 'icon', 'class', 'execSuccess', 'execError', 'syncComponent', 'switchTab', 'resetPageIndex', 'pagination', 'search', 'width'],
-  popview: ['label', 'Ot', 'OpenType', 'show', 'icon', 'class', 'popClose', 'resetPageIndex', 'width', 'display', 'ratio', 'placement', 'syncComponent', 'clickouter'],
-  tab: ['label', 'Ot', 'OpenType', 'show', 'icon', 'class', 'linkmenu', 'width'],
-  innerpage: ['label', 'Ot', 'OpenType', 'pageTemplate', 'show', 'icon', 'class', 'width', 'open'],
-  funcbutton: ['label', 'OpenType', 'funcType', 'show', 'icon', 'class', 'width']
+  pop: ['label', 'OpenType', 'intertype', 'Ot', 'show', 'icon', 'class', 'color', 'execSuccess', 'execError', 'resetPageIndex', 'syncComponent', 'switchTab', 'width', 'openmenu', 'open', 'output', 'refreshTab', 'reload'],
+  prompt: ['label', 'OpenType', 'intertype', 'Ot', 'show', 'icon', 'class', 'color', 'execSuccess', 'execError', 'resetPageIndex', 'syncComponent', 'switchTab', 'width', 'openmenu', 'open', 'output', 'refreshTab', 'reload'],
+  exec: ['label', 'OpenType', 'intertype', 'Ot', 'show', 'icon', 'class', 'color', 'execSuccess', 'execError', 'resetPageIndex', 'syncComponent', 'switchTab', 'width', 'openmenu', 'open', 'output', 'refreshTab', 'reload'],
+  excelIn: ['label', 'Ot', 'OpenType', 'intertype', 'show', 'icon', 'class', 'color', 'sheet', 'execSuccess', 'execError', 'resetPageIndex', 'syncComponent', 'switchTab', 'width'],
+  excelOut: ['label', 'OpenType', 'intertype', 'show', 'icon', 'class', 'color', 'execSuccess', 'execError', 'syncComponent', 'switchTab', 'resetPageIndex', 'pagination', 'search', 'width'],
+  popview: ['label', 'Ot', 'OpenType', 'show', 'icon', 'class', 'color', 'popClose', 'resetPageIndex', 'width', 'display', 'ratio', 'placement', 'syncComponent', 'clickouter'],
+  tab: ['label', 'Ot', 'OpenType', 'show', 'icon', 'class', 'color', 'linkmenu', 'width'],
+  innerpage: ['label', 'Ot', 'OpenType', 'pageTemplate', 'show', 'icon', 'class', 'color', 'width', 'open'],
+  funcbutton: ['label', 'OpenType', 'funcType', 'show', 'icon', 'class', 'color', 'width']
 }
 
 class ActionForm extends Component {
@@ -363,6 +363,7 @@
       })
     } else if (key === 'sqlType') {
       let _fieldval = {}
+      let hasclass = true
       this.setState({
         formlist: this.state.formlist.map(item => {
           if (item.key === 'Ot') {
@@ -373,26 +374,45 @@
             } else {
               item.options = this.state.requireOptions
             }
+          } else if (item.key === 'class') {
+            hasclass = item.forbid !== true
           }
           return item
         })
       }, () => {
         if (value === 'insert') {
           _fieldval.label = '娣诲姞'
-          _fieldval.class = 'green'
           _fieldval.Ot = 'notRequired'
+          if (hasclass) {
+            _fieldval.class = 'green'
+          } else {
+            _fieldval.color = 'success'
+          }
         } else if (value === 'update') {
           _fieldval.label = '淇敼'
-          _fieldval.class = 'purple'
           _fieldval.Ot = 'requiredSgl'
+          if (hasclass) {
+            _fieldval.class = 'purple'
+          } else {
+            _fieldval.color = 'primary'
+          }
+          
         } else if (value === 'audit') {
           _fieldval.label = '瀹℃牳'
-          _fieldval.class = 'primary'
           _fieldval.Ot = 'requiredSgl'
+          if (hasclass) {
+            _fieldval.class = 'primary'
+          } else {
+            _fieldval.color = 'warning'
+          }
         } else if (value === 'LogicDelete' || value === 'delete') {
           _fieldval.label = '鍒犻櫎'
-          _fieldval.class = 'danger'
           _fieldval.Ot = 'requiredSgl'
+          if (hasclass) {
+            _fieldval.class = 'danger'
+          } else {
+            _fieldval.color = 'danger'
+          }
         }
 
         this.props.form.setFieldsValue(_fieldval)

--
Gitblit v1.8.0