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

28131 2.0选项卡组件搬到1.0来

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