一、需求
二、组件封装
BatchInputNumber.js
import React, {
PureComponent, Fragment } from 'react';
import moment from 'moment';
import {
Form, Row, Col, InputNumber, Icon, Button, message } from 'antd';
import styles from './index.less';
const FormItem = Form.Item;
const formItemLayout = {
labelCol: {
span: 3 },
wrapperCol: {
span: 21 },
};
// 日期段组件
@Form.create()
export default class extends PureComponent {
constructor(props) {
super(props);
this.state = {
};
}
//变化
onInputChange = (id, value) => {
const {
inputBar, dispatch, name, dispatchType } = this.props;
let newInputBar = inputBar.map(item => {
return item.id != id
? item
: {
...item,
inputValue: value
};
});
dispatch({
type