Merge branch 'dev_aliyun' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

video_transcode
caicai8 5 years ago
commit 8eb6535427

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

@ -1268,7 +1268,8 @@ submittojoinclass=(value)=>{
{shixuntype===true?"":<li><Link to={`/users/${this.props.current_user===undefined?"":this.props.current_user.login}/shixuns`}>我的实训项目</Link></li>} {shixuntype===true?"":<li><Link to={`/users/${this.props.current_user===undefined?"":this.props.current_user.login}/shixuns`}>我的实训项目</Link></li>}
{pathstype===true?"":<li><Link to={`/users/${this.props.current_user===undefined?"":this.props.current_user.login}/paths`}>{this.props.user&&this.props.user.main_site===false?"我的课程":"我的实践课程"}</Link></li>} {pathstype===true?"":<li><Link to={`/users/${this.props.current_user===undefined?"":this.props.current_user.login}/paths`}>{this.props.user&&this.props.user.main_site===false?"我的课程":"我的实践课程"}</Link></li>}
{this.props.user&&this.props.user.main_site===true?<li><Link to={`/users/${this.props.current_user===undefined?"":this.props.current_user.login}/projects`}>我的开发项目</Link></li>:""} {this.props.user&&this.props.user.main_site===true?<li><Link to={`/users/${this.props.current_user===undefined?"":this.props.current_user.login}/projects`}>我的开发项目</Link></li>:""}
{ Periofters === true &&<li><Link to ={`/problemset`}>我的题库</Link></li> } { Periofters === true &&<li><Link to ={`/problemset`}>我的试题库</Link></li> }
{ Periofters === true &&<li><Link to ={`/paperlibrary`}>我的试卷库</Link></li> }
{/*<li><Link to={`/users/${this.props.current_user===undefined?"":this.props.current_user.login}/package`}>我的众包</Link></li>*/} {/*<li><Link to={`/users/${this.props.current_user===undefined?"":this.props.current_user.login}/package`}>我的众包</Link></li>*/}
<li style={{display: this.props.Headertop === undefined ? 'none' : this.props.Headertop.customer_management_url===null || this.props.Headertop.customer_management_url===""? 'none' : 'block'}}> <li style={{display: this.props.Headertop === undefined ? 'none' : this.props.Headertop.customer_management_url===null || this.props.Headertop.customer_management_url===""? 'none' : 'block'}}>
<a href={this.props.Headertop === undefined ? '' : this.props.Headertop.customer_management_url}>客户管理</a> <a href={this.props.Headertop === undefined ? '' : this.props.Headertop.customer_management_url}>客户管理</a>

@ -26,7 +26,6 @@ import { notification } from "antd";
export const startProgramQuestion = (id, props) => { export const startProgramQuestion = (id, props) => {
return (dispatch, getState) => { return (dispatch, getState) => {
const {searchParams} = getState().ojFormReducer; const {searchParams} = getState().ojFormReducer;
console.log(searchParams);
fetchStartProgram(id).then(res => { fetchStartProgram(id).then(res => {
const { status, data } = res; const { status, data } = res;
if (status === 200) { if (status === 200) {
@ -50,7 +49,7 @@ export const startProgramQuestion = (id, props) => {
// console.log(path); // console.log(path);
// props.history.push(`/myproblems/${identifier}`); // props.history.push(`/myproblems/${identifier}`);
props.history.push({ props.history.push({
pathname: `/myproblems/${identifier}.json?${searchParams}`, pathname: `/myproblems/${identifier}`,
}); });
} }
} }

@ -1,14 +1,14 @@
/* /*
* @Description: 开发者社区编辑模块 * @Description: 开发者社区编辑模块
* @Author: tangjiang * @Author: tangjiang
* @Github: * @Github:
* @Date: 2019-11-20 16:35:46 * @Date: 2019-11-20 16:35:46
* @LastEditors : tangjiang * @LastEditors : tangjiang
* @LastEditTime : 2020-02-11 16:29:32 * @LastEditTime : 2020-02-11 16:29:32
*/ */
import types from './actionTypes'; import types from './actionTypes';
import CONST from '../../constants'; import CONST from '../../constants';
import { import {
fetchPostOjForm, fetchPostOjForm,
fetchGetOjById, fetchGetOjById,
publishTask, publishTask,
@ -18,7 +18,7 @@ import {
} from '../../services/ojService'; } from '../../services/ojService';
import { Base64 } from 'js-base64'; import { Base64 } from 'js-base64';
import { notification } from 'antd'; import { notification } from 'antd';
import { toStore } from 'educoder'; import { toStore } from 'educoder';
// import { startProgramQuestion } from '' // import { startProgramQuestion } from ''
const { jcLabel } = CONST; const { jcLabel } = CONST;
// 表单字段映射 // 表单字段映射
@ -124,7 +124,7 @@ export const validateOjForm = (props, type, cb) => {
hasSuccess = false; hasSuccess = false;
dispatch( dispatch(
{ {
type: maps[key].type, type: maps[key].type,
payload: payloadInfo(key, value, errMsg, validateResult[key]) payload: payloadInfo(key, value, errMsg, validateResult[key])
} }
) )
@ -168,14 +168,14 @@ export const validateOjForm = (props, type, cb) => {
tcValidResult.push(tempObj); tcValidResult.push(tempObj);
}); });
if (testCases.length === 0) { // if (testCases.length === 0) {
hasSuccess = false; // hasSuccess = false;
notification['error']({ // notification['error']({
message: '提示', // message: '提示',
description: '测试用例必须输入!' // description: '测试用例必须输入!'
}); // });
} // }
// if (!code) { // if (!code) {
// hasSuccess = false; // hasSuccess = false;
// notification['error']({ // notification['error']({
@ -300,7 +300,7 @@ export const validateOjForm = (props, type, cb) => {
cb && cb(); cb && cb();
} else { } else {
const {identifier} = res.data; const {identifier} = res.data;
// message.success(paramsObj['submitType'] === 'update' ? '更新成功' : '保存成功'); // message.success(paramsObj['submitType'] === 'update' ? '更新成功' : '保存成功');
notification.success({ notification.success({
message: '提示', message: '提示',
@ -311,7 +311,7 @@ export const validateOjForm = (props, type, cb) => {
type: types.SAVE_OJ_FORM_ID, type: types.SAVE_OJ_FORM_ID,
payload: identifier payload: identifier
}); });
// console.log(identifier , props.identifier); // console.log(identifier , props.identifier);
if (identifier || props.identifier) { if (identifier || props.identifier) {
dispatch(getOJFormById(identifier || props.identifier)); dispatch(getOJFormById(identifier || props.identifier));
@ -443,7 +443,7 @@ export const saveOjFormCode = (value) => {
payload: value payload: value
}; };
} }
// 验证任务名称 // 验证任务名称
export const validateOJName = (value) => { export const validateOJName = (value) => {
const validate = emptyValidate('name', value)['name']; const validate = emptyValidate('name', value)['name'];
const errMsg = validate.errMsg; const errMsg = validate.errMsg;
@ -735,9 +735,9 @@ export const saveKnowledge = (values) => {
} }
/** /**
* 新增时跳转到OJ时带的默认参数: * 新增时跳转到OJ时带的默认参数:
* @param {}} params * @param {}} params
* { * {
* difficult: '', // 难易度 * difficult: '', // 难易度
* sub_discipline_id: '' // 课程方向 * sub_discipline_id: '' // 课程方向
* tag_discipline_id [] 知识点 * tag_discipline_id [] 知识点
@ -767,7 +767,7 @@ export const tagDisciplines = (params) => {
} }
}); });
} }
} }
// 保存地址栏参数 // 保存地址栏参数
export const saveSearchParams = (params) => { export const saveSearchParams = (params) => {

@ -1,7 +1,7 @@
/* /*
* @Description: 开发者社区接口 * @Description: 开发者社区接口
* @Author: tangjiang * @Author: tangjiang
* @Github: * @Github:
* @Date: 2019-11-20 10:55:38 * @Date: 2019-11-20 10:55:38
* @LastEditors : tangjiang * @LastEditors : tangjiang
* @LastEditTime : 2020-01-07 15:23:19 * @LastEditTime : 2020-01-07 15:23:19
@ -34,7 +34,7 @@ export async function fetchPostOjForm (paramsObj) {
// if (identifier) { // if (identifier) {
// return axios.post(url, params); // return axios.post(url, params);
// } else { // } else {
// return // return
// } // }
return identifier ? axios.put(url, params) : axios.post(url, params); return identifier ? axios.put(url, params) : axios.post(url, params);
} }
@ -136,7 +136,7 @@ export async function fetchUploadImage (file) {
export async function fetchUploadImageUrl (id) { export async function fetchUploadImageUrl (id) {
const url = `/attachments/${id}`; const url = `/attachments/${id}`;
return axios.get(url); return axios.get(url);
} }
// 添加笔记 // 添加笔记
export async function fetchAddNotes (identifier, params) { export async function fetchAddNotes (identifier, params) {

Loading…
Cancel
Save