提交 94739633 authored 作者: chscls@163.com's avatar chscls@163.com

修复bug

上级 97b766c0
...@@ -475,6 +475,7 @@ export default class ZdyTable extends Component { ...@@ -475,6 +475,7 @@ export default class ZdyTable extends Component {
j={j} // 当前行数下班 j={j} // 当前行数下班
fatherCode={fatherCode} fatherCode={fatherCode}
index={index} index={index}
fatherObj={this.props.fatherObj}
datas={datas} datas={datas}
uuid={cell.uuid} uuid={cell.uuid}
isEdit={isEdit} isEdit={isEdit}
...@@ -553,6 +554,7 @@ export default class ZdyTable extends Component { ...@@ -553,6 +554,7 @@ export default class ZdyTable extends Component {
fatherCode={fatherCode} fatherCode={fatherCode}
datas={datas} datas={datas}
isEdit={isEdit} isEdit={isEdit}
fatherObj={this.props.fatherObj}
formKey={currentFormKey} formKey={currentFormKey}
init={init} init={init}
get={get} get={get}
......
...@@ -119,7 +119,7 @@ export default class ChildForm extends React.Component { ...@@ -119,7 +119,7 @@ export default class ChildForm extends React.Component {
return "" return ""
} }
return <Row key={r} gutter={gutter} ><Col style={{ textAlign: 'right' }} span={isEdit ? 23 : span} > return <Row key={r} gutter={gutter} ><Col style={{ textAlign: 'right' }} span={isEdit ? 23 : span} >
<ZdyTable key={r} formConfig={datas} get='mobile' fatherCode={base52} isEdit={isEdit} index={r} obj={objs[r]} init={objs} isChild={true} form={form} mapData={mapData} sqlData={sqlData} {...datas} defaultValues={defaultValues} /> <ZdyTable key={r} formConfig={datas} get='mobile' fatherCode={base52} isEdit={isEdit} index={r} obj={objs[r]} fatherObj={this.props.fatherObj} init={objs} isChild={true} form={form} mapData={mapData} sqlData={sqlData} {...datas} defaultValues={defaultValues} />
{rights.includes("delete") && isEdit ? <Button type='danger' onClick={this.delete.bind(this, r)}>{deleteName || "删除"} </Button> : ''} {rights.includes("delete") && isEdit ? <Button type='danger' onClick={this.delete.bind(this, r)}>{deleteName || "删除"} </Button> : ''}
</Col> </Col>
</Row> </Row>
...@@ -142,7 +142,7 @@ export default class ChildForm extends React.Component { ...@@ -142,7 +142,7 @@ export default class ChildForm extends React.Component {
span={span} span={span}
> >
<ZdyTable formConfig={datas} key={r} fatherCode={base52} isEdit={isEdit} index={r} obj={objs[r]} init={objs} isChild={true} get="web" form={form} mapData={mapData} sqlData={sqlData} {...datas} defaultValues={defaultValues} /> <ZdyTable formConfig={datas} key={r} fatherCode={base52} isEdit={isEdit} index={r} obj={objs[r]} fatherObj={this.props.fatherObj} init={objs} isChild={true} get="web" form={form} mapData={mapData} sqlData={sqlData} {...datas} defaultValues={defaultValues} />
{rights.includes("delete") && isEdit ? <Button size="small" {rights.includes("delete") && isEdit ? <Button size="small"
style={{ position: "absolute", right: 10, top: '50%',transform:'translateY(-50%)' }} style={{ position: "absolute", right: 10, top: '50%',transform:'translateY(-50%)' }}
......
...@@ -938,7 +938,7 @@ export default class tableCom extends Component { ...@@ -938,7 +938,7 @@ export default class tableCom extends Component {
} }
sqlUtil = (base52, json,orgCallback, sqlKey, params, callback, options = {}) => { sqlUtil = (base52, json,orgCallback, sqlKey, params, callback, options = {}) => {
//查缓存 //查缓存
var isChange = false; var isChange = false;
const { sqlKeys } = this.state const { sqlKeys } = this.state
...@@ -1113,12 +1113,20 @@ export default class tableCom extends Component { ...@@ -1113,12 +1113,20 @@ export default class tableCom extends Component {
return return
} */ } */
const base52 = column.base52 const base52 = column.base52
try { try {
var fun1 = new Function("obj","init", "defaultValues", "env", "index", "fatherCode", "utils", fun); var fun1 = new Function("obj","init", "defaultValues", "env", "index", "fatherCode", "utils", fun);
const obj = { ...this.props.obj, ...this.props.form.getFieldsValue(), ...this.props.defaultValues[this.props.formKey] } let obj
if(!this.props.isEdit&&this.props.fatherCode){
obj = { ...this.props.fatherObj, ...this.props.form.getFieldsValue(), ...this.props.defaultValues[this.props.formKey] }
console.log("xxxxxxxxxxxxxxxxxxxxxxxxxxxttttttttt",this.props.fatherObj)
}else{
obj = { ...this.props.obj, ...this.props.form.getFieldsValue(), ...this.props.defaultValues[this.props.formKey] }
}
const value = fun1(obj,this.props.init, this.props.defaultValues, { clientType: this.props.get,formCode:this.props.formCode,formId:this.props.formId }, this.props.index, this.props.fatherCode, const value = fun1(obj,this.props.init, this.props.defaultValues, { clientType: this.props.get,formCode:this.props.formCode,formId:this.props.formId }, this.props.index, this.props.fatherCode,
{ {
moment: moment, moment: moment,
...@@ -1929,7 +1937,7 @@ export default class tableCom extends Component { ...@@ -1929,7 +1937,7 @@ export default class tableCom extends Component {
delete xxxxx[""] delete xxxxx[""]
} }
cm = <ChildForm json={json} rights={json.rights || ["add", "delete"]} isMobile={get === 'mobile'} value={xxxxx} deleteName={json.deleteName} addName={json.addName} isEdit={isEdit} base52={dataColumn.base52} mapData={mapData} datas={datas ? datas[json.childFormKey] : null} defaultValues={defaultValues} sqlData={sqlData} form={this.props.form} /> cm = <ChildForm fatherObj={obj} json={json} rights={json.rights || ["add", "delete"]} isMobile={get === 'mobile'} value={xxxxx} deleteName={json.deleteName} addName={json.addName} isEdit={isEdit} base52={dataColumn.base52} mapData={mapData} datas={datas ? datas[json.childFormKey] : null} defaultValues={defaultValues} sqlData={sqlData} form={this.props.form} />
break; break;
case 'Button': case 'Button':
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论