render()

in src/routes/System/Dict/AddModal.js [40:208]


  render() {
    let {
      handleCancel,
      form,
      type = "",
      dictCode = "",
      dictName = "",
      dictValue = "",
      desc = "",
      sort = "0",
      enabled = true,
    } = this.props;

    const { getFieldDecorator } = form;
    const formItemLayout = {
      labelCol: {
        sm: { span: 8 },
      },
      wrapperCol: {
        sm: { span: 16 },
      },
    };
    return (
      <Modal
        width={450}
        centered
        title={getIntlContent("SHENYU.DIC")}
        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.DIC.TYPE")}
            {...formItemLayout}
          >
            {getFieldDecorator("type", {
              rules: [
                {
                  required: true,
                  message:
                    getIntlContent("SHENYU.AUTH.INPUT") +
                    getIntlContent("SHENYU.DIC.TYPE"),
                },
              ],
              initialValue: type,
            })(
              <Input
                allowClear
                placeholder={getIntlContent("SHENYU.DIC.TYPE")}
              />,
            )}
          </FormItem>

          <FormItem
            label={getIntlContent("SHENYU.DIC.CODE")}
            {...formItemLayout}
          >
            {getFieldDecorator("dictCode", {
              rules: [
                {
                  required: true,
                  message:
                    getIntlContent("SHENYU.AUTH.INPUT") +
                    getIntlContent("SHENYU.DIC.CODE"),
                },
              ],
              initialValue: dictCode,
            })(
              <Input
                allowClear
                placeholder={getIntlContent("SHENYU.DIC.CODE")}
              />,
            )}
          </FormItem>
          <FormItem
            label={getIntlContent("SHENYU.DIC.NAME")}
            {...formItemLayout}
          >
            {getFieldDecorator("dictName", {
              rules: [
                {
                  required: true,
                  message:
                    getIntlContent("SHENYU.AUTH.INPUT") +
                    getIntlContent("SHENYU.DIC.NAME"),
                },
              ],
              initialValue: dictName,
            })(
              <Input
                allowClear
                placeholder={getIntlContent("SHENYU.DIC.NAME")}
              />,
            )}
          </FormItem>
          <FormItem
            label={getIntlContent("SHENYU.DIC.VALUE")}
            {...formItemLayout}
          >
            {getFieldDecorator("dictValue", {
              rules: [
                {
                  required: true,
                  message:
                    getIntlContent("SHENYU.AUTH.INPUT") +
                    getIntlContent("SHENYU.DIC.VALUE"),
                },
              ],
              initialValue: dictValue,
            })(
              <Input
                allowClear
                placeholder={getIntlContent("SHENYU.DIC.VALUE")}
              />,
            )}
          </FormItem>
          <FormItem
            label={getIntlContent("SHENYU.DIC.DESCRIBE")}
            {...formItemLayout}
          >
            {getFieldDecorator("desc", {
              initialValue: desc,
            })(
              <TextArea
                placeholder={getIntlContent("SHENYU.DIC.DESCRIBE")}
                rows={3}
              />,
            )}
          </FormItem>
          <FormItem
            label={getIntlContent("SHENYU.PLUGIN.SORT")}
            {...formItemLayout}
          >
            {getFieldDecorator("sort", {
              rules: [
                {
                  required: true,
                  message:
                    getIntlContent("SHENYU.AUTH.INPUT") +
                    getIntlContent("SHENYU.PLUGIN.SORT"),
                },
              ],
              initialValue: sort,
            })(
              <InputNumber
                precision={0}
                placeholder={getIntlContent("SHENYU.PLUGIN.SORT")}
              />,
            )}
          </FormItem>
          {/* status */}
          {
            <FormItem
              {...formItemLayout}
              label={getIntlContent("SHENYU.SYSTEM.STATUS")}
            >
              {getFieldDecorator("enabled", {
                initialValue: enabled,
                valuePropName: "checked",
              })(<Switch disabled={!this.props.isShow} />)}
            </FormItem>
          }
        </Form>
      </Modal>
    );
  }