From 95f2f60ba9eb343c2605e1ae68c221443d75f704 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期六, 30 十一月 2019 00:55:07 +0800
Subject: [PATCH] commontable-update

---
 src/templates/comtableconfig/actionform/index.jsx |   43 ++++++++++++++++++++++++++++++++-----------
 1 files changed, 32 insertions(+), 11 deletions(-)

diff --git a/src/templates/comtableconfig/actionform/index.jsx b/src/templates/comtableconfig/actionform/index.jsx
index e299728..c9c3d81 100644
--- a/src/templates/comtableconfig/actionform/index.jsx
+++ b/src/templates/comtableconfig/actionform/index.jsx
@@ -1,7 +1,9 @@
 import React, {Component} from 'react'
 import PropTypes from 'prop-types'
-import { Form, Row, Col, Input, Select, Icon, Radio } from 'antd'
+import { Form, Row, Col, Input, Select, Icon, Radio, notification } from 'antd'
 import './index.scss'
+
+const { TextArea } = Input
 
 const btnIcons = [{
   MenuID: '',
@@ -105,9 +107,9 @@
       _options = ['label', 'Ot', 'OpenType', 'icon', 'class', 'position']
     } else {
       if (_intertype === 'outer') {
-      _options = ['label', 'position', 'OpenType', 'intertype', 'innerFunc', 'interface', 'outerFunc', 'callbackFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError']
+      _options = ['label', 'position', 'OpenType', 'intertype', 'innerFunc', 'interface', 'outerFunc', 'callbackFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError', 'method']
       } else {
-        _options = ['label', 'position', 'OpenType', 'intertype', 'innerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError']
+        _options = ['label', 'position', 'OpenType', 'intertype', 'innerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError', 'sql']
       }
     }
     this.setState({
@@ -144,9 +146,9 @@
         _options = ['label', 'Ot', 'OpenType', 'icon', 'class', 'position']
       } else {
         if (this.state.interType === 'inner') {
-          _options = ['label', 'position', 'OpenType', 'intertype', 'innerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError']
+          _options = ['label', 'position', 'OpenType', 'intertype', 'innerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError', 'sql']
         } else {
-          _options = ['label', 'position', 'OpenType', 'intertype', 'innerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError', 'interface', 'outerFunc', 'callbackFunc']
+          _options = ['label', 'position', 'OpenType', 'intertype', 'innerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError', 'interface', 'outerFunc', 'callbackFunc', 'method']
         }
       }
       this.setState({
@@ -193,9 +195,9 @@
     if (key === 'intertype') {
       let _options = null
       if (value === 'inner') {
-        _options = ['label', 'position', 'OpenType', 'intertype', 'innerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError']
+        _options = ['label', 'position', 'OpenType', 'intertype', 'innerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError', 'sql']
       } else {
-        _options = ['label', 'position', 'OpenType', 'intertype', 'innerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError', 'interface', 'outerFunc', 'callbackFunc']
+        _options = ['label', 'position', 'OpenType', 'intertype', 'innerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError', 'interface', 'outerFunc', 'callbackFunc', 'method']
       }
       this.setState({
         interType: value,
@@ -284,6 +286,16 @@
             </Form.Item>
           </Col>
         )
+      } else if (item.type === 'textarea') {
+        fields.push(
+          <Col span={24} key={index}>
+            <Form.Item label={item.label} help={this.props.dict['header.form.datasource.actionhelp']} className="textarea">
+              {getFieldDecorator(item.key, {
+                initialValue: item.initVal
+              })(<TextArea rows={4} />)}
+            </Form.Item>
+          </Col>
+        )
       }
     })
     return fields
@@ -296,10 +308,19 @@
         if (!err) {
           values.id = this.props.card.id
           values.uuid = this.props.card.uuid
-          resolve({
-            type: 'action',
-            values
-          })
+
+          if (values.innerFunc === '' && values.sql === '') {
+            notification.warning({
+              top: 92,
+              message: this.props.dict['header.form.datasource.actionhelp'],
+              duration: 10
+            })
+          } else {
+            resolve({
+              type: 'action',
+              values
+            })
+          }
         } else {
           reject(err)
         }

--
Gitblit v1.8.0