杨树明 5 years ago
commit 173f2ecc37

@ -29,7 +29,7 @@ const env = getClientEnvironment(publicUrl);
module.exports = { module.exports = {
// You may want 'eval' instead if you prefer to see the compiled output in DevTools. // You may want 'eval' instead if you prefer to see the compiled output in DevTools.
// See the discussion in https://github.com/facebookincubator/create-react-app/issues/343.s // See the discussion in https://github.com/facebookincubator/create-react-app/issues/343.s
devtool: "source-map", // 开启调试 // devtool: "source-map", // 开启调试
// These are the "entry points" to our application. // These are the "entry points" to our application.
// This means they will be the "root" imports that are included in JS bundle. // This means they will be the "root" imports that are included in JS bundle.
// The first two entry points enable "hot" CSS and auto-refreshes for JS. // The first two entry points enable "hot" CSS and auto-refreshes for JS.

@ -567,7 +567,14 @@ class Comments extends Component {
<Pagination showQuickJumper onChange={onPaginationChange} current={currentPage} total={comment_count_without_reply} /> <Pagination showQuickJumper onChange={onPaginationChange} current={currentPage} total={comment_count_without_reply} />
</div> </div>
: '' } : '' }
{ (comment_count_without_reply == 0) ? <div className="noCommentTitle">暂时还没有评论快来show出你的idea吧</div> { (comment_count_without_reply == 0) ? <div>
<div className="edu-tab-con-box clearfix edu-txt-center">
<img className="edu-nodata-img mb20"
src={getImageUrl("images/educoder/nodata.png")} />
<p className="edu-nodata-p mb20">暂时还没有评论~</p>
</div>
</div>
: '' } : '' }
</div> </div>

@ -8,12 +8,13 @@ import { CNotificationHOC } from '../common/CNotificationHOC'
import { RouteHOC } from './common' import { RouteHOC } from './common'
import locale from 'antd/lib/date-picker/locale/zh_CN'; import locale from 'antd/lib/date-picker/locale/zh_CN';
import { WordsBtn, MarkdownToHtml, trigger } from 'educoder'; import { WordsBtn, MarkdownToHtml, trigger, queryString } from 'educoder';
import axios from 'axios'; import axios from 'axios';
import Modals from '../../modals/Modals'; import Modals from '../../modals/Modals';
import CoursesListType from '../coursesPublic/CoursesListType'; import CoursesListType from '../coursesPublic/CoursesListType';
import AccessoryModal from "../coursesPublic/AccessoryModal"; import AccessoryModal from "../coursesPublic/AccessoryModal";
import PublishRightnow from './PublishRightnow' import PublishRightnow from './PublishRightnow'
import DownloadMessage from '../../modals/DownloadMessage';
import '../css/Courses.css' import '../css/Courses.css'
import CBreadcrumb from '../common/CBreadcrumb' import CBreadcrumb from '../common/CBreadcrumb'
@ -121,9 +122,17 @@ class CommonWorkDetailIndex extends Component{
} }
const isAdmin = this.props.isAdmin() const isAdmin = this.props.isAdmin()
let exportUrl = `/api/homework_commons/${workId}/works_list.zip`
const exportResultUrl = `/api/homework_commons/${workId}/works_list.xlsx`
let exportParams = {}
const isListModule = childModuleName == '作品列表';
// 是列表页
let params = {}
if (isListModule) {
// TODO
// params = this.refs.commonWorkList._getRequestParams()
}
let exportUrl = `/homework_commons/${workId}/works_list.zip?${queryString.stringify(params)}`
let exportResultUrl = `/homework_commons/${workId}/works_list.xlsx?${queryString.stringify(params)}`
return ( return (
<div> <div>
<PublishRightnow ref={this.publishModal} showActionButton={false} {...this.props} checkBoxValues={[workId]} <PublishRightnow ref={this.publishModal} showActionButton={false} {...this.props} checkBoxValues={[workId]}
@ -132,6 +141,9 @@ class CommonWorkDetailIndex extends Component{
></PublishRightnow> ></PublishRightnow>
<PublishRightnow ref={this.endModal} showActionButton={false} {...this.props} checkBoxValues={[workId]} <PublishRightnow ref={this.endModal} showActionButton={false} {...this.props} checkBoxValues={[workId]}
isPublish={false} doWhenSuccess={this.doWhenSuccess}></PublishRightnow> isPublish={false} doWhenSuccess={this.doWhenSuccess}></PublishRightnow>
<DownloadMessage ref="DownloadMessage" {...this.props} />
<div className="newMain clearfix worklist1"> <div className="newMain clearfix worklist1">
<div className={"educontent mt20"}> <div className={"educontent mt20"}>
<style>{` <style>{`
@ -189,7 +201,7 @@ class CommonWorkDetailIndex extends Component{
<div className="mt10 clearfix edu-back-white poll_list pl5"> <div className="mt10 clearfix edu-back-white poll_list pl5">
<Link <Link
onClick={() => this.setState({moduleName: '作品列表'})} onClick={() => this.setState({moduleName: '作品列表'})}
className={`${childModuleName == '作品列表' ? 'active' : '' } `} className={`${isListModule ? 'active' : '' } `}
to={`/courses/${courseId}/${moduleEngName}/${workId}/list`}>作品列表</Link> to={`/courses/${courseId}/${moduleEngName}/${workId}/list`}>作品列表</Link>
<Link <Link
onClick={() => this.setState({moduleName: '作业问答'})} onClick={() => this.setState({moduleName: '作业问答'})}
@ -228,8 +240,12 @@ class CommonWorkDetailIndex extends Component{
{this.props.isAdmin()? <li className="li_line drop_down fr color-blue font-16 mr8 mt20" style={{"padding":"0 20px"}}> {this.props.isAdmin()? <li className="li_line drop_down fr color-blue font-16 mr8 mt20" style={{"padding":"0 20px"}}>
导出<i className="iconfont icon-xiajiantou font-12 ml2"></i> 导出<i className="iconfont icon-xiajiantou font-12 ml2"></i>
<ul className="drop_down_menu" style={{"right":"-34px","left":"unset","height":"auto"}}> <ul className="drop_down_menu" style={{"right":"-34px","left":"unset","height":"auto"}}>
<li><a href={exportResultUrl} className="color-dark">导出成绩</a></li> <li><a href={"javascript:void(0)"} className="color-dark"
<li><a href={exportUrl} className="color-dark">导出作品附件</a></li> onClick={() => this.refs.DownloadMessage.confirmysl(exportResultUrl, exportParams)}
>导出成绩</a></li>
<li><a href={"javascript:void(0)"} className="color-dark"
onClick={() => this.refs.DownloadMessage.confirmysl(exportUrl, exportParams)}
>导出作品附件</a></li>
</ul> </ul>
</li>:""} </li>:""}
@ -293,7 +309,7 @@ class CommonWorkDetailIndex extends Component{
{/* 作品列表 */} {/* 作品列表 */}
<Route exact path="/courses/:coursesId/common_homeworks/:workId/list" <Route exact path="/courses/:coursesId/common_homeworks/:workId/list"
render={ render={
(props) => (<CommonWorkList {...this.props} {...props} {...this.state} {...commonHandler}/>) (props) => (<CommonWorkList ref="commonWorkList" {...this.props} {...props} {...this.state} {...commonHandler}/>)
} }
></Route> ></Route>

@ -211,15 +211,15 @@ class ShixunModal extends Component{
<a onClick={()=>this.changeTag("all")} className={ type==="all" ? "active edu-filter-cir-grey font-12":"edu-filter-cir-grey font-12"}>全部</a> <a onClick={()=>this.changeTag("all")} className={ type==="all" ? "active edu-filter-cir-grey font-12":"edu-filter-cir-grey font-12"}>全部</a>
</li> </li>
{/*{*/} {
{/*shixunmodallist && shixunmodallist.tags.map((item,key)=>{*/} shixunmodallist && shixunmodallist.tags.map((item,key)=>{
{/*return(*/} return(
{/*<li className="fl mr5 mt5" key={key}>*/} <li className="fl mr5 mt5" key={key}>
{/*<a onClick={()=>this.changeTag(item.tag_id)} className={ parseInt(type) === parseInt(item.tag_id) ? "active edu-filter-cir-grey font-12":"edu-filter-cir-grey font-12"}>{item.tag_name}</a>*/} <a onClick={()=>this.changeTag(item.tag_id)} className={ parseInt(type) === parseInt(item.tag_id) ? "active edu-filter-cir-grey font-12":"edu-filter-cir-grey font-12"}>{item.tag_name}</a>
{/*</li>*/} </li>
{/*)*/} )
{/*})*/} })
{/*}*/} }
</div> </div>
<div className="clearfix mb10" id="shixun_search_form_div" style={{height:"30px"}}> <div className="clearfix mb10" id="shixun_search_form_div" style={{height:"30px"}}>
@ -251,10 +251,10 @@ class ShixunModal extends Component{
} }
<ul className="clearfix greybackHead edu-txt-center"> <ul className="clearfix greybackHead edu-txt-center">
<li className="fl with40 paddingleft22" >实训名称</li> <li className="fl with40 paddingleft22" >实训名称</li>
<li className="fl with30 edu-txt-left">院校</li> <li className="fl with25 edu-txt-left">院校</li>
<li className="fl with10">学习人数</li> <li className="fl with11">学习人数</li>
<li className="fl with10">难度</li> <li className="fl with11">难度</li>
<li className="fl with10"></li> <li className="fl with11"></li>
</ul> </ul>
@ -266,12 +266,16 @@ class ShixunModal extends Component{
{ {
` `
.next-loading{ .next-loading{
width: 100%; width: 100%;
height: 230px; height: 230px;
} }
.newtaskhide{ .newtaskhide{
margin-top:0px !important; margin-top:0px !important;
height: 40px; height: 40px;
}
.with11{
width: 11%;
box-sizing: border-box;
} }
` `
} }
@ -292,11 +296,11 @@ class ShixunModal extends Component{
<span style={{"textAlign":"left","color":"#05101A"}} className="task-hide color-grey-name">{item.shixun_name}</span> <span style={{"textAlign":"left","color":"#05101A"}} className="task-hide color-grey-name">{item.shixun_name}</span>
</Checkbox> </Checkbox>
</li> </li>
<li className="fl with30 edu-txt-left task-hide paddingl5">{item.school}</li> <li className="fl with25 edu-txt-left task-hide paddingl5">{item.school}</li>
<li className="fl with10 paddingl10">{item.myshixuns_count}</li> <li className="fl with11 paddingl10">{item.myshixuns_count}</li>
<li className="fl with10 color-orange-tip paddingl10">{item.level}</li> <li className="fl with11 color-orange-tip paddingl10">{item.level}</li>
<Tooltip title="新窗口查看详情"> <Tooltip title="新窗口查看详情">
<li className="fl with10"><a className="color-blue" href={"/shixuns/"+item.identifier+"/challenges"} target="_blank">详情</a></li> <li className="fl with11"><a className="color-blue" href={"/shixuns/"+item.identifier+"/challenges"} target="_blank">详情</a></li>
</Tooltip> </Tooltip>
</div> </div>
) )

@ -59,8 +59,8 @@ class EducoderInteresse extends Component {
display: "flex", display: "flex",
justifyContent: "center", justifyContent: "center",
width: "100%", width: "100%",
height: "630px", height: "600px",
marginTop: "44px", marginTop: "20px",
}}> }}>
<InterestpageComponent {...this.props} {...this.state}> <InterestpageComponent {...this.props} {...this.state}>
</InterestpageComponent> </InterestpageComponent>

@ -337,12 +337,16 @@ class MainContentContainer extends Component {
this.oldGameIdentifier = null; this.oldGameIdentifier = null;
return; return;
} }
// 重试调用的这个 this.props.fetchRepositoryCode(this.props, null, null, true)
setTimeout(() => { setTimeout(() => {
this.fetchRepositoryCode(props, arg_path, type, 1) this.fetchRepositoryCode(props, arg_path, type, 1)
}, 1500); }, 1500);
} }
} }
}else{ } else if (fetchRepositoryCodeResponse.data.status === -4) {
// 异常 直接重试
this.fetchRepositoryCode(props, null, null, true)
} else{
this.setState({ isEditablePath, currentPath: path }); this.setState({ isEditablePath, currentPath: path });
this.oldRepositoryCode = fetchRepositoryCodeResponse.data.content || ''; this.oldRepositoryCode = fetchRepositoryCodeResponse.data.content || '';
this.updateRepositoryCode(this.oldRepositoryCode, updateCodeMirror) this.updateRepositoryCode(this.oldRepositoryCode, updateCodeMirror)

@ -154,11 +154,13 @@ function checkIfLoaded (callback) {
const mirror2LanguageMap = { const mirror2LanguageMap = {
'JFinal': 'java', 'JFinal': 'java',
'Java': 'java', 'Java': 'java',
'JavaWeb': 'java',
'Kotlin': 'java', 'Kotlin': 'java',
'Html': 'html', 'Html': 'html',
'Css': 'css', 'Css': 'css',
'Javascript': 'javascript', 'Javascript': 'javascript',
'JavaScript': 'javascript',
'C/C++': 'cpp', 'C/C++': 'cpp',
'MachineLearning': 'python', 'MachineLearning': 'python',
@ -173,6 +175,7 @@ function getLanguageByMirrorName(mirror_name) {
let lang = 'javascript' let lang = 'javascript'
if (mirror_name && mirror_name.length) { if (mirror_name && mirror_name.length) {
// 需要倒着遍历, html、css的实训主评测语言环境是python小类别是html或css // 需要倒着遍历, html、css的实训主评测语言环境是python小类别是html或css
// TODO http://localhost:3007/tasks/hmcwa3g8typ5?debug=t ["Python3.6", "VNC", "Html"]
for (let i = mirror_name.length - 1; i >= 0; i--) { for (let i = mirror_name.length - 1; i >= 0; i--) {
let languageVal = mirror2LanguageMap[mirror_name[i]]; let languageVal = mirror2LanguageMap[mirror_name[i]];
if (languageVal) { if (languageVal) {

@ -6,7 +6,7 @@
} }
#game_test_set_results .-task-ces-top { #game_test_set_results .-task-ces-top {
background: #1F2F3B; background: #1F2F3B;
padding: 5px 20px; padding: 9px 20px;
} }

@ -321,7 +321,7 @@ export default class TPMMDEditor extends Component {
<div className={`df ${className}`} > <div className={`df ${className}`} >
{/* padding10-20 */} {/* padding10-20 */}
<div className="edu-back-greyf5 radius4" id={`mdEditor_${mdID}`} style={{..._style}}> <div className="edu-back-greyf5 radius4" id={`mdEditor_${mdID}`} style={{..._style}}>
<textarea style={{display: 'none'}} id="evaluate_script_show" name="content"></textarea> <textarea style={{display: 'none'}} id={`mdEditors_${mdID}`} name="content"></textarea>
<div className="CodeMirror cm-s-defualt"> <div className="CodeMirror cm-s-defualt">
</div> </div>
</div> </div>

@ -1,6 +1,6 @@
import React, {Component} from 'react'; import React, {Component} from 'react';
import {Input, InputNumber, Select, Radio, Checkbox, Popconfirm, message, Modal} from 'antd'; import {Input, InputNumber, Select, Radio, Checkbox, Popconfirm, message, Modal, Tooltip} from 'antd';
import {BrowserRouter as Router, Route, Link, Switch} from "react-router-dom"; import {BrowserRouter as Router, Route, Link, Switch} from "react-router-dom";
@ -320,9 +320,11 @@ export default class TPManswer extends Component {
return <div className="levelSection" id={`levelSection${index}`} style={{ clear: 'both' }}> return <div className="levelSection" id={`levelSection${index}`} style={{ clear: 'both' }}>
<span className="mr4 color-orange pt10">*</span> <span className="mr4 color-orange pt10">*</span>
<p className="color-grey-6 font-16 mb30 mt10" style={{ display: "inline" }}>级别{index + 1}</p> <p className="color-grey-6 font-16 mb30 mt10" style={{ display: "inline" }}>级别{index + 1}</p>
<Tooltip title="删除">
<a className="fr sample_icon_remove mr30 mt8" onClick={()=>this.delanswers(index)}> <a className="fr sample_icon_remove mr30 mt8" onClick={()=>this.delanswers(index)}>
<i className="fa fa-times-circle color-grey-c font-16 fl" ></i> <i className="fa fa-times-circle color-grey-c font-16 fl" ></i>
</a> </a>
</Tooltip>
<div className=" color-grey-6 font-16" style={{ marginLeft: "9px", margin: '8px 9px'}}> <div className=" color-grey-6 font-16" style={{ marginLeft: "9px", margin: '8px 9px'}}>
<div className=" "> <div className=" ">
<span>名称</span> <span>名称</span>

@ -572,6 +572,7 @@ export default class TPMchallengesnew extends Component {
<div className="edu-back-white padding40-20 mb20"> <div className="edu-back-white padding40-20 mb20">
<p className="color-grey-6 font-16 mb30">服务配置</p> <p className="color-grey-6 font-16 mb30">服务配置</p>
<div className="clearfix mb5"> <div className="clearfix mb5">
<span className="mr30 color-orange pt10">*</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}/>

@ -1,6 +1,6 @@
import React, {Component} from 'react'; import React, {Component} from 'react';
import {Input, Select, Radio, Checkbox, Popconfirm, message, Modal,Tooltip} from 'antd'; import {Input, Select, Radio, Checkbox, Popconfirm, message, Modal,Tooltip,notification} from 'antd';
import {BrowserRouter as Router, Route, Link, Switch} from "react-router-dom"; import {BrowserRouter as Router, Route, Link, Switch} from "react-router-dom";
@ -184,7 +184,7 @@ export default class TPMquestion extends Component {
practice_url: newpractice_url, practice_url: newpractice_url,
go_back_url: newgo_back_url, go_back_url: newgo_back_url,
power:response.data.power, power:response.data.power,
questioMD:response.data.task_pass, // questioMD:response.data.task_pass,
answer:response.data.answer answer:response.data.answer
}) })
@ -192,7 +192,7 @@ export default class TPMquestion extends Component {
this.setState({ this.setState({
contentMdRefval:response.data.task_pass contentMdRefval:response.data.task_pass
}) })
this.contentMdRef.current.setValue(response.data.task_pass || '') // this.contentMdRef.current.setValue(response.data.task_pass || '')
if(response.data.chooses.length===0){ if(response.data.chooses.length===0){
this.questionadd() this.questionadd()
} }
@ -248,14 +248,14 @@ export default class TPMquestion extends Component {
practice_url: newpractice_url, practice_url: newpractice_url,
go_back_url: newgo_back_url, go_back_url: newgo_back_url,
power:response.data.power, power:response.data.power,
questioMD:response.data.task_pass, // questioMD:response.data.task_pass,
}) })
this.setState({ this.setState({
contentMdRefval:response.data.task_pass contentMdRefval:response.data.task_pass
}) })
this.contentMdRef.current.setValue(response.data.task_pass || '') // this.contentMdRef.current.setValue(response.data.task_pass || '')
if(response.data.chooses.length===0){ if(response.data.chooses.length===0){
this.questionadd() this.questionadd()
} }
@ -400,12 +400,14 @@ export default class TPMquestion extends Component {
} }
questionall=()=>{ questionall=()=>{
this.setState({ // this.setState({
activetype:"first", // activetype:"first",
newquestionaddtype:false, // newquestionaddtype:false,
editquestionaddtype:false, // editquestionaddtype:false,
questionaddtype:false // questionaddtype:false
}) // })
window.location.href = '/shixuns/'+this.props.match.params.shixunId+'/challenges/'+this.props.match.params.checkpointId+'/editquestion';
} }
questionadd=()=>{ questionadd=()=>{
$('html').animate({ $('html').animate({
@ -707,14 +709,22 @@ export default class TPMquestion extends Component {
// $('html').animate({ // $('html').animate({
// scrollTop: 10 // scrollTop: 10
// }, 200); // }, 200);
message.success("修改成功"); $('html').animate({
scrollTop: 10
}, 200);
notification.open({
message: '提示',
description:
'修改成功,请点击右侧加号继续添加',
});
this.setState({ this.setState({
questionaddtype:false, questionaddtype:false,
newquestioMDvaluetype:false, newquestioMDvaluetype:false,
newquestioMDvaluetypes:false, newquestioMDvaluetypes:false,
}) })
setTimeout(window.location.href="/shixuns/"+this.props.match.params.shixunId+"/challenges/"+this.props.match.params.checkpointId+"/editquestion"+"/"+response.data.challenge_choose_id,1000) // setTimeout(window.location.href="/shixuns/"+this.props.match.params.shixunId+"/challenges/"+this.props.match.params.checkpointId+"/editquestion"+"/"+response.data.challenge_choose_id,1000)
// this.gochooseid() // this.gochooseid()
}).catch((error) => { }).catch((error) => {
console.log(error) console.log(error)
@ -761,12 +771,17 @@ export default class TPMquestion extends Component {
newquestioMDvaluetypes:false, newquestioMDvaluetypes:false,
questionaddarray:questionaddarrays questionaddarray:questionaddarrays
}) })
// $('html').animate({ $('html').animate({
// scrollTop: 10 scrollTop: 10
// }, 200); }, 200);
message.success("新建成功");
notification.open({
message: '提示',
description:
'新建成功,请点击右侧加号继续添加',
});
// this.getanswer_subitlist() // this.getanswer_subitlist()
this.gochooseid("/shixuns/"+this.props.match.params.shixunId+"/challenges/"+this.props.match.params.checkpointId+"/editquestion"+"/"+response.data.challenge_choose_id) // this.gochooseid("/shixuns/"+this.props.match.params.shixunId+"/challenges/"+this.props.match.params.checkpointId+"/editquestion"+"/"+response.data.challenge_choose_id)
}).catch((error) => { }).catch((error) => {
console.log(error) console.log(error)
}); });
@ -869,7 +884,8 @@ export default class TPMquestion extends Component {
} }
gochooseid=(url)=>{ gochooseid=(url)=>{
window.location.href =url window.location.href =url
// window.location.Reload(url)
// this.props.history.replace( url ); // this.props.history.replace( url );
// this.props.history.push( url ); // this.props.history.push( url );
// 返回 // 返回

@ -24,7 +24,10 @@ export default class TpmQuestionEdit extends Component {
render() { render() {
console.log( this.props.questionlists) console.log( this.props.neweditanswerRef)
console.log( this.props.neweditanswerRefval)
console.log( this.props.editanswersRef)
console.log( this.props.editanswersRefval)
return ( return (
<div> <div>
@ -34,7 +37,7 @@ export default class TpmQuestionEdit extends Component {
<div className="df"> <div className="df">
<span className="mr30 color-orange pt10">*</span> <span className="mr30 color-orange pt10">*</span>
<div className="flex1 mr20"> <div className="flex1 mr20">
<TPMMDEditor ref={this.props.neweditanswerRef} placeholder="请输入选择题的题干内容" mdID={'newquestioMDid'} refreshTimeout={1500} <TPMMDEditor ref={this.props.neweditanswerRef} placeholder="请输入选择题的题干内容" mdID={'editquestioMDid'} refreshTimeout={1500}
watch={true} className="courseMessageMD" initValue={this.props.neweditanswerRefval}></TPMMDEditor> watch={true} className="courseMessageMD" initValue={this.props.neweditanswerRefval}></TPMMDEditor>
</div> </div>

@ -24,7 +24,7 @@ export default class TpmQuestionNew extends Component {
render() { render() {
console.log( this.props.questionlists) // console.log( this.props.questionlists)
return ( return (
<div> <div>

@ -130,7 +130,7 @@ class TPMRightSection extends Component {
return( return(
<div className="recomments clearfix df" key={key}> <div className="recomments clearfix df" key={key}>
<a href={"/shixuns/"+item.identifier+"/challenges"} target="_blank"> <a href={"/shixuns/"+item.identifier+"/challenges"} target="_blank">
<img alt="69?1526971094" height="96" src={item.pic} width="128"/> <img alt="69?1526971094" height="96" src={"/"+item.pic} width="128"/>
</a> </a>
<div className="ml10 flex1"> <div className="ml10 flex1">
<Tooltip placement="bottom" title={item.name}> <Tooltip placement="bottom" title={item.name}>
@ -161,7 +161,7 @@ class TPMRightSection extends Component {
<div className="recomments clearfix df" key={k}> <div className="recomments clearfix df" key={k}>
<a href={"/paths/"+i.id} height="96" width="128" target="_blank"> <a href={"/paths/"+i.id} height="96" width="128" target="_blank">
<img alt="实训" height="96" src={i.image_url} width="128" /> <img alt="实训" height="96" src={"/"+i.image_url} width="128" />
</a> </a>
<div className="ml10 flex1"> <div className="ml10 flex1">

@ -314,7 +314,7 @@ class Challenges extends Component {
*/} */}
</div> </div>
<p className="clearfix mb10"> <p className="clearfix mb10 mt20">
<span className="font-16 fl">全部任务</span> <span className="font-16 fl">全部任务</span>
{this.props.identity < 5 && ChallengesDataList&&ChallengesDataList.shixun_status=== 0 ? {this.props.identity < 5 && ChallengesDataList&&ChallengesDataList.shixun_status=== 0 ?
<Link to={"/shixuns/" + id + "/challenges/new"} <Link to={"/shixuns/" + id + "/challenges/new"}

@ -2,3 +2,8 @@
height: 30px; height: 30px;
line-height: 30px; line-height: 30px;
} }
.line27{
line-height: 27px;
vertical-align: 1px;
}

@ -2,7 +2,7 @@ import React, { Component } from 'react';
import { Redirect } from 'react-router'; import { Redirect } from 'react-router';
import {Modal, Button, Radio, Input, Checkbox,message} from 'antd'; import {Modal, Button, Radio, Input, Checkbox,message,Spin, Icon} from 'antd';
import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom"; import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom";
@ -44,7 +44,8 @@ class Collaborators extends Component {
collaboratorListsum:10, collaboratorListsum:10,
collaboratorListsumtype:true, collaboratorListsumtype:true,
user_name:undefined, user_name:undefined,
school_name:undefined school_name:undefined,
spinnings:false
} }
} }
componentDidMount() { componentDidMount() {
@ -155,9 +156,11 @@ class Collaborators extends Component {
}) })
} }
onSearchadmin = (value) => { onSearchadmin = (value) => {
let {collaboratorList,user_name,school_name} = this.state; let {collaboratorList,user_name,school_name} = this.state;
this.setState({ this.setState({
Searchadmin: [], Searchadmin: [],
spinnings:true,
}) })
// if (value === "") { // if (value === "") {
// this.setState({ // this.setState({
@ -174,7 +177,9 @@ class Collaborators extends Component {
school_name:school_name, school_name:school_name,
}}).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) {
this.setState({
spinnings:false
})
}else{ }else{
let newlist = response.data.users; let newlist = response.data.users;
for (var i = 0; i < newlist.length; i++) { for (var i = 0; i < newlist.length; i++) {
@ -182,7 +187,8 @@ class Collaborators extends Component {
} }
this.setState({ this.setState({
Searchadmin: newlist, Searchadmin: newlist,
collaboratorList: collaboratorList collaboratorList: collaboratorList,
spinnings:false
}) })
} }
@ -404,7 +410,10 @@ class Collaborators extends Component {
lineHeight: '30px', lineHeight: '30px',
}; };
// console.log(collaboratorList) // console.log(collaboratorList)
return (
const antIcon = <Icon type="loading" style={{ fontSize: 24 }} spin />;
return (
<React.Fragment> <React.Fragment>
<p className="clearfix mt30" <p className="clearfix mt30"
style={{display:this.props.identity<5?"block":"none"}} style={{display:this.props.identity<5?"block":"none"}}
@ -412,7 +421,7 @@ class Collaborators extends Component {
<a onClick={() => this.showCollaboratorsvisible("cooperation")} <a onClick={() => this.showCollaboratorsvisible("cooperation")}
className="edu-default-btn edu-greenback-btn fr mr20 height40" className="edu-default-btn edu-greenback-btn fr mr20 height40"
data-remote="true"> data-remote="true">
+ 添加合作 <span className={"line27"}>+ </span>
</a> </a>
<a onClick={() => this.showCollaboratorsvisible("admin")} <a onClick={() => this.showCollaboratorsvisible("admin")}
style={{display:this.props.identity===1?"block":"none"}} style={{display:this.props.identity===1?"block":"none"}}
@ -467,6 +476,7 @@ class Collaborators extends Component {
visible={Collaboratorsvisibleadmin} visible={Collaboratorsvisibleadmin}
closable={false} closable={false}
footer={null} footer={null}
width={800}
> >
{/*<Search*/} {/*<Search*/}
{/*placeholder="输入用户的姓名、昵称、邮箱进行搜索"*/} {/*placeholder="输入用户的姓名、昵称、邮箱进行搜索"*/}
@ -475,53 +485,53 @@ class Collaborators extends Component {
{/*onInput={this.onSearchadmins}*/} {/*onInput={this.onSearchadmins}*/}
{/*style={{width: '100%'}}*/} {/*style={{width: '100%'}}*/}
{/*/>*/} {/*/>*/}
<span className="mr10">姓名:</span> <span className="mr10">姓名或手机号:</span>
<Input allowClear placeholder="请输入真实姓名" value={user_name} onInput={(e) => {this.setState({user_name: e.target.value})}} <Input placeholder="请输入姓名或手机号码搜索" value={user_name} onInput={(e) => {this.setState({user_name: e.target.value})}}
style={{ width: '130px'}} style={{ width: '215px'}}
></Input> ></Input>
<span className="label ml10 " style={{ minWidth: '36px' }}>单位:</span> <span className="label ml10 " style={{ minWidth: '36px' }}>单位:</span>
<Input allowClear placeholder="请输入单位名称" className="ml10" value={school_name} onInput={(e) => {this.setState({school_name: e.target.value})}} <Input placeholder="请输入单位名称" className="ml10" value={school_name} onInput={(e) => {this.setState({school_name: e.target.value})}}
style={{ width: '135px'}}> style={{ width: '215px'}}
>
</Input> </Input>
<a className="task-btn task-btn-orange" onClick={() => this.onSearchadmin()} <a className="task-btn task-btn-orange ml20" onClick={() => this.onSearchadmin()}
style={{ height: '30px', lineHeight: '30px', marginLeft: '10px', width: '70px'}} style={{ height: '30px', lineHeight: '30px', width: '70px'}}
>搜索</a> >搜索</a>
<p className="clearfix pl35 mt20"> <p className="clearfix pl35 mt20">
<span className="fl edu-txt-w80 task-hide font-bd ml10 edu-txt-left">姓名</span> <span className="fl edu-txt-w100 task-hide font-bd ml10 edu-txt-left">姓名</span>
<span className="fl edu-txt-w80 task-hide font-bd">职业</span> <span className="fl edu-txt-w100 task-hide font-bd">职业</span>
<span className="fl edu-txt-w180 task-hide font-bd ml50">单位</span> <span className="fl edu-txt-w180 task-hide font-bd ml80">单位</span>
</p> </p>
<div className="mt5" style={{background: '#f7f9fd'}}> <div className="mt5" style={{background: '#f7f9fd'}}>
<Spin indicator={antIcon} spinning={this.state.spinnings}>
<div className="clearfix"> <div className="clearfix">
<ul className="upload_select_box fl" id="search_not_teachers_list" onScroll={this.contentViewScrolledit}> <ul className="upload_select_box fl" id="search_not_teachers_list" onScroll={this.contentViewScrolledit}>
{Searchadmin.length === 0 ? <li style={{textAlign: 'center'}}> {Searchadmin.length === 0 ? <li style={{textAlign: 'center'}}>
<span>请试试搜索一下</span> <span>请试试搜索一下</span>
</li> : Searchadmin.map((item, key) => { </li> : Searchadmin.map((item, key) => {
return ( return (
<li key={key} style={{display: item.identify === "专业人士" ? "none" : "block"}}> <li key={key} style={{display: item.identify === "专业人士" ? "none" : "block"}}>
<Checkbox className="fl mr20" checked={item.checked} <Checkbox className="fl mr20" checked={item.checked}
onChange={(e) => this.selectChangenickname(e, key)} onChange={(e) => this.selectChangenickname(e, key)}
id={item.user_id}></Checkbox> id={item.user_id}></Checkbox>
<a className="task-hide color-grey3 fl span1 edu-txt-w80 edu-txt-left">{item.nickname}</a> <a className="task-hide color-grey3 fl span1 edu-txt-w80 edu-txt-left">{item.nickname}</a>
<span className="task-hide fl color-grey edu-txt-w80 span2">{item.identify}</span> <span className="task-hide fl color-grey edu-txt-w80 span2">{item.identify}</span>
<span <span
title={item.school_name} title={item.school_name}
style={{width: '150px'}} style={{width: '150px'}}
className="span3 color-grey fl edu-txt-w260 task-hide ml50 task-hide" >{item.school_name}</span> className="span3 color-grey fl edu-txt-w260 task-hide ml50 task-hide" >{item.school_name}</span>
</li> </li>
) )
}) })
} }
</ul> </ul>
</div> </div>
</Spin>
</div> </div>
<div className="mt10 clearfix"> <div className="mt10 clearfix">
<span className="fl mr15"> <span className="fl mr15">
<Checkbox className="fl" checked={allChangechecked} onChange={this.allChange}>全选</Checkbox> <Checkbox className="fl" checked={allChangechecked} onChange={this.allChange}>全选</Checkbox>
<div className="fl" style={{height: '27px'}}> <div className="fl" style={{height: '27px'}}>

@ -1,7 +1,5 @@
import React, {Component} from 'react'; import React, {Component} from 'react';
import {Button,notification} from 'antd';
import {Button} from 'antd';
import {broadcastChannelPostMessage} from 'educoder'; import {broadcastChannelPostMessage} from 'educoder';
import axios from 'axios'; import axios from 'axios';
import './common.css' import './common.css'
@ -26,12 +24,65 @@ class InterestpageComponent extends Component {
this.state = { this.state = {
gouxuans: "", gouxuans: "",
gouxuans2:0, gouxuans2:0,
gouxuans3:[{id:1,name:"前端开发",bool:false,url:qdkf},{id:2,name:"后端开发",bool:false,url:hdkf},{id:3,name:"移动开发",bool:false,url:ydkf},{id:4,name:"数据库",bool:false,url:sjk},{id:5,name:"云计算和大数据",bool:false,url:ysj},{id:6,name:"运维与测试",bool:false,url:yunwei},{id:7,name:"人工智能",bool:false,url:rgzn},{id:8,name:"其他",bool:false,url:qita}], gouxuans4:[],
namezh:this.props.namezh, namezh:this.props.namezh,
passmm:this.props.passmm, passmm:this.props.passmm,
homedatalist:undefined,
hometypepvisible: undefined,
} }
} }
openNotification = (messge) => {
// type 1 成功提示绿色 2提醒颜色黄色 3错误提示红色
notification.open({
message: "提示",
description: messge,
onClick: () => {
console.log('Notification Clicked!');
},
});
}
componentDidMount(){
let{gouxuans4} =this.state;
let url=`/repertoires.json`;
axios.get(url).then((response)=> {
if(response){
console.log("53");
console.log(response.data);
for(var i=0;i<response.data.repertoires.length;i++){
var qdkfys="";
if(response.data.repertoires[i].id===1){
qdkfys=qdkf;
}if(response.data.repertoires[i].id===2){
qdkfys=hdkf;
}if(response.data.repertoires[i].id===3){
qdkfys=ydkf;
}if(response.data.repertoires[i].id===4){
qdkfys=sjk;
}if(response.data.repertoires[i].id===5){
qdkfys=ysj;
}if(response.data.repertoires[i].id===6){
qdkfys=yunwei;
}if(response.data.repertoires[i].id===8){
qdkfys=qita;
}if(response.data.repertoires[i].id===9){
qdkfys=rgzn;
}
var datas={id:response.data.repertoires[i].id,name:response.data.repertoires[i].name,bool:false,url:qdkfys};
gouxuans4.push(datas);
this.setState({
gouxuans4:gouxuans4,
})
}
console.log("75");
console.log(gouxuans4);
}
}).catch((error)=>{
console.log(error)
});
}
componentWillReceiveProps(nextProps) { componentWillReceiveProps(nextProps) {
// console.log("46"); // console.log("46");
// console.log(nextProps); // console.log(nextProps);
@ -85,21 +136,21 @@ class InterestpageComponent extends Component {
} }
Clickteacher2=(e)=>{ Clickteacher2=(e)=>{
console.log(e); console.log(e);
let {gouxuans3} =this.state; let {gouxuans4} =this.state;
for (var i=0;i<gouxuans3.length;i++){ for (var i=0;i<gouxuans4.length;i++){
if(gouxuans3[i].id === e){ if(gouxuans4[i].id === e){
console.log("51"); console.log("51");
console.log(e); console.log(e);
if(gouxuans3[i].bool === true){ if(gouxuans4[i].bool === true){
gouxuans3[i].bool=false; gouxuans4[i].bool=false;
}else{ }else{
gouxuans3[i].bool=true; gouxuans4[i].bool=true;
} }
} }
} }
console.log(gouxuans3); console.log(gouxuans4);
this.setState({ this.setState({
gouxuans3:gouxuans3, gouxuans4:gouxuans4,
}) })
} }
@ -107,15 +158,20 @@ class InterestpageComponent extends Component {
//兴趣页面点击 //兴趣页面点击
Interestcompletionpage(){ Interestcompletionpage(){
if(this.state.gouxuans.length === 0){ if(this.state.gouxuans.length === 0){
this.props.showNotification("请选择您的职业"); this.openNotification("请选择您的职业");
return return
} }
var ints=[]; var ints=[];
for (var i =0;i<this.state.gouxuans.length;i++) { for (var i =0;i<this.state.gouxuans4.length;i++) {
if(this.state.gouxuans[i].bool === true){ if(this.state.gouxuans4[i].bool === true){
ints.push(this.state.gouxuans[i].id); ints.push(this.state.gouxuans4[i].id);
} }
} }
if(ints.length<1){
this.openNotification("内容是最少得选一个");
return
}
var url = "/users/interest.json"; var url = "/users/interest.json";
axios.post(url, { axios.post(url, {
identity:this.state.gouxuans, identity:this.state.gouxuans,
@ -133,44 +189,44 @@ class InterestpageComponent extends Component {
}) })
} }
//跳转然后登入 // //跳转然后登入
Jumptotheinterestpage=()=>{ // Jumptotheinterestpage=()=>{
console.log(this.state.login); // console.log(this.state.login);
console.log(this.state.password); // console.log(this.state.password);
var url = "/accounts/login.json"; // var url = "/accounts/login.json";
axios.post(url, { // axios.post(url, {
login: this.props.login, // login: this.props.login,
password: this.props.password, // password: this.props.password,
}).then((response) => { // }).then((response) => {
if (response === undefined) { // if (response === undefined) {
return // return
} // }
if (response.status === 200) { // if (response.status === 200) {
// if (response.data.status === 402) { // // if (response.data.status === 402) {
// window.location.href = response.data.url; // // window.location.href = response.data.url;
// } else { // // } else {
// broadcastChannelPostMessage('refreshPage') // // broadcastChannelPostMessage('refreshPage')
// this.setState({ // // this.setState({
// isRender: false // // isRender: false
// }) // // })
window.location.href = "/" // window.location.href = "/"
// } // // }
} // }
//
//
}).catch((error) => { // }).catch((error) => {
console.log(error); // console.log(error);
}) // })
} // }
render() { render() {
const { const {
gouxuans, gouxuans,
gouxuans3 gouxuans4,
} = this.state } = this.state
// height: 346px; // height: 346px;
return ( return (
<div className="ysllogin_register_contents" style={{width:"800px",height: "620px"}}> <div className="ysllogin_register_contents" style={{width:"800px",height: "600px"}}>
<div className="ysllogin_section"> <div className="ysllogin_section">
<div className="mt15"><span className="yslspans1">请选择你的职业</span></div> <div className="mt15"><span className="yslspans1">请选择你的职业</span></div>
@ -188,12 +244,12 @@ class InterestpageComponent extends Component {
<div className="ysldivhomedivimg"><img src={zyrs1} className="ysldivhomedivimg"/></div> <div className="ysldivhomedivimg"><img src={zyrs1} className="ysldivhomedivimg"/></div>
</div> </div>
</div> </div>
<div className="mt5"><span className="yslspans2">选择你可能感兴趣的内容</span></div> <div><span className="yslspans2">选择你可能感兴趣的内容</span></div>
<div ><span className="yslspans3">基于你关注的内容推荐</span></div> <div ><span className="yslspans3">基于你关注的内容推荐</span></div>
<div className="ysldivhome2"> <div className="ysldivhome2">
{gouxuans3&&gouxuans3.map((item,key)=>{ {gouxuans4&&gouxuans4.map((item,key)=>{
return( return(
<div className={item.id<5?"ysldivhomediv1":"ysldivhomediv2"} onClick={()=>this.Clickteacher2(item.id)}> <div className={item.id<5?"ysldivhomediv1":"ysldivhomediv2"} onClick={()=>this.Clickteacher2(item.id)}>
{item.bool===true?<img src={gouxuan} className="yslgouxuanimg"/>:<div className="yslgouxuanimg2"></div>} {item.bool===true?<img src={gouxuan} className="yslgouxuanimg"/>:<div className="yslgouxuanimg2"></div>}
@ -203,9 +259,8 @@ class InterestpageComponent extends Component {
) )
})} })}
</div> </div>
<Button className="yslbutton" size={"large"} type="primary"onClick={()=>this.Interestcompletionpage()} style={{width:"255px",height: "36px",background: "#4CACFF"} }>完成</Button> <Button className="yslbutton" size={"large"} type="primary"onClick={()=>this.Interestcompletionpage()} style={{width:"255px",height: "36px",background: "#4CACFF",marginTop: "30px"} }>完成</Button>
</div>
</div>
</div> </div>
); );

@ -730,12 +730,23 @@ class LoginRegisterComponent extends Component {
{/* style={{height: '0', width: '0', border: 'none', display: "none"}}/>*/} {/* style={{height: '0', width: '0', border: 'none', display: "none"}}/>*/}
{/*<Input type="password" name="password" id="password" autoComplete="new-password"*/} {/*<Input type="password" name="password" id="password" autoComplete="new-password"*/}
{/* style={{height: '0', width: '0', border: 'none', display: "none"}}/>*/} {/* style={{height: '0', width: '0', border: 'none', display: "none"}}/>*/}
<style>
{
`
.ant-input-affix-wrapper .ant-input-suffix {
right: 12px;
height: 20px;
}
`
}
</style>
<Input className="loginInput font-14 mt25 color-grey-9 loginInputzhuche" placeholder="输入8~16位密码区分大小写" <Input className="loginInput font-14 mt25 color-grey-9 loginInputzhuche" placeholder="输入8~16位密码区分大小写"
type={classpass} type={classpass}
autoComplete="new-password" autoComplete="new-password"
onClick={this.changeType} onClick={this.changeType}
value={this.state.passwords} onChange={this.passwordonChanges} suffix={ value={this.state.passwords} onChange={this.passwordonChanges}
suffix={
<img className={"mt5"} src={passopens} onClick={(key) => this.Showandhide(key)}> <img className={"mt5"} src={passopens} onClick={(key) => this.Showandhide(key)}>
</img> </img>
}></Input> }></Input>

@ -101,7 +101,11 @@ class AccountBasic extends Component {
this.props.form.validateFieldsAndScroll((err, values) => { this.props.form.validateFieldsAndScroll((err, values) => {
console.log(values); console.log(values);
let {basicInfo}=this.props; let {basicInfo}=this.props;
if(!err){ // TODO 为什么modal里的form影响到这里的了
if (err) {
delete err.depart
}
if(!err || Object.keys(err).length == 0){
let url=`/users/accounts/${basicInfo.id}.json` let url=`/users/accounts/${basicInfo.id}.json`
axios.put((url),{ axios.put((url),{
nickname:values.nickname, nickname:values.nickname,
@ -117,7 +121,9 @@ class AccountBasic extends Component {
department_id:this.state.department_id department_id:this.state.department_id
}).then((result)=>{ }).then((result)=>{
if(result){ if(result){
this.props.showNotification('保存成功')
this.props.getBasicInfo(); this.props.getBasicInfo();
this.props.history.push('/account/profile')
} }
}).catch((error)=>{ }).catch((error)=>{
console.log(error); console.log(error);

@ -58,7 +58,6 @@
display: flex; display: flex;
flex-flow: row wrap; flex-flow: row wrap;
align-content:stretch; align-content:stretch;
margin-top: 10px;
} }
.ysldivhomediv{ .ysldivhomediv{
width: 101px; width: 101px;
@ -90,14 +89,14 @@
.ysldivhomedivtxt{ .ysldivhomedivtxt{
width:101px; width:101px;
height:27px; height:27px;
margin-bottom: 10px; margin-bottom: 5px;
font-size: 14px; font-size: 14px;
text-align: center; text-align: center;
} }
.ysldivhomedivimg{ .ysldivhomedivimg{
width: 101px; width: 90px;
height: 101px; height: 90px;
} }
.ysllogin_register_contents{ .ysllogin_register_contents{
display: flex; display: flex;
@ -108,7 +107,7 @@
} }
.ysllogin_section { .ysllogin_section {
width:800px; width:800px;
height: 620px; height: 600px;
display: flex; display: flex;
align-items: center; align-items: center;
flex-direction: column; flex-direction: column;
@ -131,8 +130,8 @@
.yslbutton{ .yslbutton{
width:255px; width:255px;
height: 36px; height: 36px;
margin-top:30px; margin-top: 20px;
margin-bottom: 19px;
} }
.mt22{ .mt22{
margin-top: 22px; margin-top: 22px;

Loading…
Cancel
Save