forked from Gitlink/forgeplus-react
完善资料弹框代码库新建疑修 以及 里程碑新建疑修"
This commit is contained in:
parent
6b879ee4d8
commit
085cd400c4
|
@ -1,8 +1,14 @@
|
|||
import React from 'react';
|
||||
|
||||
function Profile({children,sureFunc,showCompeleteDialog , completeProfile, className}) {
|
||||
|
||||
function Profile({children,sureFunc,showCompeleteDialog , completeProfile, className,checkIfLogin,showLoginDialog,checklogin}) {
|
||||
|
||||
function checkProfile() {
|
||||
if(checklogin){
|
||||
if(checkIfLogin()===false){
|
||||
showLoginDialog();
|
||||
return;
|
||||
}
|
||||
}
|
||||
if(!completeProfile){
|
||||
showCompeleteDialog && showCompeleteDialog();
|
||||
}else{
|
||||
|
|
|
@ -63,7 +63,6 @@ function IssueCommentList(props){
|
|||
}
|
||||
})
|
||||
}
|
||||
console.log('journals', journals);
|
||||
setJournals(journals);
|
||||
}
|
||||
})
|
||||
|
|
|
@ -48,7 +48,7 @@ function Datas({checkbox ,item , projectsId,owner}){
|
|||
</div>
|
||||
<div className="infos">
|
||||
<Link to={`/${item.author && item.author.login}`}><img src={`${getImageUrl(item.author && item.author.image_url)}`} alt="" /></Link>
|
||||
<span className="mr20"><Link to={`/${item.author && item.author.login}`}>{item.author && item.author.name}</Link></span>
|
||||
<span className="mr20"><Link style={{color:"#898d9d"}} to={`/${item.author && item.author.login}`}>{item.author && item.author.name}</Link></span>
|
||||
<span className="mr25">{item.created_at} 发布</span>
|
||||
<span className="mr50">{item.updated_at}更新</span>
|
||||
{item.milestone_name && <span style={{maxWidth:"120px"}} title={item.milestone_name} className="task-hide"><i className="iconfont icon-lichengbeiicon1 font-12 mr3"></i>{item.milestone_name}</span> }
|
||||
|
|
|
@ -7,8 +7,8 @@ const { Search } = Input;
|
|||
/**
|
||||
*
|
||||
* @param {placeholder} placeholder:默认显示内容(为空时)
|
||||
* @param {editFlag} editFlag:是否显示编辑按钮
|
||||
* @param {searchFlag} editFlag:是否显示搜索框
|
||||
* @param {editFlag} editFlag:是否有编辑权限
|
||||
* @param {searchFlag} searchFlag:是否显示搜索框
|
||||
* @param {selectValueList} selectValueList:将选中的list保存
|
||||
* @param {searchFunc} searchFunc:搜索方法
|
||||
* @param {onAdd} onAdd:标记管理
|
||||
|
@ -16,6 +16,8 @@ const { Search } = Input;
|
|||
* @param {menus} menus:下拉列表
|
||||
* @param {chooseFunc} chooseFunc:选择下拉列表
|
||||
* @param {double} double:undefined为单选,有值就是最多选的数量
|
||||
* @param {colorFlag} colorFlag:选中值需根据颜色显示背景
|
||||
* @param {mustFlag} mustFlag:必须选择一个
|
||||
* @returns
|
||||
*/
|
||||
function DropMenu({
|
||||
|
@ -27,7 +29,7 @@ function DropMenu({
|
|||
onAdd,
|
||||
headImg,
|
||||
menus,
|
||||
chooseFunc,double
|
||||
chooseFunc,double,colorFlag,mustFlag
|
||||
}){
|
||||
const [ visible , setVisible ] = useState(false);
|
||||
const [ searchValue , setSearchValue ]= useState(undefined);
|
||||
|
@ -47,16 +49,11 @@ function DropMenu({
|
|||
},[selectValueList])
|
||||
|
||||
function renderSelectList(list){
|
||||
console.log(list);
|
||||
let a = list.map((i,k)=>{
|
||||
return i.id.toString() || i.name
|
||||
})
|
||||
let n = list.map((i,k)=>{
|
||||
return i.name
|
||||
})
|
||||
console.log("根据选中的列表循环出id数组:",a);
|
||||
setValuesId(a);
|
||||
setValuesName(n);
|
||||
let a = list && list.length > 0 && list.map((i,k)=>{
|
||||
return i.id ? i.id.toString() : i.name
|
||||
})
|
||||
setValuesId(a);
|
||||
setValuesName(list);
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
|
@ -85,20 +82,39 @@ function DropMenu({
|
|||
let list = selectValueList;
|
||||
let re = [];
|
||||
re = list && list.length > 0 ? list:[];
|
||||
let filter = list.filter(j=>j.id === i.id);
|
||||
|
||||
let filter = [];
|
||||
if(i.id){
|
||||
filter = list.filter(j=>j.id === i.id);
|
||||
}else{
|
||||
filter = list.filter(j=>j.name === i.name);
|
||||
}
|
||||
if(filter && filter.length > 0){
|
||||
re = list.filter(j=>j.id !== i.id) ;
|
||||
if(!mustFlag){
|
||||
if(i.id){
|
||||
re = list.filter(j=>j.id !== i.id);
|
||||
}else{
|
||||
re = list.filter(j=>j.name !== i.name);
|
||||
}
|
||||
renderSelectList(re);
|
||||
chooseFunc(re);
|
||||
!double && setVisible(false);
|
||||
}else{
|
||||
setVisible(false);
|
||||
}
|
||||
}else{
|
||||
if(double && (selectValueList && selectValueList.length >= double)){
|
||||
message.info(`最多只能添加${double}个${placeholder}`);
|
||||
return;
|
||||
}
|
||||
re.push(i);
|
||||
if(double){
|
||||
re.push(i);
|
||||
}else{
|
||||
re = [i];
|
||||
setVisible(false);
|
||||
}
|
||||
renderSelectList(re);
|
||||
chooseFunc(re);
|
||||
}
|
||||
console.log("选择后:",re);
|
||||
renderSelectList(re);
|
||||
chooseFunc(re);
|
||||
}
|
||||
|
||||
function renderNames(nameArrs){
|
||||
|
@ -107,10 +123,13 @@ function DropMenu({
|
|||
nameArrs && nameArrs.length>0?
|
||||
nameArrs.map((i,k)=>{
|
||||
return(
|
||||
<p className="task-hide">{i}</p>
|
||||
<p style={{display:"flex",alignItems:"center"}}>
|
||||
{i.image_url && <img src={getImageUrl(i.image_url)} alt="" width="20px" height="20px" style={{borderRadius:"50%"}} className="mr5"/>}
|
||||
<span className={colorFlag ? "colorsquare task-hide":"task-hide"} style={{backgroundColor:colorFlag ?`${i.color}`:"#fff"}}>{i.name}</span>
|
||||
</p>
|
||||
)
|
||||
})
|
||||
:""
|
||||
:<span>{placeholder}</span>
|
||||
}
|
||||
</React.Fragment>
|
||||
}
|
||||
|
@ -159,12 +178,12 @@ function DropMenu({
|
|||
:
|
||||
<div className="menusEmpty">
|
||||
<p>{searchValue ? <span>暂无{placeholder}“{searchValue}”</span>: `暂无${placeholder}`}</p>
|
||||
{ onAdd && <a className="color-blue font-15" onClick={()=>{setVisible(false);onAdd()}}><i className="iconfont icon-a-bianji12 font-14 mr5"></i>标记管理</a>}
|
||||
</div>
|
||||
}
|
||||
{ onAdd && <div className="pl35 pr20 pb20"><a className="color-blue font-15" onClick={()=>{setVisible(false);onAdd()}}><i className="iconfont icon-a-bianji12 font-14 mr5"></i>标记管理</a></div>}
|
||||
</div>
|
||||
}>
|
||||
<div className={selectValueList && selectValueList.length > 0 ? "operatevalue color-grey-3":"operatevalue"}>{renderNames(valuesName) || placeholder}</div>
|
||||
<div className={selectValueList && selectValueList.length > 0 ? "operatevalue color-grey-3":"operatevalue"}>{renderNames(selectValueList)}</div>
|
||||
</Dropdown>
|
||||
</li>
|
||||
)
|
||||
|
|
|
@ -5,6 +5,7 @@ import { Link } from 'react-router-dom';
|
|||
import { Box , LongWidth } from '../../Component/layout';
|
||||
import RenderHtml from "../../../components/render-html";
|
||||
import EditMenus from '../Component/editMenus';
|
||||
import DropMenu from '../Component/dropMenu';
|
||||
import NewPanel from '../Component/newPanel';
|
||||
import Attachments from "../../Upload/attachment";
|
||||
import AddTagsBox from '../Component/addTagsBox';
|
||||
|
@ -51,7 +52,14 @@ function Details(props){
|
|||
const [ commentReload, setCommentReload] = useState(undefined);
|
||||
|
||||
const [ assigner_choose , setAssigner_choose ] = useState([]);
|
||||
const [ prioritie_choose , setPrioritie_choose ] = useState([]);
|
||||
const [ status_choose , setStatus_choose ] = useState([]);
|
||||
const [ tag_choose , setTag_choose ] = useState([]);
|
||||
const [ millstone_choose , setMillstone_choose ] = useState([]);
|
||||
const [ branch_choose , setBranch_choose ] = useState([]);
|
||||
const pathname = props.history.location.pathname;
|
||||
const permission = props && props.projectDetail && props.projectDetail.permission;
|
||||
let colors = ["#1abcb1","#28be6c","#db3d1d","#db3d1d"];
|
||||
|
||||
useEffect(()=>{
|
||||
if(pathname === `/${owner}/${projectsId}/issues/${index}/copy`){
|
||||
|
@ -77,25 +85,16 @@ function Details(props){
|
|||
setDetails(data);
|
||||
|
||||
setAssigner_choose(data.assigners);
|
||||
|
||||
let cIds = data.assigners && data.assigners.length>0 ? data.assigners.map((i)=>{return i.id.toString();}):undefined;
|
||||
let cNames = data.assigners && data.assigners.length>0 ? data.assigners.map((i)=>{return i.name.toString();}):undefined;
|
||||
setCharegeId(cIds);
|
||||
setStatusId([`${data.status && data.status.id}`]);
|
||||
setPrioritiesId([`${data.priority && data.priority.id}`]);
|
||||
let tags = data.tags && data.tags.length>0 ? data.tags.map((i)=>{return i.id.toString();}):undefined;
|
||||
let tagNames = data.tags && data.tags.length>0 ? data.tags.map((i)=>{return i.name.toString();}):undefined;
|
||||
setTagId(tags);
|
||||
setMillstoneId((data.milestone && data.milestone.id) ? [`${ data.milestone.id}`] :undefined)
|
||||
setBranchId(data.branch_name && [data.branch_name]);
|
||||
const n = {
|
||||
issue_priorities_name:data.priority ? [`${data.priority.name}`]:undefined,
|
||||
issue_tag_name:tagNames,
|
||||
milestone_name:data.milestone ? [`${data.milestone.name}`]:undefined,
|
||||
status_name:data.status ? [`${data.status.name}`]:undefined,
|
||||
assigner_name:cNames
|
||||
if(data.priority && data.priority.id){
|
||||
setPrioritie_choose([{...data.priority,color:colors[data.priority.id-1]}]);
|
||||
}else{
|
||||
setPrioritie_choose([]);
|
||||
}
|
||||
setNames(n);
|
||||
setStatus_choose(data.status && data.status.id ? [data.status]:[]);
|
||||
setTag_choose(data.tags);
|
||||
setMillstone_choose(data.milestone && data.milestone.id ? [data.milestone]:[]);
|
||||
setBranch_choose(data.branch_name ? [{name:data.branch_name}] : []);
|
||||
|
||||
data.start_date && setStartDate(moment(data.start_date).format('YYYY-MM-DD'));
|
||||
data.due_date && setDueDate(moment(data.due_date).format('YYYY-MM-DD'));
|
||||
|
||||
|
@ -143,19 +142,23 @@ function Details(props){
|
|||
axios.get(url).then(result=>{
|
||||
if(result && result.data){
|
||||
let priorities = result.data.priorities;
|
||||
let array =[];
|
||||
let colors = ["#1abcb1","#28be6c","#db3d1d","#db3d1d"];
|
||||
if(priorities && priorities.length>0){
|
||||
array = priorities.map((i,k)=>{
|
||||
let arr = {...i,color:colors[k]}
|
||||
return arr;
|
||||
})
|
||||
}
|
||||
let array = addColorForPriorities(priorities);
|
||||
setPrioritiesList(array);
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function addColorForPriorities(list){
|
||||
let array =[];
|
||||
if(list && list.length>0){
|
||||
array = list.map((i,k)=>{
|
||||
let arr = {...i,color:colors[k]}
|
||||
return arr;
|
||||
})
|
||||
}
|
||||
return array;
|
||||
}
|
||||
|
||||
// 获取负责人列表
|
||||
useEffect(()=>{
|
||||
getCharge();
|
||||
|
@ -334,7 +337,7 @@ function Details(props){
|
|||
/>
|
||||
</div>
|
||||
:
|
||||
<React.Fragment>
|
||||
<div className="editpanel">
|
||||
<div className="detailbanner">
|
||||
<div className="detailtitle">
|
||||
<div className="ilog">
|
||||
|
@ -375,27 +378,74 @@ function Details(props){
|
|||
: ""
|
||||
}
|
||||
</div>
|
||||
</React.Fragment>
|
||||
<CommentList {...props} reload = {commentReload} reloadComment = {()=>{setCommentReload(Math.random())}}/>
|
||||
</div>
|
||||
}
|
||||
<CommentList {...props} reload = {commentReload} reloadComment = {()=>{setCommentReload(Math.random())}}/>
|
||||
</LongWidth>
|
||||
<div className="shortwidth mt25">
|
||||
{/* <DropMenu
|
||||
<DropMenu
|
||||
placeholder="负责人"
|
||||
menus={chargeList}
|
||||
searchFunc={(value)=>{setCharge(value)}}
|
||||
headImg
|
||||
selectValueList={assigner_choose}
|
||||
chooseFunc={(list)=>{setAssigner_choose(list)}}
|
||||
editFlag={details && !details.user_permission}
|
||||
chooseFunc={(list)=>{setAssigner_choose(list);let l = list && list.length>0 ?list.map(i=>{return i.id || i.name}):[];saveForeach(l);}}
|
||||
double={5}
|
||||
/> */}
|
||||
/>
|
||||
|
||||
<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}/>
|
||||
{/* <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}/> */}
|
||||
|
||||
<DropMenu
|
||||
placeholder="状态"
|
||||
menus={statusList}
|
||||
selectValueList={status_choose}
|
||||
mustFlag
|
||||
editFlag={details && !details.user_permission}
|
||||
chooseFunc={(list)=>{setStatus_choose(list);let l = list && list.length>0 ?list.map(i=>{return i.id || i.name}):[];saveForeach(undefined,l);}}
|
||||
/>
|
||||
|
||||
<DropMenu
|
||||
placeholder="优先级"
|
||||
menus={prioritiesList}
|
||||
selectValueList={prioritie_choose}
|
||||
colorFlag
|
||||
mustFlag
|
||||
editFlag={details && !details.user_permission}
|
||||
chooseFunc={(list)=>{setPrioritie_choose(list);let l = list && list.length>0 ?list.map(i=>{return i.id || i.name}):[];saveForeach(undefined,undefined,l);}}
|
||||
/>
|
||||
{/* <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}/> */}
|
||||
|
||||
<DropMenu
|
||||
placeholder="标记"
|
||||
menus={tagList}
|
||||
searchFunc={(value)=>{setCharge(value)}}
|
||||
selectValueList={tag_choose}
|
||||
chooseFunc={(list)=>{setTag_choose(list);let l = list && list.length>0 ?list.map(i=>{return i.id || i.name}):[];saveForeach(undefined,undefined,undefined,l);}}
|
||||
double={3}
|
||||
editFlag={details && !details.user_permission}
|
||||
onAdd={permission && permission !== "Reporter" ? ()=>setVisible(true) :false}
|
||||
/>
|
||||
{/* <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}/> */}
|
||||
|
||||
<DropMenu
|
||||
placeholder="里程碑"
|
||||
menus={millstoneList}
|
||||
searchFunc={(value)=>{setCharge(value)}}
|
||||
selectValueList={millstone_choose}
|
||||
chooseFunc={(list)=>{setMillstone_choose(list);let l = list && list.length>0 ?list.map(i=>{return i.id || i.name}):[];saveForeach(undefined,undefined,undefined,undefined,l);}}
|
||||
/>
|
||||
<DropMenu
|
||||
placeholder="关联分支"
|
||||
menus={branchList}
|
||||
searchFunc={(value)=>{setCharge(value)}}
|
||||
selectValueList={branch_choose}
|
||||
editFlag={details && !details.user_permission}
|
||||
chooseFunc={(list)=>{setBranch_choose(list);let l = list && list.length>0 ?list.map(i=>{return i.id || i.name}):[];saveForeach(undefined,undefined,undefined,undefined,undefined,l);}}
|
||||
/>
|
||||
{/* <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>
|
||||
|
|
|
@ -5,7 +5,7 @@ import issueEmp from '../Img/issue-big.png';
|
|||
import create from '../Img/create.png';
|
||||
import { Link } from "react-router-dom";
|
||||
import AllMenus from '../Component/allMenus';
|
||||
import CheckProfile from '../../Component/ProfileModal/Profile'
|
||||
import CheckProfile from '../../Component/ProfileModal/Profile';
|
||||
import Datas from '../Component/datas';
|
||||
import DelBox from '../Component/delBox';
|
||||
import axios from 'axios';
|
||||
|
@ -188,6 +188,7 @@ function List(props){
|
|||
status_id: updateIds && updateIds.status_id
|
||||
}).then(result=>{
|
||||
if(result){
|
||||
setUpdateIds(undefined);
|
||||
setAllValue([]);
|
||||
setTotal(undefined);
|
||||
Init();
|
||||
|
@ -248,6 +249,12 @@ function List(props){
|
|||
}
|
||||
props.history.push(`/${owner}/${projectsId}/issues/new`);
|
||||
}
|
||||
|
||||
function changeCategory(value){
|
||||
setCategory(value);
|
||||
setPage(1);
|
||||
setTotal(undefined);
|
||||
}
|
||||
|
||||
return(
|
||||
<div>
|
||||
|
@ -276,24 +283,24 @@ function List(props){
|
|||
</div>
|
||||
<div>
|
||||
{
|
||||
permission && permission !== "reporter" &&
|
||||
permission && permission !== "Reporter" &&
|
||||
<Link to={`/${owner}/${projectsId}/issues/sign`} className="dorpdownButton"><img src={bj} alt="" className="mr5" />标记管理</Link>
|
||||
}
|
||||
<CheckProfile {...props} sureFunc={()=>{props.history.push(`/${owner}/${projectsId}/issues/new`)}} className="operateButton ml20">创建疑修</CheckProfile>
|
||||
<CheckProfile {...props} sureFunc={()=>{props.history.push(`/${owner}/${projectsId}/issues/new`)}} checklogin className="operateButton ml20">创建疑修</CheckProfile>
|
||||
</div>
|
||||
</div>
|
||||
<div className="lists">
|
||||
<div className="listheader">
|
||||
<div style={{display:"flex"}}>
|
||||
<Checkbox value="all" style={{marginRight: "16px",display: (permission && permission !== "reporter") ?"block":"none"}} checked={checkAll} onChange={chooseAll}></Checkbox>
|
||||
<Checkbox value="all" style={{marginRight: "16px",display: (permission && permission !== "Reporter") ?"block":"none"}} checked={checkAll} onChange={chooseAll}></Checkbox>
|
||||
{
|
||||
allValue && allValue.length>0 ?
|
||||
<span>选择{allValue.length}个issue</span>
|
||||
:
|
||||
<ul className="statusul">
|
||||
<li className={category === "all" ?"active":""} onClick={()=>{setCategory("all");setPage(1)}}>全部<span>{issueTotal}</span></li>
|
||||
<li className={category === "opened" ?"active":""} onClick={()=>{setCategory("opened");setPage(1)}}>开启中<span>{openedCount}</span></li>
|
||||
<li className={category === "closed" ?"active":""} onClick={()=>{setCategory("closed");setPage(1)}}>已关闭<span>{closedCount}</span></li>
|
||||
<li className={category === "all" ?"active":""} onClick={()=>{changeCategory("all")}}>全部<span>{issueTotal}</span></li>
|
||||
<li className={category === "opened" ?"active":""} onClick={()=>{changeCategory("opened")}}>开启中<span>{openedCount}</span></li>
|
||||
<li className={category === "closed" ?"active":""} onClick={()=>{changeCategory("closed")}}>已关闭<span>{closedCount}</span></li>
|
||||
</ul>
|
||||
}
|
||||
</div>
|
||||
|
@ -324,7 +331,7 @@ function List(props){
|
|||
<div className="listempty">
|
||||
<img src={issueEmp} alt="" width="68px" />
|
||||
<p className="font-22 mt5 mb10">欢迎使用疑修(Issue)</p>
|
||||
<p className="font-15">疑修用于记录与跟踪待办事项、项目bug、功能需求等。在使用之前,请您先<CheckProfile {...props} sureFunc={()=>{props.history.push(`/${owner}/${projectsId}/issues/new`)}} className="color-blue">创建一个疑修</CheckProfile></p>
|
||||
<p className="font-15">疑修用于记录与跟踪待办事项、项目bug、功能需求等。在使用之前,请您先<CheckProfile {...props} checklogin sureFunc={()=>{props.history.push(`/${owner}/${projectsId}/issues/new`)}} className="color-blue">创建一个疑修</CheckProfile></p>
|
||||
</div>
|
||||
:
|
||||
<div className="dataempty"><img src={emp} alt="" /></div>
|
||||
|
@ -339,7 +346,7 @@ function List(props){
|
|||
return(
|
||||
<Datas
|
||||
key={key}
|
||||
checkbox={(permission && permission !== "reporter") && <Checkbox value={item.id} key={item.id} style={{marginRight: "16px"}}></Checkbox> }
|
||||
checkbox={(permission && permission !== "Reporter") && <Checkbox value={item.id} key={item.id} style={{marginRight: "16px"}}></Checkbox> }
|
||||
item={item}
|
||||
owner={owner}
|
||||
projectsId={projectsId}
|
||||
|
|
|
@ -2,6 +2,7 @@ import React , { useEffect , useState , forwardRef } from 'react';
|
|||
import { Form } from 'antd';
|
||||
import { Box , LongWidth } from '../../Component/layout';
|
||||
import EditMenus from '../Component/editMenus';
|
||||
import DropMenu from '../Component/dropMenu';
|
||||
import AddTagsBox from '../Component/addTagsBox';
|
||||
import Date from '../Component/date';
|
||||
import NewPanel from '../Component/newPanel';
|
||||
|
@ -25,13 +26,13 @@ function New(props){
|
|||
const [ branchList , setBranchList ] = useState(undefined);
|
||||
const [ branch , setBranch ] = useState(undefined);
|
||||
|
||||
const [ charegeId , setCharegeId ] = useState([]);
|
||||
const [ statusId , setStatusId ] = useState([`1`]);
|
||||
const [ names , setNames ] = useState({author_name:undefined,issue_priorities_name:["正常"],issue_tag_name:undefined,milestone_name:undefined,sortby_name:undefined,status_name:['新增'],assigner_name:undefined});
|
||||
const [ prioritiesId , setPrioritiesId ] = useState([`2`]);
|
||||
const [ tagId , setTagId ] = useState([]);
|
||||
const [ millstoneId , setMillstoneId ] = useState([]);
|
||||
const [ branchId , setBranchId ] = useState([]);
|
||||
|
||||
const [ assigner_choose , setAssigner_choose ] = useState([]);
|
||||
const [ prioritie_choose , setPrioritie_choose ] = useState([]);
|
||||
const [ status_choose , setStatus_choose ] = useState([]);
|
||||
const [ tag_choose , setTag_choose ] = useState([]);
|
||||
const [ millstone_choose , setMillstone_choose ] = useState([]);
|
||||
const [ branch_choose , setBranch_choose ] = useState([]);
|
||||
|
||||
const [ start_date, setStartDate ] = useState("");//moment().format('YYYY-MM-DD')
|
||||
const [ due_date, setDueDate ] = useState("");
|
||||
|
@ -58,7 +59,11 @@ function New(props){
|
|||
const url = `/v1/${owner}/${projectsId}/issue_statues`;
|
||||
axios.get(url).then(result=>{
|
||||
if(result && result.data){
|
||||
setStatusList(result.data.statues);
|
||||
let status = result.data.statues;
|
||||
setStatusList(status);
|
||||
if(status && status.length>0){
|
||||
setStatus_choose(status.filter(i=>i.id === 1));
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
@ -81,6 +86,7 @@ function New(props){
|
|||
})
|
||||
}
|
||||
setPrioritiesList(array);
|
||||
setPrioritie_choose(array.filter(i=>i.id === 2));
|
||||
}
|
||||
})
|
||||
}
|
||||
|
@ -154,14 +160,20 @@ function New(props){
|
|||
function createFunc(values,fileList,receivers_login,description){
|
||||
const { subject } = values;
|
||||
const url = `/v1/${owner}/${projectsId}/issues`;
|
||||
let b = branch_choose && branch_choose.length>0 ? branch_choose.map(i=>{return i.name}) :undefined;
|
||||
let t = tag_choose && tag_choose.length>0 ? tag_choose.map(i=>{return i.id}) :undefined;
|
||||
let a = assigner_choose && assigner_choose.length>0 ? assigner_choose.map(i=>{return i.id}) :undefined;
|
||||
let m = millstone_choose && millstone_choose.length>0 ? millstone_choose.map(i=>{return i.id}) :undefined;
|
||||
let p = prioritie_choose && prioritie_choose.length>0 ? prioritie_choose.map(i=>{return i.id}) :undefined;
|
||||
let s = status_choose && status_choose.length>0 ? status_choose.map(i=>{return i.id}) :undefined;
|
||||
axios.post(url,{
|
||||
description,subject,
|
||||
branch_name:branchId.join(","),
|
||||
status_id:statusId.join(","),
|
||||
priority_id:prioritiesId.join(","),
|
||||
milestone_id:millstoneId.join(","),
|
||||
issue_tag_ids:tagId,
|
||||
assigner_ids:charegeId,
|
||||
branch_name:b.join(","),
|
||||
status_id:s.join(","),
|
||||
priority_id:p.join(","),
|
||||
milestone_id:m.join(","),
|
||||
issue_tag_ids:t,
|
||||
assigner_ids:a,
|
||||
attachment_ids:fileList,
|
||||
start_date,due_date,receivers_login
|
||||
}).then(result=>{
|
||||
|
@ -173,10 +185,6 @@ function New(props){
|
|||
}
|
||||
|
||||
|
||||
function onAdd(){
|
||||
setVisible(true);
|
||||
}
|
||||
|
||||
return(
|
||||
<div>
|
||||
<AddTagsBox
|
||||
|
@ -185,19 +193,61 @@ function New(props){
|
|||
visible={visible}
|
||||
onCancel={()=>setVisible(false)} onSuccess={onSuccess}
|
||||
/>
|
||||
<p className="font-20 color-grey-3 mt20 mb15">新建疑修</p>
|
||||
<p className="font-17 color-grey-3 mt20 mb15">新建疑修</p>
|
||||
<Box>
|
||||
<LongWidth>
|
||||
<NewPanel {...props} createFunc={createFunc}
|
||||
owner = {owner} projectsId = {projectsId}/>
|
||||
</LongWidth>
|
||||
<div className="shortwidth">
|
||||
<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="标记" 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)}/>
|
||||
<DropMenu
|
||||
placeholder="负责人"
|
||||
menus={chargeList}
|
||||
searchFunc={(value)=>{setCharge(value)}}
|
||||
headImg
|
||||
selectValueList={assigner_choose}
|
||||
chooseFunc={(list)=>{setAssigner_choose(list);}}
|
||||
double={5}
|
||||
/>
|
||||
<DropMenu
|
||||
placeholder="状态"
|
||||
menus={statusList}
|
||||
selectValueList={status_choose}
|
||||
mustFlag
|
||||
editFlag={false}
|
||||
chooseFunc={(list)=>{setStatus_choose(list);}}
|
||||
/>
|
||||
<DropMenu
|
||||
placeholder="优先级"
|
||||
menus={prioritiesList}
|
||||
selectValueList={prioritie_choose}
|
||||
colorFlag
|
||||
mustFlag
|
||||
chooseFunc={(list)=>{setPrioritie_choose(list);}}
|
||||
/>
|
||||
<DropMenu
|
||||
placeholder="标记"
|
||||
menus={tagList}
|
||||
searchFunc={(value)=>{setCharge(value)}}
|
||||
selectValueList={tag_choose}
|
||||
chooseFunc={(list)=>{setTag_choose(list);}}
|
||||
double={3}
|
||||
onAdd={permission && permission !== "Reporter" ? ()=>setVisible(true) :false}
|
||||
/>
|
||||
<DropMenu
|
||||
placeholder="里程碑"
|
||||
menus={millstoneList}
|
||||
searchFunc={(value)=>{setCharge(value)}}
|
||||
selectValueList={millstone_choose}
|
||||
chooseFunc={(list)=>{setMillstone_choose(list);}}
|
||||
/>
|
||||
<DropMenu
|
||||
placeholder="关联分支"
|
||||
menus={branchList}
|
||||
searchFunc={(value)=>{setCharge(value)}}
|
||||
selectValueList={branch_choose}
|
||||
chooseFunc={(list)=>{setBranch_choose(list);}}
|
||||
/>
|
||||
<Date name="开始日期" today={start_date} setDate={(date)=>setStartDate(date)}/>
|
||||
<Date name="结束日期" today={due_date} setDate={(date)=>setDueDate(date)}/>
|
||||
</div>
|
||||
|
|
|
@ -27,6 +27,14 @@ function Sign(props){
|
|||
const owner = props.match.params.owner;
|
||||
const projectsId = props.match.params.projectsId;
|
||||
const { projectDetail } = props;
|
||||
const permission = projectDetail && props.projectDetail.permission;
|
||||
|
||||
|
||||
useEffect(()=>{
|
||||
if(!permission || (permission && permission === "Reporter")){
|
||||
window.location.href = "/403";
|
||||
}
|
||||
},[permission])
|
||||
|
||||
useEffect(()=>{
|
||||
if(projectDetail){
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
height:32px;
|
||||
color: #fff!important;
|
||||
cursor: pointer;
|
||||
line-height: 32px;
|
||||
line-height: 30px;
|
||||
background-color:rgba(70, 106, 255, 1);
|
||||
border:1px solid rgba(70, 106, 255, 1);
|
||||
border-radius: 4px;
|
||||
|
@ -159,8 +159,8 @@
|
|||
align-items: center;
|
||||
cursor: pointer;
|
||||
&.active{
|
||||
color: #333;
|
||||
font-weight: 500;
|
||||
color: #466aff;
|
||||
// font-weight: 500;
|
||||
&>span{
|
||||
font-weight: normal;
|
||||
color: #466aff;
|
||||
|
@ -211,10 +211,15 @@
|
|||
.idetails{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
&>p{
|
||||
&>a{
|
||||
color: #40424a;
|
||||
margin-right: 10px;
|
||||
font-size: 16px;
|
||||
display: block;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
max-width: 600px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
}
|
||||
.infos{
|
||||
|
@ -291,7 +296,7 @@
|
|||
background-color:#28be6c;
|
||||
}
|
||||
&.hight{
|
||||
background-color: #db7c1d;
|
||||
background-color: #db3d1d;
|
||||
}
|
||||
&.urgent{
|
||||
background-color: #db3d1d;
|
||||
|
@ -437,6 +442,14 @@
|
|||
line-height: 24px;
|
||||
color: #acb0bf;
|
||||
margin-top: 10px;
|
||||
.colorsquare{
|
||||
width: 45px;
|
||||
height: 20px;
|
||||
line-height: 20px;
|
||||
border-radius: 4px;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -509,8 +522,8 @@
|
|||
padding:12px 20px 0px 16px;
|
||||
}
|
||||
.ant-menu{
|
||||
padding:12px 16px 10px 16px;
|
||||
max-height: 338px;
|
||||
padding:10px 16px 10px 16px;
|
||||
max-height: 324px;
|
||||
overflow-y: auto;
|
||||
li{
|
||||
padding:0px 16px;
|
||||
|
@ -536,13 +549,19 @@
|
|||
}
|
||||
}
|
||||
//详情页面
|
||||
.detailbanner{
|
||||
.editpanel{
|
||||
padding:20px;
|
||||
margin-top: 25px;
|
||||
// height:82px;
|
||||
background-color:#fafcff;
|
||||
border:1px solid rgba(42, 97, 255, 0.23);
|
||||
border-radius:4px;
|
||||
padding:12px 25px 12px 20px;
|
||||
border-radius: 2px;
|
||||
}
|
||||
.detailbanner{
|
||||
// margin-top: 25px;
|
||||
// height:82px;
|
||||
// background-color:#fafcff;
|
||||
// border:1px solid rgba(42, 97, 255, 0.23);
|
||||
// border-radius:4px;
|
||||
// padding:12px 25px 12px 20px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
|
@ -572,11 +591,11 @@
|
|||
}
|
||||
}
|
||||
.descPanel{
|
||||
margin-top:20px;
|
||||
padding:20px;
|
||||
margin-top:30px;
|
||||
// padding:20px;
|
||||
// background-color: #f7f8fd;
|
||||
border:1px solid #c9d8ff;
|
||||
border-radius: 2px;
|
||||
// border:1px solid #c9d8ff;
|
||||
// border-radius: 2px;
|
||||
}
|
||||
// 新建页面
|
||||
.explain{
|
||||
|
|
|
@ -476,7 +476,7 @@ function CoderDepot(props){
|
|||
}
|
||||
{
|
||||
issuesFlag &&
|
||||
<a onClick={createIssue}>+ 疑修</a>
|
||||
<CheckProfile {...props} sureFunc={createIssue}>+ 疑修</CheckProfile>
|
||||
}
|
||||
|
||||
</div>
|
||||
|
|
|
@ -6,6 +6,7 @@ import AllMenus from './component/allMenus';
|
|||
import Datas from '../Issues/Component/datas';
|
||||
import axios from 'axios';
|
||||
import { FlexAJ } from '../Component/layout';
|
||||
import CheckProfile from '../Component/ProfileModal/Profile';
|
||||
import './milepost.scss';
|
||||
import './order.scss';
|
||||
import '../Issues/index.scss';
|
||||
|
@ -184,11 +185,12 @@ function MilepostDetail(props){
|
|||
<Link to={`/${owner}/${projectsId}/milestones/${mileId}/edit`} className="grayButton" style={{ marginRight: 15 }}><i className="iconfont icon-lichengbeiicon1 font-12 mr5"></i>编辑里程碑</Link>
|
||||
:""
|
||||
}
|
||||
{
|
||||
{/* {
|
||||
current_user && current_user.login ?
|
||||
<Button type='primary' onClick={() => {history.push(`/${owner}/${projectsId}/issues/${mileId}/new`)}} className='createMilepostBtn' style={{width: '83px'}}>+ 创建疑修</Button>
|
||||
:<Button type='primary' onClick={showLoginDialog} className='createMilepostBtn' style={{width: '83px'}}>+ 创建疑修</Button>
|
||||
}
|
||||
} */}
|
||||
<CheckProfile {...props} sureFunc={()=>{history.push(`/${owner}/${projectsId}/issues/${mileId}/new`)}} checklogin className="operateButton ml20">+ 创建疑修</CheckProfile>
|
||||
</div>
|
||||
</FlexAJ>}
|
||||
<div className="lists mt25">
|
||||
|
|
|
@ -4,6 +4,9 @@ ul,ol,dl{
|
|||
.markdown-body{
|
||||
overflow: inherit;
|
||||
}
|
||||
.markdown-body .editormd-tex .katex-display>.katex{
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
.markdown-body a{
|
||||
color: #466AFF;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue