From 2ff464f30d94235b3ad04475593b75a74a354de9 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 09 四月 2020 19:04:01 +0800 Subject: [PATCH] 2020-04-09 --- src/templates/zshare/verifycard/customform/index.jsx | 45 ++++++++++++++++++++++++++++++++++++--------- 1 files changed, 36 insertions(+), 9 deletions(-) diff --git a/src/templates/zshare/verifycard/customform/index.jsx b/src/templates/zshare/verifycard/customform/index.jsx index 5ddb237..2217988 100644 --- a/src/templates/zshare/verifycard/customform/index.jsx +++ b/src/templates/zshare/verifycard/customform/index.jsx @@ -1,6 +1,10 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' import { Form, Row, Col, Input, Select, Button, notification } from 'antd' +import moment from 'moment' + +import Utils from '@/utils/utils.js' +import Api from '@/api' import './index.scss' const { TextArea } = Input @@ -9,11 +13,13 @@ static propTpyes = { dict: PropTypes.object, // 瀛楀吀椤� usefulfields: PropTypes.string, // 鍙敤瀛楁 + initsql: PropTypes.string, // 鍙敤瀛楁 customChange: PropTypes.func // 琛ㄥ崟 } state = { - editItem: null + editItem: null, + loading: false } edit = (record) => { @@ -67,14 +73,35 @@ }) return } + + let param = { + func: 's_debug_sql', + LText: this.props.initsql + values.sql + } + param.LText = Utils.formatOptions(param.LText) + param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000' + param.secretkey = Utils.encrypt(param.LText, param.timestamp) - this.props.customChange(values) - this.setState({ - editItem: null - }) - this.props.form.setFieldsValue({ - sql: '', - errmsg: '' + this.setState({loading: true}) + Api.getLocalConfig(param).then(res => { + if (res.status) { + this.props.customChange(values) + this.setState({ + loading: false, + editItem: null + }) + this.props.form.setFieldsValue({ + sql: '', + errmsg: '' + }) + } else { + this.setState({loading: false}) + notification.warning({ + top: 92, + message: res.message, + duration: 10 + }) + } }) } }) @@ -115,7 +142,7 @@ </Form.Item> </Col> <Col span={3} className="add"> - <Button onClick={this.handleConfirm} type="primary" className="add-row"> + <Button onClick={this.handleConfirm} loading={this.state.loading} type="primary" className="add-row"> 纭畾 </Button> </Col> -- Gitblit v1.8.0