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,15 +1,12 @@
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
// https://testbdweb.trustie.net
// const local = 'http://localhost:3000'
const local = 'https://test-newweb.educoder.net' const local = 'https://test-newweb.educoder.net'
if (isDev) { if (isDev) {
return `${local}/${path}` return `${local}/${path}`
@ -17,31 +14,22 @@ export function getImageUrl(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;
@ -70,25 +58,27 @@ export function getStaticUrl() {
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,11 +1,9 @@
import React, {Component} from 'react'; import React, { Component } from 'react';
import {Link} from "react-router-dom";
import axios from 'axios'; import axios from 'axios';
import { Input , Spin, Icon ,Button,Pagination,DatePicker} from 'antd'; import { Input, Spin, Icon, Button, Pagination, DatePicker } from 'antd';
import { handleDateString,getUrl,setmiyah} from 'educoder'; import { handleDateString, getUrl, setmiyah } from 'educoder';
import locale from 'antd/lib/date-picker/locale/zh_CN'; import locale from 'antd/lib/date-picker/locale/zh_CN';
import MDEditors from '../MDEditors'; import MDEditors from '../MDEditors';
import PhoneModel from './PhoneModel';
import moment from 'moment'; import moment from 'moment';
import '../packageconcnet.css'; import '../packageconcnet.css';
const { Search } = Input; const { Search } = Input;
@ -22,9 +20,9 @@ if (!window.postUpMsg) {
} }
function checkPhone(phone){ function checkPhone(phone) {
if(!(/^1[3456789]\d{9}$/.test(phone))){ if (!(/^1[3456789]\d{9}$/.test(phone))) {
// alert("手机号码有误,请重填"); // alert("手机号码有误,请重填");
return false; return false;
} }
@ -54,62 +52,62 @@ class PackageIndexNEIBannerConcent extends Component {
super(props) super(props)
this.contentMdRef = React.createRef(); this.contentMdRef = React.createRef();
this.state = { this.state = {
modalCancel:false, modalCancel: false,
getverificationcodes:true, getverificationcodes: true,
seconds:60, seconds: 60,
springtype:false, springtype: false,
category:undefined, category: undefined,
title:undefined, title: undefined,
content:undefined, content: undefined,
attachment_ids:undefined, attachment_ids: undefined,
deadline_at:undefined, deadline_at: undefined,
min_price:undefined, min_price: undefined,
max_price:undefined, max_price: undefined,
contact_name:undefined, contact_name: undefined,
contact_phone:undefined, contact_phone: undefined,
code:undefined, code: undefined,
publish:false, publish: false,
categories:[] categories: []
} }
} }
componentDidMount() { componentDidMount() {
window.document.title = '众包创新' window.document.title = '众包创新'
if(this.props.match.params.id!=undefined){ if (this.props.match.params.id != undefined) {
let url=`/project_packages/${this.props.match.params.id}.json` let url = `/project_packages/${this.props.match.params.id}.json`
axios.get((url)).then((response) => { axios.get((url)).then((response) => {
let data=response.data let data = response.data
this.setState({ this.setState({
category:data.category_id, category: data.category_id,
title:data.title, title: data.title,
content:data.content, content: data.content,
deadline_at:moment(data.deadline_at), deadline_at: moment(data.deadline_at),
min_price:data.min_price, min_price: data.min_price,
max_price:data.max_price, max_price: data.max_price,
contact_name:data.contact_name==null||data.contact_name==undefined?this.props.current_user.real_name:data.contact_name, contact_name: data.contact_name == null || data.contact_name == undefined ? this.props.current_user.real_name : data.contact_name,
phones:data.contact_phone, phones: data.contact_phone,
attachments:data.attachments, attachments: data.attachments,
}) })
}).catch((error) => { }).catch((error) => {
console.log(error); console.log(error);
}) })
}else{ } else {
console.log(this.props.current_user&&this.props.current_user.real_name) console.log(this.props.current_user && this.props.current_user.real_name)
} }
let Url = `/project_package_categories.json`; let Url = `/project_package_categories.json`;
axios.get(Url).then((response) => { axios.get(Url).then((response) => {
// console.log(response) // console.log(response)
if(response.data.status===-1){ if (response.data.status === -1) {
}else{ } else {
this.setState({ this.setState({
categories:response.data.categories categories: response.data.categories
}) })
} }
@ -118,7 +116,7 @@ class PackageIndexNEIBannerConcent extends Component {
}) })
this.setState({ this.setState({
contact_name:this.props.current_user&&this.props.current_user.real_name contact_name: this.props.current_user && this.props.current_user.real_name
}) })
// this.contentMdRef.current.setValue("测试赋值") // this.contentMdRef.current.setValue("测试赋值")
@ -126,22 +124,22 @@ class PackageIndexNEIBannerConcent extends Component {
componentDidUpdate = (prevProps) => { componentDidUpdate = (prevProps) => {
if(prevProps.current_user!=this.props.current_user){ if (prevProps.current_user != this.props.current_user) {
if(this.props.current_user!=undefined){ if (this.props.current_user != undefined) {
this.setState({ this.setState({
contact_name:this.props.current_user.real_name contact_name: this.props.current_user.real_name
}) })
} }
} }
} }
//获取验证码; //获取验证码;
getverificationcode =()=>{ getverificationcode = () => {
// if (this.state.logins&&this.state.logins.length === 0) { // if (this.state.logins&&this.state.logins.length === 0) {
// // 判断没有输入手机号 // // 判断没有输入手机号
// return // return
// } // }
if(this.state.getverificationcodes === undefined){ if (this.state.getverificationcodes === undefined) {
console.log("undefined"); console.log("undefined");
return; return;
} }
@ -188,22 +186,22 @@ class PackageIndexNEIBannerConcent extends Component {
} }
//短信验证 //短信验证
SMSverification = () => { SMSverification = () => {
let {contact_phone,code}=this.state; let { contact_phone, code } = this.state;
var url = `/accounts/get_verification_code.json`; var url = `/accounts/get_verification_code.json`;
axios.get((url), { axios.get((url), {
params: { params: {
login: contact_phone, login: contact_phone,
type: 5, type: 5,
smscode:setmiyah(contact_phone) smscode: setmiyah(contact_phone)
} }
}).then((result) => { }).then((result) => {
//验证有问题{"status":1,"message":"success"} //验证有问题{"status":1,"message":"success"}
// console.log(result); // console.log(result);
// this.openNotification("验证码已发送,请注意查收"); // this.openNotification("验证码已发送,请注意查收");
if(result.data.status===1){ if (result.data.status === 1) {
this.openNotification("验证码已发送,请注意查收"); this.openNotification("验证码已发送,请注意查收");
}else if(result.data.status===-2){ } else if (result.data.status === -2) {
this.openNotification(result.data.message); this.openNotification(result.data.message);
} }
}).catch((error) => { }).catch((error) => {
@ -214,27 +212,27 @@ class PackageIndexNEIBannerConcent extends Component {
onChangeTimePicker = (value, dateString) => { onChangeTimePicker = (value, dateString) => {
if(value===null){ if (value === null) {
this.setState({ this.setState({
deadline_at:"" deadline_at: ""
}) })
}else{ } else {
if(moment(handleDateString(dateString))===undefined||moment(handleDateString(dateString))===null||moment(handleDateString(dateString))===""){ if (moment(handleDateString(dateString)) === undefined || moment(handleDateString(dateString)) === null || moment(handleDateString(dateString)) === "") {
this.setState({ this.setState({
deadline_attypes:true deadline_attypes: true
}) })
}else{ } else {
this.setState({ this.setState({
deadline_attypes:false deadline_attypes: false
}) })
} }
if(moment(handleDateString(dateString))<moment(new Date())){ if (moment(handleDateString(dateString)) < moment(new Date())) {
this.setState({ this.setState({
deadline_attypexy:true deadline_attypexy: true
}) })
}else{ } else {
this.setState({ this.setState({
deadline_attypexy:false deadline_attypexy: false
}) })
} }
@ -246,21 +244,21 @@ class PackageIndexNEIBannerConcent extends Component {
} }
setcheckoutcontent=()=>{ setcheckoutcontent = () => {
const content = this.contentMdRef.current.getValue().trim(); const content = this.contentMdRef.current.getValue().trim();
if(content===undefined||content===null||content===""){ if (content === undefined || content === null || content === "") {
this.setState({ this.setState({
contenttypes:true contenttypes: true
}) })
}else{ } else {
this.setState({ this.setState({
contenttypes:false contenttypes: false
}) })
} }
} }
setcheckout=(min_price,max_price)=>{ setcheckout = (min_price, max_price) => {
// if(min_price===undefined){ // if(min_price===undefined){
// this.setState({ // this.setState({
// min_pricetype:true // min_pricetype:true
@ -295,24 +293,24 @@ class PackageIndexNEIBannerConcent extends Component {
// }) // })
// } // }
if(parseInt(min_price)<=0){ if (parseInt(min_price) <= 0) {
this.setState({ this.setState({
smallstype:true smallstype: true
}) })
}else{ } else {
this.setState({ this.setState({
smallstype:false smallstype: false
}) })
} }
if(parseInt(max_price)<parseInt(min_price)){ if (parseInt(max_price) < parseInt(min_price)) {
this.setState({ this.setState({
minmaxtype:true minmaxtype: true
}) })
}else{ } else {
this.setState({ this.setState({
minmaxtype:false minmaxtype: false
}) })
} }
@ -320,52 +318,52 @@ class PackageIndexNEIBannerConcent extends Component {
setPublication=(type)=>{ setPublication = (type) => {
const content = this.contentMdRef.current.getValue().trim(); const content = this.contentMdRef.current.getValue().trim();
// console.log(content) // console.log(content)
// console.log(this.state.deadline_at._i) // console.log(this.state.deadline_at._i)
this.setState({ this.setState({
publish:type publish: type
}) })
let types=type; let types = type;
let {category,title,attachment_ids,deadline_at,min_price,max_price,contact_name,contact_phone,code,modalCancel}=this.state; let { category, title, attachment_ids, deadline_at, min_price, max_price, contact_name, contact_phone, code, modalCancel } = this.state;
if(category===undefined||category===null||category===""){ if (category === undefined || category === null || category === "") {
this.setState({ this.setState({
categorytypes:true categorytypes: true
}) })
this.scrollToAnchor("publishtimestart"); this.scrollToAnchor("publishtimestart");
return return
} }
if(title===undefined||title===null||title===""){ if (title === undefined || title === null || title === "") {
this.setState({ this.setState({
titletypes:true titletypes: true
}) })
this.scrollToAnchor("publishtimestart"); this.scrollToAnchor("publishtimestart");
return return
} }
if(content===undefined||content===null||content===""){ if (content === undefined || content === null || content === "") {
this.setState({ this.setState({
contenttypes:true contenttypes: true
}) })
this.scrollToAnchor("publishtimestart"); this.scrollToAnchor("publishtimestart");
return return
} }
if(deadline_at===undefined||deadline_at===null||deadline_at===""){ if (deadline_at === undefined || deadline_at === null || deadline_at === "") {
this.setState({ this.setState({
deadline_attypes:true deadline_attypes: true
}) })
this.scrollToAnchor("publishtime"); this.scrollToAnchor("publishtime");
return return
} }
if(moment(deadline_at)<moment(new Date())){ if (moment(deadline_at) < moment(new Date())) {
this.setState({ this.setState({
deadline_attypexy:true deadline_attypexy: true
}) })
return return
} }
@ -394,24 +392,24 @@ class PackageIndexNEIBannerConcent extends Component {
// return // return
// } // }
if(parseInt(min_price)<=0){ if (parseInt(min_price) <= 0) {
this.setState({ this.setState({
smallstype:true smallstype: true
}) })
return return
} }
if(parseInt(max_price)<parseInt(min_price)){ if (parseInt(max_price) < parseInt(min_price)) {
this.setState({ this.setState({
minmaxtype:true minmaxtype: true
}) })
return return
} }
if(contact_name===undefined||contact_name===""||contact_name===null){ if (contact_name === undefined || contact_name === "" || contact_name === null) {
this.setState({ this.setState({
contact_nametype:true contact_nametype: true
}) })
return return
} }
@ -426,33 +424,33 @@ class PackageIndexNEIBannerConcent extends Component {
// } // }
if(this.props.current_user&&this.props.current_user.phone===null||modalCancel===true){ if (this.props.current_user && this.props.current_user.phone === null || modalCancel === true) {
if(contact_phone===undefined||contact_phone===null||contact_phone===""){ if (contact_phone === undefined || contact_phone === null || contact_phone === "") {
this.setState({ this.setState({
contact_phonetype:true contact_phonetype: true
}) })
return return
} }
if(checkPhone(contact_phone)===false){ if (checkPhone(contact_phone) === false) {
this.setState({ this.setState({
contact_phonetypes:true contact_phonetypes: true
}) })
return return
} }
if(code===undefined||code===""||code===null){ if (code === undefined || code === "" || code === null) {
this.setState({ this.setState({
codeypes:true codeypes: true
}) })
return return
} }
} }
this.setState({ this.setState({
springtype:true springtype: true
}) })
if(this.props.match.params.id===undefined){ if (this.props.match.params.id === undefined) {
const url = `/project_packages.json`; const url = `/project_packages.json`;
axios.post(url, { axios.post(url, {
@ -460,44 +458,44 @@ class PackageIndexNEIBannerConcent extends Component {
title: title, title: title,
content: content, content: content,
attachment_ids: attachment_ids, attachment_ids: attachment_ids,
deadline_at:deadline_at._i, deadline_at: deadline_at._i,
min_price:parseInt(min_price), min_price: parseInt(min_price),
max_price:parseInt(max_price), max_price: parseInt(max_price),
contact_name: contact_name===null||contact_name===undefined?this.props.current_user.real_name:contact_name, contact_name: contact_name === null || contact_name === undefined ? this.props.current_user.real_name : contact_name,
contact_phone: contact_phone===undefined?this.props.current_user&&this.props.current_user.phone:contact_phone, contact_phone: contact_phone === undefined ? this.props.current_user && this.props.current_user.phone : contact_phone,
code:code, code: code,
publish:types publish: types
} }
).then((response) => { ).then((response) => {
if(response.data.status===0){ if (response.data.status === 0) {
if(type===true){ if (type === true) {
this.props.setPublicationfun(response.data.id) this.props.setPublicationfun(response.data.id)
}else{ } else {
window.location.href="/crowdsourcing/"+response.data.id window.location.href = "/crowdsourcing/" + response.data.id
} }
this.setState({ this.setState({
springtype:false springtype: false
}) })
}else if(response.data.status===-1){ } else if (response.data.status === -1) {
if(response.data.message==="无效的验证码"){ if (response.data.message === "无效的验证码") {
this.setState({ this.setState({
codeypesno:true, codeypesno: true,
springtype:false springtype: false
}) })
} }
} }
this.setState({ this.setState({
springtype:false springtype: false
}) })
}).catch((error) => { }).catch((error) => {
console.log(error) console.log(error)
this.setState({ this.setState({
springtype:false springtype: false
}) })
}) })
}else{ } else {
// edit // edit
@ -508,39 +506,39 @@ class PackageIndexNEIBannerConcent extends Component {
title: title, title: title,
content: content, content: content,
attachment_ids: attachment_ids, attachment_ids: attachment_ids,
deadline_at:deadline_at._i, deadline_at: deadline_at._i,
min_price:parseInt(min_price), min_price: parseInt(min_price),
max_price:parseInt(max_price), max_price: parseInt(max_price),
contact_name: contact_name===null||contact_name===undefined?this.props.current_user.real_name:contact_name, contact_name: contact_name === null || contact_name === undefined ? this.props.current_user.real_name : contact_name,
contact_phone: contact_phone===undefined?this.props.current_user&&this.props.current_user.phone:contact_phone, contact_phone: contact_phone === undefined ? this.props.current_user && this.props.current_user.phone : contact_phone,
code:code, code: code,
publish:types publish: types
} }
).then((response) => { ).then((response) => {
if(response.data.status===0){ if (response.data.status === 0) {
if(type===true){ if (type === true) {
this.props.setPublicationfun(response.data.id) this.props.setPublicationfun(response.data.id)
}else{ } else {
window.location.href="/crowdsourcing/"+response.data.id window.location.href = "/crowdsourcing/" + response.data.id
} }
this.setState({ this.setState({
springtype:false springtype: false
}) })
}else if(response.data.status===-1){ } else if (response.data.status === -1) {
if(response.data.message==="无效的验证码"){ if (response.data.message === "无效的验证码") {
this.setState({ this.setState({
codeypesno:true, codeypesno: true,
springtype:false springtype: false
}) })
} }
} }
this.setState({ this.setState({
springtype:false springtype: false
}) })
}).catch((error) => { }).catch((error) => {
console.log(error) console.log(error)
this.setState({ this.setState({
springtype:false springtype: false
}) })
}) })
@ -551,92 +549,92 @@ class PackageIndexNEIBannerConcent extends Component {
} }
modalCancel=()=>{ modalCancel = () => {
this.setState({ this.setState({
modalCancel:false, modalCancel: false,
contact_phone:undefined, contact_phone: undefined,
code:undefined, code: undefined,
}) })
} }
editmodels=()=>{ editmodels = () => {
this.setState({ this.setState({
modalCancel:true modalCancel: true
}) })
} }
setcategory=(value)=>{ setcategory = (value) => {
if(value===undefined||value===null||value===""){ if (value === undefined || value === null || value === "") {
this.setState({ this.setState({
categorytypes:true categorytypes: true
}) })
}else{ } else {
this.setState({ this.setState({
categorytypes:false categorytypes: false
}) })
} }
this.setState({ this.setState({
category:value category: value
}) })
} }
settitlefun=(e)=>{ settitlefun = (e) => {
if(e.target.value===undefined||e.target.value===null||e.target.value===""){ if (e.target.value === undefined || e.target.value === null || e.target.value === "") {
this.setState({ this.setState({
titletypes:true titletypes: true
}) })
}else{ } else {
this.setState({ this.setState({
titletypes:false titletypes: false
}) })
} }
this.setState({ this.setState({
title:e.target.value title: e.target.value
}) })
} }
onChangemin_prices=(e)=>{ onChangemin_prices = (e) => {
let{max_price}=this.state; let { max_price } = this.state;
this.setState({ this.setState({
min_price:e.target.value min_price: e.target.value
}) })
this.setcheckout(e.target.value,max_price) this.setcheckout(e.target.value, max_price)
} }
onChangemax_prices=(e)=>{ onChangemax_prices = (e) => {
let{min_price}=this.state; let { min_price } = this.state;
this.setState({ this.setState({
max_price:e.target.value max_price: e.target.value
}) })
this.setcheckout(min_price,e.target.value) this.setcheckout(min_price, e.target.value)
} }
onChangeContact_name=(e)=>{ onChangeContact_name = (e) => {
if(e.target.value===undefined||e.target.value===""||e.target.value===null){ if (e.target.value === undefined || e.target.value === "" || e.target.value === null) {
this.setState({ this.setState({
contact_nametype:true contact_nametype: true
}) })
}else{ } else {
this.setState({ this.setState({
contact_nametype:false contact_nametype: false
}) })
} }
this.setState({ this.setState({
contact_name:e.target.value contact_name: e.target.value
}) })
} }
onChangeContact_phone=(e)=>{ onChangeContact_phone = (e) => {
let {modalCancel}=this.state; let { modalCancel } = this.state;
// if(modalCancel===false){ // if(modalCancel===false){
// if(this.props.current_user.phone===undefined||this.props.current_user.phone===null||this.props.current_user.phone===""){ // if(this.props.current_user.phone===undefined||this.props.current_user.phone===null||this.props.current_user.phone===""){
// this.setState({ // this.setState({
@ -648,46 +646,46 @@ class PackageIndexNEIBannerConcent extends Component {
// }) // })
// } // }
// } // }
if(this.props.current_user&&this.props.current_user.phone===null||modalCancel===true){ if (this.props.current_user && this.props.current_user.phone === null || modalCancel === true) {
if(e.target.value===undefined||e.target.value===null||e.target.value===""){ if (e.target.value === undefined || e.target.value === null || e.target.value === "") {
this.setState({ this.setState({
contact_phonetype:true contact_phonetype: true
}) })
}else{ } else {
this.setState({ this.setState({
contact_phonetype:false contact_phonetype: false
}) })
} }
if(checkPhone(e.target.value)===false){ if (checkPhone(e.target.value) === false) {
this.setState({ this.setState({
contact_phonetypes:true contact_phonetypes: true
}) })
}else{ } else {
this.setState({ this.setState({
contact_phonetypes:false contact_phonetypes: false
}) })
} }
} }
this.setState({ this.setState({
contact_phone:e.target.value contact_phone: e.target.value
}) })
} }
onChangeCode=(e)=>{ onChangeCode = (e) => {
if(e.target.value===undefined||e.target.value===""||e.target.value===null){ if (e.target.value === undefined || e.target.value === "" || e.target.value === null) {
this.setState({ this.setState({
codeypes:true codeypes: true
}) })
}else{ } else {
this.setState({ this.setState({
codeypes:false codeypes: false
}) })
} }
this.setState({ this.setState({
code:e.target.value code: e.target.value
}) })
} }
@ -697,21 +695,21 @@ class PackageIndexNEIBannerConcent extends Component {
// 找到锚点 // 找到锚点
let anchorElement = document.getElementById(anchorName); let anchorElement = document.getElementById(anchorName);
// 如果对应id的锚点存在就跳转到锚点 // 如果对应id的锚点存在就跳转到锚点
if(anchorElement) { anchorElement.scrollIntoView(); } if (anchorElement) { anchorElement.scrollIntoView(); }
} }
} }
render() { render() {
let {modalCancel,seconds,getverificationcodes,attachments, let { modalCancel, seconds, getverificationcodes, attachments,
category,title}=this.state; category, title } = this.state;
let categorylist=[ let categorylist = [
{name:"前端开发",value:"front"}, { name: "前端开发", value: "front" },
{name:"后端开发",value:"backend"}, { name: "后端开发", value: "backend" },
{name:"移动开发",value:"mobile"}, { name: "移动开发", value: "mobile" },
{name:"数据库",value:"database"}, { name: "数据库", value: "database" },
{name:"云计算和大数据",value:"cloud_compute_and_big_data"}, { name: "云计算和大数据", value: "cloud_compute_and_big_data" },
{name:"人工智能",value:"ai"}, { name: "人工智能", value: "ai" },
{name:"其他",value:"other"}, { name: "其他", value: "other" },
] ]
@ -733,27 +731,27 @@ class PackageIndexNEIBannerConcent extends Component {
<p className="clearfix mb20 shaiContent" > <p className="clearfix mb20 shaiContent" >
<div className="fl pr shaiAllItem pagetype"> <div className="fl pr shaiAllItem pagetype">
{this.state.categories.map((item,key)=>{ {this.state.categories.map((item, key) => {
return( return (
<li key={key} className={category===item.id?"shaiItem shixun_repertoire active borderccc":"shaiItem shixun_repertoire borderccc"} value={item.id} onClick={()=>this.setcategory(item.id)}>{item.name}</li> <li key={key} className={category === item.id ? "shaiItem shixun_repertoire active borderccc" : "shaiItem shixun_repertoire borderccc"} value={item.id} onClick={() => this.setcategory(item.id)}>{item.name}</li>
) )
})} })}
</div> </div>
</p> </p>
{this.state.categorytypes===true?<div className={"color-red mb10"}>请选择类型</div>:""} {this.state.categorytypes === true ? <div className={"color-red mb10"}>请选择类型</div> : ""}
<div className="ant-form-item-label mb15"> <div className="ant-form-item-label mb15">
<label htmlFor="coursesNew_description" className="ant-form-item-requireds font-16" >需求标题和详情</label> <label htmlFor="coursesNew_description" className="ant-form-item-requireds font-16" >需求标题和详情</label>
</div> </div>
<Input placeholder="请输入需求标题示例美食类APP开发最大限制60个字符" maxLength="60" className="input-100-40s mt5 fafafas" <Input placeholder="请输入需求标题示例美食类APP开发最大限制60个字符" maxLength="60" className="input-100-40s mt5 fafafas"
value={title} onInput={this.settitlefun}/> value={title} onInput={this.settitlefun} />
{this.state.titletypes===true?<div className={"color-red mt10"}>不能为空</div>:""} {this.state.titletypes === true ? <div className={"color-red mt10"}>不能为空</div> : ""}
<MDEditors ref={this.contentMdRef} placeholder="请填写清晰完整的需求内容" mdID={'courseContentMD'} refreshTimeout={1500} <MDEditors ref={this.contentMdRef} placeholder="请填写清晰完整的需求内容" mdID={'courseContentMD'} refreshTimeout={1500}
watch={false} className="courseMessageMD" initValue={this.state.content} setcheckoutcontent={()=>this.setcheckoutcontent()}></MDEditors> watch={false} className="courseMessageMD" initValue={this.state.content} setcheckoutcontent={() => this.setcheckoutcontent()}></MDEditors>
{/* 请求status 422 */} {/* 请求status 422 */}
{this.state.contenttypes===true?<div className={"color-red"}>不能为空</div>:""} {this.state.contenttypes === true ? <div className={"color-red"}>不能为空</div> : ""}
{/*<div className="df uploadBtn">*/} {/*<div className="df uploadBtn">*/}
{/*<a href="javascript:void(0);" className="fl" onClick={() => window.$('#_file').click()}*/} {/*<a href="javascript:void(0);" className="fl" onClick={() => window.$('#_file').click()}*/}
{/*data-tip-down="请选择文件上传">*/} {/*data-tip-down="请选择文件上传">*/}
@ -801,7 +799,7 @@ class PackageIndexNEIBannerConcent extends Component {
</div> </div>
</div> </div>
<div className={"stud-class-set padding30 coursenavbox edu-back-white"} style={{borderTop: '1px solid #EAEAEA'}} id={"publishtime"}> <div className={"stud-class-set padding30 coursenavbox edu-back-white"} style={{ borderTop: '1px solid #EAEAEA' }} id={"publishtime"}>
<div className={"ant-row contentbox mdInForm "}> <div className={"ant-row contentbox mdInForm "}>
<div className="ant-form-item-label mb10"> <div className="ant-form-item-label mb10">
<label htmlFor="coursesNew_description" className="ant-form-item-requireds font-16">工期与预算</label> <label htmlFor="coursesNew_description" className="ant-form-item-requireds font-16">工期与预算</label>
@ -812,7 +810,7 @@ class PackageIndexNEIBannerConcent extends Component {
showToday={false} showToday={false}
showTime={{ format: 'HH:mm' }} showTime={{ format: 'HH:mm' }}
locale={locale} locale={locale}
style={{"width": "260px"}} style={{ "width": "260px" }}
format="YYYY-MM-DD HH:mm" format="YYYY-MM-DD HH:mm"
placeholder="请选择任务的竞标截止日期" placeholder="请选择任务的竞标截止日期"
className={"fafas"} className={"fafas"}
@ -823,18 +821,18 @@ class PackageIndexNEIBannerConcent extends Component {
onChange={this.onChangeTimePicker} onChange={this.onChangeTimePicker}
/> />
{this.state.deadline_attypes===true?<div className={"color-red ml100"}>不能为空</div>:""} {this.state.deadline_attypes === true ? <div className={"color-red ml100"}>不能为空</div> : ""}
{this.state.deadline_attypexy===true?<div className={"color-red ml100"}>不能早于当前时间</div>:""} {this.state.deadline_attypexy === true ? <div className={"color-red ml100"}>不能早于当前时间</div> : ""}
</p> </p>
<p className="clearfix mb20 shaiContent"> <p className="clearfix mb20 shaiContent">
<span className="shaiTitle fl mt5 ml10">支付费用</span> <span className="shaiTitle fl mt5 ml10">支付费用</span>
<Input <Input
className={"fafas"} className={"fafas"}
style={{"width": "260px"}} style={{ "width": "260px" }}
value={this.state.min_price} value={this.state.min_price}
placeholder="支付多少费用(最低)" placeholder="支付多少费用(最低)"
onInput={(e)=>this.onChangemin_prices(e)} onInput={(e) => this.onChangemin_prices(e)}
suffix={ suffix={
<span >¥</span> <span >¥</span>
} }
@ -842,17 +840,17 @@ class PackageIndexNEIBannerConcent extends Component {
<span className={"ml10 mr10"}></span> <span className={"ml10 mr10"}></span>
<Input <Input
className={"fafas"} className={"fafas"}
style={{"width": "260px"}} style={{ "width": "260px" }}
value={this.state.max_price} value={this.state.max_price}
placeholder="支付多少费用(最高)" placeholder="支付多少费用(最高)"
onInput={(e)=>this.onChangemax_prices(e)} onInput={(e) => this.onChangemax_prices(e)}
suffix={ suffix={
<span>¥</span> <span>¥</span>
} }
/><span className={"pagenoedits"}></span> /><span className={"pagenoedits"}></span>
{this.state.min_pricetype===true?<div className={"color-red ml100"}>不能为空</div>:""} {this.state.min_pricetype === true ? <div className={"color-red ml100"}>不能为空</div> : ""}
{this.state.smallstype===true?<div className={"color-red ml100"}>不能小于零</div>:""} {this.state.smallstype === true ? <div className={"color-red ml100"}>不能小于零</div> : ""}
{this.state.minmaxtype===true?<div className={"color-red ml100"}>最高费用不能小于最低费用</div>:""} {this.state.minmaxtype === true ? <div className={"color-red ml100"}>最高费用不能小于最低费用</div> : ""}
</p> </p>
<div className="ant-form-item-label mb10"> <div className="ant-form-item-label mb10">
<label htmlFor="coursesNew_description" className="ant-form-item-requireds font-16" >联系方式</label> <label htmlFor="coursesNew_description" className="ant-form-item-requireds font-16" >联系方式</label>
@ -861,29 +859,29 @@ class PackageIndexNEIBannerConcent extends Component {
<span className="shaiTitle fl mt5 ml40">姓名</span> <span className="shaiTitle fl mt5 ml40">姓名</span>
<Input <Input
className={"fafafas"} className={"fafafas"}
style={{"width": "260px"}} style={{ "width": "260px" }}
value={this.state.contact_name===null||this.state.contact_name===undefined?this.props.current_user&&this.props.current_user.real_name:this.state.contact_name} value={this.state.contact_name === null || this.state.contact_name === undefined ? this.props.current_user && this.props.current_user.real_name : this.state.contact_name}
placeholder="请输入姓名" placeholder="请输入姓名"
onInput={(e)=>this.onChangeContact_name(e)} onInput={(e) => this.onChangeContact_name(e)}
/> />
{this.state.contact_nametype===true?<div className={"color-red ml100"}>不能为空</div>:""} {this.state.contact_nametype === true ? <div className={"color-red ml100"}>不能为空</div> : ""}
</p> </p>
{this.props.current_user&&this.props.current_user.phone!=null&&modalCancel===false?<p className="clearfix mb20 shaiContent"> {this.props.current_user && this.props.current_user.phone != null && modalCancel === false ? <p className="clearfix mb20 shaiContent">
<span className="shaiTitle fl mt5 ml25">手机号</span> <span className="shaiTitle fl mt5 ml25">手机号</span>
<Input <Input
className={"fafafas fl"} className={"fafafas fl"}
style={{"width": "260px"}} style={{ "width": "260px" }}
value={this.state.phones===undefined?this.props.current_user&&this.props.current_user.phone:this.state.phones} value={this.state.phones === undefined ? this.props.current_user && this.props.current_user.phone : this.state.phones}
placeholder="请输入手机号" placeholder="请输入手机号"
disabled={true} disabled={true}
/> />
<a className="fl ml20 mt10"> <a className="fl ml20 mt10">
<i className="iconfont icon-bianjidaibeijing font-20 color-blue" onClick={()=>this.editmodels()}></i> <i className="iconfont icon-bianjidaibeijing font-20 color-blue" onClick={() => this.editmodels()}></i>
</a> </a>
</p>:""} </p> : ""}
{/*{this.state.current_userphonetype===true?<div className={"color-red ml100"}>不能为空</div>:""}*/} {/*{this.state.current_userphonetype===true?<div className={"color-red ml100"}>不能为空</div>:""}*/}
{this.props.current_user&&this.props.current_user.phone===null||modalCancel===true?<p className="clearfix mb20 shaiContent"> {this.props.current_user && this.props.current_user.phone === null || modalCancel === true ? <p className="clearfix mb20 shaiContent">
<span className="shaiTitle mt5 fl"> <span className="shaiTitle mt5 fl">
<span className="shaiTitle fl mt5 ml25"> <span className="shaiTitle fl mt5 ml25">
{/*未注册才显示!*/} {/*未注册才显示!*/}
@ -891,13 +889,13 @@ class PackageIndexNEIBannerConcent extends Component {
手机号</span> 手机号</span>
<Input <Input
className={"fafafas fl"} className={"fafafas fl"}
style={{"width": "260px"}} style={{ "width": "260px" }}
value={this.state.contact_phone} value={this.state.contact_phone}
placeholder="请输入手机号码" placeholder="请输入手机号码"
onInput={(e)=>this.onChangeContact_phone(e)} onInput={(e) => this.onChangeContact_phone(e)}
/> />
{this.state.contact_phonetype===true?<div className={"color-red ml100"}>不能为空</div>:""} {this.state.contact_phonetype === true ? <div className={"color-red ml100"}>不能为空</div> : ""}
{this.state.contact_phonetypes===true?<div className={"color-red ml100"}>请输入正确的手机号</div>:""} {this.state.contact_phonetypes === true ? <div className={"color-red ml100"}>请输入正确的手机号</div> : ""}
</span> </span>
<span className="shaiTitle mt5 ml17 fl"> <span className="shaiTitle mt5 ml17 fl">
@ -908,21 +906,21 @@ class PackageIndexNEIBannerConcent extends Component {
className="fafas" className="fafas"
placeholder="请输入验证码" placeholder="请输入验证码"
enterButton={ enterButton={
getverificationcodes === undefined ? <span>重新发送 ({seconds}s)</span>: getverificationcodes === true ?<span ></span> :<span ></span>} getverificationcodes === undefined ? <span>重新发送 ({seconds}s)</span> : getverificationcodes === true ? <span ></span> : <span ></span>}
onSearch={()=>this.getverificationcode()} onSearch={() => this.getverificationcode()}
onInput={(e)=>this.onChangeCode(e)} onInput={(e) => this.onChangeCode(e)}
/> />
{this.state.codeypes===true?<div className={"color-red"}>验证码不能为空</div>:""} {this.state.codeypes === true ? <div className={"color-red"}>验证码不能为空</div> : ""}
{this.state.codeypesno===true?<div className={"color-red"}>验证码不正确</div>:""} {this.state.codeypesno === true ? <div className={"color-red"}>验证码不正确</div> : ""}
</span> </span>
<span> <span>
{/*<Button type="primary" className="defalutSubmitbtn ml10 defalutSubmitbtnmodels">重新发送()</Button>*/} {/*<Button type="primary" className="defalutSubmitbtn ml10 defalutSubmitbtnmodels">重新发送()</Button>*/}
</span> </span>
</span> </span>
<a className="fl mt8 mt15"> <a className="fl mt8 mt15">
<span className="font-18 color-blue" onClick={()=>this.modalCancel()}>X</span> <span className="font-18 color-blue" onClick={() => this.modalCancel()}>X</span>
</a> </a>
</p>:""} </p> : ""}
</div> </div>
@ -930,8 +928,8 @@ class PackageIndexNEIBannerConcent extends Component {
</p> </p>
<div className="clearfix mt30 mb30"> <div className="clearfix mt30 mb30">
<Button type="primary" className="defalutSubmitbtn fl mr20 defalutSubmitbtns" onClick={()=>this.setPublication(true)}>申请发布</Button> <Button type="primary" className="defalutSubmitbtn fl mr20 defalutSubmitbtns" onClick={() => this.setPublication(true)}>申请发布</Button>
<a className="defalutCancelbtns fl" onClick={()=>this.setPublication(false)}>保存</ a> <a className="defalutCancelbtns fl" onClick={() => this.setPublication(false)}>保存</ a>
</div> </div>
</Spin> </Spin>
</div> </div>

@ -1,44 +1,38 @@
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('')
} }
@ -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,7 +65,7 @@ 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">
@ -79,7 +73,7 @@ export default class TPMUpdatepropaede extends Component {
<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">
@ -91,7 +85,7 @@ export default class TPMUpdatepropaede extends Component {
<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
}) })
} }
@ -181,18 +173,18 @@ export default class TPMchallengesnew extends Component {
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
}) })
@ -202,7 +194,7 @@ export default class TPMchallengesnew extends Component {
}, 1000); }, 1000);
this.setState({ this.setState({
CreatePracticesendtype:false CreatePracticesendtype: false
}) })
return return
} }
@ -210,15 +202,15 @@ export default class TPMchallengesnew extends Component {
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
} }
@ -229,19 +221,19 @@ 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,
@ -273,14 +265,14 @@ 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
} }
@ -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,21 +371,21 @@ 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() {
@ -401,15 +393,15 @@ export default class TPMchallengesnew extends Component {
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>
@ -422,16 +414,16 @@ export default class TPMchallengesnew extends Component {
<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>
} }
@ -440,12 +432,12 @@ 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>
@ -474,14 +466,14 @@ export default class TPMchallengesnew extends Component {
<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
@ -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>
@ -523,11 +515,11 @@ export default class TPMchallengesnew extends Component {
> >
<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}
@ -536,7 +528,7 @@ export default class TPMchallengesnew extends Component {
</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>
@ -566,7 +558,7 @@ export default class TPMchallengesnew extends Component {
<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>
@ -591,7 +583,7 @@ export default class TPMchallengesnew extends Component {
<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"}
@ -601,10 +593,10 @@ export default class TPMchallengesnew extends Component {
</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>

@ -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,7 +35,7 @@ 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();
@ -55,7 +52,7 @@ class ChangeHeaderPicModal extends Component{
// 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');
}; };
@ -118,8 +115,8 @@ class ChangeHeaderPicModal extends Component{
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)
@ -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}
@ -207,7 +203,7 @@ class ChangeHeaderPicModal extends Component{
<span className="tip">仅支持JPGGIFPNG且文件小于2M</span> <span className="tip">仅支持JPGGIFPNG且文件小于2M</span>
</div> </div>
<div <div
className="df previewWrap" style ={{flexDirection: 'column'}} className="df previewWrap" style={{ flexDirection: 'column' }}
> >
<div> <div>
<div id="changeHeader_imagePreview"> <div id="changeHeader_imagePreview">

@ -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)
@ -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,7 +205,7 @@ class NewGtaskForms extends Component{
}; };
return( return (
<div> <div>
<style> <style>
{ {
@ -226,7 +226,7 @@ class NewGtaskForms extends Component{
<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> </div>
<Form.Item <Form.Item
@ -241,7 +241,7 @@ class NewGtaskForms extends Component{
<Input placeholder="请输入毕设任务标题最大限制60个字符" <Input placeholder="请输入毕设任务标题最大限制60个字符"
onInput={this.changeTitle} onInput={this.changeTitle}
className="searchView yslnewworkinputaddonAfter searchViewAfter" className="searchView yslnewworkinputaddonAfter searchViewAfter"
style={{"width":"100%"}} style={{ "width": "100%" }}
maxLength={MAX_TITLE_LENGTH} addonAfter={`${String(title_num)}/${MAX_TITLE_LENGTH}`} maxLength={MAX_TITLE_LENGTH} addonAfter={`${String(title_num)}/${MAX_TITLE_LENGTH}`}
/> />
)} )}
@ -282,7 +282,7 @@ class NewGtaskForms extends Component{
`}</style> `}</style>
{ <Form.Item {<Form.Item
label="内容" label="内容"
className="AboutInputForm workContent mdInForm" className="AboutInputForm workContent mdInForm"
> >
@ -294,14 +294,14 @@ class NewGtaskForms extends Component{
<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,14 +317,14 @@ 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>
@ -338,7 +338,7 @@ class NewGtaskForms extends Component{
</p> </p>
</div> </div>
)} )}
</Form.Item>:"" </Form.Item> : ""
} }
<Form.Item> <Form.Item>
<div className="clearfix mt30 mb30"> <div className="clearfix mt30 mb30">

Loading…
Cancel
Save