This commit is contained in:
caishi 2021-06-07 11:13:38 +08:00
parent bcdf506e6c
commit 9a2c3f1754
7 changed files with 143 additions and 36 deletions

View File

@ -2,12 +2,13 @@ import React, { Component } from 'react';
import AccountProfile from "../../modules/user/AccountProfile"; import AccountProfile from "../../modules/user/AccountProfile";
import { getImageUrl } from 'educoder' import { getImageUrl } from 'educoder'
import axios from 'axios'; import axios from 'axios';
import { Input , notification , Dropdown , Menu } from 'antd'; import { Modal, Input, message, notification , Dropdown , Menu } from 'antd';
import LoginDialog from '../../modules/login/LoginDialog'; import LoginDialog from '../../modules/login/LoginDialog';
import GotoQQgroup from '../../modal/GotoQQgroup' import GotoQQgroup from '../../modal/GotoQQgroup'
import '../../modules/tpm/TPMIndex.css'; import '../../modules/tpm/TPMIndex.css';
import logo from '../../modules/tpm/images/logo.png';
import './header.scss'; import './header.scss';
const $ = window.$ const $ = window.$
@ -32,9 +33,11 @@ class NewHeader extends Component {
Checkboxteachertype: false, Checkboxteachertype: false,
Checkboxteachingtype: false, Checkboxteachingtype: false,
code_notice: false, code_notice: false,
checked_notice: false,
RadioGroupvalue: undefined, RadioGroupvalue: undefined,
submitapplications: false, submitapplications: false,
isRender: false, isRender: false,
showSearchOpentype: false,
showTrial: false, showTrial: false,
setevaluatinghides: false, setevaluatinghides: false,
occupation: 0, occupation: 0,
@ -42,6 +45,7 @@ class NewHeader extends Component {
headtypesonClickbool: false, headtypesonClickbool: false,
headtypess: "/", headtypess: "/",
settings: null, settings: null,
goshowqqgtounp: false,
visiblemyss: false, visiblemyss: false,
openSearch:false, openSearch:false,
} }
@ -126,7 +130,43 @@ class NewHeader extends Component {
} }
} }
submitsubmitapplications = () => {
let {
submitapplicationssum,
submitapplicationsvaluedata
} = this.state;
this.setState({
submitapplications: false,
RadioGroupvalue: undefined
})
if (submitapplicationssum === 0) {
if (submitapplicationsvaluedata !== undefined) {
window.location.href = "/courses/" + submitapplicationsvaluedata;
}
} else if (submitapplicationssum === 1) {
if (submitapplicationsvaluedata !== undefined) {
window.location.href = "/projects/" + submitapplicationsvaluedata;
}
}
}
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
})
}
educoderlogin = () => { educoderlogin = () => {
//登录账号 //登录账号
this.setState({ this.setState({
@ -165,6 +205,23 @@ class NewHeader extends Component {
}; };
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
})
}
// 关闭 // 关闭
cancelModulationModels = () => { cancelModulationModels = () => {
this.setState({ isRenders: false }) this.setState({ isRenders: false })
@ -256,6 +313,14 @@ class NewHeader extends Component {
} }
} }
// 处理弹框
setgoshowqqgtounp = (bool) => {
this.setState({
goshowqqgtounp: bool
})
}
addMenu=(list)=>{ addMenu=(list)=>{
return( return(
list && list.length >0 && list && list.length >0 &&
@ -273,25 +338,6 @@ class NewHeader extends Component {
) )
} }
renderMenu=(personal)=>{
const { current_user } = this.props;
return(
<Menu className="currentMenu">
<Menu.Item>
<span title={current_user && current_user.username}>{current_user && current_user.username}</span>
</Menu.Item>
{
personal && personal.length > 0 && personal.map((item,key)=>{
return(
<li key={key}><a href={item.url} target="_blank">{item.name}</a></li>
)
})
}
<Menu.Item><a onClick={() => this.educoderloginysl()}>退出</a></Menu.Item>
</Menu>
)
}
render() { render() {
const { match} = this.props; const { match} = this.props;
let current_user = this.props.user; let current_user = this.props.user;
@ -299,12 +345,17 @@ class NewHeader extends Component {
tojoinitemtype, tojoinitemtype,
tojoinclasstitle, tojoinclasstitle,
code_notice, code_notice,
checked_notice,
AccountProfiletype, AccountProfiletype,
submitapplications,
submitapplicationsvalue,
user, user,
isRender, isRender,
showSearchOpentype,
headtypesonClickbool, headtypesonClickbool,
headtypess, headtypess,
settings, settings,
goshowqqgtounp,
openSearch, openSearch,
} = this.state; } = this.state;
/*用户名称 用户头像url*/ /*用户名称 用户头像url*/
@ -401,6 +452,11 @@ class NewHeader extends Component {
{...this.props} {...this.props}
{...this.state} {...this.state}
/> : ""} /> : ""}
{
goshowqqgtounp === true ?
<GotoQQgroup {...this.state} {...this.props} setgoshowqqgtounp={(bool) => this.setgoshowqqgtounp(bool)}></GotoQQgroup>
:""
}
{ {
settings && settings.nav_logo_url ? settings && settings.nav_logo_url ?
<a href={settings && settings.new_course.default_url} className={"fl mr50"} style={{minWidth:"45px"}}> <a href={settings && settings.new_course.default_url} className={"fl mr50"} style={{minWidth:"45px"}}>
@ -466,6 +522,32 @@ class NewHeader extends Component {
} }
</div>:"" </div>:""
} }
<Modal
keyboard={false}
title="提示"
visible={submitapplications}
closable={false}
footer={null}
>
<div className="task_popup_con ml30">
<div className="mr15">
<ul>
<div className="task-popup-content">
<p className="task-popup-text-center font-16">
{submitapplicationsvalue}
</p>
</div>
<li className="clearfix mt10 edu-txt-center">
<a className="task-btn mr10"
onClick={this.hidesubmitapplications}>取消</a>
<a
className="task-btn task-btn-orange ml20"
onClick={this.submitsubmitapplications}>确定</a>
</li>
</ul>
</div>
</div>
</Modal>
</div> </div>
{!user || (user && !user.login) ? {!user || (user && !user.login) ?
<span className="font-15 ml30"> <span className="font-15 ml30">
@ -476,11 +558,25 @@ class NewHeader extends Component {
} }
</span> </span>
: :
<Dropdown placement={`bottomRight`} overlay={this.renderMenu(settings && settings.personal)}> <div className="ml30 edu-menu-panel" style={{ height: "70px", lineHeight: "70px" }}>
<a href={`/users/${this.props.current_user && this.props.current_user.login}`}> <a href={`/users/${this.props.current_user === undefined ? "" : this.props.current_user.login}`}>
<img alt="头像" src={getImageUrl(`/${user.image_url}`)} className="currentImg"></img> <img alt="头像" className="radius" height="34" id="nh_user_logo" name="avatar_image" src={getImageUrl(`/${user.image_url}`)} width="34">
</img>
</a> </a>
</Dropdown> <ul className="edu-menu-list" style={{ top: '60px', textAlign: 'center' }}>
<li className="bor-bottom-greyE" style={{cursor:"default",background:"#fff"}}>{this.props.current_user.username}</li>
{
settings && settings.personal && settings.personal.length > 0 && settings.personal.map((item,key)=>{
return(
<li key={key}><a href={item.url} target="_blank">{item.name}</a></li>
)
})
}
<li className="bor-top-greyE">
<a onClick={() => this.educoderloginysl()}>退出</a>
</li>
</ul>
</div>
} }
</div> </div>
</div> </div>

View File

@ -40,7 +40,7 @@ export default ((props)=>{
</p> </p>
</div> </div>
<span> <span>
<Link to={`/projects/${owner}/${projectsId}/pulls/new`} className="mr20 color-blue mr30">创建合并请求</Link> <Link to={`/projects/${owner}/${projectsId}/pulls/new/${item.name}`} className="mr20 color-blue mr30">创建合并请求</Link>
<Dropdown overlay={menu(item.zip_url,item.tar_url)} trigger={['click']} placement="bottomRight" className="color-green-file"> <Dropdown overlay={menu(item.zip_url,item.tar_url)} trigger={['click']} placement="bottomRight" className="color-green-file">
<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>

View File

@ -74,7 +74,7 @@ function Calendar({ userLogin , time , chooseTime }) {
var M = (date.getMonth()+1 < 10 ? '0'+(date.getMonth()+1) : date.getMonth()+1) + '-'; var M = (date.getMonth()+1 < 10 ? '0'+(date.getMonth()+1) : date.getMonth()+1) + '-';
var D = date.getDate() < 10 ? '0' + date.getDate() : date.getDate(); var D = date.getDate() < 10 ? '0' + date.getDate() : date.getDate();
return Y+M+D; return Y+M+D;
} }
function Init(data,max) { function Init(data,max) {
var huan_val = document.getElementById("Calendar"); var huan_val = document.getElementById("Calendar");
@ -137,6 +137,7 @@ function Calendar({ userLogin , time , chooseTime }) {
}); });
} }
return( return(
<div id="Calendar" style={{height:"210px"}}></div> <div id="Calendar" style={{height:"210px"}}></div>
) )

View File

@ -15,14 +15,13 @@ function ConcentrateBox({ visible , onCancel , onSure , username , choosed }) {
const [ value , setValue ]= useState([]); const [ value , setValue ]= useState([]);
const [ isSpin , setIsSpin ]= useState(true); const [ isSpin , setIsSpin ]= useState(true);
const [ disable , setDisable ] = useState(false); const [ disable , setDisable ] = useState(false);
const [ loadCount , setLoadCount ]= useState(0);
useEffect(()=>{ useEffect(()=>{
if(visible && loadCount === 0){ if(visible){
setLoadCount(loadCount+1);
setIsSpin(true); setIsSpin(true);
getProjectList(); getProjectList();
} }
setSearch(undefined);
},[visible]) },[visible])
useEffect(()=>{ useEffect(()=>{
@ -57,15 +56,16 @@ function ConcentrateBox({ visible , onCancel , onSure , username , choosed }) {
const url = `/users/${username}/projects.json`; const url = `/users/${username}/projects.json`;
Axios.get(url,{ Axios.get(url,{
params:{ params:{
page:p,limit,is_public: "public",search:s page:p,limit,is_public: "public",search:s,choosed
} }
}).then(result=>{ }).then(result=>{
if(result && result.data){ if(result && result.data){
let e = mergeArrayMerge(list,result.data.projects); let e = page > 1 ? mergeArrayMerge(list,result.data.projects) : result.data.projects;
setTotal(result.data.count); setTotal(result.data.count);
setList(page > 1 ? e : result.data.projects); setList(e);
setIsSpin(false); setIsSpin(false);
//
let s = parseInt(result.data.count/limit,0); let s = parseInt(result.data.count/limit,0);
let y = result.data.count%limit; let y = result.data.count%limit;
setPageSize(y>0?s+1:s); setPageSize(y>0?s+1:s);
@ -91,13 +91,21 @@ function ConcentrateBox({ visible , onCancel , onSure , username , choosed }) {
setValue([]); setValue([]);
} }
function chooseProject(e) { function chooseProject(e,p) {
setValue(e); setValue(e);
} }
// //
function onSearch(params) { function onSearch(params) {
setPage(1);
setList([]);
setSearch(params); setSearch(params);
// if(params){
// setValueCopy(value);
// }else{
// setValue(valueCopy);
// setValueCopy([]);
// }
} }
return( return(
@ -120,6 +128,8 @@ function ConcentrateBox({ visible , onCancel , onSure , username , choosed }) {
onSearch={onSearch} onSearch={onSearch}
enterButton="搜索" enterButton="搜索"
allowClear allowClear
value={search}
onChange={(e)=>setSearch(e.target.value)}
/> />
</div> </div>
<div className="listbox"> <div className="listbox">

View File

@ -45,7 +45,7 @@
} }
} }
.ConcentrateTip{ .ConcentrateTip{
margin:0px 30px; margin:20px 20px 0px;
padding:5px 20px; padding:5px 20px;
border:1px solid rgb(248, 56, 56); border:1px solid rgb(248, 56, 56);
border-radius: 4px; border-radius: 4px;

View File

@ -56,7 +56,7 @@ export default Form.create()(
{getFieldDecorator("email",{ {getFieldDecorator("email",{
rules:[{required:true,message:"请输入邮箱账号"}] rules:[{required:true,message:"请输入邮箱账号"}]
})( })(
<Input placeholder="请输入您的邮箱账号" style={{width:"400px"}}/> <Input placeholder="请输入您的邮箱账号" disabled style={{width:"400px"}}/>
)} )}
</Form.Item> </Form.Item>
<Form.Item label=""> <Form.Item label="">

View File

@ -33,7 +33,7 @@ function Index(props){
<div> <div>
<Menu selectedKeys={[key]} mode={'horizontal'} className="infosRightMenu"> <Menu selectedKeys={[key]} mode={'horizontal'} className="infosRightMenu">
<Menu.Item key="0"><Link to={`/users/${username}/info`}>基本资料</Link></Menu.Item> <Menu.Item key="0"><Link to={`/users/${username}/info`}>基本资料</Link></Menu.Item>
<Menu.Item key="1"><Link to={`/users/${username}/password`}>密码管理</Link></Menu.Item> {/* <Menu.Item key="1"><Link to={`/users/${username}/password`}>密码管理</Link></Menu.Item> */}
</Menu> </Menu>
<div style={{padding:"20px"}}> <div style={{padding:"20px"}}>
{ {