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

子表单要传一个datas 属性

上级 bc56bf2c
...@@ -55,7 +55,10 @@ export default class ZdyTable extends Component { ...@@ -55,7 +55,10 @@ export default class ZdyTable extends Component {
isQRCode = false, // 是否为二维码快捷发起 isQRCode = false, // 是否为二维码快捷发起
formDeafault = '', // 为二维码快捷发起默认值 formDeafault = '', // 为二维码快捷发起默认值
} = this.props; } = this.props;
if (isPreview || isChild) { // if(this.props.currentFormKey === 'aa20cdbd-2019-45ea-8cdf-715aa46e132e'){
// debugger;
// }
if (isPreview || isChild ) {
this.initExcel({ datas: this.props.datas, trees: this.props.trees }, () => { this.initExcel({ datas: this.props.datas, trees: this.props.trees }, () => {
this.setState({ this.setState({
...this.state, ...this.state,
...@@ -228,7 +231,7 @@ export default class ZdyTable extends Component { ...@@ -228,7 +231,7 @@ export default class ZdyTable extends Component {
: val.taskFormKey : val.taskFormKey
? val.taskFormKey ? val.taskFormKey
: obj.init; : obj.init;
console.log('231--------'); // console.log('231--------');
this.initExcel(obj, () => this.initExcel(obj, () =>
this.setState( this.setState(
{ {
...@@ -734,6 +737,10 @@ export default class ZdyTable extends Component { ...@@ -734,6 +737,10 @@ export default class ZdyTable extends Component {
updateTime = moment(+this.props.postData?.updateTime).format('llll'); updateTime = moment(+this.props.postData?.updateTime).format('llll');
} }
if(this.props.currentFormKey === 'aa20cdbd-2019-45ea-8cdf-715aa46e132e'){
console.log(this);
}
switch (get) { switch (get) {
case 'web': case 'web':
return ( return (
......
...@@ -119,12 +119,13 @@ export default class ChildForm extends React.Component { ...@@ -119,12 +119,13 @@ export default class ChildForm extends React.Component {
getCurrentFormTitle, getCurrentFormTitle,
getCellValue, getCellValue,
taskId, taskId,
datasAll,
} = this.props; } = this.props;
const span = json.span || 24; const span = json.span || 24;
const gutter = json.gutter != null ? json.gutter : 0; const gutter = json.gutter != null ? json.gutter : 0;
const rights = this.props.rights; const rights = this.props.rights;
// console.log(datasAll);
if (datas == null) { if (datas == null) {
return <div>还没有配置子表单key</div>; return <div>还没有配置子表单key</div>;
} }
...@@ -155,7 +156,6 @@ export default class ChildForm extends React.Component { ...@@ -155,7 +156,6 @@ export default class ChildForm extends React.Component {
currentFormTitle={ currentFormTitle={
getCurrentFormTitle ? getCurrentFormTitle(json.childFormKey) : null getCurrentFormTitle ? getCurrentFormTitle(json.childFormKey) : null
} }
getCellValue={getCellValue}
hfInstance={hfInstance} hfInstance={hfInstance}
getCellValue={getCellValue} getCellValue={getCellValue}
formCode={this.props.formCode} formCode={this.props.formCode}
...@@ -174,6 +174,7 @@ export default class ChildForm extends React.Component { ...@@ -174,6 +174,7 @@ export default class ChildForm extends React.Component {
form={form} form={form}
mapData={mapData} mapData={mapData}
sqlData={sqlData} sqlData={sqlData}
datas={datasAll}
{...datas} {...datas}
defaultValues={defaultValues} defaultValues={defaultValues}
/> />
...@@ -255,6 +256,7 @@ export default class ChildForm extends React.Component { ...@@ -255,6 +256,7 @@ export default class ChildForm extends React.Component {
form={form} form={form}
mapData={mapData} mapData={mapData}
sqlData={sqlData} sqlData={sqlData}
datas={datasAll}
{...datas} {...datas}
defaultValues={defaultValues} defaultValues={defaultValues}
/> />
......
...@@ -3,6 +3,7 @@ import { Button, Form, Input, InputNumber, Modal, Select } from 'antd'; ...@@ -3,6 +3,7 @@ import { Button, Form, Input, InputNumber, Modal, Select } from 'antd';
export default class FormModal extends React.Component { export default class FormModal extends React.Component {
render() { render() {
// console.log(this.props);
return ( return (
<Modal <Modal
destroyOnClose destroyOnClose
......
...@@ -110,6 +110,8 @@ export default class tableCom extends Component { ...@@ -110,6 +110,8 @@ export default class tableCom extends Component {
}); });
}; };
showModal = (fk, title, data, modalProps) => { showModal = (fk, title, data, modalProps) => {
// console.log(fk, title, data, modalProps);
const { dispatch } = this.props; const { dispatch } = this.props;
const x = this.props.DataColumn.isShowModal; const x = this.props.DataColumn.isShowModal;
x[fk] = true; x[fk] = true;
...@@ -1313,6 +1315,7 @@ export default class tableCom extends Component { ...@@ -1313,6 +1315,7 @@ export default class tableCom extends Component {
currentFormTitle, currentFormTitle,
getCellValue, getCellValue,
} = this.props; } = this.props;
// console.log(this.props.datas);
const { options, labels, selectDis, modalCode, modalTitle, modalInit, modalProps } = this.state; const { options, labels, selectDis, modalCode, modalTitle, modalInit, modalProps } = this.state;
const { getFieldDecorator, getFieldError, getFieldProps } = this.props.form; const { getFieldDecorator, getFieldError, getFieldProps } = this.props.form;
const disabled = json != null ? json.disabled : false; const disabled = json != null ? json.disabled : false;
...@@ -2152,7 +2155,7 @@ export default class tableCom extends Component { ...@@ -2152,7 +2155,7 @@ export default class tableCom extends Component {
if (Object.keys(xxxxx).length > 0) { if (Object.keys(xxxxx).length > 0) {
delete xxxxx['']; delete xxxxx[''];
} }
// console.log(datas);
cm = ( cm = (
<ChildForm <ChildForm
taskId={this.props.taskId} taskId={this.props.taskId}
...@@ -2176,6 +2179,7 @@ export default class tableCom extends Component { ...@@ -2176,6 +2179,7 @@ export default class tableCom extends Component {
base52={dataColumn.base52} base52={dataColumn.base52}
mapData={mapData} mapData={mapData}
datas={datas ? datas[json.childFormKey] : null} datas={datas ? datas[json.childFormKey] : null}
datasAll={datas}
defaultValues={defaultValues} defaultValues={defaultValues}
sqlData={sqlData} sqlData={sqlData}
form={this.props.form} form={this.props.form}
...@@ -3003,6 +3007,7 @@ export default class tableCom extends Component { ...@@ -3003,6 +3007,7 @@ export default class tableCom extends Component {
} }
break; break;
case 'ChildForm': case 'ChildForm':
// console.log(datas, json);
cm = getFieldDecorator(dataColumn.base52, { initialValue: initValue || {} })( cm = getFieldDecorator(dataColumn.base52, { initialValue: initValue || {} })(
<ChildForm <ChildForm
taskId={this.props.taskId} taskId={this.props.taskId}
...@@ -3025,6 +3030,8 @@ export default class tableCom extends Component { ...@@ -3025,6 +3030,8 @@ export default class tableCom extends Component {
base52={dataColumn.base52} base52={dataColumn.base52}
mapData={mapData} mapData={mapData}
datas={datas ? datas[json.childFormKey] : null} datas={datas ? datas[json.childFormKey] : null}
datasAll={datas}
// datas={datas}
defaultValues={defaultValues} defaultValues={defaultValues}
sqlData={sqlData} sqlData={sqlData}
form={this.props.form} form={this.props.form}
...@@ -3284,6 +3291,7 @@ export default class tableCom extends Component { ...@@ -3284,6 +3291,7 @@ export default class tableCom extends Component {
</Row> </Row>
); );
} else { } else {
// console.log(datas);
return ( return (
<> <>
{modalCode ? ( {modalCode ? (
...@@ -3311,6 +3319,7 @@ export default class tableCom extends Component { ...@@ -3311,6 +3319,7 @@ export default class tableCom extends Component {
mapData={mapData} mapData={mapData}
sqlData={sqlData} sqlData={sqlData}
{...datas[modalCode]} {...datas[modalCode]}
// items={}
defaultValues={defaultValues} defaultValues={defaultValues}
/> />
</FormModal> </FormModal>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论