From 6781ba45775af16872ac68f7e459b1072b16c4cc Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期三, 18 十月 2023 17:33:47 +0800 Subject: [PATCH] Merge branch 'master' into positec --- src/tabviews/custom/components/chart/antv-X6/nodeupdate/nodeform.jsx | 70 +++++++++++++++++++++++++++++++++- 1 files changed, 67 insertions(+), 3 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 4d6fc81..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' @@ -14,13 +14,23 @@ } state = { - flowType: this.props.data.flowType || 'approval' + 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) @@ -32,7 +42,7 @@ render() { const { node, orgs } = this.props const { getFieldDecorator } = this.props.form - const { flowType } = this.state + const { flowType, execCondition } = this.state const formItemLayout = { labelCol: { xs: { span: 24 }, @@ -155,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="<"><</Radio> + <Radio value=">">></Radio> + <Radio value="<="><=</Radio> + <Radio value=">=">>=</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