diff --git a/package-lock.json b/package-lock.json index 9ea84263..a72d2386 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14204,7 +14204,7 @@ }, "qr.js": { "version": "0.0.0", - "resolved": "https://registry.npmjs.org/qr.js/-/qr.js-0.0.0.tgz", + "resolved": "https://registry.npm.taobao.org/qr.js/download/qr.js-0.0.0.tgz", "integrity": "sha1-ys6GOG9ZoNuAUPqQ2baw6IoeNk8=" }, "qrcode.react": { diff --git a/public/css/edu-common.css b/public/css/edu-common.css index 56790f05..30ddf03f 100755 --- a/public/css/edu-common.css +++ b/public/css/edu-common.css @@ -25,9 +25,6 @@ html { min-width: 1200px } -.newFooter { - max-height: 110px; -} .newFooter { position: absolute; diff --git a/public/css/edu-purge.css b/public/css/edu-purge.css index 0d146204..0d23c5bc 100644 --- a/public/css/edu-purge.css +++ b/public/css/edu-purge.css @@ -3604,7 +3604,6 @@ a.user_bluebg_btn { margin-right: 5px; } - /***** loading ******/ /*****载入中******/ #ajax-indicator { @@ -3971,7 +3970,7 @@ html>body #ajax-indicator { display: block; height: 100%; width: 100%; - color: #333; + color: #fff; font-size: 16px; } diff --git a/src/App.js b/src/App.js index 3072aca5..fad7e937 100644 --- a/src/App.js +++ b/src/App.js @@ -84,7 +84,7 @@ const EducoderLogin = Loadable({ loading: Loading, }) const Search = Loadable({ - loader: () => import('./modules/search/'), + loader: () => import('./search/SearchPage'), loading: Loading, }) const WikiPreview = Loadable({ @@ -92,6 +92,7 @@ const WikiPreview = Loadable({ loading: Loading, }) + const ProjectIndex = Loadable({ loader: () => import("./forge/Index"), loading: Loading, @@ -178,7 +179,6 @@ class App extends Component { componentDidMount() { document.title = "loading..."; - this.getAppdata(); window.addEventListener('error', (event) => { diff --git a/src/AppConfig.js b/src/AppConfig.js index ea85a4e5..b93e7c0b 100644 --- a/src/AppConfig.js +++ b/src/AppConfig.js @@ -11,9 +11,9 @@ broadcastChannelOnmessage('refreshPage', () => { }) function locationurl(list) { - if (window.location.port !== "3007") { + // if (window.location.port !== "3007") { window.location.href = list - } + // } } // TODO 开发期多个身份切换 let debugType = "" @@ -32,7 +32,7 @@ export function initAxiosInterceptors(props) { // 判断网络是否连接 initOnlineOfflineListener(); - var proxy = "https://testforgeplus.trustie.net"; + var proxy = "https://testforgeplus.educoder.net"; //响应前的设置 axios.interceptors.request.use( config => { @@ -86,7 +86,7 @@ export function initAxiosInterceptors(props) { if (response.data.status === 404) { let responseURL = response.request ? response.request.responseURL:''; - if (responseURL.indexOf('/api/users/') === -1 && responseURL.indexOf('/api/organizations/') === -1 ) { + if (responseURL.indexOf('/api/users/') === -1 || responseURL.indexOf('/api/organizations/') === -1 || responseURL.indexOf('/api/owners/') === -1) { locationurl('/nopage'); } } diff --git a/src/common/UrlTool.js b/src/common/UrlTool.js index f1800a75..f75fbf70 100644 --- a/src/common/UrlTool.js +++ b/src/common/UrlTool.js @@ -8,16 +8,34 @@ const isDev = window.location.port == 3007; const isdev2= window.location.hostname ==='www.educoder.net' export const TEST_HOST = "https://testforgeplus.trustie.net/" export function getImageUrl(path) { - // https://www.educoder.net - // https://testbdweb.trustie.net - // const local = 'http://localhost:3000' - const local = 'https://testforgeplus.trustie.net'; - if (isDev) { - return `${local}/${path}` + const local = 'https://testforgeplus.educoder.net'; + const normal = 'https://ali-cdn.educoder.net/images'; + const normalend = 'https://ali-cdn.educoder.net'; + if(path.substr(0, 7) !== "/system"){ + if (isDev) { + return `${local}/${path}` + } + if(path.substr(0, 7) !== "/images"){ + return `${normal}${path}`; + }else{ + return `${normalend}${path}`; + } } return `${path}`; } + +export function openNewWindow(url) { + let link = document.createElement('a') + link.target = "_blank" + document.body.appendChild(link) + link.href = url + let evt = document.createEvent("MouseEvents") + evt.initEvent("click", false, false) + link.dispatchEvent(evt) + document.body.removeChild(link); +} + export function numFormat(num, digits){ let d = digits || 1; var si = [ @@ -179,7 +197,7 @@ export function getmyUrl(geturl) { } export function getUploadActionUrl(path, goTest) { - return `${getUrl()}/api/attachments.json${isDev ?`${isDev ?`?debug=${window._debugType || 'admin'}` : ""}` : ""}`; + return `${getUrl()}/api/attachments.json`; } export function getUploadLogoActionUrl() { diff --git a/src/common/educoder.js b/src/common/educoder.js index 1a063d82..5191bb4f 100644 --- a/src/common/educoder.js +++ b/src/common/educoder.js @@ -7,6 +7,7 @@ export { getImageUrl as getImageUrl,getImage as getImage, getmyUrl as getmyUrl, getRandomNumber as getRandomNumber, getUrl as getUrl, publicSearchs as publicSearchs, getRandomcode as getRandomcode, getUrlmys as getUrlmys, getUrl2 as getUrl2, setImagesUrl as setImagesUrl , getUploadActionUrl as getUploadActionUrl, getUploadActionUrltwo as getUploadActionUrltwo, getUploadActionUrlthree as getUploadActionUrlthree, getUploadActionUrlOfAuth as getUploadActionUrlOfAuth , getTaskUrlById as getTaskUrlById, TEST_HOST, htmlEncode as htmlEncode, getupload_git_file as getupload_git_file, getcdnImageUrl as getcdnImageUrl + , openNewWindow as openNewWindow } from './UrlTool'; export { setmiyah as setmiyah } from './Component'; diff --git a/src/forge/Component/EAccount.scss b/src/forge/Component/EAccount.scss index 6fe44ab3..38dc0adf 100644 --- a/src/forge/Component/EAccount.scss +++ b/src/forge/Component/EAccount.scss @@ -3,4 +3,9 @@ } .ant-modal-wrap{ z-index: 1032; +} +.ant-modal-wrap{ + .ant-form-explain{ + position: absolute; + } } \ No newline at end of file diff --git a/src/forge/Component/EducoderAccount.jsx b/src/forge/Component/EducoderAccount.jsx index 51fe0ded..76243f77 100644 --- a/src/forge/Component/EducoderAccount.jsx +++ b/src/forge/Component/EducoderAccount.jsx @@ -1,15 +1,32 @@ import React , {forwardRef, useEffect} from 'react'; import { Modal , Form , Input , Button } from 'antd'; import './EAccount.scss'; +import axios from 'axios'; -function EducoderAccount({form , visible , onOk , email}){ +function EducoderAccount({form , visible , current_user , onCancel}){ const { getFieldDecorator, validateFields , setFieldsValue } = form; useEffect(()=>{ - if(email){ - setFieldsValue({email}) + if(current_user && current_user.email){ + setFieldsValue({email:current_user.email}) } - },[email]) + },[current_user]) + + function onOk(values){ + let url = `/accounts/gitea_register.json`; + const { email , is_sync_pwd} = current_user; + if(email && !is_sync_pwd){ + url = `/users/change_password.json`; + } + axios.post(url,{ + login:current_user && current_user.login, + ...values + }).then(result=>{ + if(result && result.data && result.data.status === 0){ + window.location.reload(); + } + }).catch(error=>{}) + } function onSure(){ validateFields((error,values)=>{ @@ -27,7 +44,7 @@ function EducoderAccount({form , visible , onOk , email}){ visible={visible} title="提示" width="500px" - closable={false} + onCancel={onCancel} footer={ } @@ -35,21 +52,26 @@ function EducoderAccount({form , visible , onOk , email}){ >

- 为确保您能正常使用平台功能,请确认以下信息: + { + current_user && current_user.email ? + `平台已检测到您已绑定邮箱${current_user.email},请您确认如下操作` + : + "平台已检测到您未绑定邮箱,为不影响使用协同开发功能,请先绑定邮箱" + }

{getFieldDecorator("email",{ rules:[{required:true,message:"请输入邮箱账号"}] })( - + )} {getFieldDecorator("password",{ - rules:[{required:true,message:"请输入邮箱密码"}] + rules:[{required:true,message:"请输入您的平台密码"}] })( - + )}
diff --git a/src/forge/Component/ProfileModal/Profile.jsx b/src/forge/Component/ProfileModal/Profile.jsx index e63c1286..977c6de0 100644 --- a/src/forge/Component/ProfileModal/Profile.jsx +++ b/src/forge/Component/ProfileModal/Profile.jsx @@ -1,17 +1,36 @@ import React from 'react'; +import { useState } from 'react'; +import EducoderAccount from '../EducoderAccount'; -function Profile({children,sureFunc,showCompeleteDialog , completeProfile, className}) { - +function Profile({ + children, + sureFunc, + showCompeleteDialog , + completeProfile, + className , + current_user +}) { + const [ giteaVisible , setGiteaVisible ] = useState(false); + function checkProfile() { - if(!completeProfile){ - showCompeleteDialog && showCompeleteDialog(); - }else{ - sureFunc(); + if(current_user && current_user.login){ + if(!current_user.has_gitea_user || (current_user.has_gitea_user && !current_user.is_sync_pwd)){ + setGiteaVisible(true); + }else{ + if(!completeProfile){ + showCompeleteDialog && showCompeleteDialog(); + }else{ + sureFunc(); + } + } } } return( - {children} + + setGiteaVisible(false)} current_user={current_user}/> + {children} + ) } export default Profile; \ No newline at end of file diff --git a/src/forge/DevOps/ServiceModal.jsx b/src/forge/DevOps/ServiceModal.jsx index 3fac8bc9..9be3dc2a 100644 --- a/src/forge/DevOps/ServiceModal.jsx +++ b/src/forge/DevOps/ServiceModal.jsx @@ -12,7 +12,7 @@ function ServiceModal({sureModal}){
自有服务器 - Trustie服务器 + EduCoder服务器

diff --git a/src/forge/Divert/DivertModal.jsx b/src/forge/Divert/DivertModal.jsx index d4c1f201..a82cf5df 100644 --- a/src/forge/Divert/DivertModal.jsx +++ b/src/forge/Divert/DivertModal.jsx @@ -20,13 +20,6 @@ function DivertModal({form , visible , onSuccess , onCancel,owner,repo}){ if(owner && repo && visible===true){ getTeam(); } - if(!visible){ - setFieldsValue({ - owner_name:undefined, - identifier:undefined - }) - setValue(undefined) - } },[repo,owner,visible]) function getTeam(){ @@ -127,7 +120,6 @@ function DivertModal({form , visible , onSuccess , onCancel,owner,repo}){ {getFieldDecorator("owner_name",{ rules:[{required:true,message:"请输入目标用户名"}] })( - // )} @@ -153,11 +145,11 @@ function DivertModal({form , visible , onSuccess , onCancel,owner,repo}){ } - + {getFieldDecorator("identifier", { rules:[ - {required:true,message:"请输入仓库标识!"}, + {required:true,message:"请输入仓库标识"}, { validator:checkIdentifier } diff --git a/src/forge/Head/Engineer.jsx b/src/forge/Head/Engineer.jsx new file mode 100644 index 00000000..44e08fa6 --- /dev/null +++ b/src/forge/Head/Engineer.jsx @@ -0,0 +1,30 @@ +import React from 'react'; +import { Modal } from 'antd'; +import { openNewWindow } from 'educoder'; + +function Engineer({QQVisible,setQQVisible}) { + + return( + { + openNewWindow("https://qm.qq.com/cgi-bin/qm/qr?k=DWdqQHAbbfw7_rqm0d-Q_vDn5H6bMp91&jump_from=webapi") + }} + onCancel={() => setQQVisible(false)} + > +
+

您可以在QQ服务群向管理员申请,获得继续操作的权限

+ < img src={require("./teacherQQ.png")} width={200} height={200} alt=""/> +

群号:693542422

+
+
+ ) +} +export default Engineer \ No newline at end of file diff --git a/src/forge/Head/Footer.jsx b/src/forge/Head/Footer.jsx index 52c06858..b54c234f 100644 --- a/src/forge/Head/Footer.jsx +++ b/src/forge/Head/Footer.jsx @@ -19,7 +19,7 @@ function Footer(){ return(
-
+
{value && showhtml(value)} {/*
diff --git a/src/forge/Head/Header.js b/src/forge/Head/Header.js index ac139351..d7f4b28b 100644 --- a/src/forge/Head/Header.js +++ b/src/forge/Head/Header.js @@ -1,9 +1,8 @@ import React, { Component } from 'react'; import AccountProfile from "../../modules/user/AccountProfile"; -import { getImageUrl } from 'educoder' +import { getImageUrl , openNewWindow } from 'educoder'; import axios from 'axios'; -import { Input , notification , Dropdown ,Popover, Menu,Badge, Button } from 'antd'; -import { Link } from 'react-router-dom'; +import { Input , notification , Dropdown , Menu } from 'antd'; import LoginDialog from '../../modules/login/LoginDialog'; import HeadSearch from '../Component/HeadSearch'; @@ -13,13 +12,14 @@ import '../../modules/tpm/TPMIndex.css'; import CheckProfile from '../Component/ProfileModal/Profile'; import './header.scss'; -import NoticeContent from './NoticeContent'; +import Engineer from './Engineer'; const $ = window.$ // TODO 这部分脚本从公共脚本中直接调用 const { Search } = Input; let old_url; window._header_componentHandler = null; +const isPath= window.location.hostname ==='code.educoder.net' || window.location.hostname==='testforgeplus.educoder.net'; // 非trustie链接则新开页跳转 const str = ['www.trustie.net','forgeplus.trustie.net','forum.trustie.net','testforgeplus.trustie.net'] class NewHeader extends Component { @@ -49,6 +49,7 @@ class NewHeader extends Component { visiblemyss: false, openSearch:false, visible:false, //浮动消息框展示控制 + QQVisible:false } } componentDidMount() { @@ -82,6 +83,36 @@ class NewHeader extends Component { } catch (e) {} } + SearchInput = (open,item)=>{ + if(open){ + return( +
{ + setTimeout(() => { + this.setState({ + openSearch:false + }) + }, 300) + }} + > + this.onGlobalSearch(value,item)} + autoFocus={true} + /> +
+ ) + }else{ + return { + this.setState({openSearch:true}) + }} /> + } + } + + onGlobalSearch=(value,item)=>{ + window.location.href=`${item}?value=` + value; + } + openNotification = (messge) => { notification.open({ message: "提示", @@ -96,6 +127,26 @@ class NewHeader extends Component { }) } + submitsubmitapplications = () => { + let { + submitapplicationssum, + submitapplicationsvaluedata + } = this.state; + this.setState({ + submitapplications: false, + RadioGroupvalue: undefined + }) + if (submitapplicationssum === 0) { + if (submitapplicationsvaluedata !== undefined) { + window.location.href = "/courses/" + submitapplicationsvaluedata; + } + } else if (submitapplicationssum === 1) { + if (submitapplicationsvaluedata !== undefined) { + window.location.href = "/projects/" + submitapplicationsvaluedata; + } + } + } + educoderlogin = () => { //登录账号 this.setState({ @@ -132,6 +183,24 @@ class NewHeader extends Component { }) }; + + hidetojoinclass = () => { + this.setState({ + tojoinclasstype: false, + tojoinitemtype: false, + tojoinclasstitle: undefined, + rolearr: ["", ""], + Checkboxteacherchecked: false, + Checkboxstudentchecked: false, + Checkboxteachingchecked: false, + Checkboxteachertype: false, + Checkboxteachingtype: false, + code_notice: false, + checked_notice: false, + RadioGroupvalue: undefined + }) + } + // 关闭 cancelModulationModels = () => { this.setState({ isRenders: false }) @@ -278,10 +347,32 @@ class NewHeader extends Component { this.setState({ visible }); }; + turntoEngineer=(url)=>{ + const { current_user } = this.props; + if(current_user && current_user.login){ + if(url){ + window.location.href=url; + }else{ + this.setState({ + QQVisible:true + }) + } + }else{ + this.educoderlogin(); + } + } + + setQQVisible=()=>{ + this.setState({ + QQVisible:false + }) + } + render() { - const { match ,resetUserInfo ,showNotification} = this.props; + const { match } = this.props; let current_user = this.props.user; let { + QQVisible, AccountProfiletype, user, isRender, @@ -369,6 +460,7 @@ class NewHeader extends Component { let search_url = settings && settings.common && settings.common.search; return (
+
{isRender === true ? new_link.indexOf(item)>-1) ); var wl = waiLian && waiLian.length>0; return ( -
  • this.headtypesonClick(item.link, true)} className={`${this.matchpaths(item.link) === true ? 'pr active' : 'pr'}`} style={!is_hidden ? { display: 'flex' } : { display: 'none' }}> - {item.name} +
  • this.headtypesonClick(item.link, true)} className={`${((isPath && item.name === "大学开源") || this.matchpaths(item.link) === true) ? 'pr active' : 'pr'}`} style={!is_hidden ? { display: 'flex' } : { display: 'none' }}> +
  • ) }) } + { + settings && settings.engineer_url !== undefined ? +
  • + this.turntoEngineer(settings.engineer_url)}>工程认证 +
  • + :"" + } : "" } @@ -438,29 +537,20 @@ class NewHeader extends Component { } { (settings && settings.common && settings.common.notice) && (current_user && current_user.login)? - } - visible={visible} - onVisibleChange={this.handleVisibleChange} - destroyTooltipOnHide - > - - {current_user && - - } - - + + {current_user && + + } + : "" }
    {!user || (user && !user.login) ? - this.educoderlogin()} className="mr5 color-grey-6">登录 + this.educoderlogin()} className="mr5 color-white">登录 { settings && settings.common && settings.common.register && - 注册 + 注册 } : diff --git a/src/forge/Head/NoticeContent.jsx b/src/forge/Head/NoticeContent.jsx index 634a7adc..24cf9fb2 100644 --- a/src/forge/Head/NoticeContent.jsx +++ b/src/forge/Head/NoticeContent.jsx @@ -184,11 +184,11 @@ function NoticeContent({ visible, showNotification, resetUserInfo, current_user: className='hoverNotice-body' // 外部添加className加以区分 onPullRefresh={() => { setNoticePage(noticePage + 1); }} //触发加载ajax的function // type={2} // 传送加载组件的状态 - count={noticeUnreadList.length} // 数据当前的总数量 + count={noticeUnreadList && noticeUnreadList.length} // 数据当前的总数量 pageSize={10} // > { - noticeUnreadList.map(item => { + noticeUnreadList && noticeUnreadList.length>0 && noticeUnreadList.map(item => { return (
    { readItem(item) }}>
    diff --git a/src/forge/Head/teacherQQ.png b/src/forge/Head/teacherQQ.png new file mode 100644 index 00000000..772a0e8d Binary files /dev/null and b/src/forge/Head/teacherQQ.png differ diff --git a/src/forge/Images/banner.png b/src/forge/Images/banner.png new file mode 100644 index 00000000..af644cb4 Binary files /dev/null and b/src/forge/Images/banner.png differ diff --git a/src/forge/Index.js b/src/forge/Index.js index c2e36916..e189fe63 100644 --- a/src/forge/Index.js +++ b/src/forge/Index.js @@ -79,6 +79,12 @@ class Index extends Component { )} > + ( + + )} + >
    ); diff --git a/src/forge/Main/Index.js b/src/forge/Main/Index.js index 3b1f66db..b03ae0bc 100644 --- a/src/forge/Main/Index.js +++ b/src/forge/Main/Index.js @@ -11,8 +11,9 @@ import ListItem from './IndexItem' import axios from 'axios'; import img_new from '../Images/new.png'; import img_array from '../Images/array.png'; -import banner from '../Images/banner_list.jpg'; +import banner from '../Images/banner.png'; import CheckProfile from '../Component/ProfileModal/Profile'; +import AddProjectModal from '../Head/AddProjectModal'; const Search = Input.Search; @@ -291,35 +292,33 @@ class Index extends Component { arrows:false, adaptiveHeight:true } - const settings={ - dots: true, - infinite: true, - speed: 500, - slidesToShow: 6, - slidesToScroll: 6, - autoplay:false, - arrows:false, - adaptiveHeight:true - } - return (
    -

    - -

    - {/* { - recommendOriList && recommendOriList.length>0? - - { - recommendOriList.map((i,k)=>{ - return( -
  • {i.name}
  • - ) - }) - } -
    - :"" - } */} +
    + +
    +
    + 头歌开源 + + + 让大学绽放开源之花 +

    Powered by Trustie

    +
    +
    +
    + this.props.history.push("/projects/deposit/new")}> + + 新建项目 + + + + + + + 新手指引 + +
    +
    { recommendList && recommendList.length>0 && 5 ? "recommandProjects":"recommandProjects mb20"}> @@ -345,7 +344,7 @@ class Index extends Component {
      -
    • 项目类型
    • +
    • 项目类型
    • {typeList}
      diff --git a/src/forge/Main/list.scss b/src/forge/Main/list.scss index 59589fb6..c2b8a2ab 100644 --- a/src/forge/Main/list.scss +++ b/src/forge/Main/list.scss @@ -1,10 +1,78 @@ .lineH2{line-height:2} -.t_project_banner { - /* height: 260px; - background: url(../Images/banner_list.jpg) no-repeat center; */ +.subjectBanner { + height: 160px; + position: relative; + overflow: hidden; background-color: #050d34; } +.subjectleft{ + margin-top: 40px; + display: -ms-flexbox; + display: flex; + -ms-flex-align: center; + align-items: center; +} +.bannerBox{ + width: 1200px; + position: absolute; + z-index: 2; + left: 50%; + top: 0; + transform: translateX(-50%); +} +.subjectleft>span:first-child{ + width: 140px; + height: 30px; + font-size: 30px; + font-weight: 600; + color: #fff; + line-height: 30px; + letter-spacing: 4px; +} +.subjectleft>span:last-child{ + height: 16px; + font-size: 16px; + color: #fff; + line-height: 16px; + margin-left: 16px; +} +.subjectleft>span:last-child .words{ + letter-spacing: 3px; + display: block; + margin-top: -6px; + margin-bottom: 2px!important; +} +.bannerBox > a{ + display: inline-block; + width: 104px; + height: 30px; + line-height: 28px; + text-align: center; + border-radius: 4px; + border: 1px solid #666; + margin-right: 30px; + margin-top: 30px; + color: #fff; + cursor: pointer; +} +.bannerBox .ant-btn{ + margin-top: 30px; + height: 40px; + font-size: 16px; + width: 120px; + border-radius: 4px; + margin-right: 40px; +} + +.bannerBox > a > i{ + font-size: 14px!important; + display: inline-block; + margin-right: 10px; +} +.bannerBox > a > a{ + color: #fff!important; +} .ProjectListIndex{ width: 1200px; margin:20px auto; @@ -53,8 +121,9 @@ justify-content: space-between; flex-wrap: wrap; align-items: center; - padding:25px 30px; + padding:0px 30px; border-bottom: 1px solid #E0E0E0; + height: 62px; } .list-r-Search{ width: 400px; diff --git a/src/forge/Main/sub/DetailBanner.jsx b/src/forge/Main/sub/DetailBanner.jsx index 22a5ce41..803ad6aa 100644 --- a/src/forge/Main/sub/DetailBanner.jsx +++ b/src/forge/Main/sub/DetailBanner.jsx @@ -20,7 +20,7 @@ function DetailBanner({ history,list , owner , projectsId , isManager , url , pa return(
      { - menuName && projectDetail ? + menuName && menuName.length> 0 && projectDetail ?
        { Array.isArray(menuName)&& menuName.map((item,key)=>{ @@ -66,7 +66,7 @@ function DetailBanner({ history,list , owner , projectsId , isManager , url , pa :"" } - { + {/* { item.menu_name === "wiki" &&
      • @@ -74,7 +74,7 @@ function DetailBanner({ history,list , owner , projectsId , isManager , url , pa Wiki
      • - } + } */} { item.menu_name === "devops" && platform ?
      • diff --git a/src/forge/Main/tree/Index.jsx b/src/forge/Main/tree/Index.jsx index 2fc57434..e9cb06fc 100644 --- a/src/forge/Main/tree/Index.jsx +++ b/src/forge/Main/tree/Index.jsx @@ -4,6 +4,7 @@ import { truncateCommitId } from '../../common/util'; import { Link } from 'react-router-dom'; import { getImageUrl } from 'educoder'; import { Dropdown , Menu , Spin } from 'antd'; +import Nodata from '../../Nodata'; import './Index.scss'; import Tree from '../img/tree.png'; @@ -107,6 +108,9 @@ function Index(props) { ) }) } + { + list && list.length === 0 && + }
      ) diff --git a/src/forge/Merge/MergeSubmit.js b/src/forge/Merge/MergeSubmit.js index d4b42c3b..35d6c379 100644 --- a/src/forge/Merge/MergeSubmit.js +++ b/src/forge/Merge/MergeSubmit.js @@ -102,7 +102,7 @@ class MergeSubmit extends Component{ - + ), diff --git a/src/forge/Notice/Index.jsx b/src/forge/Notice/Index.jsx index 73a2561b..8d3c0540 100644 --- a/src/forge/Notice/Index.jsx +++ b/src/forge/Notice/Index.jsx @@ -18,6 +18,7 @@ function Index(props){ const username = props.match.params.username; const pathname = props.history.location.pathname; const user = props.user; + const undo_messages = props.undo_messages; const [ menu , setMenu ] = useState("undo"); const [ messagesCount , setMessagesCount ] = useState(0); diff --git a/src/forge/Notice/Notify.jsx b/src/forge/Notice/Notify.jsx index 31373908..dee79d9e 100644 --- a/src/forge/Notice/Notify.jsx +++ b/src/forge/Notice/Notify.jsx @@ -14,8 +14,24 @@ function Notify(props){ const [ isSpin , setIsSpin ] = useState(true); useEffect(()=>{ - props && props.deleteEvent("notify",0); - },[]) + if(username){ + getList(); + } + },[username,page]) + + function getList(){ + const url = `/users/${username}/applied_messages.json`; + Axios.get(url,{ + params:{ + page,per_page:limit + } + }).then(result=>{ + if(result){ + setList(result.data.applied_messages); + setTotal(result.data.total_count); + } + }).catch(error=>{}) + } useEffect(()=>{ if(username){ @@ -71,6 +87,20 @@ function Notify(props){ } } + function renderApplyStatus(status,applied) { + let { project } = applied; + if(status){ + switch(status){ + case 'successed': + return

      已通过你加入【{project && project.name}】项目的申请

      + default: + return

      已拒绝你加入【{project && project.name}】项目的申请

      + } + }else{ + return "" + } + } + return(
      diff --git a/src/forge/Notice/UndoEvent.jsx b/src/forge/Notice/UndoEvent.jsx index 17dcc321..93b4eb5a 100644 --- a/src/forge/Notice/UndoEvent.jsx +++ b/src/forge/Notice/UndoEvent.jsx @@ -14,6 +14,7 @@ function UndoEvent(props){ const [ total , setTotal ] = useState(0); const [ isSpin , setIsSpin ] = useState(true); + useEffect(()=>{ if(username){ setIsSpin(true); @@ -93,7 +94,7 @@ function UndoEvent(props){ i.status === "canceled" && 对方已取消转移 } { - i.status === "accepted" && 已接受 + i.status === "accept" && 已接受 } { i.status === "refused" && 已拒绝 diff --git a/src/forge/Settings/Setting.js b/src/forge/Settings/Setting.js index deccb3da..3fb8423e 100644 --- a/src/forge/Settings/Setting.js +++ b/src/forge/Settings/Setting.js @@ -14,7 +14,7 @@ const menu = [ {name:"代码库",index:"code"}, {name:"易修 (Issue)",index:"issues"}, {name:"合并请求",index:"pulls"}, - {name:"Wiki",index:"wiki"}, + // {name:"Wiki",index:"wiki"}, {name:"工作流(beta版)",index:"devops"}, // {name:"资源库",index:"resources"}, {name:"里程碑",index:"versions"}, @@ -31,7 +31,8 @@ class Setting extends Component { project_units:['home',"activity","code"], divertVisible:false, is_transfering:undefined, - projectName:undefined + projectName:undefined, + permission:undefined }; } @@ -245,6 +246,7 @@ class Setting extends Component { let mirror = projectDetail && projectDetail.mirror; let type = projectDetail && projectDetail.type; const forked_from_project_id = this.props && this.props.projectDetail && this.props.projectDetail.forked_from_project_id; + return (
      { if(owner && repo_id){ - setIsSpin(true); getData(); } },[repo_id,owner,search,sortValue,page]) @@ -56,10 +46,8 @@ function Index(props){ if(result && result.data){ setData(result.data.data.rows); setTotal(result.data.data.total); - setIsSpin(false); - setError(false); } - }).catch(error=>{setIsSpin(false);setError(true);}) + }).catch(error=>{}) } // 搜索 @@ -85,52 +73,16 @@ function Index(props){ ) - function listmenu(id,attachments,isPublic){ - return( - - {setId(id);setVisible(true);setAttachments(attachments)}}>更新版本 - changeStatus(id,isPublic===1?0:1)}>{isPublic === 1 ? "设为私有":"设为公开"} - deleteSourceFunc(id)}>删除资源 - - ) - } - // 更细私有状态 - function changeStatus(id,isPublic){ - const url = https+`/api/project/achievement/updateStatus`; - axios.put(url,{ - id,status:isPublic - }).then(result=>{ - if(result && result.data){ - props.showNotification(`资源${isPublic === 1 ? "设为公开":"设为私有"}成功!`); - setIsSpin(true); - getData(); - } - }).catch({}) - } - - // 删除资源方法 - function deleteSourceFunc(id){ - props.confirm({ - content: "是否确认删除所选资源文件?", - onOk: () => { - const url = https + `/api/project/achievement/${id}`; - axios.delete(url).then(result=>{ - if(result && result.data && result.data.code === "1"){ - props.showNotification("资源删除成功"); - setIsSpin(true); - getData(); - } - }) - } - }) - - } - + const listmenu=( + + 更新版本 + 设为私有 + 删除资源 + + ) // 上传资源成功 function onOk(){ - setVisible(false); - setIsSpin(true); getData(); } @@ -142,42 +94,14 @@ function Index(props){ }).then(result=>{ if(result && result.data){ props.showNotification("标记删除成功"); - setIsSpin(true); getData(); } }).then(error=>{}) } - function addPanel(id){ - setAddVisible(true); - setId(id); - } - - function onCancelAdd(){ - setId(undefined); - setAddVisible(false); - } - - // 添加标签 - function sureAddTag(values){ - const url = https+`/api/project/achievement/addTag?id=`+id+`&tagName=`+values.tagName; - axios.put(url).then(result=>{ - if(result){ - setId(undefined); - setAddVisible(false); - setIsSpin(true); - getData(); - } - }) - } return(
      - setVisible(false)} @@ -185,15 +109,11 @@ function Index(props){ showNotification={props.showNotification} owner={owner} projectsId={repo_id} - id={id} - attachments={attachments} />
      - 资源库{total ? ({total}):""} - { current_user && current_user.login && (props.projectDetail && props.projectDetail.permission) ? - {setId(undefined);setVisible(true);}}>上传资源:"" - } + 资源库(18) + setVisible(true)}>上传资源
      @@ -208,65 +128,43 @@ function Index(props){ {sort[sortValue]} - -
      - { - data && data.length> 0 && -
        - { - data.map((item,key)=>{ - return( -
      • - -
        - - - {item.fileName} - - {item.isPublic === 0 && 私有} - - { current_user && current_user.login && - listmenu(item.id,item.attachments,item.isPublic)} placement={'bottomRight'}> - - - } - -

        - 上传时间:{item.uploadTime} - 文件大小:{item.fileSize} - 下载:{item.download} -

        -

        {item.remark}

        +
        +
          + { + data && data.length> 0 && data.map((item,key)=>{ + return( +
        • + +
          + + {item.fileName} + + + + +

          + 上传时间:{item.uploadTime} + 文件大小:{item.fileSize} + 下载:{item.download} +

          +

          {item.remark}

          + { item.tags && item.tags.length>0 &&
          { - item.tags && item.tags.length>0 && item.tags.map((i,k)=>{ + item.tags.map((i,k)=>{ return( - {i} - { - current_user && (current_user.login === item.login) ? - removeTagFunc(item.id,i)} okText="是" cancelText="否"> - - :"" - } - + {i} ) }) } - { - current_user && (current_user.login === item.login) && - addPanel(item.id)} style={{height:"20px",lineHeight:"20px"}}>+新增标签 - }
          -
          -
        • - ) - }) - } -
        - } - { - ((data && data.length === 0) || error) && - } + } +
        +
      • + ) + }) + } +
      { total > limit &&
      @@ -280,7 +178,6 @@ function Index(props){
      }
      -
      ) } diff --git a/src/forge/Source/Index.scss b/src/forge/Source/Index.scss index 57b122ae..20f55c27 100644 --- a/src/forge/Source/Index.scss +++ b/src/forge/Source/Index.scss @@ -21,7 +21,6 @@ } .bodycontent{ padding:0px 20px; - min-height: 500px; & > ul.bodycontentul > li{ display: flex; border-bottom: 1px solid #eee; @@ -41,16 +40,6 @@ .infoname{ font-size: 16px; } - .privateTip{ - display: block; - font-size: 12px; - margin-left: 10px; - background-color: orange; - height: 18px; - line-height: 18px; - padding:0px 3px; - color: #fff; - } .infos{ & > span{ margin-right: 20px; @@ -84,26 +73,4 @@ } } } -} -.versionTable{ - .currentTip{ - display: block; - padding:0px 3px; - border-radius: 2px; - border:1px solid #68c7ec; - font-size: 12px; - color: #68c7ec; - height: 18px; - line-height: 18px; - margin-left: 5px; - } - .ant-table-body{ - margin:0px!important; - thead{ - background-color: #eee; - } - thead >tr >th,tbody > tr > td{ - padding:4px 5px!important; - } - } } \ No newline at end of file diff --git a/src/forge/Source/Upload.jsx b/src/forge/Source/Upload.jsx index de2c8ecb..aac28699 100644 --- a/src/forge/Source/Upload.jsx +++ b/src/forge/Source/Upload.jsx @@ -79,4 +79,4 @@ function Uploads({ className , size , actionUrl,fileList,showNotification , load ) } -export default Uploads; \ No newline at end of file +export default Uploads; diff --git a/src/forge/Source/UploadSource.jsx b/src/forge/Source/UploadSource.jsx index 64bd5b7c..22a45392 100644 --- a/src/forge/Source/UploadSource.jsx +++ b/src/forge/Source/UploadSource.jsx @@ -5,18 +5,18 @@ import { AlignCenter } from '../Component/layout'; import axios from 'axios'; const { TextArea } = Input; +const data = [ + {name:"sdfkjsfj.pdf",loadNum:"10",citeNum:"15",time:"2021-04-01 10:45"}, + {name:"sdfkjsfj.pdf",loadNum:"10",citeNum:"15",time:"2021-04-01 10:45"}, + {name:"sdfkjsfj.pdf",loadNum:"10",citeNum:"15",time:"2021-04-01 10:45"} +] const https = 'https://testfiles.trustie.net'; -function UploadSource({ form , visible , onCancel , onOk , showNotification , attachments , id ,owner,projectsId}){ - const [ tableData , setTableData ] = useState(undefined); +function UploadSource({ form , visible , onCancel , onOk , showNotification ,owner,projectsId}){ + const [ tableData , setTableData ] = useState(data); const [ fileId , setFilesId ] = useState(undefined); const [ fileName , setFileName ] = useState(undefined); const { getFieldDecorator, validateFields , setFieldsValue } = form; - useEffect(()=>{ - if(id && attachments){ - setTableData(attachments); - } - },[id,attachments]) // 上传附件后得到的文件id数组 function UploadFunc(id,name){ setFilesId(id); @@ -25,36 +25,37 @@ function UploadSource({ form , visible , onCancel , onOk , showNotification , at const columns = [ { - dataIndex:"fileName", - key:"fileName", + dataIndex:"name", + key:"name", title:"资源名称", - width:"42%", + width:"45%", ellipsis:true, render:(value,item,key)=>{ return -
      {value}
      +
      {value}
      { key === 0 && 当前版本 }
      } }, { - dataIndex:"downloads", - key:"downloads", + dataIndex:"loadNum", + key:"loadNum", title:"下载数", - width:"14%", + width:"15%", className:"edu-txt-center" }, { - dataIndex:"fileSizeString", - key:"fileSizeString", - title:"文件大小", - width:"16%", + dataIndex:"citeNum", + key:"citeNum", + title:"引用数", + width:"15%", className:"edu-txt-center" }, { - dataIndex:"createdAt", - key:"createdAt", + dataIndex:"time", + key:"time", title:"上传时间", + width:"25%" } ] @@ -73,35 +74,22 @@ function UploadSource({ form , visible , onCancel , onOk , showNotification , at function postInfo(values){ const url = https+`/api/project/achievement/`; - if(id){ - // 修改 - axios.put(url,{ - id,fileName,fileId:`${fileId}`, - remark:values.remark - }).then(result=>{ - if(result && result.data){ - onOk(); - } - }).catch(error=>{}) - }else{ - // 上传 - axios.post(url,{ - fileId:`${fileId}`, - fileName, - login:owner, - projectId:projectsId, - ...values - }).then(result=>{ - if(result && result.data){ - onOk(); - } - }).catch(error=>{}) - } + axios.post(url,{ + fileId:`${fileId}`, + fileName, + login:owner, + projectId:projectsId, + ...values + }).then(result=>{ + if(result && result.data){ + onOk(); + } + }).catch(error=>{}) } return(
      - {id && } - +
      + {getFieldDecorator("tagNames",{ rules:[] })( @@ -147,4 +135,4 @@ function UploadSource({ form , visible , onCancel , onOk , showNotification , at ) } -export default Form.create()(forwardRef(UploadSource));; \ No newline at end of file +export default UploadSource; diff --git a/src/forge/Team/Group/GroupForm.jsx b/src/forge/Team/Group/GroupForm.jsx index 94825905..f9b47b86 100644 --- a/src/forge/Team/Group/GroupForm.jsx +++ b/src/forge/Team/Group/GroupForm.jsx @@ -218,7 +218,7 @@ export default Form.create()( [], 新建项目(成员可以在组织中新建项目。创建者将自动获得新建的项目的管理员权限), false, 20,onwers ? "hide":"" )} - {helper( + {/* {helper( '版本库权限:', "authorize", [], @@ -227,7 +227,7 @@ export default Form.create()( 写入权限(成员可以查看和推送提交到团队项目) 管理员权限(成员可以拉取和推送到团队项目同时可以添加协作者) , false, 20,onwers ? "hide":"" - )} + )} */} {/*

      允许访问项目单元:

      diff --git a/src/forge/Wiki/Index.jsx b/src/forge/Wiki/Index.jsx index f15b1968..f8f78861 100644 --- a/src/forge/Wiki/Index.jsx +++ b/src/forge/Wiki/Index.jsx @@ -217,7 +217,6 @@ export default (props) => { -
      diff --git a/src/forge/Wiki/components/Login/index.scss b/src/forge/Wiki/components/Login/index.scss new file mode 100644 index 00000000..13d16066 --- /dev/null +++ b/src/forge/Wiki/components/Login/index.scss @@ -0,0 +1,56 @@ +.delete-modal { + .ant-modal-header { + padding: 9px 24px; + background: #f8f8f8; + border-bottom: 1px solid #eee; + } + .ant-modal-title { + text-align: left; + } + .ant-modal-close { + top: 0px !important; + } + .ant-modal-close-x { + font-size: 24px; + } + .ant-modal-body { + text-align: center; + } + .delete-title { + display: flex; + justify-content: center; + align-items: center; + margin: 2rem 0 1rem !important; + font-size: 16px; + color: #333; + letter-spacing: 0; + line-height: 29px; + font-weight: 400; + } + .red-circle { + align-self: flex-start; + color: #ca0002; + font-size: 1.5rem !important; + } + .delete-descibe { + font-size: 14px; + color: #666; + line-height: 33px; + font-weight: 400; + } + .ant-modal-footer { + padding: 2rem 0; + text-align: center; + border: 0; + .ant-btn { + width: 6rem; + } + } + .foot-submit { + margin-left: 3rem; + color: #df0002; + &:hover { + border-color: #df0002; + } + } +} \ No newline at end of file diff --git a/src/forge/Wiki/fetch.js b/src/forge/Wiki/fetch.js index 9f0e6901..ccb9676a 100644 --- a/src/forge/Wiki/fetch.js +++ b/src/forge/Wiki/fetch.js @@ -12,7 +12,7 @@ if (window.location.href.indexOf('localhost') > -1) { actionUrl = "https://test-search.trustie.net"; // actionUrl = 'https://testforgeplus.trustie.net'; axios.defaults.withCredentials = true; -}else if (window.location.href.indexOf('forgeplus') > -1) { +}else if (window.location.href.indexOf('wiki-api') > -1) { actionUrl = "https://wiki-api.trustie.net"; axios.defaults.withCredentials = true; } diff --git a/src/forge/users/Echart/Cloud.jsx b/src/forge/users/Echart/Cloud.jsx index 778b30e7..e0d5dcda 100644 --- a/src/forge/users/Echart/Cloud.jsx +++ b/src/forge/users/Echart/Cloud.jsx @@ -13,8 +13,10 @@ function Cloud({data}) { var div = new Js2WordCloud(document.getElementById('cloud')) let textList= d.categories; let cyList=[] - for(let i=0;i 0){ + for(let i=0;i{ - if(visible){ + if(visible && loadCount === 0){ + setLoadCount(loadCount+1); setIsSpin(true); getProjectList(); }else{ @@ -169,6 +171,7 @@ function ConcentrateBox({ visible , onCancel , onSure , username , choosed , his (list && list.length === 0) && (copyList && copyList.length === 0) &&
      您还没有公开的{search && `“${search}”`}项目,先去 {history.push(`/projects/deposit/new`)}} diff --git a/src/forge/users/Infos.js b/src/forge/users/Infos.js index 1cd3969d..b3e0eae6 100644 --- a/src/forge/users/Infos.js +++ b/src/forge/users/Infos.js @@ -133,12 +133,7 @@ class Infos extends Component { undo_events:e }); }) - .catch((error) => { - this.setState({ - isSpin: false, - }); - }); - }; + } change_devops_type=(type)=>{ const {user} = this.state; @@ -194,7 +189,7 @@ class Infos extends Component { render() { const { current_user } = this.props; const { username } = this.props.match.params; - const { user, isSpin, route_type , undo_events , menuKey } = this.state; + const { user, isSpin, route_type , undo_events , menuKey , project_type } = this.state; return (
      @@ -207,14 +202,14 @@ class Infos extends Component { { user && user.gender===1? - + : - + } -
      +
      {user && user.username}
      diff --git a/src/forge/users/Statistics/Index.jsx b/src/forge/users/Statistics/Index.jsx index aca25eb1..16abdf4f 100644 --- a/src/forge/users/Statistics/Index.jsx +++ b/src/forge/users/Statistics/Index.jsx @@ -143,18 +143,18 @@ function Index(props) { topThree && topThree.length > 0 &&
      - { topThree[1] && } - { topThree[2] && } + +
      } { percentData &&
      -
      +
      { percentData.map((i,k)=>{ return( - + ) }) } @@ -163,8 +163,8 @@ function Index(props) { { percentData.map((i,k)=>{ return( - - {i.name} + + {i.name} {`${i.p}%`} ) diff --git a/src/images/login/logo.png b/src/images/login/logo.png new file mode 100644 index 00000000..961f3052 Binary files /dev/null and b/src/images/login/logo.png differ diff --git a/src/modules/login/EducoderLogin.js b/src/modules/login/EducoderLogin.js index 9a552673..e8dd8ef0 100644 --- a/src/modules/login/EducoderLogin.js +++ b/src/modules/login/EducoderLogin.js @@ -1,11 +1,11 @@ -import React, {Component} from "react"; +import React, { Component } from "react"; import moment from 'moment'; import { getImageUrl } from 'educoder'; import '../courses/css/members.css'; import "../courses/common/formCommon.css"; import '../courses/css/Courses.css'; import beijintulogontwo from '../../../src/images/login/beijintulogontwo.png'; -import educodernet from '../../../src/images/login/educodernet.png'; +import educodernet from '../../../src/images/login/logo.png'; import LoginRegisterComponent from '../user/LoginRegisterComponent'; import FindPasswordComponent from '../user/FindPasswordComponent'; //educoder登入页面 @@ -94,84 +94,39 @@ class EducoderLogin extends Component { render() { - let {showbool,loginstatus,logini} = this.state; + let { showbool } = this.state; + const { settings } = this.props; return (
      - -
      -
      -
      - {this.props.mygetHelmetapi === null ? "" - : - this.props.mygetHelmetapi===undefined||this.props.mygetHelmetapi.login_logo_url===null|| this.props.mygetHelmetapi.login_logo_url===undefined? - this.gohome()} src={educodernet}/> - : - this.gohome()} src={getImageUrl(this.props.mygetHelmetapi.login_logo_url)}/> - } - -
      - - +
      +
      + { + settings && settings.login_logo_url ? + this.gohome()} width="80px" src={getImageUrl(settings.login_logo_url)}/> + : + this.gohome()} src={educodernet} width="80px"/> + }
      { showbool === 1 ? -
      -
      - - this.Setshowbool(e)} > - -
      - +
      +
      + this.Setshowbool(e)} >
      +
      : -
      -
      - this.Setshowbool(e)}> - -
      -
      +
      +
      + this.Setshowbool(e)}> +
      +
      } - {this.props.mygetHelmetapi === null ?
      -
      © {moment().year()} EduCoder湘ICP备17009477号Trustie   &   IntelliDE inside.
      -
      : - this.props.mygetHelmetapi===undefined||this.props.mygetHelmetapi.main_site===null|| this.props.mygetHelmetapi.main_site===undefined?
      -
      © {moment().year()} EduCoder湘ICP备17009477号Trustie   &   IntelliDE inside.
      -
      :this.props.mygetHelmetapi.main_site===true? -
      -
      © {moment().year()} EduCoder湘ICP备17009477号Trustie   &   IntelliDE inside.
      -
      - :"" - } - +
      © {moment().year()} EduCoder湘ICP备17009477号Trustie   &   IntelliDE inside.
      ) diff --git a/src/modules/login/LoginDialog.js b/src/modules/login/LoginDialog.js index 6311a5cd..c3d1c407 100644 --- a/src/modules/login/LoginDialog.js +++ b/src/modules/login/LoginDialog.js @@ -321,8 +321,8 @@ class LoginDialog extends Component { return flag; } componentDidMount() { - //true为PC端,false为手机端 - let flag = this.IsPC(); + + let flag = this.IsPC(); //true为PC端,false为手机端 this.setState({ isphone: flag }) @@ -455,9 +455,10 @@ class LoginDialog extends Component { } render() { - let { login, isGoing, isGoingValue, disabled , Phonenumberisnotco , dialogBox, isRender, weixinlogin } = this.state; - let { settings } = this.props; + let { login, isGoing, isGoingValue, disabled, Phonenumberisnotco, + dialogBox, isRender, weixinlogin } = this.state; + let { settings } = this.props; if (isRender === undefined) { isRender = false } diff --git a/src/modules/question/NewMyShixunModel.js b/src/modules/question/NewMyShixunModel.js index 2ae8625b..08cd7b72 100644 --- a/src/modules/question/NewMyShixunModel.js +++ b/src/modules/question/NewMyShixunModel.js @@ -1068,11 +1068,6 @@ class NewMyShixunModel extends Component {