This commit is contained in:
timorls 2022-01-06 22:16:34 +08:00
parent 15ab6fbedf
commit 78667cb620
2 changed files with 22115 additions and 36 deletions

22114
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -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) => {