);
});
return group;
};
convertFormItemViewAttr = (viewAttr) => {
const { ledgerStore: { AARForm } } = this.props;
const { isOpenApproval } = AARForm.getFormParams();
this.setState({
conditions: _.map(this.state.conditions, item => ({
...item, items: _.map(item.items, o => {
if (getKey(o) === "approvalWorkflowUrl") {
return { ...o, viewAttr, hide: isOpenApproval === "0" };
} else if (getKey(o) === "approvalItemGroup") {
return { ...o, viewAttr, hide: isOpenApproval === "0" };
}
return { ...o };
})
}))
});
};
handleFormItemChange = (value) => {
const { ledgerStore: { AARForm } } = this.props;
const { isOpenApproval } = AARForm.getFormParams();
if (_.keys(value)[0] === "isOpenApproval") {
this.convertFormItemViewAttr(isOpenApproval === "1" ? 3 : 2);
}
};
render() {
const { conditions } = this.state;
const { ledgerStore: { AARForm } } = this.props;
return (
{this.renderForm(AARForm, conditions)}
);
}
}
export default LedgerAccountApprRule;