From 49f09cc6f8ff8c30a75ed1a9d6f510b69b73962a Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 12 十二月 2023 21:05:37 +0800
Subject: [PATCH] 2023-12-12

---
 src/tabviews/custom/components/chart/antv-X6/nodeupdate/nodeform.jsx |   99 +++++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 91 insertions(+), 8 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 67dcce9..6444785 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'
@@ -13,12 +13,24 @@
     orgs: PropTypes.array
   }
 
-  state = {}
+  state = {
+    flowType: this.props.data.flowType || 'approval',
+    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, '')
+          }
           resolve(values)
         } else {
           reject(err)
@@ -30,6 +42,7 @@
   render() {
     const { node, orgs } = this.props
     const { getFieldDecorator } = this.props.form
+    const { flowType, execCondition } = this.state
     const formItemLayout = {
       labelCol: {
         xs: { span: 24 },
@@ -46,6 +59,10 @@
       nodetype = 'start'
     } else if (node.mknode === 'end') {
       nodetype = 'end'
+    } else if (node.mknode === 'endEdge') {
+      nodetype = 'endEdge'
+    } else if (node.mknode === 'startEdge') {
+      nodetype = 'startEdge'
     }
 
     return (
@@ -54,7 +71,7 @@
           <Col span={12}>
             <Form.Item label="鐘舵�佸��">
               {getFieldDecorator('status', {
-                initialValue: data.status === undefined ? 0 : data.status,
+                initialValue: data.status,
                 rules: [
                   {
                     required: true,
@@ -62,7 +79,7 @@
                   }
                 ]
               })(
-                <InputNumber precision={0}/>
+                <InputNumber readOnly={nodetype !== 'node' && nodetype !== 'edge'} precision={0}/>
               )}
             </Form.Item>
           </Col>
@@ -90,6 +107,18 @@
             </Form.Item>
           </Col> : null}
           {nodetype === 'edge' ? <Col span={12}>
+            <Form.Item label="鎿嶄綔绫诲瀷">
+              {getFieldDecorator('flowType', {
+                initialValue: flowType
+              })(
+                <Radio.Group onChange={(e) => this.setState({flowType: e.target.value})}>
+                  <Radio value="approval">瀹℃壒</Radio>
+                  <Radio value="reject">椹冲洖</Radio>
+                </Radio.Group>
+              )}
+            </Form.Item>
+          </Col> : null}
+          {nodetype === 'edge' ? <Col span={12}>
             <Form.Item label="璁剧疆瀹℃壒浜�">
               {getFieldDecorator('approver', {
                 initialValue: data.approver || 'member'
@@ -102,10 +131,10 @@
               )}
             </Form.Item>
           </Col> : null}
-          {nodetype === 'edge' ? <Col span={12}>
+          {nodetype === 'edge' && flowType !== 'reject' ? <Col span={12}>
             <Form.Item label="瀹℃壒鏂瑰紡">
               {getFieldDecorator('approvalMethod', {
-                initialValue: data.approvalMethod || 'countersign'
+                initialValue: data.approvalMethod || 'orsign'
               })(
                 <Radio.Group>
                   <Radio value="countersign">浼氱</Radio>
@@ -114,7 +143,7 @@
               )}
             </Form.Item>
           </Col> : null}
-          {nodetype === 'edge' || nodetype === 'node' ? <Col span={12}>
+          {nodetype === 'edge' ? <Col span={12}>
             <Form.Item label="瀹℃壒浜�">
               {getFieldDecorator('members', {
                 initialValue: data.members || [],
@@ -127,7 +156,7 @@
               )}
             </Form.Item>
           </Col> : null}
-          {nodetype === 'edge' || nodetype === 'node' ? <Col span={12}>
+          {nodetype === 'edge' ? <Col span={12}>
             <Form.Item label="鎶勯�佷汉">
               {getFieldDecorator('copys', {
                 initialValue: data.copys || []
@@ -136,6 +165,60 @@
               )}
             </Form.Item>
           </Col> : null}
+          {nodetype === 'edge' && flowType !== 'reject' ? <Col span={12}>
+            <Form.Item label="鎵ц鏉′欢">
+              {getFieldDecorator('execCondition', {
+                valuePropName: 'checked',
+                initialValue: execCondition
+              })(
+                <Switch checkedChildren="寮�鍚�" unCheckedChildren="鍏抽棴" onChange={(val) => this.setState({execCondition: val})} />
+              )}
+            </Form.Item>
+          </Col> : null}
+          {nodetype === 'edge' && flowType !== 'reject' && execCondition ? <Col span={12}>
+            <Form.Item label="瀵规瘮鏂瑰紡">
+              {getFieldDecorator('match', {
+                initialValue: data.match || '='
+              })(
+                <Radio.Group>
+                  <Radio value="=">=</Radio>
+                  <Radio value="<">&lt;</Radio>
+                  <Radio value=">">&gt;</Radio>
+                  <Radio value="<=">&lt;=</Radio>
+                  <Radio value=">=">&gt;=</Radio>
+                  <Radio value="!=">!=</Radio>
+                </Radio.Group>
+              )}
+            </Form.Item>
+          </Col> : null}
+          {nodetype === 'edge' && flowType !== 'reject' && execCondition ? <Col span={12}>
+            <Form.Item label={
+              <Tooltip placement="topLeft" title="瀵规瘮鍊间腑涓嶅彲鍖呭惈鍒惰〃绗︺�佺┖鏍笺�佹崲琛岀绛夈��">
+                <QuestionCircleOutlined className="mk-form-tip" />
+                瀵规瘮鍊�
+              </Tooltip>
+            }>
+              {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"/>
+              )}
+            </Form.Item>
+          </Col> : null}
           <Col span={24}>
             <Form.Item label="澶囨敞">
               {getFieldDecorator('remark', {

--
Gitblit v1.8.0