/* *visible *onClose *classId */ import React, { Component } from "react"; import st from "styled-components"; import { trainGradeCreateClass, trainQuestionTestpaperList } from '../../../../../services/bkt/apis'; import { // Drawer, Input, Row, Col, Button, Form, DatePicker, // Modal, Breadcrumb, Select } from "antd"; const { RangePicker } = DatePicker; const { Option } = Select; @Form.create() export default class Messages extends Component { constructor(props) { super(props); this.state = { outFormData: { graduateComputerScoreLimit: '', graduatePracticeScoreLimit: '', identityComputerScoreLimit: '', identityPracticeScoreLimit: '', }, licked: false, //用户是否点击过下一步,如果有,开始校验字段 pegers: [], //试卷(下拉列表) } } componentDidMount() { this.__getExamsPapers(); } __getExamsPapers = () => { trainQuestionTestpaperList({data: {}}).then(res => { this.setState({ pegers: res.data }); }) } _submitData = () => { this.setState({ licked: true }); this.props.form.validateFields((err, values) => { const { outFormData } = this.state; const outFormDataHasEmpty = Object.keys(outFormData).some(key => outFormData[key] == ''); // 存在空值 if(outFormDataHasEmpty) { return; } if (!err) { // 结业理论考试时间 values.graduateComputerStartDate = values.graduateComputerDate[0]; values.graduateComputerEndDate = values.graduateComputerDate[1]; Reflect.deleteProperty(values, 'graduateComputerDate'); // 结业实操考试时间 values.graduatePracticeStartDate = values.graduatePracticeDate[0]; values.graduatePracticeEndDate = values.graduatePracticeDate[1]; Reflect.deleteProperty(values, 'graduatePracticeDate'); // 鉴定理论考试时间 values.identifyComputerStartDate = values.identifyComputerDate[0]; values.identifyComputerEndDate = values.identifyComputerDate[1]; Reflect.deleteProperty(values, 'identifyComputerDate'); // 鉴定实操考试时间 values.identifyPracticeStartDate = values.identifyPracticeDate[0]; values.identifyPracticeEndDate = values.identifyPracticeDate[1]; Reflect.deleteProperty(values, 'identifyPracticeDate'); values = { ...values, ...outFormData } trainGradeCreateClass({data: values}).then(res => { this.props.onClose && this.props.onClose(); }); } }); } _setOutField = (key, value) => { this.setState({ outFormData: { ...this.state.outFormData, [key]: value } }); } render() { const { getFieldDecorator } = this.props.form; const { visible, onClose, classId, } = this.props; const { outFormData } = this.state; const formItemLayout = { labelCol: { span: 10 }, wrapperCol: { span: 14 }, labelAlign: 'right' }; const formItemLayout1 = { labelCol: { span: 5 }, wrapperCol: { span: 19 }, labelAlign: 'right' }; return (
); } } const Title = st.div` font-size: 16px; text-align: right; font-weight: bold; `;