in src/routes/System/Role/AddModal.js [123:180]
render() {
let { handleCancel, form, sysRole: { roleName = '', description = '' }, allPermissionInfo: { treeList = [] } } = this.props;
const { getFieldDecorator } = form;
const formItemLayout = {
labelCol: {
sm: { span: 5 },
},
wrapperCol: {
sm: { span: 19 },
},
};
return (
<Modal
width={900}
centered
title={getIntlContent("SHENYU.SYSTEM.ROLE")}
visible
okText={getIntlContent("SHENYU.COMMON.SURE")}
cancelText={getIntlContent("SHENYU.COMMON.CALCEL")}
onOk={this.handleSubmit}
onCancel={handleCancel}
>
<Form onSubmit={this.handleSubmit} className="login-form">
<FormItem
label={getIntlContent("SHENYU.SYSTEM.ROLENAME")}
{...formItemLayout}
>
{getFieldDecorator('roleName', {
rules: [{ required: true, message: getIntlContent("SHENYU.SYSTEM.ROLE.INPUT.NAME") }],
initialValue: roleName,
})(
<Input placeholder={getIntlContent("SHENYU.SYSTEM.ROLE.INPUT.NAME")} />
)}
</FormItem>
<FormItem
label={getIntlContent("SHENYU.SYSTEM.ROLE.DESCRIPTION")}
{...formItemLayout}
>
{getFieldDecorator('description', {
rules: [{message: getIntlContent("SHENYU.SYSTEM.ROLE.INPUT.DESCRIPTION") }],
initialValue: description,
})(
<Input.TextArea autoSize placeholder={getIntlContent("SHENYU.SYSTEM.ROLE.INPUT.DESCRIPTION")} />
)}
</FormItem>
</Form>
{treeList && treeList.length > 0 && (
<Fragment>
<Divider>{getIntlContent("SHENYU.SYSTEM.ROLE.CONFIG")}</Divider>
<div style={{ display: "flex", justifyContent: "space-around" }}>
{this.renderResourceTree(treeList)}
</div>
</Fragment>
)}
</Modal>
)
}