|
|
|
@ -1,7 +1,7 @@
|
|
|
|
|
/*
|
|
|
|
|
* @Description: 添加测试用例
|
|
|
|
|
* @Author: tangjiang
|
|
|
|
|
* @Github:
|
|
|
|
|
* @Github:
|
|
|
|
|
* @Date: 2019-11-21 09:19:38
|
|
|
|
|
* @LastEditors : tangjiang
|
|
|
|
|
* @LastEditTime : 2019-12-27 10:37:41
|
|
|
|
@ -19,14 +19,14 @@ const AddTestDemo = (props) => {
|
|
|
|
|
const {
|
|
|
|
|
// key,
|
|
|
|
|
// onSubmitTest,
|
|
|
|
|
onDeleteTest,
|
|
|
|
|
onDeleteTest,
|
|
|
|
|
testCase,
|
|
|
|
|
testCaseValidate,
|
|
|
|
|
isOpen
|
|
|
|
|
} = props;
|
|
|
|
|
|
|
|
|
|
// const [isEditor, setIsEditor] = useState(false); // 是否是编辑
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 删除操作
|
|
|
|
|
const handleDeletePanel = (e) => {
|
|
|
|
|
// console.log('点击的删除按钮')
|
|
|
|
@ -63,7 +63,7 @@ const AddTestDemo = (props) => {
|
|
|
|
|
const value = e.target.value;
|
|
|
|
|
testCaseOutputChange(value, index);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 右侧删除图标
|
|
|
|
|
const genExtra = () => (
|
|
|
|
|
<Icon
|
|
|
|
@ -127,7 +127,7 @@ const AddTestDemo = (props) => {
|
|
|
|
|
* 文本输入框可编辑的情况
|
|
|
|
|
* 1. 新增时
|
|
|
|
|
* 2. isAdd 为 false 且 isEditor 为true 时
|
|
|
|
|
* @param {*} testCase
|
|
|
|
|
* @param {*} testCase
|
|
|
|
|
*/
|
|
|
|
|
// const isDisabled = (testCase) => {
|
|
|
|
|
// return !testCase.isAdd && !isEditor;
|
|
|
|
@ -138,21 +138,19 @@ const AddTestDemo = (props) => {
|
|
|
|
|
// defaultActiveKey: [isOpen ? '1' : '']
|
|
|
|
|
// };
|
|
|
|
|
// console.log(activePane);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 切换手风琴
|
|
|
|
|
const handleChangeCollapse = () => {
|
|
|
|
|
const {index, updateOpenTestCaseIndex} = props;
|
|
|
|
|
updateOpenTestCaseIndex(index);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<Collapse className={'collapse_area'} activeKey={isOpen?'1':''} onChange={() => handleChangeCollapse()}>
|
|
|
|
|
<Panel header={`测试用例${props.index + 1}`} extra={genExtra()} key="1">
|
|
|
|
|
<Form>
|
|
|
|
|
<FormItem
|
|
|
|
|
label={<span className={'label_text'}>输入</span>}
|
|
|
|
|
validateStatus={testCaseValidate.input.validateStatus}
|
|
|
|
|
help={testCaseValidate.input.errMsg}
|
|
|
|
|
colon={ false }
|
|
|
|
|
>
|
|
|
|
|
<TextArea
|
|
|
|
@ -164,8 +162,6 @@ const AddTestDemo = (props) => {
|
|
|
|
|
</FormItem>
|
|
|
|
|
<FormItem
|
|
|
|
|
label={<span className={'label_text'}>输出</span>}
|
|
|
|
|
validateStatus={testCaseValidate.output.validateStatus}
|
|
|
|
|
help={testCaseValidate.output.errMsg}
|
|
|
|
|
colon={ false }
|
|
|
|
|
>
|
|
|
|
|
<TextArea
|
|
|
|
|