forked from Gitlink/forgeplus-react
style
This commit is contained in:
parent
3071c785bc
commit
b5e1a91af5
|
@ -1,6 +1,5 @@
|
||||||
/*头部导航条样式---2018-03-19--by-cs*/
|
/*头部导航条样式---2018-03-19--by-cs*/
|
||||||
.newHeader {
|
.newHeader {
|
||||||
background: #24292D !important;
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 60px !important;
|
height: 60px !important;
|
||||||
min-width: 1200px;
|
min-width: 1200px;
|
||||||
|
|
|
@ -4,16 +4,14 @@ import { broadcastChannelOnmessage, isDev, queryString } from 'educoder';
|
||||||
import { notification } from 'antd';
|
import { notification } from 'antd';
|
||||||
import cookie from 'react-cookies';
|
import cookie from 'react-cookies';
|
||||||
import './index.css';
|
import './index.css';
|
||||||
|
|
||||||
let message501 = false;
|
let message501 = false;
|
||||||
|
|
||||||
broadcastChannelOnmessage('refreshPage', () => {
|
broadcastChannelOnmessage('refreshPage', () => {
|
||||||
window.location.reload();
|
window.location.reload()
|
||||||
})
|
})
|
||||||
|
|
||||||
function locationurl(list) {
|
function locationurl(list) {
|
||||||
if (window.location.port === "3007") {
|
if (window.location.port !== "3007") {
|
||||||
|
|
||||||
} else {
|
|
||||||
window.location.href = list
|
window.location.href = list
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -27,14 +25,14 @@ if (isDev) {
|
||||||
}
|
}
|
||||||
debugType = window.location.search.indexOf('debug=t') !== -1 ? 'teacher' :
|
debugType = window.location.search.indexOf('debug=t') !== -1 ? 'teacher' :
|
||||||
window.location.search.indexOf('debug=s') !== -1 ? 'student' :
|
window.location.search.indexOf('debug=s') !== -1 ? 'student' :
|
||||||
window.location.search.indexOf('debug=a') !== -1 ? 'admin' : parsed.debug || 'admin'
|
window.location.search.indexOf('debug=a') !== -1 ? 'admin' : parsed.debug || 'p86402359'
|
||||||
}
|
}
|
||||||
function clearAllCookie() {
|
function clearAllCookie() {
|
||||||
cookie.remove('_educoder_session', { path: '/' });
|
cookie.remove('_educoder_session', { path: '/' });
|
||||||
cookie.remove('autologin_trustie', { path: '/' });
|
cookie.remove('autologin_trustie', { path: '/' });
|
||||||
setpostcookie()
|
setpostcookie()
|
||||||
}
|
}
|
||||||
clearAllCookie();
|
// clearAllCookie();
|
||||||
function setpostcookie() {
|
function setpostcookie() {
|
||||||
const str = window.location.pathname;
|
const str = window.location.pathname;
|
||||||
if (str.indexOf("/wxcode") !== -1) {
|
if (str.indexOf("/wxcode") !== -1) {
|
||||||
|
@ -54,9 +52,11 @@ setpostcookie();
|
||||||
|
|
||||||
window._debugType = debugType;
|
window._debugType = debugType;
|
||||||
export function initAxiosInterceptors(props) {
|
export function initAxiosInterceptors(props) {
|
||||||
initOnlineOfflineListener();
|
initOnlineOfflineListener()
|
||||||
var proxy = "http://localhost:3000";
|
// TODO 避免重复的请求 https://github.com/axios/axios#cancellation
|
||||||
proxy = "https://testforgeplus.trustie.net";
|
var
|
||||||
|
proxy = "http://localhost:3000";
|
||||||
|
proxy = "https://forge.osredm.com";
|
||||||
|
|
||||||
const requestMap = {};
|
const requestMap = {};
|
||||||
window.setfalseInRequestMap = function (keyName) {
|
window.setfalseInRequestMap = function (keyName) {
|
||||||
|
@ -90,7 +90,6 @@ export function initAxiosInterceptors(props) {
|
||||||
}
|
}
|
||||||
if (config.url.indexOf('update_file') === -1) {
|
if (config.url.indexOf('update_file') === -1) {
|
||||||
requestMap[config.url] = true;
|
requestMap[config.url] = true;
|
||||||
|
|
||||||
window.setTimeout("setfalseInRequestMap('" + config.url + "')", 900)
|
window.setTimeout("setfalseInRequestMap('" + config.url + "')", 900)
|
||||||
}
|
}
|
||||||
return config;
|
return config;
|
||||||
|
|
|
@ -68,7 +68,7 @@ export function appendFileSizeToUploadFile(item) {
|
||||||
return `${item.title}${uploadNameSizeSeperator}${item.filesize}`
|
return `${item.title}${uploadNameSizeSeperator}${item.filesize}`
|
||||||
}
|
}
|
||||||
export function appendFileSizeToUploadFileAll(fileList) {
|
export function appendFileSizeToUploadFileAll(fileList) {
|
||||||
return fileList.map(item => {
|
return fileList && fileList.map(item => {
|
||||||
if (item.name.indexOf(uploadNameSizeSeperator) == -1) {
|
if (item.name.indexOf(uploadNameSizeSeperator) == -1) {
|
||||||
return Object.assign({}, item, { name: `${item.name}${uploadNameSizeSeperator}${bytesToSize(item.size)}` })
|
return Object.assign({}, item, { name: `${item.name}${uploadNameSizeSeperator}${bytesToSize(item.size)}` })
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,12 +6,12 @@ const { Search } = Input;
|
||||||
const $ = window.$;
|
const $ = window.$;
|
||||||
const isDev = window.location.port == 3007;
|
const isDev = window.location.port == 3007;
|
||||||
const isdev2= window.location.hostname ==='www.educoder.net'
|
const isdev2= window.location.hostname ==='www.educoder.net'
|
||||||
export const TEST_HOST = "https://testforgeplus.trustie.net/"
|
export const TEST_HOST = "http://39.105.176.215:49999"
|
||||||
export function getImageUrl(path) {
|
export function getImageUrl(path) {
|
||||||
// https://www.educoder.net
|
// https://www.educoder.net
|
||||||
// https://testbdweb.trustie.net
|
// https://testbdweb.trustie.net
|
||||||
// const local = 'http://localhost:3000'
|
// const local = 'http://localhost:3000'
|
||||||
const local = 'https://testforgeplus.trustie.net';
|
const local = 'http://39.105.176.215:49999';
|
||||||
if (isDev) {
|
if (isDev) {
|
||||||
return `${local}/${path}`
|
return `${local}/${path}`
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,7 @@ export function getImage(path) {
|
||||||
// https://www.educoder.net
|
// https://www.educoder.net
|
||||||
// https://testbdweb.trustie.net
|
// https://testbdweb.trustie.net
|
||||||
// const local = 'http://localhost:3000'
|
// const local = 'http://localhost:3000'
|
||||||
const local = 'https://testforgeplus.trustie.net/';
|
const local = 'http://39.105.176.215:49999';
|
||||||
if(path.indexOf("http://")===-1){
|
if(path.indexOf("http://")===-1){
|
||||||
if (isDev) {
|
if (isDev) {
|
||||||
return `${local}/images/${path}`
|
return `${local}/images/${path}`
|
||||||
|
@ -93,7 +93,7 @@ export function setImagesUrl(path){
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getUrl(path, goTest) {
|
export function getUrl(path, goTest) {
|
||||||
const local = 'https://testforgeplus.trustie.net'
|
const local = 'http://39.105.176.215:49999'
|
||||||
if (isDev) {
|
if (isDev) {
|
||||||
return `${local}${path?path:''}`
|
return `${local}${path?path:''}`
|
||||||
}
|
}
|
||||||
|
@ -162,7 +162,7 @@ export function getmyUrl(geturl) {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getUploadActionUrl(path, goTest) {
|
export function getUploadActionUrl(path, goTest) {
|
||||||
return `${getUrl()}/api/attachments.json?debug=${window._debugType || 'admin'}`;
|
return `${getUrl()}/api/attachments.json`;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getUploadLogoActionUrl() {
|
export function getUploadLogoActionUrl() {
|
||||||
|
|
|
@ -14,7 +14,7 @@ class CloneAddress extends Component {
|
||||||
const { http_url, downloadUrl } = this.props;
|
const { http_url, downloadUrl } = this.props;
|
||||||
return (
|
return (
|
||||||
<div className="gitAddressClone">
|
<div className="gitAddressClone">
|
||||||
{/* <p className="addressTips"><span>版本库地址已变更,请基于新地址提交代码</span></p> */}
|
<p className="addressTips"><span>版本库地址已变更,请基于新地址提交代码</span></p>
|
||||||
{
|
{
|
||||||
http_url && <span>HTTP</span>
|
http_url && <span>HTTP</span>
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
|
||||||
|
|
||||||
import React , { useState , useEffect } from 'react';
|
import React , { useState , useEffect } from 'react';
|
||||||
import { Select } from 'antd';
|
import { Select } from 'antd';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
@ -57,7 +59,6 @@ const LANGUAGE = [
|
||||||
|
|
||||||
export default (({ language , select_language })=>{
|
export default (({ language , select_language })=>{
|
||||||
const [ languages , setLanguage ] = useState(undefined);
|
const [ languages , setLanguage ] = useState(undefined);
|
||||||
|
|
||||||
// useEffect(()=>{
|
// useEffect(()=>{
|
||||||
// const url = '/dev_ops/languages.json';
|
// const url = '/dev_ops/languages.json';
|
||||||
// axios.get(url).then(result=>{
|
// axios.get(url).then(result=>{
|
||||||
|
|
|
@ -32,7 +32,7 @@ function List({ list, operate , projectsId , owner , showModal , deleteFunc }){
|
||||||
ellipsis:true,
|
ellipsis:true,
|
||||||
render:(value,item)=>{
|
render:(value,item)=>{
|
||||||
return(
|
return(
|
||||||
<Link to={`/projects/${owner}/${projectsId}/branch/${item.branch}?url=${value}`} className="color-blue">{value}</Link>
|
<Link to={`/projects/${owner}/${projectsId}/branch/${item.branch}/tree/${value}`} className="color-blue">{value}</Link>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -10,55 +10,40 @@ const About = Loadable({
|
||||||
loader: () => import('./About'),
|
loader: () => import('./About'),
|
||||||
loading: Loading,
|
loading: Loading,
|
||||||
})
|
})
|
||||||
const New = Loadable({
|
const Infos = Loadable({
|
||||||
loader: () => import('./disposePipeline'),
|
loader: () => import('./Infos'),
|
||||||
loading: Loading,
|
|
||||||
})
|
|
||||||
const Dispose = Loadable({
|
|
||||||
loader: () => import('./Dispose'),
|
|
||||||
loading: Loading,
|
|
||||||
})
|
|
||||||
const Stucture = Loadable({
|
|
||||||
loader: () => import('./Structure'),
|
|
||||||
loading: Loading,
|
|
||||||
})
|
|
||||||
const Mould = Loadable({
|
|
||||||
loader: () => import('./Mould'),
|
|
||||||
loading: Loading,
|
loading: Loading,
|
||||||
})
|
})
|
||||||
export default ((props)=>{
|
export default ((props)=>{
|
||||||
|
const { projectsId , owner } = props.match.params;
|
||||||
|
const open_devops = props.projectDetail && props.projectDetail.open_devops;
|
||||||
|
|
||||||
|
// 工作流:两种状态进入的链接不同
|
||||||
|
useEffect(()=>{
|
||||||
|
if(open_devops !== undefined){
|
||||||
|
if(open_devops){
|
||||||
|
props.history.replace(`/projects/${owner}/${projectsId}/devops/list`);
|
||||||
|
}else{
|
||||||
|
props.history.replace(`/projects/${owner}/${projectsId}/devops`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},[open_devops])
|
||||||
return(
|
return(
|
||||||
<WhiteBack className="opsPanel">
|
<WhiteBack className="opsPanel">
|
||||||
<Switch {...props}>
|
<Switch {...props}>
|
||||||
<Route path="/projects/:owner/:projectsId/devops/dispose/:disposeId"
|
|
||||||
render={
|
|
||||||
(p) => (<New {...props} {...p}/>)
|
|
||||||
}
|
|
||||||
></Route>
|
|
||||||
<Route path="/projects/:owner/:projectsId/devops/mould"
|
|
||||||
render={
|
|
||||||
(p) => (<Mould {...props} {...p}/>)
|
|
||||||
}
|
|
||||||
></Route>
|
|
||||||
<Route path="/projects/:owner/:projectsId/devops/dispose/new"
|
|
||||||
render={
|
|
||||||
(p) => (<New {...props} {...p}/>)
|
|
||||||
}
|
|
||||||
></Route>
|
|
||||||
<Route path="/projects/:owner/:projectsId/devops/dispose"
|
<Route path="/projects/:owner/:projectsId/devops/dispose"
|
||||||
render={
|
render={
|
||||||
(p) => (<Dispose {...props} {...p}/>)
|
() => (<Infos {...props} />)
|
||||||
}
|
}
|
||||||
></Route>
|
></Route>
|
||||||
<Route path="/projects/:owner/:projectsId/devops/list/:branch"
|
<Route path="/projects/:owner/:projectsId/devops/list"
|
||||||
render={
|
render={
|
||||||
(p) => (<Stucture {...props} {...p}/>)
|
() => (<Infos {...props} />)
|
||||||
}
|
}
|
||||||
></Route>
|
></Route>
|
||||||
<Route path="/projects/:owner/:projectsId/devops"
|
<Route path="/projects/:owner/:projectsId/devops"
|
||||||
render={
|
render={
|
||||||
(p) => (<About {...props} {...p}/>)
|
() => (<About {...props} />)
|
||||||
}
|
}
|
||||||
></Route>
|
></Route>
|
||||||
</Switch>
|
</Switch>
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 64 KiB |
Binary file not shown.
After Width: | Height: | Size: 90 KiB |
Binary file not shown.
After Width: | Height: | Size: 222 KiB |
|
@ -6,7 +6,6 @@ import { withRouter } from "react-router";
|
||||||
import { SnackbarHOC } from "educoder";
|
import { SnackbarHOC } from "educoder";
|
||||||
import { CNotificationHOC } from "../modules/courses/common/CNotificationHOC";
|
import { CNotificationHOC } from "../modules/courses/common/CNotificationHOC";
|
||||||
import { TPMIndexHOC } from "../modules/tpm/TPMIndexHOC";
|
import { TPMIndexHOC } from "../modules/tpm/TPMIndexHOC";
|
||||||
import Handbook from './Component/Handbook';
|
|
||||||
import "./css/index.scss";
|
import "./css/index.scss";
|
||||||
|
|
||||||
import Loadable from "react-loadable";
|
import Loadable from "react-loadable";
|
||||||
|
@ -31,18 +30,13 @@ const Infos = Loadable({
|
||||||
loader: () => import("./users/Infos"),
|
loader: () => import("./users/Infos"),
|
||||||
loading: Loading,
|
loading: Loading,
|
||||||
});
|
});
|
||||||
|
|
||||||
class Index extends Component {
|
class Index extends Component {
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<div className="newMain clearfix">
|
<div className="newMain clearfix">
|
||||||
<Handbook />
|
|
||||||
<Switch {...this.props}>
|
<Switch {...this.props}>
|
||||||
<Route
|
|
||||||
path="/projects/:projectsType/new/:OIdentifier"
|
|
||||||
render={(props) => (
|
|
||||||
<ProjectNew {...this.props} {...props} />
|
|
||||||
)}
|
|
||||||
></Route>
|
|
||||||
<Route
|
<Route
|
||||||
path="/projects/:projectsType/new"
|
path="/projects/:projectsType/new"
|
||||||
render={(props) => (
|
render={(props) => (
|
||||||
|
|
|
@ -52,7 +52,8 @@ class CoderRootDirectory extends Component {
|
||||||
tar_url:undefined,
|
tar_url:undefined,
|
||||||
chooseType:undefined,
|
chooseType:undefined,
|
||||||
|
|
||||||
md:false
|
md:false,
|
||||||
|
treeValue:undefined
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
changeAddress = (address) => {
|
changeAddress = (address) => {
|
||||||
|
@ -87,15 +88,13 @@ class CoderRootDirectory extends Component {
|
||||||
};
|
};
|
||||||
|
|
||||||
Init = () => {
|
Init = () => {
|
||||||
let { search } = this.props.history.location;
|
let { pathname } = this.props.history.location;
|
||||||
const { branchName } = this.props.match.params;
|
const { branchName , owner , projectsId } = this.props.match.params;
|
||||||
const { defaultBranch } = this.props;
|
const { defaultBranch } = this.props;
|
||||||
let branch = branchName || defaultBranch;
|
let branch = branchName || defaultBranch;
|
||||||
if (search && (search.indexOf("?url=") > -1 || search.indexOf("&url=") > -1)) {
|
if (pathname && (pathname.indexOf(`/projects/${owner}/${projectsId}`) > -1 && pathname.indexOf(`/tree/${branchName}/`) > -1)) {
|
||||||
let url = search.split("url=")[1];
|
let url = pathname.split(`/tree/${branchName}/`)[1];
|
||||||
if(url && decodeURI(url).indexOf("&")){
|
this.setState({treeValue:url})
|
||||||
url=decodeURI(url).split("&")[0];
|
|
||||||
}
|
|
||||||
this.getFileDetail(decodeURI(url),branch);
|
this.getFileDetail(decodeURI(url),branch);
|
||||||
} else {
|
} else {
|
||||||
this.getProjectRoot(branch);
|
this.getProjectRoot(branch);
|
||||||
|
@ -106,9 +105,10 @@ class CoderRootDirectory extends Component {
|
||||||
returnMain = (branch) => {
|
returnMain = (branch) => {
|
||||||
const { projectsId , owner , branchName } = this.props.match.params;
|
const { projectsId , owner , branchName } = this.props.match.params;
|
||||||
this.setState({
|
this.setState({
|
||||||
readOnly:true
|
readOnly:true,
|
||||||
|
treeValue:undefined
|
||||||
})
|
})
|
||||||
this.props.history.push(`/projects/${owner}/${projectsId}${branchName?`/branch/${branchName}`:""}`);
|
this.props.history.push(`/projects/${owner}/${projectsId}${branchName?`/tree/${branchName}`:""}`);
|
||||||
this.getProjectRoot(branch);
|
this.getProjectRoot(branch);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -145,45 +145,13 @@ class CoderRootDirectory extends Component {
|
||||||
ChangeFile = (arr, readOnly) => {
|
ChangeFile = (arr, readOnly) => {
|
||||||
const { projectsId , owner } = this.props.match.params;
|
const { projectsId , owner } = this.props.match.params;
|
||||||
//点击直接跳转页面 加载一次路由
|
//点击直接跳转页面 加载一次路由
|
||||||
this.props.history.push(`/projects/${owner}/${projectsId}?url=${arr.path}`);
|
this.props.history.push(`/projects/${owner}/${projectsId}/tree/${arr.path}`);
|
||||||
this.setState({
|
this.setState({
|
||||||
readOnly: readOnly,
|
readOnly: readOnly,
|
||||||
chooseType:"file"
|
chooseType:"file"
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
renderUrl = (name, path, type) => {
|
|
||||||
let list = [];
|
|
||||||
const { filePath } = this.state;
|
|
||||||
if (path.indexOf("/")) {
|
|
||||||
const array = path.split("/");
|
|
||||||
let str = "";
|
|
||||||
array.map((i, k) => {
|
|
||||||
str += "/" + i;
|
|
||||||
return list.push({
|
|
||||||
key: k,
|
|
||||||
index: k,
|
|
||||||
name: i,
|
|
||||||
path: str.substr(1),
|
|
||||||
type: filePath && filePath.length > 0 ? filePath[k] ? filePath[k].type : type : type,
|
|
||||||
});
|
|
||||||
});
|
|
||||||
const { projectsId , owner } = this.props.match.params;
|
|
||||||
//点击直接跳转页面 加载一次路由
|
|
||||||
this.props.history.push(`/projects/${owner}/${projectsId}?url=${str.substr(1)}`);
|
|
||||||
} else {
|
|
||||||
list.push({
|
|
||||||
index: 0,
|
|
||||||
name,
|
|
||||||
path,
|
|
||||||
type,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
this.setState({
|
|
||||||
filePath: list,
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
// 获取子目录
|
// 获取子目录
|
||||||
getFileDetail = (path, ref) => {
|
getFileDetail = (path, ref) => {
|
||||||
this.setState({
|
this.setState({
|
||||||
|
@ -267,7 +235,8 @@ class CoderRootDirectory extends Component {
|
||||||
chooseType:type
|
chooseType:type
|
||||||
})
|
})
|
||||||
const { projectsId, owner , branchName } = this.props.match.params;
|
const { projectsId, owner , branchName } = this.props.match.params;
|
||||||
this.props.history.push(`/projects/${owner}/${projectsId}${branchName?`/branch/${branchName}`:""}?url=${path}`);
|
const { defaultBranch } = this.props;
|
||||||
|
this.props.history.push(`/projects/${owner}/${projectsId}${`/tree/${branchName || defaultBranch}`}${path?`/${path}`:""}`);
|
||||||
if(filename.substring(filename.length - 3) === ".md"){
|
if(filename.substring(filename.length - 3) === ".md"){
|
||||||
this.setState({
|
this.setState({
|
||||||
md:true
|
md:true
|
||||||
|
@ -320,17 +289,9 @@ class CoderRootDirectory extends Component {
|
||||||
|
|
||||||
// 选择分支
|
// 选择分支
|
||||||
changeBranch = (value) => {
|
changeBranch = (value) => {
|
||||||
let { search } = this.props.history.location;
|
|
||||||
const { projectsId , owner } = this.props.match.params;
|
const { projectsId , owner } = this.props.match.params;
|
||||||
|
const { treeValue } = this.state;
|
||||||
let url = `/projects/${owner}/${projectsId}${value && `/branch/${value}`}`;
|
let url = `/projects/${owner}/${projectsId}${value && `/tree/${value}`}${treeValue ? `/${treeValue}`:""}`;
|
||||||
if (search && (search.indexOf("?url=") > -1 || search.indexOf("&url=") > -1)) {
|
|
||||||
let u = search.split("url=")[1];
|
|
||||||
if(u && decodeURI(u).indexOf("&")){
|
|
||||||
u=decodeURI(u).split("&")[0];
|
|
||||||
}
|
|
||||||
url += `?url=${u}`;
|
|
||||||
}
|
|
||||||
this.props.history.push(url);
|
this.props.history.push(url);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -338,10 +299,11 @@ class CoderRootDirectory extends Component {
|
||||||
returnUlr=(url)=>{
|
returnUlr=(url)=>{
|
||||||
this.setState({
|
this.setState({
|
||||||
chooseType:"dir",
|
chooseType:"dir",
|
||||||
readOnly:true
|
readOnly:true,
|
||||||
|
treeValue:url
|
||||||
})
|
})
|
||||||
const { projectsId , owner } = this.props.match.params;
|
const { projectsId , owner , branchName } = this.props.match.params;
|
||||||
this.props.history.push(`/projects/${owner}/${projectsId}?url=${url}`);
|
this.props.history.push(`/projects/${owner}/${projectsId}${branchName?`/branch/${branchName}`:""}/tree/${url}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
onEdit=(readOnly)=>{
|
onEdit=(readOnly)=>{
|
||||||
|
|
|
@ -145,7 +145,7 @@ class CoderRootIndex extends Component{
|
||||||
() => (<CoderRootTag {...this.props} {...this.state} />)
|
() => (<CoderRootTag {...this.props} {...this.state} />)
|
||||||
}
|
}
|
||||||
></Route>
|
></Route>
|
||||||
<Route path="/projects/:owner/:projectsId/branch/:branchName"
|
<Route path="/projects/:owner/:projectsId/tree/:branchName"
|
||||||
render={
|
render={
|
||||||
(props) => (<CoderRootDirectory {...this.props} {...this.state} getTopCount={this.getTopCount} />)
|
(props) => (<CoderRootDirectory {...this.props} {...this.state} getTopCount={this.getTopCount} />)
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,7 @@ import { Link, Route, Switch } from 'react-router-dom';
|
||||||
import { Content } from '../Component/layout';
|
import { Content } from '../Component/layout';
|
||||||
import '../css/index.scss'
|
import '../css/index.scss'
|
||||||
import './list.css';
|
import './list.css';
|
||||||
|
import SpecialModal from './SpecialModal';
|
||||||
|
|
||||||
import Loadable from 'react-loadable';
|
import Loadable from 'react-loadable';
|
||||||
import Loading from '../../Loading';
|
import Loading from '../../Loading';
|
||||||
|
@ -114,9 +115,9 @@ const DevIndex = Loadable({
|
||||||
/**
|
/**
|
||||||
* permission:Manager:管理员,Reporter:报告人员(只有读取权限),Developer:开发人员(除不能设置仓库信息外)
|
* permission:Manager:管理员,Reporter:报告人员(只有读取权限),Developer:开发人员(除不能设置仓库信息外)
|
||||||
*/
|
*/
|
||||||
function checkPathname(projectsId,owner,pathname){
|
function checkPathname(pathname){
|
||||||
let name = "";
|
let name = "";
|
||||||
if(pathname && pathname !== `/projects/${owner}/${projectsId}`){
|
if(pathname){
|
||||||
if(pathname.indexOf("/about")>-1){
|
if(pathname.indexOf("/about")>-1){
|
||||||
name="about"
|
name="about"
|
||||||
}else if(pathname.indexOf("/issues")>-1 ||pathname.indexOf("Milepost") > 0){
|
}else if(pathname.indexOf("/issues")>-1 ||pathname.indexOf("Milepost") > 0){
|
||||||
|
@ -129,7 +130,7 @@ function checkPathname(projectsId,owner,pathname){
|
||||||
name="activity"
|
name="activity"
|
||||||
}else if(pathname.indexOf("/setting")>-1){
|
}else if(pathname.indexOf("/setting")>-1){
|
||||||
name="setting"
|
name="setting"
|
||||||
}else if(pathname.indexOf(`/devops`)>-1){
|
}else if(pathname.indexOf("/devops")>-1){
|
||||||
name="devops"
|
name="devops"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -161,7 +162,9 @@ class Detail extends Component {
|
||||||
defaultBranch:undefined,
|
defaultBranch:undefined,
|
||||||
|
|
||||||
// 非本平台项目
|
// 非本平台项目
|
||||||
platform:false
|
platform:false,
|
||||||
|
visible:false,
|
||||||
|
user_apply_signatures:[]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -178,6 +181,7 @@ class Detail extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
getProject = (num) => {
|
getProject = (num) => {
|
||||||
|
const {user} = this.props;
|
||||||
const { projectsId , owner } = this.props.match.params;
|
const { projectsId , owner } = this.props.match.params;
|
||||||
const url = `/${owner}/${projectsId}/simple.json`;
|
const url = `/${owner}/${projectsId}/simple.json`;
|
||||||
axios.get(url).then((result) => {
|
axios.get(url).then((result) => {
|
||||||
|
@ -187,6 +191,24 @@ class Detail extends Component {
|
||||||
open_devops:result.data.open_devops,
|
open_devops:result.data.open_devops,
|
||||||
platform:result.data.platform && result.data.platform !== 'educoder'
|
platform:result.data.platform && result.data.platform !== 'educoder'
|
||||||
})
|
})
|
||||||
|
let signa = result.data.user_apply_signatures && result.data.user_apply_signatures[0];
|
||||||
|
if(result.data.is_secret && !result.data.is_member && (!signa || (signa && signa.status !== "passed")) && user.login !== owner){
|
||||||
|
this.setState({
|
||||||
|
visible:true,
|
||||||
|
is_secret:result.data.is_secret,
|
||||||
|
user_apply_signatures:signa
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 工作流:两种状态进入的链接不同
|
||||||
|
const pathname = this.props.history.location.pathname;
|
||||||
|
if(pathname===`/projects/${owner}/${projectsId}/devops`){
|
||||||
|
if(result.data.open_devops && pathname === `/projects/${owner}/${projectsId}/devops`){
|
||||||
|
this.props.history.push(`/projects/${owner}/${projectsId}/devops/list`);
|
||||||
|
}else if(result.data.open_devops===false && pathname !== `/projects/${owner}/${projectsId}/devops`){
|
||||||
|
this.props.history.push(`/projects/${owner}/${projectsId}/devops`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (result.data.type !== 0 && result.data.mirror_status === 1) {
|
if (result.data.type !== 0 && result.data.mirror_status === 1) {
|
||||||
console.log("--------start channel --------");
|
console.log("--------start channel --------");
|
||||||
|
@ -347,7 +369,6 @@ class Detail extends Component {
|
||||||
const url = `/${owner}/${projectsId}/sync_mirror.json`;
|
const url = `/${owner}/${projectsId}/sync_mirror.json`;
|
||||||
axios.post(url).then(result => {
|
axios.post(url).then(result => {
|
||||||
if (result && result.data && result.data.status === 0) {
|
if (result && result.data && result.data.status === 0) {
|
||||||
this.props.showNotification("镜像同步成功!");
|
|
||||||
this.getProject(2);
|
this.getProject(2);
|
||||||
} else {
|
} else {
|
||||||
this.props.showNotification("镜像同步失败!");
|
this.props.showNotification("镜像同步失败!");
|
||||||
|
@ -357,19 +378,30 @@ class Detail extends Component {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
hideModal=()=>{
|
||||||
|
this.setState({
|
||||||
|
visible:false
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
sureModal=()=>{
|
||||||
|
this.hideModal();
|
||||||
|
this.props.history.push('/projects');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { projectDetail, watchers_count, praises_count,
|
const { projectDetail, watchers_count, praises_count,
|
||||||
forked_count, firstSync , secondSync ,
|
forked_count, firstSync , secondSync ,
|
||||||
isManager, watched, praised,
|
isManager, watched, praised,
|
||||||
project , open_devops , platform , defaultBranch } = this.state;
|
project , open_devops , platform , defaultBranch , project_id , user_apply_signatures , visible } = this.state;
|
||||||
const url = this.props.history.location.pathname;
|
const url = this.props.history.location.pathname;
|
||||||
const urlArr = url.split("/");
|
const urlArr = url.split("/");
|
||||||
const urlFlag = (urlArr.length === 3);
|
const urlFlag = (urlArr.length === 3);
|
||||||
|
let pathname = checkPathname(url);
|
||||||
|
|
||||||
const { projectsId , owner } = this.props.match.params;
|
const { projectsId , owner } = this.props.match.params;
|
||||||
let pathname = checkPathname(projectsId,owner,url);
|
|
||||||
|
|
||||||
const { state } = this.props.history.location;
|
const { state } = this.props.history.location;
|
||||||
|
|
||||||
|
@ -390,18 +422,19 @@ class Detail extends Component {
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
|
<SpecialModal {...this.props} visible={visible} hideModal={this.sureModal} user_apply_signatures={user_apply_signatures} project_id={project_id} sureModal={this.sureModal}></SpecialModal>
|
||||||
<div className="detailHeader-wrapper">
|
<div className="detailHeader-wrapper">
|
||||||
<div className="normal">
|
<div className="normal">
|
||||||
<div className="f-wrap-between pb15" style={{ position: "relative" }}>
|
<div className="f-wrap-between pb15" style={{ position: "relative" }}>
|
||||||
<p className="font-22 df flex-1 lineH2 mt15" style={{ alignItems: "center" }}>
|
<p className="color-white font-22 df flex-1 lineH2 mt15" style={{ alignItems: "center" }}>
|
||||||
{project && project.author &&
|
{project && project.author &&
|
||||||
<Link to={`${project.author.type ==="Organization" ? "/organize":'/users'}/${project.author.login}`} className="show-user-link">
|
<Link to={`/users/${project.author.login}`} className="show-user-link color-white">
|
||||||
{project.author.name}
|
{project.author.name}
|
||||||
</Link>
|
</Link>
|
||||||
}
|
}
|
||||||
<span className="ml5 mr5">/</span>
|
<span className="ml5 mr5">/</span>
|
||||||
<span className="hide-1 flex-1 df">
|
<span className="hide-1 flex-1 df">
|
||||||
<Link to={`/projects/${owner}/${projectsId}`} className="font-22">{project && project.name}</Link>
|
<Link to={`/projects/${owner}/${projectsId}`} className="color-white font-22">{project && project.name}</Link>
|
||||||
{
|
{
|
||||||
projectDetail && projectDetail.forked_from_project_id && projectDetail.fork_info ?
|
projectDetail && projectDetail.forked_from_project_id && projectDetail.fork_info ?
|
||||||
<Tooltip placement={'right'} title={text}>
|
<Tooltip placement={'right'} title={text}>
|
||||||
|
@ -438,15 +471,14 @@ class Detail extends Component {
|
||||||
<span>{watched ? '取消关注' : '关注'}</span>
|
<span>{watched ? '取消关注' : '关注'}</span>
|
||||||
</a>
|
</a>
|
||||||
{
|
{
|
||||||
watchers_count > 0 ?
|
|
||||||
platform ?
|
platform ?
|
||||||
<Link className="detail_tag_btn_count" style={{color:`${watched?"#2878FF":"#666"}`}} to={platform?{ pathname: `/projects/${owner}/${projectsId}/watchers`, state }:""}>
|
<Link className="detail_tag_btn_count" style={{color:`${watched?"#2878FF":"#666"}`}} to={platform?{ pathname: `/projects/${owner}/${projectsId}/watchers`, state }:""}>
|
||||||
{watchers_count}
|
{watchers_count}
|
||||||
</Link>
|
</Link>
|
||||||
:
|
:
|
||||||
<span className="detail_tag_btn_count">{watchers_count}</span>
|
<span className="detail_tag_btn_count">{watchers_count}</span>
|
||||||
:""
|
|
||||||
}
|
}
|
||||||
|
|
||||||
</span>
|
</span>
|
||||||
<span className="detail_tag_btn">
|
<span className="detail_tag_btn">
|
||||||
<a className="detail_tag_btn_name" style={{cursor:platform?"pointer":"default"}} onClick={() => this.pariseFunc(praised)}>
|
<a className="detail_tag_btn_name" style={{cursor:platform?"pointer":"default"}} onClick={() => this.pariseFunc(praised)}>
|
||||||
|
@ -454,13 +486,11 @@ class Detail extends Component {
|
||||||
<span>{praised ? '取消点赞' : '点赞'}</span>
|
<span>{praised ? '取消点赞' : '点赞'}</span>
|
||||||
</a>
|
</a>
|
||||||
{
|
{
|
||||||
praises_count > 0 ?
|
|
||||||
platform ?
|
platform ?
|
||||||
<Link className="detail_tag_btn_count" style={{color:`${praised?"#2878FF":"#666"}`}} to={{ pathname: `/projects/${owner}/${projectsId}/stargazers`, state }}>
|
<Link className="detail_tag_btn_count" style={{color:`${praised?"#2878FF":"#666"}`}} to={{ pathname: `/projects/${owner}/${projectsId}/stargazers`, state }}>
|
||||||
{praises_count}
|
{praises_count}
|
||||||
</Link>:
|
</Link>:
|
||||||
<span className="detail_tag_btn_count">{praises_count}</span>
|
<span className="detail_tag_btn_count">{praises_count}</span>
|
||||||
:""
|
|
||||||
}
|
}
|
||||||
</span>
|
</span>
|
||||||
<span className="detail_tag_btn">
|
<span className="detail_tag_btn">
|
||||||
|
@ -468,14 +498,12 @@ class Detail extends Component {
|
||||||
<i className="iconfont icon-fork color-grey-9 mr3"></i>复刻 (Fork)
|
<i className="iconfont icon-fork color-grey-9 mr3"></i>复刻 (Fork)
|
||||||
</a>
|
</a>
|
||||||
{
|
{
|
||||||
forked_count > 0 ?
|
|
||||||
platform ?
|
platform ?
|
||||||
<Link className="detail_tag_btn_count" to={{ pathname: `/projects/${owner}/${projectsId}/fork_users`, state }}>
|
<Link className="detail_tag_btn_count" to={{ pathname: `/projects/${owner}/${projectsId}/fork_users`, state }}>
|
||||||
{forked_count}
|
{forked_count}
|
||||||
</Link>
|
</Link>
|
||||||
:
|
:
|
||||||
<span className="detail_tag_btn_count">{forked_count}</span>
|
<span className="detail_tag_btn_count">{praises_count}</span>
|
||||||
:""
|
|
||||||
}
|
}
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
|
@ -483,23 +511,23 @@ class Detail extends Component {
|
||||||
</div>
|
</div>
|
||||||
{
|
{
|
||||||
firstSync ? "" :
|
firstSync ? "" :
|
||||||
<div className="f-wrap-between mt15">
|
<div className="f-wrap-between pb20">
|
||||||
<ul className="headerMenu-wrapper">
|
<ul className="headerMenu-wrapper">
|
||||||
<li className={pathname==="about" ? "active" : ""}>
|
<li className={pathname==="about" ? "active" : ""}>
|
||||||
<Link to={{ pathname: `/projects/${owner}/${projectsId}/about`, state }}>
|
<Link to={{ pathname: `/projects/${owner}/${projectsId}/about`, state }}>
|
||||||
<i className={(pathname==="" || urlFlag) ? "iconfont icon-zhuye1 color-grey-3 mr5 font-14":"iconfont icon-zhuye1 color-grey-6 font-14 mr5"}></i>
|
<i className={ pathname === "about" ? "iconfont icon-zhuye1 color-blue mr5 font-14":"iconfont icon-zhuye1 color-white font-14 mr5"}></i>
|
||||||
<span>主页</span>
|
<span>主页</span>
|
||||||
</Link>
|
</Link>
|
||||||
</li>
|
</li>
|
||||||
<li className={(pathname==="" || urlFlag) ? "active" : ""}>
|
<li className={(pathname==="" || urlFlag) ? "active" : ""}>
|
||||||
<Link to={{ pathname: `/projects/${owner}/${projectsId}`, state }}>
|
<Link to={{ pathname: `/projects/${owner}/${projectsId}`, state }}>
|
||||||
<i className={(pathname==="" || urlFlag) ? "iconfont icon-daimaku color-grey-3 mr5 font-14":"iconfont icon-daimaku color-grey-6 font-14 mr5"}></i>
|
<i className={(pathname==="" || urlFlag) ? "iconfont icon-daimaku color-blue mr5 font-14":"iconfont icon-daimaku color-white font-14 mr5"}></i>
|
||||||
<span>代码库</span>
|
<span>代码库</span>
|
||||||
</Link>
|
</Link>
|
||||||
</li>
|
</li>
|
||||||
<li className={pathname==="issues" ? "active" : ""}>
|
<li className={pathname==="issues" ? "active" : ""}>
|
||||||
<Link to={{ pathname: `/projects/${owner}/${projectsId}/issues`, state }}>
|
<Link to={{ pathname: `/projects/${owner}/${projectsId}/issues`, state }}>
|
||||||
<i className={pathname==="issues" ? "iconfont icon-renwu color-grey-3 mr5 font-14":"iconfont icon-renwu color-grey-6 font-14 mr5"}></i>
|
<i className={pathname==="issues" ? "iconfont icon-renwu color-blue mr5 font-14":"iconfont icon-renwu color-white font-14 mr5"}></i>
|
||||||
<span>易修 (Issue)</span>
|
<span>易修 (Issue)</span>
|
||||||
{projectDetail && projectDetail.issues_count ? <span className="num">{projectDetail.issues_count}</span> : ""}
|
{projectDetail && projectDetail.issues_count ? <span className="num">{projectDetail.issues_count}</span> : ""}
|
||||||
</Link>
|
</Link>
|
||||||
|
@ -508,32 +536,32 @@ class Detail extends Component {
|
||||||
projectDetail && parseInt(projectDetail.type) !== 2 && platform &&
|
projectDetail && parseInt(projectDetail.type) !== 2 && platform &&
|
||||||
<li className={pathname==="pulls" ? "active" : ""}>
|
<li className={pathname==="pulls" ? "active" : ""}>
|
||||||
<Link to={{ pathname: `/projects/${owner}/${projectsId}/pulls`, state }}>
|
<Link to={{ pathname: `/projects/${owner}/${projectsId}/pulls`, state }}>
|
||||||
<i className={pathname==="pulls" ? "iconfont icon-hebingqingqiu1 color-grey-3 mr5 font-14":"iconfont icon-hebingqingqiu1 color-grey-6 font-14 mr5"}></i>
|
<i className={pathname==="pulls" ? "iconfont icon-hebingqingqiu1 color-blue mr5 font-14":"iconfont icon-hebingqingqiu1 color-white font-14 mr5"}></i>
|
||||||
<span>合并请求</span>
|
<span>合并请求</span>
|
||||||
{projectDetail && projectDetail.pull_requests_count ? <span className="num">{projectDetail.pull_requests_count}</span> : ""}
|
{projectDetail && projectDetail.pull_requests_count ? <span className="num">{projectDetail.pull_requests_count}</span> : ""}
|
||||||
</Link>
|
</Link>
|
||||||
</li>
|
</li>
|
||||||
}
|
}
|
||||||
{
|
{/* {
|
||||||
platform &&
|
platform &&
|
||||||
<li className={pathname==="devops" ? "active" : ""}>
|
<li className={pathname==="devops" ? "active" : ""}>
|
||||||
<Link to={{ pathname: `/projects/${owner}/${projectsId}/devops${open_devops ? `/dispose`:""}`, state }}>
|
<Link to={{ pathname: `/projects/${owner}/${projectsId}/devops${open_devops ? `/list`:""}`, state }}>
|
||||||
<i className="iconfont icon-gongzuoliu font-13 mr8"></i>工作流(beta版)
|
<i className="iconfont icon-gongzuoliu font-13 mr8"></i>工作流(beta版)
|
||||||
{projectDetail && projectDetail.ops_count ? <span>{projectDetail.ops_count}</span> : ""}
|
{projectDetail && projectDetail.ops_count ? <span>{projectDetail.ops_count}</span> : ""}
|
||||||
</Link>
|
</Link>
|
||||||
</li>
|
</li>
|
||||||
}
|
} */}
|
||||||
|
|
||||||
<li className={pathname==="milestones" ? "active" : ""}>
|
<li className={pathname==="milestones" ? "active" : ""}>
|
||||||
<Link to={{ pathname: `/projects/${owner}/${projectsId}/milestones`, state }}>
|
<Link to={{ pathname: `/projects/${owner}/${projectsId}/milestones`, state }}>
|
||||||
<i className={pathname==="milestones" ? "iconfont icon-lichengbei color-grey-3 mr5 font-14":"iconfont icon-lichengbei color-grey-6 font-14 mr5"}></i>
|
<i className={pathname==="milestones" ? "iconfont icon-lichengbei color-blue mr5 font-14":"iconfont icon-lichengbei color-white font-14 mr5"}></i>
|
||||||
<span>里程碑</span>
|
<span>里程碑</span>
|
||||||
{projectDetail && projectDetail.versions_count ? <span className="num">{projectDetail.versions_count}</span> :""}
|
{projectDetail && projectDetail.versions_count ? <span className="num">{projectDetail.versions_count}</span> :""}
|
||||||
</Link>
|
</Link>
|
||||||
</li>
|
</li>
|
||||||
<li className={pathname==="activity" ? "active" : ""}>
|
<li className={pathname==="activity" ? "active" : ""}>
|
||||||
<Link to={{ pathname: `/projects/${owner}/${projectsId}/activity`, state }}>
|
<Link to={{ pathname: `/projects/${owner}/${projectsId}/activity`, state }}>
|
||||||
<i className={pathname==="activity" ? "iconfont icon-tongzhi color-grey-3 mr5 font-14":"iconfont icon-tongzhi color-grey-6 font-14 mr5"}></i>
|
<i className={pathname==="activity" ? "iconfont icon-tongzhi color-blue mr5 font-14":"iconfont icon-tongzhi color-white font-14 mr5"}></i>
|
||||||
<span>动态</span>
|
<span>动态</span>
|
||||||
</Link>
|
</Link>
|
||||||
</li>
|
</li>
|
||||||
|
@ -541,7 +569,7 @@ class Detail extends Component {
|
||||||
isManager && platform &&
|
isManager && platform &&
|
||||||
<li className={url.indexOf("/setting") > 0 ? "active" : ""}>
|
<li className={url.indexOf("/setting") > 0 ? "active" : ""}>
|
||||||
<Link to={`/projects/${owner}/${projectsId}/setting`}>
|
<Link to={`/projects/${owner}/${projectsId}/setting`}>
|
||||||
<i className={url.indexOf("/setting") > 0 ? "iconfont icon-cangku color-grey-3 mr5 font-14":"iconfont icon-cangku color-grey-6 font-14 mr5"}></i>
|
<i className={url.indexOf("/setting") > 0 ? "iconfont icon-cangku color-blue mr5 font-14":"iconfont icon-cangku color-white font-14 mr5"}></i>
|
||||||
<span>仓库设置</span>
|
<span>仓库设置</span>
|
||||||
</Link>
|
</Link>
|
||||||
</li>
|
</li>
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import { Link } from 'react-router-dom';
|
import { Link } from 'react-router-dom';
|
||||||
import { Menu, Input , Spin, Pagination , Popover , Select } from 'antd';
|
import { Menu, Input , Spin, Pagination , Popover } from 'antd';
|
||||||
import { getUrl } from 'educoder';
|
|
||||||
import '../css/index.scss'
|
import '../css/index.scss'
|
||||||
import './list.css';
|
import './list.css';
|
||||||
import './Index.scss';
|
import './Index.scss';
|
||||||
|
@ -9,7 +8,7 @@ import ListItem from './IndexItem'
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import img_new from '../Images/new.png';
|
import img_new from '../Images/new.png';
|
||||||
import img_array from '../Images/array.png';
|
import img_array from '../Images/array.png';
|
||||||
import banner from '../Images/banner_list.jpg';
|
import banner from '../Images/banner_list.png';
|
||||||
const Search = Input.Search;
|
const Search = Input.Search;
|
||||||
|
|
||||||
class Index extends Component {
|
class Index extends Component {
|
||||||
|
@ -23,7 +22,6 @@ class Index extends Component {
|
||||||
sort: undefined,
|
sort: undefined,
|
||||||
total: 0,
|
total: 0,
|
||||||
isSpin: true,
|
isSpin: true,
|
||||||
project_type: undefined,
|
|
||||||
category_id: undefined,
|
category_id: undefined,
|
||||||
|
|
||||||
typeList: undefined,
|
typeList: undefined,
|
||||||
|
@ -37,8 +35,8 @@ class Index extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount = () => {
|
componentDidMount = () => {
|
||||||
const { page, limit, search, sort, project_type, category_id , languageId } = this.state;
|
const { page,search, sort,category_id , languageId } = this.state;
|
||||||
this.getListData(page, limit, search, sort, project_type, category_id , languageId);
|
this.getListData(page,search, sort,category_id , languageId);
|
||||||
|
|
||||||
this.getType();
|
this.getType();
|
||||||
|
|
||||||
|
@ -73,19 +71,18 @@ class Index extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取列表
|
// 获取列表
|
||||||
getListData = (page, limit, search, sort, project_type, category_id,languageId) => {
|
getListData = (page,search, sort,category_id,language_id) => {
|
||||||
const { current_user } = this.props;
|
const { current_user } = this.props;
|
||||||
const url = `/projects.json`;
|
const url = `/projects.json`;
|
||||||
axios.get(url, {
|
axios.get(url, {
|
||||||
params: {
|
params: {
|
||||||
user_id: current_user && current_user.user_id,
|
user_id: current_user && current_user.user_id,
|
||||||
page,
|
page,
|
||||||
limit,
|
limit:15,
|
||||||
search,
|
search,
|
||||||
sort_by: sort,
|
sort_by: sort,
|
||||||
project_type,
|
|
||||||
category_id,
|
category_id,
|
||||||
language_id:languageId
|
language_id
|
||||||
}
|
}
|
||||||
}).then((result) => {
|
}).then((result) => {
|
||||||
if (result) {
|
if (result) {
|
||||||
|
@ -112,7 +109,7 @@ class Index extends Component {
|
||||||
this.setState({
|
this.setState({
|
||||||
typeList: list.map((item, key) => {
|
typeList: list.map((item, key) => {
|
||||||
return (
|
return (
|
||||||
<li key={key} className={active_type && active_type === item.project_type ? 'active' : ''} onClick={() => this.changeType(`${item.project_type}`, list)}>
|
<li key={key} className={active_type && parseInt(active_type) === item.id ? 'active' : ''} onClick={() => this.changeType(`${item.id}`, list)}>
|
||||||
<p>
|
<p>
|
||||||
<span className="font-16">{item.name}</span>
|
<span className="font-16">{item.name}</span>
|
||||||
<span className="color-blue">{item.projects_count}</span>
|
<span className="color-blue">{item.projects_count}</span>
|
||||||
|
@ -124,15 +121,15 @@ class Index extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
// 切换类型
|
// 切换类型
|
||||||
changeType = (type, list) => {
|
changeType = (id, list) => {
|
||||||
this.setState({
|
this.setState({
|
||||||
isSpin: true,
|
isSpin: true,
|
||||||
project_type: type,
|
languageId: id,
|
||||||
search: undefined
|
search: undefined
|
||||||
})
|
})
|
||||||
this.setTypeList(list, type)
|
this.setTypeList(list, id)
|
||||||
const { page, limit, sort, category_id , languageId } = this.state;
|
const { page,sort, category_id} = this.state;
|
||||||
this.getListData(page, limit, undefined, sort, type, category_id , languageId);
|
this.getListData(page,undefined, sort,category_id , id);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取类型
|
// 获取类型
|
||||||
|
@ -167,8 +164,8 @@ class Index extends Component {
|
||||||
page: 1
|
page: 1
|
||||||
});
|
});
|
||||||
this.setCategoryList(list, id)
|
this.setCategoryList(list, id)
|
||||||
const { limit, sort, project_type , languageId } = this.state;
|
const { sort,languageId } = this.state;
|
||||||
this.getListData(1, limit, undefined, sort, project_type, id , languageId);
|
this.getListData(1,undefined, sort,id , languageId);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 排序
|
// 排序
|
||||||
|
@ -179,8 +176,8 @@ class Index extends Component {
|
||||||
search: undefined,
|
search: undefined,
|
||||||
isSpin: true
|
isSpin: true
|
||||||
})
|
})
|
||||||
const { limit, project_type, category_id , languageId } = this.state;
|
const {category_id , languageId } = this.state;
|
||||||
this.getListData(1, limit, undefined, e.key, project_type, category_id , languageId);
|
this.getListData(1,undefined, e.key,category_id , languageId);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 搜索
|
// 搜索
|
||||||
|
@ -192,8 +189,8 @@ class Index extends Component {
|
||||||
project_type: undefined,
|
project_type: undefined,
|
||||||
sort: "updated_on"
|
sort: "updated_on"
|
||||||
})
|
})
|
||||||
const { limit, sort, category_id , languageId } = this.state;
|
const {sort, category_id , languageId } = this.state;
|
||||||
this.getListData(1, limit, value, sort, undefined, category_id , languageId);
|
this.getListData(1,value, sort,category_id , languageId);
|
||||||
}
|
}
|
||||||
changeSearchValue = (e) => {
|
changeSearchValue = (e) => {
|
||||||
this.setState({
|
this.setState({
|
||||||
|
@ -205,23 +202,14 @@ class Index extends Component {
|
||||||
this.setState({
|
this.setState({
|
||||||
page
|
page
|
||||||
})
|
})
|
||||||
const { limit, search, sort, project_type, category_id , languageId } = this.state;
|
const {search, sort,category_id , languageId } = this.state;
|
||||||
this.getListData(page, limit, search, sort, project_type, category_id , languageId);
|
this.getListData(page,search, sort, category_id , languageId);
|
||||||
}
|
}
|
||||||
|
|
||||||
getoDetail=(login,identifier)=>{
|
getoDetail=(login,identifier)=>{
|
||||||
this.props.history.push(`/projects/${login}/${identifier}`);
|
this.props.history.push(`/projects/${login}/${identifier}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 选择语言类别
|
|
||||||
changeLanguage=(e)=>{
|
|
||||||
this.setState({
|
|
||||||
isSpin:true,
|
|
||||||
languageId:e === 0 ?undefined:e
|
|
||||||
})
|
|
||||||
const { page, limit, sort , project_type , category_id } = this.state;
|
|
||||||
this.getListData(page, limit, undefined, sort, project_type, category_id ,e === 0 ?undefined:e);
|
|
||||||
}
|
|
||||||
|
|
||||||
menu =()=> {
|
menu =()=> {
|
||||||
return(
|
return(
|
||||||
|
@ -255,15 +243,14 @@ class Index extends Component {
|
||||||
render() {
|
render() {
|
||||||
const { current_user } = this.props;
|
const { current_user } = this.props;
|
||||||
|
|
||||||
const { projectsList , recommendList , languageList , languageId ,
|
const { projectsList , isSpin , total , search , limit , page , typeList , categoryList } = this.state;
|
||||||
isSpin, total, search, limit, page, typeList, categoryList } = this.state;
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<p className="t_project_banner">
|
<p className="t_project_banner">
|
||||||
<img src={banner} width="100%" alt=""/>
|
<img src={banner} width="100%" alt=""/>
|
||||||
</p>
|
</p>
|
||||||
{
|
{/* {
|
||||||
recommendList && recommendList.length>0 &&
|
recommendList && recommendList.length>0 &&
|
||||||
<div className="recommandProjects">
|
<div className="recommandProjects">
|
||||||
{
|
{
|
||||||
|
@ -285,44 +272,23 @@ class Index extends Component {
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
*/}
|
||||||
<div className="ProjectListIndex">
|
<div className="ProjectListIndex">
|
||||||
<div className="list-left">
|
<div className="list-left">
|
||||||
<ul className="list-l-Menu">
|
<ul className="list-l-Menu">
|
||||||
<li className="MenuTitle"><i className="iconfont icon-xiangmuleixing color-grey-9 font-15 mr5"></i>项目类型</li>
|
<li className="MenuTitle"><i className="iconfont icon-bianchengyuyan color-grey-9 font-15 mr5"></i>
|
||||||
{typeList}
|
语言</li>
|
||||||
|
<div className="list-affix">{typeList}</div>
|
||||||
</ul>
|
</ul>
|
||||||
<ul className="list-l-Menu">
|
<ul className="list-l-Menu">
|
||||||
<li className="MenuTitle"><i className="iconfont icon-xiangmuleibie color-grey-9 font-15 mr5"></i>项目类别</li>
|
<li className="MenuTitle"><i className="iconfont icon-xiangmuleibie color-grey-9 font-15 mr5"></i>项目类别</li>
|
||||||
{categoryList}
|
<div className="list-affix">{categoryList}</div>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div className="list-right boxShandow radius-2" style={{padding:0}}>
|
<div className="list-right boxShandow radius-2" style={{padding:0}}>
|
||||||
<Spin spinning={isSpin}>
|
<Spin spinning={isSpin}>
|
||||||
<div className="list-r-operation">
|
<div className="list-r-operation">
|
||||||
<div>
|
<div>
|
||||||
<Select
|
|
||||||
showSearch
|
|
||||||
placeholder="请选择语言"
|
|
||||||
style={{width:"150px",marginRight:"20px"}}
|
|
||||||
size={"large"}
|
|
||||||
onChange={this.changeLanguage}
|
|
||||||
value={languageId}
|
|
||||||
allowClear={true}
|
|
||||||
optionFilterProp="children"
|
|
||||||
filterOption={(input,option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0}
|
|
||||||
>
|
|
||||||
<Select.Option key={0} value={0}>请选择语言</Select.Option>
|
|
||||||
{
|
|
||||||
languageList && languageList.length>0 && languageList.map((item,key)=>{
|
|
||||||
return(
|
|
||||||
<Select.Option key={item.id} value={item.id}>
|
|
||||||
{item.name}
|
|
||||||
</Select.Option>
|
|
||||||
)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
</Select>
|
|
||||||
<Search
|
<Search
|
||||||
placeholder="输入项目名称关键字进行搜索"
|
placeholder="输入项目名称关键字进行搜索"
|
||||||
enterButton="搜索"
|
enterButton="搜索"
|
||||||
|
@ -350,7 +316,7 @@ class Index extends Component {
|
||||||
</Popover>
|
</Popover>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<ListItem {...this.props} {...this.state} projects={projectsList}></ListItem>
|
<ListItem {...this.props} {...this.state} projects={projectsList} getListData={this.getListData}></ListItem>
|
||||||
{this.pagination(total,limit,page)}
|
{this.pagination(total,limit,page)}
|
||||||
</Spin>
|
</Spin>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -72,3 +72,15 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.singleBtn{
|
||||||
|
display: inline-block;
|
||||||
|
.ant-upload-list-item{
|
||||||
|
position: absolute;
|
||||||
|
bottom: 0px;
|
||||||
|
width: 100%;
|
||||||
|
left: 0px;
|
||||||
|
.ant-upload-list-item-name{
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -6,24 +6,70 @@ import '../css/index.scss';
|
||||||
import Nodata from '../Nodata';
|
import Nodata from '../Nodata';
|
||||||
import './list.css';
|
import './list.css';
|
||||||
import img_parise from '../Images/parise.png';
|
import img_parise from '../Images/parise.png';
|
||||||
|
import SpecialModal from './SpecialModal';
|
||||||
|
|
||||||
class IndexItem extends Component {
|
class IndexItem extends Component {
|
||||||
|
constructor(props){
|
||||||
|
super(props);
|
||||||
|
this.state={
|
||||||
|
visible:false,
|
||||||
|
user_apply_signatures:[],
|
||||||
|
project_id:undefined
|
||||||
|
}
|
||||||
|
}
|
||||||
TurnToDetail = (login, url) => {
|
TurnToDetail = (login, url) => {
|
||||||
this.props.history.push({
|
this.props.history.push({
|
||||||
pathname: url,
|
pathname: url,
|
||||||
state: login
|
state: login
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* link:跳转到详情的地址
|
||||||
|
* user_apply_signatures:是否已经发送访问特殊开源项目的文件
|
||||||
|
* project_id:项目id
|
||||||
|
* is_secret:是否是特殊开源许可证项目
|
||||||
|
* id:创建者login
|
||||||
|
* is_member:是否是项目成员(如果是项目成员可以直接进入项目)
|
||||||
|
* */
|
||||||
|
projectHref=(link , user_apply_signatures,project_id,is_secret , id,is_member)=>{
|
||||||
|
const { user , showLoginDialog } = this.props;
|
||||||
|
if(is_secret && (!user || (user && !user.login))){
|
||||||
|
showLoginDialog();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
let signa = user_apply_signatures && user_apply_signatures[0];
|
||||||
|
if((is_secret && !is_member && (!signa || (signa && signa.status !== "passed"))) && user.login !== id ){
|
||||||
|
this.setState({
|
||||||
|
visible:true,
|
||||||
|
user_apply_signatures:user_apply_signatures.length>0 ? user_apply_signatures[0] : undefined,
|
||||||
|
project_id
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
this.props.history.push(link);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
hideModal=()=>{
|
||||||
|
this.setState({
|
||||||
|
visible:false
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
sureModal=()=>{
|
||||||
|
this.hideModal();
|
||||||
|
const { getListData } = this.props;
|
||||||
|
getListData && getListData(1);
|
||||||
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { projects } = this.props;
|
const { projects } = this.props;
|
||||||
return (
|
const { visible , user_apply_signatures , project_id } = this.state;
|
||||||
<div className="project-list minH-670">
|
const renderList = (
|
||||||
{ projects && projects.length > 0 ? projects.map((item, key) => {
|
projects && projects.length > 0 ? projects.map((item, key) => {
|
||||||
return (
|
return (
|
||||||
<div className="p-r-Item" key={key}>
|
<div className="p-r-Item" key={key}>
|
||||||
{
|
{
|
||||||
item.platform === "educoder" ?
|
item.platform === "educoder" ?
|
||||||
<a href="javascript:void(0)" style={{cursor:"default"}} className="show-user-link">
|
<a style={{cursor:"default"}} className="show-user-link">
|
||||||
<img className="p-r-photo" alt="" src={item.author && item.author.image_url} ></img>
|
<img className="p-r-photo" alt="" src={item.author && item.author.image_url} ></img>
|
||||||
</a>
|
</a>
|
||||||
:
|
:
|
||||||
|
@ -33,7 +79,7 @@ class IndexItem extends Component {
|
||||||
}
|
}
|
||||||
<div className="p-r-Infos">
|
<div className="p-r-Infos">
|
||||||
<div className="p-r-name">
|
<div className="p-r-name">
|
||||||
<Link to={`/projects/${item.author.login}/${item.identifier}`} className="hide-1 color-grey-3 font-18 task-hide " style={{ whiteSpace: "wrap", display: 'flex', width: 400 }}>
|
<a onClick={()=>this.projectHref(`/projects/${item.author.login}/${item.identifier}`,item.user_apply_signatures, item.id,item.is_secret,item.author.login,item.is_member)} className="hide-1 color-grey-3 font-18 task-hide fwt-500 " style={{ whiteSpace: "wrap", display: 'flex', width: 400 }}>
|
||||||
{item.author.name}/{item.name}
|
{item.author.name}/{item.name}
|
||||||
{
|
{
|
||||||
item.forked_from_project_id ?
|
item.forked_from_project_id ?
|
||||||
|
@ -52,13 +98,13 @@ class IndexItem extends Component {
|
||||||
<i className="iconfont icon-jingxiang font-18 color-green" />
|
<i className="iconfont icon-jingxiang font-18 color-green" />
|
||||||
</span>:""
|
</span>:""
|
||||||
}
|
}
|
||||||
</Link>
|
</a>
|
||||||
<span className="p-r-tags">
|
<span className="p-r-tags">
|
||||||
<span className="pariseTag"><img src={img_parise} alt="" className="pariseImg" />赞 {item.praises_count}</span>
|
<span className="pariseTag"><img src={img_parise} alt="" className="pariseImg" />赞 {item.praises_count}</span>
|
||||||
<span><i className="iconfont icon-fork mr3 font-16" style={{ color: "#1B8FFF" }} />fork {item.forked_count}</span>
|
<span><i className="iconfont icon-fork mr3 font-16" style={{ color: "#1B8FFF" }} />fork {item.forked_count}</span>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<p className="break_word task-hide-2 mt10" style={{ maxHeight: "44px",lineHeight:"22px" }}>{item.description}</p>
|
<p className="break_word task-hide-2 mt8 color-grey-3 " style={{ maxHeight: "44px",lineHeight:"22px" }}>{item.description}</p>
|
||||||
|
|
||||||
<div className="p-r-about">
|
<div className="p-r-about">
|
||||||
<span className="p-r-detail">
|
<span className="p-r-detail">
|
||||||
|
@ -71,7 +117,12 @@ class IndexItem extends Component {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}) : <Nodata _html="暂无数据~"></Nodata>}
|
}) : <Nodata _html="暂无数据~"></Nodata>
|
||||||
|
)
|
||||||
|
return (
|
||||||
|
<div className="project-list minH-670">
|
||||||
|
<SpecialModal {...this.props} visible={visible} hideModal={this.hideModal} user_apply_signatures={user_apply_signatures} project_id={project_id} sureModal={this.sureModal}></SpecialModal>
|
||||||
|
{renderList}
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,49 @@
|
||||||
|
import React , { useEffect , useState } from 'react';
|
||||||
|
import { Modal } from 'antd';
|
||||||
|
import UploadSingle from '../Upload/single';
|
||||||
|
import './Index.scss';
|
||||||
|
import axios from 'axios';
|
||||||
|
import { getUrl } from 'educoder';
|
||||||
|
|
||||||
|
function SpecialModal({ visible , hideModal , sureModal , showNotification , user_apply_signatures , project_id }){
|
||||||
|
const [ id ,setId ] = useState(undefined);
|
||||||
|
|
||||||
|
|
||||||
|
function loadFunc(id){
|
||||||
|
setId(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
function sure(){
|
||||||
|
if(!user_apply_signatures || (user_apply_signatures && user_apply_signatures.status !== "waiting")){
|
||||||
|
if(!id || (id && id.length === 0)){
|
||||||
|
showNotification("请先提交文件进行审核!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const url = `/apply_signatures.json`;
|
||||||
|
axios.post(url,{
|
||||||
|
attachment_id:id,
|
||||||
|
project_id:project_id
|
||||||
|
}).then(result=>{
|
||||||
|
if(result && result.data.id){
|
||||||
|
showNotification("已提交文件,正在等待审核!");
|
||||||
|
sureModal();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
sureModal();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return(
|
||||||
|
<Modal title="提示" visible={visible} closable={false} onCancel={hideModal} onOk={sure}>
|
||||||
|
{
|
||||||
|
!user_apply_signatures || (user_apply_signatures && user_apply_signatures.status !== "waiting") ?
|
||||||
|
<div style={{width:"420px",textAlign:'center',margin:"0 auto",paddingBottom:"30px",position:"relative"}}>
|
||||||
|
<div>该项目为私有项目,请先<a href={getUrl(`/api/apply_signatures/template_file`)} className="color-blue">下载</a>开源协议,阅读并填写<br/>相关信息后,将协议<UploadSingle size={"5"} load={loadFunc} showNotification={showNotification} className={'singleBtn'}><span className="color-blue" style={{cursor:"pointer"}}>上传</span></UploadSingle>,平台审核通过后即可进入当前项目</div>
|
||||||
|
</div>
|
||||||
|
:
|
||||||
|
<p style={{textAlign:'center'}}>您上传的文件正在审核中,通过后才能访问当前项目</p>
|
||||||
|
}
|
||||||
|
</Modal>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
export default SpecialModal;
|
|
@ -208,9 +208,7 @@
|
||||||
}
|
}
|
||||||
/* -----------详情------------ */
|
/* -----------详情------------ */
|
||||||
.detailHeader-wrapper{
|
.detailHeader-wrapper{
|
||||||
background-color:#FAFBFC;
|
background:linear-gradient(82deg,rgba(82,91,215,1) 0%,rgba(34,24,171,1) 100%);
|
||||||
/* background: url(../Images/forgeBanner.jpg) no-repeat center; */
|
|
||||||
/* background-size:cover; */
|
|
||||||
}
|
}
|
||||||
.headerMenu-wrapper{
|
.headerMenu-wrapper{
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
|
@ -222,36 +220,42 @@
|
||||||
text-align: center;
|
text-align: center;
|
||||||
height: 40px;
|
height: 40px;
|
||||||
line-height: 28px;
|
line-height: 28px;
|
||||||
margin-right: 40px;
|
border:1px solid transparent;
|
||||||
|
}
|
||||||
|
.headerMenu-wrapper{
|
||||||
|
font-size: 16px;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
}
|
||||||
|
.headerMenu-wrapper li{
|
||||||
|
padding:0px 18px;
|
||||||
|
position: relative;
|
||||||
|
text-align: center;
|
||||||
|
height: 30px;
|
||||||
|
line-height: 30px;
|
||||||
}
|
}
|
||||||
.headerMenu-wrapper li a{
|
.headerMenu-wrapper li a{
|
||||||
color: #666;
|
color: #fff;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
}
|
}
|
||||||
.headerMenu-wrapper li a > img{
|
.headerMenu-wrapper li a > img{
|
||||||
margin-right: 8px;
|
margin-right: 8px;
|
||||||
}
|
}
|
||||||
.headerMenu-wrapper li a > span.num{
|
.headerMenu-wrapper li a > span{
|
||||||
height: 28px;
|
display: block;
|
||||||
line-height: 29px;
|
margin-left: 5px;
|
||||||
margin-left: 8px;
|
font-size: 16px;
|
||||||
font-size: 12px;
|
|
||||||
color: #2878FF;
|
|
||||||
float: right;
|
|
||||||
}
|
}
|
||||||
.headerMenu-wrapper li.active::after{
|
.headerMenu-wrapper li.active{
|
||||||
position: absolute;
|
border-radius: 15px;
|
||||||
bottom:0px;
|
border:1px solid #71A6FF;
|
||||||
height:2px;
|
|
||||||
background-color: #5091FF;
|
|
||||||
content:'';
|
|
||||||
left: 0px;
|
|
||||||
width:100%;
|
|
||||||
}
|
}
|
||||||
.detail_tag_btn{
|
.detail_tag_btn{
|
||||||
height:26px;
|
height:26px;
|
||||||
line-height: 26px;
|
line-height: 26px;
|
||||||
border-radius:5px;
|
border-radius:5px;
|
||||||
border:1px solid #f1f1f1;
|
border:1px solid #71A6FF;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
margin-left: 30px
|
margin-left: 30px
|
||||||
|
@ -259,19 +263,26 @@
|
||||||
.ant-tooltip {
|
.ant-tooltip {
|
||||||
max-width: fit-content!important;
|
max-width: fit-content!important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.detail_tag_btn_name{
|
.detail_tag_btn_name{
|
||||||
padding:0px 10px;
|
padding:0px 10px;
|
||||||
color: #666!important;
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
color: #fff;
|
||||||
}
|
}
|
||||||
.detail_tag_btn_name img{
|
.detail_tag_btn_name img{
|
||||||
margin-right: 10px;
|
margin-right: 10px;
|
||||||
}
|
}
|
||||||
.detail_tag_btn_count{
|
.detail_tag_btn_count{
|
||||||
padding:0px 10px;
|
padding:0px 10px;
|
||||||
background: #fff;
|
color: #fff !important;
|
||||||
|
background: rgba(255,255,255,0.2);
|
||||||
border-radius: 0px 4px 4px 0px;
|
border-radius: 0px 4px 4px 0px;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
height:100%;
|
}
|
||||||
|
.detail_tag_btn_count:hover{
|
||||||
|
/* color: #1C91FF !important; */
|
||||||
|
background: rgba(255,255,255,0.5);
|
||||||
}
|
}
|
||||||
.files-md{
|
.files-md{
|
||||||
border:1px solid #eee;
|
border:1px solid #eee;
|
||||||
|
|
|
@ -47,7 +47,7 @@ function Files({data,history,owner,projectsId}){
|
||||||
<span>{item.name}</span>
|
<span>{item.name}</span>
|
||||||
</AlignCenter>
|
</AlignCenter>
|
||||||
<span>
|
<span>
|
||||||
<Button className="mr20" onClick={()=>{history.push(`/projects/${owner}/${projectsId}${item.sha ? `/branch/${truncateCommitId(item.sha)}?`:"?"}url=${item.name}`)}}>查看文件</Button>
|
<Button className="mr20" onClick={()=>{history.push(`/projects/${owner}/${projectsId}${item.sha ? `/branch/${truncateCommitId(item.sha)}/`:"/"}tree/${item.name}`)}}>查看文件</Button>
|
||||||
<span className="color-green">+{item.addition}</span>
|
<span className="color-green">+{item.addition}</span>
|
||||||
<span className="color-red ml20">-{item.deletion}</span>
|
<span className="color-red ml20">-{item.deletion}</span>
|
||||||
</span>
|
</span>
|
||||||
|
|
|
@ -122,12 +122,12 @@ class MessageCount extends Component {
|
||||||
SpinMerge: true,
|
SpinMerge: true,
|
||||||
});
|
});
|
||||||
const { projectsId , owner } = this.props.match.params;
|
const { projectsId , owner } = this.props.match.params;
|
||||||
const { data, title, body, mergekey, pr_status } = this.state;
|
const { title, body, mergekey, pull_request } = this.state;
|
||||||
const url = `/${owner}/${projectsId}/pulls/${data.pull_request.id}/pr_merge.json`;
|
const url = `/${owner}/${projectsId}/pulls/${pull_request.id}/pr_merge.json`;
|
||||||
axios
|
axios
|
||||||
.post(url, {
|
.post(url, {
|
||||||
project_id: projectsId,
|
project_id: projectsId,
|
||||||
id: data.pull_request.id,
|
id: pull_request.id,
|
||||||
do: mergekey,
|
do: mergekey,
|
||||||
body: body,
|
body: body,
|
||||||
title: title,
|
title: title,
|
||||||
|
@ -255,6 +255,11 @@ class MessageCount extends Component {
|
||||||
pull_request
|
pull_request
|
||||||
} = this.state;
|
} = this.state;
|
||||||
const { current_user, projectDetail } = this.props;
|
const { current_user, projectDetail } = this.props;
|
||||||
|
|
||||||
|
const permission = projectDetail && (projectDetail.permission === "Admin" || projectDetail.permission === "Owner" || projectDetail.permission === "Manager");
|
||||||
|
const userLogin = current_user && current_user.login;
|
||||||
|
const operate = userLogin && projectDetail && pr_status === 0 && permission;
|
||||||
|
|
||||||
const menu = (
|
const menu = (
|
||||||
<Menu onClick={(e) => this.getOption(e)}>
|
<Menu onClick={(e) => this.getOption(e)}>
|
||||||
<Menu.Item key={"merge"} value="合并请求">
|
<Menu.Item key={"merge"} value="合并请求">
|
||||||
|
@ -271,11 +276,9 @@ class MessageCount extends Component {
|
||||||
</Menu.Item>
|
</Menu.Item>
|
||||||
</Menu>
|
</Menu>
|
||||||
);
|
);
|
||||||
const permission = projectDetail && (projectDetail.permission === "Admin" || projectDetail.permission === "Owner" || projectDetail.permission === "Manager");
|
|
||||||
const userLogin = current_user && current_user.login;
|
|
||||||
const operate = userLogin && projectDetail && pr_status === 0 && permission;
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div className="">
|
||||||
{data ? (
|
{data ? (
|
||||||
<div>
|
<div>
|
||||||
<div className="main">
|
<div className="main">
|
||||||
|
@ -285,13 +288,13 @@ class MessageCount extends Component {
|
||||||
<div className="ver-middle">
|
<div className="ver-middle">
|
||||||
<span className="mr10 ver-middle">
|
<span className="mr10 ver-middle">
|
||||||
<span className="font-18 fwb">
|
<span className="font-18 fwb">
|
||||||
{data.issue.subject}
|
{ data.issue && data.issue.subject}
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
{data.pull_request && (
|
{pull_request && (
|
||||||
<Tag
|
<Tag
|
||||||
className={`pr_tags_${data.pull_request.pull_request_staus}`}
|
className={`pr_tags_${pull_request.pull_request_staus}`}
|
||||||
>
|
>
|
||||||
{pr_status === 1
|
{pr_status === 1
|
||||||
? "已合并"
|
? "已合并"
|
||||||
|
@ -305,10 +308,10 @@ class MessageCount extends Component {
|
||||||
<div className="mt15">
|
<div className="mt15">
|
||||||
<Tag className="pr-branch-tag">
|
<Tag className="pr-branch-tag">
|
||||||
<Link
|
<Link
|
||||||
to={`/projects/${owner}/${data.pull_request.is_original?data.project_identifier:projectsId}/branch/${data.pull_request.head}`}
|
to={`/projects/${owner}/${pull_request.is_original?data.project_identifier:projectsId}/branch/${pull_request.head}`}
|
||||||
className="ver-middle"
|
className="ver-middle"
|
||||||
>
|
>
|
||||||
{data.pull_request.is_original ? data.pull_request.fork_project_user : data.issue.project_author_name}:{data.pull_request.head}
|
{pull_request.is_original ? pull_request.fork_project_user : data.issue.project_author_name}:{pull_request.head}
|
||||||
</Link>
|
</Link>
|
||||||
</Tag>
|
</Tag>
|
||||||
<span className="mr8 ver-middle">
|
<span className="mr8 ver-middle">
|
||||||
|
@ -320,11 +323,11 @@ class MessageCount extends Component {
|
||||||
</span>
|
</span>
|
||||||
<Tag className="pr-branch-tag">
|
<Tag className="pr-branch-tag">
|
||||||
<Link
|
<Link
|
||||||
to={`/projects/${owner}/${projectsId}/branch/${data.pull_request.base}`}
|
to={`/projects/${owner}/${projectsId}/branch/${pull_request.base}`}
|
||||||
className="ver-middle"
|
className="ver-middle"
|
||||||
>
|
>
|
||||||
{/* {data.pull_request.is_fork ? data.pull_request.base : `${data.pull_request.pull_request_user}:${data.pull_request.base}`} */}
|
{/* {data.pull_request.is_fork ? data.pull_request.base : `${data.pull_request.pull_request_user}:${data.pull_request.base}`} */}
|
||||||
{data.issue.project_author_name}:{data.pull_request.base}
|
{data.issue.project_author_name}:{pull_request.base}
|
||||||
</Link>
|
</Link>
|
||||||
</Tag>
|
</Tag>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -43,7 +43,9 @@ class Index extends Component {
|
||||||
project_language_name: undefined,
|
project_language_name: undefined,
|
||||||
project_category_name: undefined,
|
project_category_name: undefined,
|
||||||
license_name: undefined,
|
license_name: undefined,
|
||||||
ignore_name: undefined
|
ignore_name: undefined,
|
||||||
|
|
||||||
|
licenseForDisabled:undefined
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
componentDidMount = () => {
|
componentDidMount = () => {
|
||||||
|
@ -145,7 +147,7 @@ class Index extends Component {
|
||||||
_data = data.filter(item => item.name.toLowerCase().indexOf(name.toLowerCase()) > -1);
|
_data = data.filter(item => item.name.toLowerCase().indexOf(name.toLowerCase()) > -1);
|
||||||
}
|
}
|
||||||
let list = _data && _data.map((item) => (
|
let list = _data && _data.map((item) => (
|
||||||
<Option key={item.id} value={item.name}>
|
<Option key={item.id} value={item.name} onClick={()=>this.selectSerect(item.is_secret)}>
|
||||||
{item.name}
|
{item.name}
|
||||||
</Option>
|
</Option>
|
||||||
));
|
));
|
||||||
|
@ -155,6 +157,17 @@ class Index extends Component {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
selectSerect=(flag)=>{
|
||||||
|
if(flag){
|
||||||
|
this.props.form.setFieldsValue({
|
||||||
|
private:true
|
||||||
|
})
|
||||||
|
}
|
||||||
|
this.setState({
|
||||||
|
licenseForDisabled:flag
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
subMitFrom = () => {
|
subMitFrom = () => {
|
||||||
this.props.form.validateFieldsAndScroll((err, values) => {
|
this.props.form.validateFieldsAndScroll((err, values) => {
|
||||||
if (!err) {
|
if (!err) {
|
||||||
|
@ -198,7 +211,8 @@ class Index extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
ChangePlatform = (value, e, name, list) => {
|
ChangePlatform = (value, e, name, list) => {
|
||||||
this.setOptionsList(list, name, value)
|
this.setOptionsList(list, name, value);
|
||||||
|
|
||||||
this.setState({
|
this.setState({
|
||||||
[name + "_id"]: e.key,
|
[name + "_id"]: e.key,
|
||||||
[name + "_name"]: value,
|
[name + "_name"]: value,
|
||||||
|
@ -272,6 +286,7 @@ class Index extends Component {
|
||||||
project_category_list,
|
project_category_list,
|
||||||
license_list,
|
license_list,
|
||||||
ignore_list,
|
ignore_list,
|
||||||
|
licenseForDisabled,
|
||||||
|
|
||||||
mirrorCheck
|
mirrorCheck
|
||||||
} = this.state;
|
} = this.state;
|
||||||
|
@ -477,8 +492,8 @@ class Index extends Component {
|
||||||
style={{ margin: "0px" }}
|
style={{ margin: "0px" }}
|
||||||
className="privatePart"
|
className="privatePart"
|
||||||
>
|
>
|
||||||
{getFieldDecorator('private')(
|
{getFieldDecorator('private',{valuePropName:"checked"})(
|
||||||
<Checkbox value="limit">将项目设为私有<span className="ml15 font-13 color-grey-9">(只有项目所有人或拥有权限的项目成员才能看到)</span></Checkbox>
|
<Checkbox value="limit" disabled={licenseForDisabled}>将项目设为私有<span className="ml15 font-13 color-grey-9">(只有项目所有人或拥有权限的项目成员才能看到)</span></Checkbox>
|
||||||
)}
|
)}
|
||||||
</Form.Item >
|
</Form.Item >
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,53 +1,528 @@
|
||||||
import React, { useState } from "react";
|
import React, { Component } from "react";
|
||||||
|
import { Link } from "react-router-dom";
|
||||||
|
import {
|
||||||
|
Input,
|
||||||
|
AutoComplete,
|
||||||
|
Dropdown,
|
||||||
|
Menu,
|
||||||
|
Icon,
|
||||||
|
Spin,
|
||||||
|
Pagination,
|
||||||
|
Button,
|
||||||
|
Table,
|
||||||
|
Tooltip
|
||||||
|
} from "antd";
|
||||||
|
import NoneData from "../Nodata";
|
||||||
|
import axios from "axios";
|
||||||
|
import { getImageUrl } from "educoder";
|
||||||
import {WhiteBack} from '../Component/layout';
|
import {WhiteBack} from '../Component/layout';
|
||||||
import AddMember from '../Component/AddMember';
|
|
||||||
import AddGroup from '../Component/AddGroup';
|
|
||||||
import Member from './CollaboratorMember';
|
|
||||||
import Group from './CollaboratorGroup';
|
|
||||||
|
|
||||||
function Collaborator(props){
|
const { Search } = Input;
|
||||||
const [ nav , setNav] = useState("1");
|
|
||||||
const [ newId , setNewId] = useState(undefined);
|
|
||||||
const [ newGroupId , setNewGroupId] = useState(undefined);
|
|
||||||
const {projectsId ,owner} = props.match.params;
|
|
||||||
|
|
||||||
const author = props.projectDetail && props.projectDetail.author;
|
const { Option } = AutoComplete;
|
||||||
|
const MENU_LIST = [
|
||||||
function getID(id){
|
{
|
||||||
setNewId(id);
|
id: "Manager",
|
||||||
|
name: "管理员",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "Developer",
|
||||||
|
name: "开发者",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "Reporter",
|
||||||
|
name: "报告者",
|
||||||
|
},
|
||||||
|
];
|
||||||
|
const LIMIT = 15;
|
||||||
|
class Collaborator extends Component {
|
||||||
|
constructor(props) {
|
||||||
|
super(props);
|
||||||
|
this.state = {
|
||||||
|
listData: undefined,
|
||||||
|
user: undefined,
|
||||||
|
user_id: undefined,
|
||||||
|
userDataSource: undefined,
|
||||||
|
page: 1,
|
||||||
|
total_count: undefined,
|
||||||
|
isSpin: true,
|
||||||
|
searchKey: undefined,
|
||||||
|
search: undefined,
|
||||||
|
role: undefined,
|
||||||
|
otherSpin: false,
|
||||||
|
searchSpin: false,
|
||||||
|
roleName: undefined,
|
||||||
|
};
|
||||||
}
|
}
|
||||||
function getGroupID(id){
|
componentDidUpdate=(prevPros)=>{
|
||||||
setNewGroupId(id);
|
if(prevPros && this.props && !this.props.checkIfLogin()){
|
||||||
|
this.props.history.push("/403")
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
componentDidMount = () => {
|
||||||
|
// this.check_is_login()
|
||||||
|
if (this.props.project_id) {
|
||||||
|
this.getMember();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// check_is_login =() =>{
|
||||||
|
// if(!this.props.checkIfLogin()){
|
||||||
|
// this.props.history.push("/403")
|
||||||
|
// return
|
||||||
|
// }
|
||||||
|
// };
|
||||||
|
|
||||||
|
componentDidUpdate = (prevState) => {
|
||||||
|
if (
|
||||||
|
this.props.project_id &&
|
||||||
|
this.props.project_id !== prevState.project_id
|
||||||
|
) {
|
||||||
|
this.getMember();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// 获取项目协作者
|
||||||
|
getMember = () => {
|
||||||
|
const { page, search, role } = this.state;
|
||||||
|
const {projectsId ,owner} = this.props.match.params;
|
||||||
|
const url = `/${owner}/${projectsId}/collaborators.json`;
|
||||||
|
axios
|
||||||
|
.get(url, {
|
||||||
|
params: {
|
||||||
|
page,
|
||||||
|
search: search,
|
||||||
|
role: role,
|
||||||
|
limit: LIMIT,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
.then((result) => {
|
||||||
|
if (result) {
|
||||||
|
this.setState({
|
||||||
|
listData: result.data.members,
|
||||||
|
isSpin: false,
|
||||||
|
otherSpin: false,
|
||||||
|
searchSpin: false,
|
||||||
|
total_count: result.data.total_count,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
this.setState({
|
||||||
|
isSpin: false,
|
||||||
|
otherSpin: false,
|
||||||
|
searchSpin: false,
|
||||||
|
});
|
||||||
|
console.log(error);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
// 输入用户
|
||||||
|
changeInputUser = (e) => {
|
||||||
|
this.setState({
|
||||||
|
searchKey: e,
|
||||||
|
});
|
||||||
|
this.getUserList(e);
|
||||||
|
};
|
||||||
|
searchMember = (e) => {
|
||||||
|
this.state.search = e;
|
||||||
|
this.setState({
|
||||||
|
searchSpin: true,
|
||||||
|
});
|
||||||
|
this.getMember();
|
||||||
|
};
|
||||||
|
orderMember = (id, name) => {
|
||||||
|
this.setState({
|
||||||
|
isSpin: true
|
||||||
|
})
|
||||||
|
this.state.role = id;
|
||||||
|
this.state.roleName = name;
|
||||||
|
this.getMember();
|
||||||
|
};
|
||||||
|
// 选择用户
|
||||||
|
selectInputUser = (e, option) => {
|
||||||
|
this.setState({
|
||||||
|
user_id: e,
|
||||||
|
searchKey: option.props.searchValue,
|
||||||
|
});
|
||||||
|
this.getUserList(option.props.searchValue);
|
||||||
|
};
|
||||||
|
getUserList = (e) => {
|
||||||
|
const url = `/users/list.json`;
|
||||||
|
axios
|
||||||
|
.get(url, {
|
||||||
|
params: {
|
||||||
|
search: e,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
.then((result) => {
|
||||||
|
if (result) {
|
||||||
|
this.setState({
|
||||||
|
userDataSource: result.data.users,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
console.log(error);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
// 增加协作者
|
||||||
|
addCollaborator = () => {
|
||||||
|
// const { project_id } = this.props;
|
||||||
|
const { user_id } = this.state;
|
||||||
|
if(user_id){
|
||||||
|
this.setState({
|
||||||
|
otherSpin: true,
|
||||||
|
});
|
||||||
|
const {projectsId ,owner} = this.props.match.params;
|
||||||
|
const url = `/${owner}/${projectsId}/collaborators.json`;
|
||||||
|
axios.post(url, {
|
||||||
|
user_id,
|
||||||
|
})
|
||||||
|
.then((result) => {
|
||||||
|
if (result) {
|
||||||
|
this.setState({
|
||||||
|
isSpin: true,
|
||||||
|
otherSpin: false,
|
||||||
|
});
|
||||||
|
this.getMember();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
this.setState({
|
||||||
|
isSpin: false,
|
||||||
|
otherSpin: false,
|
||||||
|
});
|
||||||
|
console.log(error);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// 修改权限
|
||||||
|
changeOperaiton = (e, id) => {
|
||||||
|
// const { project_id, page } = this.state;
|
||||||
|
this.setState({
|
||||||
|
isSpin: true,
|
||||||
|
});
|
||||||
|
const {projectsId ,owner} = this.props.match.params;
|
||||||
|
|
||||||
|
const url = `/${owner}/${projectsId}/collaborators/change_role.json`;
|
||||||
|
axios
|
||||||
|
.put(url, {
|
||||||
|
user_id: id,
|
||||||
|
role: e.key,
|
||||||
|
})
|
||||||
|
.then((result) => {
|
||||||
|
if (result) {
|
||||||
|
this.setState({
|
||||||
|
isSpin: true,
|
||||||
|
});
|
||||||
|
this.props.showNotification("权限修改成功!");
|
||||||
|
this.getMember();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
this.setState({
|
||||||
|
isSpin: false,
|
||||||
|
});
|
||||||
|
console.log(error);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
// 删除协作者
|
||||||
|
deleteUser = (id) => {
|
||||||
|
const { page } = this.state;
|
||||||
|
const {projectsId ,owner} = this.props.match.params;
|
||||||
|
this.props.confirm({
|
||||||
|
content: "确认将此成员从项目中移除?",
|
||||||
|
onOk: () => {
|
||||||
|
const { project_id } = this.props;
|
||||||
|
const url = `/${owner}/${projectsId}/collaborators/remove.json`;
|
||||||
|
axios
|
||||||
|
.delete(url, {
|
||||||
|
data: {
|
||||||
|
user_id: id,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
.then((result) => {
|
||||||
|
if (result) {
|
||||||
|
this.setState({
|
||||||
|
isSpin: true,
|
||||||
|
});
|
||||||
|
this.props.showNotification("成员删除成功!");
|
||||||
|
this.getMember();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
this.setState({
|
||||||
|
isSpin: false,
|
||||||
|
});
|
||||||
|
console.log(error);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
});
|
||||||
|
};
|
||||||
|
changePage = (page) => {
|
||||||
|
this.state.page = page;
|
||||||
|
this.setState({
|
||||||
|
isSpin: true,
|
||||||
|
});
|
||||||
|
this.getMember();
|
||||||
|
};
|
||||||
|
|
||||||
|
render() {
|
||||||
|
const {
|
||||||
|
userDataSource,
|
||||||
|
listData,
|
||||||
|
isSpin,
|
||||||
|
page,
|
||||||
|
total_count,
|
||||||
|
searchKey,
|
||||||
|
otherSpin,
|
||||||
|
searchSpin,
|
||||||
|
roleName,
|
||||||
|
} = this.state;
|
||||||
|
// 获取当前项目的拥有者
|
||||||
|
const { author } = this.props;
|
||||||
|
const get_color = (role) => {
|
||||||
|
if (role === "Manager") {
|
||||||
|
return "text-green";
|
||||||
|
} else if (role === "Developer") {
|
||||||
|
return "text-primary";
|
||||||
|
} else if(role === "Reporter"){
|
||||||
|
return "text-yellow";
|
||||||
|
}else{
|
||||||
|
return "text-gray";
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const member_roles = (item) => {
|
||||||
|
const operation = MENU_LIST.filter((i) => i.id === item.role);
|
||||||
|
return (
|
||||||
|
<span>
|
||||||
|
{author && author.login === item.login ? (
|
||||||
|
<label className={get_color(item.role)}>
|
||||||
|
{operation && operation[0].name}
|
||||||
|
</label>
|
||||||
|
) :
|
||||||
|
item.is_apply_signature ?
|
||||||
|
<label className="text-grey">外围贡献者</label>
|
||||||
|
:
|
||||||
|
(
|
||||||
|
<Dropdown overlay={setRoles(`${item.id}`)} placement={"bottomCenter"}>
|
||||||
|
<span className={get_color(item.role)}>
|
||||||
|
{operation && operation[0].name}
|
||||||
|
<Icon type="caret-down" className="ml2" size="13" />
|
||||||
|
</span>
|
||||||
|
</Dropdown>
|
||||||
|
)}
|
||||||
|
</span>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
const roleTitle = (
|
||||||
|
<div><span className="mr3">角色</span>
|
||||||
|
<Tooltip placement='bottom' title={<div>
|
||||||
|
<div className="mb3">管理员:拥有仓库设置功能、代码库读、写操作</div>
|
||||||
|
<div className="mb3">开发人员:只拥有代码库读、写操作</div>
|
||||||
|
<div className="mb3">报告者:只拥有代码库读操作</div>
|
||||||
|
</div>
|
||||||
|
}>
|
||||||
|
<Icon type="question-circle"></Icon>
|
||||||
|
</Tooltip>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
const columns = [
|
||||||
|
{
|
||||||
|
title: "头像",
|
||||||
|
dataIndex: "image_url",
|
||||||
|
render: (text, item) => (
|
||||||
|
<span className="f-wrap-alignCenter">
|
||||||
|
<Link
|
||||||
|
to={`/users/${item.login}`}
|
||||||
|
className="show-user-link"
|
||||||
|
>
|
||||||
|
<img
|
||||||
|
src={getImageUrl(`images/${text}`)}
|
||||||
|
alt=""
|
||||||
|
width="32px"
|
||||||
|
height="32px"
|
||||||
|
className="mr3 radius"
|
||||||
|
/>
|
||||||
|
</Link>
|
||||||
|
</span>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "用户名",
|
||||||
|
dataIndex: "name",
|
||||||
|
render: (text, item) => (
|
||||||
|
<Link to={`/users/${item.login}`} className="show-user-link">
|
||||||
|
{text}
|
||||||
|
</Link>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "邮箱",
|
||||||
|
dataIndex: "email",
|
||||||
|
render: (text) => <span>{text}</span>,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Token值",
|
||||||
|
dataIndex: "token",
|
||||||
|
render: (text) => <span>{text}</span>,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: roleTitle,
|
||||||
|
dataIndex: "role_name",
|
||||||
|
render: (text, item) => member_roles(item),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "操作",
|
||||||
|
dataIndex: "action",
|
||||||
|
render: (text, item) => (
|
||||||
|
<span style={{ justifyContent: "center" }}>
|
||||||
|
{author && author.login !== item.login && (
|
||||||
|
<a
|
||||||
|
className="text-delete"
|
||||||
|
onClick={() => this.deleteUser(item.id)}
|
||||||
|
>
|
||||||
|
删除
|
||||||
|
</a>
|
||||||
|
)}
|
||||||
|
</span>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
];
|
||||||
|
const roles = (id) => (
|
||||||
|
<Menu>
|
||||||
|
<Menu.Item
|
||||||
|
key={0}
|
||||||
|
value={undefined}
|
||||||
|
onClick={(e) => this.orderMember(undefined, "角色筛选")}
|
||||||
|
>
|
||||||
|
全部
|
||||||
|
</Menu.Item>
|
||||||
|
{MENU_LIST.map((item, key) => {
|
||||||
|
return (
|
||||||
|
<Menu.Item
|
||||||
|
key={item.id}
|
||||||
|
value={item.id}
|
||||||
|
onClick={(e) => this.orderMember(item.id, item.name)}
|
||||||
|
>
|
||||||
|
{item.name}
|
||||||
|
</Menu.Item>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</Menu>
|
||||||
|
);
|
||||||
|
const setRoles = (id) => (
|
||||||
|
<Menu>
|
||||||
|
{MENU_LIST.map((item, key) => {
|
||||||
|
return (
|
||||||
|
<Menu.Item
|
||||||
|
key={item.id}
|
||||||
|
value={item.id}
|
||||||
|
onClick={(e) => this.changeOperaiton(e,id)}
|
||||||
|
>
|
||||||
|
{item.name}
|
||||||
|
</Menu.Item>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</Menu>
|
||||||
|
);
|
||||||
|
|
||||||
|
const source =
|
||||||
|
userDataSource &&
|
||||||
|
userDataSource.map((item, key) => {
|
||||||
|
return (
|
||||||
|
<Option
|
||||||
|
key={key}
|
||||||
|
value={`${item.user_id}`}
|
||||||
|
searchValue={`${item.username}`}
|
||||||
|
>
|
||||||
|
<img
|
||||||
|
className="user_img radius"
|
||||||
|
width="28"
|
||||||
|
height="28"
|
||||||
|
src={getImageUrl(`images/${item && item.image_url}`)}
|
||||||
|
alt=""
|
||||||
|
/>
|
||||||
|
<span className="ml10" style={{ "vertical-align": "middle" }}>
|
||||||
|
{item.username}
|
||||||
|
<span className="color-grey ml10">({item.login})</span>
|
||||||
|
</span>
|
||||||
|
</Option>
|
||||||
|
);
|
||||||
|
});
|
||||||
return (
|
return (
|
||||||
<WhiteBack>
|
<WhiteBack>
|
||||||
<div className="flex-a-center baseForm bbr">
|
<div className="flex-a-center baseForm bbr">
|
||||||
{
|
|
||||||
author && author.type === "Organization" ?
|
|
||||||
<span>
|
|
||||||
<span style={{cursor:"pointer"}} className={nav === "1" ? "font-18 text-black color-blue":"font-18 text-black"} onClick={()=>setNav("1")}>协作者管理</span>
|
|
||||||
<span style={{cursor:"pointer"}} className={nav === "2" ? "font-18 text-black ml30 color-blue":"font-18 text-black ml30"} onClick={()=>setNav("2")}>团队管理</span>
|
|
||||||
</span>
|
|
||||||
:
|
|
||||||
<span className="font-18 text-black">协作者管理</span>
|
<span className="font-18 text-black">协作者管理</span>
|
||||||
}
|
<div className="addPanel">
|
||||||
{
|
<AutoComplete
|
||||||
nav === "1" ?
|
dataSource={source}
|
||||||
<AddMember getID={getID} login/>
|
value={searchKey}
|
||||||
:
|
style={{ width: 300 }}
|
||||||
<AddGroup getGroupID={getGroupID} organizeId={owner}/>
|
onChange={this.changeInputUser}
|
||||||
}
|
onSelect={this.selectInputUser}
|
||||||
|
placeholder="搜索需要添加的用户..."
|
||||||
|
/>
|
||||||
|
<Button
|
||||||
|
type="primary"
|
||||||
|
ghost
|
||||||
|
onClick={this.addCollaborator}
|
||||||
|
className="ml15"
|
||||||
|
loading={otherSpin}
|
||||||
|
>
|
||||||
|
<Icon type="plus" size="16"></Icon>
|
||||||
|
添加成员
|
||||||
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
|
||||||
{
|
|
||||||
nav === "1" ?
|
|
||||||
<Member newId={newId} projectsId={projectsId} owner={owner} project_id={props.project_id} author={props.author} showNotification={props.showNotification}/>
|
|
||||||
:
|
|
||||||
<Group owner={owner} projectsId={projectsId} newGroupId={newGroupId}/>
|
|
||||||
}
|
|
||||||
</div>
|
</div>
|
||||||
|
<div className="grid-item-left baseForm">
|
||||||
|
<Search
|
||||||
|
placeholder="搜索项目成员..."
|
||||||
|
enterButton="搜索"
|
||||||
|
loading={searchSpin}
|
||||||
|
onSearch={(value) => this.searchMember(value)}
|
||||||
|
/>
|
||||||
|
<Dropdown overlay={roles} placement={"bottomCenter"}>
|
||||||
|
<a className="ml180 text-primary">
|
||||||
|
{roleName ? roleName : "角色筛选"}
|
||||||
|
<Icon type="caret-down" size="16"></Icon>
|
||||||
|
</a>
|
||||||
|
</Dropdown>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<Spin spinning={isSpin}>
|
||||||
|
<div className="collaboratorList baseForm">
|
||||||
|
{listData && listData.length>0 ? (
|
||||||
|
<Table
|
||||||
|
pagination={false}
|
||||||
|
columns={columns}
|
||||||
|
dataSource={listData}
|
||||||
|
rowKey={(record) => record.id}
|
||||||
|
></Table>
|
||||||
|
) : (
|
||||||
|
<NoneData _html="暂时还没有相关数据!" />
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</Spin>
|
||||||
|
{total_count && total_count > LIMIT ? (
|
||||||
|
<div className="edu-txt-center mt20 mb20">
|
||||||
|
<Pagination
|
||||||
|
showQuickJumper
|
||||||
|
pageSize={LIMIT}
|
||||||
|
current={page}
|
||||||
|
total={total_count}
|
||||||
|
onChange={this.changePage}
|
||||||
|
></Pagination>
|
||||||
|
</div>
|
||||||
|
) : (
|
||||||
|
""
|
||||||
|
)}
|
||||||
</WhiteBack>
|
</WhiteBack>
|
||||||
);
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
export default Collaborator;
|
export default Collaborator;
|
||||||
|
|
|
@ -28,6 +28,10 @@ const Tags = Loadable({
|
||||||
loader: () => import("./new_tags"),
|
loader: () => import("./new_tags"),
|
||||||
loading: Loading,
|
loading: Loading,
|
||||||
});
|
});
|
||||||
|
const Special = Loadable({
|
||||||
|
loader: () => import("./SpecialProject"),
|
||||||
|
loading: Loading,
|
||||||
|
});
|
||||||
const Manage = Loadable({
|
const Manage = Loadable({
|
||||||
loader: () => import("./ManageWeb"),
|
loader: () => import("./ManageWeb"),
|
||||||
loading: Loading,
|
loading: Loading,
|
||||||
|
@ -40,6 +44,7 @@ class Index extends Component {
|
||||||
render() {
|
render() {
|
||||||
const { projectsId , owner } = this.props.match.params;
|
const { projectsId , owner } = this.props.match.params;
|
||||||
const { pathname } = this.props.history.location;
|
const { pathname } = this.props.history.location;
|
||||||
|
const { projectDetail } = this.props;
|
||||||
|
|
||||||
const flag = pathname === `/projects/${owner}/${projectsId}/setting`;
|
const flag = pathname === `/projects/${owner}/${projectsId}/setting`;
|
||||||
return (
|
return (
|
||||||
|
@ -87,6 +92,20 @@ class Index extends Component {
|
||||||
</Link>
|
</Link>
|
||||||
</p>
|
</p>
|
||||||
</li>
|
</li>
|
||||||
|
{
|
||||||
|
projectDetail && projectDetail.permission && (projectDetail.permission === "Owner" || projectDetail.permission === "Admin") ?
|
||||||
|
<li
|
||||||
|
className={pathname.indexOf("setting/special") > -1 ? "active" : ""}
|
||||||
|
>
|
||||||
|
<p>
|
||||||
|
<Link to={`/projects/${owner}/${projectsId}/setting/special`} className="w-100">
|
||||||
|
<i className="iconfont icon-jingyan font-18 mr10"></i>
|
||||||
|
特殊开源许可证项目管理
|
||||||
|
</Link>
|
||||||
|
</p>
|
||||||
|
</li>
|
||||||
|
:""
|
||||||
|
}
|
||||||
|
|
||||||
{/* <li
|
{/* <li
|
||||||
className={
|
className={
|
||||||
|
@ -112,7 +131,15 @@ class Index extends Component {
|
||||||
<Collaborator {...this.props} {...props} {...this.state} />
|
<Collaborator {...this.props} {...props} {...this.state} />
|
||||||
)}
|
)}
|
||||||
></Route>
|
></Route>
|
||||||
|
|
||||||
|
<Route
|
||||||
|
path="/projects/:owner/:projectsId/setting/special"
|
||||||
|
render={(props) => (
|
||||||
|
<Special {...this.props} {...props} {...this.state} />
|
||||||
|
)}
|
||||||
|
></Route>
|
||||||
{/* 修改仓库信息 */}
|
{/* 修改仓库信息 */}
|
||||||
|
|
||||||
<Route
|
<Route
|
||||||
path="/projects/:owner/:projectsId/setting/tags"
|
path="/projects/:owner/:projectsId/setting/tags"
|
||||||
render={(props) => (
|
render={(props) => (
|
||||||
|
|
|
@ -15,6 +15,7 @@ class Setting extends Component {
|
||||||
CategoryList: undefined,
|
CategoryList: undefined,
|
||||||
LanguageList: undefined,
|
LanguageList: undefined,
|
||||||
private_check: undefined,
|
private_check: undefined,
|
||||||
|
is_secret:false
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -52,10 +53,11 @@ class Setting extends Component {
|
||||||
.then((result) => {
|
.then((result) => {
|
||||||
if (result) {
|
if (result) {
|
||||||
this.props.form.setFieldsValue({
|
this.props.form.setFieldsValue({
|
||||||
...result.data,
|
...result.data
|
||||||
});
|
});
|
||||||
this.setState({
|
this.setState({
|
||||||
private_check: result.data.private,
|
private_check: result.data.private,
|
||||||
|
is_secret:result.data.is_secret
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -152,7 +154,7 @@ class Setting extends Component {
|
||||||
render() {
|
render() {
|
||||||
const { getFieldDecorator } = this.props.form;
|
const { getFieldDecorator } = this.props.form;
|
||||||
|
|
||||||
const { CategoryList, LanguageList, private_check } = this.state;
|
const { CategoryList, LanguageList, private_check , is_secret } = this.state;
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<WhiteBack style={{paddingBottom:"20px"}}>
|
<WhiteBack style={{paddingBottom:"20px"}}>
|
||||||
|
@ -177,6 +179,7 @@ class Setting extends Component {
|
||||||
<Checkbox
|
<Checkbox
|
||||||
checked={private_check}
|
checked={private_check}
|
||||||
onChange={this.changePrivate}
|
onChange={this.changePrivate}
|
||||||
|
disabled={is_secret}
|
||||||
>
|
>
|
||||||
将仓库设为私有
|
将仓库设为私有
|
||||||
</Checkbox>
|
</Checkbox>
|
||||||
|
|
|
@ -0,0 +1,186 @@
|
||||||
|
import React , { useEffect , useState} from 'react';
|
||||||
|
import { Input , Table , Pagination, Button , Dropdown , Menu } from 'antd';
|
||||||
|
import { Banner , WhiteBack , AlignCenterBetween } from '../Component/layout';
|
||||||
|
import axios from 'axios';
|
||||||
|
|
||||||
|
const { Search } = Input;
|
||||||
|
|
||||||
|
const LIMIT = 15;
|
||||||
|
function SpecialProject(props){
|
||||||
|
const [ page , setPage] = useState(1);
|
||||||
|
const [ searchValue , SetSearchValue ] = useState(undefined);
|
||||||
|
const [ total , setTotal ] = useState(0);
|
||||||
|
const [ list , setList ] = useState(undefined);
|
||||||
|
const [ status , setStatus ] = useState(undefined);
|
||||||
|
const [ loading ,setLoading ] = useState(true);
|
||||||
|
|
||||||
|
const { owner , projectsId} = props.match.params;
|
||||||
|
const { project_id } = props;
|
||||||
|
|
||||||
|
useEffect(()=>{
|
||||||
|
if(project_id){
|
||||||
|
setLoading(true);
|
||||||
|
Init(searchValue, status);
|
||||||
|
}
|
||||||
|
},[page,project_id]);
|
||||||
|
|
||||||
|
function Init(search,status){
|
||||||
|
const url = `/apply_signatures.json`;
|
||||||
|
axios.get(url,{
|
||||||
|
params:{
|
||||||
|
project_id,
|
||||||
|
page,limit:LIMIT,search,status
|
||||||
|
}
|
||||||
|
}).then(result=>{
|
||||||
|
setLoading(false);
|
||||||
|
if(result){
|
||||||
|
setList(result.data.apply_signatures);
|
||||||
|
setTotal(result.data.total_count);
|
||||||
|
}
|
||||||
|
}).catch(error=>{})
|
||||||
|
}
|
||||||
|
|
||||||
|
function changePage(page){
|
||||||
|
setLoading(true);
|
||||||
|
setPage(page);
|
||||||
|
}
|
||||||
|
|
||||||
|
const column = [
|
||||||
|
{
|
||||||
|
dataIndex:"column",
|
||||||
|
key:1,
|
||||||
|
width:"12%",
|
||||||
|
title:"序号",
|
||||||
|
render:(txt,item,index)=>{
|
||||||
|
return `${index+1}`
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
dataIndex:"name",
|
||||||
|
key:2,
|
||||||
|
title:"申请人",
|
||||||
|
render:(text,item,m)=>{
|
||||||
|
return item.user && <span className="task-hide" style={{maxWidth:"139px",display:"block"}}>{item.user.name}</span>
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
dataIndex:"email",
|
||||||
|
key:2,
|
||||||
|
title:"邮箱",
|
||||||
|
width:"22%",
|
||||||
|
render:(text,item,m)=>{
|
||||||
|
return item.user && <span>{item.user.email}</span>
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
dataIndex:"attachment",
|
||||||
|
key:3,
|
||||||
|
title:"附件",
|
||||||
|
width:"28%",
|
||||||
|
render:(text,item,m)=>{
|
||||||
|
return item.attachment && <a className="task-hide" style={{maxWidth:"173px",display:"block"}} href={`${item.attachment.path}`}>{item.attachment.filename}</a>
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
dataIndex:"operation",
|
||||||
|
key:4,
|
||||||
|
width:"18%",
|
||||||
|
title:"操作",
|
||||||
|
render:(text, item) =>{
|
||||||
|
return(
|
||||||
|
<React.Fragment>
|
||||||
|
{
|
||||||
|
item.status === "waiting" &&
|
||||||
|
<span>
|
||||||
|
<Button size="small" onClick={()=>operation(item.id,"unpassed")}>拒绝</Button>
|
||||||
|
<Button size="small" onClick={()=>operation(item.id,"passed")} type={"primary"} className="ml20">同意</Button>
|
||||||
|
</span>
|
||||||
|
}
|
||||||
|
{
|
||||||
|
item.status === "unpassed" &&
|
||||||
|
<span style={{color:"#ff041c"}}>已拒绝</span>
|
||||||
|
}
|
||||||
|
{
|
||||||
|
item.status === "passed" &&
|
||||||
|
<span style={{color:"#13b4f1"}}>已同意</span>
|
||||||
|
}
|
||||||
|
</React.Fragment>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
// 拒绝&同意
|
||||||
|
function operation(ids,s){
|
||||||
|
setLoading(true);
|
||||||
|
const url = `/apply_signatures/${ids}.json`;
|
||||||
|
axios.put(url,{
|
||||||
|
project_id:project_id,
|
||||||
|
status:s
|
||||||
|
}).then(result=>{
|
||||||
|
setLoading(false);
|
||||||
|
if(result){
|
||||||
|
props.showNotification(`${s==="passed"?"同意":"拒绝"}此申请已操作成功!`);
|
||||||
|
Init(searchValue,status);
|
||||||
|
}
|
||||||
|
}).catch(error=>{setLoading(false)})
|
||||||
|
}
|
||||||
|
|
||||||
|
function searchList(){
|
||||||
|
setLoading(true);
|
||||||
|
Init(searchValue,status);
|
||||||
|
}
|
||||||
|
|
||||||
|
const menu=(
|
||||||
|
<Menu onClick={chooseStatus}>
|
||||||
|
<Menu.Item key="all">全部</Menu.Item>
|
||||||
|
<Menu.Item key="waiting">审核中</Menu.Item>
|
||||||
|
<Menu.Item key="unpassed">已拒绝</Menu.Item>
|
||||||
|
<Menu.Item key="passed">已同意</Menu.Item>
|
||||||
|
</Menu>
|
||||||
|
)
|
||||||
|
|
||||||
|
function chooseStatus(e){
|
||||||
|
setStatus(e.key);
|
||||||
|
Init(searchValue, e.key);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return(
|
||||||
|
<WhiteBack style={{minHeight:"500px"}}>
|
||||||
|
<Banner>项目管理</Banner>
|
||||||
|
<AlignCenterBetween style={{padding:"10px 20px",textAlign:"right"}}>
|
||||||
|
<Search
|
||||||
|
placeholder="请输入用户姓名或者邮箱搜索"
|
||||||
|
allowClear
|
||||||
|
enterButton="搜索"
|
||||||
|
style={{width:400}}
|
||||||
|
size="middle"
|
||||||
|
value={searchValue}
|
||||||
|
onChange={(e)=>SetSearchValue(e.target.value)}
|
||||||
|
onSearch={searchList}
|
||||||
|
/>
|
||||||
|
<Dropdown overlay={menu} placement="bottomRight">
|
||||||
|
<span>
|
||||||
|
<span style={{color:status ? "color-blue" : "color-grey-3"}}>{status ==="waiting"?"审核中":status==="unpassed"?"已拒绝":status==="passed"?"已同意":"全部"}</span>
|
||||||
|
<i className="iconfont icon-xiajiantou color-grey-9 font-14 ml8"></i>
|
||||||
|
</span>
|
||||||
|
</Dropdown>
|
||||||
|
</AlignCenterBetween>
|
||||||
|
<Table
|
||||||
|
columns={column}
|
||||||
|
rowKey={(record) => record.id}
|
||||||
|
pagination={false}
|
||||||
|
dataSource={list}
|
||||||
|
loading={loading}
|
||||||
|
></Table>
|
||||||
|
{
|
||||||
|
total > LIMIT &&
|
||||||
|
<div className="center mt20 mb20">
|
||||||
|
<Pagination simple current={page} total={total} pageSize={LIMIT} onChange={changePage}></Pagination>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
|
||||||
|
</WhiteBack>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
export default SpecialProject;
|
|
@ -139,6 +139,7 @@
|
||||||
.padding15-10{
|
.padding15-10{
|
||||||
padding:15px 10px;
|
padding:15px 10px;
|
||||||
}
|
}
|
||||||
|
.center{text-align: center;}
|
||||||
.w-100{width: 100%;}
|
.w-100{width: 100%;}
|
||||||
.fwb{font-weight: 600;}
|
.fwb{font-weight: 600;}
|
||||||
.text-black{color: #333;}
|
.text-black{color: #333;}
|
||||||
|
@ -151,6 +152,9 @@
|
||||||
.text-yellow{color: #FF6E21 !important;}
|
.text-yellow{color: #FF6E21 !important;}
|
||||||
.text-delete{color: #BBBBBB; }
|
.text-delete{color: #BBBBBB; }
|
||||||
.text-delete:hover{color: #db2828; }
|
.text-delete:hover{color: #db2828; }
|
||||||
|
.text-grey{
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
.new-tag-div{
|
.new-tag-div{
|
||||||
padding: 15px;
|
padding: 15px;
|
||||||
height: 75px;
|
height: 75px;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import React, { Component } from "react";
|
import React, { Component } from "react";
|
||||||
import { Upload, Button, Icon } from 'antd';
|
import { Upload , Icon } from 'antd';
|
||||||
import { getUploadActionUrl, appendFileSizeToUploadFileAll } from 'educoder';
|
import { getUploadActionUrl, appendFileSizeToUploadFileAll } from 'educoder';
|
||||||
|
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
@ -45,8 +45,7 @@ class Index extends Component {
|
||||||
deleteAttachment = (file) => {
|
deleteAttachment = (file) => {
|
||||||
|
|
||||||
const url = `/attachments/${file.response ? file.response.id : file.uid}.json`
|
const url = `/attachments/${file.response ? file.response.id : file.uid}.json`
|
||||||
axios.delete(url, {
|
axios.delete(url).then((response) => {
|
||||||
}).then((response) => {
|
|
||||||
if (response.data) {
|
if (response.data) {
|
||||||
if (response.data.status === 0) {
|
if (response.data.status === 0) {
|
||||||
this.setState((state) => {
|
this.setState((state) => {
|
||||||
|
@ -71,11 +70,26 @@ class Index extends Component {
|
||||||
handleChange = (info) => {
|
handleChange = (info) => {
|
||||||
const { changeIsComplete } = this.props;
|
const { changeIsComplete } = this.props;
|
||||||
changeIsComplete && changeIsComplete(true);
|
changeIsComplete && changeIsComplete(true);
|
||||||
|
|
||||||
if (info.file.status === 'uploading' || info.file.status === 'done' || info.file.status === 'removed') {
|
if (info.file.status === 'uploading' || info.file.status === 'done' || info.file.status === 'removed') {
|
||||||
let fileList = info.fileList;
|
let fileList = info.fileList;
|
||||||
|
|
||||||
this.setState({ fileList: appendFileSizeToUploadFileAll(fileList) });
|
this.setState({ fileList: appendFileSizeToUploadFileAll(fileList) });
|
||||||
this.fileIdList(fileList);
|
this.fileIdList(fileList);
|
||||||
|
|
||||||
|
if ( info.file.status === 'done') {
|
||||||
|
let filelist = info.fileList && info.fileList.length>0 && info.fileList[info.fileList.length-1];
|
||||||
|
if(filelist && filelist.response && filelist.response.status === -1){
|
||||||
|
this.props.showNotification(filelist.response.message)
|
||||||
|
this.setState((state) => {
|
||||||
|
state.fileList.pop()
|
||||||
|
return {
|
||||||
|
fileList: state.fileList,
|
||||||
|
};
|
||||||
|
});
|
||||||
|
this.fileIdList(this.state.fileList);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,78 @@
|
||||||
|
import React, { useEffect , useState } from "react";
|
||||||
|
import { Upload } from 'antd';
|
||||||
|
import { getUploadActionUrl, appendFileSizeToUploadFileAll } from 'educoder';
|
||||||
|
|
||||||
|
import axios from 'axios';
|
||||||
|
|
||||||
|
function Single({ children , showNotification , className , load , size }) {
|
||||||
|
const [ fileList , setFileList ] = useState(undefined);
|
||||||
|
// 移除
|
||||||
|
function onAttachmentRemove(file){
|
||||||
|
if (!file.percent || file.percent === 100) {
|
||||||
|
deleteAttachment(file);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function deleteAttachment(file){
|
||||||
|
let uid = file.response ? file.response.id : file.uid;
|
||||||
|
const url = `/attachments/${uid}.json`
|
||||||
|
axios.delete(url).then((response) => {
|
||||||
|
if (response.data && response.data.status === 0) {
|
||||||
|
let list = fileList.filter(item=> item.response && item.response.id !== uid);
|
||||||
|
setFileList(list);
|
||||||
|
fileIdList(list);
|
||||||
|
}
|
||||||
|
}).catch(error=>{});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function handleChange(info){
|
||||||
|
if (info.file.status === 'uploading' || info.file.status === 'done' || info.file.status === 'removed') {
|
||||||
|
let fileList = [info.file];
|
||||||
|
|
||||||
|
let list = appendFileSizeToUploadFileAll(fileList);
|
||||||
|
setFileList(list);
|
||||||
|
if ( info.file.status === 'done') {
|
||||||
|
let f = info.fileList && info.fileList.length>0 && info.fileList[info.fileList.length-1];
|
||||||
|
if(f && f.response && f.response.status === -1){
|
||||||
|
showNotification(f.response.message)
|
||||||
|
setFileList(f);
|
||||||
|
}
|
||||||
|
fileIdList(fileList);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function fileIdList(fileList){
|
||||||
|
let l = fileList && fileList.length > 0 && fileList[0];
|
||||||
|
let array = [l && l.response && l.response.id];
|
||||||
|
load && load(array);
|
||||||
|
}
|
||||||
|
|
||||||
|
function beforeUpload(file){
|
||||||
|
if(!size) return;
|
||||||
|
const isLt100M = file.size / 1024 / 1024 < size;
|
||||||
|
if (!isLt100M) {
|
||||||
|
showNotification(`文件大小必须小于${size}MB!`);
|
||||||
|
}
|
||||||
|
return isLt100M;
|
||||||
|
}
|
||||||
|
|
||||||
|
//判断是否已经提交,如已提交评论则上一条评论数据清除
|
||||||
|
const upload = {
|
||||||
|
name: 'file',
|
||||||
|
fileList: fileList,
|
||||||
|
action: `${getUploadActionUrl()}`,
|
||||||
|
onChange: handleChange,
|
||||||
|
onRemove: onAttachmentRemove,
|
||||||
|
beforeUpload: beforeUpload
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Upload {...upload} className={className}>
|
||||||
|
{children}
|
||||||
|
</Upload>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
export default Single;
|
|
@ -1,21 +0,0 @@
|
||||||
|
|
||||||
1.请求URL: https://code.ihub.org.cn/api/v1/mirrors/create.json
|
|
||||||
|
|
||||||
2.请求方式: POST
|
|
||||||
|
|
||||||
3.参数:
|
|
||||||
|
|
||||||
{
|
|
||||||
"image_url": "xxx.git", #必填,且后缀必为.git,
|
|
||||||
"language": "Ruby", #必填,如数据库不存在,则会创建新的记录
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
4. 返回值: {
|
|
||||||
"status": 1,
|
|
||||||
"message": "同步成功,项目ID===1806"
|
|
||||||
}
|
|
||||||
|
|
||||||
5. 返回值说明: 仅有当有返回值,且返回值的status 的值为1, 才是创建成功,其余均为创建失败
|
|
||||||
|
|
||||||
|
|
|
@ -62,6 +62,9 @@
|
||||||
.text-yellow{
|
.text-yellow{
|
||||||
color: #FFA802 !important
|
color: #FFA802 !important
|
||||||
}
|
}
|
||||||
|
.text-grey{
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
.text-gray {
|
.text-gray {
|
||||||
color: #888888;
|
color: #888888;
|
||||||
}
|
}
|
||||||
|
|
|
@ -166,7 +166,12 @@ form{
|
||||||
margin-bottom: 12px;
|
margin-bottom: 12px;
|
||||||
border-radius:2px;
|
border-radius:2px;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
&>li{
|
.list-affix{
|
||||||
|
min-height: 20px;
|
||||||
|
max-height: 180px;
|
||||||
|
overflow-y: auto;
|
||||||
|
}
|
||||||
|
& li{
|
||||||
font-size: 1rem;
|
font-size: 1rem;
|
||||||
padding:0px 0px 0px 20px;
|
padding:0px 0px 0px 20px;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
|
|
@ -6,7 +6,6 @@ import { withRouter } from "react-router";
|
||||||
import { SnackbarHOC } from "educoder";
|
import { SnackbarHOC } from "educoder";
|
||||||
import { CNotificationHOC } from "../../modules/courses/common/CNotificationHOC";
|
import { CNotificationHOC } from "../../modules/courses/common/CNotificationHOC";
|
||||||
import { TPMIndexHOC } from "../../modules/tpm/TPMIndexHOC";
|
import { TPMIndexHOC } from "../../modules/tpm/TPMIndexHOC";
|
||||||
import Handbook from '../Component/Handbook';
|
|
||||||
const Infos = Loadable({
|
const Infos = Loadable({
|
||||||
loader: () => import("./Infos"),
|
loader: () => import("./Infos"),
|
||||||
loading: Loading,
|
loading: Loading,
|
||||||
|
@ -15,7 +14,6 @@ export default withRouter(
|
||||||
(CNotificationHOC()(SnackbarHOC()(TPMIndexHOC((props)=>{
|
(CNotificationHOC()(SnackbarHOC()(TPMIndexHOC((props)=>{
|
||||||
return(
|
return(
|
||||||
<div>
|
<div>
|
||||||
<Handbook />
|
|
||||||
<Switch>
|
<Switch>
|
||||||
<Route
|
<Route
|
||||||
path="/users/:username"
|
path="/users/:username"
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
import React, { Component } from "react";
|
import React, { Component } from "react";
|
||||||
import { Link } from "react-router-dom";
|
|
||||||
import { Avatar, Tag, Button, Spin } from "antd";
|
import { Avatar, Tag, Button, Spin } from "antd";
|
||||||
import FocusButton from "../UsersList/focus_button";
|
import FocusButton from "../UsersList/focus_button";
|
||||||
|
|
||||||
|
@ -52,7 +51,7 @@ class Infos extends Component {
|
||||||
isSpin: false,
|
isSpin: false,
|
||||||
user: undefined,
|
user: undefined,
|
||||||
project_type: undefined,
|
project_type: undefined,
|
||||||
route_type: undefined
|
route_type: undefined,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -147,7 +146,7 @@ class Infos extends Component {
|
||||||
<Spin spinning={isSpin}>
|
<Spin spinning={isSpin}>
|
||||||
<div className="new-content-flex">
|
<div className="new-content-flex">
|
||||||
<div className="list-left">
|
<div className="list-left">
|
||||||
<div className="bgcF">
|
<div className="bgcF mb20">
|
||||||
<div className="list-l-Menu text-center pd20 ">
|
<div className="list-l-Menu text-center pd20 ">
|
||||||
<Avatar
|
<Avatar
|
||||||
size={110}
|
size={110}
|
||||||
|
@ -168,11 +167,7 @@ class Infos extends Component {
|
||||||
<Button
|
<Button
|
||||||
block
|
block
|
||||||
className="text-button-grey"
|
className="text-button-grey"
|
||||||
href={`${
|
href={`/users/${user.login}/profiles`}
|
||||||
mygetHelmetapi &&mygetHelmetapi.new_course&&
|
|
||||||
mygetHelmetapi.new_course.edit_account
|
|
||||||
}`}
|
|
||||||
target="_blank"
|
|
||||||
>
|
>
|
||||||
{" "}
|
{" "}
|
||||||
<i className="iconfont icon-shezhi4 font-15 mr5"></i>
|
<i className="iconfont icon-shezhi4 font-15 mr5"></i>
|
||||||
|
@ -193,22 +188,22 @@ class Infos extends Component {
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<div className="width100 inline-block mt20">
|
<div className="width100 inline-block mt20">
|
||||||
<Link
|
<a
|
||||||
to={`/users/${user && user.login}/watchers`}
|
href={`/users/${user && user.login}/user_watchlist`}
|
||||||
className={`with50 text-center pull-left ${route_type === "watchers" ? "text-primary" : ""}`}
|
className={`with50 text-center pull-left ${route_type === "watchers" ? "text-primary" : ""}`}
|
||||||
onClick={() =>this.route_link("watchers")}
|
onClick={() =>this.route_link("watchers")}
|
||||||
>
|
>
|
||||||
<div>{current_user && user && user.login === current_user.login ? "我关注的" : "TA关注的"}</div>
|
<div>{current_user && user && user.login === current_user.login ? "我关注的" : "TA关注的"}</div>
|
||||||
<span>{user && user.watching_count}</span>
|
<span>{user && user.watching_count}</span>
|
||||||
</Link>
|
</a>
|
||||||
<Link
|
<a
|
||||||
to={`/users/${user && user.login}/fan_users`}
|
href={`/users/${user && user.login}/user_fanslist`}
|
||||||
onClick={() =>this.route_link("fan_users")}
|
onClick={() =>this.route_link("fan_users")}
|
||||||
className={`with50 text-center pull-left ${route_type === "fan_users" ? "text-primary" : ""}`}
|
className={`with50 text-center pull-left ${route_type === "fan_users" ? "text-primary" : ""}`}
|
||||||
>
|
>
|
||||||
<div>{current_user && user && user.login === current_user.login ? "关注我的" : "关注TA的"}</div>
|
<div>{current_user && user && user.login === current_user.login ? "关注我的" : "关注TA的"}</div>
|
||||||
<span>{user && user.watched_count}</span>
|
<span>{user && user.watched_count}</span>
|
||||||
</Link>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -230,7 +225,7 @@ class Infos extends Component {
|
||||||
|
|
||||||
<div className="bgcF">
|
<div className="bgcF">
|
||||||
<ul className="list-l-Menu">
|
<ul className="list-l-Menu">
|
||||||
<li className="MenuTitle" onClick={() => this.change_project_type(undefined)}>
|
<li className="MenuTitle" onClick={() => this.change_project_type()}>
|
||||||
<i className="iconfont icon-xiangmuleixing font-15 mr5"></i>
|
<i className="iconfont icon-xiangmuleixing font-15 mr5"></i>
|
||||||
项目类型
|
项目类型
|
||||||
<i className="iconfont icon-youjiantou font-15 mr20 color-grey-9 pull-right"></i>
|
<i className="iconfont icon-youjiantou font-15 mr20 color-grey-9 pull-right"></i>
|
||||||
|
|
|
@ -580,9 +580,9 @@ class LoginDialog extends Component {
|
||||||
<label htmlFor="p_autolog" style={{ top: '0px' }}>下次自动登录</label>
|
<label htmlFor="p_autolog" style={{ top: '0px' }}>下次自动登录</label>
|
||||||
</span>
|
</span>
|
||||||
<span className="fr">
|
<span className="fr">
|
||||||
<a onClick={(url) => this.getloginurl("https://www.trustie.net/account/lost_password")}
|
<a onClick={(url) => this.getloginurl("http://39.105.176.215/account/lost_password")}
|
||||||
className="mr3 color-grey-9">找回密码</a><em className="vertical-line"></em>
|
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("http://39.105.176.215/user_join")} className="color-grey-9">注册</a>
|
||||||
</span>
|
</span>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
|
|
@ -13,12 +13,9 @@ 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';
|
||||||
import logo from './images/logo.png';
|
import logo from './images/logo.png';
|
||||||
|
import { result } from 'lodash';
|
||||||
|
|
||||||
const $ = window.$
|
const $ = window.$
|
||||||
// TODO 这部分脚本从公共脚本中直接调用
|
|
||||||
const { Search } = Input;
|
|
||||||
let old_url;
|
|
||||||
|
|
||||||
window._header_componentHandler = null;
|
window._header_componentHandler = null;
|
||||||
// 非trustie链接则新开页跳转
|
// 非trustie链接则新开页跳转
|
||||||
const str = ['www.trustie.net','forgeplus.trustie.net','forum.trustie.net','testforgeplus.trustie.net']
|
const str = ['www.trustie.net','forgeplus.trustie.net','forum.trustie.net','testforgeplus.trustie.net']
|
||||||
|
@ -49,7 +46,7 @@ class NewHeader extends Component {
|
||||||
headtypess: "/",
|
headtypess: "/",
|
||||||
mygetHelmetapi2: null,
|
mygetHelmetapi2: null,
|
||||||
goshowqqgtounp: false,
|
goshowqqgtounp: false,
|
||||||
visiblemyss: false,
|
visiblemyss: false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
|
@ -96,10 +93,6 @@ class NewHeader extends Component {
|
||||||
this.setState({
|
this.setState({
|
||||||
user: newProps.user
|
user: newProps.user
|
||||||
})
|
})
|
||||||
if (newProps.Headertop !== undefined) {
|
|
||||||
old_url = newProps.Headertop.old_url
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
getCookie = (key) => {
|
getCookie = (key) => {
|
||||||
var arr, reg = RegExp('(^| )' + key + '=([^;]+)(;|$)');
|
var arr, reg = RegExp('(^| )' + key + '=([^;]+)(;|$)');
|
||||||
|
@ -395,6 +388,7 @@ class NewHeader extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
inputjoinclassvalue = (e) => {
|
inputjoinclassvalue = (e) => {
|
||||||
|
console.log(e.target.value.length);
|
||||||
if (e.target.value.length >= 7) {
|
if (e.target.value.length >= 7) {
|
||||||
this.openNotification("请输入6位项目邀请码!");
|
this.openNotification("请输入6位项目邀请码!");
|
||||||
return
|
return
|
||||||
|
@ -552,8 +546,6 @@ class NewHeader extends Component {
|
||||||
axios.get(url).then((response) => {
|
axios.get(url).then((response) => {
|
||||||
if (response && response.data) {
|
if (response && response.data) {
|
||||||
this.setState({ mygetHelmetapi2: response.data.setting });
|
this.setState({ mygetHelmetapi2: response.data.setting });
|
||||||
// localStorage.setItem('chromesetting', JSON.stringify(response.data.setting));
|
|
||||||
// localStorage.setItem('chromesettingresponse', JSON.stringify(response));
|
|
||||||
try {
|
try {
|
||||||
if (response.data.setting.tab_logo_url) {
|
if (response.data.setting.tab_logo_url) {
|
||||||
this.gettablogourldata(response);
|
this.gettablogourldata(response);
|
||||||
|
@ -610,7 +602,7 @@ class NewHeader extends Component {
|
||||||
headtypesonClickbool,
|
headtypesonClickbool,
|
||||||
headtypess,
|
headtypess,
|
||||||
mygetHelmetapi2,
|
mygetHelmetapi2,
|
||||||
goshowqqgtounp,
|
goshowqqgtounp
|
||||||
} = this.state;
|
} = this.state;
|
||||||
/*用户名称 用户头像url*/
|
/*用户名称 用户头像url*/
|
||||||
let activeIndex = false;
|
let activeIndex = false;
|
||||||
|
@ -764,7 +756,6 @@ class NewHeader extends Component {
|
||||||
<ul className="edu-txt-center">
|
<ul className="edu-txt-center">
|
||||||
<li><Link to={"/projects/mirror/new"}>新建镜像项目</Link></li>
|
<li><Link to={"/projects/mirror/new"}>新建镜像项目</Link></li>
|
||||||
<li><Link to={"/projects/deposit/new"}>新建托管项目</Link></li>
|
<li><Link to={"/projects/deposit/new"}>新建托管项目</Link></li>
|
||||||
<li><Link to={"/organize/new"}>新建组织</Link></li>
|
|
||||||
</ul>
|
</ul>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
|
@ -834,17 +825,33 @@ class NewHeader extends Component {
|
||||||
<ul className="edu-menu-list" style={{ top: '60px', textAlign: 'center' }}>
|
<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>
|
<li className="bor-bottom-greyE" style={{cursor:"default",background:"#fff"}}>{this.props.current_user.username}</li>
|
||||||
<li>
|
<li>
|
||||||
<Link to={`/users/${this.props.current_user.login}`}>个人中心</Link>
|
<a href={`/users/${user.login}`}>个人中心</a>
|
||||||
</li>
|
</li>
|
||||||
{
|
<li>
|
||||||
mygetHelmetapi2 && mygetHelmetapi2.new_course && mygetHelmetapi2.new_course.my_courses &&
|
<a
|
||||||
<li><a href={`${mygetHelmetapi2.new_course.my_courses}`} target="_blank">我的课程</a></li>
|
href={`${mygetHelmetapi2 && mygetHelmetapi2.main_web_site_url}users/${user.login}/profiles`}
|
||||||
}
|
>
|
||||||
{
|
账号管理
|
||||||
mygetHelmetapi2 && mygetHelmetapi2.new_course && mygetHelmetapi2.new_course.my_organ &&
|
</a>
|
||||||
<li><a href={`/users/${this.props.current_user.login}/organizes`} target="_blank">我的组织</a></li>
|
</li>
|
||||||
}
|
<li>
|
||||||
<li className="bor-top-greyE">
|
<a
|
||||||
|
href={`${mygetHelmetapi2 && mygetHelmetapi2.main_web_site_url}users/${user.login}/user_tidings`}
|
||||||
|
>
|
||||||
|
我的消息
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a href={`${mygetHelmetapi2 && mygetHelmetapi2.main_web_site_url}my/account`}>
|
||||||
|
账号安全
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a href={`${mygetHelmetapi2 && mygetHelmetapi2.main_web_site_url}tasks/my_tasks`}>
|
||||||
|
创客管理
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li className="border-Tgrey-eb">
|
||||||
<a onClick={() => this.educoderloginysl()}>退出</a>
|
<a onClick={() => this.educoderloginysl()}>退出</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -33,7 +33,8 @@ body>.-task-title {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
}
|
}
|
||||||
.headerContent{
|
.headerContent{
|
||||||
width:1200px;
|
width:100%;
|
||||||
|
padding:0px 70px;
|
||||||
margin:0px auto;
|
margin:0px auto;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
@ -130,11 +131,6 @@ body>.-task-title {
|
||||||
color: #000 !important;
|
color: #000 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.newHeader {
|
|
||||||
background: #24292D !important;
|
|
||||||
height: 60px !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*-------------------个人主页:右侧提示区域--------------------------*/
|
/*-------------------个人主页:右侧提示区域--------------------------*/
|
||||||
.-task-sidebar {
|
.-task-sidebar {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
|
|
|
@ -0,0 +1,119 @@
|
||||||
|
|
||||||
|
.headerRight{
|
||||||
|
float: right;
|
||||||
|
}
|
||||||
|
.head-navnew{
|
||||||
|
width:97%;
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
.iconSearch{
|
||||||
|
color: #666 !important;
|
||||||
|
margin-top: -13px !important;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
.headerLeft{
|
||||||
|
flex:1;
|
||||||
|
}
|
||||||
|
.headerRight{
|
||||||
|
flex:0.8;
|
||||||
|
width:200px;
|
||||||
|
}
|
||||||
|
.headerRightbox{
|
||||||
|
width:100%;
|
||||||
|
display:flex;
|
||||||
|
}
|
||||||
|
.radius{border-radius: 50%;}
|
||||||
|
.posi-search{
|
||||||
|
flex:8;
|
||||||
|
margin-top:15px;
|
||||||
|
}
|
||||||
|
.headRightbox{
|
||||||
|
display:flex;
|
||||||
|
flex:4;
|
||||||
|
}
|
||||||
|
.headRightboxuse{
|
||||||
|
display:flex;
|
||||||
|
flex:2;
|
||||||
|
margin-right: 15px;
|
||||||
|
}
|
||||||
|
.headRightpan,.headRightwrite,.headRighthint{
|
||||||
|
width: 48px;
|
||||||
|
height: 70px;
|
||||||
|
line-height: 70px;
|
||||||
|
}
|
||||||
|
.headRighthint-font{
|
||||||
|
color:#666 !important;
|
||||||
|
}
|
||||||
|
.searchBox{
|
||||||
|
float:right;
|
||||||
|
}
|
||||||
|
.newslight{
|
||||||
|
left: 25px !important;
|
||||||
|
top: 14px !important;
|
||||||
|
color:#fff;
|
||||||
|
min-height:18px;
|
||||||
|
min-width: 18px;
|
||||||
|
line-height:18px;
|
||||||
|
padding:0px 3px;
|
||||||
|
border-radius:50%;
|
||||||
|
background:red;
|
||||||
|
position:absolute;
|
||||||
|
font-size:12px
|
||||||
|
}
|
||||||
|
.isLogin{
|
||||||
|
line-height:46px
|
||||||
|
}
|
||||||
|
.isLoginImg{
|
||||||
|
margin-top: 7px !important;
|
||||||
|
}
|
||||||
|
.headerRight a {
|
||||||
|
color: #1A3F5F;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
.headerRight a:hover{
|
||||||
|
color: #21B351 !important;
|
||||||
|
}
|
||||||
|
.headerRight i{
|
||||||
|
font-size: 18px !important;
|
||||||
|
margin-top: 17px;
|
||||||
|
vertical-align: -4px;
|
||||||
|
}
|
||||||
|
.headIcon, #header_keyword_search {
|
||||||
|
padding-top: 0px !important;
|
||||||
|
}
|
||||||
|
.search-all {
|
||||||
|
width: 300px !important;
|
||||||
|
height: 28px !important;
|
||||||
|
}
|
||||||
|
.edu-menu-list li{
|
||||||
|
text-align:left;
|
||||||
|
}
|
||||||
|
.eduSearch{
|
||||||
|
width:50px !important;
|
||||||
|
height:26px;
|
||||||
|
line-height: 26px;
|
||||||
|
}
|
||||||
|
.eduSearch:after {
|
||||||
|
position: absolute;
|
||||||
|
height: 10px;
|
||||||
|
width: 1px;
|
||||||
|
background-color: #EBEBEB;
|
||||||
|
right: 0px;
|
||||||
|
top: 9px;
|
||||||
|
content: '';
|
||||||
|
}
|
||||||
|
.searchLabel{
|
||||||
|
margin: 0px !important;
|
||||||
|
vertical-align: 0px !important;
|
||||||
|
font-size: 12px !important;
|
||||||
|
}
|
||||||
|
.search-input{
|
||||||
|
width: 73% !important;
|
||||||
|
margin-left: 2%;
|
||||||
|
}
|
||||||
|
.newHeader .search-all .search-input {
|
||||||
|
color: #000;
|
||||||
|
}
|
||||||
|
.border-Tgrey-eb{
|
||||||
|
border-top: 1px solid #ebebeb;
|
||||||
|
}
|
|
@ -0,0 +1,150 @@
|
||||||
|
.newHeader {
|
||||||
|
background: #fff;
|
||||||
|
width: 100%;
|
||||||
|
height: 70px;
|
||||||
|
min-width: 1200px;
|
||||||
|
position: fixed;
|
||||||
|
top: 0px;
|
||||||
|
left: 0px;
|
||||||
|
z-index: 99;
|
||||||
|
-moz-box-shadow: 0px 0px 12px rgba(0,0,0,0.1);
|
||||||
|
box-shadow: 0px 0px 12px rgba(0,0,0,0.1);
|
||||||
|
}
|
||||||
|
.educontent {
|
||||||
|
width: 1200px;
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
.head-nav {
|
||||||
|
text-align: center;
|
||||||
|
height: 60px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
width:100%;
|
||||||
|
padding:0px 70px
|
||||||
|
}
|
||||||
|
.newHeader .logoimg {
|
||||||
|
margin-top: 12px;
|
||||||
|
float: left;
|
||||||
|
width: 48px;
|
||||||
|
}
|
||||||
|
.headerLeft {
|
||||||
|
-ms-flex: 1 1;
|
||||||
|
flex: 1 1;
|
||||||
|
}
|
||||||
|
.head-nav ul#header-nav {
|
||||||
|
position: absolute;
|
||||||
|
top: 0px;
|
||||||
|
z-index: 3;
|
||||||
|
height: 70px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
.head-nav ul#header-nav li {
|
||||||
|
float: left;
|
||||||
|
height: 70px;
|
||||||
|
line-height: 70px;
|
||||||
|
padding: 0px 24px;
|
||||||
|
cursor: pointer;
|
||||||
|
position: relative;
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
.head-nav ul#header-nav li a {
|
||||||
|
display: block;
|
||||||
|
height: 100%;
|
||||||
|
width: 100%;
|
||||||
|
color: #333;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
.head-nav ul#header-nav li:hover a, .head-nav ul#header-nav li.active a{
|
||||||
|
color: #1484EF;
|
||||||
|
}
|
||||||
|
.head-nav ul#header-nav li.active a::after{
|
||||||
|
content: "";
|
||||||
|
width: 100%;
|
||||||
|
height:2px;
|
||||||
|
background-color: #1484EF;
|
||||||
|
left:0px;
|
||||||
|
bottom: 12px;
|
||||||
|
position: absolute;
|
||||||
|
}
|
||||||
|
.headRightboxuse {
|
||||||
|
-ms-flex: 2 1;
|
||||||
|
flex: 2 1;
|
||||||
|
margin-right: 15px;
|
||||||
|
}
|
||||||
|
.headRightbox, .headRightboxuse {
|
||||||
|
display: -ms-flexbox;
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
.edu-menu-panel {
|
||||||
|
position: relative;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
.edu-menu-panel:hover .edu-menu-list{
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
ul.edu-menu-list li:hover{
|
||||||
|
background: #fafafa !important;
|
||||||
|
/* color: #1484EF !important */
|
||||||
|
}
|
||||||
|
ul.edu-menu-list li:hover > a{color: #1484EF !important;}
|
||||||
|
|
||||||
|
.headRighthint, .headRightpan, .headRightwrite {
|
||||||
|
width: 48px;
|
||||||
|
height: 60px;
|
||||||
|
line-height: 60px;
|
||||||
|
}
|
||||||
|
.color-white {
|
||||||
|
color: #ffffff!important;
|
||||||
|
}
|
||||||
|
em.vertical-line {
|
||||||
|
display: inline-block;
|
||||||
|
width: 2px;
|
||||||
|
background: #999;
|
||||||
|
height: 10px;
|
||||||
|
}
|
||||||
|
.edu-menu-list {
|
||||||
|
position: absolute;
|
||||||
|
padding: 5px 0px;
|
||||||
|
box-shadow: 0 2px 8px 0 rgba(0,0,0,.2);
|
||||||
|
display: none;
|
||||||
|
width: 120px;
|
||||||
|
background: #FFFFff;
|
||||||
|
right: -5px;
|
||||||
|
border-radius: 0px 0px 4px 4px;
|
||||||
|
color: #05101a;
|
||||||
|
font-size: 14px;
|
||||||
|
z-index: 100;
|
||||||
|
}
|
||||||
|
.edu-menu-list li {
|
||||||
|
width: 100%;
|
||||||
|
padding: 0px 15px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
height: 35px;
|
||||||
|
line-height: 35px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
.edu-menu-list li a, .edu-menuSmall-list li a {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
display: block;
|
||||||
|
color: #323232;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
.currentName {
|
||||||
|
display: block;
|
||||||
|
width: 100%;
|
||||||
|
padding: 0px 15px;
|
||||||
|
height: 40px;
|
||||||
|
line-height: 40px;
|
||||||
|
font-size: 16px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
cursor: default;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
.border-Bgrey-eb {
|
||||||
|
border-bottom: 1px solid #ebebeb;
|
||||||
|
}
|
||||||
|
.task-hide {
|
||||||
|
overflow: hidden;
|
||||||
|
white-space: nowrap;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
}
|
Loading…
Reference in New Issue