Merge branch 'hotfix_gitlink' of http://106.75.45.236:3000/tongChong/forgeplus-react into feature_style

This commit is contained in:
何童崇 2022-06-15 17:11:03 +08:00
commit c2b1808cab
9 changed files with 58 additions and 24 deletions

View File

@ -27,7 +27,7 @@
margin-left: 15px; margin-left: 15px;
} }
.currentMenu{ .ant-dropdown-menu.currentMenu{
width: 120px; width: 120px;
text-align: center; text-align: center;
padding:0px; padding:0px;

View File

@ -688,6 +688,12 @@ class Detail extends Component {
() => (<WikiEdit {...this.props} {...this.state} {...common} />) () => (<WikiEdit {...this.props} {...this.state} {...common} />)
} }
></Route> ></Route>
{/* wiki具体某一个地址 */}
<Route path="/:owner/:projectsId/wiki/:wikiName"
render={
(props) => (<Wiki {...this.props} {...props} {...this.state} {...common} />)
}
></Route>
{/* wiki */} {/* wiki */}
<Route path="/:owner/:projectsId/wiki" <Route path="/:owner/:projectsId/wiki"
render={ render={

View File

@ -9,7 +9,7 @@ function DetailBanner({ history,list , owner , projectsId ,showNotification , ur
const [ menuName , setMenuName ] = useState(undefined); const [ menuName , setMenuName ] = useState(undefined);
const [ visible , setVisible ] = useState(false); const [ visible , setVisible ] = useState(false);
useEffect(()=>{ useEffect(()=>{
if(list){ if(Array.isArray(list)){
// banner // banner
let a = list.filter(item=>item.menu_name === "resources"); let a = list.filter(item=>item.menu_name === "resources");
if((pathname && pathname==="source") && (a && a.length === 0)){ if((pathname && pathname==="source") && (a && a.length === 0)){

View File

@ -1,6 +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 { Tag } from "antd"; import { Tag, Tooltip } from "antd";
import { AlignCenter } from '../Component/layout'; import { AlignCenter } from '../Component/layout';
import { getImageUrl, turnbar } from "educoder"; import { getImageUrl, turnbar } from "educoder";
import "./merge.css"; import "./merge.css";
@ -157,7 +157,7 @@ class MergeItem extends Component {
"--" "--"
)} )}
</li> </li>
<li>{item.version || "--"}</li> <li>{item.version ? <Tooltip placement="topLeft" title={item.version}>{item.version}</Tooltip> : "--"}</li>
<li> <li>
<div <div

View File

@ -1,6 +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 { Popconfirm } from 'antd' import { Popconfirm,Tooltip } from 'antd'
import { TagInfo } from '../Utils/TagColor'; import { TagInfo } from '../Utils/TagColor';
class OrderItem extends Component { class OrderItem extends Component {
constructor(props) { constructor(props) {
@ -84,7 +84,9 @@ class OrderItem extends Component {
} }
</li> </li>
<li>{item.tracker || "--"}</li> <li>{item.tracker || "--"}</li>
{ !mile ?<li>{item.version || "--"}</li>:""} {!mile ? <li>
{item.version ? <Tooltip placement="topLeft" title={item.version}>{item.version}</Tooltip> : "--"}
</li> : ""}
<li>{item.issue_status || "--"}</li> <li>{item.issue_status || "--"}</li>
<li style={{color:`${item.done_ratio === "100%"?"#28BD6C":"#F73030"}`}}>{item.done_ratio || "--"}</li> <li style={{color:`${item.done_ratio === "100%"?"#28BD6C":"#F73030"}`}}>{item.done_ratio || "--"}</li>
<li> <li>

View File

@ -116,11 +116,11 @@ class order extends Component {
}; };
// 获取列表数据 // 获取列表数据
getIssueList = (status_type, begin, end) => { getIssueList = (status_type,) => {
this.setState({ this.setState({
isSpin: true isSpin: true
}) })
const { select_params } = this.state; const { select_params ,begin,end} = this.state;
const { projectsId, owner } = this.props.match.params; const { projectsId, owner } = this.props.match.params;
const url = `/${owner }/${projectsId}/issues.json`; const url = `/${owner }/${projectsId}/issues.json`;
axios axios
@ -282,13 +282,17 @@ class order extends Component {
// 翻页 // 翻页
ChangePage = (page) => { ChangePage = (page) => {
window.scrollTo(0,0); window.scrollTo(0,0);
const { status_type } = this.state; const { status_type,select_params } = this.state;
this.setState({ this.setState({
isSpin: true, isSpin: true,
checkedValue: [], checkedValue: [],
all: false, all: false,
select_params:{
...select_params,
page
}
},()=>{ },()=>{
this.state.select_params.page=page; // this.state.select_params.page=page;
this.getIssueList(status_type); this.getIssueList(status_type);
}); });
}; };
@ -432,18 +436,28 @@ class order extends Component {
// 修改开始时间 // 修改开始时间
changeBeginTime = (data, value) => { changeBeginTime = (data, value) => {
const { status_type } = this.state; const { status_type,select_params } = this.state;
this.setState({ this.setState({
begin: value begin: value,
}) select_params:{
...select_params,
page:1
}
},()=>{
this.getIssueList(status_type, value, this.state.end); this.getIssueList(status_type, value, this.state.end);
})
} }
changeEndTime = (data, value) => { changeEndTime = (data, value) => {
const { status_type } = this.state; const { status_type,select_params } = this.state;
this.setState({ this.setState({
end: value end: value,
}) select_params:{
...select_params,
page:1
}
},()=>{
this.getIssueList(status_type, this.state.begin, value); this.getIssueList(status_type, this.state.begin, value);
});
} }
// 选择列表里面的checkbox // 选择列表里面的checkbox

View File

@ -19,7 +19,7 @@ export default (props) => {
let projectsId = match.params.projectsId; let projectsId = match.params.projectsId;
let owner = match.params.owner; let owner = match.params.owner;
let wikiName = match.params.wikiName;
const [fileArrInit, setFileArrInit] = useState(null); const [fileArrInit, setFileArrInit] = useState(null);
const [checkItem, setCheckItem] = useState({}); const [checkItem, setCheckItem] = useState({});
const [itemDetail, setItemDetail] = useState({}); const [itemDetail, setItemDetail] = useState({});
@ -40,7 +40,12 @@ export default (props) => {
setFileArr(res.data); setFileArr(res.data);
setFileArrInit(res.data); setFileArrInit(res.data);
if (res.data.length) { if (res.data.length) {
if (wikiName) {
let activeItem = res.data.filter(item => { return item.name == wikiName })[0] || res.data[0];
setCheckItem(activeItem)
} else {
setCheckItem(res.data[0]); setCheckItem(res.data[0]);
}
}; };
} else { } else {
setFileArr([]); setFileArr([]);
@ -191,6 +196,11 @@ export default (props) => {
}, },
}; };
function changeitem(item){
history.push(`/${owner}/${projectsId}/wiki/${item.name}`)
setCheckItem(item);
}
return ( return (
< Spin spinning={!fileArrInit} className="opacitySpin"> < Spin spinning={!fileArrInit} className="opacitySpin">
{fileArrInit && fileArrInit.length ? {fileArrInit && fileArrInit.length ?
@ -234,7 +244,7 @@ export default (props) => {
{ {
fileArr.map(item => { fileArr.map(item => {
return <div className="wiki-nav-title-parent" key={item.name}> return <div className="wiki-nav-title-parent" key={item.name}>
<div className={`wiki-nav-title ${item.name === checkItem.name ? 'active' : ''}`} onClick={() => { setCheckItem(item) }}> <div className={`wiki-nav-title ${item.name === checkItem.name ? 'active' : ''}`} onClick={() => { changeitem(item) }}>
<div className="nav-title-left"> <div className="nav-title-left">
<i className="iconfont icon-wenjianjia2 mr3"></i> <i className="iconfont icon-wenjianjia2 mr3"></i>
<span className="nav-title-left-text">{item.name}</span> <span className="nav-title-left-text">{item.name}</span>
@ -266,7 +276,7 @@ export default (props) => {
{itemDetail.image_url && <img alt="头像" className="head-log-small" src={getImageUrl(`/${itemDetail.image_url}`)} />} {itemDetail.image_url && <img alt="头像" className="head-log-small" src={getImageUrl(`/${itemDetail.image_url}`)} />}
<span >{itemDetail.userName}</span> <span >{itemDetail.userName}</span>
</span> </span>
<span className="time-ago">上次修改于{checkItem.commit ? timeAgo(checkItem.commit.author.when):'刚刚'}</span> <span className="time-ago">上次修改于{checkItem.commit ? timeAgo(checkItem.commit.author.when) : '刚刚'}</span>
</div> </div>
{permission && <Button type="primary" onClick={goEdit}>编辑</Button>} {permission && <Button type="primary" onClick={goEdit}>编辑</Button>}
</div> </div>

View File

@ -23,6 +23,8 @@ function Check({ current_user, showNotification, history }) {
const [taskId, setTaskId] = useState(); const [taskId, setTaskId] = useState();
const [havePass, setHavePass] = useState(false); const [havePass, setHavePass] = useState(false);
const disabledCheck = new Date().getTime() > new Date('2022-07-01').getTime();
const columns = [ const columns = [
{ {
title: '学生姓名', title: '学生姓名',
@ -128,8 +130,8 @@ function Check({ current_user, showNotification, history }) {
return ( return (
<div className='actionBox'> <div className='actionBox'>
{ {
text ? <Button type="default" onClick={() => { checkStudent(record.id, 0) }}>撤销</Button> : text ? <Button disabled={disabledCheck} type="default" onClick={() => { checkStudent(record.id, 0) }}>撤销</Button> :
<Button type="primary" disabled={havePass} onClick={() => { checkStudent(record.id, 1) }}>通过</Button> <Button disabled={disabledCheck} type="primary" disabled={havePass} onClick={() => { checkStudent(record.id, 1) }}>通过</Button>
} }
</div> </div>
) )

View File

@ -27,7 +27,7 @@ body>.-task-title {
width: 100%; width: 100%;
height:58px; height:58px;
min-width: 1200px; min-width: 1200px;
z-index: 1000; z-index: 1031;
position: fixed; position: fixed;
background: #1B2440; background: #1B2440;
color: #fff; color: #fff;