forked from Gitlink/forgeplus-react
标记管理
This commit is contained in:
parent
6ce554df87
commit
ce8c22959a
|
|
@ -19,7 +19,6 @@ function AddTagsBox({visible,onCancel, onSuccess , form ,owner , projectsId}){
|
|||
|
||||
function getColor(colors){
|
||||
setColors(colors);
|
||||
console.log(colors);
|
||||
}
|
||||
|
||||
return(
|
||||
|
|
|
|||
|
|
@ -1,22 +1,27 @@
|
|||
import React,{ useState } from 'react';
|
||||
import React,{ useState , useEffect } from 'react';
|
||||
import { SketchPicker } from 'react-color';
|
||||
|
||||
function ColorCard({getColor}){
|
||||
function ColorCard({getColor,defaultColor}){
|
||||
const [ displayColorPicker , setDisplayColorPicker ] = useState(false);
|
||||
const [ color , setColor ] = useState({r: '241',g: '112',b: '19',a: '1',});
|
||||
const [ textcolor , setTextColor ] = useState("#F17013");
|
||||
|
||||
useEffect(()=>{
|
||||
console.log(defaultColor);
|
||||
defaultColor && setTextColor(defaultColor);
|
||||
},[defaultColor])
|
||||
|
||||
// 切换色卡
|
||||
function handleChange(color){
|
||||
setColor(color.rgb);
|
||||
setTextColor(color.hex);
|
||||
getColor(color);
|
||||
getColor(color ? color.hex : defaultColor);
|
||||
}
|
||||
|
||||
// 隐藏色卡
|
||||
function handleClick(){
|
||||
setDisplayColorPicker(!displayColorPicker);
|
||||
reduction();
|
||||
// reduction();
|
||||
}
|
||||
|
||||
// 还原色卡
|
||||
|
|
@ -27,7 +32,7 @@ function ColorCard({getColor}){
|
|||
return(
|
||||
<div>
|
||||
<div className="swatch" onClick={handleClick}>
|
||||
<div className="color" style={{backgroundColor:`rgba(${color.r}, ${color.g}, ${color.b}, ${color.a})`}}></div>
|
||||
<div className="color" style={{backgroundColor:`${textcolor}`}}></div>
|
||||
<p style={{ paddingLeft: 5 }}>{textcolor}</p>
|
||||
</div>
|
||||
{displayColorPicker ? (
|
||||
|
|
|
|||
|
|
@ -23,7 +23,6 @@ function Datas({checkbox ,item , projectsId,owner}){
|
|||
}
|
||||
|
||||
return(
|
||||
<div className="listdatas">
|
||||
<div>
|
||||
<div className="issuedetail">
|
||||
{checkbox}
|
||||
|
|
@ -52,14 +51,14 @@ function Datas({checkbox ,item , projectsId,owner}){
|
|||
<span className="mr20"><Link 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><i className="iconfont icon-lichengbeiicon1 font-12 mr3"></i>{item.milestone_name}</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> }
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="issuecondition">
|
||||
{
|
||||
item.assigners && item.assigners.length > 0 ?
|
||||
<div className="principal">
|
||||
<div className={item.assigners.length > 1 ?"principal hovers":"principal"}>
|
||||
{
|
||||
item.assigners.map((i,k)=>{
|
||||
return(
|
||||
|
|
@ -75,105 +74,6 @@ function Datas({checkbox ,item , projectsId,owner}){
|
|||
<div className="commentnum"><i className="iconfont icon-a-xiaoxi1 mr5 font-15"></i>{item.comment_journals_count}</div>
|
||||
</div>
|
||||
</div>
|
||||
{/* <div>
|
||||
<div className="issuedetail">
|
||||
<Checkbox style={{marginRight: "16px"}} value={1}></Checkbox>
|
||||
<div className="ilog">
|
||||
<span className="status urgent">紧急</span>
|
||||
<span className="number">#2</span>
|
||||
</div>
|
||||
<div style={{marginTop:"-2px"}}>
|
||||
<div className="idetails">
|
||||
<img src={issue} alt="" width="16px" className="mr5" />
|
||||
<p>如何参与到项目的开发,提升技术能力?</p>
|
||||
<Tooltip title="点击复制链接" placement="bottom"><span style={{color: "#009a43"}}><i className="iconfont icon-biaoji mr3 font-12"></i>test</span></Tooltip>
|
||||
</div>
|
||||
<div className="infos">
|
||||
<img src={"https://testforgeplus.trustie.net/images/avatars/User/36480?t=1672730523"} alt="" />
|
||||
<span className="mr20">张嘉佳</span>
|
||||
<span className="mr25">2022/11/25 15:25 发布</span>
|
||||
<span className="mr50">2022/11/29 15:25更新</span>
|
||||
<span><i className="iconfont icon-lichengbeiicon1 font-12 mr2"></i>里程碑名称标题</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="issuecondition">
|
||||
<div className="principal">
|
||||
<img style={{right:`${4*20}px`,zIndex:1}} src={"https://testforgeplus.trustie.net/images/avatars/User/36480?t=1672730523"} alt="" />
|
||||
<img style={{right:`${3*20}px`,zIndex:2}} src={"https://testforgeplus.trustie.net/images/avatars/User/36480?t=1672730523"} alt="" />
|
||||
<img style={{right:`${2*20}px`,zIndex:3}} src={"https://testforgeplus.trustie.net/images/avatars/User/36480?t=1672730523"} alt="" />
|
||||
<img style={{right:`${1*20}px`,zIndex:4}} src={"https://testforgeplus.trustie.net/images/avatars/User/36480?t=1672730523"} alt="" />
|
||||
<img style={{right:`${0*20}px`,zIndex:5}} src={"https://testforgeplus.trustie.net/images/avatars/User/36480?t=1672730523"} alt="" />
|
||||
</div>
|
||||
<div>拒绝</div>
|
||||
<div className="commentnum"><i className="iconfont icon-a-xiaoxi1 mr5 font-15"></i>10</div>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div className="issuedetail">
|
||||
<Checkbox style={{marginRight: "16px"}} value={2}></Checkbox>
|
||||
<div className="ilog">
|
||||
<span className="status hight">高</span>
|
||||
<span className="number">#3</span>
|
||||
</div>
|
||||
<div style={{marginTop:"-2px"}}>
|
||||
<div className="idetails">
|
||||
<img src={issue} alt="" width="16px" className="mr5" />
|
||||
<Link to={``}>如何参与到项目的开发,提升技术能力?</Link>
|
||||
<Tooltip title="点击复制链接" placement="bottom"><span style={{color: "#c1a30d"}}><i className="iconfont icon-biaoji mr3 font-12"></i>feature</span></Tooltip>
|
||||
</div>
|
||||
<div className="infos">
|
||||
<img src={"https://testforgeplus.trustie.net/images/avatars/User/36480?t=1672730523"} alt="" />
|
||||
<span className="mr20">张嘉佳</span>
|
||||
<span className="mr25">2022/11/25 15:25 发布</span>
|
||||
<span className="mr50">2022/11/29 15:25更新</span>
|
||||
<span><i className="iconfont icon-lichengbeiicon1 font-12 mr2"></i>里程碑名称标题</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="issuecondition">
|
||||
<div className="principal">
|
||||
<img style={{right:`${2*20}px`,zIndex:3}} src={"https://testforgeplus.trustie.net/images/avatars/User/36480?t=1672730523"} alt="" />
|
||||
<img style={{right:`${1*20}px`,zIndex:4}} src={"https://testforgeplus.trustie.net/images/avatars/User/36480?t=1672730523"} alt="" />
|
||||
<img style={{right:`${0*20}px`,zIndex:5}} src={"https://testforgeplus.trustie.net/images/avatars/User/36480?t=1672730523"} alt="" />
|
||||
</div>
|
||||
<div>反馈</div>
|
||||
<div className="commentnum"><i className="iconfont icon-a-xiaoxi1 mr5 font-15"></i>10</div>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div className="issuedetail">
|
||||
<Checkbox style={{marginRight: "16px"}} value={3}></Checkbox>
|
||||
<div className="ilog">
|
||||
<span className="status low">低</span>
|
||||
<span className="number">#3</span>
|
||||
</div>
|
||||
<div style={{marginTop:"-2px"}}>
|
||||
<div className="idetails">
|
||||
<img src={issue} alt="" width="16px" className="mr5" />
|
||||
<p>如何参与到项目的开发,提升技术能力?</p>
|
||||
<Tooltip title="点击复制链接" placement="bottom"><span style={{color: "#c1a30d"}}><i className="iconfont icon-biaoji mr3 font-12"></i>feature</span></Tooltip>
|
||||
</div>
|
||||
<div className="infos">
|
||||
<img src={"https://testforgeplus.trustie.net/images/avatars/User/36480?t=1672730523"} alt="" />
|
||||
<span className="mr20">张嘉佳</span>
|
||||
<span className="mr25">2022/11/25 15:25 发布</span>
|
||||
<span className="mr50">2022/11/29 15:25更新</span>
|
||||
<span><i className="iconfont icon-lichengbeiicon1 font-12 mr2"></i>里程碑名称标题</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="issuecondition">
|
||||
<div className="principal">
|
||||
<img style={{right:`${2*20}px`,zIndex:3}} src={"https://testforgeplus.trustie.net/images/avatars/User/36480?t=1672730523"} alt="" />
|
||||
<img style={{right:`${1*20}px`,zIndex:4}} src={"https://testforgeplus.trustie.net/images/avatars/User/36480?t=1672730523"} alt="" />
|
||||
<img style={{right:`${0*20}px`,zIndex:5}} src={"https://testforgeplus.trustie.net/images/avatars/User/36480?t=1672730523"} alt="" />
|
||||
</div>
|
||||
<div>反馈</div>
|
||||
<div className="commentnum"><i className="iconfont icon-a-xiaoxi1 mr5 font-15"></i>10</div>
|
||||
</div>
|
||||
</div> */}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
export default Datas;
|
||||
|
|
@ -82,7 +82,6 @@ function EditMenus({
|
|||
return;
|
||||
}
|
||||
l.push(idStr);
|
||||
console.log(valueId,l,idStr);
|
||||
nameArr.push(i.name);
|
||||
}
|
||||
setValueId(l);
|
||||
|
|
@ -140,7 +139,7 @@ function EditMenus({
|
|||
<Menu.Item key={i.id || i.name} onClick={()=>chooseMenu(i)}>
|
||||
{ imgFlag && <img src={getImageUrl(i.image_url)} alt="" width="22px" className="mr5 radius"/>}
|
||||
{i.color && <span style={{backgroundColor:i.color}} className="colorpiece"></span>}
|
||||
{i.name}
|
||||
<span className="task-hide">{i.name}</span>
|
||||
</Menu.Item>
|
||||
)
|
||||
})
|
||||
|
|
|
|||
|
|
@ -24,7 +24,6 @@ function Menus({name, ids , lists , size , imgControl , searchFunc , chooseFunc
|
|||
useEffect(()=>{
|
||||
setChooseValue(ids);
|
||||
setShowValue(names);
|
||||
console.log(names);
|
||||
},[ids,names])
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -33,7 +33,6 @@ function NewPanel(props,ref){
|
|||
let arr = files.map(i=>{return i.id});
|
||||
list = arr && arr.length>0 ? f.concat(arr) : f ;
|
||||
}
|
||||
console.log(list);
|
||||
setFileList(list);
|
||||
};
|
||||
function changeAtWhoLoginList(loginList){
|
||||
|
|
@ -100,7 +99,7 @@ function NewPanel(props,ref){
|
|||
}
|
||||
</div>
|
||||
<div style={{display:"flex"}}>
|
||||
<Button type="primary" className="operateButton" style={{width:"100px"}} onClick={sureFunc}>创建</Button>
|
||||
<Button type="primary" className="operateButton" style={{width:"100px"}} onClick={sureFunc}>{ title ? "保存" :"创建"}</Button>
|
||||
<Button className="ml30" style={{width:"100px"}} onClick={cancelFunc}>取消</Button>
|
||||
</div>
|
||||
</React.Fragment>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import React , { useEffect , useState , forwardRef } from 'react';
|
||||
import { Spin , Form } from 'antd';
|
||||
import { getImageUrl } from 'educoder';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { Box , LongWidth } from '../../Component/layout';
|
||||
import RenderHtml from "../../../components/render-html";
|
||||
import EditMenus from '../Component/editMenus';
|
||||
|
|
@ -43,9 +44,21 @@ function Details(props){
|
|||
const [ visible , setVisible ] = useState(false);
|
||||
const [ delVisible , setDelVisible] = useState(false);
|
||||
const [ edit , setEdit] = useState(false);
|
||||
const [ copy , setCopy] = useState(false);
|
||||
|
||||
const [ start_date, setStartDate ] = useState("");
|
||||
const [ due_date, setDueDate ] = useState("");
|
||||
const pathname = props.history.location.pathname;
|
||||
|
||||
useEffect(()=>{
|
||||
if(pathname === `/${owner}/${projectsId}/issues/${index}/copy`){
|
||||
setEdit(true);
|
||||
setCopy(true);
|
||||
}else{
|
||||
setEdit(false);
|
||||
setCopy(false);
|
||||
}
|
||||
},[pathname])
|
||||
|
||||
useEffect(()=>{
|
||||
if(index){
|
||||
|
|
@ -67,7 +80,7 @@ function Details(props){
|
|||
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}`])
|
||||
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,
|
||||
|
|
@ -184,20 +197,23 @@ function Details(props){
|
|||
setVisible(false);
|
||||
}
|
||||
|
||||
// 可单个编辑保存右侧的项(!copy:非复制状态下)
|
||||
function saveForeach(c,s,p,t,m,b,sDate,eDate){
|
||||
const url = `/v1/${owner}/${projectsId}/issues/${index}`;
|
||||
axios.patch(url,{
|
||||
branch_name: b ? b.join(",") :undefined,
|
||||
status_id: s ? s.join(",") : undefined,
|
||||
priority_id: p ? p.join(",") :undefined,
|
||||
milestone_id: m ? m.join(",") :undefined,
|
||||
issue_tag_ids: t?t:undefined,
|
||||
assigner_ids: c?c:undefined,
|
||||
start_date:sDate,
|
||||
due_date:eDate
|
||||
}).then(result=>{
|
||||
|
||||
}).catch(error=>{})
|
||||
if(!copy){
|
||||
const url = `/v1/${owner}/${projectsId}/issues/${index}`;
|
||||
axios.patch(url,{
|
||||
branch_name: b ? b.join(",") :undefined,
|
||||
status_id: s ? s.join(",") : undefined,
|
||||
priority_id: p ? p.join(",") :undefined,
|
||||
milestone_id: m ? m.join(",") :undefined,
|
||||
issue_tag_ids: t?t:undefined,
|
||||
assigner_ids: c?c:undefined,
|
||||
start_date:sDate,
|
||||
due_date:eDate
|
||||
}).then(result=>{
|
||||
|
||||
}).catch(error=>{})
|
||||
}
|
||||
}
|
||||
|
||||
function deleteFunc(){
|
||||
|
|
@ -212,21 +228,55 @@ function Details(props){
|
|||
|
||||
// 编辑保存
|
||||
function createFunc(values,fileList,receivers_login,description){
|
||||
const url = `/v1/${owner}/${projectsId}/issues/${index}`;
|
||||
axios.patch(url,{
|
||||
subject: values.subject,
|
||||
attachment_ids: fileList,
|
||||
receivers_login: receivers_login,
|
||||
description: description
|
||||
}).then(result=>{
|
||||
if(result){
|
||||
props.showNotification("疑修更新成功!");
|
||||
Init();
|
||||
setEdit(false);
|
||||
}
|
||||
}).catch(error=>{})
|
||||
let params ={
|
||||
subject: values.subject,
|
||||
attachment_ids: fileList,
|
||||
receivers_login: receivers_login,
|
||||
description: description
|
||||
}
|
||||
if(!copy){
|
||||
// 调用编辑保存接口
|
||||
const url = `/v1/${owner}/${projectsId}/issues/${index}`;
|
||||
axios.patch(url,{
|
||||
...params
|
||||
}).then(result=>{
|
||||
if(result){
|
||||
props.showNotification("疑修更新成功!");
|
||||
Init();
|
||||
setEdit(false);
|
||||
}
|
||||
}).catch(error=>{})
|
||||
}else{
|
||||
// 调用新建保存接口
|
||||
console.log(branchId,statusId,prioritiesId,millstoneId,tagId, charegeId);
|
||||
const url = `/v1/${owner}/${projectsId}/issues`;
|
||||
axios.post(url,{
|
||||
...params,
|
||||
branch_name:branchId && branchId.join(","),
|
||||
status_id:statusId && statusId.join(","),
|
||||
priority_id:prioritiesId && prioritiesId.join(","),
|
||||
milestone_id:millstoneId && millstoneId.join(","),
|
||||
issue_tag_ids:tagId,
|
||||
assigner_ids:charegeId,
|
||||
start_date,due_date
|
||||
}).then(result=>{
|
||||
debugger;
|
||||
if(result && result.data && result.data.project_issues_index){
|
||||
props.showNotification("任务复制成功!");
|
||||
props.history.push(`/${owner}/${projectsId}/issues/${result.data.project_issues_index}`);
|
||||
}
|
||||
}).catch(error=>{})
|
||||
}
|
||||
}
|
||||
|
||||
// 取消编辑或复制
|
||||
function onCancel(){
|
||||
if(copy){
|
||||
props.history.push(`/${owner}/${projectsId}/issues/${index}`);
|
||||
}else{
|
||||
setEdit(false)
|
||||
}
|
||||
}
|
||||
|
||||
return(
|
||||
details ?
|
||||
|
|
@ -249,7 +299,7 @@ function Details(props){
|
|||
<div style={{paddingTop:"25px"}} >
|
||||
<NewPanel
|
||||
{...props}
|
||||
onCancel={()=>setEdit(false)}
|
||||
onCancel={onCancel}
|
||||
title={details.subject}
|
||||
desc={details.description}
|
||||
files={details.attachments}
|
||||
|
|
@ -279,7 +329,7 @@ function Details(props){
|
|||
details.user_permission &&
|
||||
<ul className="detailoperate">
|
||||
<li><a className="color-blue" onClick={()=>setEdit(true)}><i className="iconfont icon-a-bianji12 font-12 mr5"></i>编辑</a></li>
|
||||
<li><a className="color-blue ml20"><i className="iconfont icon-a-fuzhi2 font-12 mr5"></i>复制</a></li>
|
||||
<li><Link to={`/${owner}/${projectsId}/issues/${index}/copy`} className="color-blue ml20"><i className="iconfont icon-a-fuzhi2 font-12 mr5"></i>复制</Link></li>
|
||||
<li><a className="color-red ml20" onClick={()=>setDelVisible(true)}><i className="iconfont icon-fuzhi-shanchu font-12 mr5"></i>删除</a></li>
|
||||
</ul>
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,9 +35,7 @@ function List(props){
|
|||
const menuRef = useRef(null);
|
||||
const owner = props.match.params.owner;
|
||||
const projectsId = props.match.params.projectsId;
|
||||
console.log(props && props.projectDetail);
|
||||
const { permission } = props && props.projectDetail;
|
||||
console.log(permission);
|
||||
const permission = props && props.projectDetail && props.projectDetail.permission;
|
||||
|
||||
|
||||
useEffect(()=>{
|
||||
|
|
@ -161,7 +159,6 @@ function List(props){
|
|||
if(allValue && allValue.length>0){
|
||||
// 将ids保存下来以便修改
|
||||
setUpdateIds(ids);
|
||||
console.log(ids);
|
||||
}else{
|
||||
Init(ids);
|
||||
}
|
||||
|
|
@ -241,10 +238,11 @@ function List(props){
|
|||
total > 0 &&
|
||||
<React.Fragment>
|
||||
<Checkbox.Group name="issues" onChange={checkIssues} value={allValue} style={{ width: "100%" }}>
|
||||
{
|
||||
issueList.map((item,key)=>{
|
||||
<div className="listdatas">
|
||||
{issueList.map((item,key)=>{
|
||||
return(
|
||||
<Datas
|
||||
key={key}
|
||||
checkbox={ <Checkbox value={item.id} key={item.id} style={{marginRight: "16px"}}></Checkbox> }
|
||||
item={item}
|
||||
owner={owner}
|
||||
|
|
@ -253,7 +251,7 @@ function List(props){
|
|||
)
|
||||
})
|
||||
}
|
||||
|
||||
</div>
|
||||
</Checkbox.Group>
|
||||
{
|
||||
total > 10 &&
|
||||
|
|
|
|||
|
|
@ -1,14 +1,52 @@
|
|||
import React , { useEffect , useState } from 'react';
|
||||
import create from '../Img/create.png';
|
||||
import { Menu , Dropdown , Icon, Input, Button } from 'antd';
|
||||
import { Menu , Dropdown , Icon, Input, Button , Spin , Pagination } from 'antd';
|
||||
import ColorCard from '../Component/colorCard';
|
||||
|
||||
function Sign(){
|
||||
import DelBox from '../Component/delBox';
|
||||
import axios from 'axios';
|
||||
import {Link} from 'react-router-dom';
|
||||
const limit = 15;
|
||||
function Sign(props){
|
||||
const [ edit , setEdit ] = useState(false);
|
||||
const [ colors , setColors ] = useState(undefined);
|
||||
const [ delVisible , setDelVisible ] = useState(false);
|
||||
const [ editId , setEditId ] = useState(undefined);
|
||||
const [ list , setList ] = useState(undefined);
|
||||
const [ total , setTotal ] = useState(undefined);
|
||||
const [ page , setPage ] = useState(1);
|
||||
|
||||
function arrayList(){
|
||||
const [ name , setName ] = useState(undefined);
|
||||
const [ desc , setDesc ] = useState(undefined);
|
||||
const [ order_name , setOrderName ] = useState(undefined);
|
||||
const [ order_type , setOrderType ] = useState(undefined);
|
||||
const [ nameFlag , setNameFlag ] = useState(undefined);
|
||||
const [ defaultColor , setDefaultColor ]= useState("#F17013");
|
||||
const owner = props.match.params.owner;
|
||||
const projectsId = props.match.params.projectsId;
|
||||
|
||||
useEffect(()=>{
|
||||
Init();
|
||||
},[page,order_name,order_type])
|
||||
|
||||
function Init(){
|
||||
const url = `/v1/${owner}/${projectsId}/issue_tags`;
|
||||
axios.get(url,{
|
||||
params:{
|
||||
page,limit,order_name,order_type
|
||||
}
|
||||
}).then(result=>{
|
||||
if(result && result.data){
|
||||
setList(result.data.issue_tags);
|
||||
setTotal(result.data.total_count);
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function arrayList(e){
|
||||
const { eventKey , value } = e.item.props;
|
||||
setPage(1);
|
||||
setOrderName(eventKey);
|
||||
setOrderType(value);
|
||||
}
|
||||
|
||||
const menu = (
|
||||
|
|
@ -30,82 +68,153 @@ function Sign(){
|
|||
|
||||
function getColor(colors){
|
||||
setColors(colors);
|
||||
console.log(colors);
|
||||
}
|
||||
|
||||
function deleteFunc(){
|
||||
if(editId){
|
||||
const url = `/v1/${owner}/${projectsId}/issue_tags/${editId}`;
|
||||
axios.delete(url).then(result=>{
|
||||
if(result){
|
||||
props.showNotification("项目标记删除成功!");
|
||||
Init();
|
||||
setDelVisible(false);
|
||||
}
|
||||
}).catch(error=>{})
|
||||
}
|
||||
}
|
||||
|
||||
function sureSave(){
|
||||
console.log(colors || defaultColor);
|
||||
if(!name){
|
||||
setNameFlag(true);
|
||||
}else{
|
||||
setNameFlag(false);
|
||||
if(editId){
|
||||
// 编辑
|
||||
const url = `/v1/${owner}/${projectsId}/issue_tags/${editId}`;
|
||||
axios.patch(url,{
|
||||
color: colors || defaultColor,
|
||||
description: desc,
|
||||
name
|
||||
}).then(result=>{
|
||||
if(result){
|
||||
props.showNotification("标记编辑成功!");
|
||||
Init();
|
||||
cancel();
|
||||
}
|
||||
}).catch(error=>{})
|
||||
}else{
|
||||
// 保存
|
||||
const url = `/v1/${owner}/${projectsId}/issue_tags`;
|
||||
axios.post(url,{
|
||||
color: colors || defaultColor,
|
||||
description: desc,
|
||||
name
|
||||
}).then(result=>{
|
||||
if(result){
|
||||
props.showNotification("标记新增成功!");
|
||||
Init();
|
||||
cancel();
|
||||
}
|
||||
}).catch(error=>{})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function cancel(){
|
||||
setNameFlag(false);
|
||||
setName(undefined);
|
||||
setEdit(false);
|
||||
setDesc(undefined);
|
||||
}
|
||||
|
||||
function editFunc(i){
|
||||
setEditId(i.id);
|
||||
setDefaultColor(i.color);
|
||||
setName(i.name);
|
||||
setDesc(i.description);
|
||||
setEdit(true);
|
||||
}
|
||||
|
||||
function onChangeValue(e){
|
||||
setName(e.target.value);
|
||||
if(e.target.value){
|
||||
setNameFlag(false);
|
||||
}else{
|
||||
setNameFlag(true);
|
||||
}
|
||||
}
|
||||
return(
|
||||
<div>
|
||||
<DelBox
|
||||
visible={delVisible}
|
||||
onCancel={()=>setDelVisible(false)}
|
||||
onSuccess={deleteFunc}
|
||||
content={<div style={{paddingTop:"3px"}}><p className="font-15 mb20">您确定要删除当前标记?</p></div>}
|
||||
/>
|
||||
<div className="between mt30 mb25">
|
||||
<span>Issue / 项目标记</span>
|
||||
<span><Link to={`/${owner}/${projectsId}/issues`}>Issue</Link> / 项目标记</span>
|
||||
<a className="operateButton" onClick={()=>setEdit(true)}><img src={create} alt="" className="mr5"/>创建标记</a>
|
||||
</div>
|
||||
{
|
||||
edit &&
|
||||
<div className="editbar">
|
||||
<Input style={{width:"163px"}} placeholder="名称15字以内"/>
|
||||
<Input style={{width:"276px"}} placeholder="描述30字以内"/>
|
||||
<ColorCard getColor={getColor}/>
|
||||
<div>
|
||||
<Input style={{width:"163px"}} className={nameFlag ?"inputred":""} value={name} onChange={onChangeValue} placeholder="名称15字以内"/>
|
||||
{ nameFlag && <p className="red">请输入标记名称</p>}
|
||||
</div>
|
||||
<Input style={{width:"276px"}} value={desc} onChange={(e)=>setDesc(e.target.value)} placeholder="描述30字以内"/>
|
||||
<ColorCard
|
||||
getColor={getColor}
|
||||
defaultColor={defaultColor}
|
||||
/>
|
||||
<span>
|
||||
<Button type="primary" ghost>确定</Button>
|
||||
<Button ghost className="ml15" onClick={()=>setEdit(false)}>取消</Button>
|
||||
<Button type="primary" ghost onClick={sureSave}>确定</Button>
|
||||
<Button ghost className="ml15" onClick={cancel}>取消</Button>
|
||||
</span>
|
||||
</div>
|
||||
}
|
||||
<div className="between bluebar">
|
||||
<span>项目标记(10)</span>
|
||||
<span>项目标记({total || 0})</span>
|
||||
<Dropdown overlay={menu} trigger={["click"]} placement="bottomRight">
|
||||
<a>标记<Icon type="caret-down" className="ml5 color-grey-6" /></a>
|
||||
</Dropdown>
|
||||
</div>
|
||||
<ul className="signlist">
|
||||
<li>
|
||||
<p>
|
||||
<span className="square mr10" style={{backgroundColor:"#d92d4c"}}></span>
|
||||
<i className="iconfont icon-biaoji mr3 font-12 " style={{color:"#d92d4c"}}></i>
|
||||
缺陷
|
||||
</p>
|
||||
<p>表示项目存在问题</p>
|
||||
<p>
|
||||
<span className="mr12">0 Issue</span>
|
||||
<span className="line">12 合并请求</span>
|
||||
</p>
|
||||
<p>
|
||||
<a className="color-blue mr12">编辑</a>
|
||||
<a className="color-red line">删除</a>
|
||||
</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>
|
||||
<span className="square mr10" style={{backgroundColor:"#2d6ddc"}}></span>
|
||||
<i className="iconfont icon-biaoji mr3 font-12 " style={{color:"#2d6ddc"}}></i>
|
||||
疑问
|
||||
</p>
|
||||
<p>表示存在的问题</p>
|
||||
<p>
|
||||
<span className="mr12">0 Issue</span>
|
||||
<span className="line">12 合并请求</span>
|
||||
</p>
|
||||
<p>
|
||||
<a className="color-blue mr12">编辑</a>
|
||||
<a className="color-red line">删除</a>
|
||||
</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>
|
||||
<span className="square mr10" style={{backgroundColor:"#ee955a"}}></span>
|
||||
<i className="iconfont icon-biaoji mr3 font-12 " style={{color:"#ee955a"}}></i>
|
||||
功能
|
||||
</p>
|
||||
<p>表示新功能申请</p>
|
||||
<p>
|
||||
<span className="mr12">0 Issue</span>
|
||||
<span className="line">12 合并请求</span>
|
||||
</p>
|
||||
<p>
|
||||
<a className="color-blue mr12">编辑</a>
|
||||
<a className="color-red line">删除</a>
|
||||
</p>
|
||||
</li>
|
||||
</ul>
|
||||
{
|
||||
list && list.length > 0 ?
|
||||
<ul className="signlist">
|
||||
{
|
||||
list.map((i,k)=>{
|
||||
return(
|
||||
<li>
|
||||
<p>
|
||||
<span className="square mr10" style={{backgroundColor:`${i.color}`}}></span>
|
||||
<i className="iconfont icon-biaoji mr3 font-12 " style={{color:`${i.color}`}}></i>
|
||||
{i.name}
|
||||
</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> */}
|
||||
</p>
|
||||
<p>
|
||||
<a className="color-blue mr12" onClick={()=>editFunc(i)}>编辑</a>
|
||||
<a className="color-red line" onClick={()=>{setEditId(i.id);setDelVisible(true);}}>删除</a>
|
||||
</p>
|
||||
</li>
|
||||
)
|
||||
})
|
||||
}
|
||||
</ul>
|
||||
:""
|
||||
}
|
||||
{
|
||||
total > limit &&
|
||||
<div style={{paddingBottom:"30px",textAlign:"center"}}>
|
||||
<Pagination total={total} current={page} onChange={(p)=>setPage(p)} pageSize={limit}/>
|
||||
</div>
|
||||
}
|
||||
{total === undefined && <div style={{height:344,display:"flex",alignItems:"center",justifyContent:"center"}}><Spin /></div> }
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,6 +25,12 @@ function Index(props){
|
|||
return(
|
||||
<div className="pagebox">
|
||||
<Switch>
|
||||
<Route
|
||||
path="/:owner/:projectsId/issues/:index/copy"
|
||||
render={(p) => (
|
||||
<Detail {...props} {...p}/>
|
||||
)}
|
||||
></Route>
|
||||
<Route
|
||||
path="/:owner/:projectsId/issues/new"
|
||||
render={(p) => (
|
||||
|
|
|
|||
|
|
@ -168,8 +168,8 @@
|
|||
// issue列表
|
||||
.listdatas{
|
||||
border:1px solid #d0d0d0;
|
||||
border-radius:0px 0px 4px 4px ;
|
||||
border-top: none;
|
||||
border-radius: 0px 0px 2px 2px;
|
||||
&>div{
|
||||
padding:20px 18px;
|
||||
border-bottom: 1px solid #eee;
|
||||
|
|
@ -215,7 +215,7 @@
|
|||
.principal{
|
||||
position: relative;
|
||||
height: 20px;
|
||||
&:hover{
|
||||
&.hovers:hover{
|
||||
a{
|
||||
position:initial;
|
||||
}
|
||||
|
|
@ -223,7 +223,6 @@
|
|||
a{
|
||||
position: absolute;
|
||||
right: 0px;
|
||||
bottom: 0px;
|
||||
transition: 0.6s;
|
||||
}
|
||||
img,span{
|
||||
|
|
@ -334,6 +333,19 @@
|
|||
align-items: center;
|
||||
margin-bottom: 30px;
|
||||
justify-content: space-between;
|
||||
&>div{
|
||||
position: relative;
|
||||
.inputred{
|
||||
border-color: red;
|
||||
}
|
||||
.red{
|
||||
position: absolute;
|
||||
left: 166px;
|
||||
width: 100%;
|
||||
top: 2px;
|
||||
color: red;
|
||||
}
|
||||
}
|
||||
}
|
||||
.signlist{
|
||||
padding:10px 0px;
|
||||
|
|
@ -470,6 +482,7 @@
|
|||
background-color:#ffffff;
|
||||
border-radius:6px;
|
||||
box-shadow:0px 0px 10px rgba(24, 54, 181, 0.17);
|
||||
max-width: 280px;
|
||||
.searchbox{
|
||||
padding:12px 20px 0px 16px;
|
||||
}
|
||||
|
|
@ -484,6 +497,8 @@
|
|||
border-bottom: none;
|
||||
color:#898d9d;
|
||||
position: relative;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
&:hover,&.ant-menu-item-selected{
|
||||
background-color:rgba(70, 106, 255, 0.07);
|
||||
color:#40424a;
|
||||
|
|
|
|||
Loading…
Reference in New Issue