forked from Gitlink/forgeplus-react
update issue v1
This commit is contained in:
parent
ce8c22959a
commit
bfa4ceae1f
|
@ -6,7 +6,9 @@ const array =[
|
|||
{id:1,name:"最新创建"},
|
||||
{id:2,name:"最早创建"},
|
||||
{id:3,name:"最新更新"},
|
||||
{id:4,name:"最早更新"}
|
||||
{id:4,name:"最早更新"},
|
||||
{id:5,name:"高优先级"},
|
||||
{id:6,name:"低优先级"}
|
||||
]
|
||||
|
||||
function AllMenus({owner,projectsId,chooseFunc,update},ref){
|
||||
|
@ -73,15 +75,24 @@ function AllMenus({owner,projectsId,chooseFunc,update},ref){
|
|||
// 获取负责人列表
|
||||
useEffect(()=>{
|
||||
getCharge();
|
||||
},[charge])
|
||||
},[charge,update])
|
||||
|
||||
function getCharge(){
|
||||
const url = `/v1/${owner}/${projectsId}/issue_assigners`;
|
||||
axios.get(url,{params:{keyword:charge,only_name:true}}).then(result=>{
|
||||
if(result && result.data){
|
||||
setChargeList(result.data.assigners);
|
||||
}
|
||||
})
|
||||
if(update){
|
||||
const url = `/v1/${owner}/${projectsId}/collaborators`;
|
||||
axios.get(url,{params:{keyword:charge,only_name:true}}).then(result=>{
|
||||
if(result && result.data){
|
||||
setChargeList(result.data.collaborators);
|
||||
}
|
||||
})
|
||||
}else{
|
||||
const url = `/v1/${owner}/${projectsId}/issue_assigners`;
|
||||
axios.get(url,{params:{keyword:charge,only_name:true}}).then(result=>{
|
||||
if(result && result.data){
|
||||
setChargeList(result.data.assigners);
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
// 获取优先级列表
|
||||
useEffect(()=>{
|
||||
|
|
|
@ -8,6 +8,7 @@ import Copy from '../Component/copy';
|
|||
|
||||
// issue列表显示
|
||||
function Datas({checkbox ,item , projectsId,owner}){
|
||||
let host = window.location.hostname === "localhost" ? "testforgeplus.trustie.net" : window.location.hostname;
|
||||
|
||||
function statusTag(name){
|
||||
switch (name) {
|
||||
|
@ -29,12 +30,12 @@ function Datas({checkbox ,item , projectsId,owner}){
|
|||
<div className="ilog">
|
||||
<span className={statusTag(item.priority_name)}>{item.priority_name}</span>
|
||||
{ item.project_issues_index &&
|
||||
<Copy value={`/${owner}/${projectsId}/issues/${item.project_issues_index}`}><span className="number">#{item.project_issues_index}</span></Copy>
|
||||
<Copy value={`${host}/${owner}/${projectsId}/issues/${item.project_issues_index}`}><span className="number">#{item.project_issues_index}</span></Copy>
|
||||
}
|
||||
</div>
|
||||
<div style={{marginTop:"-2px"}}>
|
||||
<div className="idetails mt2">
|
||||
<img src={issue} alt="" width="16px" className="mr5" />
|
||||
{/* <img src={issue} alt="" width="16px" className="mr5" /> */}
|
||||
<Link to={`/${owner}/${projectsId}/issues/${item.project_issues_index}`}>{item.subject}</Link>
|
||||
{
|
||||
item.tags && item.tags.length>0?
|
||||
|
@ -62,7 +63,7 @@ function Datas({checkbox ,item , projectsId,owner}){
|
|||
{
|
||||
item.assigners.map((i,k)=>{
|
||||
return(
|
||||
k<5 && <Link to={`/${i.login}`} style={{right:`${(item.assigners.length-k-1)*(20-7)}px`,zIndex:k+1}}><img src={getImageUrl(i.image_url)} alt="" /></Link>
|
||||
k<5 && <Link to={`/${i.login}`} style={{right:`${(item.assigners.length-k-1)*(22-7)}px`,zIndex:k+1}}><img src={getImageUrl(i.image_url)} alt="" /></Link>
|
||||
)
|
||||
})
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@ import { findDOMNode } from 'react-dom';
|
|||
import moment from 'moment';
|
||||
const { Group , Button } = Radio;
|
||||
|
||||
function Date({name , today , setDate},ref){
|
||||
function Date({name , today , setDate , editFlag},ref){
|
||||
const [ visible , setVisible ] = useState(false);
|
||||
const [ time , setTime ] = useState();
|
||||
|
||||
|
@ -130,7 +130,7 @@ function Date({name , today , setDate},ref){
|
|||
<li>
|
||||
<span>
|
||||
{name}
|
||||
<a ref={refBox} onClick={()=>setVisible(visible ? false : true)}><i className="iconfont icon-riqi font-14" style={{color:"#898d9d"}}></i></a>
|
||||
{!editFlag && <a ref={refBox} onClick={()=>setVisible(visible ? false : true)}><i className="iconfont icon-riqi font-14" style={{color:"#898d9d"}}></i></a> }
|
||||
</span>
|
||||
<p className={time ? "operatevalue color-grey-3 task-hide" : "operatevalue task-hide"}>{time || "未设置"}</p>
|
||||
</li>
|
||||
|
|
|
@ -3,13 +3,12 @@ import Modals from '../../Component/PublicModal/Index';
|
|||
import { AlignTop } from '../../Component/layout';
|
||||
import { Button } from 'antd';
|
||||
|
||||
function DelBox({visible,onCancel,onSuccess,content}){
|
||||
function DelBox({visible,onCancel,onSuccess,content,title}){
|
||||
return(
|
||||
<Modals
|
||||
visible={visible}
|
||||
onCancel={onCancel}
|
||||
title={"删除疑修"}
|
||||
|
||||
title={title || "删除疑修"}
|
||||
btn={
|
||||
<div>
|
||||
<Button size={'large'} onClick={onCancel}>取消</Button>
|
||||
|
|
|
@ -17,6 +17,7 @@ const { Search } = Input;
|
|||
* @param editFlag:是否有编辑按钮
|
||||
* @param double:可多选
|
||||
* @param onChange:选择项后返回id数组
|
||||
* @param permission:权限
|
||||
* @returns
|
||||
*/
|
||||
function EditMenus({
|
||||
|
@ -31,7 +32,8 @@ function EditMenus({
|
|||
searchFunc ,
|
||||
double ,
|
||||
onChange ,
|
||||
imgFlag
|
||||
imgFlag,
|
||||
permission
|
||||
}){
|
||||
const [ menus , setMenus ] = useState([]);
|
||||
const [ searchValue , setSearchValue ]= useState(undefined);
|
||||
|
@ -119,7 +121,7 @@ function EditMenus({
|
|||
placement="bottomLeft"
|
||||
trigger={['click']}
|
||||
overlay={
|
||||
<div className="branch-tagBox" ref={refFa}>
|
||||
<div ref={refFa}>
|
||||
{ searchFlag &&
|
||||
<div className="searchbox">
|
||||
<Search
|
||||
|
@ -148,7 +150,7 @@ function EditMenus({
|
|||
:
|
||||
<div className="menusEmpty">
|
||||
<p>{searchValue ? <span>暂无{name}“{searchValue}”</span>: `暂无${name}`}</p>
|
||||
{ name === "标记" && <a className="color-blue font-15" onClick={()=>{setVisible(false);onAdd()}}><i className="iconfont icon-a-bianji12 font-14 mr5"></i>标记管理</a>}
|
||||
{ onAdd && (permission && permission!=="reporter") && <a className="color-blue font-15" onClick={()=>{setVisible(false);onAdd()}}><i className="iconfont icon-a-bianji12 font-14 mr5"></i>标记管理</a>}
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 50 KiB |
|
@ -91,7 +91,8 @@ function Details(props){
|
|||
}
|
||||
setNames(n);
|
||||
data.start_date && setStartDate(moment(data.start_date).format('YYYY-MM-DD'));
|
||||
data.start_date && setDueDate(moment(data.due_date).format('YYYY-MM-DD'));
|
||||
console.log(data.due_date);
|
||||
data.due_date && setDueDate(moment(data.due_date).format('YYYY-MM-DD'));
|
||||
}
|
||||
}).catch(error=>{})
|
||||
}
|
||||
|
@ -211,7 +212,9 @@ function Details(props){
|
|||
start_date:sDate,
|
||||
due_date:eDate
|
||||
}).then(result=>{
|
||||
|
||||
if(result){
|
||||
Init();
|
||||
}
|
||||
}).catch(error=>{})
|
||||
}
|
||||
}
|
||||
|
@ -277,7 +280,7 @@ function Details(props){
|
|||
setEdit(false)
|
||||
}
|
||||
}
|
||||
|
||||
let host = window.location.hostname === "localhost" ? "testforgeplus.trustie.net" : window.location.hostname;
|
||||
return(
|
||||
details ?
|
||||
<Box>
|
||||
|
@ -312,7 +315,7 @@ function Details(props){
|
|||
<div className="detailtitle">
|
||||
<div className="ilog">
|
||||
{details.priority && <span className={statusTag(details.priority.name)}>{ details.priority.name }</span> }
|
||||
<Copy value={`/${owner}/${projectsId}/issues/${index}`}><span className="number">#{details.project_issues_index}</span></Copy>
|
||||
<Copy value={`${host}/${owner}/${projectsId}/issues/${index}`}><span className="number">#{details.project_issues_index}</span></Copy>
|
||||
</div>
|
||||
<div>
|
||||
<p className="name">{details.subject}</p>
|
||||
|
@ -334,7 +337,7 @@ function Details(props){
|
|||
</ul>
|
||||
}
|
||||
</div>
|
||||
<div style={{padding:"20px"}}>
|
||||
<div class="descPanel">
|
||||
{details.description ?
|
||||
<RenderHtml className="break_word_comments imageLayerParent" value={details.description} url={props.history.location} />
|
||||
:
|
||||
|
@ -356,14 +359,14 @@ function Details(props){
|
|||
</div> */}
|
||||
</LongWidth>
|
||||
<div className="shortwidth mt25">
|
||||
<EditMenus name="负责人" names={names && names.assigner_name} imgFlag onChange={(ids,name)=>{saveForeach(ids);let copyname = { ...names,assigner_name:name};setNames(copyname);setCharegeId(ids);}} list={chargeList} value={charegeId} searchFlag searchFunc={(value)=>{setCharge(value)}} double={5}/>
|
||||
<EditMenus name="状态" names={names && names.status_name} onChange={(ids,name)=>{setStatusId(ids);saveForeach(undefined,ids);let copyname = { ...names,status_name:name};setNames(copyname);}} list={statusList} value={statusId}/>
|
||||
<EditMenus name="优先级" names={names && names.issue_priorities_name} onChange={(ids,name)=>{setPrioritiesId(ids);saveForeach(undefined,undefined,ids);let copyname = { ...names,issue_priorities_name:name};setNames(copyname);}} list={prioritiesList} value={prioritiesId}/>
|
||||
<EditMenus name="标记" names={names && names.issue_tag_name} onChange={(ids,name)=>{setTagId(ids);saveForeach(undefined,undefined,undefined,ids);let copyname = { ...names,issue_tag_name:name};setNames(copyname);}} list={tagList} value={tagId} onAdd={()=>setVisible(true)} searchFlag double={3} searchFunc={(value)=>setTag(value)}/>
|
||||
<EditMenus name="里程碑" names={names && names.milestone_name} emptyName="未关联" onChange={(ids,name)=>{setMillstoneId(ids);saveForeach(undefined,undefined,undefined,undefined,ids);let copyname = { ...names,milestone_name:name};setNames(copyname);}} value={millstoneId} list={millstoneList} searchFlag searchFunc={(value)=>setMillstone(value)}/>
|
||||
<EditMenus name="关联分支" names={branchId} emptyName="未关联" onChange={(ids)=>{setBranchId(ids);saveForeach(undefined,undefined,undefined,undefined,undefined,ids);}} value={branchId} list={branchList} searchFlag searchFunc={(value)=>setBranch(value)}/>
|
||||
<Date name="开始日期" today={start_date} setDate={(date)=>{setStartDate(date);saveForeach(undefined,undefined,undefined,undefined,undefined,undefined,date)}}/>
|
||||
<Date name="结束日期" today={due_date} setDate={(date)=>{setDueDate(date);saveForeach(undefined,undefined,undefined,undefined,undefined,undefined,undefined,date)}}/>
|
||||
<EditMenus name="负责人" names={names && names.assigner_name} imgFlag onChange={(ids,name)=>{saveForeach(ids);let copyname = { ...names,assigner_name:name};setNames(copyname);setCharegeId(ids);}} list={chargeList} value={charegeId} searchFlag searchFunc={(value)=>{setCharge(value)}} double={5} editFlag={details && !details.user_permission}/>
|
||||
<EditMenus name="状态" names={names && names.status_name} onChange={(ids,name)=>{setStatusId(ids);saveForeach(undefined,ids);let copyname = { ...names,status_name:name};setNames(copyname);}} list={statusList} value={statusId} editFlag={details && !details.user_permission}/>
|
||||
<EditMenus name="优先级" names={names && names.issue_priorities_name} onChange={(ids,name)=>{setPrioritiesId(ids);saveForeach(undefined,undefined,ids);let copyname = { ...names,issue_priorities_name:name};setNames(copyname);}} list={prioritiesList} value={prioritiesId} editFlag={details && !details.user_permission}/>
|
||||
<EditMenus name="标记" names={names && names.issue_tag_name} onChange={(ids,name)=>{setTagId(ids);saveForeach(undefined,undefined,undefined,ids);let copyname = { ...names,issue_tag_name:name};setNames(copyname);}} list={tagList} value={tagId} onAdd={()=>setVisible(true)} searchFlag double={3} searchFunc={(value)=>setTag(value)} editFlag={details && !details.user_permission}/>
|
||||
<EditMenus name="里程碑" names={names && names.milestone_name} emptyName="未关联" onChange={(ids,name)=>{setMillstoneId(ids);saveForeach(undefined,undefined,undefined,undefined,ids);let copyname = { ...names,milestone_name:name};setNames(copyname);}} value={millstoneId} list={millstoneList} searchFlag searchFunc={(value)=>setMillstone(value)} editFlag={details && !details.user_permission}/>
|
||||
<EditMenus name="关联分支" names={branchId} emptyName="未关联" onChange={(ids)=>{setBranchId(ids);saveForeach(undefined,undefined,undefined,undefined,undefined,ids);}} value={branchId} list={branchList} searchFlag searchFunc={(value)=>setBranch(value)} editFlag={details && !details.user_permission}/>
|
||||
<Date name="开始日期" today={start_date} setDate={(date)=>{setStartDate(date);saveForeach(undefined,undefined,undefined,undefined,undefined,undefined,date)}} editFlag={details && !details.user_permission}/>
|
||||
<Date name="结束日期" today={due_date} setDate={(date)=>{setDueDate(date);saveForeach(undefined,undefined,undefined,undefined,undefined,undefined,undefined,date)}} editFlag={details && !details.user_permission}/>
|
||||
</div>
|
||||
</Box>
|
||||
:
|
||||
|
|
|
@ -8,8 +8,10 @@ import AllMenus from '../Component/allMenus';
|
|||
import Datas from '../Component/datas';
|
||||
import DelBox from '../Component/delBox';
|
||||
import axios from 'axios';
|
||||
import cookie from 'react-cookies';
|
||||
import emp from '../Img/emp.png';
|
||||
const { Search } = Input;
|
||||
|
||||
const defaultLimit = 10;
|
||||
|
||||
function List(props){
|
||||
const [ visible , setVisible ] = useState(false);
|
||||
|
@ -17,20 +19,23 @@ function List(props){
|
|||
const [ closedCount , setClosedCount ] = useState(0);
|
||||
const [ openedCount , setOpenedCount ] = useState(0);
|
||||
|
||||
const[ aboutMe , setAboutMe ] = useState("aboutme");
|
||||
const[ aboutMe , setAboutMe ] = useState("all");
|
||||
const[ value , setValue ] = useState("");
|
||||
const[ keyword , setKeyword ] = useState(undefined);
|
||||
|
||||
const [ category , setCategory] = useState("all");
|
||||
const [ category , setCategory] = useState("opened");
|
||||
|
||||
const [ allValue , setAllValue ] = useState([]);
|
||||
const [ allIds , setAllIds ] = useState([]);
|
||||
const [ checkAll , setCheckAll ] = useState(false);
|
||||
|
||||
const [ updateIds , setUpdateIds ] = useState([]);
|
||||
const [ updateIds , setUpdateIds ] = useState(undefined);
|
||||
|
||||
const [ page , setPage ] = useState(1);
|
||||
const [ limit , setLimit ] = useState(10);
|
||||
const [ total , setTotal ] = useState(undefined);
|
||||
const [ issueTotal , setIssueTotal ] = useState(0);
|
||||
|
||||
|
||||
const menuRef = useRef(null);
|
||||
const owner = props.match.params.owner;
|
||||
|
@ -39,19 +44,42 @@ function List(props){
|
|||
|
||||
|
||||
useEffect(()=>{
|
||||
Init();
|
||||
},[aboutMe,keyword,category])
|
||||
// 获取issue列表数据
|
||||
function Init(params){
|
||||
setTotal(undefined);
|
||||
setLimit(defaultLimit);
|
||||
Init(updateIds,1);
|
||||
},[aboutMe,keyword,category])
|
||||
|
||||
function getDirection(id){
|
||||
if(!id) return undefined;
|
||||
if(id === "1" || id === "3" || id === "5"){
|
||||
return "desc"
|
||||
}else{
|
||||
return "asc"
|
||||
}
|
||||
}
|
||||
function getBy(id){
|
||||
if(!id) return undefined;
|
||||
if(id === "1" || id === "2"){
|
||||
return "issues.created_on"
|
||||
}else if(id === "3" || id === "4"){
|
||||
return "issues.updated_on"
|
||||
}else{
|
||||
return "issue_priorities.position"
|
||||
}
|
||||
}
|
||||
|
||||
// 获取issue列表数据
|
||||
function Init(params,p){
|
||||
const url = `/v1/${owner}/${projectsId}/issues`;
|
||||
axios.get(url,{
|
||||
params:{
|
||||
participant_category:aboutMe,
|
||||
keyword,category,
|
||||
limit,
|
||||
page:p || page,
|
||||
...params,
|
||||
sort_direction:(params && params.sort_by) ? ((params.sort_by === 1 || params.sort_by === 3) ? "desc" : "asc") :undefined,
|
||||
sort_by:(params && params.sort_by) ? ((params.sort_by === 1 || params.sort_by === 2) ? "created_on" : "updated_on") : undefined
|
||||
sort_direction:getDirection(params && params.sort_by),
|
||||
sort_by:getBy(params && params.sort_by)
|
||||
}
|
||||
}).then(result=>{
|
||||
if(result){
|
||||
|
@ -61,8 +89,13 @@ function List(props){
|
|||
setOpenedCount(result.data.opened_count);
|
||||
const ids = result.data.issues.length>0 ? result.data.issues.map(i=>{return i.id}) : [];
|
||||
setAllIds(ids);
|
||||
setIssueTotal(result.data.total_issues_count);
|
||||
|
||||
let d={participant_category:aboutMe,keyword,category,limit,page,...params}
|
||||
let inFifteenMinutes = new Date(new Date().getTime() + 24 * 3600 * 1000);
|
||||
cookie.save('states', {...d},{ expires: inFifteenMinutes,path:`/` });
|
||||
}
|
||||
}).then(error=>{console.log("error:",error)})
|
||||
}).then(error=>{})
|
||||
}
|
||||
|
||||
// 第一个下拉搜索
|
||||
|
@ -83,16 +116,20 @@ function List(props){
|
|||
//清除筛选条件
|
||||
function clearCondition(){
|
||||
setKeyword(undefined);
|
||||
setAboutMe("aboutme");
|
||||
Init();
|
||||
setAboutMe("all");
|
||||
setCategory("opened");
|
||||
setTotal(undefined);
|
||||
setUpdateIds(undefined);
|
||||
Init();
|
||||
// 清除下拉选项
|
||||
menuRef.current && menuRef.current.clearChoose();
|
||||
|
||||
}
|
||||
|
||||
// 全选所有issue
|
||||
function chooseAll(e){
|
||||
setCheckAll(e.target.checked);
|
||||
// 清除下拉选项
|
||||
menuRef.current && menuRef.current.clearChoose();
|
||||
if(e.target.checked){
|
||||
setAllValue(allIds);
|
||||
}else{
|
||||
|
@ -102,6 +139,8 @@ function List(props){
|
|||
|
||||
// 选择列表里的issue
|
||||
function checkIssues(value){
|
||||
// 清除下拉选项
|
||||
menuRef.current && menuRef.current.clearChoose();
|
||||
setAllValue(value);
|
||||
if(value.length === allIds.length){
|
||||
setCheckAll(true);
|
||||
|
@ -121,14 +160,15 @@ function List(props){
|
|||
function sureUpdate(){
|
||||
const url = `/v1/${owner}/${projectsId}/issues/batch_update`;
|
||||
axios.patch(url,{
|
||||
assigner_ids: [updateIds && updateIds.assigner_id],
|
||||
assigner_ids: updateIds && updateIds.assigner_id && updateIds.assigner_id.split(","),
|
||||
ids: allValue,
|
||||
issue_tag_ids: [updateIds && updateIds.issue_tag_ids],
|
||||
issue_tag_ids: updateIds && updateIds.issue_tag_ids && updateIds.issue_tag_ids.split(","),
|
||||
milestone_id: updateIds && updateIds.milestone_id,
|
||||
priority_id: updateIds && updateIds.issue_priorities_id,
|
||||
status_id: updateIds && updateIds.status_id
|
||||
}).then(result=>{
|
||||
if(result){
|
||||
setTotal(undefined);
|
||||
Init();
|
||||
cancelUpdate();
|
||||
}
|
||||
|
@ -138,6 +178,7 @@ function List(props){
|
|||
// 切换页码
|
||||
function changepage(page){
|
||||
setPage(page);
|
||||
Init(updateIds,page);
|
||||
}
|
||||
|
||||
// 删除issue相关 func
|
||||
|
@ -147,6 +188,7 @@ function List(props){
|
|||
params:{ids:allValue}
|
||||
}).then(result=>{
|
||||
if(result){
|
||||
setUpdateIds(undefined);
|
||||
setAllValue([]);
|
||||
setVisible(false);
|
||||
props.showNotification("疑修删除成功!");
|
||||
|
@ -160,9 +202,24 @@ function List(props){
|
|||
// 将ids保存下来以便修改
|
||||
setUpdateIds(ids);
|
||||
}else{
|
||||
Init(ids);
|
||||
setUpdateIds(ids);
|
||||
setTotal(undefined);
|
||||
Init(ids,1);
|
||||
}
|
||||
}
|
||||
|
||||
function chageLimit(c,p){
|
||||
setPage(1);
|
||||
setLimit(p);
|
||||
}
|
||||
|
||||
function createBtnFunc(){
|
||||
if(props.checkIfLogin()===false){
|
||||
props.showLoginDialog();
|
||||
return false;
|
||||
}
|
||||
props.history.push(`/${owner}/${projectsId}/issues/new`);
|
||||
}
|
||||
|
||||
return(
|
||||
<div>
|
||||
|
@ -182,14 +239,15 @@ function List(props){
|
|||
onSearch={()=>setKeyword(value)}
|
||||
style={{ width: 354 , height : 32 , marginLeft: 20 }}
|
||||
/>
|
||||
<a className="color-blue ml25" onClick={clearCondition} style={{ display: "flex" , alignItems: "center"}}><i className="iconfont icon-roundclose font-16 mr5"></i>清除筛选条件</a>
|
||||
<a className="color-blue ml25" onClick={clearCondition} style={{ display: "flex" , alignItems: "center"}}>
|
||||
<i className="iconfont icon-roundclose font-16 mr5"></i>清除筛选条件</a>
|
||||
</div>
|
||||
<div>
|
||||
{
|
||||
permission && permission !== "reporter" &&
|
||||
<Link to={`/${owner}/${projectsId}/issues/sign`} className="dorpdownButton"><img src={bj} alt="" className="mr5" />标记管理</Link>
|
||||
}
|
||||
<Link to={`/${owner}/${projectsId}/issues/new`} className="operateButton ml20"><img src={create} alt="" className="mr5" />创建疑修</Link>
|
||||
<a onClick={createBtnFunc} className="operateButton ml20"><img src={create} alt="" className="mr5" />创建疑修</a>
|
||||
</div>
|
||||
</div>
|
||||
<div className="lists">
|
||||
|
@ -201,7 +259,7 @@ function List(props){
|
|||
<span>选择{allValue.length}个issue</span>
|
||||
:
|
||||
<ul className="statusul">
|
||||
<li className={category === "all" ?"active":""} onClick={()=>setCategory("all")}>全部<span>{total}</span></li>
|
||||
<li className={category === "all" ?"active":""} onClick={()=>setCategory("all")}>全部<span>{issueTotal}</span></li>
|
||||
<li className={category === "opened" ?"active":""} onClick={()=>setCategory("opened")}>开启中<span>{openedCount}</span></li>
|
||||
<li className={category === "closed" ?"active":""} onClick={()=>setCategory("closed")}>已关闭<span>{closedCount}</span></li>
|
||||
</ul>
|
||||
|
@ -228,11 +286,15 @@ function List(props){
|
|||
</div>
|
||||
{
|
||||
total === 0 &&
|
||||
<div className="listempty">
|
||||
<img src={issueEmp} alt="" width="68px" />
|
||||
<p className="font-22 mt5 mb10">欢迎使用疑修(Issue)</p>
|
||||
<p className="font-15">疑修用于记录与跟踪待办事项、项目bug、功能需求等。在使用之前,请您先<a className="color-blue">创建一个疑修</a></p>
|
||||
</div>
|
||||
(issueTotal === 0 ?
|
||||
<div className="dataempty"><img src={emp} alt="" /></div>
|
||||
:
|
||||
<div className="listempty">
|
||||
<img src={issueEmp} alt="" width="68px" />
|
||||
<p className="font-22 mt5 mb10">欢迎使用疑修(Issue)</p>
|
||||
<p className="font-15">疑修用于记录与跟踪待办事项、项目bug、功能需求等。在使用之前,请您先<Link to={`/${owner}/${projectsId}/issues/new`} className="color-blue">创建一个疑修</Link></p>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
{
|
||||
total > 0 &&
|
||||
|
@ -256,7 +318,7 @@ function List(props){
|
|||
{
|
||||
total > 10 &&
|
||||
<div className="pt25 pb30" style={{textAlign:"right"}}>
|
||||
<Pagination total={total} current={page} onChange={changepage} showSizeChanger showQuickJumper />
|
||||
<Pagination total={total} onShowSizeChange={chageLimit} current={page} pageSize={limit} onChange={changepage} showSizeChanger showQuickJumper />
|
||||
</div>
|
||||
}
|
||||
</React.Fragment>
|
||||
|
|
|
@ -37,6 +37,7 @@ function New(props){
|
|||
|
||||
const owner = props.match.params.owner;
|
||||
const projectsId = props.match.params.projectsId;
|
||||
const permission = props && props.projectDetail && props.projectDetail.permission;
|
||||
|
||||
|
||||
|
||||
|
@ -167,6 +168,9 @@ function New(props){
|
|||
}
|
||||
|
||||
|
||||
function onAdd(){
|
||||
setVisible(true);
|
||||
}
|
||||
|
||||
return(
|
||||
<div>
|
||||
|
@ -185,7 +189,7 @@ function New(props){
|
|||
<EditMenus name="负责人" value={charegeId} names={names && names.assigner_name} imgFlag onChange={(ids,name)=>{setCharegeId(ids);let copyname = { ...names,assigner_name:name};setNames(copyname);}} list={chargeList} searchFlag searchFunc={(value)=>setCharge(value)} double={5}/>
|
||||
<EditMenus name="状态" value={statusId} names={names && names.status_name} onChange={(ids,name)=>{setStatusId(ids);let copyname = { ...names,status_name:name};setNames(copyname);}} list={statusList} editFlag/>
|
||||
<EditMenus name="优先级" value={prioritiesId} names={names && names.issue_priorities_name} onChange={(ids,name)=>{setPrioritiesId(ids);let copyname = { ...names,issue_priorities_name:name};setNames(copyname);}} list={prioritiesList}/>
|
||||
<EditMenus name="标记" value={tagId} names={names && names.issue_tag_name} onChange={(ids,name)=>{setTagId(ids);let copyname = { ...names,issue_tag_name:name};setNames(copyname);}} list={tagList} onAdd={()=>setVisible(true)} searchFlag double={3} searchFunc={(value)=>setTag(value)}/>
|
||||
<EditMenus name="标记" permission={permission} value={tagId} names={names && names.issue_tag_name} onChange={(ids,name)=>{setTagId(ids);let copyname = { ...names,issue_tag_name:name};setNames(copyname);}} list={tagList} onAdd={onAdd} searchFlag double={3} searchFunc={(value)=>setTag(value)}/>
|
||||
<EditMenus name="里程碑" value={millstoneId} names={names && names.milestone_name} emptyName="未关联" onChange={(ids,name)=>{setMillstoneId(ids);let copyname = { ...names,milestone_name:name};setNames(copyname);}} list={millstoneList} searchFlag searchFunc={(value)=>setMillstone(value)}/>
|
||||
<EditMenus name="关联分支" value={branchId} names={branchId} emptyName="未关联" onChange={(ids)=>setBranchId(ids)} list={branchList} searchFlag searchFunc={(value)=>setBranch(value)}/>
|
||||
<Date name="开始日期" today={start_date} setDate={(date)=>setStartDate(date)}/>
|
||||
|
|
|
@ -21,6 +21,9 @@ function Sign(props){
|
|||
const [ order_type , setOrderType ] = useState(undefined);
|
||||
const [ nameFlag , setNameFlag ] = useState(undefined);
|
||||
const [ defaultColor , setDefaultColor ]= useState("#F17013");
|
||||
|
||||
const [ arrayName , setArrayName ] = useState("标记");
|
||||
const [ key , setKey ] = useState("0");
|
||||
const owner = props.match.params.owner;
|
||||
const projectsId = props.match.params.projectsId;
|
||||
|
||||
|
@ -32,7 +35,7 @@ function Sign(props){
|
|||
const url = `/v1/${owner}/${projectsId}/issue_tags`;
|
||||
axios.get(url,{
|
||||
params:{
|
||||
page,limit,order_name,order_type
|
||||
page,limit,sort_by:order_name,sort_direction:order_type
|
||||
}
|
||||
}).then(result=>{
|
||||
if(result && result.data){
|
||||
|
@ -43,25 +46,27 @@ function Sign(props){
|
|||
}
|
||||
|
||||
function arrayList(e){
|
||||
const { eventKey , value } = e.item.props;
|
||||
const { eventKey , value , children , createName } = e.item.props;
|
||||
setPage(1);
|
||||
setOrderName(eventKey);
|
||||
setOrderName(createName);
|
||||
setOrderType(value);
|
||||
setArrayName(children);
|
||||
setKey(eventKey);
|
||||
}
|
||||
|
||||
const menu = (
|
||||
<Menu onClick={arrayList}>
|
||||
<Menu.Item key={"created_at"} value="desc">
|
||||
按创建时间降序排序
|
||||
<Menu onClick={arrayList} selectedKeys={[`${key}`]}>
|
||||
<Menu.Item key={"1"} value="desc" createName="issues_count">
|
||||
按疑修数量降序排序
|
||||
</Menu.Item>
|
||||
<Menu.Item key={"created_at"} value="asc">
|
||||
按创建时间升序排序
|
||||
<Menu.Item key={"2"} value="asc" createName="issues_count">
|
||||
按疑修数量升序排序
|
||||
</Menu.Item>
|
||||
<Menu.Item key={"issues_count"} value="desc">
|
||||
按issue个数降序排序
|
||||
<Menu.Item key={"3"} value="desc" createName="pull_requests_count">
|
||||
按合并请求数量降序排序
|
||||
</Menu.Item>
|
||||
<Menu.Item key={"issues_count"} value="asc">
|
||||
按issue个数升序排序
|
||||
<Menu.Item key={"4"} value="asc" createName="pull_requests_count">
|
||||
按合并请求数量升序排序
|
||||
</Menu.Item>
|
||||
</Menu>
|
||||
);
|
||||
|
@ -84,7 +89,6 @@ function Sign(props){
|
|||
}
|
||||
|
||||
function sureSave(){
|
||||
console.log(colors || defaultColor);
|
||||
if(!name){
|
||||
setNameFlag(true);
|
||||
}else{
|
||||
|
@ -150,10 +154,11 @@ function Sign(props){
|
|||
visible={delVisible}
|
||||
onCancel={()=>setDelVisible(false)}
|
||||
onSuccess={deleteFunc}
|
||||
title="删除标记"
|
||||
content={<div style={{paddingTop:"3px"}}><p className="font-15 mb20">您确定要删除当前标记?</p></div>}
|
||||
/>
|
||||
<div className="between mt30 mb25">
|
||||
<span><Link to={`/${owner}/${projectsId}/issues`}>Issue</Link> / 项目标记</span>
|
||||
<span><Link to={`/${owner}/${projectsId}/issues`}>疑修</Link> / 项目标记</span>
|
||||
<a className="operateButton" onClick={()=>setEdit(true)}><img src={create} alt="" className="mr5"/>创建标记</a>
|
||||
</div>
|
||||
{
|
||||
|
@ -177,7 +182,7 @@ function Sign(props){
|
|||
<div className="between bluebar">
|
||||
<span>项目标记({total || 0})</span>
|
||||
<Dropdown overlay={menu} trigger={["click"]} placement="bottomRight">
|
||||
<a>标记<Icon type="caret-down" className="ml5 color-grey-6" /></a>
|
||||
<a>{arrayName}<Icon type="caret-down" className="ml5 color-grey-6" /></a>
|
||||
</Dropdown>
|
||||
</div>
|
||||
{
|
||||
|
@ -194,8 +199,8 @@ function Sign(props){
|
|||
</p>
|
||||
<p style={{flex:2}} className="task-hide">{i.description}</p>
|
||||
<p>
|
||||
<span className="mr12">{i.issues_count || 0} Issue</span>
|
||||
{/* <span className="line">12 合并请求</span> */}
|
||||
<span className="mr12">{i.issues_count || 0} 疑修</span>
|
||||
<span className="line">{i.pull_requests_count || 0} 合并请求</span>
|
||||
</p>
|
||||
<p>
|
||||
<a className="color-blue mr12" onClick={()=>editFunc(i)}>编辑</a>
|
||||
|
|
|
@ -82,6 +82,16 @@
|
|||
.lists{
|
||||
margin-bottom: 50px;
|
||||
}
|
||||
.dataempty{
|
||||
height: 420px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border: 1px solid;
|
||||
border-color: #d9d9d9;
|
||||
border-radius: 0px 0px 4px 4px;
|
||||
border-top: none;
|
||||
}
|
||||
// 列表为空样式
|
||||
.listempty{
|
||||
display: flex;
|
||||
|
@ -128,7 +138,7 @@
|
|||
width: 106px;
|
||||
&>span{
|
||||
height:19px;
|
||||
line-height: 19px;
|
||||
line-height: 17px;
|
||||
color: #666;
|
||||
background-color:rgba(70, 106, 255, 0.09);
|
||||
border-radius:10px;
|
||||
|
@ -136,6 +146,8 @@
|
|||
padding:0px 6px;
|
||||
font-size: 13px;
|
||||
display: block;
|
||||
border:1px solid ;
|
||||
border-color: rgba(70, 106, 255, 0.01);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -146,6 +158,13 @@
|
|||
cursor: pointer;
|
||||
&.active{
|
||||
color: #333;
|
||||
font-weight: 500;
|
||||
&>span{
|
||||
font-weight: normal;
|
||||
color: #466aff;
|
||||
border-color: #466aff;
|
||||
background-color: #fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -214,7 +233,7 @@
|
|||
color: #40424a;
|
||||
.principal{
|
||||
position: relative;
|
||||
height: 20px;
|
||||
height: 22px;
|
||||
&.hovers:hover{
|
||||
a{
|
||||
position:initial;
|
||||
|
@ -226,8 +245,8 @@
|
|||
transition: 0.6s;
|
||||
}
|
||||
img,span{
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
width: 22px;
|
||||
height: 22px;
|
||||
border-radius: 50%;
|
||||
}
|
||||
span{
|
||||
|
@ -239,7 +258,7 @@
|
|||
}
|
||||
}
|
||||
&>div{
|
||||
width: 106px;
|
||||
width: 110px;
|
||||
text-align: right;
|
||||
}
|
||||
.commentnum{
|
||||
|
@ -483,6 +502,7 @@
|
|||
border-radius:6px;
|
||||
box-shadow:0px 0px 10px rgba(24, 54, 181, 0.17);
|
||||
max-width: 280px;
|
||||
z-index: 100;
|
||||
.searchbox{
|
||||
padding:12px 20px 0px 16px;
|
||||
}
|
||||
|
@ -549,6 +569,11 @@
|
|||
align-items: center;
|
||||
}
|
||||
}
|
||||
.descPanel{
|
||||
margin:20px 0px;
|
||||
padding:20px;
|
||||
background-color: #f7f8fd;
|
||||
}
|
||||
// 新建页面
|
||||
.explain{
|
||||
.ant-form-explain{
|
||||
|
|
|
@ -97,7 +97,7 @@ class Index extends Component {
|
|||
</Link>
|
||||
</p>
|
||||
</li>
|
||||
<li
|
||||
{/* <li
|
||||
className={pathname.indexOf("settings/labels") > -1 ? "active" : ""}
|
||||
>
|
||||
<p>
|
||||
|
@ -106,7 +106,7 @@ class Index extends Component {
|
|||
项目标记
|
||||
</Link>
|
||||
</p>
|
||||
</li>
|
||||
</li> */}
|
||||
|
||||
{/* <li
|
||||
className={
|
||||
|
|
Loading…
Reference in New Issue