提交 fa6340da authored 作者: 钟是志's avatar 钟是志

23675 求职创业补贴管理---班级做成选项,,发放表和申请表筛选后可以有针对性打印

上级 23174415
import React from 'react';
import { Button, Row, Col, message } from 'antd';
import ZdyTable from '../Table';
import UUID from 'react-native-uuid';
import { Card, WingBlank } from 'antd-mobile';
import { getOrderUid } from './splitChildForm';
import { Card } from 'antd-mobile';
export default class ChildForm extends React.Component {
constructor(props) {
......@@ -14,21 +13,19 @@ export default class ChildForm extends React.Component {
}
triggerChange = changedValue => {
// Should provide an event to pass value to Form.
const onChange = this.props.onChange;
if (onChange) {
if (changedValue && typeof changedValue === 'object' && !Object.keys(changedValue).length) {
onChange(changedValue);
// onChange(null);
} else {
onChange(changedValue);
}
// if (changedValue && typeof changedValue === 'object' && !Object.keys(changedValue).length) {
// onChange(changedValue);
// // onChange(null);
// } else {
// onChange(changedValue);
// }
}
};
componentWillReceiveProps(nextProps) {
// Should be a controlled component.
if ('value' in nextProps) {
const value = nextProps.value;
this.state = value;
......@@ -41,11 +38,11 @@ export default class ChildForm extends React.Component {
const objs = this.state;
if (this.props.min != null && this.props.min > this.props.num) {
for (var i = 0; i < this.props.min; i++) {
objs['id_' + UUID.v4().replace(/-/g, '2')] = {};
objs[getOrderUid()] = {};
}
} else {
for (var i = 0; i < this.props.num; i++) {
objs['id_' + UUID.v4().replace(/-/g, '2')] = {};
objs[getOrderUid()] = {};
}
}
......@@ -93,7 +90,7 @@ export default class ChildForm extends React.Component {
return;
}
objs['id_' + UUID.v4().replace(/-/g, '2')] = {};
objs[getOrderUid()] = {};
if (!('value' in this.props)) {
this.setState(objs);
......@@ -133,7 +130,6 @@ export default class ChildForm extends React.Component {
const rights = this.props.rights;
const { disabled } = json;
const isEdit = !disabled && isEditProps; // 29128 北电]资助-新生入学资助管理-批次设置,2张图2问题不要详情改编辑只能修改是否启用
// console.log(objs);
if (datas == null) {
return <div>还没有配置子表单key</div>;
}
......@@ -141,6 +137,7 @@ export default class ChildForm extends React.Component {
if (!objs) {
return null;
}
console.log(this.props.form.getFieldsValue());
if (isMobile) {
return ( // 2022年11月24日 姚新国说的 把干掉两翼留白 解决北电科工作情况考核 移动端样式的问题
......
import UUID from 'react-native-uuid';
export const getInitData = (i = 0) => {
return {
timeUnix: new Date().getTime() + i,
};
};
export function getOrderUid(){
const v = new Date().getTime() + '_' + UUID.v4().slice(-5);
return v;
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论