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}
+
+
+ 输入值
+ 输入值
+
+
+ 预览
+ 输入值
+
+
)
@@ -699,6 +731,7 @@ export default class Run extends Component {
{
query.map((item, index) => {
+ console.log(item.value);
return (
@@ -709,13 +742,14 @@ export default class Run extends Component {
}
=
-
)
diff --git a/client/components/Postman/Postman.scss b/client/components/Postman/Postman.scss
index ee1c196e..19313131 100755
--- a/client/components/Postman/Postman.scss
+++ b/client/components/Postman/Postman.scss
@@ -20,3 +20,33 @@
display: flex;
}
}
+
+.modal-postman {
+ .ant-modal-body {
+ padding: 0;
+ }
+ .ant-modal-footer {
+ background-color: #f5f5f5;
+ }
+ .modal-postman-form {
+ padding: 16px;
+ max-height: 300px;
+ overflow-y: scroll;
+ .row {
+ margin-bottom: 8px;
+ }
+ }
+ .modal-postman-expression, .modal-postman-preview {
+ border-top: 1px solid #e9e9e9;
+ padding: 8px 16px;
+ }
+ .modal-postman-expression {
+ }
+ .modal-postman-preview {
+ background-color: #f5f5f5;
+ }
+ .title {
+ border-left: 3px solid #2395f1;
+ padding-left: 8px;
+ }
+}