From 6a4fe4d2770f769db31903b8680d524b50eb6d13 Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Tue, 30 Mar 2021 10:26:02 +0800 Subject: [PATCH 001/461] =?UTF-8?q?=E5=B7=A6=E4=BE=A7=E6=8A=BD=E5=B1=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/forge/Main/CoderDepot.jsx | 7 +++++-- src/forge/Main/CoderRootIndex.js | 4 ---- src/forge/Main/Index.scss | 18 ++++++++++++++---- 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/src/forge/Main/CoderDepot.jsx b/src/forge/Main/CoderDepot.jsx index 41b69004..d6024b06 100644 --- a/src/forge/Main/CoderDepot.jsx +++ b/src/forge/Main/CoderDepot.jsx @@ -242,7 +242,10 @@ function CoderDepot(props){ onClose={()=>setVisible(false)} list = {mainFlag ? dirInfo : undefined} /> -
setVisible(true)}>
+
setVisible(true)}> + + 目录 +
}
@@ -358,7 +361,7 @@ function CoderDepot(props){ 简介 {projectDetail.permission && (projectDetail.permission==="Admin" || projectDetail.permission==="Owner") && setOpenModal(true)} className="iconfont icon-anquanshezhi color-grey-9 font-15">} - {desc &&

{desc}

} + {desc &&

{desc}

} { website &&

diff --git a/src/forge/Main/CoderRootIndex.js b/src/forge/Main/CoderRootIndex.js index 4dd531bc..ceff9d9f 100644 --- a/src/forge/Main/CoderRootIndex.js +++ b/src/forge/Main/CoderRootIndex.js @@ -13,10 +13,6 @@ const UploadFile = Loadable({ loader: () => import('../Newfile/upload_file'), loading: Loading, }) -const CoderRootDirectory = Loadable({ - loader: () => import('./CoderRootDirectory'), - loading: Loading, -}) const CoderRootCommit = Loadable({ loader: () => import('./CoderRootCommit'), loading: Loading, diff --git a/src/forge/Main/Index.scss b/src/forge/Main/Index.scss index e144a33d..d6a97a4b 100644 --- a/src/forge/Main/Index.scss +++ b/src/forge/Main/Index.scss @@ -254,20 +254,30 @@ .drawerBtn{ position: fixed; left: -13px; - border:1px solid #d9d9d9; + border:1px solid rgb(207,205,223); width: 34px; border-radius: 0px 12px 12px 0px; - text-align: right; height: 70px; - line-height: 70px; top:50%; margin-top: -35px; cursor: pointer; + display: flex; + flex-direction: column; + align-items: flex-end; + justify-content: center; &:hover{ box-shadow: 1px 0px 7px rgba(0,0,0,0.1); } + span{ + writing-mode: vertical-lr; + color: #202429; + width: 25px; + } i{ - color: #d9d9d9; + color: #24292e; + height: 18px; + line-height: 18px; + width: 18px; } } .downMenu{ From 2c832213764f2b46e737f7c2e3e035982a636c30 Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Tue, 30 Mar 2021 11:50:25 +0800 Subject: [PATCH 002/461] =?UTF-8?q?=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/forge/Main/CoderDepot.jsx | 12 +++++++++--- src/forge/Main/Index.scss | 4 ++-- src/forge/Settings/Collaborator.js | 2 +- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/forge/Main/CoderDepot.jsx b/src/forge/Main/CoderDepot.jsx index d6024b06..58e941d2 100644 --- a/src/forge/Main/CoderDepot.jsx +++ b/src/forge/Main/CoderDepot.jsx @@ -1,6 +1,6 @@ import React , { useEffect , useState } from 'react'; import { WhiteBack , Box , LongWidth , ShortWidth , Gap , AlignCenter , FlexAJ } from '../Component/layout'; -import { Dropdown , Menu , Divider , Spin } from 'antd'; +import { Dropdown , Menu , Divider , Spin, Button } from 'antd'; import { getImageUrl } from "educoder"; import { Link } from 'react-router-dom'; import CloneAddress from '../Branch/CloneAddress'; @@ -290,8 +290,14 @@ function CoderDepot(props){ urlLink(`/projects/${owner}/${projectsId}/pulls/new`)} >+ 合并请求 urlLink(`/projects/${owner}/${projectsId}/issues/new`)} >+ 任务

- { type === "dir" && 文件} - 下载 + { type === "dir" && + + + + } + + + { diff --git a/src/forge/Main/Index.scss b/src/forge/Main/Index.scss index d6a97a4b..bd19f89c 100644 --- a/src/forge/Main/Index.scss +++ b/src/forge/Main/Index.scss @@ -83,10 +83,10 @@ } .addOptionBtn{ height: 32px; - line-height: 32px; + line-height: 30px; display: flex; border:1px solid #d9d9d9; - border-radius: 4px; + border-radius: 2px; a{ padding:0px 13px; color: rgba(0, 0, 0, 0.65); diff --git a/src/forge/Settings/Collaborator.js b/src/forge/Settings/Collaborator.js index fdffad36..90b1b6a7 100644 --- a/src/forge/Settings/Collaborator.js +++ b/src/forge/Settings/Collaborator.js @@ -11,7 +11,7 @@ function Collaborator(props){ const [ newGroupId , setNewGroupId] = useState(undefined); const {projectsId ,owner} = props.match.params; - const author = props.projectDetail && props.projectDetail.author; + const author = props && props.projectDetail && props.projectDetail.author; function getID(id){ setNewId(id); From b568aef34eeb8ecf15bc0382913843aca1380b5a Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Tue, 30 Mar 2021 15:01:25 +0800 Subject: [PATCH 003/461] issue --- src/AppConfig.js | 2 +- src/common/UrlTool.js | 2 +- src/forge/Branch/Select.jsx | 2 +- src/forge/Component/Component.scss | 3 +++ src/forge/Component/Releases.jsx | 7 +++++-- src/forge/Component/User.jsx | 12 ++++++++++-- src/forge/Main/CoderDepot.jsx | 6 +++--- src/forge/Main/Detail.js | 8 +++++--- src/forge/Main/sub/DetailBanner.jsx | 14 ++++++++------ src/modules/login/LoginDialog.js | 4 ++-- 10 files changed, 39 insertions(+), 21 deletions(-) diff --git a/src/AppConfig.js b/src/AppConfig.js index a5a063b0..31f39150 100644 --- a/src/AppConfig.js +++ b/src/AppConfig.js @@ -27,7 +27,7 @@ if (isDev) { } debugType = window.location.search.indexOf('debug=t') !== -1 ? 'teacher' : 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 || '' } function clearAllCookie() { cookie.remove('_educoder_session', { path: '/' }); diff --git a/src/common/UrlTool.js b/src/common/UrlTool.js index 5b101e7a..6b3d3564 100644 --- a/src/common/UrlTool.js +++ b/src/common/UrlTool.js @@ -162,7 +162,7 @@ export function getmyUrl(geturl) { } export function getUploadActionUrl(path, goTest) { - return `${getUrl()}/api/attachments.json?debug=${window._debugType || 'admin'}`; + return `${getUrl()}/api/attachments.json`; } export function getUploadLogoActionUrl() { diff --git a/src/forge/Branch/Select.jsx b/src/forge/Branch/Select.jsx index 0f0b0de4..f33a716f 100644 --- a/src/forge/Branch/Select.jsx +++ b/src/forge/Branch/Select.jsx @@ -102,7 +102,7 @@ export default (({ projectsId , branch , owner , changeBranch , branchList , tag ); return( - setFlag(!flag)} overlayClassName="branch-tagBox-list"> + setFlag(!flag)} overlayClassName="branch-tagBox-list">
{/* {nav === 0 ?"分支":"标签"} */} diff --git a/src/forge/Component/Component.scss b/src/forge/Component/Component.scss index d27d4aae..bfd5e961 100644 --- a/src/forge/Component/Component.scss +++ b/src/forge/Component/Component.scss @@ -112,6 +112,9 @@ li.ant-menu-item{ right:240px; z-index: 10000; } +.laterest{ + color: #05690d; +} @media screen and (max-width: 1800px){ .handleBox{ diff --git a/src/forge/Component/Releases.jsx b/src/forge/Component/Releases.jsx index b3b0a774..3dc8cf02 100644 --- a/src/forge/Component/Releases.jsx +++ b/src/forge/Component/Releases.jsx @@ -20,10 +20,13 @@ function Releases({owner,projectsId,releaseVersions}){ releaseVersions && releaseVersions.total_count>0 ? releaseVersions.list.map((item,key)=>{ return( - + key === 0 &&
-

{item.name}

+

+ {item.name} + 最新 +

{item.created_at}

diff --git a/src/forge/Component/User.jsx b/src/forge/Component/User.jsx index 8701e607..4d22c77b 100644 --- a/src/forge/Component/User.jsx +++ b/src/forge/Component/User.jsx @@ -1,8 +1,8 @@ import React from 'react'; import styled from 'styled-components'; +import { Link } from 'react-router-dom'; - -export default ({ url , name , column })=>{ +export default ({ url , name , column , id , login })=>{ const Img = styled.span` display:flex; ${column && "flex-direction: column;text-align:center;"} @@ -19,6 +19,14 @@ export default ({ url , name , column })=>{ } `; return( + id? + + + { url && } + {name} + + + : { url && } {name} diff --git a/src/forge/Main/CoderDepot.jsx b/src/forge/Main/CoderDepot.jsx index 58e941d2..2e4f82da 100644 --- a/src/forge/Main/CoderDepot.jsx +++ b/src/forge/Main/CoderDepot.jsx @@ -92,7 +92,7 @@ function CoderDepot(props){ setZip_url(result.data.zip_url); let c = result.data.last_commit setLastCommit(c && c.commit); - setLastCommitAuthor(c && (c.author || (c.commit && c.commit.author))); + setLastCommitAuthor(c && c.committer); setMainFlag(true); } setTimeout(function(){setIsSpin(false);},500); @@ -133,7 +133,7 @@ function CoderDepot(props){ } let c = result.data.last_commit setLastCommit(c && c.commit); - setLastCommitAuthor(c && (c.author || (c.commit && c.commit.author))); + setLastCommitAuthor(c && c.committer); setMainFlag(false); } setTimeout(function(){setIsSpin(false);},500) @@ -306,7 +306,7 @@ function CoderDepot(props){ { lastCommit &&
- +

{lastCommit && lastCommit.message}

{ hideBtn && changeHide(hide)}> } diff --git a/src/forge/Main/Detail.js b/src/forge/Main/Detail.js index 1deeba36..93e49c71 100644 --- a/src/forge/Main/Detail.js +++ b/src/forge/Main/Detail.js @@ -496,9 +496,11 @@ class Detail extends Component { } - - 复刻 (Fork) - + + + 复刻 + + { forked_count > 0 ? platform ? diff --git a/src/forge/Main/sub/DetailBanner.jsx b/src/forge/Main/sub/DetailBanner.jsx index fbdf5541..1361acb0 100644 --- a/src/forge/Main/sub/DetailBanner.jsx +++ b/src/forge/Main/sub/DetailBanner.jsx @@ -1,5 +1,5 @@ import React, { useEffect, useState } from 'react'; -import { Skeleton } from 'antd'; +import { Skeleton , Tooltip} from 'antd'; import { Link } from 'react-router-dom'; function DetailBanner({ list , owner , projectsId , isManager , url , pathname , state , urlFlag , projectDetail , platform ,open_devops }){ @@ -39,11 +39,13 @@ function DetailBanner({ list , owner , projectsId , isManager , url , pathname , { item.menu_name === "issues" &&
  • - - - 易修 (Issue) - {projectDetail && projectDetail.issues_count ? {projectDetail.issues_count} : ""} - + + + + 易修 + {projectDetail && projectDetail.issues_count ? {projectDetail.issues_count} : ""} + +
  • } { diff --git a/src/modules/login/LoginDialog.js b/src/modules/login/LoginDialog.js index 44197524..86ba57b6 100644 --- a/src/modules/login/LoginDialog.js +++ b/src/modules/login/LoginDialog.js @@ -580,8 +580,8 @@ class LoginDialog extends Component {
    - this.getloginurl("https://www.trustie.net/account/lost_password")} - className="mr3 color-grey-9">找回密码 + this.getloginurl("https://www.trustie.net/account/lost_password")} className="mr3 color-grey-9">找回密码 + this.getloginurl("https://www.trustie.net/login?login=false")} className="color-grey-9">注册

    From 02f382e6fbbe6a3bf9b8e6ba338931aec972b5c0 Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Wed, 31 Mar 2021 11:15:41 +0800 Subject: [PATCH 004/461] =?UTF-8?q?=E7=99=BB=E5=BD=95=E6=A1=86=E4=B8=AD?= =?UTF-8?q?=E7=9A=84=E6=89=BE=E5=9B=9E=E5=AF=86=E7=A0=81=E3=80=81=E6=B3=A8?= =?UTF-8?q?=E5=86=8C=E7=9A=84url?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/forge/Head/Header.js | 4 +- src/forge/Main/CoderRootCommit.js | 17 +++-- src/forge/Source/Index.jsx | 111 +++++++++++++++++++++++++++++- src/forge/Source/Index.scss | 65 +++++++++++++++++ src/forge/Source/UploadSource.jsx | 22 ++++++ src/modules/login/LoginDialog.js | 16 ++--- src/modules/tpm/NewHeader.js | 8 +-- 7 files changed, 220 insertions(+), 23 deletions(-) create mode 100644 src/forge/Source/UploadSource.jsx diff --git a/src/forge/Head/Header.js b/src/forge/Head/Header.js index e7880362..64ad93fc 100644 --- a/src/forge/Head/Header.js +++ b/src/forge/Head/Header.js @@ -696,8 +696,8 @@ class NewHeader extends Component { this.educoderlogin()} className="mr5 color-grey-6">登录 { - settings && settings.new_course && settings.new_course.register_url && - 注册 + settings && settings.common && settings.common.register && + 注册 } : diff --git a/src/forge/Main/CoderRootCommit.js b/src/forge/Main/CoderRootCommit.js index f87a8539..bb4f5ba5 100644 --- a/src/forge/Main/CoderRootCommit.js +++ b/src/forge/Main/CoderRootCommit.js @@ -74,6 +74,7 @@ class CoderRootCommit extends Component{ array.push({ name:item.author && item.author.name, login: item.author && item.author.login, + id: item.author && item.author.id, image_url:item.author && item.author.image_url, sha:item.sha, time_from_now:item.time_from_now, @@ -136,10 +137,18 @@ class CoderRootCommit extends Component{ {item.message}

    - - {item.image_url?:""} - - + { + item.id ? + + {item.image_url?:""} + + : + + {item.image_url?:""} + + + } +

    ) diff --git a/src/forge/Source/Index.jsx b/src/forge/Source/Index.jsx index 475bda0c..3ba40678 100644 --- a/src/forge/Source/Index.jsx +++ b/src/forge/Source/Index.jsx @@ -1,16 +1,121 @@ -import React from 'react'; +import React, { useEffect, useState } from 'react'; import './Index.scss'; import { Blueback , FlexAJ } from '../Component/layout'; +import { Dropdown, Input , Menu , Pagination } from 'antd'; +import { Link } from 'react-router-dom'; +import UploadSource from './UploadSource'; +const { Search } = Input; +const sort = [ + "按上传时间排序", + "按下载次数排序", + "按引用排序" +] +const limit = 15; function Index(props){ + const [ sortValue , setSortValue ] = useState(0); + const [ page , setPage ] = useState(1); + const [ total , setTotal ] = useState(0); + const [ search , setSearch ] = useState(undefined); + + const [ visible , setVisible ] = useState(false); + + useEffect(()=>{ + + },[search,sort,page]) + + // 搜索 + function onSearch(value){ + setSearch(value); + } + + // 切换排序方式 + function changeSort(e,index){ + setSortValue(index); + } + + + const menu=( + + { + sort && sort.map((item,key)=>{ + return( + changeSort(e,key)} value={key} className={key === sortValue ?"color-blue":""}>{item} + ) + }) + } + + ) + + const listmenu=( + + 更新版本 + 设为私有 + 删除资源 + + ) + + function onOk(){ + + } return(
    + setVisible(false)} onOk={onOk}/>
    - 资源库 - 上传资源 + 资源库(18) + setVisible(true)}>上传资源
    + + + + {sort[sortValue]} + + +
    +
      +
    • + +
      + + DaVinci.fdb + + + + +

      + 上传时间:2021-03-30 + 上传类型:软件版本 + 文件大小:10KB + 下载:111 +

      +

      资源描述资源描述资源描述资源描述资源描述资源描述资源描述

      +
      + 软件版本 +
      +
      +
    • +
    + { + total > limit && +
    + {setPage(p)}} + /> +
    + } +
    ) } diff --git a/src/forge/Source/Index.scss b/src/forge/Source/Index.scss index 4338c5a9..20f55c27 100644 --- a/src/forge/Source/Index.scss +++ b/src/forge/Source/Index.scss @@ -8,4 +8,69 @@ padding:15px 20px; border-bottom: 1px solid #eee; } + .subHeadtitle{ + padding:15px 20px; + border-bottom: 1px solid #eee; + .ant-input-group-wrapper{ + width:320px; + .ant-btn.ant-input-search-button{ + margin: 0px; + margin-top: -1px; + } + } + } + .bodycontent{ + padding:0px 20px; + & > ul.bodycontentul > li{ + display: flex; + border-bottom: 1px solid #eee; + padding:20px 0px; + align-items: flex-start; + &:last-child{ + border-bottom: none; + } + .infoImg{ + img{ + width: 50px; + height: 50px; + border-radius: 50%; + } + margin-right: 15px; + } + .infoname{ + font-size: 16px; + } + .infos{ + & > span{ + margin-right: 20px; + color: #999; + & >span{ + color: #666; + } + } + } + .infodesc{ + color: #666; + line-height: 20px; + margin:5px 0px!important; + } + .infotag{ + display: flex; + flex-wrap: wrap; + span{ + display: block; + padding:0px 4px; + height: 20px; + line-height: 20px; + font-size: 12px; + margin-right: 10px; + border: 1px solid #f8df8c; + background: #fffce6; + color: #0d90c3; + border-radius: 2px; + cursor: pointer; + } + } + } + } } \ No newline at end of file diff --git a/src/forge/Source/UploadSource.jsx b/src/forge/Source/UploadSource.jsx new file mode 100644 index 00000000..a8ccfdc3 --- /dev/null +++ b/src/forge/Source/UploadSource.jsx @@ -0,0 +1,22 @@ +import React from 'react'; +import { Modal } from 'antd'; + + +function UploadSource({ visible , onCancel , onOk }){ + return( + +
    +
    + ) +} +export default UploadSource; \ No newline at end of file diff --git a/src/modules/login/LoginDialog.js b/src/modules/login/LoginDialog.js index 86ba57b6..aebfba8c 100644 --- a/src/modules/login/LoginDialog.js +++ b/src/modules/login/LoginDialog.js @@ -1,13 +1,7 @@ import React, { Component } from 'react'; -import { Redirect } from 'react-router'; -import Dialog, { - DialogActions, - DialogContent, - DialogContentText, - DialogTitle, -} from 'material-ui/Dialog'; -import { notification, Modal } from 'antd'; +import Dialog from 'material-ui/Dialog'; +import { notification } from 'antd'; import axios from 'axios'; @@ -329,6 +323,7 @@ class LoginDialog extends Component { return flag; } componentDidMount() { + let flag = this.IsPC(); //true为PC端,false为手机端 this.setState({ isphone: flag @@ -478,6 +473,7 @@ class LoginDialog extends Component { let { qqlogin, login, isGoing, isGoingValue, disabled, bottonclass, Phonenumberisnotco, dialogBox, isRender, weixinlogin } = this.state; + let { settings } = this.props; if (isRender === undefined) { isRender = false } @@ -580,9 +576,9 @@ class LoginDialog extends Component { - this.getloginurl("https://www.trustie.net/account/lost_password")} className="mr3 color-grey-9">找回密码 + this.getloginurl(`${settings && settings.common && settings.common.lost_password}`)} className="mr3 color-grey-9">找回密码 - this.getloginurl("https://www.trustie.net/login?login=false")} className="color-grey-9">注册 + this.getloginurl(`${settings && settings.common && settings.common.register}`)} className="color-grey-9">注册

    diff --git a/src/modules/tpm/NewHeader.js b/src/modules/tpm/NewHeader.js index cc054774..6d5b9697 100644 --- a/src/modules/tpm/NewHeader.js +++ b/src/modules/tpm/NewHeader.js @@ -812,16 +812,16 @@ class NewHeader extends Component { this.educoderlogin()} className="mr5 color-grey-6">登录 { - settings && settings.new_course && settings.new_course.register_url && - 注册 + settings && settings.common && settings.common.register && + 注册 } : user.login === "" ? this.educoderlogin()} className="mr5 color-grey-6">登录 { - settings && settings.new_course && settings.new_course.register_url && - 注册 + settings && settings.common && settings.common.register && + 注册 } : From e2dbda30832a8526576221441c3f60b7a83fc201 Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Wed, 31 Mar 2021 17:12:31 +0800 Subject: [PATCH 005/461] =?UTF-8?q?=E5=B7=A5=E4=BD=9C=E6=B5=81author?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/AppConfig.js | 2 +- src/forge/DevOps/About.jsx | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/AppConfig.js b/src/AppConfig.js index 31f39150..a5a063b0 100644 --- a/src/AppConfig.js +++ b/src/AppConfig.js @@ -27,7 +27,7 @@ if (isDev) { } debugType = window.location.search.indexOf('debug=t') !== -1 ? 'teacher' : window.location.search.indexOf('debug=s') !== -1 ? 'student' : - window.location.search.indexOf('debug=a') !== -1 ? 'admin' : parsed.debug || '' + window.location.search.indexOf('debug=a') !== -1 ? 'admin' : parsed.debug || 'admin' } function clearAllCookie() { cookie.remove('_educoder_session', { path: '/' }); diff --git a/src/forge/DevOps/About.jsx b/src/forge/DevOps/About.jsx index b9b10dad..bb79caad 100644 --- a/src/forge/DevOps/About.jsx +++ b/src/forge/DevOps/About.jsx @@ -36,8 +36,7 @@ function About(props, ref) { const [ disabled, setDisabled ] = useState(false); const [ typeFlag, setTypeFlag] = useState(false); - - const AuthorLogin = props.author && props.author.login; + const AuthorLogin = props.projectDetail && props.projectDetail.author && props.projectDetail.author.login; const CurrentLogin = props.current_user && props.current_user.login; useEffect(()=>{ if(CurrentLogin === AuthorLogin){ From 6296434527b454e9cf683faabc12ddfd5f35a69a Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Thu, 1 Apr 2021 14:41:13 +0800 Subject: [PATCH 006/461] =?UTF-8?q?=E6=B8=85=E7=90=86appconfig=E6=96=87?= =?UTF-8?q?=E4=BB=B6=20=E8=B5=84=E6=BA=90=E5=BA=93=E6=89=80=E6=9C=89?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E6=8E=92=E7=89=88=E3=80=81=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=9C=AA=E7=BB=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/AppConfig.js | 57 +++---------------- src/common/UrlTool.js | 12 ++-- src/forge/DevOps/About.jsx | 5 -- src/forge/Source/Index.jsx | 39 +++++++++++-- src/forge/Source/Index.scss | 22 ++++++++ src/forge/Source/UploadSource.jsx | 93 +++++++++++++++++++++++++++++-- src/forge/Upload/Index.js | 23 ++++---- 7 files changed, 168 insertions(+), 83 deletions(-) diff --git a/src/AppConfig.js b/src/AppConfig.js index a5a063b0..c42dcbf4 100644 --- a/src/AppConfig.js +++ b/src/AppConfig.js @@ -2,7 +2,7 @@ import axios from 'axios'; import { requestProxy } from "./indexEduplus2RequestProxy"; import { broadcastChannelOnmessage, isDev, queryString } from 'educoder'; import { notification } from 'antd'; -import cookie from 'react-cookies'; + import './index.css'; let message501 = false; @@ -11,10 +11,8 @@ broadcastChannelOnmessage('refreshPage', () => { }) function locationurl(list) { - if (window.location.port === "3007") { - - } else { - window.location.href = list + if (window.location.port !== "3007") { + window.location.href = list } } // TODO 开发期多个身份切换 @@ -26,52 +24,21 @@ if (isDev) { parsed = queryString.parse(_search); } debugType = window.location.search.indexOf('debug=t') !== -1 ? 'teacher' : - window.location.search.indexOf('debug=s') !== -1 ? 'student' : - window.location.search.indexOf('debug=a') !== -1 ? 'admin' : parsed.debug || 'admin' + window.location.search.indexOf('debug=s') !== -1 ? 'student' : + window.location.search.indexOf('debug=a') !== -1 ? 'admin' : parsed.debug || 'admin' } -function clearAllCookie() { - cookie.remove('_educoder_session', { path: '/' }); - cookie.remove('autologin_trustie', { path: '/' }); - setpostcookie() -} -clearAllCookie(); -function setpostcookie() { - const str = window.location.pathname; - if (str.indexOf("/wxcode") !== -1) { - cookie.remove('_educoder_session', { path: '/' }); - cookie.remove('autologin_trustie', { path: '/' }); - const _params = window.location.search; - if (_params) { - let _search = _params.split('?')[1]; - let _educoder_sessions = _search.split('&')[0].split('='); - cookie.save('_educoder_session', _educoder_sessions[1], { domain: '.educoder.net', path: '/' }); - let autologin_trusties = _search.split('&')[1].split('='); - cookie.save('autologin_trustie', autologin_trusties[1], { domain: '.educoder.net', path: '/' }); - } - } -} -setpostcookie(); - window._debugType = debugType; export function initAxiosInterceptors(props) { initOnlineOfflineListener(); - var proxy = "http://localhost:3000"; - proxy = "https://testforgeplus.trustie.net"; + var proxy = "https://testforgeplus.trustie.net"; - const requestMap = {}; - window.setfalseInRequestMap = function (keyName) { - requestMap[keyName] = false; - } //响应前的设置 axios.interceptors.request.use( config => { - setpostcookie() - clearAllCookie() - - if (config.url.indexOf(proxy) !== -1) { + if (config.url.indexOf(proxy) !== -1 || config.url.indexOf("http") !== -1) { return config } - requestProxy(config) + requestProxy(config); let url = `/api${config.url}`; @@ -86,12 +53,6 @@ export function initAxiosInterceptors(props) { } else { config.url = url; } - setpostcookie(); - } - if (config.url.indexOf('update_file') === -1) { - requestMap[config.url] = true; - - window.setTimeout("setfalseInRequestMap('" + config.url + "')", 900) } return config; }, @@ -146,8 +107,6 @@ export function initAxiosInterceptors(props) { message501 = false }, 2000); } - requestMap[response.config.url] = false; - setpostcookie(); return response; }, function (error) { return Promise.reject(error); diff --git a/src/common/UrlTool.js b/src/common/UrlTool.js index 6b3d3564..329bc81a 100644 --- a/src/common/UrlTool.js +++ b/src/common/UrlTool.js @@ -162,28 +162,28 @@ export function getmyUrl(geturl) { } export function getUploadActionUrl(path, goTest) { - return `${getUrl()}/api/attachments.json`; + return `${getUrl()}/api/attachments.json${isDev ?`${isDev ?`?debug=${window._debugType || 'admin'}` : ""}` : ""}`; } export function getUploadLogoActionUrl() { - return `${getUrl()}/api/resumes/logo.json?debug=${window._debugType || 'admin'}`; + return `${getUrl()}/api/resumes/logo.json${isDev ?`?debug=${window._debugType || 'admin'}` : ""}`; } export function getUploadActionUrltwo(id) { - return `${getUrlmys()}/api/shixuns/${id}/upload_data_sets.json?debug=${window._debugType || 'admin'}` + return `${getUrlmys()}/api/shixuns/${id}/upload_data_sets.json${isDev ?`?debug=${window._debugType || 'admin'}` : ""}` } export function getUploadActionUrlthree() { - return `${getUrlmys()}/api/jupyters/import_with_tpm.json?debug=${window._debugType || 'admin'}` + return `${getUrlmys()}/api/jupyters/import_with_tpm.json${isDev ?`?debug=${window._debugType || 'admin'}` : ""}` } export function getupload_git_file(id) { - return `${getUrlmys()}/api/shixuns/${id}/upload_git_file.json?debug=${window._debugType || 'admin'}` + return `${getUrlmys()}/api/shixuns/${id}/upload_git_file.json${isDev ?`?debug=${window._debugType || 'admin'}` : ""}` } export function getUploadActionUrlOfAuth(id) { - return `${getUrl()}/api/users/accounts/${id}/auth_attachment.json?debug=${window._debugType || 'admin'}` + return `${getUrl()}/api/users/accounts/${id}/auth_attachment.json${isDev ?`?debug=${window._debugType || 'admin'}` : ""}` } export function getRandomNumber(type) { diff --git a/src/forge/DevOps/About.jsx b/src/forge/DevOps/About.jsx index bb79caad..b9524d54 100644 --- a/src/forge/DevOps/About.jsx +++ b/src/forge/DevOps/About.jsx @@ -55,11 +55,6 @@ function About(props, ref) { setIsSpining(false); if(result && result.data ){ setStep(result.data.step); - // setStep(0); - // setFieldsValue({...result.data.cloud_account}); - // if(result.data.cloud_account){ - // setDisabled(true); - // } } }).catch(error=>{ setIsSpining(false); diff --git a/src/forge/Source/Index.jsx b/src/forge/Source/Index.jsx index 3ba40678..b01e3907 100644 --- a/src/forge/Source/Index.jsx +++ b/src/forge/Source/Index.jsx @@ -4,6 +4,7 @@ import { Blueback , FlexAJ } from '../Component/layout'; import { Dropdown, Input , Menu , Pagination } from 'antd'; import { Link } from 'react-router-dom'; import UploadSource from './UploadSource'; +import axios from 'axios'; const { Search } = Input; const sort = [ @@ -13,16 +14,37 @@ const sort = [ ] const limit = 15; function Index(props){ - const [ sortValue , setSortValue ] = useState(0); + const [ sortValue , setSortValue ] = useState(1); const [ page , setPage ] = useState(1); const [ total , setTotal ] = useState(0); const [ search , setSearch ] = useState(undefined); const [ visible , setVisible ] = useState(false); + const projectsId = props.match.params.projectsId; + const owner = props.match.params.owner; useEffect(()=>{ + if(owner && projectsId){ + getData(); + } + },[projectsId,owner,search,sort,page]) - },[search,sort,page]) + function getData(){ + const url = `http://117.50.100.12:8001/api/project/achievement/`; + axios.get(url,{ + params:{ + projectId:projectsId, + curPage:page, + pageSize:limit, + name:search, + sort:sortValue, + } + }).then(result=>{ + if(result && result.data){ + + } + }).catch(error=>{}) + } // 搜索 function onSearch(value){ @@ -40,7 +62,7 @@ function Index(props){ { sort && sort.map((item,key)=>{ return( - changeSort(e,key)} value={key} className={key === sortValue ?"color-blue":""}>{item} + changeSort(e,key+1)} value={key} className={key+1 === sortValue ?"color-blue":""}>{item} ) }) } @@ -55,12 +77,19 @@ function Index(props){ ) + // 上传资源确定 function onOk(){ } + + // 删除标签 + function removeTagFunc(){ + + } + return(
    - setVisible(false)} onOk={onOk}/> + setVisible(false)} onOk={onOk} showNotification={props.showNotification}/>
    资源库(18) @@ -98,7 +127,7 @@ function Index(props){

    资源描述资源描述资源描述资源描述资源描述资源描述资源描述

    - 软件版本 + 软件版本
    diff --git a/src/forge/Source/Index.scss b/src/forge/Source/Index.scss index 20f55c27..c3ea90cf 100644 --- a/src/forge/Source/Index.scss +++ b/src/forge/Source/Index.scss @@ -73,4 +73,26 @@ } } } +} +.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/UploadSource.jsx b/src/forge/Source/UploadSource.jsx index a8ccfdc3..72baa195 100644 --- a/src/forge/Source/UploadSource.jsx +++ b/src/forge/Source/UploadSource.jsx @@ -1,8 +1,58 @@ -import React from 'react'; -import { Modal } from 'antd'; +import React , { forwardRef, useEffect, useState } from 'react'; +import { Modal , Form , Checkbox , Input , Table } from 'antd'; +import Upload from '../Upload/Index'; +import { AlignCenter } from '../Component/layout'; +const { TextArea } = Input; -function UploadSource({ visible , onCancel , onOk }){ +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"} +] +function UploadSource({ form , visible , onCancel , onOk , showNotification}){ + const [ tableData , setTableData ] = useState(data); + const { getFieldDecorator, validateFields , setFieldsValue } = form; + + function UploadFunc(){ + + } + + const columns = [ + { + dataIndex:"name", + key:"name", + title:"资源名称", + width:"45%", + ellipsis:true, + render:(value,item,key)=>{ + return +
    {value}
    + { key === 0 && 当前版本 } +
    + } + }, + { + dataIndex:"loadNum", + key:"loadNum", + title:"下载数", + width:"15%", + className:"edu-txt-center" + }, + { + dataIndex:"citeNum", + key:"citeNum", + title:"引用数", + width:"15%", + className:"edu-txt-center" + }, + { + dataIndex:"time", + key:"time", + title:"上传时间", + width:"25%" + } + ] return( -
    +
    +
    + + + {getFieldDecorator("type",{ + rules:[] + })( + + 软件版本 + 文档 + 代码 + 媒体 + 论文 + 其它 + + )} + + + + {getFieldDecorator("desc",{ + rules:[] + })( +