diff --git a/public/react/src/common/mediator.js b/public/react/src/common/mediator.js new file mode 100644 index 000000000..464a5cbf8 --- /dev/null +++ b/public/react/src/common/mediator.js @@ -0,0 +1,46 @@ +function Mediator(obj) { + const channels = {} + + const mediator = { + subscribe: function (channel, cb) { + if (!channels[channel]) { + channels[channel] = [] + } + channels[channel].push(cb) + return this.unsubscribe.bind(null, channel, cb) + }, + + unsubscribe: function (channel, cb) { + let rs = channels[channel] + let index = -1 + if (rs) { + for (let i = 0; i < rs.length; i++) { + if (rs[i].name === cb.name) { + index = i + break + } + } + if (index >= 0) { + channels[channel].splice(index, 1) + return true + } + } + return false + }, + + publish: function (channel) { + if (!channels[channel]) { + return false + } + const args = Array.prototype.slice.call(arguments, 1) + channels[channel].forEach(subscription => { + subscription.apply(null, args) + }) + return this + }, + } + + return obj ? Object.assign(obj, mediator) : mediator +} +const mediator = new Mediator() +export default mediator diff --git a/public/react/src/modules/courses/coursesHome/CoursesHome.js b/public/react/src/modules/courses/coursesHome/CoursesHome.js index 73289b2d5..611ff20d5 100644 --- a/public/react/src/modules/courses/coursesHome/CoursesHome.js +++ b/public/react/src/modules/courses/coursesHome/CoursesHome.js @@ -1,118 +1,117 @@ -import React, { Component } from 'react'; -import {getImageUrl} from 'educoder'; +import React, { Component, Fragment } from 'react'; +import { getImageUrl } from 'educoder'; import CoursesHomeCard from "./CoursesHomeCard.js" import axios from 'axios'; -import {Input,Tooltip} from 'antd'; +import { Pagination } from 'antd'; import LoadingSpin from '../../../common/LoadingSpin'; import UpgradeModals from '../../modals/UpgradeModals'; import './css/CoursesHome.css'; -import Pagination from '@icedesign/base/lib/pagination'; -import '@icedesign/base/lib/pagination/style.js'; +import '../../tpm/shixuns/shixun-keyword-list.scss'; +import btnNew from './btn-new.png' +import btnJoin from './btn-join.png' - -const Search = Input.Search; -class CoursesHome extends Component{ +class CoursesHome extends Component { constructor(props) { super(props) this.state = { - limit:16, - page:1, - order:"created_at", - coursesHomelist:undefined, - search:"", + limit: 16, + page: 1, + order: "created_at", + coursesHomelist: undefined, + search: "", } } //切换列表状态 - changeStatus=(value)=>{ + changeStatus = (value) => { this.setState({ - order:value, - page:1, - coursesHomelist:undefined + order: value, + page: 1, + coursesHomelist: undefined }) - this.searchcourses(16,1,value,"") + this.searchcourses(16, 1, value, "") } //搜索输入 - inputSearchValue=(e)=>{ + inputSearchValue = (e) => { this.setState({ - search:e.target.value, - page:1 + search: e.target.value, + page: 1 }) } //搜索 - searchValue=(e)=>{ - let { search ,order}=this.state; + searchValue = (e) => { + let { search, order } = this.state; this.setState({ - order:order, - page:1 + order: order, + page: 1 }) - this.searchcourses(16,1,order,search) + this.searchcourses(16, 1, order, search) } - componentDidMount(){ - document.title="教学课堂"; - const upsystem=`/users/system_update.json`; - axios.get(upsystem).then((response)=>{ - let updata=response.data; - this.setState({ - updata:updata - }) - }).catch((error)=>{ - console.log(error); - }) - - this.searchcourses(16,1,"all","") + componentDidMount() { + document.title = "教学课堂"; + const upsystem = `/users/system_update.json`; + axios.get(upsystem).then((response) => { + let updata = response.data; + this.setState({ + updata: updata + }) + }).catch((error) => { + console.log(error); + }) + + this.searchcourses(16, 1, "all", "") } - onChange=(pageNumber)=> { + onChange = (pageNumber) => { this.setState({ - page:pageNumber + page: pageNumber }) - let {limit,order,search}=this.state; + let { limit, order, search } = this.state; - this.searchcourses(limit,pageNumber,order,search) + this.searchcourses(limit, pageNumber, order, search) } - searchcourses=(limit,page,order,search)=>{ - let url="/courses.json"; - axios.get(url,{ + searchcourses = (limit, page, order, search) => { + let url = "/courses.json"; + axios.get(url, { params: { - limit:limit, - page:page, - order:order, - search:search + limit: limit, + page: page, + order: order, + search: search } - }).then((result)=>{ - if(result.data.status===401){ + }).then((result) => { + if (result.data.status === 401) { - }else{ + } else { this.setState({ - coursesHomelist:result.data + coursesHomelist: result.data }) } - }).catch((error)=>{ - console.log(error); - }) + }).catch((error) => { + console.log(error); + }) } - getUser=(url,type)=>{ - if(this.props.checkIfLogin()===false){ + getUser = (url, type) => { + if (this.props.checkIfLogin() === false) { this.props.showLoginDialog() return } - if(this.props.checkIfProfileCompleted()===false){ + if (this.props.checkIfProfileCompleted() === false) { this.props.showProfileCompleteDialog() return } - if(url !== undefined || url!==""){ + if (url !== undefined || url !== "") { this.props.history.push(url); } @@ -120,79 +119,71 @@ class CoursesHome extends Component{ } render() { - let { order,search,page,coursesHomelist }=this.state; - //console.log(this.props) + const { order, page, coursesHomelist } = this.state; + const { user, tojoinclass } = this.props + console.log(tojoinclass, '--------------s') return ( -
- {this.state.updata===undefined?"":} +
+ {this.state.updata === undefined ? "" : }
- -
-
-
-
-
+ } + +
+
+
+
- -
- {/* this.changeStatus("all")}>全部*/} - {/* this.changeStatus("mine")}>我的*/} - this.changeStatus("created_at")}>最新 - this.changeStatus("visits")}>最热 - {this.props.user&&this.props.user.user_identity==="学生"?"":this.getUser("/courses/new")}>+新建教学课堂} - - {/*
*/} - {/*/!* *!/*/} - {/*
*/} - +
+ +
+ - - {coursesHomelist===undefined?:} - - {coursesHomelist===undefined?"":coursesHomelist.courses.length===0?
- -

暂时还没有相关数据哦!

-
:""} - - { - coursesHomelist===undefined?"":coursesHomelist.courses_count > 16? -
- -
:"" + {user && user.user_identity !== '学生' ? + + { this.getUser("/courses/new") }} > 创建教学课堂 + { window._header_componentHandler.tojoinclass() }} > 加入教学课堂 + : null } +
+ + {coursesHomelist === undefined ? : } + + {coursesHomelist === undefined ? "" : coursesHomelist.courses.length === 0 ?
+ +

暂时还没有相关数据哦!

+
: ""} + + { + coursesHomelist === undefined ? "" : coursesHomelist.courses_count > 16 ? +
+ +
: "" + }
-
+
) } } diff --git a/public/react/src/modules/courses/coursesHome/btn-join.png b/public/react/src/modules/courses/coursesHome/btn-join.png new file mode 100644 index 000000000..de1fdb3df Binary files /dev/null and b/public/react/src/modules/courses/coursesHome/btn-join.png differ diff --git a/public/react/src/modules/courses/coursesHome/btn-new.png b/public/react/src/modules/courses/coursesHome/btn-new.png new file mode 100644 index 000000000..af288c560 Binary files /dev/null and b/public/react/src/modules/courses/coursesHome/btn-new.png differ diff --git a/public/react/src/modules/tpm/NewHeader.js b/public/react/src/modules/tpm/NewHeader.js index 99018567c..00325b9b2 100644 --- a/public/react/src/modules/tpm/NewHeader.js +++ b/public/react/src/modules/tpm/NewHeader.js @@ -1,25 +1,18 @@ import React, { Component } from 'react'; -import { BrowserRouter as Router, Route, Link } from "react-router-dom"; -import { Redirect } from 'react-router'; -import AccountProfile from"../user/AccountProfile"; -import PropTypes from 'prop-types'; +import { Link } from "react-router-dom"; +import AccountProfile from "../user/AccountProfile"; import Certifiedprofessional from "../../modules/modals/Certifiedprofessional" -// import searchImg from '../../../../images/educoder/icon/search.svg' - -// /images/educoder/icon/search.svg - -import { getImageUrl, toPath ,trigger,broadcastChannelPostMessage} from 'educoder' +import { getImageUrl } from 'educoder' import axios from 'axios'; -import { Modal,Checkbox ,Radio,Input,message,notification,Popover} from 'antd'; +import { Modal, Radio, Input, message, notification } from 'antd'; import Addcourses from '../courses/coursesPublic/Addcourses'; import LoginDialog from '../login/LoginDialog'; -import Trialapplication from '../login/Trialapplication'; import GotoQQgroup from '../../modal/GotoQQgroup' @@ -50,53 +43,53 @@ window._header_componentHandler = null; class NewHeader extends Component { constructor(props) { super(props) - this.state={ - Addcoursestypes:false, - tojoinitemtype:false, - tojoinclasstitle:undefined, - rolearr:["",""], - Checkboxteacherchecked:false, - Checkboxstudentchecked:false, - Checkboxteachingchecked:false, - Checkboxteachertype:false, - Checkboxteachingtype:false, - code_notice:false, - checked_notice:false, - RadioGroupvalue:undefined, - submitapplications:false, - isRender:false, - showSearchOpentype:false, - showTrial:false, - setevaluatinghides:false, - occupation:0, - mydisplay:false, - headtypesonClickbool:false, - headtypess:"/", - mygetHelmetapi2: null, - goshowqqgtounp:false, - visiblemyss:false, + this.state = { + Addcoursestypes: false, + tojoinitemtype: false, + tojoinclasstitle: undefined, + rolearr: ["", ""], + Checkboxteacherchecked: false, + Checkboxstudentchecked: false, + Checkboxteachingchecked: false, + Checkboxteachertype: false, + Checkboxteachingtype: false, + code_notice: false, + checked_notice: false, + RadioGroupvalue: undefined, + submitapplications: false, + isRender: false, + showSearchOpentype: false, + showTrial: false, + setevaluatinghides: false, + occupation: 0, + mydisplay: false, + headtypesonClickbool: false, + headtypess: "/", + mygetHelmetapi2: null, + goshowqqgtounp: false, + visiblemyss: false, } - // console.log("176") + // console.log("176") // console.log(props); // console.log("NewHeader1234567890"); // console.log(this.props); } - componentDidUpdate = (prevProps) => { - // console.log("componentDidMount2"); - // console.log(this.state.mygetHelmetapi2); - if(this.state.mygetHelmetapi2===undefined){ - this.getAppdata(); - } - } + componentDidUpdate = (prevProps) => { + // console.log("componentDidMount2"); + // console.log(this.state.mygetHelmetapi2); + if (this.state.mygetHelmetapi2 === undefined) { + this.getAppdata(); + } + } componentDidMount() { - // console.log("componentDidMount1"); - this.getAppdata(); + // console.log("componentDidMount1"); + this.getAppdata(); window._header_componentHandler = this; //下拉框的显示隐藏 var hoverTimeout; var hoveredPanel; - $(".edu-menu-panel").hover(function(){ + $(".edu-menu-panel").hover(function () { if (hoverTimeout) { // 一次只显示一个panel if (hoveredPanel && hoveredPanel != this) { $(hoveredPanel).find(".edu-menu-list").hide() @@ -106,92 +99,54 @@ class NewHeader extends Component { } hoveredPanel = this; $(this).find(".edu-menu-list").show(); - },function(){ - var that =this; + }, function () { + var that = this; // 延迟hide - hoverTimeout = setTimeout(function() { + hoverTimeout = setTimeout(function () { $(that).find(".edu-menu-list").hide(); }, 800) }); //获取游览器地址 - try { - window.sessionStorage.setItem("yslgeturls", JSON.stringify(window.location.href)) - } catch (e) { - - } - // axios.interceptors.response.use((response) => { - // if (response != undefined) - // if (response && response.data.status === -1) { - // if (response.data.message === "该课堂要求成员完成实名认证") { - // - // } else if (response.data.message === "该课堂要求成员完成职业认证") { - // console.log("该课堂要求成员完成职业认证"); - // this.HideAddcoursestypess(2); - // - // - // - // return - // } else if (response.data.message === "该课堂要求成员完成实名和职业认证") { - // console.log("该课堂要求成员完成实名和职业认证"); - // this.HideAddcoursestypess(3); - // return - // - // } - // } - // return response; - // }, (error) => { - // - // }); - } + try { + window.sessionStorage.setItem("yslgeturls", JSON.stringify(window.location.href)) + } catch (e) { - componentDidUpdate = (prevProps) => { - // if(prevProps.user!=this.props.user){ - // // console.log("216") - // // console.log(prevProps.user); - // // console.log(this.props.user); - // if(this.props.user !== undefined){ - // this.setState({ - // user_phone_binded :this.props.user.user_phone_binded, - // }) - // } - // - // - // } + } } openNotification = (messge) => { notification.open({ message: "提示", description: - messge, + messge, }); }; componentWillReceiveProps(newProps, oldProps) { this.setState({ - user:newProps.user + user: newProps.user }) - if(newProps.Headertop!=undefined){ - old_url=newProps.Headertop.old_url + if (newProps.Headertop != undefined) { + old_url = newProps.Headertop.old_url } } - getCookie=(key)=>{ - var arr,reg = RegExp('(^| )'+key+'=([^;]+)(;|$)'); + getCookie = (key) => { + var arr, reg = RegExp('(^| )' + key + '=([^;]+)(;|$)'); if (arr = document.cookie.match(reg)) //["username=liuwei;", "", "liuwei", ";"] return decodeURIComponent(arr[2]); else return null; } - delCookie=(name)=>{ + delCookie = (name) => { var exp = new Date(); exp.setTime(exp.getTime() - 1); - var cval=this.getCookie(name); - if(cval!=null){ - document.cookie= name + "="+cval+";expires="+exp.toGMTString(); + var cval = this.getCookie(name); + if (cval != null) { + document.cookie = name + "=" + cval + ";expires=" + exp.toGMTString(); } } onLogout = () => { @@ -200,96 +155,93 @@ class NewHeader extends Component { axios.get(url, { }) .then((response) => { - if(response.data.status===1){ + if (response.data.status === 1) { this.setState({ - user:undefined + user: undefined }) - // let path="/"; - // this.props.history.push(path); - // broadcastChannelPostMessage('refreshPage') - window.location.href ="/login" + window.location.href = "/login" message.success('退出成功'); } }); } - tojoinclass=()=>{ - let{user} =this.state; - if(user===undefined){ + tojoinclass = () => { + let { user } = this.state; + if (user === undefined) { this.setState({ - isRender:true + isRender: true }) return } - if(user&&user.login===""){ + if (user && user.login === "") { this.setState({ - isRender:true + isRender: true }) return; } - if(user&&user.profile_completed===false){ - this.setState({ - AccountProfiletype:true - }) - return; - } + if (user && user.profile_completed === false) { + this.setState({ + AccountProfiletype: true + }) + return; + } - this.setState({ - Addcoursestypes:true, + this.setState({ + Addcoursestypes: true, }) } - tojoinitem=()=>{ - if(this.props.user&&this.props.user.email===undefined||this.props.user&&this.props.user.email===null||this.props.user&&this.props.user.email===""){ - this.openNotification("请先绑定邮箱,谢谢"); - return - } - let{user} =this.state; - if(user===undefined){ + tojoinitem = () => { + if (this.props.user && this.props.user.email === undefined || this.props.user && this.props.user.email === null || this.props.user && this.props.user.email === "") { + this.openNotification("请先绑定邮箱,谢谢"); + return + } + let { user } = this.state; + if (user === undefined) { this.setState({ - isRender:true + isRender: true }) return } - if(user&&user.login===""){ + if (user && user.login === "") { this.setState({ - isRender:true + isRender: true }) return; } - if(user&&user.profile_completed===false){ - this.setState({ - AccountProfiletype:true - }) - return; - } + if (user && user.profile_completed === false) { + this.setState({ + AccountProfiletype: true + }) + return; + } - this.setState({ - tojoinitemtype:true + this.setState({ + tojoinitemtype: true }) } - submitstatevalue=(sum,value,data)=>{ + submitstatevalue = (sum, value, data) => { this.setState({ - Addcoursestypes:false, - tojoinitemtype:false, - tojoinclasstitle:undefined, - rolearr:["",""], - Checkboxteacherchecked:false, - Checkboxstudentchecked:false, - Checkboxteachingchecked:false, - Checkboxteachertype:false, - Checkboxteachingtype:false, - code_notice:false, - checked_notice:false, - submitapplicationssum:sum, - submitapplications:true, - submitapplicationsvalue:value, - submitapplicationsvaluedata:data, - RadioGroupvalue:undefined + Addcoursestypes: false, + tojoinitemtype: false, + tojoinclasstitle: undefined, + rolearr: ["", ""], + Checkboxteacherchecked: false, + Checkboxstudentchecked: false, + Checkboxteachingchecked: false, + Checkboxteachertype: false, + Checkboxteachingtype: false, + code_notice: false, + checked_notice: false, + submitapplicationssum: sum, + submitapplications: true, + submitapplicationsvalue: value, + submitapplicationsvaluedata: data, + RadioGroupvalue: undefined }) } @@ -299,80 +251,54 @@ class NewHeader extends Component { }); } - submitsubmitapplications=()=>{ + submitsubmitapplications = () => { let { submitapplicationssum, submitapplicationsvaluedata - }=this.state; + } = this.state; this.setState({ - submitapplications:false, - RadioGroupvalue:undefined + submitapplications: false, + RadioGroupvalue: undefined }) - if(submitapplicationssum===0){ - if(submitapplicationsvaluedata!=undefined){ - window.location.href = "/courses/"+submitapplicationsvaluedata; + if (submitapplicationssum === 0) { + if (submitapplicationsvaluedata != undefined) { + window.location.href = "/courses/" + submitapplicationsvaluedata; } - }else if(submitapplicationssum===1){ - if(submitapplicationsvaluedata!=undefined){ - window.location.href = "/projects/"+submitapplicationsvaluedata; + } else if (submitapplicationssum === 1) { + if (submitapplicationsvaluedata != undefined) { + window.location.href = "/projects/" + submitapplicationsvaluedata; } } } - hidesubmitapplications=()=>{ + hidesubmitapplications = () => { this.setState({ - Addcoursestypes:false, - tojoinitemtype:false, - tojoinclasstitle:undefined, - rolearr:["",""], - Checkboxteacherchecked:false, - Checkboxstudentchecked:false, - Checkboxteachingchecked:false, - Checkboxteachertype:false, - Checkboxteachingtype:false, - code_notice:false, - checked_notice:false, - submitapplications:false, - RadioGroupvalue:undefined + Addcoursestypes: false, + tojoinitemtype: false, + tojoinclasstitle: undefined, + rolearr: ["", ""], + Checkboxteacherchecked: false, + Checkboxstudentchecked: false, + Checkboxteachingchecked: false, + Checkboxteachertype: false, + Checkboxteachingtype: false, + code_notice: false, + checked_notice: false, + submitapplications: false, + RadioGroupvalue: undefined }) } - educoderlogin=()=>{ + educoderlogin = () => { //登录账号 this.setState({ - isRender:true + isRender: true }) - // var url = `/accounts/logout.json`; - // - // axios.get((url)).then((result) => { - // if(result!==undefined){ - // // this.setState({ - // // isRender:true - // // }) - // window.location.href = "/"; - // } - // }).catch((error) => { - // console.log(error); - // }) + } - educoderloginysl=()=>{ - //退出账号 - // this.setState({ - // isRender:true - // }) - // let newTPMsettings=this.props.user&&this.props.user.user_id+'newTPMsettings' - // let shixunopenprocess=this.props.user&&this.props.user.user_id+'shixunopenprocess' - // let openopenpublictype=this.props.user&&this.props.user.user_id+'openopenpublictype' + educoderloginysl = () => { var url = `/accounts/logout.json`; - // let storage=window.localStorage; axios.get((url)).then((result) => { - // storage.removeItem(newTPMsettings); - // storage.removeItem(shixunopenprocess); - // storage.removeItem( openopenpublictype); - if(result!==undefined){ - // this.setState({ - // isRender:true - // }) - // broadcastChannelPostMessage('refreshPage') + if (result !== undefined) { window.location.href = "/"; } }).catch((error) => { @@ -380,295 +306,237 @@ class NewHeader extends Component { }) } - hideAddcoursestypes=()=>{ + hideAddcoursestypes = () => { this.setState({ - Addcoursestypes:false + Addcoursestypes: false }) }; - HideAddcoursestypess=(i)=>{ + HideAddcoursestypess = (i) => { console.log("调用了"); this.setState({ - Addcoursestypes:false, - mydisplay:true, - occupation:i, + Addcoursestypes: false, + mydisplay: true, + occupation: i, }) }; - ModalCancelsy=()=>{ + ModalCancelsy = () => { this.setState({ - mydisplay:false, + mydisplay: false, }) }; - hidetojoinclass=()=>{ + hidetojoinclass = () => { this.setState({ - tojoinclasstype:false, - tojoinitemtype:false, - tojoinclasstitle:undefined, - rolearr:["",""], - Checkboxteacherchecked:false, - Checkboxstudentchecked:false, - Checkboxteachingchecked:false, - Checkboxteachertype:false, - Checkboxteachingtype:false, - code_notice:false, - checked_notice:false, - RadioGroupvalue:undefined + tojoinclasstype: false, + tojoinitemtype: false, + tojoinclasstitle: undefined, + rolearr: ["", ""], + Checkboxteacherchecked: false, + Checkboxstudentchecked: false, + Checkboxteachingchecked: false, + Checkboxteachertype: false, + Checkboxteachingtype: false, + code_notice: false, + checked_notice: false, + RadioGroupvalue: undefined }) } -submittojoinclass=(value)=>{ - let {tojoinclasstitle,rolearr,RadioGroupvalue}=this.state; + submittojoinclass = (value) => { + let { tojoinclasstitle, rolearr, RadioGroupvalue } = this.state; - if(tojoinclasstitle===undefined){ - this.setState({ - code_notice:true - }) - return - } - let newrolearr=rolearr; - // if(value===1){ - if(tojoinclasstitle.length<6){ + if (tojoinclasstitle === undefined) { this.setState({ - code_notice:true + code_notice: true }) return } - // }else if(value===0){ - // if(tojoinclasstitle.length<5){ - // this.setState({ - // code_notice:true - // }) - // return - // } - // } - if(tojoinclasstitle===""||tojoinclasstitle===undefined){ - this.setState({ - code_notice:true - }) - return - }else{ - this.setState({ - code_notice:false - }) - } + let newrolearr = rolearr; + // if(value===1){ + if (tojoinclasstitle.length < 6) { + this.setState({ + code_notice: true + }) + return + } + // }else if(value===0){ + // if(tojoinclasstitle.length<5){ + // this.setState({ + // code_notice:true + // }) + // return + // } + // } + if (tojoinclasstitle === "" || tojoinclasstitle === undefined) { + this.setState({ + code_notice: true + }) + return + } else { + this.setState({ + code_notice: false + }) + } - let pamst=[]; - let num=0; - for(var i = 0 ; i { + if (response.data.status === 1) { + this.submitstatevalue(1, "您输入的邀请码错误") + } else if (response.data.status === 2) { + this.submitstatevalue(1, "您已经是该项目成员", response.data.project) + } else if (response.data.status === 3) { + this.submitstatevalue(1, "请选择一个角色") + } else if (response.data.status === 4) { + this.submitstatevalue(1, "您的申请已提交,请等待项目管理员审批") + } else if (response.data.status === 5) { + this.submitstatevalue(1, "您已经申请加入该项目了,请耐心等待") + } else if (response.data.status === 6) { + this.submitstatevalue(1, "您已成功加入项目", response.data.project) + } else if (response.data.status === 0) { + if (RadioGroupvalue === "reporter") { + this.openNotification("您加入项目成功!"); + window.location.href = `/projects/${response.data.project_id}`; + } else { + this.openNotification("您的申请已提交,请等待项目管理员审批!"); + } + } + }) + } + this.hidetojoinclass() + } + // 关闭 + cancelModulationModels = () => { + this.setState({ isRenders: false }) } - if(num===2&&value===0){ + inputjoinclassvalue = (e) => { + console.log(e.target.value.length); + if (e.target.value.length >= 7) { + this.openNotification("请输入6位项目邀请码!"); + return + } this.setState({ - checked_notice:true + tojoinclasstitle: e.target.value }) - return } - if(value===1&&RadioGroupvalue===undefined){ + showSearchOpen = (e) => { this.setState({ - checked_notice:true + showSearchOpentype: true }) - return + } - // if(value===0){ - // let url="/courses/join_course_multi_role.json" - // const form = new FormData(); - // form.append('invite_code', tojoinclasstitle); - // form.append('role', pamst); - // form.append('type', 1); - // axios.post(url,form,[true] - // ).then((response) => { - // if( response.data.state===0){ - // this.submitstatevalue(0,"加入成功",response.data.course_id) - // }else if( response.data.state===1){ - // }else if( response.data.state===2){ - // this.submitstatevalue( 0,"课堂已过期! 请联系课堂管理员重启课堂。(在配置课堂处)") - // }else if( response.data.state===3){ - // this.submitstatevalue( 0,"您已是课堂成员)",response.data.course_id) - // }else if( response.data.state===4){ - // this.submitstatevalue( 0,"您输入的邀请码错误)") - // }else if( response.data.state===5){ - // this.submitstatevalue( 0,"您还未登录") - // }else if( response.data.state===6){ - // this.submitstatevalue( 0,"申请已提交,请等待审核") - // }else if( response.data.state===7){ - // this.submitstatevalue( 0," 您已经发送过申请了,请耐心等待") - // }else if( response.data.state===8){ - // this.submitstatevalue( 0,"您已经是该课堂的教师了",response.data.course_id) - // }else if( response.data.state==9){ - // this.submitstatevalue( 0,"您已经是该课堂的教辅了",response.data.course_id) - // }else if( response.data.state==10){ - // this.submitstatevalue(0,"您已经是该课堂的管理员了",response.data.course_id) - // }else if( response.data.state==11){ - // this.submitstatevalue(0," 该课堂已归档,请联系老师") - // }else if( response.data.state==12){ - // this.submitstatevalue(0,"您已经发送过申请了,请耐心等待师") - // }else if( response.data.state==13){ - // this.submitstatevalue(0,"您申请已提交,请等待审核") - // }else if( response.data.state==14){ - // this.submitstatevalue("此邀请码已停用,请与老师联系") - // }else if( response.data.state==15){ - // this.submitstatevalue(0,"您已是课堂成员! 加入分班请在课堂具体分班页面进行") - // }else { - // this.submitstatevalue(0," 未知错误,请稍后再试") - // } - // }) - // - // } - - if(value===1){ - let url="/project_applies.json" - // const form = new FormData(); - // form.append('code', tojoinclasstitle); - // form.append('role', RadioGroupvalue); - // form.append('type', 1); - axios.post(url,{ - code:tojoinclasstitle, - role:RadioGroupvalue - } - ).then((response) => { - if( response.data.status===1){ - this.submitstatevalue(1,"您输入的邀请码错误") - }else if( response.data.status===2){ - this.submitstatevalue( 1,"您已经是该项目成员",response.data.project) - }else if( response.data.status===3){ - this.submitstatevalue( 1,"请选择一个角色") - }else if( response.data.status===4){ - this.submitstatevalue( 1,"您的申请已提交,请等待项目管理员审批") - }else if( response.data.status===5){ - this.submitstatevalue( 1,"您已经申请加入该项目了,请耐心等待") - }else if( response.data.status===6){ - this.submitstatevalue( 1,"您已成功加入项目",response.data.project) - }else if( response.data.status===0){ - if(RadioGroupvalue==="reporter"){ - this.openNotification("您加入项目成功!"); - window.location.href=`/projects/${response.data.project_id}`; - }else{ - this.openNotification("您的申请已提交,请等待项目管理员审批!"); - } - } - }) + hideshowSearchOpen = (e) => { + let { setevaluatinghides } = this.state; + if (setevaluatinghides === true) { + this.setState({ + showSearchOpentype: false, + setevaluatinghides: false + }) + + } } - this.hidetojoinclass() -} - // trialapplications =()=>{ - // console.log("点击了") - // this.setState({ - // isRenders: true, - // showTrial:true, - // }) - // } + onKeywordSearchKeyDown = (value) => { + let url = `/search?value=${value}`; + this.props.history.push(url) + } - // 关闭 - cancelModulationModels = () => { - this.setState({isRenders: false}) + onKeywordSearchKeyDowns = () => { + this.setState( + { + setevaluatinghides: false + } + ) } - inputjoinclassvalue=(e)=>{ - console.log(e.target.value.length); - if(e.target.value.length>=7){ - this.openNotification("请输入6位项目邀请码!"); - return - } - this.setState({ - tojoinclasstitle:e.target.value - }) + setevaluatinghides = () => { + this.setState( + { + setevaluatinghides: true + } + ) } + //头部获取是否已经登录了 + getUser = (url, type) => { - showSearchOpen=(e)=>{ - this.setState({ - showSearchOpentype:true - }) - - } - - hideshowSearchOpen=(e)=>{ - let {setevaluatinghides}=this.state; - if(setevaluatinghides===true){ - this.setState({ - showSearchOpentype:false, - setevaluatinghides:false - }) - - } - } - - onKeywordSearchKeyDown = (value) => { - let url=`/search?value=${value}`; - this.props.history.push(url) - } - - onKeywordSearchKeyDowns=()=>{ - this.setState( - { - setevaluatinghides:false - } - ) - } - - setevaluatinghides=()=>{ - this.setState( - { - setevaluatinghides:true - } - ) - } - //头部获取是否已经登录了 - getUser=(url,type)=>{ - - if(type==="projects"){ - if(this.props.user&&this.props.user.email===undefined||this.props.user&&this.props.user.email===null||this.props.user&&this.props.user.email===""){ - this.openNotification("请先绑定邮箱,谢谢"); - return - } - } + if (type === "projects") { + if (this.props.user && this.props.user.email === undefined || this.props.user && this.props.user.email === null || this.props.user && this.props.user.email === "") { + this.openNotification("请先绑定邮箱,谢谢"); + return + } + } // console.log("点击了503") // console.log(url); - let{user} =this.state; + let { user } = this.state; - if(user===undefined){ - this.setState({ - isRender:true - }) - return + if (user === undefined) { + this.setState({ + isRender: true + }) + return } - if(user&&user.login===""){ + if (user && user.login === "") { this.setState({ - isRender:true + isRender: true }) return; } - if(user&&user.profile_completed===false){ - this.setState({ - AccountProfiletype:true - }) - return; - } + if (user && user.profile_completed === false) { + this.setState({ + AccountProfiletype: true + }) + return; + } - if(type==="newshixuns"){ - if(this.props&&this.props.current_user&&this.props.current_user.is_shixun_marker===false){ - this.setgoshowqqgtounp(true); - return; + if (type === "newshixuns") { + if (this.props && this.props.current_user && this.props.current_user.is_shixun_marker === false) { + this.setgoshowqqgtounp(true); + return; + } } - } - if(url !== undefined || url!==""){ + if (url !== undefined || url !== "") { window.location.href = url; } @@ -676,211 +544,211 @@ submittojoinclass=(value)=>{ } //修改登录方法 - Modifyloginvalue=()=>{ + Modifyloginvalue = () => { this.setState({ - isRender:false, + isRender: false, }) } - hideAccountProfile=()=>{ - this.setState({ - AccountProfiletype:false - }) - }; - headtypesonClick=(url,bool)=>{ - this.setState({ - headtypess:url, - headtypesonClickbool:bool, - }) - } - //获取数据为空的时候 - gettablogourlnull = () => { - this.setState({ - mygetHelmetapi2: undefined - }); - document.title = "EduCoder"; - var link = document.createElement('link'), - oldLink = document.getElementById('dynamic-favicon'); - link.id = 'dynamic-favicon'; - link.rel = 'shortcut icon'; - link.href = "/react/build/./favicon.ico"; - if (oldLink) { - document.head.removeChild(oldLink); - } - document.head.appendChild(link); - }; - - //获取数据的时候 - gettablogourldata = (response) => { - document.title = response.data.setting.name; - var link = document.createElement('link'), - oldLink = document.getElementById('dynamic-favicon'); - link.id = 'dynamic-favicon'; - link.rel = 'shortcut icon'; - link.href = '/' + response.data.setting.tab_logo_url; - if (oldLink) { - document.head.removeChild(oldLink); - } - document.head.appendChild(link); - } - - - handleVisibleChanges = (boll) => { - this.setState({ - visiblemyss: boll, - }) - - } - - - getAppdata=()=>{ - try { - var chromesettingArray = JSON.parse(localStorage.getItem('chromesetting')); - var chromesettingresponseArray = JSON.parse(localStorage.getItem('chromesettingresponse')); - // console.log("NewHeaderNewHeaderNewHeader"); - // console.log(chromesettingArray); - // console.log(chromesettingresponseArray); - - this.setState({ - mygetHelmetapi2:chromesettingArray - }); - if (chromesettingArray.tab_logo_url) { - this.gettablogourldata(chromesettingresponseArray); - } else { - this.gettablogourlnull(); - } - }catch (e) { - console.log("head获取游览器配置失败 重新请求开始读取配置"); - this.geturlsdata(); - } - }; - - geturlsdata=()=>{ - let url = "/setting.json"; - axios.get(url).then((response) => { - // console.log("app.js开始请求/setting.json"); - // console.log("获取当前定制信息"); - if(response){ - if(response.data){ - this.setState({ - mygetHelmetapi2:response.data.setting - }); - localStorage.setItem('chromesetting',JSON.stringify(response.data.setting)); - localStorage.setItem('chromesettingresponse',JSON.stringify(response)); - try { - if (response.data.setting.tab_logo_url) { - this.gettablogourldata(response); - } else { - this.gettablogourlnull(); - } - } catch (e) { - this.gettablogourlnull(); - } + hideAccountProfile = () => { + this.setState({ + AccountProfiletype: false + }) + }; + headtypesonClick = (url, bool) => { + this.setState({ + headtypess: url, + headtypesonClickbool: bool, + }) + } + //获取数据为空的时候 + gettablogourlnull = () => { + this.setState({ + mygetHelmetapi2: undefined + }); + document.title = "EduCoder"; + var link = document.createElement('link'), + oldLink = document.getElementById('dynamic-favicon'); + link.id = 'dynamic-favicon'; + link.rel = 'shortcut icon'; + link.href = "/react/build/./favicon.ico"; + if (oldLink) { + document.head.removeChild(oldLink); + } + document.head.appendChild(link); + }; + + //获取数据的时候 + gettablogourldata = (response) => { + document.title = response.data.setting.name; + var link = document.createElement('link'), + oldLink = document.getElementById('dynamic-favicon'); + link.id = 'dynamic-favicon'; + link.rel = 'shortcut icon'; + link.href = '/' + response.data.setting.tab_logo_url; + if (oldLink) { + document.head.removeChild(oldLink); + } + document.head.appendChild(link); + } - } else { + handleVisibleChanges = (boll) => { + this.setState({ + visiblemyss: boll, + }) + + } - this.gettablogourlnull(); - } + getAppdata = () => { + try { + var chromesettingArray = JSON.parse(localStorage.getItem('chromesetting')); + var chromesettingresponseArray = JSON.parse(localStorage.getItem('chromesettingresponse')); + // console.log("NewHeaderNewHeaderNewHeader"); + // console.log(chromesettingArray); + // console.log(chromesettingresponseArray); - } else { - this.gettablogourlnull(); + this.setState({ + mygetHelmetapi2: chromesettingArray + }); + if (chromesettingArray.tab_logo_url) { + this.gettablogourldata(chromesettingresponseArray); + } else { + this.gettablogourlnull(); + } + } catch (e) { + console.log("head获取游览器配置失败 重新请求开始读取配置"); + this.geturlsdata(); + } + }; - } + geturlsdata = () => { + let url = "/setting.json"; + axios.get(url).then((response) => { + // console.log("app.js开始请求/setting.json"); + // console.log("获取当前定制信息"); + if (response) { + if (response.data) { + this.setState({ + mygetHelmetapi2: response.data.setting + }); + localStorage.setItem('chromesetting', JSON.stringify(response.data.setting)); + localStorage.setItem('chromesettingresponse', JSON.stringify(response)); + try { + if (response.data.setting.tab_logo_url) { + this.gettablogourldata(response); + } else { + this.gettablogourlnull(); + } + } catch (e) { + this.gettablogourlnull(); + } - }).catch((error) => { - this.gettablogourlnull(); - }); - } + } else { + this.gettablogourlnull(); - matchpaths=(url)=>{ - const {match} = this.props; - if (url=== '/forums'&&match.path === '/forums') { - return true - } else if (url.startsWith('/shixuns')&&match.path.startsWith('/shixuns')) { - return true - }else if (url.startsWith('/paths')&&match.path.startsWith('/paths')) { - return true - } else if (url.startsWith('/courses')&&match.path.startsWith('/courses')) { - return true - }else if (url.startsWith('/competitions')&&match.path.startsWith('/competitions')) { - return true - }else if (url.startsWith('/crowdsourcing')&&match.path.startsWith('/crowdsourcing')) { - return true - }else if(url.startsWith('/moop_cases')&&match.path.startsWith('/moop_cases')){ - return true - }else if(url.startsWith('/developer')&&match.path.startsWith('/developer')){ - return true - }else { - return false } + + } else { + this.gettablogourlnull(); + + } + + }).catch((error) => { + this.gettablogourlnull(); + + }); + } + + + matchpaths = (url) => { + const { match } = this.props; + if (url === '/forums' && match.path === '/forums') { + return true + } else if (url.startsWith('/shixuns') && match.path.startsWith('/shixuns')) { + return true + } else if (url.startsWith('/paths') && match.path.startsWith('/paths')) { + return true + } else if (url.startsWith('/courses') && match.path.startsWith('/courses')) { + return true + } else if (url.startsWith('/competitions') && match.path.startsWith('/competitions')) { + return true + } else if (url.startsWith('/crowdsourcing') && match.path.startsWith('/crowdsourcing')) { + return true + } else if (url.startsWith('/moop_cases') && match.path.startsWith('/moop_cases')) { + return true + } else if (url.startsWith('/developer') && match.path.startsWith('/developer')) { + return true + } else { + return false } + } - // 处理弹框 - setgoshowqqgtounp=(bool)=>{ - this.setState({ - goshowqqgtounp:bool - }) - } + // 处理弹框 + setgoshowqqgtounp = (bool) => { + this.setState({ + goshowqqgtounp: bool + }) + } render() { const isLogin = true; // 这里不会出现未登录的情况,服务端在服务端路由时发现如果是未登录,则跳转到登录页了。 - const {match} = this.props; + const { match } = this.props; - let {Addcoursestypes, + let { Addcoursestypes, tojoinitemtype, tojoinclasstitle, code_notice, checked_notice, - AccountProfiletype, + AccountProfiletype, submitapplications, submitapplicationsvalue, user, isRender, - showSearchOpentype, - headtypesonClickbool, - headtypess, - mygetHelmetapi2, - goshowqqgtounp, - }=this.state; + showSearchOpentype, + headtypesonClickbool, + headtypess, + mygetHelmetapi2, + goshowqqgtounp, + } = this.state; /* 用户名称 用户头像url */ - let activeIndex = false; - let activeForums = false; - let activeShixuns = false; - let activePaths = false; - let coursestype=false; - let activePackages=false; - let activeMoopCases=false; - let activeCompetitions=false; - - if (match.path === '/forums') { - activeForums = true; - } else if (match.path.startsWith('/shixuns')) { - activeShixuns = true; - }else if (match.path.startsWith('/paths')) { - activePaths = true; - } else if (match.path.startsWith('/courses')) { - coursestype = true; - }else if (match.path.startsWith('/crowdsourcing')) { - activePackages = true; - }else if(match.path.startsWith('/moop_cases')){ - activeMoopCases = true; - }else if(match.path.startsWith('/competitions')){ - activeCompetitions = true; - }else { - activeIndex = true; - } - - let headtypes='/'; - - // console.log("mygetHelmetapi2"); - // console.log(mygetHelmetapi2); - if(mygetHelmetapi2) { + let activeIndex = false; + let activeForums = false; + let activeShixuns = false; + let activePaths = false; + let coursestype = false; + let activePackages = false; + let activeMoopCases = false; + let activeCompetitions = false; + + if (match.path === '/forums') { + activeForums = true; + } else if (match.path.startsWith('/shixuns')) { + activeShixuns = true; + } else if (match.path.startsWith('/paths')) { + activePaths = true; + } else if (match.path.startsWith('/courses')) { + coursestype = true; + } else if (match.path.startsWith('/crowdsourcing')) { + activePackages = true; + } else if (match.path.startsWith('/moop_cases')) { + activeMoopCases = true; + } else if (match.path.startsWith('/competitions')) { + activeCompetitions = true; + } else { + activeIndex = true; + } + + let headtypes = '/'; + + // console.log("mygetHelmetapi2"); + // console.log(mygetHelmetapi2); + if (mygetHelmetapi2) { if (mygetHelmetapi2.navbar) { if (mygetHelmetapi2.navbar.length > 0) { // console.log("mygetHelmetapi2.navbar.length>0====-=-=--=-=-=-="); @@ -906,159 +774,159 @@ submittojoinclass=(value)=>{ } // console.log(mygetHelmetapi2); - // console.log("NewHeadermygetHelmetapi123123123123"); - - let shixuntype=false; - let pathstype=false; - let coursestypes=false; - if(this.props&&this.props.mygetHelmetapi!=null){ - let shixun="/shixuns"; - let paths="/paths"; - let courses="/courses"; - this.props.mygetHelmetapi.navbar.map((item,key)=>{ - var reg = RegExp(item.link); - if(shixun.match(reg)){ - if(item.hidden===true){ - shixuntype=true - } - } - if(paths.match(reg)){ - if(item.hidden===true){ - pathstype=true - } - } - if(courses.match(reg)){ - if(item.hidden===true){ - coursestypes=true - } - } - }) - } - - const contents = ( -
-

试题库

-

-

试卷库

- -
- ); - - // console.log("头部"); - // console.log(this.props); - //判断平台身份 - let Periofters=false; - if(this.props){ - if(this.props.current_user){ - if(this.props.current_user.admin){ - Periofters=true; - } - else if(this.props.current_user.business){ - Periofters=true; - } - else if(this.props.current_user.is_teacher){ - Periofters=true; - }else if(this.props.current_user.user_identity !=="学生") { - Periofters=true; - } - } - } - - - return ( + // console.log("NewHeadermygetHelmetapi123123123123"); + + let shixuntype = false; + let pathstype = false; + let coursestypes = false; + if (this.props && this.props.mygetHelmetapi != null) { + let shixun = "/shixuns"; + let paths = "/paths"; + let courses = "/courses"; + this.props.mygetHelmetapi.navbar.map((item, key) => { + var reg = RegExp(item.link); + if (shixun.match(reg)) { + if (item.hidden === true) { + shixuntype = true + } + } + if (paths.match(reg)) { + if (item.hidden === true) { + pathstype = true + } + } + if (courses.match(reg)) { + if (item.hidden === true) { + coursestypes = true + } + } + }) + } + + const contents = ( +
+

试题库

+

+

试卷库

+ +
+ ); + + // console.log("头部"); + // console.log(this.props); + //判断平台身份 + let Periofters = false; + if (this.props) { + if (this.props.current_user) { + if (this.props.current_user.admin) { + Periofters = true; + } + else if (this.props.current_user.business) { + Periofters = true; + } + else if (this.props.current_user.is_teacher) { + Periofters = true; + } else if (this.props.current_user.user_identity !== "学生") { + Periofters = true; + } + } + } + + + return (
- - - {isRender===true?this.Modifyloginvalue()} - {...this.props} - {...this.state} - />:""} - - {AccountProfiletype===true?this.hideAccountProfile()} - {...this.props} - {...this.state} - />:""} - - { - goshowqqgtounp===true? - this.setgoshowqqgtounp(bool)}> - : - "" - } - - this.headtypesonClick("/",false)} className={"fl mr30 ml25 mt10"}> + } + + {isRender === true ? this.Modifyloginvalue()} + {...this.props} + {...this.state} + /> : ""} + + {AccountProfiletype === true ? this.hideAccountProfile()} + {...this.props} + {...this.state} + /> : ""} + + { + goshowqqgtounp === true ? + this.setgoshowqqgtounp(bool)}> + : + "" + } + + this.headtypesonClick("/", false)} className={"fl mr30 ml25 mt10"}> { - mygetHelmetapi2 === null ? - "" - : - mygetHelmetapi2===undefined||mygetHelmetapi2.nav_logo_url===null||mygetHelmetapi2.nav_logo_url===undefined? - 高校智能化教学与实训平台 - : - 高校智能化教学与实训平台 + mygetHelmetapi2 === null ? + "" + : + mygetHelmetapi2 === undefined || mygetHelmetapi2.nav_logo_url === null || mygetHelmetapi2.nav_logo_url === undefined ? + 高校智能化教学与实训平台 + : + 高校智能化教学与实训平台 } - + - - { - mygetHelmetapi2 === null ? - "" : - mygetHelmetapi2!==undefined&&mygetHelmetapi2.navbar!==null&&mygetHelmetapi2.navbar!==undefined&&mygetHelmetapi2.navbar.length>0? -
-
    - {/*
  • 首页
  • */} - {/*
  • 实训路径
  • */} - { - mygetHelmetapi2.navbar && mygetHelmetapi2.navbar.map((item,key)=>{ - // console.log("headtypes"); - // console.log(headtypes);hidden - var str=new RegExp("http"); - var strbool=false; - //test方法返回值为(true或者false) - if(item.link){ - if(str.test(item.link)===true){ - strbool=true - }else{ - strbool=false - } - } - // console.log(item.hidden); - return( -
  • this.headtypesonClick(item.link,true)} className={`${this.matchpaths(item.link)===true?'pr active':'pr'}`} style={item.hidden==false?{display: 'block'}:{display: 'none'}}> - { - strbool===true? - {item.name} - : - {item.name} - } -
  • - ) - }) - } - + { + mygetHelmetapi2 === null ? + "" : + mygetHelmetapi2 !== undefined && mygetHelmetapi2.navbar !== null && mygetHelmetapi2.navbar !== undefined && mygetHelmetapi2.navbar.length > 0 ? +
    +
      + {/*
    • 首页
    • */} + {/*
    • 实训路径
    • */} + { + mygetHelmetapi2.navbar && mygetHelmetapi2.navbar.map((item, key) => { + // console.log("headtypes"); + // console.log(headtypes);hidden + var str = new RegExp("http"); + var strbool = false; + //test方法返回值为(true或者false) + if (item.link) { + if (str.test(item.link) === true) { + strbool = true + } else { + strbool = false + } + } + // console.log(item.hidden); + return ( +
    • this.headtypesonClick(item.link, true)} className={`${this.matchpaths(item.link) === true ? 'pr active' : 'pr'}`} style={item.hidden == false ? { display: 'block' } : { display: 'none' }}> + { + strbool === true ? + {item.name} + : + {item.name} + } +
    • + ) + }) + } + - {/*{*/} - {/* Periofters===true?*/} - {/*
    • */} - {/* */} - {/*
      */} - {/*
      */} - {/* 题库*/} - {/*
      */} - {/*
      */} - {/*
      */} - {/*
    • */} - {/* :""*/} - {/*}*/} - - -
    • 工程认证
    • - -
    • 0 ? 'block' : 'none'}}> - 职业路径 -
      0 ? 'block' : 'none'}}> -
        - {this.props.Headertop === undefined ? "" : this.props.Headertop.career_url.map((item, key) => { - return( -
      • {item.name}
      • - ) - }) - } -
      -
      -
    • -
    -
    - : -
    - -
      - {/*
    • 首页
    • */} - - {/*
    • 实训路径
    • */} -
    • - 实践课程 -
    • - - {/*
    • 课堂
    • */} -
    • - {/*课堂*/} - 教学课堂 -
    • -
    • - 实训项目 - {/**/} - {/**/} -
    • - -
    • 0 ? 'block' : 'none'}}> - 职业路径 -
      0 ? 'block' : 'none'}}> -
        - {this.props.Headertop === undefined ? "" : this.props.Headertop.career_url.map((item, key) => { - return( -
      • {item.name}
      • - ) - }) - } -
      -
      -
    • - - {/*
    • 教学案例
    • */} -
    • - 在线竞赛 - {/**/} -
    • -
    • 教学案例
    • - {/*
    • */} - {/*众包创新*/} - {/*
    • */} -
    • 交流问答
    • -
    • 工程认证
    • -
    -
    - } - - - - - - - + {/*{*/} + {/* Periofters===true?*/} + {/*
  • */} + {/* */} + {/*
    */} + {/*
    */} + {/* 题库*/} + {/*
    */} + {/*
    */} + {/*
    */} + {/*
  • */} + {/* :""*/} + {/*}*/} + + +
  • 工程认证
  • + +
  • 0 ? 'block' : 'none' }}> + 职业路径 +
    0 ? 'block' : 'none' }}> +
      + {this.props.Headertop === undefined ? "" : this.props.Headertop.career_url.map((item, key) => { + return ( +
    • {item.name}
    • + ) + }) + } +
    +
    +
  • +
+
+ : +
+ +
    + {/*
  • 首页
  • */} + + {/*
  • 实训路径
  • */} +
  • + 实践课程 +
  • + + {/*
  • 课堂
  • */} +
  • + {/*课堂*/} + 教学课堂 +
  • +
  • + 实训项目 + {/**/} + {/**/} +
  • + +
  • 0 ? 'block' : 'none' }}> + 职业路径 +
    0 ? 'block' : 'none' }}> +
      + {this.props.Headertop === undefined ? "" : this.props.Headertop.career_url.map((item, key) => { + return ( +
    • {item.name}
    • + ) + }) + } +
    +
    +
  • + + {/*
  • 教学案例
  • */} +
  • + 在线竞赛 + {/**/} +
  • +
  • 教学案例
  • + {/*
  • */} + {/*众包创新*/} + {/*
  • */} +
  • 交流问答
  • +
  • 工程认证
  • +
+
+ } + + + + + + + -
-
- {/**/} -
- - 实训 - - -
- {/**/} - {/*搜索框*/} - {showSearchOpentype===true?
this.hideshowSearchOpen(e)} onMouseLeave={()=>this.setevaluatinghides()}> - this.onKeywordSearchKeyDowns()} - onSearch={(value) => this.onKeywordSearchKeyDown(value)} - // onPressEnter={this.onKeywordSearchKeyDown} - style={{ width: 300,height:32}} - autoFocus={true} - /> -
:""} - - {/**/} - {/*/!**!/*/} - {/**/} - - {/**/} - {/* TODO 需要服务端接口提供最近搜索 + } + +
+
+ {/**/} +
+ + 实训 + + +
+ {/**/} + {/*搜索框*/} + {showSearchOpentype === true ?
this.hideshowSearchOpen(e)} onMouseLeave={() => this.setevaluatinghides()}> + this.onKeywordSearchKeyDowns()} + onSearch={(value) => this.onKeywordSearchKeyDown(value)} + // onPressEnter={this.onKeywordSearchKeyDown} + style={{ width: 300, height: 32 }} + autoFocus={true} + /> +
: ""} + + {/**/} + {/*/!**!/*/} + {/**/} + + {/**/} + {/* TODO 需要服务端接口提供最近搜索
最近搜索
*/} -
-
+
+
- {/* + {/* <%= link_to '登录', signin_path, :className => "mr5" %> <%= link_to '注册', user_join_path, :className => "ml5" %> */} - { user===undefined? - - this.educoderlogin()} className="mr5 color-white">登录 - - 注册 - :user.login===""? - this.educoderlogin()} className="mr5 color-white">登录 - - 注册 - : -
- + {user === undefined ? + + this.educoderlogin()} className="mr5 color-white">登录 + + 注册 + : user.login === "" ? + this.educoderlogin()} className="mr5 color-white">登录 + + 注册 + : +
+ + src={getImageUrl(`images/` + user.image_url)} width="34"> -
    +
      {/*{user.username}*/} -
    • 我的个人主页
    • - {coursestypes===true?"":
    • {this.props.user&&this.props.user.main_site===false?"我的课堂":"我的教学课堂"}
    • } +
    • 我的个人主页
    • + {coursestypes === true ? "" :
    • {this.props.user && this.props.user.main_site === false ? "我的课堂" : "我的教学课堂"}
    • } {/* p 老师 l 学生 */} - {shixuntype===true?"":
    • 我的实训项目
    • } - {pathstype===true?"":
    • {this.props.user&&this.props.user.main_site===false?"我的课程":"我的实践课程"}
    • } - {this.props.user&&this.props.user.main_site===true?
    • 我的开发项目
    • :""} - { Periofters === true &&
    • 我的试题库
    • } - { Periofters === true &&
    • 我的试卷库
    • } - {/*
    • 我的众包
    • */} -
    • - 客户管理 -
    • + {shixuntype === true ? "" :
    • 我的实训项目
    • } + {pathstype === true ? "" :
    • {this.props.user && this.props.user.main_site === false ? "我的课程" : "我的实践课程"}
    • } + {this.props.user && this.props.user.main_site === true ?
    • 我的开发项目
    • : ""} + {Periofters === true &&
    • 我的试题库
    • } + {Periofters === true &&
    • 我的试卷库
    • } + {/*
    • 我的众包
    • */} +
    • + 客户管理 +
    • { this.props.Headertop && this.props.Headertop.college_identifier &&
    • 学院统计
    • @@ -1288,159 +1156,157 @@ submittojoinclass=(value)=>{ {/*
    • this.trialapplications()} >试用申请
    • */} {/*
    • 兴趣页
    • */} -
    • +
    • - {/*this.educoderlogin()} >登录*/} - this.educoderloginysl()}>退出 + {/*this.educoderlogin()} >登录*/} + this.educoderloginysl()}>退出
- } - {/*href="https://www.educoder.net/login"*/} -
- {/*{ loadHeader()}*/} - {showSearchOpentype===true?"":this.props.user&&this.props.user.main_site===true?this.showSearchOpen(e)}> - {/*"/images/educoder/icon/search.svg" + } + {/*href="https://www.educoder.net/login"*/} + */} -
+ {/*
*/} +
- + -
-
- - {coursestypes===true&&this.props.user&&this.props.user.main_site===false?"":
+ : ""} + }
+
- {this.props.user&&this.props.user.main_site===true?
- { user===undefined?"":user.login===""?"": - - - {/*{this.props.Headertop===undefined?"":this.props.Headertop.unread_message_count > 99 ? '99+'*/} - {/*: this.props.Headertop===undefined?"":this.props.Headertop.unread_message_count}*/} - - - } + {this.props.user && this.props.user.main_site === true ?
+ {user === undefined ? "" : user.login === "" ? "" : + + + + + } -
:""} +
: ""} + + +
+
+
    +
    +

    + {submitapplicationsvalue} +

    +
    +
  • + 取消 + 确定 +
  • - -
    -
    -
      -
      -

      - {submitapplicationsvalue} -

      -
      -
    • - 取消 - 确定 -
    • - -
    -
    +
- +
+
-
+
diff --git a/public/react/src/modules/tpm/shixuns/shixun-keyword-list.scss b/public/react/src/modules/tpm/shixuns/shixun-keyword-list.scss index d3ecd2008..c8a62bdd8 100644 --- a/public/react/src/modules/tpm/shixuns/shixun-keyword-list.scss +++ b/public/react/src/modules/tpm/shixuns/shixun-keyword-list.scss @@ -65,6 +65,14 @@ position: absolute; width: 40px; right: 39px; - top: 76px; + top: 77px; + z-index: 10; +} + +.btn-join { + position: absolute; + width: 40px; + right: 39px; + top: 133px; z-index: 10; } \ No newline at end of file