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

28131 2.0选项卡组件搬到1.0来

上级 66222046
......@@ -13,16 +13,16 @@ export default class ChildForm extends React.Component {
this.state = value;
}
triggerChange = (changedValue) => {
triggerChange = changedValue => {
// Should provide an event to pass value to Form.
const onChange = this.props.onChange;
console.log('ChildForm', changedValue);
if (onChange) {
if(changedValue && typeof changedValue === 'object' && !Object.keys(changedValue).length){
if (changedValue && typeof changedValue === 'object' && !Object.keys(changedValue).length) {
onChange(changedValue);
// onChange(null);
}else{
} else {
onChange(changedValue);
}
}
......@@ -57,7 +57,7 @@ export default class ChildForm extends React.Component {
}
}
};
delete = (uuid) => {
delete = uuid => {
const objs = this.state;
const {
json: { numCode },
......@@ -139,7 +139,7 @@ export default class ChildForm extends React.Component {
return <div>还没有配置子表单key</div>;
}
if(!objs){
if (!objs) {
return null;
}
......@@ -149,7 +149,7 @@ export default class ChildForm extends React.Component {
{Object.keys(objs).length > 1 || rights.includes('add') ? (
<Card>
<Card.Body style={{ minHeight: 10 }}>
{Object.keys(objs).map((r) => {
{Object.keys(objs).map(r => {
if (r == '') {
return '';
}
......@@ -159,7 +159,8 @@ export default class ChildForm extends React.Component {
style={{
zIndex: 55,
}}
span={isEdit ? 24 : span}>
span={isEdit ? 24 : span}
>
<ZdyTable
changedValues={this.props.changedValues}
setRealTimeValues={this.props.setRealTimeValues}
......@@ -171,7 +172,6 @@ export default class ChildForm extends React.Component {
currentFormTitle={
getCurrentFormTitle ? getCurrentFormTitle(json.childFormKey) : null
}
hfInstance={hfInstance}
getCellValue={getCellValue}
formCode={this.props.formCode}
formId={this.props.formId}
......@@ -214,7 +214,8 @@ export default class ChildForm extends React.Component {
type="primary"
size="small"
style={{ margin: 'auto' }}
onClick={this.add}>
onClick={this.add}
>
{addName || '新增'}
</Button>{' '}
</Col>
......@@ -237,7 +238,7 @@ export default class ChildForm extends React.Component {
return (
<div style={{ width: '100%' }}>
<Row gutter={gutter}>
{Object.keys(objs).map((r) => {
{Object.keys(objs).map(r => {
if (r == '') {
return '';
}
......@@ -292,7 +293,8 @@ export default class ChildForm extends React.Component {
lineHeight: '10px',
}}
type="danger"
onClick={this.delete.bind(this, r)}>
onClick={this.delete.bind(this, r)}
>
{deleteName || '-'}
</Button>
) : (
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论