dev_aliyun2
harry 5 years ago
parent 89c7c078cf
commit 1c5ac52b68

@ -1,5 +1,5 @@
import md5 from 'md5'; import md5 from 'md5';
export function setmiyah(logins){ export default function setmiyah(logins) {
const opens ="79e33abd4b6588941ab7622aed1e67e8"; const opens = "79e33abd4b6588941ab7622aed1e67e8";
return md5(opens+logins); return md5(opens + logins);
} }

@ -1,47 +1,35 @@
import React from "react"; import React from "react";
import md5 from 'md5'; import md5 from 'md5';
import {Input} from "antd"; import { Input } from "antd";
const { Search } = Input; const { Search } = Input;
const $ = window.$; const $ = window.$;
const isDev = window.location.port == 3007; const isDev = window.location.port == 3007;
export const TEST_HOST = "https://test-newweb.educoder.net" export const TEST_HOST = "https://test-newweb.educoder.net"
export function getImageUrl(path) { export function getImageUrl(path) {
// https://www.educoder.net const local = 'https://test-newweb.educoder.net'
// https://testbdweb.trustie.net
// const local = 'http://localhost:3000'
const local = 'https://test-newweb.educoder.net'
if (isDev) { if (isDev) {
return `${local}/${path}` return `${local}/${path}`
} }
return `/${path}`; return `/${path}`;
} }
export function setImagesUrl(path){ export function setImagesUrl(path) {
const local = 'https://test-newweb.educoder.net' const local = 'https://test-newweb.educoder.net'
let firstStr=path.substr(0,1); let firstStr = path.substr(0, 1);
// console.log(firstStr); if (firstStr == "/") {
if(firstStr=="/"){ return isDev ? `${local}${path}` : `${path}`;
return isDev?`${local}${path}`:`${path}`; } else {
}else{ return isDev ? `${local}/${path}` : `/${path}`;
return isDev?`${local}/${path}`:`/${path}`;
} }
} }
export function getUrl(path, goTest) { export function getUrl(path) {
// https://www.educoder.net
// https://testbdweb.trustie.net
// 如果想所有url定位到测试版可以反注释掉下面这行
//goTest = true
// testbdweb.educoder.net testbdweb.trustie.net
// const local = goTest ? 'https://testeduplus2.educoder.net' : 'http://localhost:3000'
// const local = 'https://testeduplus2.educoder.net'
const local = 'https://test-newweb.educoder.net' const local = 'https://test-newweb.educoder.net'
if (isDev) { if (isDev) {
return `${local}${path?path:''}` return `${local}${path ? path : ''}`
} }
return `${path ? path: ''}`; return `${path ? path : ''}`;
} }
export function getUrlmys(path, goTest) { export function getUrlmys(path, goTest) {
@ -55,9 +43,9 @@ export function getUrlmys(path, goTest) {
// const local = 'https://testeduplus2.educoder.net' // const local = 'https://testeduplus2.educoder.net'
const local = 'https://test-jupyterweb.educoder.net' const local = 'https://test-jupyterweb.educoder.net'
if (isDev) { if (isDev) {
return `${local}${path?path:''}` return `${local}${path ? path : ''}`
} }
return `${path ? path: ''}`; return `${path ? path : ''}`;
} }
export function getStaticUrl() { export function getStaticUrl() {
const local = TEST_HOST; const local = TEST_HOST;
@ -68,27 +56,29 @@ export function getStaticUrl() {
return '' return ''
} }
export function getUrl2(path, goTest) { export function getUrl2(path, goTest) {
const local = 'http://localhost:3000' const local = 'http://localhost:3000'
if (isDev) { if (isDev) {
return `${local}${path?path:''}` return `${local}${path ? path : ''}`
} }
return `${path ? path: ''}`; return `${path ? path : ''}`;
} }
const newopens ="79e33abd4b6588941ab7622aed1e67e8"; const newopens = "79e33abd4b6588941ab7622aed1e67e8";
let newtimestamp; let newtimestamp;
let checkSubmitFlgs = false; let checkSubmitFlgs = false;
function railsgettimess(proxy) { function railsgettimess(proxy) {
if(checkSubmitFlgs===false){ if (checkSubmitFlgs === false) {
$.ajax({url:proxy, $.ajax({
async:false,success:function(data){ url: proxy,
if(data.status===0){ async: false, success: function (data) {
newtimestamp=data.message; if (data.status === 0) {
newtimestamp = data.message;
checkSubmitFlgs = true; checkSubmitFlgs = true;
} }
}}) }
})
window.setTimeout(function () { window.setTimeout(function () {
checkSubmitFlgs=false; checkSubmitFlgs = false;
}, 2500); }, 2500);
} }
} }
@ -107,32 +97,32 @@ export function getmyUrl(geturl) {
export function getUploadActionUrl(path, goTest) { export function getUploadActionUrl(path, goTest) {
Railsgettimes() Railsgettimes()
let anewopens=md5(newopens+newtimestamp); let anewopens = md5(newopens + newtimestamp);
return `${getUrl()}/api/attachments.json${isDev ? `?debug=${window._debugType || 'admin'}&randomcode=${newtimestamp}&client_key=${anewopens}` : `?randomcode=${newtimestamp}&client_key=${anewopens}`}`; return `${getUrl()}/api/attachments.json${isDev ? `?debug=${window._debugType || 'admin'}&randomcode=${newtimestamp}&client_key=${anewopens}` : `?randomcode=${newtimestamp}&client_key=${anewopens}`}`;
} }
export function getUploadActionUrltwo(id) { export function getUploadActionUrltwo(id) {
Railsgettimes() Railsgettimes()
let anewopens=md5(newopens+newtimestamp); let anewopens = md5(newopens + newtimestamp);
return `${getUrlmys()}/api/shixuns/${id}/upload_data_sets.json${isDev ? `?debug=${window._debugType || 'admin'}&randomcode=${newtimestamp}&client_key=${anewopens}` : `?randomcode=${newtimestamp}&client_key=${anewopens}`}` return `${getUrlmys()}/api/shixuns/${id}/upload_data_sets.json${isDev ? `?debug=${window._debugType || 'admin'}&randomcode=${newtimestamp}&client_key=${anewopens}` : `?randomcode=${newtimestamp}&client_key=${anewopens}`}`
} }
export function getUploadActionUrlthree() { export function getUploadActionUrlthree() {
Railsgettimes() Railsgettimes()
let anewopens=md5(newopens+newtimestamp); let anewopens = md5(newopens + newtimestamp);
return `${getUrlmys()}/api/jupyters/import_with_tpm.json${isDev ? `?debug=${window._debugType || 'admin'}&randomcode=${newtimestamp}&client_key=${anewopens}` : `?randomcode=${newtimestamp}&client_key=${anewopens}`}` return `${getUrlmys()}/api/jupyters/import_with_tpm.json${isDev ? `?debug=${window._debugType || 'admin'}&randomcode=${newtimestamp}&client_key=${anewopens}` : `?randomcode=${newtimestamp}&client_key=${anewopens}`}`
} }
export function getUploadActionUrlOfAuth(id) { export function getUploadActionUrlOfAuth(id) {
Railsgettimes() Railsgettimes()
let anewopens=md5(newopens+newtimestamp); let anewopens = md5(newopens + newtimestamp);
return `${getUrl()}/api/users/accounts/${id}/auth_attachment.json${isDev ? `?debug=${window._debugType || 'admin'}&randomcode=${newtimestamp}&client_key=${anewopens}` : `?randomcode=${newtimestamp}&client_key=${anewopens}`}` return `${getUrl()}/api/users/accounts/${id}/auth_attachment.json${isDev ? `?debug=${window._debugType || 'admin'}&randomcode=${newtimestamp}&client_key=${anewopens}` : `?randomcode=${newtimestamp}&client_key=${anewopens}`}`
} }
export function getRandomNumber(type) { export function getRandomNumber(type) {
Railsgettimes() Railsgettimes()
let anewopens=md5(newopens+newtimestamp); let anewopens = md5(newopens + newtimestamp);
return type===true?`randomcode=${newtimestamp}&client_key=${anewopens}`:`?randomcode=${newtimestamp}&client_key=${anewopens}` return type === true ? `randomcode=${newtimestamp}&client_key=${anewopens}` : `?randomcode=${newtimestamp}&client_key=${anewopens}`
} }
export function test(path) { export function test(path) {
@ -150,11 +140,11 @@ export function getTaskUrlById(id) {
export function getRandomcode(url) { export function getRandomcode(url) {
Railsgettimes() Railsgettimes()
let anewopens=md5(newopens+newtimestamp); let anewopens = md5(newopens + newtimestamp);
if (url.indexOf('?') == -1) { if (url.indexOf('?') == -1) {
return `${url}?randomcode=${newtimestamp}&client_key=${anewopens}` return `${url}?randomcode=${newtimestamp}&client_key=${anewopens}`
}else { } else {
return `${url}&randomcode=${newtimestamp}&client_key=${anewopens}` return `${url}&randomcode=${newtimestamp}&client_key=${anewopens}`
} }
@ -174,14 +164,14 @@ export function htmlEncode(str) {
return s; return s;
} }
export function publicSearchs(Placeholder,onSearch,onInputs,onChanges,loadings) { export function publicSearchs(Placeholder, onSearch, onInputs, onChanges, loadings) {
return(<Search return (<Search
placeholder= { Placeholder || "请输入内容进行搜索" } placeholder={Placeholder || "请输入内容进行搜索"}
onSearch={onSearch} onSearch={onSearch}
// value={searchValue} // value={searchValue}
onInput={onInputs} onInput={onInputs}
onChange={onChanges} onChange={onChanges}
loading={loadings||false} loading={loadings || false}
allowClear={true} allowClear={true}
></Search>) ></Search>)
} }

@ -1,6 +1,6 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import { Modal } from 'antd'; import { Modal } from 'antd';
export function SetAppModel(options={}) { export default function SetAppModel(options = {}) {
return function wrap(WrappedComponent) { return function wrap(WrappedComponent) {
return class Wrapper extends Component { return class Wrapper extends Component {
constructor(props) { constructor(props) {
@ -10,14 +10,14 @@ export function SetAppModel(options={}) {
} }
} }
modalCancel=()=>{ modalCancel = () => {
window.location.href = "/"; window.location.href = "/";
} }
setDownload=()=>{ setDownload = () => {
window.location.href ='/account/profile'; window.location.href = '/account/profile';
} }
componentDidMount(){ componentDidMount() {
console.log(this.props) console.log(this.props)
} }
@ -38,8 +38,8 @@ export function SetAppModel(options={}) {
<div className={"tabeltext-alignleft mt10"}><p>您尚未完善个人资料</p></div> <div className={"tabeltext-alignleft mt10"}><p>您尚未完善个人资料</p></div>
<div className={"tabeltext-alignleft mt10"}><p>请在完成资料后提交试用申请</p></div> <div className={"tabeltext-alignleft mt10"}><p>请在完成资料后提交试用申请</p></div>
<div className="clearfix mt30 edu-txt-center"> <div className="clearfix mt30 edu-txt-center">
<a className="task-btn mr30" onClick={()=>this.modalCancel()}>取消</a> <a className="task-btn mr30" onClick={() => this.modalCancel()}>取消</a>
<a className="task-btn task-btn-orange" onClick={()=>this.setDownload()}>立即完善资料</a> <a className="task-btn task-btn-orange" onClick={() => this.setDownload()}>立即完善资料</a>
</div> </div>
</div> </div>
</Modal> </Modal>

@ -4,7 +4,7 @@ export {
, getTaskUrlById as getTaskUrlById, TEST_HOST, htmlEncode as htmlEncode , getTaskUrlById as getTaskUrlById, TEST_HOST, htmlEncode as htmlEncode
} from './UrlTool'; } from './UrlTool';
export { setmiyah as setmiyah } from './Component'; export { default as setmiyah } from './Component';
export { default as queryString } from './UrlTool2'; export { default as queryString } from './UrlTool2';
export { default as SnackbarHOC } from './SnackbarHOC'; export { default as SnackbarHOC } from './SnackbarHOC';
@ -44,7 +44,7 @@ export { themes, ThemeContext } from './context/ThemeContext'
export { default as ModalHOC } from './components/ModalHOC' export { default as ModalHOC } from './components/ModalHOC'
export { SetAppModel } from './components/SetAppModel' export { default as SetAppModel } from './components/SetAppModel'
export { default as LinkAfterLogin } from './components/LinkAfterLogin' export { default as LinkAfterLogin } from './components/LinkAfterLogin'
export { default as Cropper } from './components/Cropper' export { default as Cropper } from './components/Cropper'
@ -58,19 +58,12 @@ export { default as City } from './components/form/City'
// course // course
export { default as WordsBtn } from './course/WordsBtn' export { default as WordsBtn } from './course/WordsBtn'
export { default as ActionBtn } from './course/ActionBtn' export { default as ActionBtn } from './course/ActionBtn'
export { default as MarkdownToHtml } from './components/markdown/MarkdownToHtml' export { default as MarkdownToHtml } from './components/markdown/MarkdownToHtml'
export { default as DMDEditor } from './components/markdown/DMDEditor' export { default as DMDEditor } from './components/markdown/DMDEditor'
export { default as Clappr } from './components/media/Clappr' export { default as Clappr } from './components/media/Clappr'
export { default as AliyunUploader } from './components/media/AliyunUploader' export { default as AliyunUploader } from './components/media/AliyunUploader'
export { default as ImageLayer2 } from './hooks/ImageLayer2' export { default as ImageLayer2 } from './hooks/ImageLayer2'
// 外部 // 外部
export { default as CBreadcrumb } from '../modules/courses/common/CBreadcrumb' export { default as CBreadcrumb } from '../modules/courses/common/CBreadcrumb'
export { default as CNotificationHOC } from '../modules/courses/common/CNotificationHOC' export { default as CNotificationHOC } from '../modules/courses/common/CNotificationHOC'

@ -1,5 +1,5 @@
import React, { Fragment } from 'react'; import React, { Fragment } from 'react';
import { getUploadActionUrl, getUrl } from 'educoder'; import { getUploadActionUrl, getUrl, setmiyah } from 'educoder';
import TPMMDEditor from '../modules/tpm/challengesnew/TPMMDEditor'; import TPMMDEditor from '../modules/tpm/challengesnew/TPMMDEditor';
import moment from 'moment' import moment from 'moment'
@ -118,6 +118,7 @@ export default () => {
return ( return (
<Fragment > <Fragment >
<p>{getUrl()}</p> <p>{getUrl()}</p>
<p>{setmiyah()}</p>
<p>{getUploadActionUrl()}</p> <p>{getUploadActionUrl()}</p>
<TPMMDEditor /> <TPMMDEditor />
</Fragment> </Fragment>

@ -1,46 +1,40 @@
import React, {Component} from 'react'; import React, { Component } from 'react';
import {Input, Select, Radio, Checkbox, Popconfirm, message, Modal} from 'antd'; import { Link } from "react-router-dom";
import {BrowserRouter as Router, Route, Link, Switch} from "react-router-dom";
import axios from 'axios'; import axios from 'axios';
import TPMMDEditor from '../../tpm/challengesnew/TPMMDEditor'; import TPMMDEditor from '../../tpm/challengesnew/TPMMDEditor';
import {getUrl} from 'educoder';
export default class TPMUpdatepropaede extends Component { export default class TPMUpdatepropaede extends Component {
constructor(props) { constructor(props) {
super(props) super(props)
this.neweditanswerRef=React.createRef(); this.neweditanswerRef = React.createRef();
this.state = { this.state = {
shixunId:undefined, shixunId: undefined,
} }
} }
componentDidMount() { componentDidMount() {
let id = this.props.match.params.shixunId; let id = this.props.match.params.shixunId;
let url="/shixuns/"+id+"/propaedeutics.json"; let url = "/shixuns/" + id + "/propaedeutics.json";
axios.get(url).then((response) => { axios.get(url).then((response) => {
if (response.data.status === 403||response.data.status === 401||response.data.status === 500) { if (response.data.status === 403 || response.data.status === 401 || response.data.status === 500) {
}else{ } else {
this.setState({ this.setState({
shixunId:id, shixunId: id,
}) })
if(response.data.content[0]!=null){ if (response.data.content[0] != null) {
this.setState({ this.setState({
editanswersRefval:response.data.content, editanswersRefval: response.data.content,
}) })
this.neweditanswerRef.current.setValue(response.data.content) this.neweditanswerRef.current.setValue(response.data.content)
}else{ } else {
this.setState({ this.setState({
editanswersRefval:"", editanswersRefval: "",
}) })
this.neweditanswerRef.current.setValue('') this.neweditanswerRef.current.setValue('')
} }
} }
}).catch((error) => { }).catch((error) => {
@ -49,21 +43,21 @@ export default class TPMUpdatepropaede extends Component {
} }
updatepropaedeuticsvalue=()=>{ updatepropaedeuticsvalue = () => {
let id = this.props.match.params.shixunId; let id = this.props.match.params.shixunId;
let {shixunId} = this.state; let { shixunId } = this.state;
let url="/shixuns/"+id+"/update_propaedeutics.json"; let url = "/shixuns/" + id + "/update_propaedeutics.json";
const update_propaedeuticsvalue = this.neweditanswerRef.current.getValue().trim(); const update_propaedeuticsvalue = this.neweditanswerRef.current.getValue().trim();
axios.post(url,{ axios.post(url, {
content:update_propaedeuticsvalue content: update_propaedeuticsvalue
} }
).then((response) => { ).then((response) => {
if (response.data.status === 403||response.data.status === 401||response.data.status === 500) { if (response.data.status === 403 || response.data.status === 401 || response.data.status === 500) {
}else{ } else {
this.props.showNotification(response.data.message); this.props.showNotification(response.data.message);
if(response.data.status===1){ if (response.data.status === 1) {
this.props.history.replace("/shixuns/"+shixunId+"/propaedeutics"); this.props.history.replace("/shixuns/" + shixunId + "/propaedeutics");
} }
} }
}).catch((error) => { }).catch((error) => {
@ -71,27 +65,27 @@ export default class TPMUpdatepropaede extends Component {
}); });
} }
render() { render() {
let {shixunId} = this.state; let { shixunId } = this.state;
return ( return (
<React.Fragment> <React.Fragment>
<div className="educontent"> <div className="educontent">
<div className="edu-back-white mt30"> <div className="edu-back-white mt30">
<div className="font-16 pt20 pl20 pr20 pb20 bor-bottom-greyE clearfix"> <div className="font-16 pt20 pl20 pr20 pb20 bor-bottom-greyE clearfix">
<span className="fl">背景知识</span> <span className="fl">背景知识</span>
<Link to={"/shixuns/"+shixunId+"/propaedeutics"}className="color-grey-9 fr">返回</Link> <Link to={"/shixuns/" + shixunId + "/propaedeutics"} className="color-grey-9 fr">返回</Link>
</div> </div>
<div className="padding40-20"> <div className="padding40-20">
<TPMMDEditor ref={this.neweditanswerRef} placeholder="请输入选择题的题干内容" mdID={'editquestioMDid'} refreshTimeout={1500} <TPMMDEditor ref={this.neweditanswerRef} placeholder="请输入选择题的题干内容" mdID={'editquestioMDid'} refreshTimeout={1500}
needRecreate={true} watch={true} className="courseMessageMD" initValue={this.neweditanswerRefval}></TPMMDEditor> needRecreate={true} watch={true} className="courseMessageMD" initValue={this.neweditanswerRefval}></TPMMDEditor>
</div> </div>
</div> </div>
<div className="clearfix mb30 mt30"> <div className="clearfix mb30 mt30">
<a className="defalutSubmitbtn fl mr20" <a className="defalutSubmitbtn fl mr20"
onClick={this.updatepropaedeuticsvalue}>保存</a> onClick={this.updatepropaedeuticsvalue}>保存</a>
<Link to={"/shixuns/"+shixunId+"/propaedeutics"} className="defalutCancelbtn fl" <Link to={"/shixuns/" + shixunId + "/propaedeutics"} className="defalutCancelbtn fl"
>取消</Link> >取消</Link>
</div> </div>

@ -3,7 +3,7 @@ import React, { Component } from 'react';
import MonacoEditor from 'react-monaco-editor'; import MonacoEditor from 'react-monaco-editor';
//MonacoDiffEditor 对比模式 //MonacoDiffEditor 对比模式
import { Input, Select, Radio, Checkbox, Popconfirm, message, Modal, Icon, DatePicker, Breadcrumb, Upload, Button, notification, Tooltip } from 'antd'; import { Input, Select, Radio, Checkbox, Modal, Icon, DatePicker, Breadcrumb, Upload, Button, notification, Tooltip } from 'antd';
// import "antd/dist/antd.css"; // import "antd/dist/antd.css";
@ -15,9 +15,8 @@ import axios from 'axios';
import './css/TPMsettings.css'; import './css/TPMsettings.css';
import { getImageUrl, toPath, getUrl, getUploadActionUrl } from 'educoder'; import { getImageUrl, getUrl, getUploadActionUrl } from 'educoder';
let origin = getUrl();
let path = getUrl("/editormd/lib/") let path = getUrl("/editormd/lib/")

@ -4,11 +4,8 @@ import '../../courses/css/Courses.css'
import './css/TPMchallengesnew.css'; import './css/TPMchallengesnew.css';
let path = '/editormd/lib/'
path = getUrl("/editormd/lib/")
const $ = window.$; const $ = window.$;
// 保存数据 // 保存数据
function md_add_data(k, mdu, d) { function md_add_data(k, mdu, d) {
window.sessionStorage.setItem(k + mdu, d); window.sessionStorage.setItem(k + mdu, d);
@ -86,7 +83,7 @@ function create_editorMD(id, width, high, placeholder, imageUrl, callback, initV
var editorName = window.editormd(id, { var editorName = window.editormd(id, {
width: width, width: width,
height: high === undefined ? 400 : high, height: high === undefined ? 400 : high,
path: path, // "/editormd/lib/" path: getUrl("/editormd/lib/"), // "/editormd/lib/"
markdown: initValue, markdown: initValue,
dialogLockScreen: false, dialogLockScreen: false,

File diff suppressed because it is too large Load Diff

@ -1,10 +1,8 @@
import React, {Component} from 'react'; import React, { Component } from 'react';
import {Input, Select, Radio, Checkbox, Popconfirm, message, Modal} from 'antd'; import { Input, Select, Radio, message } from 'antd';
import {BrowserRouter as Router, Route, Link, Switch} from "react-router-dom"; import { Link } from "react-router-dom";
// import "antd/dist/antd.css";
import TPMMDEditor from '../TPMMDEditor'; import TPMMDEditor from '../TPMMDEditor';
@ -12,19 +10,13 @@ import axios from 'axios';
import '../css/TPMchallengesnew.css'; import '../css/TPMchallengesnew.css';
import { getImageUrl, toPath } from 'educoder'; import { getImageUrl } from 'educoder';
import {getUrl} from 'educoder';
let origin = getUrl(); import { getUrl } from 'educoder';
let path = getUrl("/editormd/lib/")
const $ = window.$; const $ = window.$;
let timeout;
let currentValue;
const Option = Select.Option; const Option = Select.Option;
@ -33,7 +25,7 @@ const RadioGroup = Radio.Group;
export default class TPMchallengesnew extends Component { export default class TPMchallengesnew extends Component {
constructor(props) { constructor(props) {
super(props) super(props)
this.exercisememoMDRef=React.createRef(); this.exercisememoMDRef = React.createRef();
this.state = { this.state = {
choice_url: undefined, choice_url: undefined,
practice_url: undefined, practice_url: undefined,
@ -41,8 +33,8 @@ export default class TPMchallengesnew extends Component {
task_pass_default: undefined, task_pass_default: undefined,
submit_url: undefined, submit_url: undefined,
shixunCreatePracticeGroup: 1, shixunCreatePracticeGroup: 1,
optionsums:[100,200], optionsums: [100, 200],
activetype:0, activetype: 0,
setopen: false, setopen: false,
shixunCreatePractice: undefined, shixunCreatePractice: undefined,
onshixunsmarkvalue: 100, onshixunsmarkvalue: 100,
@ -50,28 +42,28 @@ export default class TPMchallengesnew extends Component {
shixunsskillvaluelist: [], shixunsskillvaluelist: [],
tab2url: "", tab2url: "",
tab3url: "", tab3url: "",
prev_challenge:undefined, prev_challenge: undefined,
next_challenge:undefined, next_challenge: undefined,
power: false, power: false,
shixunCreatePracticetype: false, shixunCreatePracticetype: false,
shixunsskillvaluelisttype: false, shixunsskillvaluelisttype: false,
marktype:false, marktype: false,
editPracticesendtype:false, editPracticesendtype: false,
CreatePracticesendtype:false, CreatePracticesendtype: false,
exec_time:20, exec_time: 20,
shixunExec_timeType:false shixunExec_timeType: false
} }
} }
componentDidMount() { componentDidMount() {
let id = this.props.match.params.shixunId; let id = this.props.match.params.shixunId;
let checkpointId=this.props.match.params.checkpointId; let checkpointId = this.props.match.params.checkpointId;
let newchoice_url= "/shixuns/"+id+"/challenges/newquestion"; let newchoice_url = "/shixuns/" + id + "/challenges/newquestion";
let newpractice_url= "/shixuns/"+id+"/challenges/new"; let newpractice_url = "/shixuns/" + id + "/challenges/new";
let newgo_back_url="/shixuns/"+id+"/challenges" let newgo_back_url = "/shixuns/" + id + "/challenges"
if(checkpointId===undefined){ if (checkpointId === undefined) {
//新建模式 //新建模式
let url = "/shixuns/" + id + "/challenges/new.json" let url = "/shixuns/" + id + "/challenges/new.json"
axios.get(url).then((response) => { axios.get(url).then((response) => {
@ -82,67 +74,67 @@ export default class TPMchallengesnew extends Component {
position: response.data.position, position: response.data.position,
task_pass_default: response.data.task_pass_default, task_pass_default: response.data.task_pass_default,
submit_url: response.data.submit_url, submit_url: response.data.submit_url,
checkpointId:checkpointId, checkpointId: checkpointId,
exercisememoMDRefval:response.data.task_pass_default exercisememoMDRefval: response.data.task_pass_default
}) })
this.exercisememoMDRef.current.setValue(response.data.task_pass_default||'') this.exercisememoMDRef.current.setValue(response.data.task_pass_default || '')
}).catch((error) => { }).catch((error) => {
console.log(error) console.log(error)
}); });
}else{ } else {
//编辑模式 //编辑模式
let url="/shixuns/"+id+"/challenges/"+checkpointId+".json?tab=0"; let url = "/shixuns/" + id + "/challenges/" + checkpointId + ".json?tab=0";
axios.get(url).then((response) => { axios.get(url).then((response) => {
let optionsum; let optionsum;
if(response.data.difficulty===1){ if (response.data.difficulty === 1) {
optionsum=[100,200]; optionsum = [100, 200];
}else if(response.data.difficulty===2){ } else if (response.data.difficulty === 2) {
optionsum=[300,400,500,600]; optionsum = [300, 400, 500, 600];
}else if(response.data.difficulty===3){ } else if (response.data.difficulty === 3) {
optionsum=[700,800,900,1000] optionsum = [700, 800, 900, 1000]
} }
let newprev_challenge=response.data.prev_challenge; let newprev_challenge = response.data.prev_challenge;
let next_challenge=response.data.next_challenge; let next_challenge = response.data.next_challenge;
if (newprev_challenge != undefined) { if (newprev_challenge != undefined) {
if(newprev_challenge.st===0){ if (newprev_challenge.st === 0) {
newprev_challenge = "/shixuns/" + id + "/challenges/" + newprev_challenge.id + "/editcheckpoint"; newprev_challenge = "/shixuns/" + id + "/challenges/" + newprev_challenge.id + "/editcheckpoint";
}else{ } else {
newprev_challenge = "/shixuns/" + id + "/challenges/" + newprev_challenge.id + "/editquestion"; newprev_challenge = "/shixuns/" + id + "/challenges/" + newprev_challenge.id + "/editquestion";
} }
} }
if (next_challenge != undefined) { if (next_challenge != undefined) {
if(next_challenge.st===0){ if (next_challenge.st === 0) {
next_challenge = "/shixuns/" + id + "/challenges/" + next_challenge.id+ "/editcheckpoint"; next_challenge = "/shixuns/" + id + "/challenges/" + next_challenge.id + "/editcheckpoint";
}else{ } else {
next_challenge = "/shixuns/" + id + "/challenges/" + next_challenge.id+ "/editquestion"; next_challenge = "/shixuns/" + id + "/challenges/" + next_challenge.id + "/editquestion";
} }
} }
this.setState({ this.setState({
power: response.data.power, power: response.data.power,
prev_challenge:newprev_challenge, prev_challenge: newprev_challenge,
next_challenge:next_challenge, next_challenge: next_challenge,
choice_url: newchoice_url, choice_url: newchoice_url,
practice_url: newpractice_url, practice_url: newpractice_url,
go_back_url: newgo_back_url, go_back_url: newgo_back_url,
shixunCreatePractice:response.data.subject, shixunCreatePractice: response.data.subject,
position:response.data.position, position: response.data.position,
shixunCreatePracticeGroup:response.data.difficulty, shixunCreatePracticeGroup: response.data.difficulty,
optionsums:optionsum, optionsums: optionsum,
onshixunsmarkvalue:response.data.score, onshixunsmarkvalue: response.data.score,
shixunsskillvaluelist:response.data.tags, shixunsskillvaluelist: response.data.tags,
checkpointId:checkpointId, checkpointId: checkpointId,
exec_time:response.data.exec_time, exec_time: response.data.exec_time,
tab2url: "/shixuns/" + id + "/challenges/"+checkpointId+"/tab=2", tab2url: "/shixuns/" + id + "/challenges/" + checkpointId + "/tab=2",
tab3url: "/shixuns/" + id + "/challenges/"+checkpointId+"/tab=3", tab3url: "/shixuns/" + id + "/challenges/" + checkpointId + "/tab=3",
exercisememoMDRefval:response.data.task_pass exercisememoMDRefval: response.data.task_pass
}) })
if(response.data.power===false){ if (response.data.power === false) {
this.props.showSnackbar("你没有权限修改"); this.props.showSnackbar("你没有权限修改");
} }
this.exercisememoMDRef.current.setValue(response.data.task_pass||'') this.exercisememoMDRef.current.setValue(response.data.task_pass || '')
}).catch((error) => { }).catch((error) => {
console.log(error) console.log(error)
}); });
@ -154,20 +146,20 @@ export default class TPMchallengesnew extends Component {
onshixunCreatePracticeChange = (e) => { onshixunCreatePracticeChange = (e) => {
let optionsum; let optionsum;
let onshixunsmark; let onshixunsmark;
if(e.target.value===1){ if (e.target.value === 1) {
optionsum=[100,200]; optionsum = [100, 200];
onshixunsmark=100; onshixunsmark = 100;
}else if(e.target.value===2){ } else if (e.target.value === 2) {
optionsum=[300,400,500,600]; optionsum = [300, 400, 500, 600];
onshixunsmark=300; onshixunsmark = 300;
}else if(e.target.value===3){ } else if (e.target.value === 3) {
optionsum=[700,800,900,1000] optionsum = [700, 800, 900, 1000]
onshixunsmark=700; onshixunsmark = 700;
} }
this.setState({ this.setState({
shixunCreatePracticeGroup: e.target.value, shixunCreatePracticeGroup: e.target.value,
optionsums:optionsum, optionsums: optionsum,
onshixunsmarkvalue:onshixunsmark onshixunsmarkvalue: onshixunsmark
}) })
} }
@ -180,48 +172,48 @@ export default class TPMchallengesnew extends Component {
CreatePracticesend = () => { CreatePracticesend = () => {
this.setState({ this.setState({
CreatePracticesendtype:true CreatePracticesendtype: true
}) })
if(this.props.status===2){ if (this.props.status === 2) {
this.props.showSnackbar("该实训已经发布不能新建") this.props.showSnackbar("该实训已经发布不能新建")
this.setState({ this.setState({
CreatePracticesendtype:false CreatePracticesendtype: false
}) })
return return
} }
let {shixunCreatePractice, shixunCreatePracticeGroup, onshixunsmarkvalue, shixunsskillvaluelist,exec_time} = this.state; let { shixunCreatePractice, shixunCreatePracticeGroup, onshixunsmarkvalue, shixunsskillvaluelist, exec_time } = this.state;
if (shixunCreatePractice === undefined||shixunCreatePractice=="") { if (shixunCreatePractice === undefined || shixunCreatePractice == "") {
this.setState({ this.setState({
shixunCreatePracticetype: true shixunCreatePracticetype: true
}) })
this.props.showSnackbar("任务名称为空") this.props.showSnackbar("任务名称为空")
$('html').animate({ $('html').animate({
scrollTop: 10 scrollTop: 10
}, 1000); }, 1000);
this.setState({ this.setState({
CreatePracticesendtype:false CreatePracticesendtype: false
}) })
return return
} }
if (shixunsskillvaluelist.length === 0) { if (shixunsskillvaluelist.length === 0) {
this.setState({ this.setState({
shixunsskillvaluelisttype: true, shixunsskillvaluelisttype: true,
CreatePracticesendtype:false CreatePracticesendtype: false
}) })
this.props.showSnackbar("技能标签为空") this.props.showSnackbar("技能标签为空")
return return
} }
if(exec_time===null||exec_time===undefined||exec_time===""){ if (exec_time === null || exec_time === undefined || exec_time === "") {
this.setState({ this.setState({
shixunExec_timeType:false shixunExec_timeType: false
}) })
return return
} }
const exercise_editormdvalue = this.exercisememoMDRef.current.getValue().trim(); const exercise_editormdvalue = this.exercisememoMDRef.current.getValue().trim();
let id = this.props.match.params.shixunId; let id = this.props.match.params.shixunId;
@ -229,28 +221,28 @@ export default class TPMchallengesnew extends Component {
let url = "/shixuns/" + id + "/challenges.json"; let url = "/shixuns/" + id + "/challenges.json";
axios.post(url, { axios.post(url, {
identifier:id, identifier: id,
subject: shixunCreatePractice, subject: shixunCreatePractice,
task_pass: exercise_editormdvalue, task_pass: exercise_editormdvalue,
difficulty: shixunCreatePracticeGroup, difficulty: shixunCreatePracticeGroup,
score: onshixunsmarkvalue, score: onshixunsmarkvalue,
challenge_tag: shixunsskillvaluelist, challenge_tag: shixunsskillvaluelist,
st: 0, st: 0,
exec_time:exec_time exec_time: exec_time
}).then((response) => { }).then((response) => {
if (response.data.status === 1) { if (response.data.status === 1) {
// $("html").animate({ scrollTop: 0 }) // $("html").animate({ scrollTop: 0 })
//window.location.href=`/shixuns/${id}/challenges/${response.data.challenge_id}/editcheckpoint?tab=2`; //window.location.href=`/shixuns/${id}/challenges/${response.data.challenge_id}/editcheckpoint?tab=2`;
window.location.href=`/shixuns/${id}/challenges/${response.data.challenge_id}/tab=2`; window.location.href = `/shixuns/${id}/challenges/${response.data.challenge_id}/tab=2`;
// this.setState({ // this.setState({
// setopen: true, // setopen: true,
// CreatePracticesendtype:false, // CreatePracticesendtype:false,
// tab2url: "/shixuns/" + id + "/challenges/"+response.data.challenge_id+"/tab=2", // tab2url: "/shixuns/" + id + "/challenges/"+response.data.challenge_id+"/tab=2",
// tab3url: "/shixuns/" + id + "/challenges/"+response.data.challenge_id+"/tab=3", // tab3url: "/shixuns/" + id + "/challenges/"+response.data.challenge_id+"/tab=3",
// }) // })
} }
// this.props.showSnackbar(response.data.messages); // this.props.showSnackbar(response.data.messages);
}).catch((error) => { }).catch((error) => {
console.log(error) console.log(error)
}); });
@ -273,19 +265,19 @@ export default class TPMchallengesnew extends Component {
clickshixunsskill = () => { clickshixunsskill = () => {
let {shixunsskillvalue, shixunsskillvaluelist} = this.state; let { shixunsskillvalue, shixunsskillvaluelist } = this.state;
if (shixunsskillvalue === "") { if (shixunsskillvalue === "") {
return return
} else if (shixunsskillvalue === undefined) { } else if (shixunsskillvalue === undefined) {
return return
} }
if(shixunsskillvalue == "" || shixunsskillvalue == undefined || shixunsskillvalue == null || (shixunsskillvalue.length>0 && shixunsskillvalue.trim().length == 0)){ if (shixunsskillvalue == "" || shixunsskillvalue == undefined || shixunsskillvalue == null || (shixunsskillvalue.length > 0 && shixunsskillvalue.trim().length == 0)) {
message.error("输入为空,不能保存!"); message.error("输入为空,不能保存!");
return return
} }
let list = shixunsskillvaluelist; let list = shixunsskillvaluelist;
list.push(shixunsskillvalue); list.push(shixunsskillvalue);
this.setState({ this.setState({
shixunsskillvaluelist: list, shixunsskillvaluelist: list,
@ -294,7 +286,7 @@ export default class TPMchallengesnew extends Component {
} }
delshixunsskilllist = (key) => { delshixunsskilllist = (key) => {
let {shixunsskillvaluelist} = this.state; let { shixunsskillvaluelist } = this.state;
let newshixunsskillvaluelist = shixunsskillvaluelist; let newshixunsskillvaluelist = shixunsskillvaluelist;
newshixunsskillvaluelist.splice(key, 1); newshixunsskillvaluelist.splice(key, 1);
this.setState({ this.setState({
@ -302,21 +294,21 @@ export default class TPMchallengesnew extends Component {
}) })
} }
editPracticesend=()=>{ editPracticesend = () => {
this.setState({ this.setState({
editPracticesendtype:true editPracticesendtype: true
}) })
let {shixunCreatePractice, shixunCreatePracticeGroup, onshixunsmarkvalue, shixunsskillvaluelist,checkpointId,exec_time} = this.state; let { shixunCreatePractice, shixunCreatePracticeGroup, onshixunsmarkvalue, shixunsskillvaluelist, checkpointId, exec_time } = this.state;
const exercise_editormdvalue = this.exercisememoMDRef.current.getValue().trim(); const exercise_editormdvalue = this.exercisememoMDRef.current.getValue().trim();
let id = this.props.match.params.shixunId; let id = this.props.match.params.shixunId;
let url = "/shixuns/"+id+"/challenges/"+checkpointId+".json"; let url = "/shixuns/" + id + "/challenges/" + checkpointId + ".json";
if (shixunCreatePractice === undefined||shixunCreatePractice=="") { if (shixunCreatePractice === undefined || shixunCreatePractice == "") {
// this.setState({ // this.setState({
// shixunCreatePracticetype: true // shixunCreatePracticetype: true
// }) // })
@ -325,7 +317,7 @@ export default class TPMchallengesnew extends Component {
scrollTop: 10 scrollTop: 10
}, 1000); }, 1000);
this.setState({ this.setState({
editPracticesendtype:false editPracticesendtype: false
}) })
return return
} }
@ -336,39 +328,39 @@ export default class TPMchallengesnew extends Component {
// }) // })
this.props.showSnackbar("技能标签为空") this.props.showSnackbar("技能标签为空")
this.setState({ this.setState({
editPracticesendtype:false editPracticesendtype: false
}) })
return return
} }
if(exec_time===null||exec_time===undefined||exec_time===""){ if (exec_time === null || exec_time === undefined || exec_time === "") {
this.setState({ this.setState({
shixunExec_timeType:false shixunExec_timeType: false
}) })
return return
} }
axios.put(url, { axios.put(url, {
tab:0, tab: 0,
identifier:id, identifier: id,
id:checkpointId, id: checkpointId,
challenge:{ challenge: {
subject: shixunCreatePractice, subject: shixunCreatePractice,
task_pass: exercise_editormdvalue, task_pass: exercise_editormdvalue,
difficulty: shixunCreatePracticeGroup, difficulty: shixunCreatePracticeGroup,
score: onshixunsmarkvalue, score: onshixunsmarkvalue,
exec_time:exec_time exec_time: exec_time
}, },
challenge_tag:shixunsskillvaluelist challenge_tag: shixunsskillvaluelist
}).then((response) => { }).then((response) => {
this.props.showSnackbar(response.data.messages); this.props.showSnackbar(response.data.messages);
if (response.data.status === 1) { if (response.data.status === 1) {
window.location.href=`/shixuns/${id}/challenges/${checkpointId}/tab=2`; window.location.href = `/shixuns/${id}/challenges/${checkpointId}/tab=2`;
this.setState({ this.setState({
setopen: true, setopen: true,
editPracticesendtype:false, editPracticesendtype: false,
tab2url: "/shixuns/" + id + "/challenges/"+checkpointId+"/tab=2", tab2url: "/shixuns/" + id + "/challenges/" + checkpointId + "/tab=2",
tab3url: "/shixuns/" + id + "/challenges/"+checkpointId+"/tab=3", tab3url: "/shixuns/" + id + "/challenges/" + checkpointId + "/tab=3",
}) })
// window.location.href = "/shixuns/" + id + "/challenges/"+response.data.challenge_id+"/tab=2" // window.location.href = "/shixuns/" + id + "/challenges/"+response.data.challenge_id+"/tab=2"
} }
@ -379,59 +371,59 @@ export default class TPMchallengesnew extends Component {
} }
onshixunsmarks=()=> { onshixunsmarks = () => {
this.setState({ this.setState({
marktype:true marktype: true
}) })
} }
onshixunsmarkss=()=> { onshixunsmarkss = () => {
this.setState({ this.setState({
marktype:false marktype: false
}) })
} }
setexec_time=(e)=>{ setexec_time = (e) => {
this.setState({ this.setState({
exec_time:e.target.value exec_time: e.target.value
}) })
} }
render() { render() {
let shixuntype = this.props.match.params.type; let shixuntype = this.props.match.params.type;
let {marktype, let { marktype,
shixunCreatePracticetype, shixunsskillvaluelisttype, shixunCreatePracticetype, shixunsskillvaluelisttype,
choice_url, practice_url, go_back_url, position, task_pass_default, submit_url, setopen,checkpointId,prev_challenge,next_challenge,power, choice_url, practice_url, go_back_url, position, task_pass_default, submit_url, setopen, checkpointId, prev_challenge, next_challenge, power,
shixunCreatePractice, shixunCreatePracticeGroup, onshixunsmarkvalue, shixunsskillvalue, shixunsskillvaluelist, tab2url, tab3url,optionsums, shixunCreatePractice, shixunCreatePracticeGroup, onshixunsmarkvalue, shixunsskillvalue, shixunsskillvaluelist, tab2url, tab3url, optionsums,
CreatePracticesendtype,editPracticesendtype CreatePracticesendtype, editPracticesendtype
} = this.state; } = this.state;
let options; let options;
if(optionsums!=undefined){ if (optionsums != undefined) {
options = optionsums.map((d, k) => { options = optionsums.map((d, k) => {
return ( return (
<Option key={d} id={k}>{d}</Option> <Option key={d} id={k}>{d}</Option>
) )
}) })
} }
return ( return (
<React.Fragment> <React.Fragment>
<div className="educontent mt30 mb30"> <div className="educontent mt30 mb30">
<div className="padding10-20 mb10 edu-back-white clearfix"> <div className="padding10-20 mb10 edu-back-white clearfix">
<span className="fl ring-blue mr10 mt7"> <span className="fl ring-blue mr10 mt7">
<img src={getImageUrl("images/educoder/icon/code.svg")} data-tip-down="实训任务" className="fl mt2 ml2"/> <img src={getImageUrl("images/educoder/icon/code.svg")} data-tip-down="实训任务" className="fl mt2 ml2" />
</span> </span>
<span className="font-16 task-hide fl TPMtaskName">{position}</span> <span className="font-16 task-hide fl TPMtaskName">{position}</span>
<Link to={go_back_url === undefined ? "" : go_back_url} <Link to={go_back_url === undefined ? "" : go_back_url}
className="color-grey-6 fr font-15 mt3">返回</Link> className="color-grey-6 fr font-15 mt3">返回</Link>
{ next_challenge===undefined?"": {next_challenge === undefined ? "" :
<a href={next_challenge}className="fr color-blue mr15 mt4">下一关</a> <a href={next_challenge} className="fr color-blue mr15 mt4">下一关</a>
} }
{ prev_challenge===undefined?"": {prev_challenge === undefined ? "" :
<a href={prev_challenge} className="fr color-blue mr15 mt4">上一关</a> <a href={prev_challenge} className="fr color-blue mr15 mt4">上一关</a>
} }
@ -439,14 +431,14 @@ export default class TPMchallengesnew extends Component {
<a href={practice_url === undefined ? "" : practice_url} <a href={practice_url === undefined ? "" : practice_url}
className="fr color-blue mr15 mt4" className="fr color-blue mr15 mt4"
style={{display:this.props.identity>4||this.props.identity===undefined||this.props.status===2||this.props.status===1?"none":'block'}} style={{ display: this.props.identity > 4 || this.props.identity === undefined || this.props.status === 2 || this.props.status === 1 ? "none" : 'block' }}
data-tip-down="新增代码编辑类型的任务">+&nbsp;实践类型</a> data-tip-down="新增代码编辑类型的任务">+&nbsp;实践类型</a>
<a href={choice_url === undefined ? "" : choice_url} <a href={choice_url === undefined ? "" : choice_url}
className="fr color-blue mr15 mt4" className="fr color-blue mr15 mt4"
style={{display:this.props.identity>4||this.props.identity===undefined||this.props.status===2||this.props.status===1?"none":'block'}} style={{ display: this.props.identity > 4 || this.props.identity === undefined || this.props.status === 2 || this.props.status === 1 ? "none" : 'block' }}
data-tip-down="新增选择题类型的任务">+&nbsp;选择题类型</a> data-tip-down="新增选择题类型的任务">+&nbsp;选择题类型</a>
</div> </div>
@ -473,19 +465,19 @@ export default class TPMchallengesnew extends Component {
<span className="mr30 color-orange pt10">*</span> <span className="mr30 color-orange pt10">*</span>
<div className="flex1 mr20"> <div className="flex1 mr20">
<input type="text" <input type="text"
// className="input-100-45 greyInput" // className="input-100-45 greyInput"
className={shixunCreatePracticetype===true?"input-100-45 greyInpus wind100":"input-100-45 greyInput "} className={shixunCreatePracticetype === true ? "input-100-45 greyInpus wind100" : "input-100-45 greyInput "}
maxLength="50" maxLength="50"
name="challenge[subject]" name="challenge[subject]"
value={shixunCreatePractice} value={shixunCreatePractice}
onInput={this.shixunCreatePractice} onInput={this.shixunCreatePractice}
placeholder="请输入任务名称(此信息将提前展示给学员),例:计算学生的课程成绩绩点"/> placeholder="请输入任务名称(此信息将提前展示给学员),例:计算学生的课程成绩绩点" />
</div> </div>
<div style={{width: '57px'}}> <div style={{ width: '57px' }}>
<span <span
className={shixunCreatePracticetype === true ? "color-orange mt8 fl block" : "color-orange mt8 fl none"} className={shixunCreatePracticetype === true ? "color-orange mt8 fl block" : "color-orange mt8 fl none"}
id="new_shixun_name"><i id="new_shixun_name"><i
className="fa fa-exclamation-circle mr3"></i></span> className="fa fa-exclamation-circle mr3"></i></span>
</div> </div>
</div> </div>
</div> </div>
@ -496,8 +488,8 @@ export default class TPMchallengesnew extends Component {
<p className="color-grey-6 font-16 mb30">过关任务</p> <p className="color-grey-6 font-16 mb30">过关任务</p>
<TPMMDEditor ref={this.exercisememoMDRef} placeholder="请输入选择题的题干内容" mdID={'exercisememoMD'} refreshTimeout={1500} <TPMMDEditor ref={this.exercisememoMDRef} placeholder="请输入选择题的题干内容" mdID={'exercisememoMD'} refreshTimeout={1500}
watch={true} className="courseMessageMD" initValue={this.state.exercisememoMDRefval} height={700}></TPMMDEditor> watch={true} className="courseMessageMD" initValue={this.state.exercisememoMDRefval} height={700}></TPMMDEditor>
<p id="e_tip_Memochallengesnew" className="edu-txt-right color-grey-cd font-12"></p> <p id="e_tip_Memochallengesnew" className="edu-txt-right color-grey-cd font-12"></p>
<p id="e_tips_Memochallengesnew" className="edu-txt-right color-grey-cd font-12"></p> <p id="e_tips_Memochallengesnew" className="edu-txt-right color-grey-cd font-12"></p>
@ -509,8 +501,8 @@ export default class TPMchallengesnew extends Component {
<div className="clearfix mb40"> <div className="clearfix mb40">
<RadioGroup value={shixunCreatePracticeGroup} className="fl mr40" <RadioGroup value={shixunCreatePracticeGroup} className="fl mr40"
disabled={this.props.status===2?true:false} disabled={this.props.status === 2 ? true : false}
onChange={this.props.status===2?"":this.onshixunCreatePracticeChange}> onChange={this.props.status === 2 ? "" : this.onshixunCreatePracticeChange}>
<Radio value={1}>简单</Radio> <Radio value={1}>简单</Radio>
<Radio value={2}>中等</Radio> <Radio value={2}>中等</Radio>
<Radio value={3}>困难</Radio> <Radio value={3}>困难</Radio>
@ -519,24 +511,24 @@ export default class TPMchallengesnew extends Component {
</div> </div>
<p className="color-grey-6 font-16 mb30">奖励经验值</p> <p className="color-grey-6 font-16 mb30">奖励经验值</p>
<div className="clearfix" <div className="clearfix"
// onMouseLeave={this.props.status===2?"":this.onshixunsmarkss} // onMouseLeave={this.props.status===2?"":this.onshixunsmarkss}
> >
<span className="fl mr30 color-orange pt10">*</span> <span className="fl mr30 color-orange pt10">*</span>
<Select style={{width: 120}} className="winput-240-40 fl" <Select style={{ width: 120 }} className="winput-240-40 fl"
id="challenge_score" id="challenge_score"
onChange={this.props.status===2?"":this.onshixunsmark} onChange={this.props.status === 2 ? "" : this.onshixunsmark}
// onMouseEnter={this.props.status===2?"":this.onshixunsmarks} // onMouseEnter={this.props.status===2?"":this.onshixunsmarks}
disabled={this.props.status===2?true:false} disabled={this.props.status === 2 ? true : false}
// open={marktype} // open={marktype}
value={onshixunsmarkvalue} value={onshixunsmarkvalue}
getPopupContainer={triggerNode => triggerNode.parentNode} getPopupContainer={triggerNode => triggerNode.parentNode}
> >
{options} {options}
</Select> </Select>
<p className="fl color-grey-9 font-12 ml20"> <p className="fl color-grey-9 font-12 ml20">
如果学员答题错误则不能得到相应的经验值<br/> 如果学员答题错误则不能得到相应的经验值<br />
如果学员成功得到经验值那么将同时获得等值的金币奖励+10经验值+10金币 如果学员成功得到经验值那么将同时获得等值的金币奖励+10经验值+10金币
</p> </p>
@ -552,21 +544,21 @@ export default class TPMchallengesnew extends Component {
<span className="mr30 color-orange pt10">*</span> <span className="mr30 color-orange pt10">*</span>
<div className="flex1"> <div className="flex1">
<Input type="text" <Input type="text"
className="winput-240-40 fl mr20 winput-240-40s" className="winput-240-40 fl mr20 winput-240-40s"
id="input_task_tag" id="input_task_tag"
placeholder="添加标签" placeholder="添加标签"
onInput={this.shixunsskill} onInput={this.shixunsskill}
value={shixunsskillvalue} value={shixunsskillvalue}
onPressEnter={this.clickshixunsskill} onPressEnter={this.clickshixunsskill}
onBlur={this.clickshixunsskill} onBlur={this.clickshixunsskill}
/> />
{/*<a className="white-btn orange-btn fl mt1 use_scope-btn ml20 mt5 mr20"*/} {/*<a className="white-btn orange-btn fl mt1 use_scope-btn ml20 mt5 mr20"*/}
{/*onClick={this.clickshixunsskill}>+ 添加</a>*/} {/*onClick={this.clickshixunsskill}>+ 添加</a>*/}
<div className="ml15 color-grey-9 mt5">学员答题正确将获得技能否则不能获得技能</div> <div className="ml15 color-grey-9 mt5">学员答题正确将获得技能否则不能获得技能</div>
<div className="mt20 clearfix" id="task_tag_content"> <div className="mt20 clearfix" id="task_tag_content">
{ {
shixunsskillvaluelist===undefined?"":shixunsskillvaluelist.length === 0 ? "" : shixunsskillvaluelist.map((itme, key) => { shixunsskillvaluelist === undefined ? "" : shixunsskillvaluelist.length === 0 ? "" : shixunsskillvaluelist.map((itme, key) => {
return ( return (
<li className="task_tag_span" key={key}><span>{itme}</span> <li className="task_tag_span" key={key}><span>{itme}</span>
<a onClick={() => this.delshixunsskilllist(key)}>×</a> <a onClick={() => this.delshixunsskilllist(key)}>×</a>
@ -581,32 +573,32 @@ export default class TPMchallengesnew extends Component {
<span <span
className={shixunsskillvaluelisttype === true ? "color-orange mt7 fl ml20 block" : " color-orange mt7 fl ml20 none"} className={shixunsskillvaluelisttype === true ? "color-orange mt7 fl ml20 block" : " color-orange mt7 fl ml20 none"}
id="stage_name_notice"> id="stage_name_notice">
<i className="fa fa-exclamation-circle mr3"></i></span> <i className="fa fa-exclamation-circle mr3"></i></span>
</div> </div>
</div> </div>
<div className="edu-back-white padding40-20 mb20"> <div className="edu-back-white padding40-20 mb20">
<p className="color-grey-6 font-16 mb30">服务配置</p> <p className="color-grey-6 font-16 mb30">服务配置</p>
<div className="clearfix mb5"> <div className="clearfix mb5">
<span className="color-orange pt10 fl">*</span> <span className="color-orange pt10 fl">*</span>
<label className="panel-form-label fl">评测时限(S)</label> <label className="panel-form-label fl">评测时限(S)</label>
<div className="pr fl with80 status_con"> <div className="pr fl with80 status_con">
<input value={this.state.exec_time} className="panel-box-sizing task-form-100 task-height-40" placeholder="请输入类别名称" onInput={this.setexec_time}/> <input value={this.state.exec_time} className="panel-box-sizing task-form-100 task-height-40" placeholder="请输入类别名称" onInput={this.setexec_time} />
</div> </div>
<span <span
className={this.state.shixunExec_timeType === true ? "color-orange mt8 fl block ml20" : "color-orange mt8 fl none"} className={this.state.shixunExec_timeType === true ? "color-orange mt8 fl block ml20" : "color-orange mt8 fl none"}
id="new_shixun_name"><i className="fa fa-exclamation-circle mr3"></i></span> id="new_shixun_name"><i className="fa fa-exclamation-circle mr3"></i></span>
<div className="cl"></div> <div className="cl"></div>
</div> </div>
</div> </div>
<div className="clearfix mt30" <div className="clearfix mt30"
style={{display:this.props.identity>4||this.props.identity===undefined?"none":'block'}} style={{ display: this.props.identity > 4 || this.props.identity === undefined ? "none" : 'block' }}
> >
{checkpointId===undefined?<a className="defalutSubmitbtn fl mr20" onClick={CreatePracticesendtype===true?"":this.CreatePracticesend}>提交</a>: {checkpointId === undefined ? <a className="defalutSubmitbtn fl mr20" onClick={CreatePracticesendtype === true ? "" : this.CreatePracticesend}>提交</a> :
<a className="defalutSubmitbtn fl mr20" onClick={editPracticesendtype===true?"":this.editPracticesend}>提交</a>} <a className="defalutSubmitbtn fl mr20" onClick={editPracticesendtype === true ? "" : this.editPracticesend}>提交</a>}
{/*<a href={go_back_url === undefined ? "" : go_back_url} className="defalutCancelbtn fl">取消</a>*/} {/*<a href={go_back_url === undefined ? "" : go_back_url} className="defalutCancelbtn fl">取消</a>*/}
<Link to={go_back_url === undefined ? "" : go_back_url} className={"defalutCancelbtn fl"}>取消</Link> <Link to={go_back_url === undefined ? "" : go_back_url} className={"defalutCancelbtn fl"}>取消</Link>
</div> </div>
</div> </div>
</React.Fragment> </React.Fragment>

@ -1,18 +1,15 @@
import React, { Component } from "react"; import React, { Component } from "react";
import { Spin } from "antd";
import axios from 'axios' import axios from 'axios'
import ModalWrapper from "../../courses/common/ModalWrapper" import ModalWrapper from "../../courses/common/ModalWrapper"
import { Cropper, getUrl } from 'educoder' import { Cropper, getUrl } from 'educoder'
const imageId = 'changeHeaderPic' const imageId = 'changeHeaderPic'
const previewId = 'changeHeader_imagePreview' const previewId = 'changeHeader_imagePreview'
let uploadedImageType;
let uploadedImageName;
let uploadedImageURL; let uploadedImageURL;
class ChangeHeaderPicModal extends Component{ class ChangeHeaderPicModal extends Component {
constructor(props){ constructor(props) {
super(props); super(props);
this.state={ this.state = {
uploading: false uploading: false
} }
} }
@ -38,25 +35,25 @@ class ChangeHeaderPicModal extends Component{
if (uploadedImageURL) { if (uploadedImageURL) {
URL.revokeObjectURL(uploadedImageURL); URL.revokeObjectURL(uploadedImageURL);
} }
const image = document.getElementById( imageId ); const image = document.getElementById(imageId);
// base64 // base64
var reader = new FileReader(); var reader = new FileReader();
reader.readAsBinaryString(file); reader.readAsBinaryString(file);
reader.onload = () => { reader.onload = () => {
let base64_content = btoa(reader.result); let base64_content = btoa(reader.result);
console.log(); console.log();
image.src = `data:${file.type};base64,${base64_content}` // uploadedImageURL = URL.createObjectURL(file); image.src = `data:${file.type};base64,${base64_content}` // uploadedImageURL = URL.createObjectURL(file);
that.fileUploaded = true; that.fileUploaded = true;
that.refs['cropper'].renew(image) that.refs['cropper'].renew(image)
// cropper.destroy(); // cropper.destroy();
// cropper = new Cropper(image, options); // cropper = new Cropper(image, options);
inputImage.value = null; inputImage.value = null;
}; };
reader.onerror = function() { reader.onerror = function () {
console.log('there are some problems'); console.log('there are some problems');
}; };
@ -113,27 +110,27 @@ class ChangeHeaderPicModal extends Component{
axios.put(url, { axios.put(url, {
image: dataUrl image: dataUrl
}) })
.then((response) => { .then((response) => {
// {"status":0,"message":"success","avatar_url":"avatars/User/15739"} // {"status":0,"message":"success","avatar_url":"avatars/User/15739"}
if (response.data.status == 0) { if (response.data.status == 0) {
// this.props.getBasicInfo() // this.props.getBasicInfo()
// https://www.trustie.net/issues/22461 // https://www.trustie.net/issues/22461
if ( this.props.current_user.image_url.indexOf('avatars/User/b') != -1 if (this.props.current_user.image_url.indexOf('avatars/User/b') != -1
|| this.props.current_user.image_url.indexOf('avatars/User/g') != -1 ) { || this.props.current_user.image_url.indexOf('avatars/User/g') != -1) {
window.setTimeout(() => { window.setTimeout(() => {
this.doAfterUpdated() this.doAfterUpdated()
}, 1000) }, 1000)
} else { } else {
this.doAfterUpdated(); this.doAfterUpdated();
}
this.setState({ uploading: false })
} }
})
.catch(function (error) {
this.setState({ uploading: false }) this.setState({ uploading: false })
}
})
.catch(function (error) {
this.setState({ uploading: false })
console.log(error); console.log(error);
}); });
}); });
} }
doAfterUpdated = () => { doAfterUpdated = () => {
@ -143,15 +140,14 @@ class ChangeHeaderPicModal extends Component{
this.setVisible(false) this.setVisible(false)
} }
render(){ render() {
const { course_lists } = this.state const { current_user } = this.props
const { moduleName, current_user } = this.props
const userHeaderImgUrl = current_user ? `${getUrl()}/images/${current_user.image_url}` : '' const userHeaderImgUrl = current_user ? `${getUrl()}/images/${current_user.image_url}` : ''
return( return (
<ModalWrapper <ModalWrapper
ref="modalWrapper" ref="modalWrapper"
title={`上传头像`} title={`上传头像`}
{...this.props } {...this.props}
onOk={this.onOk} onOk={this.onOk}
okText="保存" okText="保存"
width={552} width={552}
@ -195,31 +191,31 @@ class ChangeHeaderPicModal extends Component{
} }
`}</style> `}</style>
<div className="df"> <div className="df">
<div className="cropperWrap"> <div className="cropperWrap">
<Cropper <Cropper
imageSrc={''} imageSrc={''}
initPreviewUrl={userHeaderImgUrl} initPreviewUrl={userHeaderImgUrl}
ref="cropper" ref="cropper"
imageId={imageId} imageId={imageId}
previewId="changeHeader_imagePreview" previewId="changeHeader_imagePreview"
width={320} height={320} width={320} height={320}
></Cropper> ></Cropper>
<span className="tip">仅支持JPGGIFPNG且文件小于2M</span> <span className="tip">仅支持JPGGIFPNG且文件小于2M</span>
</div>
<div
className="df previewWrap" style={{ flexDirection: 'column' }}
>
<div>
<div id="changeHeader_imagePreview">
{userHeaderImgUrl && <img src={userHeaderImgUrl}></img>}
</div>
<div className="tip">头像预览</div>
</div> </div>
<div <label id="uploadBtn" for="inputImage">
className="df previewWrap" style ={{flexDirection: 'column'}} <input type="file" class="sr-only" id="inputImage" name="file" accept="image/*"></input>
> 点击上传
<div>
<div id="changeHeader_imagePreview">
{userHeaderImgUrl && <img src={userHeaderImgUrl}></img>}
</div>
<div className="tip">头像预览</div>
</div>
<label id="uploadBtn" for="inputImage">
<input type="file" class="sr-only" id="inputImage" name="file" accept="image/*"></input>
点击上传
</label> </label>
</div> </div>
</div> </div>
</ModalWrapper> </ModalWrapper>
) )

@ -1,17 +1,17 @@
import React,{ Component } from "react"; import React, { Component } from "react";
import { Input, InputNumber, Form, Button, Checkbox, Upload, Icon, message, Modal } from "antd"; import { Input, InputNumber, Form, Button, Checkbox, Upload, Icon, message, Modal } from "antd";
import axios from 'axios' import axios from 'axios'
import { getUploadActionUrl, getUrl, ConditionToolTip, appendFileSizeToUploadFile, appendFileSizeToUploadFileAll } from 'educoder' import { getUploadActionUrl, ConditionToolTip, appendFileSizeToUploadFile, appendFileSizeToUploadFileAll } from 'educoder'
import TPMMDEditor from '../../../tpm/challengesnew/TPMMDEditor'; import TPMMDEditor from '../../../tpm/challengesnew/TPMMDEditor';
const $ = window.$; const $ = window.$;
const MAX_TITLE_LENGTH = 60; const MAX_TITLE_LENGTH = 60;
class NewGtaskForms extends Component{ class NewGtaskForms extends Component {
constructor(props){ constructor(props) {
super(props); super(props);
this.contentMdRef = React.createRef(); this.contentMdRef = React.createRef();
this.state={ this.state = {
title_num:0, title_num: 0,
description:"", description: "",
contentFileList: [], contentFileList: [],
} }
} }
@ -19,7 +19,7 @@ class NewGtaskForms extends Component{
initValue = (data) => { initValue = (data) => {
if (data.isEdit===true) { if (data.isEdit === true) {
const contentFileList = data.attachments.map(item => { const contentFileList = data.attachments.map(item => {
return { return {
id: item.id, id: item.id,
@ -32,10 +32,10 @@ class NewGtaskForms extends Component{
}) })
this.setState({ this.setState({
...data, ...data,
base_on_project: data.task_type===2?data.group_info.base_on_project:undefined, base_on_project: data.task_type === 2 ? data.group_info.base_on_project : undefined,
title_num: parseInt(data.name.length), title_num: parseInt(data.name.length),
min_num: data.task_type===2?data.group_info.min_number:undefined, min_num: data.task_type === 2 ? data.group_info.min_number : undefined,
max_num: data.task_type===2?data.group_info.max_number:undefined, max_num: data.task_type === 2 ? data.group_info.max_number : undefined,
contentFileList, contentFileList,
}, () => { }, () => {
setTimeout(() => { setTimeout(() => {
@ -55,7 +55,7 @@ class NewGtaskForms extends Component{
// 输入title // 输入title
changeTitle=(e)=>{ changeTitle = (e) => {
console.log(e.target.value.length); console.log(e.target.value.length);
this.setState({ this.setState({
title_num: parseInt(e.target.value.length) title_num: parseInt(e.target.value.length)
@ -69,7 +69,7 @@ class NewGtaskForms extends Component{
// 初次上传不能直接取uid // 初次上传不能直接取uid
const url = `/attachments/${file.response ? file.response.id : file.uid}.json` const url = `/attachments/${file.response ? file.response.id : file.uid}.json`
axios.delete(url, { axios.delete(url, {
}) })
.then((response) => { .then((response) => {
if (response.data) { if (response.data) {
const { status } = response.data; const { status } = response.data;
@ -93,7 +93,7 @@ class NewGtaskForms extends Component{
} }
onAttachmentRemove = (file, stateName) => { onAttachmentRemove = (file, stateName) => {
if(file.response!=undefined){ if (file.response != undefined) {
this.props.confirm({ this.props.confirm({
content: '是否确认删除?', content: '是否确认删除?',
@ -111,10 +111,10 @@ class NewGtaskForms extends Component{
handleSubmit = () => { handleSubmit = () => {
let {contentFileList,min_num,max_num,base_on_project}=this.state; let { contentFileList, min_num, max_num, base_on_project } = this.state;
let {data}=this.props; let { data } = this.props;
let task_type=data.task_type let task_type = data.task_type
let topicId=this.props.topicId let topicId = this.props.topicId
let attachment_ids = contentFileList.map(item => { let attachment_ids = contentFileList.map(item => {
return item.response ? item.response.id : item.id return item.response ? item.response.id : item.id
}) })
@ -125,23 +125,23 @@ class NewGtaskForms extends Component{
values.description = mdContnet; values.description = mdContnet;
if (!err) { if (!err) {
if (this.props.data.isEdit===true) { if (this.props.data.isEdit === true) {
let url="/task_banks/"+topicId+".json"; let url = "/task_banks/" + topicId + ".json";
axios.put(url, { axios.put(url, {
gtask_bank: { gtask_bank: {
name: values.title, name: values.title,
description: values.description, description: values.description,
min_num:task_type===1?undefined:min_num, min_num: task_type === 1 ? undefined : min_num,
max_num:task_type===1?undefined:max_num, max_num: task_type === 1 ? undefined : max_num,
base_on_project: task_type===1?task_type:base_on_project===true?1:0 base_on_project: task_type === 1 ? task_type : base_on_project === true ? 1 : 0
}, },
attachment_ids:attachment_ids attachment_ids: attachment_ids
} }
).then((response) => { ).then((response) => {
if(response.data.status===0){ if (response.data.status === 0) {
this.props.showNotification(response.data.message) this.props.showNotification(response.data.message)
this.props.onCancel() this.props.onCancel()
}else{ } else {
this.props.showNotification(response.data.message) this.props.showNotification(response.data.message)
} }
}).catch((error) => { }).catch((error) => {
@ -176,14 +176,14 @@ class NewGtaskForms extends Component{
this.setState({ base_on_project: !this.state.base_on_project }) this.setState({ base_on_project: !this.state.base_on_project })
} }
render(){ render() {
const { getFieldDecorator } = this.props.form; const { getFieldDecorator } = this.props.form;
let{ let {
title_value, contentFileList, answerFileList, max_num, min_num, base_on_project, title_value, contentFileList, answerFileList, max_num, min_num, base_on_project,
init_max_num, init_min_num, init_max_num, init_min_num,
title_num, course_name, category, has_commit, has_project, title_num, course_name, category, has_commit, has_project,
isEdit isEdit
}=this.state } = this.state
const uploadProps = { const uploadProps = {
width: 600, width: 600,
fileList: contentFileList, fileList: contentFileList,
@ -205,11 +205,11 @@ class NewGtaskForms extends Component{
}; };
return( return (
<div> <div>
<style> <style>
{ {
` `
.newAboutInputForm.ant-form-item, .newAboutInputForm .ant-form-item{padding:20px 30px 20px 30px!important} .newAboutInputForm.ant-form-item, .newAboutInputForm .ant-form-item{padding:20px 30px 20px 30px!important}
.margin0{margin: 0px!important} .margin0{margin: 0px!important}
.tasktypes{width:64px; .tasktypes{width:64px;
@ -221,33 +221,33 @@ class NewGtaskForms extends Component{
color:rgba(51,51,51,1); color:rgba(51,51,51,1);
opacity:1;} opacity:1;}
` `
} }
</style> </style>
<Form className="courseForm" > <Form className="courseForm" >
<div className={"ant-row ant-form-item AboutInputForm newAboutInputForm "}> <div className={"ant-row ant-form-item AboutInputForm newAboutInputForm "}>
<div className="ant-col ant-form-item-label margin0"> <div className="ant-col ant-form-item-label margin0">
<label htmlFor="coursesNew_course" className="ant-form-item-required ">类型</label> <span className={"tasktypes"}>{this.props.data&&this.props.data.task_type===1?"":this.props.data&&this.props.data.task_type===2?"":""}</span> <label htmlFor="coursesNew_course" className="ant-form-item-required ">类型</label> <span className={"tasktypes"}>{this.props.data && this.props.data.task_type === 1 ? "" : this.props.data && this.props.data.task_type === 2 ? "" : ""}</span>
</div>
</div> </div>
<Form.Item </div>
label="标题" <Form.Item
className="AboutInputForm" label="标题"
> className="AboutInputForm"
{getFieldDecorator('title', { >
rules: [{ {getFieldDecorator('title', {
required: true, message: '请输入标题' rules: [{
}], required: true, message: '请输入标题'
})( }],
<Input placeholder="请输入毕设任务标题最大限制60个字符" })(
onInput={this.changeTitle} <Input placeholder="请输入毕设任务标题最大限制60个字符"
className="searchView yslnewworkinputaddonAfter searchViewAfter" onInput={this.changeTitle}
style={{"width":"100%"}} className="searchView yslnewworkinputaddonAfter searchViewAfter"
maxLength={MAX_TITLE_LENGTH} addonAfter={`${String(title_num)}/${MAX_TITLE_LENGTH}`} style={{ "width": "100%" }}
/> maxLength={MAX_TITLE_LENGTH} addonAfter={`${String(title_num)}/${MAX_TITLE_LENGTH}`}
)} />
</Form.Item> )}
</Form.Item>
<style>{`
<style>{`
.uploadBtn.ant-btn { .uploadBtn.ant-btn {
border: none; border: none;
color: #4CACFF; color: #4CACFF;
@ -282,26 +282,26 @@ class NewGtaskForms extends Component{
`}</style> `}</style>
{ <Form.Item {<Form.Item
label="内容" label="内容"
className="AboutInputForm workContent mdInForm" className="AboutInputForm workContent mdInForm"
> >
{getFieldDecorator('description', { {getFieldDecorator('description', {
rules: [{ rules: [{
required: true, message: '请输入任务内容说明' required: true, message: '请输入任务内容说明'
}], }],
})( })(
<TPMMDEditor ref={this.contentMdRef} placeholder="请输入任务内容说明最大限制5000个字符" mdID={'courseContentMD'} refreshTimeout={1500} <TPMMDEditor ref={this.contentMdRef} placeholder="请输入任务内容说明最大限制5000个字符" mdID={'courseContentMD'} refreshTimeout={1500}
className="courseMessageMD" initValue={this.state.description}></TPMMDEditor> className="courseMessageMD" initValue={this.state.description}></TPMMDEditor>
)} )}
</Form.Item> } </Form.Item>}
<Upload {...uploadProps} className="upload_1 newWorkUpload"> <Upload {...uploadProps} className="upload_1 newWorkUpload">
<Button className="uploadBtn"> <Button className="uploadBtn">
<Icon type="upload" /> 上传附件 <Icon type="upload" /> 上传附件
</Button> </Button>
(单个文件150M以内) (单个文件150M以内)
</Upload> </Upload>
{this.props.data&&this.props.data.task_type===2? {this.props.data && this.props.data.task_type === 2 ?
<Form.Item <Form.Item
label="分组设置" label="分组设置"
className="AboutInputForm" className="AboutInputForm"
@ -317,38 +317,38 @@ class NewGtaskForms extends Component{
<ConditionToolTip condition={has_commit} title={'已有提交作品,人数范围只能扩大'}> <ConditionToolTip condition={has_commit} title={'已有提交作品,人数范围只能扩大'}>
{/* max={has_commit ? init_min_num : null } */} {/* max={has_commit ? init_min_num : null } */}
每组最小人数<InputNumber placeholder="请填写每组最小人数" min={1} className="winput-240-40 mr10" value={min_num} 每组最小人数<InputNumber placeholder="请填写每组最小人数" min={1} className="winput-240-40 mr10" value={min_num}
onChange={this.min_num_change} style={{width:'180px'}} /> onChange={this.min_num_change} style={{ width: '180px' }} />
</ConditionToolTip> </ConditionToolTip>
<span className="ml15 mr15"></span> <span className="ml15 mr15"></span>
{/* min={has_commit ? init_max_num : (min_num == undefined ? 2 : min_num + 1) } */} {/* min={has_commit ? init_max_num : (min_num == undefined ? 2 : min_num + 1) } */}
<ConditionToolTip condition={has_commit} title={'已有提交作品,人数范围只能扩大'}> <ConditionToolTip condition={has_commit} title={'已有提交作品,人数范围只能扩大'}>
每组最大人数<InputNumber className="winput-240-40 mr10" placeholder="请填写每组最大人数" value={max_num} max={10} 每组最大人数<InputNumber className="winput-240-40 mr10" placeholder="请填写每组最大人数" value={max_num} max={10}
onChange={this.max_num_change} style={{width:'180px'}} /> onChange={this.max_num_change} style={{ width: '180px' }} />
</ConditionToolTip> </ConditionToolTip>
<div className="color-grey-9 mt20 font-14">学生提交作品时需要关联同组成员组内成员作品共享</div> <div className="color-grey-9 mt20 font-14">学生提交作品时需要关联同组成员组内成员作品共享</div>
</p> </p>
<p className="mt20"> <p className="mt20">
<ConditionToolTip condition={has_commit || has_project} title={'已有关联项目或作品,不能修改'}> <ConditionToolTip condition={has_commit || has_project} title={'已有关联项目或作品,不能修改'}>
<Checkbox checked={base_on_project} onChange={this.base_on_project_change} <Checkbox checked={base_on_project} onChange={this.base_on_project_change}
disabled={has_project || has_commit} disabled={has_project || has_commit}
className="color-grey-9 font-14" className="color-grey-9 font-14"
>基于项目选中则必须在本平台创建项目项目管理员可以提交作品不选中无需在平台创建项目任意小组成员均可以提交作品</Checkbox> >基于项目选中则必须在本平台创建项目项目管理员可以提交作品不选中无需在平台创建项目任意小组成员均可以提交作品</Checkbox>
</ConditionToolTip> </ConditionToolTip>
</p> </p>
</div> </div>
)} )}
</Form.Item>:"" </Form.Item> : ""
} }
<Form.Item> <Form.Item>
<div className="clearfix mt30 mb30"> <div className="clearfix mt30 mb30">
{/* htmlType="submit" */} {/* htmlType="submit" */}
<Button type="primary" onClick={this.handleSubmit} className="defalutSubmitbtn fl mr20">提交</Button> <Button type="primary" onClick={this.handleSubmit} className="defalutSubmitbtn fl mr20">提交</Button>
<a className="defalutCancelbtn fl" onClick={() => this.props.onCancel()}>取消</ a> <a className="defalutCancelbtn fl" onClick={() => this.props.onCancel()}>取消</ a>
</div> </div>
</Form.Item> </Form.Item>
</Form> </Form>
</div> </div>
) )
} }
} }

Loading…
Cancel
Save