调整oj设置相关校验issue

video_transcode
杨树明 5 years ago
parent 80d48dbd16
commit d4d83e8004

@ -1,7 +1,7 @@
/* /*
* @Description: 自定义测试化用例 * @Description: 自定义测试化用例
* @Author: tangjiang * @Author: tangjiang
* @Github: * @Github:
* @Date: 2019-11-27 19:46:14 * @Date: 2019-11-27 19:46:14
* @LastEditors : tangjiang * @LastEditors : tangjiang
* @LastEditTime : 2019-12-26 20:07:35 * @LastEditTime : 2019-12-26 20:07:35
@ -50,11 +50,8 @@ function InitTabCtx (props, ref) {
> >
{ {
getFieldDecorator('input', { getFieldDecorator('input', {
rules: [
{ required: true, message: '输入值不能为空'}
],
initialValue: inputValue initialValue: inputValue
})(<TextArea })(<TextArea
className="input_textarea_style" className="input_textarea_style"
rows={8} rows={8}
placeholder="请填写测试用例的输入值,点击“调试代码”" placeholder="请填写测试用例的输入值,点击“调试代码”"

@ -147,7 +147,7 @@ const AddTestDemo = (props) => {
return ( return (
<Collapse className={'collapse_area'} activeKey={isOpen?'1':''} onChange={() => handleChangeCollapse()}> <Collapse className={'collapse_area'} activeKey={isOpen?'1':''} onChange={() => handleChangeCollapse()}>
<Panel header={`测试用例${props.index + 1}`} extra={genExtra()} key="1"> <Panel header={`测试用例${props.index + 1}`} extra={props.index===0?false:genExtra()} key="1">
<Form> <Form>
<FormItem <FormItem
label={<span className={'label_text'}>输入</span>} label={<span className={'label_text'}>输入</span>}

@ -85,6 +85,25 @@ class EditTab extends React.Component {
// this.props.getQuestion({ // this.props.getQuestion({
// source: 'question' // source: 'question'
// }); // });
const obj = { // 测试用例参数
input: '',
output: '',
position: 1,
isAdd: true // 新增的测试用例
}
const validateObj = { // 测试用例验证参数
input: {
validateStatus: '',
errMsg: ''
},
output: {
validateStatus: '',
errMsg: ''
}
}
// this.scrollRef.current.scrollTo(1000);
this.props.addTestCase({testCase: obj, tcValidate: validateObj});
} }
// componentDidUpdate (nextProp) { // componentDidUpdate (nextProp) {
@ -171,7 +190,7 @@ class EditTab extends React.Component {
render () { render () {
const { showAdd } = this.state; const { showAdd } = this.state;
const { const {
ojForm, ojForm,
ojFormValidate, ojFormValidate,
@ -359,7 +378,7 @@ class EditTab extends React.Component {
const obj = Object.assign({}, values, {sub_discipline_id}) const obj = Object.assign({}, values, {sub_discipline_id})
tagDisciplines(obj); tagDisciplines(obj);
} }
return ( return (
<div className={'editor_area'} id="textCase"> <div className={'editor_area'} id="textCase">
<Form className={'editor_form'}> <Form className={'editor_form'}>

Loading…
Cancel
Save