| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { fromJS } from 'immutable' |
| | | import { is, fromJS } from 'immutable' |
| | | import { Form, Tabs, Row, Col, Radio, Button, Select, Popconfirm, notification, Modal, message, InputNumber, Tooltip, Typography } from 'antd' |
| | | import { QuestionCircleOutlined, CheckCircleOutlined, StopOutlined, EditOutlined, SwapOutlined, DeleteOutlined } from '@ant-design/icons' |
| | | import moment from 'moment' |
| | |
| | | }) |
| | | } |
| | | |
| | | _verify.customverifys.forEach((item, i) => { |
| | | item.$index = i + 1 |
| | | }) |
| | | _verify.scripts.forEach((item, i) => { |
| | | item.$index = i + 1 |
| | | }) |
| | | _verify.cbScripts.forEach((item, i) => { |
| | | item.$index = i + 1 |
| | | }) |
| | | |
| | | this.setState({ |
| | | setting: config.setting || {}, |
| | | verify: _verify |
| | | verify: _verify, |
| | | oriVerify: fromJS(_verify).toJS() |
| | | }) |
| | | |
| | | if (config.Template !== 'FormTab' && (card.intertype === 'inner' || card.intertype === 'outer')) { // 内部或外部接口 |
| | |
| | | }) |
| | | } |
| | | |
| | | handleCancel = () => { |
| | | const { verify, oriVerify } = this.state |
| | | // 表单提交时检查输入值是否正确 |
| | | return new Promise((resolve, reject) => { |
| | | let msg = '' |
| | | if (this.customForm && this.customForm.state.editItem) { |
| | | msg = '自定义验证' |
| | | } else if (this.customForm && this.customForm.props.form.getFieldValue('sql') && !/^\s+$/.test(this.customForm.props.form.getFieldValue('sql'))) { |
| | | msg = '自定义验证' |
| | | } else if (this.orderForm && this.orderForm.state.editItem) { |
| | | msg = '单号生成' |
| | | } else if (this.scriptsForm && this.scriptsForm.state.editItem) { |
| | | msg = '自定义脚本' |
| | | } else if (this.scriptsForm && this.scriptsForm.props.form.getFieldValue('sql') && !/^\s+$/.test(this.scriptsForm.props.form.getFieldValue('sql'))) { |
| | | msg = '自定义脚本' |
| | | } |
| | | |
| | | if (!is(fromJS(verify), fromJS(oriVerify))) { |
| | | confirm({ |
| | | content: '验证信息已修改,确定取消吗?', |
| | | onOk() { |
| | | resolve() |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | | } else if (msg) { |
| | | confirm({ |
| | | content: msg + '未保存,确定取消吗?', |
| | | onOk() { |
| | | resolve() |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | | } else { |
| | | resolve() |
| | | } |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * @description 组件销毁,清除state更新 |
| | | */ |