合并测试版分支

This commit is contained in:
caishi 2021-03-31 11:15:41 +08:00
parent e3c926da77
commit 49ebe450be
7 changed files with 224 additions and 15 deletions

View File

@ -696,8 +696,8 @@ class NewHeader extends Component {
<span className="font-15 ml30">
<a onClick={() => this.educoderlogin()} className="mr5 color-grey-6">登录</a>
{
settings && settings.new_course && settings.new_course.register_url &&
<span><em className="vertical-line"></em><a className="ml5 color-grey-6" href={`${settings.new_course.register_url}`} target="_blank"></a></span>
settings && settings.common && settings.common.register &&
<span><em className="vertical-line"></em><a className="ml5 color-grey-6" href={`${settings.common.register}`} target="_blank"></a></span>
}
</span>
:

View File

@ -74,6 +74,7 @@ class CoderRootCommit extends Component{
array.push({
name:item.author && item.author.name,
login: item.author && item.author.login,
id: item.author && item.author.id,
image_url:item.author && item.author.image_url,
sha:item.sha,
time_from_now:item.time_from_now,
@ -136,10 +137,18 @@ class CoderRootCommit extends Component{
<Link to={`/projects/${owner}/${projectsId}/commits/${truncateCommitId(`${item.sha}`)}`} className="flex1 ml20 font-16 color-grey-3">{item.message}</Link>
</p>
<p className="f-wrap-alignCenter mt15">
<Link to={`/users/${item.login}`} className="show-user-link">
{item.image_url?<img src={getImageUrl(`images/${item.image_url}`)} alt="" width="28px" height="28px" className="mr15 radius"/>:""}
<label className="font-14 color-grey-6" style={{verticalAlign:'middle'}}>{item.name ?`${item.name}:`:""}提交于 {item.time_from_now}</label>
</Link>
{
item.id ?
<Link to={`/users/${item.login}`} className="show-user-link">
{item.image_url?<img src={getImageUrl(`images/${item.image_url}`)} alt="" width="28px" height="28px" className="mr15 radius"/>:""}
<label className="font-14 color-grey-6" style={{verticalAlign:'middle'}}>{item.name ?`${item.name}:`:""}提交于 {item.time_from_now}</label>
</Link>:
<span className="show-user-link">
{item.image_url?<img src={getImageUrl(`images/${item.image_url}`)} alt="" width="28px" height="28px" className="mr15 radius"/>:""}
<label className="font-14 color-grey-6" style={{verticalAlign:'middle'}}>{item.name ?`${item.name}:`:""}提交于 {item.time_from_now}</label>
</span>
}
</p>
</div>
)

View File

@ -1,16 +1,121 @@
import React from 'react';
import React, { useEffect, useState } from 'react';
import './Index.scss';
import { Blueback , FlexAJ } from '../Component/layout';
import { Dropdown, Input , Menu , Pagination } from 'antd';
import { Link } from 'react-router-dom';
import UploadSource from './UploadSource';
const { Search } = Input;
const sort = [
"按上传时间排序",
"按下载次数排序",
"按引用排序"
]
const limit = 15;
function Index(props){
const [ sortValue , setSortValue ] = useState(0);
const [ page , setPage ] = useState(1);
const [ total , setTotal ] = useState(0);
const [ search , setSearch ] = useState(undefined);
const [ visible , setVisible ] = useState(false);
useEffect(()=>{
},[search,sort,page])
//
function onSearch(value){
setSearch(value);
}
//
function changeSort(e,index){
setSortValue(index);
}
const menu=(
<Menu>
{
sort && sort.map((item,key)=>{
return(
<Menu.Item onClick={(e)=>changeSort(e,key)} value={key} className={key === sortValue ?"color-blue":""}>{item}</Menu.Item>
)
})
}
</Menu>
)
const listmenu=(
<Menu>
<Menu.Item>更新版本</Menu.Item>
<Menu.Item>设为私有</Menu.Item>
<Menu.Item>删除资源</Menu.Item>
</Menu>
)
function onOk(){
}
return(
<div className="sourcePanel">
<UploadSource visible={visible} onCancel={()=>setVisible(false)} onOk={onOk}/>
<div className="headtitle">
<FlexAJ>
<span className="font-18">资源库</span>
<Blueback>上传资源</Blueback>
<span className="font-18">资源库(18)</span>
<Blueback onClick={()=>setVisible(true)}>上传资源</Blueback>
</FlexAJ>
</div>
<FlexAJ className="subHeadtitle">
<Search
placeholder="在项目内搜索资源"
onSearch={onSearch}
allowClear
enterButton="搜索"
width="220px"
/>
<Dropdown overlay={menu} placement="bottomRight">
<span className="color-grey-9">{sort[sortValue]}<i className="iconfont icon-sanjiaoxing-down font-16 color-grey-9 ml3"></i></span>
</Dropdown>
</FlexAJ>
<div className="bodycontent">
<ul className="bodycontentul">
<li>
<Link to= {`/users/`} className="infoImg"><img src={`https://testforgeplus.trustie.net/images/avatars/User/b`} alt="" /></Link>
<div style={{flex:'1',width:"0"}}>
<FlexAJ>
<a href={``} className="infoname">DaVinci.fdb</a>
<Dropdown overlay={listmenu} placement={'bottomRight'}>
<i className="iconfont icon-gengduo1 color-grey-6"></i>
</Dropdown>
</FlexAJ>
<p className="infos">
<span>上传时间<span>2021-03-30</span></span>
<span>上传类型<span>软件版本</span></span>
<span>文件大小<span>10KB</span></span>
<span>下载<span>111</span></span>
</p>
<p className="infodesc task-hide-2">资源描述资源描述资源描述资源描述资源描述资源描述资源描述</p>
<div className="infotag">
<span>软件版本<i className="iconfont icon-guanbi font-12 ml2"></i></span>
</div>
</div>
</li>
</ul>
{
total > limit &&
<div className="pt20 pb20 edu-txt-center">
<Pagination
simple
current={page}
pageSize={limit}
total={total}
onChange={(p)=>{setPage(p)}}
/>
</div>
}
</div>
</div>
)
}

View File

@ -8,4 +8,69 @@
padding:15px 20px;
border-bottom: 1px solid #eee;
}
.subHeadtitle{
padding:15px 20px;
border-bottom: 1px solid #eee;
.ant-input-group-wrapper{
width:320px;
.ant-btn.ant-input-search-button{
margin: 0px;
margin-top: -1px;
}
}
}
.bodycontent{
padding:0px 20px;
& > ul.bodycontentul > li{
display: flex;
border-bottom: 1px solid #eee;
padding:20px 0px;
align-items: flex-start;
&:last-child{
border-bottom: none;
}
.infoImg{
img{
width: 50px;
height: 50px;
border-radius: 50%;
}
margin-right: 15px;
}
.infoname{
font-size: 16px;
}
.infos{
& > span{
margin-right: 20px;
color: #999;
& >span{
color: #666;
}
}
}
.infodesc{
color: #666;
line-height: 20px;
margin:5px 0px!important;
}
.infotag{
display: flex;
flex-wrap: wrap;
span{
display: block;
padding:0px 4px;
height: 20px;
line-height: 20px;
font-size: 12px;
margin-right: 10px;
border: 1px solid #f8df8c;
background: #fffce6;
color: #0d90c3;
border-radius: 2px;
cursor: pointer;
}
}
}
}
}

View File

@ -0,0 +1,22 @@
import React from 'react';
import { Modal } from 'antd';
function UploadSource({ visible , onCancel , onOk }){
return(
<Modal
title={"上传资源"}
closable={false}
visible={visible}
onCancel={onCancel}
onOk={onOk}
cancelText="取消"
okText="确定"
width="600px"
centered
>
<div></div>
</Modal>
)
}
export default UploadSource;

View File

@ -1,8 +1,8 @@
import React, { Component } from 'react';
import Dialog from 'material-ui/Dialog';
import { notification } from 'antd';
import axios from 'axios';
import './LoginDialog.css';
@ -323,6 +323,7 @@ class LoginDialog extends Component {
return flag;
}
componentDidMount() {
let flag = this.IsPC(); //true为PC端false为手机端
this.setState({
isphone: flag
@ -472,6 +473,7 @@ class LoginDialog extends Component {
let { qqlogin, login, isGoing, isGoingValue, disabled, bottonclass, Phonenumberisnotco,
dialogBox, isRender, weixinlogin } = this.state;
let { settings } = this.props;
if (isRender === undefined) {
isRender = false
}
@ -574,9 +576,9 @@ class LoginDialog extends Component {
<label htmlFor="p_autolog" style={{ top: '0px' }}>下次自动登录</label>
</span>
<span className="fr">
<a onClick={(url) => this.getloginurl("https://www.trustie.net/account/lost_password")}
className="mr3 color-grey-9">找回密码</a><em className="vertical-line"></em>
<a onClick={(url) => this.getloginurl("https://www.trustie.net/login?login=false")} className="color-grey-9">注册</a>
<a onClick={(url) => this.getloginurl(`${settings && settings.common && settings.common.lost_password}`)} className="mr3 color-grey-9">找回密码</a>
<em className="vertical-line"></em>
<a onClick={(url) => this.getloginurl(`${settings && settings.common && settings.common.register}`)} className="color-grey-9">注册</a>
</span>
</p>

View File

@ -811,12 +811,18 @@ class NewHeader extends Component {
{user === undefined ?
<span className="font-15">
<a onClick={() => this.educoderlogin()} className="mr5 color-grey-6">登录</a>
<span><em className="vertical-line"></em><a className="ml5 color-grey-6" href={`/register`}></a></span>
{
settings && settings.common && settings.common.register &&
<span><em className="vertical-line"></em><a className="ml5 color-grey-6 3333" href={`${settings.common.register}`} target="_blank"></a></span>
}
</span>
: user.login === "" ?
<span className="font-15">
<a onClick={() => this.educoderlogin()} className="mr5 color-grey-6">登录</a>
<span><em className="vertical-line"></em><a className="color-grey-6 ml5" href={`/register`}></a></span>
{
settings && settings.common && settings.common.register &&
<span><em className="vertical-line"></em><a className="color-grey-6 ml5 111" href={`${settings.common.register}`} target="_blank"></a></span>
}
</span>
:
<div className="ml30 edu-menu-panel" style={{ height: "70px", lineHeight: "70px" }}>