| | |
| | | import { Form, Tabs, Popconfirm, notification, Modal, Typography, Spin, message, Button, Input } from 'antd' |
| | | import { StopOutlined, CheckCircleOutlined, EditOutlined, SwapOutlined, DeleteOutlined, CopyOutlined, BorderOutlined, SnippetsOutlined } from '@ant-design/icons' |
| | | import moment from 'moment' |
| | | import md5 from 'md5' |
| | | |
| | | import Api from '@/api' |
| | | import Utils from '@/utils/utils.js' |
| | |
| | | |
| | | state = { |
| | | columns: [], |
| | | debugId: '', |
| | | subColumns: [], |
| | | activeKey: 'setting', |
| | | loading: false, |
| | |
| | | } |
| | | |
| | | sqlverify = (resolve, reject, change = false, testScripts) => { |
| | | const { columns, setting, scripts, searches, defaultSearch } = this.state |
| | | const { columns, setting, scripts, searches, defaultSearch, debugId } = this.state |
| | | |
| | | let _scripts = scripts.filter(item => item.status !== 'false') |
| | | |
| | |
| | | if ((setting.interType === 'system' && setting.execute !== 'false') || _scripts.length > 0) { |
| | | let timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | | let r = SettingUtils.getDebugSql(setting, _scripts, columns, searches, defaultSearch, timestamp) |
| | | |
| | | let _debugId = md5(r.sql) |
| | | |
| | | if (debugId === _debugId) { |
| | | resolve() |
| | | return |
| | | } |
| | | |
| | | if (r.errors) { |
| | | notification.warning({ |
| | |
| | | if (sumParam) { |
| | | Api.genericInterface(sumParam).then(res => { |
| | | if (res.status) { |
| | | this.setState({debugId: _debugId}) |
| | | resolve() |
| | | } else { |
| | | reject() |
| | |
| | | } |
| | | }) |
| | | } else { |
| | | this.setState({debugId: _debugId}) |
| | | resolve() |
| | | } |
| | | } else { |