diff --git a/public/react/src/modules/paths/PathDetail/sendPanel.js b/public/react/src/modules/paths/PathDetail/sendPanel.js index 8aedc2770..ff8bfc6c9 100644 --- a/public/react/src/modules/paths/PathDetail/sendPanel.js +++ b/public/react/src/modules/paths/PathDetail/sendPanel.js @@ -131,7 +131,7 @@ class sendPanel extends Component{ > { - this.props.detailInfoList===undefined?"":this.props.detailInfoList.allow_statistics===true? + this.props.detailInfoList===undefined?"":this.props.detailInfoList.allow_send===true? 发送至 diff --git a/public/react/src/modules/tpm/NewHeader.js b/public/react/src/modules/tpm/NewHeader.js index 844268c34..c284ace35 100644 --- a/public/react/src/modules/tpm/NewHeader.js +++ b/public/react/src/modules/tpm/NewHeader.js @@ -28,7 +28,7 @@ import 'antd/lib/radio/style/index.css'; import 'antd/lib/input/style/index.css'; -import './TPMIndex.css' +import './TPMIndex.css'; import { trigger, broadcastChannelPostMessage } from 'educoder'; @@ -38,114 +38,6 @@ const $ = window.$ const RadioGroup = Radio.Group; const { Search } = Input; let old_url; -function loadHeader(){ - //头部导航条的----------显示搜索框 - $("#search-open").on("click",function(e){ - $(this).hide(); - // $("#header-nav").animate({opacity:"0"},1000); - $(".posi-search").show() // animate({opacity:"1"},1000); - $("#header-nav").css("z-index","2"); - $(".posi-search").css("z-index","3"); - $(".HeaderSearch").show(); - $(".HeaderSearch").val(""); - $(".search-input").focus(); - $(".search-all .search-content").hide(); - e.stopPropagation();//阻止冒泡 - }); - $(".HeaderSearch").on("click",function(e){ - e.stopPropagation();//阻止冒泡 - }); - //搜索框输入内容 - $(".HeaderSearch").on("input",function(e){ - if($(".HeaderSearch").val()==""){ - $(".search-all .search-content").hide(); - }else{ - $(".search-all .search-content").show(); - } - e.stopPropagation();//阻止冒泡 - }); - //搜索 - // $("#header_keyword_search").on("click", header_search); - // $("input[name='search_keyword']").on("keydown", function(event){ - // var code; - // if (!event) { - // event = window.event; //针对ie浏览器 - // code = event.keyCode; - // } - // else { - // code = event.keyCode; - // } - // if(code == 13) { - // header_search(); - // return false; - // } - // }); - $(".search-clear").click(function(e){e.stopPropagation();}); - //切换搜索条件 - $("#searchkey li").click(function(e){ - var key=$($(this).children("a")[0]).html(); - switch (key){ - case '实训': - $("#search_type").val('1'); - break; - case '课堂': - $("#search_type").val('2'); - break; - case '用户': - $("#search_type").val('3'); - break; - } - $("#searchkey").siblings(".searchkey").html(key); - $("#searchkey").hide(); - e.stopPropagation();//阻止冒泡 - }); - //切换选择导航条 - $("#header-nav li").click(function(){ - $("#header-nav li").removeClass("active"); - $(this).addClass("active"); - }); - //点击页面其它(与搜索框无关的地方)都会将搜索框隐藏,所以与搜索框有关的地方需要阻止冒泡 - $("body").on("click",function(){ - closeSearch(); - }); - - $(".search_history").on("click", function(){ - $("input[name='search_keyword']").val($(this).html()); - header_search(); - }); -} - -function header_search(reactHeaderComponnet){ - console.log(old_url) - var keyword = $("input[name='search_keyword']").val(); // 搜索关键字 - window.location.href ="/search"+"?value="+keyword; - // if (!reactHeaderComponnet) { - // reactHeaderComponnet = window._header_componentHandler - // } - // if (!reactHeaderComponnet) { - // var index = $("#search_type").val(); // 搜索课程/项目 - // keyword = encodeURIComponent(keyword); - // // $.get('/users/search_shixuns_or_course', - // // { search: keyword, - // // index: index}); - // window.location.href = old_url+"/users/search_shixuns_or_courses" + "?search=" + keyword + "&index=" + index; - //e.stopPropagation();//阻止冒泡 - // } else { - // window.__headSearchKeyword = keyword - // reactHeaderComponnet.props.history.push(`/shixuns`) - // trigger('searchKeywordChange', keyword) - // } -} -//头部导航条的隐藏 -function closeSearch(){ - $('#posi-search').hide(); - $("#search-open").show(); - // $(".posi-search").animate({opacity:"0"},800); - $(".HeaderSearch").hide(); - $("#header-nav").animate({opacity:"1"},1000); - $(".posi-search").css("z-index","2"); - $("#header-nav").css("z-index","3"); -} /* _logined_header.html.erb @@ -170,8 +62,9 @@ class NewHeader extends Component { RadioGroupvalue:undefined, submitapplications:false, isRender:false, - // isRenders:false, + showSearchOpentype:false, showTrial:false, + setevaluatinghides:false } // console.log("176") // console.log(props); @@ -180,8 +73,6 @@ class NewHeader extends Component { componentDidMount() { window._header_componentHandler = this; - loadHeader(); - //下拉框的显示隐藏 var hoverTimeout; var hoveredPanel; @@ -379,39 +270,11 @@ class NewHeader extends Component { console.log(error); }) } - onKeywordSearch = () => { - header_search(this) - } - onKeywordSearchKeyDown = (e) => { - - let url="/search?value="+e.target.value; - - this.props.history.push(url) - // let code = e.keyCode; - - // if(code == 13) { - // header_search(this); - // return false; - // } - } - onSearchhref = (e) => { - let url="/search?value="+e.target.value; - - this.props.history.push(url) - // let code = e.keyCode; - - // if(code == 13) { - // header_search(this); - // return false; - // } - } - + hideAddcoursestypes=()=>{ - this.setState({ Addcoursestypes:false }) - } @@ -575,13 +438,51 @@ submittojoinclass=(value)=>{ cancelModulationModels = () => { this.setState({isRenders: false}) } - inputjoinclassvalue=(e)=>{ + inputjoinclassvalue=(e)=>{ this.setState({ tojoinclasstitle:e.target.value }) - } + + showSearchOpen=(e)=>{ + this.setState({ + showSearchOpentype:true + }) + e.stopPropagation(e);//阻止冒泡 + } + + hideshowSearchOpen=(e)=>{ + let {setevaluatinghides}=this.state; + if(setevaluatinghides===true){ + this.setState({ + showSearchOpentype:false, + setevaluatinghides:false + }) + e.stopPropagation(e);//阻止冒泡 + } + } + + onKeywordSearchKeyDown = (value) => { + let url=`/search?value=${value}`; + this.props.history.push(url) + } + + onKeywordSearchKeyDowns=()=>{ + this.setState( + { + setevaluatinghides:false + } + ) + } + + setevaluatinghides=()=>{ + this.setState( + { + setevaluatinghides:true + } + ) + } render() { const isLogin = true; // 这里不会出现未登录的情况,服务端在服务端路由时发现如果是未登录,则跳转到登录页了。 const {match ,} = this.props; @@ -601,7 +502,7 @@ submittojoinclass=(value)=>{ submitapplicationsvalue, user, isRender, - isRenders, + showSearchOpentype, }=this.state; /* 用户名称 用户头像url @@ -631,25 +532,13 @@ submittojoinclass=(value)=>{ return ( -
- {/*{*/} - {/* isRender&& isRender === true?*/} +
+ - {/* :""*/} - {/*}*/} - - {/*{*/} - {/* isRenders&&isRenders===true?*/} - {/* this.cancelModulationModels()}*/} - {/* />*/} - {/* :""*/} - {/*}*/} - {/* this.cancelModulationModels()} >*/} +
{/*<%= link_to image_tag("/images/educoder/logo.png", alt:"高校智能化教学与实训平台", className:"logoimg"), home_path %>*/} @@ -726,17 +615,18 @@ submittojoinclass=(value)=>{
{/**/} - -
+ {/*搜索框*/} + {showSearchOpentype===true?
this.hideshowSearchOpen(e)} onMouseLeave={()=>this.setevaluatinghides()}> this.onSearchhref(e)} - onPressEnter={this.onKeywordSearchKeyDown} + onInput={()=>this.onKeywordSearchKeyDowns()} + onSearch={(value) => this.onKeywordSearchKeyDown(value)} + // onPressEnter={this.onKeywordSearchKeyDown} style={{ width: 300 }} + autoFocus={true} /> -
+
:""} {/*
*/} {/*/!**!/*/} @@ -798,13 +688,13 @@ submittojoinclass=(value)=>{ } {/*href="https://www.educoder.net/login"*/}
- { loadHeader()} - + {/*{ loadHeader()}*/} + {showSearchOpentype===true?"":this.showSearchOpen(e)}> {/*"/images/educoder/icon/search.svg" */} - + } {/*
*/}
@@ -980,15 +870,127 @@ export default NewHeader; {/* - 需求:消息数量 -
- - - - -
- */} + 需求:消息数量 +
+ + + + +
+*/} + + +// function loadHeader(){ +// //头部导航条的----------显示搜索框 +// $("#search-open").on("click",function(e){ +// $(this).hide(); +// // $("#header-nav").animate({opacity:"0"},1000); +// $(".posi-search").show() // animate({opacity:"1"},1000); +// $("#header-nav").css("z-index","2"); +// $(".posi-search").css("z-index","3"); +// $(".HeaderSearch").show(); +// $(".HeaderSearch").val(""); +// $(".search-input").focus(); +// $(".search-all .search-content").hide(); +// e.stopPropagation();//阻止冒泡 +// }); +// $(".HeaderSearch").on("click",function(e){ +// debugger +// e.stopPropagation();//阻止冒泡 +// }); +//搜索框输入内容 +// $("#HeaderSearchs").blur(function(e){ +// closeSearch(); +// e.stopPropagation();//阻止冒泡 +// }); +//点击页面其它(与搜索框无关的地方)都会将搜索框隐藏,所以与搜索框有关的地方需要阻止冒泡 +// $("body").on("click",function(){ +// closeSearch(); +// }); +// $(".HeaderSearch").on("input",function(e){ +// $(".search-all .search-content").show(); +// e.stopPropagation();//阻止冒泡 +// }); +//搜索 +// $("#header_keyword_search").on("click", header_search); +// $("input[name='search_keyword']").on("keydown", function(event){ +// var code; +// if (!event) { +// event = window.event; //针对ie浏览器 +// code = event.keyCode; +// } +// else { +// code = event.keyCode; +// } +// if(code == 13) { +// header_search(); +// return false; +// } +// }); +// $(".search-clear").click(function(e){e.stopPropagation();}); +// //切换搜索条件 +// $("#searchkey li").click(function(e){ +// var key=$($(this).children("a")[0]).html(); +// switch (key){ +// case '实训': +// $("#search_type").val('1'); +// break; +// case '课堂': +// $("#search_type").val('2'); +// break; +// case '用户': +// $("#search_type").val('3'); +// break; +// } +// $("#searchkey").siblings(".searchkey").html(key); +// $("#searchkey").hide(); +// e.stopPropagation();//阻止冒泡 +// }); +// //切换选择导航条 +// $("#header-nav li").click(function(){ +// $("#header-nav li").removeClass("active"); +// $(this).addClass("active"); +// }); +// +// +// $(".search_history").on("click", function(){ +// $("input[name='search_keyword']").val($(this).html()); +// header_search(); +// }); +// } +// +// function header_search(reactHeaderComponnet){ +// console.log(old_url) +// var keyword = $("input[name='search_keyword']").val(); // 搜索关键字 +// window.location.href ="/search"+"?value="+keyword; +// // if (!reactHeaderComponnet) { +// // reactHeaderComponnet = window._header_componentHandler +// // } +// // if (!reactHeaderComponnet) { +// // var index = $("#search_type").val(); // 搜索课程/项目 +// // keyword = encodeURIComponent(keyword); +// // // $.get('/users/search_shixuns_or_course', +// // // { search: keyword, +// // // index: index}); +// // window.location.href = old_url+"/users/search_shixuns_or_courses" + "?search=" + keyword + "&index=" + index; +// //e.stopPropagation();//阻止冒泡 +// // } else { +// // window.__headSearchKeyword = keyword +// // reactHeaderComponnet.props.history.push(`/shixuns`) +// // trigger('searchKeywordChange', keyword) +// // } +// } +// //头部导航条的隐藏 +// function closeSearch(){ +// $('#posi-search').hide(); +// $("#search-open").show(); +// // $(".posi-search").animate({opacity:"0"},800); +// $(".HeaderSearch").hide(); +// $("#header-nav").animate({opacity:"1"},1000); +// $(".posi-search").css("z-index","2"); +// $("#header-nav").css("z-index","3"); +// } diff --git a/public/react/src/modules/tpm/TPMIndex.css b/public/react/src/modules/tpm/TPMIndex.css index 4e6ba198b..c8a48440c 100644 --- a/public/react/src/modules/tpm/TPMIndex.css +++ b/public/react/src/modules/tpm/TPMIndex.css @@ -194,4 +194,8 @@ body>.-task-title { position: absolute; top: 10px; right: -22px; +} + +.HeaderSearch{ + width: 325px; } \ No newline at end of file diff --git a/public/react/src/modules/tpm/challengesnew/TPMchallengesnew.js b/public/react/src/modules/tpm/challengesnew/TPMchallengesnew.js index b3cfaf5b0..2cca8cb65 100644 --- a/public/react/src/modules/tpm/challengesnew/TPMchallengesnew.js +++ b/public/react/src/modules/tpm/challengesnew/TPMchallengesnew.js @@ -236,18 +236,18 @@ export default class TPMchallengesnew extends Component { st: 0, exec_time:exec_time }).then((response) => { - this.props.showSnackbar(response.data.messages); if (response.data.status === 1) { - $("html").animate({ scrollTop: 0 }) + $("html").animate({ scrollTop: 0 }) - this.setState({ - setopen: true, - tab2url: "/shixuns/" + id + "/challenges/"+response.data.challenge_id+"/tab=2", - tab3url: "/shixuns/" + id + "/challenges/"+response.data.challenge_id+"/tab=3", - }) - // window.location.href = "/shixuns/" + id + "/challenges/"+response.data.challenge_id+"/tab=2" - } + this.setState({ + setopen: true, + CreatePracticesendtype:false, + tab2url: "/shixuns/" + id + "/challenges/"+response.data.challenge_id+"/tab=2", + tab3url: "/shixuns/" + id + "/challenges/"+response.data.challenge_id+"/tab=3", + }) + } + this.props.showSnackbar(response.data.messages); }).catch((error) => { console.log(error) }); @@ -362,6 +362,7 @@ export default class TPMchallengesnew extends Component { if (response.data.status === 1) { this.setState({ setopen: true, + editPracticesendtype:false, tab2url: "/shixuns/" + id + "/challenges/"+checkpointId+"/tab=2", tab3url: "/shixuns/" + id + "/challenges/"+checkpointId+"/tab=3", }) diff --git a/public/react/src/modules/tpm/challengesnew/TPMevaluation.js b/public/react/src/modules/tpm/challengesnew/TPMevaluation.js index e12cf1810..01b99b4c2 100644 --- a/public/react/src/modules/tpm/challengesnew/TPMevaluation.js +++ b/public/react/src/modules/tpm/challengesnew/TPMevaluation.js @@ -993,7 +993,7 @@ export default class TPMevaluation extends Component {
:""} - {pathoptionvalue===1||pathoptionvalue===-1?"":
+ {pathoptionvalue===-1?"":

学员答案文件路径