diff --git a/client/components/Postman/Postman.js b/client/components/Postman/Postman.js index 2aa61300..024467f3 100755 --- a/client/components/Postman/Postman.js +++ b/client/components/Postman/Postman.js @@ -1,7 +1,8 @@ import React, { Component } from 'react' import PropTypes from 'prop-types' import Mock from 'mockjs' -import { Button, Input, Checkbox, Select, Alert, Spin, Icon, Collapse, Tooltip, message, Switch } from 'antd' + +import { Button, Input, Checkbox, Select, Alert, Spin, Icon, Collapse, Tooltip, message, Switch, Modal, Row, Col } from 'antd' import { autobind } from 'core-decorators'; import constants from '../../constants/variable.js' @@ -32,7 +33,7 @@ function isJsonData(headers) { return isResJson; } -// const wordList = constants.MOCK_SOURCE; +const wordList = constants.MOCK_SOURCE; // const mockDataSource = wordList.map(item => { // return @@ -40,6 +41,13 @@ function isJsonData(headers) { // // }); +const MockModalList = wordList.map((item, index) => { + return + + + +}) + const { TextArea } = Input; @@ -76,7 +84,8 @@ export default class Run extends Component { test_status: null, resMockTest: true, resStatusCode: null, - resStatusText: '' + resStatusText: '', + modalVisible: false } constructor(props) { @@ -565,6 +574,18 @@ export default class Run extends Component { }); } + // 模态框的相关操作 + showModal = () => { + this.setState({ + modalVisible: true + }); + } + handleOk = () => { + this.setState({ modalVisible: false }); + } + handleCancel = () => { + this.setState({ modalVisible: false }); + } render() { const { method, domains, pathParam, pathname, query, headers, bodyForm, caseEnv, bodyType, resHeader, loading, validRes } = this.state; @@ -597,6 +618,25 @@ export default class Run extends Component { return (
+ Basic Modal

} + visible={this.state.modalVisible} + onOk={this.handleOk} + onCancel={this.handleCancel} + wrapClassName="modal-postman" + > +
+ {MockModalList} +
+ +

输入值

+

输入值

+
+ +

预览

+

输入值

+
+
{hasPlugin ? '' : this.changePathParam(e, index, true)} className="key" /> = - -