mode
This commit is contained in:
parent
15ab6fbedf
commit
78667cb620
File diff suppressed because it is too large
Load Diff
|
@ -1,5 +1,5 @@
|
|||
import React, { Component } from 'react'
|
||||
import { Card, Row, Col, Modal, Input, Form } from 'antd'
|
||||
import { Card, Row, Col, Modal, Input, Form, message } from 'antd'
|
||||
import api from "@/api/request"
|
||||
|
||||
class TestCompany extends Component {
|
||||
|
@ -37,29 +37,28 @@ class TestCompany extends Component {
|
|||
}
|
||||
|
||||
handleOk = () => {
|
||||
for(let key in this.state.form){
|
||||
// console.log(this.form.current)
|
||||
}
|
||||
}
|
||||
|
||||
onFinish = (value) => {
|
||||
const form = this.form.current
|
||||
this.setState({
|
||||
form: form.getFieldsValue()
|
||||
}, () => {
|
||||
api[this.state.method](this.state.url, this.state.form)
|
||||
.then(res => {
|
||||
console.log(res)
|
||||
message.success(res.data.info);
|
||||
})
|
||||
.catch(err => {
|
||||
console.log(err)
|
||||
message.warning(err.data.info);
|
||||
})
|
||||
this.setState({
|
||||
setIsModalVisible: false
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<React.Fragment>
|
||||
<Modal title="Basic Modal" visible={this.state.setIsModalVisible} onCancel={this.handleCancel} onOk={this.handleOk}>
|
||||
<Form ref={this.form} labelCol={{ span: 5 }} wrapperCol={{ span: 16 }} onFinish={this.onFinish}>
|
||||
<Form ref={this.form} labelCol={{ span: 5 }} wrapperCol={{ span: 16 }}>
|
||||
<Row>
|
||||
{
|
||||
Object.keys(this.state.form).map((key) => {
|
||||
|
|
Loading…
Reference in New Issue