From 735955be17afba088e389c85ad36145656b3d750 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期日, 12 五月 2024 23:03:00 +0800 Subject: [PATCH] 2024-05-12 --- src/tabviews/custom/components/chart/antv-X6/nodeupdate/nodeform.jsx | 69 +++++++++++++++++++++++++++++++++- 1 files changed, 66 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 92efe95..c9e04e2 100644 --- a/src/tabviews/custom/components/chart/antv-X6/nodeupdate/nodeform.jsx +++ b/src/tabviews/custom/components/chart/antv-X6/nodeupdate/nodeform.jsx @@ -17,6 +17,7 @@ state = { flowType: 'approval', execCondition: false, + seniorCondition: false, approvalMethod: 'orsign', readOnly: false, options: [] @@ -32,6 +33,8 @@ readOnly = true } else if (node.mknode === 'end') { + } else if (node.mknode === 'throughEdge') { + options = ['senior'] } else if (node.mknode === 'endEdge') { options = ['approvalMethod', 'execCondition'] } else if (node.mknode === 'startEdge') { @@ -41,12 +44,13 @@ } else if (node.shape !== 'edge') { // node options = ['sign'] } else { - options = ['flowType', 'approvalMethod', 'approver', 'members', 'copys', 'execCondition'] + options = ['flowType', 'approvalMethod', 'approver', 'members', 'copys', 'execCondition', 'senior'] } this.setState({ flowType: data.flowType || 'approval', - execCondition: options.includes('execCondition') && data.execCondition === 'open', + execCondition: options.includes('execCondition') ? data.execCondition === 'open' : false, + seniorCondition: options.includes('senior') ? data.seniorCondition === 'open' : false, approvalMethod: data.approvalMethod || 'orsign', options, readOnly @@ -54,9 +58,12 @@ } handleConfirm = () => { + const { node } = this.props + return new Promise((resolve, reject) => { this.props.form.validateFieldsAndScroll((err, values) => { if (!err) { + if (values.approvalMethod === 'countersign' && values.members.length > 5) { notification.warning({ top: 92, @@ -64,6 +71,19 @@ duration: 10 }) return + } else if (node.mknode === 'throughEdge' && values.seniorCondition === false) { + notification.warning({ + top: 92, + message: '寮�濮嬩笌缁撴潫鐩磋繛鐨勫垎鏀繀椤昏缃壒娈婂鎵逛汉锛�', + duration: 10 + }) + return + } + + if (values.seniorCondition === true) { + values.seniorCondition = 'open' + } else if (values.seniorCondition === false) { + values.seniorCondition = 'close' } if (values.execCondition === true) { @@ -86,7 +106,7 @@ render() { const { orgs } = this.props const { getFieldDecorator } = this.props.form - const { flowType, execCondition, approvalMethod, readOnly, options } = this.state + const { flowType, execCondition, seniorCondition, approvalMethod, readOnly, options } = this.state const formItemLayout = { labelCol: { xs: { span: 24 }, @@ -270,6 +290,49 @@ )} </Form.Item> </Col> : null} + {options.includes('senior') && flowType !== 'reject' && approvalMethod !== 'countersign' ? <Col span={24}> + <p className="mk-split">楂樼骇璁剧疆<span style={{fontSize: '12px', color: 'rgba(0, 0, 0, 0.45)'}}>锛堝惎鐢ㄧ壒娈婂鎵逛汉鏃讹紝绗﹀悎瀹℃壒浜哄垪琛ㄦ椂锛屼紭鍏堜娇鐢ㄦ鍒嗘敮銆傦級</span></p> + </Col> : null} + {options.includes('senior') && flowType !== 'reject' && approvalMethod !== 'countersign' ? <Col span={12}> + <Form.Item label="鐗规畩浜哄憳"> + {getFieldDecorator('seniorCondition', { + valuePropName: 'checked', + initialValue: seniorCondition + })( + <Switch checkedChildren="鍚敤" unCheckedChildren="绂佺敤" onChange={(val) => this.setState({seniorCondition: val})} /> + )} + </Form.Item> + </Col> : null} + {options.includes('senior') && flowType !== 'reject' && approvalMethod !== 'countersign' && seniorCondition ? <Col span={12}> + <Form.Item label="瀹℃壒浜�"> + {getFieldDecorator('seniorbers', { + initialValue: data.seniorbers || [], + rules: [ + { required: true, message: '璇锋坊鍔犲鎵逛汉!' } + ] + })( + <MemberForm orgs={orgs} title="瀹℃壒浜�"/> + )} + </Form.Item> + </Col> : null} + {options.includes('senior') && flowType !== 'reject' && approvalMethod !== 'countersign' && seniorCondition ? <Col span={12}> + <Form.Item label={ + <Tooltip placement="topLeft" title="鐢ㄤ簬涓氬姟澶勭悊鏃剁殑鏍囪鍊粿works_flow_sign@銆�"> + <QuestionCircleOutlined className="mk-form-tip" /> + 鍒嗘敮鏍囪 + </Tooltip> + }> + {getFieldDecorator('seniorSign', { + initialValue: data.seniorSign || '', + rules: [ + { required: true, message: '璇锋坊鍔犲垎鏀爣璁�!' }, + { pattern: /^[0-9a-zA-Z_]+$/, message: '鍙彲杈撳叆鑻辨枃銆佹暟瀛椾互鍙奯銆�' } + ] + })( + <Input autoComplete="off" onPressEnter={() => this.props.handleSubmit()}/> + )} + </Form.Item> + </Col> : null} </Row> </Form> ) -- Gitblit v1.8.0