From cdd5b449130ea4d7223fde4f414a11a7d0c33d6d Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 07 三月 2024 17:52:16 +0800
Subject: [PATCH] 2024-03-07

---
 src/tabviews/custom/components/chart/antv-X6/nodeupdate/nodeform.jsx |   34 ++++++++++++----------------------
 1 files changed, 12 insertions(+), 22 deletions(-)

diff --git a/src/tabviews/custom/components/chart/antv-X6/nodeupdate/nodeform.jsx b/src/tabviews/custom/components/chart/antv-X6/nodeupdate/nodeform.jsx
index 3de31eb..a400204 100644
--- a/src/tabviews/custom/components/chart/antv-X6/nodeupdate/nodeform.jsx
+++ b/src/tabviews/custom/components/chart/antv-X6/nodeupdate/nodeform.jsx
@@ -1,6 +1,6 @@
 import React, {Component} from 'react'
 import PropTypes from 'prop-types'
-import { Form, Row, Col, Input, Radio, Tooltip, InputNumber } from 'antd'
+import { Form, Row, Col, Input, Radio, Tooltip, InputNumber, Switch } from 'antd'
 import { QuestionCircleOutlined } from '@ant-design/icons'
 
 import MemberForm from './memberform'
@@ -15,13 +15,19 @@
 
   state = {
     flowType: this.props.data.flowType || 'approval',
-    execCondition: this.props.data.execCondition || 'close',
+    execCondition: this.props.data.execCondition === 'open',
   }
 
   handleConfirm = () => {
     return new Promise((resolve, reject) => {
       this.props.form.validateFieldsAndScroll((err, values) => {
         if (!err) {
+          if (values.execCondition === true) {
+            values.execCondition = 'open'
+          } else if (values.execCondition === false) {
+            values.execCondition = 'close'
+          }
+
           if (values.matchVal) {
             values.matchVal = values.matchVal.replace(/\t+|\v+|\s+/g, '')
           }
@@ -162,16 +168,14 @@
           {nodetype === 'edge' && flowType !== 'reject' ? <Col span={12}>
             <Form.Item label="鎵ц鏉′欢">
               {getFieldDecorator('execCondition', {
+                valuePropName: 'checked',
                 initialValue: execCondition
               })(
-                <Radio.Group onChange={(e) => this.setState({execCondition: e.target.value})}>
-                  <Radio value="close">鍏抽棴</Radio>
-                  <Radio value="open">寮�鍚�</Radio>
-                </Radio.Group>
+                <Switch checkedChildren="寮�鍚�" unCheckedChildren="鍏抽棴" onChange={(val) => this.setState({execCondition: val})} />
               )}
             </Form.Item>
           </Col> : null}
-          {nodetype === 'edge' && flowType !== 'reject' && execCondition === 'open' ? <Col span={12}>
+          {nodetype === 'edge' && flowType !== 'reject' && execCondition ? <Col span={12}>
             <Form.Item label="瀵规瘮鏂瑰紡">
               {getFieldDecorator('match', {
                 initialValue: data.match || '='
@@ -187,7 +191,7 @@
               )}
             </Form.Item>
           </Col> : null}
-          {nodetype === 'edge' && flowType !== 'reject' && execCondition === 'open' ? <Col span={12}>
+          {nodetype === 'edge' && flowType !== 'reject' && execCondition ? <Col span={12}>
             <Form.Item label={
               <Tooltip placement="topLeft" title="瀵规瘮鍊间腑涓嶅彲鍖呭惈鍒惰〃绗︺�佺┖鏍笺�佹崲琛岀绛夈��">
                 <QuestionCircleOutlined className="mk-form-tip" />
@@ -196,20 +200,6 @@
             }>
               {getFieldDecorator('matchVal', {
                 initialValue: data.matchVal || ''
-              })(
-                <Input placeholder="" autoComplete="off"/>
-              )}
-            </Form.Item>
-          </Col> : null}
-          {nodetype === 'node' ? <Col span={12}>
-            <Form.Item label={
-              <Tooltip placement="topLeft" title="鏍囪灏嗕綔涓鸿妭鐐笽D">
-                <QuestionCircleOutlined className="mk-form-tip" />
-                鏍囪
-              </Tooltip>
-            }>
-              {getFieldDecorator('sign', {
-                initialValue: data.sign || ''
               })(
                 <Input placeholder="" autoComplete="off"/>
               )}

--
Gitblit v1.8.0