forked from Gitlink/forgeplus-react
style 代码清理
This commit is contained in:
parent
040ab7b5e2
commit
5f35b8dc91
|
@ -3506,7 +3506,7 @@ a.user_bluebg_btn {
|
||||||
color: #05101A;
|
color: #05101A;
|
||||||
float: left;
|
float: left;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
border: 1px solid #fff;
|
border: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.white-panel li a {
|
.white-panel li a {
|
||||||
|
|
|
@ -4,7 +4,6 @@ import { Dropdown , Menu , Icon , Tooltip } from 'antd';
|
||||||
import { truncateCommitId } from '../common/util';
|
import { truncateCommitId } from '../common/util';
|
||||||
|
|
||||||
import './list.css'
|
import './list.css'
|
||||||
import { branch } from 'recompose';
|
|
||||||
import Top from './DetailTop';
|
import Top from './DetailTop';
|
||||||
|
|
||||||
class CoderRootBranch extends Component {
|
class CoderRootBranch extends Component {
|
||||||
|
@ -16,32 +15,27 @@ class CoderRootBranch extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
render(){
|
render(){
|
||||||
const { branchList, projectDetail } = this.props;
|
const { branchList } = this.props;
|
||||||
const { projectsId } = this.props.match.params;
|
const { projectsId } = this.props.match.params;
|
||||||
const list =()=>{
|
const list =()=>{
|
||||||
if(branchList && branchList.length>0){
|
if(branchList && branchList.length>0){
|
||||||
return(
|
return(
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
|
|
||||||
|
|
||||||
<ul className="branchUl">
|
<ul className="branchUl">
|
||||||
{
|
{
|
||||||
branchList.map((item,key)=>{
|
branchList.map((item,key)=>{
|
||||||
return(
|
return(
|
||||||
<li>
|
<li key={key}>
|
||||||
<div>
|
<div>
|
||||||
<Link to={`/projects/${projectsId}/coders?branch=${item.name}`} className="color-blue font-15" style={{"maxWidth":"100px"}}>{item.name}</Link>
|
<Link to={`/projects/${projectsId}/coders?branch=${item.name}`} className="color-blue font-15" style={{"maxWidth":"100px"}}>{item.name}</Link>
|
||||||
{/*<span className="color-blue font-15">{item.name}</span>*/}
|
|
||||||
<p className="f-wrap-alignCenter">
|
<p className="f-wrap-alignCenter">
|
||||||
<span className="mr5 color-blue">{item.last_commit && truncateCommitId(item.last_commit.id)}</span>
|
<span className="mr5 color-blue">{item.last_commit && truncateCommitId(item.last_commit.id)}</span>
|
||||||
{/*<Link to="javascript:void(0)" className="mr5 color-blue" >{item.last_commit && item.last_commit.id}</Link>*/}
|
|
||||||
<span className="color-grey-9 hide-1 messages leftPoint">{item.last_commit && item.last_commit.message}</span>
|
<span className="color-grey-9 hide-1 messages leftPoint">{item.last_commit && item.last_commit.message}</span>
|
||||||
<span className="color-grey-6 leftPoint">最后更新于{item.last_commit && item.last_commit.time_from_now}</span>
|
<span className="color-grey-6 leftPoint">最后更新于{item.last_commit && item.last_commit.time_from_now}</span>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<span>
|
<span>
|
||||||
<Link to={`/projects/${projectsId}/merge/new`} className="mr20 operationBtn">创建合并请求</Link>
|
<Link to={`/projects/${projectsId}/merge/new`} className="mr20 operationBtn">创建合并请求</Link>
|
||||||
|
|
||||||
<Dropdown overlay={menu(item.zip_url,item.tar_url)} trigger={['click']} placement="bottomRight" className="operationBtn">
|
<Dropdown overlay={menu(item.zip_url,item.tar_url)} trigger={['click']} placement="bottomRight" className="operationBtn">
|
||||||
<a className="ant-dropdown-link">
|
<a className="ant-dropdown-link">
|
||||||
<Tooltip title={`下载分支${item.name}`}><Icon type="cloud-download" className="font-18"/></Tooltip>
|
<Tooltip title={`下载分支${item.name}`}><Icon type="cloud-download" className="font-18"/></Tooltip>
|
||||||
|
@ -59,8 +53,8 @@ class CoderRootBranch extends Component {
|
||||||
}
|
}
|
||||||
const menu =(zip_url,tar_url)=> (
|
const menu =(zip_url,tar_url)=> (
|
||||||
<Menu>
|
<Menu>
|
||||||
<Menu.Item><a href={zip_url}>ZIP</a></Menu.Item>
|
<Menu.Item key={'0'}><a href={zip_url}>ZIP</a></Menu.Item>
|
||||||
<Menu.Item><a href={tar_url}>TAR.GZ</a></Menu.Item>
|
<Menu.Item key={'1'}><a href={tar_url}>TAR.GZ</a></Menu.Item>
|
||||||
</Menu>
|
</Menu>
|
||||||
)
|
)
|
||||||
return(
|
return(
|
||||||
|
|
|
@ -89,9 +89,8 @@ class CoderRootCommit extends Component{
|
||||||
<span className="f-wrap-alignCenter">
|
<span className="f-wrap-alignCenter">
|
||||||
<Link to={`/users/${item.login}/projects`} className="show-user-link">
|
<Link to={`/users/${item.login}/projects`} className="show-user-link">
|
||||||
<img src={getImageUrl(`images/${item.image_url}`)} alt="" width="28px" height="28px" className="mr3 radius"/>
|
<img src={getImageUrl(`images/${item.image_url}`)} alt="" width="28px" height="28px" className="mr3 radius"/>
|
||||||
<label className="hide-1" style={{maxWidth:"75px",'vertical-align':'middle'}}>{text}</label>
|
<label className="hide-1" style={{maxWidth:"75px",'verticalAlign':'middle'}}>{text}</label>
|
||||||
</Link>
|
</Link>
|
||||||
|
|
||||||
</span>
|
</span>
|
||||||
),
|
),
|
||||||
},{
|
},{
|
||||||
|
@ -119,11 +118,6 @@ class CoderRootCommit extends Component{
|
||||||
return(
|
return(
|
||||||
<div className="f-wrap-between" style={{alignItems:"center"}}>
|
<div className="f-wrap-between" style={{alignItems:"center"}}>
|
||||||
<span className="font-16">{dataCount}次提交代码({branch})</span>
|
<span className="font-16">{dataCount}次提交代码({branch})</span>
|
||||||
{/* <div className="f-wrap-alignCenter">
|
|
||||||
<Input placeholder="搜索提交历史" style={{width:"300px"}}/>
|
|
||||||
<Checkbox className="ml15">所有分支</Checkbox>
|
|
||||||
<a className="btn_32 ml15">搜索</a>
|
|
||||||
</div> */}
|
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -218,7 +218,6 @@ class MessageCount extends Component{
|
||||||
|
|
||||||
//修改评论
|
//修改评论
|
||||||
updatedetail=(id)=>{
|
updatedetail=(id)=>{
|
||||||
// console.log("updtedetail", this.state)
|
|
||||||
this.setState({
|
this.setState({
|
||||||
edit_spin: true
|
edit_spin: true
|
||||||
})
|
})
|
||||||
|
@ -339,13 +338,11 @@ class MessageCount extends Component{
|
||||||
<div>
|
<div>
|
||||||
<span>没有评论~</span>
|
<span>没有评论~</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
handleSubmit=()=>{
|
handleSubmit=()=>{
|
||||||
const { fileList } = this.state;
|
|
||||||
this.props.form.validateFieldsAndScroll((err, values) => {
|
this.props.form.validateFieldsAndScroll((err, values) => {
|
||||||
if(!err){
|
if(!err){
|
||||||
const { projectsId , mergeId } = this.props.match.params;
|
const { projectsId , mergeId } = this.props.match.params;
|
||||||
|
@ -354,7 +351,7 @@ class MessageCount extends Component{
|
||||||
if(values.issue_tag_ids===''){
|
if(values.issue_tag_ids===''){
|
||||||
values.issue_tag_ids = []
|
values.issue_tag_ids = []
|
||||||
}else{
|
}else{
|
||||||
values.issue_tag_ids = [parseInt(values.issue_tag_ids)]
|
values.issue_tag_ids = [parseInt(values.issue_tag_ids,0)]
|
||||||
}
|
}
|
||||||
|
|
||||||
if(values.assigned_to_id===0){
|
if(values.assigned_to_id===0){
|
||||||
|
|
|
@ -1,51 +1,23 @@
|
||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import { BrowserRouter as Router, Route, Link } from "react-router-dom";
|
import { Link } from "react-router-dom";
|
||||||
import { Redirect } from 'react-router';
|
|
||||||
import AccountProfile from"../user/AccountProfile";
|
import AccountProfile from"../user/AccountProfile";
|
||||||
import PropTypes from 'prop-types';
|
import { getImageUrl } from 'educoder'
|
||||||
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 axios from 'axios';
|
import axios from 'axios';
|
||||||
|
import { Modal , Input , message , notification } from 'antd';
|
||||||
import { Modal,Checkbox ,Radio,Input,message,notification,Popover} from 'antd';
|
|
||||||
|
|
||||||
import Addcourses from '../courses/coursesPublic/Addcourses';
|
|
||||||
|
|
||||||
import LoginDialog from '../login/LoginDialog';
|
import LoginDialog from '../login/LoginDialog';
|
||||||
|
|
||||||
import Trialapplication from '../login/Trialapplication';
|
|
||||||
|
|
||||||
import GotoQQgroup from '../../modal/GotoQQgroup'
|
import GotoQQgroup from '../../modal/GotoQQgroup'
|
||||||
|
|
||||||
import 'antd/lib/modal/style/index.css';
|
import 'antd/lib/modal/style/index.css';
|
||||||
|
|
||||||
import 'antd/lib/checkbox/style/index.css';
|
import 'antd/lib/checkbox/style/index.css';
|
||||||
|
|
||||||
import 'antd/lib/radio/style/index.css';
|
import 'antd/lib/radio/style/index.css';
|
||||||
|
|
||||||
import 'antd/lib/input/style/index.css';
|
import 'antd/lib/input/style/index.css';
|
||||||
|
|
||||||
import './TPMIndex.css';
|
import './TPMIndex.css';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const $ = window.$
|
const $ = window.$
|
||||||
// TODO 这部分脚本从公共脚本中直接调用
|
// TODO 这部分脚本从公共脚本中直接调用
|
||||||
|
|
||||||
const RadioGroup = Radio.Group;
|
|
||||||
const { Search } = Input;
|
const { Search } = Input;
|
||||||
let old_url;
|
let old_url;
|
||||||
|
|
||||||
/*
|
|
||||||
_logined_header.html.erb
|
|
||||||
_unlogin_header.html.erb
|
|
||||||
*/
|
|
||||||
window._header_componentHandler = null;
|
window._header_componentHandler = null;
|
||||||
class NewHeader extends Component {
|
class NewHeader extends Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
|
@ -91,7 +63,7 @@ class NewHeader extends Component {
|
||||||
var hoveredPanel;
|
var hoveredPanel;
|
||||||
$(".edu-menu-panel").hover(function(){
|
$(".edu-menu-panel").hover(function(){
|
||||||
if (hoverTimeout) { // 一次只显示一个panel
|
if (hoverTimeout) { // 一次只显示一个panel
|
||||||
if (hoveredPanel && hoveredPanel != this) {
|
if (hoveredPanel && hoveredPanel !== this) {
|
||||||
$(hoveredPanel).find(".edu-menu-list").hide()
|
$(hoveredPanel).find(".edu-menu-list").hide()
|
||||||
}
|
}
|
||||||
clearTimeout(hoverTimeout);
|
clearTimeout(hoverTimeout);
|
||||||
|
@ -114,44 +86,6 @@ class NewHeader extends Component {
|
||||||
} catch (e) {
|
} 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) => {
|
|
||||||
//
|
|
||||||
// });
|
|
||||||
}
|
|
||||||
|
|
||||||
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) => {
|
openNotification = (messge) => {
|
||||||
|
@ -166,14 +100,14 @@ class NewHeader extends Component {
|
||||||
this.setState({
|
this.setState({
|
||||||
user:newProps.user
|
user:newProps.user
|
||||||
})
|
})
|
||||||
if(newProps.Headertop!=undefined){
|
if(newProps.Headertop!==undefined){
|
||||||
old_url=newProps.Headertop.old_url
|
old_url=newProps.Headertop.old_url
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
getCookie=(key)=>{
|
getCookie=(key)=>{
|
||||||
var arr,reg = RegExp('(^| )'+key+'=([^;]+)(;|$)');
|
var arr,reg = RegExp('(^| )'+key+'=([^;]+)(;|$)');
|
||||||
if (arr = document.cookie.match(reg)) //["username=liuwei;", "", "liuwei", ";"]
|
if (arr === document.cookie.match(reg))
|
||||||
return decodeURIComponent(arr[2]);
|
return decodeURIComponent(arr[2]);
|
||||||
else
|
else
|
||||||
return null;
|
return null;
|
||||||
|
@ -197,9 +131,6 @@ class NewHeader extends Component {
|
||||||
this.setState({
|
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('退出成功');
|
message.success('退出成功');
|
||||||
}
|
}
|
||||||
|
@ -234,7 +165,7 @@ class NewHeader extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
tojoinitem=()=>{
|
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===""){
|
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("请先绑定邮箱,谢谢");
|
this.openNotification("请先绑定邮箱,谢谢");
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -302,11 +233,11 @@ class NewHeader extends Component {
|
||||||
RadioGroupvalue:undefined
|
RadioGroupvalue:undefined
|
||||||
})
|
})
|
||||||
if(submitapplicationssum===0){
|
if(submitapplicationssum===0){
|
||||||
if(submitapplicationsvaluedata!=undefined){
|
if(submitapplicationsvaluedata!==undefined){
|
||||||
window.location.href = "/courses/"+submitapplicationsvaluedata;
|
window.location.href = "/courses/"+submitapplicationsvaluedata;
|
||||||
}
|
}
|
||||||
}else if(submitapplicationssum===1){
|
}else if(submitapplicationssum===1){
|
||||||
if(submitapplicationsvaluedata!=undefined){
|
if(submitapplicationsvaluedata!==undefined){
|
||||||
window.location.href = "/projects/"+submitapplicationsvaluedata;
|
window.location.href = "/projects/"+submitapplicationsvaluedata;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -334,38 +265,12 @@ class NewHeader extends Component {
|
||||||
this.setState({
|
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=()=>{
|
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'
|
|
||||||
var url = `/accounts/logout.json`;
|
var url = `/accounts/logout.json`;
|
||||||
// let storage=window.localStorage;
|
|
||||||
axios.get((url)).then((result) => {
|
axios.get((url)).then((result) => {
|
||||||
// storage.removeItem(newTPMsettings);
|
|
||||||
// storage.removeItem(shixunopenprocess);
|
|
||||||
// storage.removeItem( openopenpublictype);
|
|
||||||
if(result!==undefined){
|
if(result!==undefined){
|
||||||
// this.setState({
|
|
||||||
// isRender:true
|
|
||||||
// })
|
|
||||||
// broadcastChannelPostMessage('refreshPage')
|
|
||||||
window.location.href = "/";
|
window.location.href = "/";
|
||||||
}
|
}
|
||||||
}).catch((error) => {
|
}).catch((error) => {
|
||||||
|
@ -420,21 +325,12 @@ submittojoinclass=(value)=>{
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
let newrolearr=rolearr;
|
let newrolearr=rolearr;
|
||||||
// if(value===1){
|
|
||||||
if(tojoinclasstitle.length<6){
|
if(tojoinclasstitle.length<6){
|
||||||
this.setState({
|
this.setState({
|
||||||
code_notice:true
|
code_notice:true
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
// }else if(value===0){
|
|
||||||
// if(tojoinclasstitle.length<5){
|
|
||||||
// this.setState({
|
|
||||||
// code_notice:true
|
|
||||||
// })
|
|
||||||
// return
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
if(tojoinclasstitle===""||tojoinclasstitle===undefined){
|
if(tojoinclasstitle===""||tojoinclasstitle===undefined){
|
||||||
this.setState({
|
this.setState({
|
||||||
code_notice:true
|
code_notice:true
|
||||||
|
@ -469,59 +365,8 @@ submittojoinclass=(value)=>{
|
||||||
})
|
})
|
||||||
return
|
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){
|
if(value===1){
|
||||||
let url="/project_applies.json"
|
let url="/project_applies.json";
|
||||||
// const form = new FormData();
|
|
||||||
// form.append('code', tojoinclasstitle);
|
|
||||||
// form.append('role', RadioGroupvalue);
|
|
||||||
// form.append('type', 1);
|
|
||||||
axios.post(url,{
|
axios.post(url,{
|
||||||
code:tojoinclasstitle,
|
code:tojoinclasstitle,
|
||||||
role:RadioGroupvalue
|
role:RadioGroupvalue
|
||||||
|
@ -551,15 +396,6 @@ submittojoinclass=(value)=>{
|
||||||
}
|
}
|
||||||
this.hidetojoinclass()
|
this.hidetojoinclass()
|
||||||
}
|
}
|
||||||
|
|
||||||
// trialapplications =()=>{
|
|
||||||
// console.log("点击了")
|
|
||||||
// this.setState({
|
|
||||||
// isRenders: true,
|
|
||||||
// showTrial:true,
|
|
||||||
// })
|
|
||||||
// }
|
|
||||||
|
|
||||||
// 关闭
|
// 关闭
|
||||||
cancelModulationModels = () => {
|
cancelModulationModels = () => {
|
||||||
this.setState({isRenders: false})
|
this.setState({isRenders: false})
|
||||||
|
@ -616,15 +452,12 @@ submittojoinclass=(value)=>{
|
||||||
}
|
}
|
||||||
//头部获取是否已经登录了
|
//头部获取是否已经登录了
|
||||||
getUser=(url,type)=>{
|
getUser=(url,type)=>{
|
||||||
|
|
||||||
if(type==="projects"){
|
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===""){
|
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("请先绑定邮箱,谢谢");
|
this.openNotification("请先绑定邮箱,谢谢");
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// console.log("点击了503")
|
|
||||||
// console.log(url);
|
|
||||||
let{user} =this.state;
|
let{user} =this.state;
|
||||||
|
|
||||||
if(user===undefined){
|
if(user===undefined){
|
||||||
|
@ -633,7 +466,6 @@ submittojoinclass=(value)=>{
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if(user&&user.login===""){
|
if(user&&user.login===""){
|
||||||
this.setState({
|
this.setState({
|
||||||
isRender:true
|
isRender:true
|
||||||
|
@ -647,25 +479,15 @@ submittojoinclass=(value)=>{
|
||||||
})
|
})
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if(type==="newshixuns"){
|
||||||
|
if(this.props&&this.props.current_user&&this.props.current_user.is_shixun_marker===false){
|
||||||
if(type==="newshixuns"){
|
this.setgoshowqqgtounp(true);
|
||||||
if(this.props&&this.props.current_user&&this.props.current_user.is_shixun_marker===false){
|
return;
|
||||||
this.setgoshowqqgtounp(true);
|
}
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(url !== undefined || url!==""){
|
if(url !== undefined || url!==""){
|
||||||
window.location.href = url;
|
window.location.href = url;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//修改登录方法
|
//修改登录方法
|
||||||
|
@ -691,7 +513,6 @@ submittojoinclass=(value)=>{
|
||||||
this.setState({
|
this.setState({
|
||||||
mygetHelmetapi2: undefined
|
mygetHelmetapi2: undefined
|
||||||
});
|
});
|
||||||
// document.title = "Forge";
|
|
||||||
var link = document.createElement('link'),
|
var link = document.createElement('link'),
|
||||||
oldLink = document.getElementById('dynamic-favicon');
|
oldLink = document.getElementById('dynamic-favicon');
|
||||||
link.id = 'dynamic-favicon';
|
link.id = 'dynamic-favicon';
|
||||||
|
@ -739,7 +560,6 @@ submittojoinclass=(value)=>{
|
||||||
this.gettablogourlnull();
|
this.gettablogourlnull();
|
||||||
}
|
}
|
||||||
}catch (e) {
|
}catch (e) {
|
||||||
// console.log("head获取游览器配置失败 重新请求开始读取配置");
|
|
||||||
this.geturlsdata();
|
this.geturlsdata();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -747,8 +567,6 @@ submittojoinclass=(value)=>{
|
||||||
geturlsdata=()=>{
|
geturlsdata=()=>{
|
||||||
let url = "/setting.json";
|
let url = "/setting.json";
|
||||||
axios.get(url).then((response) => {
|
axios.get(url).then((response) => {
|
||||||
// console.log("app.js开始请求/setting.json");
|
|
||||||
// console.log("获取当前定制信息");
|
|
||||||
if(response){
|
if(response){
|
||||||
if(response.data){
|
if(response.data){
|
||||||
this.setState({
|
this.setState({
|
||||||
|
@ -802,25 +620,6 @@ submittojoinclass=(value)=>{
|
||||||
} else {
|
} else {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
// 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
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1137,7 +936,6 @@ submittojoinclass=(value)=>{
|
||||||
placeholder="实践课程/翻转课堂/实训项目/交流问答"
|
placeholder="实践课程/翻转课堂/实训项目/交流问答"
|
||||||
onInput={()=>this.onKeywordSearchKeyDowns()}
|
onInput={()=>this.onKeywordSearchKeyDowns()}
|
||||||
onSearch={(value) => this.onKeywordSearchKeyDown(value)}
|
onSearch={(value) => this.onKeywordSearchKeyDown(value)}
|
||||||
// onPressEnter={this.onKeywordSearchKeyDown}
|
|
||||||
style={{ width: 300,height:32}}
|
style={{ width: 300,height:32}}
|
||||||
autoFocus={true}
|
autoFocus={true}
|
||||||
/>
|
/>
|
||||||
|
@ -1164,7 +962,7 @@ submittojoinclass=(value)=>{
|
||||||
src={getImageUrl(`images/`+user.image_url)} width="34">
|
src={getImageUrl(`images/`+user.image_url)} width="34">
|
||||||
</img>
|
</img>
|
||||||
</a>
|
</a>
|
||||||
<ul className="edu-menu-list" style={{top:'60px', 'text-align': 'center'}}>
|
<ul className="edu-menu-list" style={{top:'60px', 'textAlign': 'center'}}>
|
||||||
{
|
{
|
||||||
mygetHelmetapi2 && mygetHelmetapi2.new_course && mygetHelmetapi2.new_course.edit_account &&
|
mygetHelmetapi2 && mygetHelmetapi2.new_course && mygetHelmetapi2.new_course.edit_account &&
|
||||||
<li><a href={`${mygetHelmetapi2.new_course.edit_account}`} target="_blank">修改资料</a></li>
|
<li><a href={`${mygetHelmetapi2.new_course.edit_account}`} target="_blank">修改资料</a></li>
|
||||||
|
@ -1173,10 +971,6 @@ submittojoinclass=(value)=>{
|
||||||
mygetHelmetapi2 && mygetHelmetapi2.new_course && mygetHelmetapi2.new_course.my_courses &&
|
mygetHelmetapi2 && mygetHelmetapi2.new_course && mygetHelmetapi2.new_course.my_courses &&
|
||||||
<li><a href={`${mygetHelmetapi2.new_course.my_courses}`} target="_blank">我的课程</a></li>
|
<li><a href={`${mygetHelmetapi2.new_course.my_courses}`} target="_blank">我的课程</a></li>
|
||||||
}
|
}
|
||||||
{/*{*/}
|
|
||||||
{/*mygetHelmetapi2 && mygetHelmetapi2.new_course && mygetHelmetapi2.new_course.my_projects &&*/}
|
|
||||||
{/*<li><a href={`${mygetHelmetapi2.new_course.my_projects}`} target="_blank">我的项目</a></li>*/}
|
|
||||||
{/*}*/}
|
|
||||||
{
|
{
|
||||||
mygetHelmetapi2 && mygetHelmetapi2.new_course && mygetHelmetapi2.new_course.my_projects &&
|
mygetHelmetapi2 && mygetHelmetapi2.new_course && mygetHelmetapi2.new_course.my_projects &&
|
||||||
<li><Link to={`/users/${this.props.current_user.login}/projects`} >我的项目</Link></li>
|
<li><Link to={`/users/${this.props.current_user.login}/projects`} >我的项目</Link></li>
|
||||||
|
@ -1246,7 +1040,7 @@ submittojoinclass=(value)=>{
|
||||||
closable={false}
|
closable={false}
|
||||||
footer={null}
|
footer={null}
|
||||||
>
|
>
|
||||||
<div className="task_popup_con ml30">
|
<div className="task_popup_con ml30">
|
||||||
<div className="mr15">
|
<div className="mr15">
|
||||||
<ul>
|
<ul>
|
||||||
<div className="task-popup-content">
|
<div className="task-popup-content">
|
||||||
|
|
|
@ -300,10 +300,9 @@ class InfosCourse extends Component {
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<div className="square-list clearfix">
|
<div className="square-list clearfix">
|
||||||
{/* 289 */}
|
|
||||||
{
|
{
|
||||||
page == 1 && is_current && !category &&
|
page === 1 && is_current && !category &&
|
||||||
this.props.current_user && this.props.current_user.user_identity != "学生" ?
|
this.props.current_user && this.props.current_user.user_identity !== "学生" ?
|
||||||
<Create href={"/classrooms/new"} name={"新建课堂"} index="1"></Create> : ""
|
<Create href={"/classrooms/new"} name={"新建课堂"} index="1"></Create> : ""
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
|
@ -314,17 +313,17 @@ class InfosCourse extends Component {
|
||||||
return (
|
return (
|
||||||
<div className="square-Item" key={key} onClick={() => this.turnToCourses(`${item.first_category_url}`, item.can_visited)} style={{ "cursor": "pointer" }}>
|
<div className="square-Item" key={key} onClick={() => this.turnToCourses(`${item.first_category_url}`, item.can_visited)} style={{ "cursor": "pointer" }}>
|
||||||
{
|
{
|
||||||
item.is_public == 1 &&
|
item.is_public === 1 &&
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
<div className={key == 0 ? "publicpart orangeBlack" : "publicpart"}></div>
|
<div className={key === 0 ? "publicpart orangeBlack" : "publicpart"}></div>
|
||||||
<span className="smalltrangle"></span>
|
<span className="smalltrangle"></span>
|
||||||
<span className="publicword">公开</span>
|
<span className="publicword">公开</span>
|
||||||
</React.Fragment>
|
</React.Fragment>
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
item.can_visited == false ?
|
item.can_visited === false ?
|
||||||
<div className="closeSquare">
|
<div className="closeSquare">
|
||||||
<img src={getImageUrl("images/educoder/icon/lockclose.svg")} className="mt80 mb25" />
|
<img src={getImageUrl("images/educoder/icon/lockclose.svg")} alt="" className="mt80 mb25" />
|
||||||
<p className="font-14 color-white">非成员不能访问</p>
|
<p className="font-14 color-white">非成员不能访问</p>
|
||||||
</div> : ""
|
</div> : ""
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue