render()

in src/routes/Plugin/PluginRuleHandle/RequestRuleHandle.js [283:356]


  render() {
    const { headerOperateType, parameterOperateType, cookieOperateType, currentType, headerList, parameterList, cookieList } = this.state;
    const { form } = this.props;
    const { getFieldDecorator } = form;
    return (
      <div className={styles.handleWrap} style={{ padding: "0px 40px" }}>
        <div className={styles.header}>
          <h3 style={{ width: 60, marginTop: 10 }}>{getIntlContent("SHENYU.COMMON.DEAL")}: </h3>
        </div>
        <Tabs style={{ marginLeft: 10 }} defaultActiveKey={currentType} onChange={this.handleTabChange}>
          <TabPane tab="Params" key="parameter">
            {parameterList && parameterList.length > 0 && (
              parameterList.map((row, rowIndex) => {
                return (
                  <Row gutter={24} key={rowIndex}>
                    {
                      row.map((field, i) => {
                        let rules = [];
                        let placeholder = field.fieldLabel;
                        return (
                          <Col span={6} key={i}>
                            {
                              field.fieldName.includes("type") ? (
                                <FormItem>
                                  {getFieldDecorator(field.fieldName, {
                                    rules,
                                    initialValue: field.fieldValue,
                                  })(
                                    <Select onChange={(val) => { this.handleTypeChange(val, "parameter", rowIndex) }} placeholder={placeholder} style={{ width: 200 }}>
                                      {
                                        parameterOperateType.map(opt => {
                                          return <Option value={opt.value}>{opt.label}</Option>
                                        })
                                      }
                                    </Select>
                                  )
                                  }
                                </FormItem>
                              ) : (
                                <FormItem>
                                  {getFieldDecorator(field.fieldName, {
                                    rules,
                                    initialValue: field.fieldValue,
                                  })(
                                    <Input
                                      // addonBefore={<div style={{width: labelWidth}}>{item.label}</div>}
                                      placeholder={placeholder}
                                      key={field.fieldName}
                                    // type="number"
                                    />)
                                  }
                                </FormItem>
                              )
                            }

                          </Col>
                        )
                      })
                    }
                    <Col span={6}>
                      <Button
                        type="danger"
                        style={{ marginRight: "20px" }}
                        onClick={() => {
                          this.handleDeleteRow("parameter", rowIndex);
                        }}
                      >
                        {getIntlContent("SHENYU.COMMON.DELETE.NAME")}
                      </Button>
                      {rowIndex === 0 && (
                        <Button onClick={() => this.handleAddRow("parameter")} type="primary">
                          {getIntlContent("SHENYU.COMMON.ADD")}
                        </Button>
                      )}