forked from Gitlink/forgeplus-react
Merge branch 'gitlink_server_issue' of http://106.75.45.236:3000/Gitlink/forgeplus-react into gitlink_server_issue
This commit is contained in:
commit
3b8ac50544
|
@ -259,10 +259,10 @@ class Activity extends Component{
|
|||
<div className="normalBox mt20">
|
||||
<div class="normalBox-title">项目演化分析</div>
|
||||
<div className="echartBox">
|
||||
<span className="echartTitle">项目演化图</span>
|
||||
<span className="echartTitle" style={{marginTop:0}}>项目演化图</span>
|
||||
{/* <ProjectScale data={undefined} url={ai_shang_v2_url}/> */}
|
||||
<SmoothLine url={ai_shang_v2_url}/>
|
||||
<div style={{marginTop:"40px"}}>
|
||||
{/* <SmoothLine url={ai_shang_v2_url}/> */}
|
||||
<div>
|
||||
<SmoothLineTwo url={ai_shang_v4_url}/>
|
||||
</div>
|
||||
<span className="echartTitle">分支演化图</span>
|
||||
|
|
|
@ -74,6 +74,8 @@
|
|||
position: relative;
|
||||
padding-left: 20px;
|
||||
font-size: 16px;
|
||||
margin-top: 40px;
|
||||
display: block;
|
||||
}
|
||||
.echartTitle::before{
|
||||
position: absolute;
|
||||
|
@ -83,7 +85,7 @@
|
|||
background-color: #466AFF;
|
||||
border-radius: 2px;
|
||||
left: 0px;
|
||||
top:3px;
|
||||
top:11px;
|
||||
}
|
||||
.commentsBox{
|
||||
border-radius: 4px;
|
||||
|
|
|
@ -31,7 +31,7 @@ function Line({url}) {
|
|||
grid: {
|
||||
left: '5%',
|
||||
right: '1%',
|
||||
bottom: '18%'
|
||||
top: '5%'
|
||||
},
|
||||
xAxis: {
|
||||
data: data.map(function (item) {
|
||||
|
|
|
@ -33,7 +33,7 @@ function Line({url}) {
|
|||
grid: {
|
||||
left: '5%',
|
||||
right: '1%',
|
||||
bottom: '18%'
|
||||
top: '5%'
|
||||
},
|
||||
xAxis: {
|
||||
data: data.map(function (item) {
|
||||
|
|
|
@ -41,10 +41,10 @@ function SmoothLineTwo({url}) {
|
|||
grid: {
|
||||
left: '5%',
|
||||
right: '1%',
|
||||
bottom: '18%'
|
||||
top: '5%'
|
||||
},
|
||||
legend: {
|
||||
data: ['index_split', 'index_shrink' ,'index_merge', 'index_expand']
|
||||
data: ['分裂指数', '缩减指数' ,'合并指数', '扩张指数']
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'axis'
|
||||
|
|
|
@ -6,12 +6,13 @@ import axios from 'axios';
|
|||
function AddTagsBox({visible,onCancel, onSuccess , form ,owner , projectsId}){
|
||||
const { getFieldDecorator , getFieldsValue } = form;
|
||||
const [ colors , setColors ] = useState(undefined);
|
||||
const [ defaultColor , setDefaultColor ]= useState("#F17013");
|
||||
|
||||
function saveFunc(){
|
||||
const { desc , name } = getFieldsValue();
|
||||
const url = `/v1/${owner}/${projectsId}/issue_tags`;
|
||||
axios.post(url,{
|
||||
name,description:desc,color:colors ? colors.hex:"#F17013"
|
||||
name,description:desc,color:colors || defaultColor
|
||||
}).then(result=>{
|
||||
result && onSuccess();
|
||||
}).catch(error=>{})
|
||||
|
@ -19,6 +20,7 @@ function AddTagsBox({visible,onCancel, onSuccess , form ,owner , projectsId}){
|
|||
|
||||
function getColor(colors){
|
||||
setColors(colors);
|
||||
console.log(colors)
|
||||
}
|
||||
|
||||
return(
|
||||
|
@ -48,7 +50,8 @@ function AddTagsBox({visible,onCancel, onSuccess , form ,owner , projectsId}){
|
|||
})(<Input placeholder="描述30字以内"/>)}
|
||||
</Form.Item>
|
||||
<Form.Item label={"标记色值"}>
|
||||
<ColorCard getColor={getColor}/>
|
||||
<ColorCard getColor={getColor}
|
||||
defaultColor={defaultColor}/>
|
||||
</Form.Item>
|
||||
<Button onClick={saveFunc} type="primary" style={{width:'100%',marginTop:45}} className="mb25">保存</Button>
|
||||
</Form>
|
||||
|
|
|
@ -32,15 +32,15 @@ function Datas({checkbox ,item , projectsId,owner}){
|
|||
<div className="issuedetail">
|
||||
{checkbox}
|
||||
<div style={{flex:1}}>
|
||||
<div className="idetails mt2">
|
||||
<div className="idetails">
|
||||
<span className={statusTag(item.priority_name)}>{item.priority_name}</span>
|
||||
{/* <img src={issue} alt="" width="16px" className="mr5" /> */}
|
||||
<Link to={`/${owner}/${projectsId}/issues/${item.project_issues_index}`} title={item.subject}>{item.subject}</Link>
|
||||
<Link to={`/${owner}/${projectsId}/issues/${item.project_issues_index}`} style={{maxWidth:`${item.tags ? 735 - item.tags.length*120 : 735}px`}} title={item.subject}>{item.subject}</Link>
|
||||
{
|
||||
item.tags && item.tags.length>0?
|
||||
item.tags.map((i,k)=>{
|
||||
return(
|
||||
<span style={{borderColor: `${i.color}`,color: `${i.color}`}} className="ml12 tagscolor task-hide" title={i.name}>{i.name}</span>
|
||||
<span style={{backgroundColor: `${i.color}`}} className="ml12 tagscolor task-hide" title={i.name}>{i.name}</span>
|
||||
)
|
||||
})
|
||||
:""
|
||||
|
@ -53,11 +53,11 @@ function Datas({checkbox ,item , projectsId,owner}){
|
|||
<Copy value={`/${owner}/${projectsId}/issues/${item.project_issues_index}`}><span className="number">#{item.project_issues_index}</span></Copy>
|
||||
}
|
||||
</div>
|
||||
<Link to={`/${item.author && item.author.login}`}><img src={`${getImageUrl(item.author && item.author.image_url)}`} alt="" /></Link>
|
||||
<Link to={`/${item.author && item.author.login}`}><i className="iconfont icon-chengyuan2 mr3 font-12" style={{color:'#898d9d'}}></i></Link>
|
||||
<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> }
|
||||
{item.milestone_name && <span style={{maxWidth:"310px"}} title={item.milestone_name} className="task-hide"><i className="iconfont icon-lichengbeiicon1 font-12 mr3"></i>{item.milestone_name}</span> }
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -136,7 +136,7 @@ function DropMenu({
|
|||
{
|
||||
colorFlag ?
|
||||
(
|
||||
colorFlag === "1" ?
|
||||
colorFlag === "2" ?
|
||||
<span className={"colorsquare task-hide"} style={{backgroundColor:`${i.color}`}}>{i.name}</span>
|
||||
:
|
||||
<span className={"colorsborder task-hide"} style={{borderColor:`${i.color}`,color:`${i.color}`}}>{i.name}</span>
|
||||
|
|
|
@ -1,179 +0,0 @@
|
|||
import React ,{ useState , useEffect , useRef } from 'react';
|
||||
import { Dropdown , Menu , Input, message } from 'antd';
|
||||
import { findDOMNode } from 'react-dom';
|
||||
import { getImageUrl } from 'educoder';
|
||||
|
||||
const { Search } = Input;
|
||||
|
||||
/**
|
||||
*
|
||||
* @param name:显示的标题
|
||||
* @param names:选择下拉项后显示的内容
|
||||
* @param list[]:选项
|
||||
* @param emptyName:没有选择项时显示的内容
|
||||
* @param value[]:显示的值
|
||||
* @param onAdd:标记管理、只针对标记
|
||||
* @param searchFlag:是否显示搜索输入框
|
||||
* @param editFlag:是否有编辑按钮
|
||||
* @param double:可多选
|
||||
* @param onChange:选择项后返回id数组
|
||||
* @param permission:权限
|
||||
* @returns
|
||||
*/
|
||||
function EditMenus({
|
||||
name ,
|
||||
names,
|
||||
emptyName='未设置',
|
||||
list,
|
||||
value ,
|
||||
onAdd ,
|
||||
searchFlag ,
|
||||
editFlag ,
|
||||
searchFunc ,
|
||||
double ,
|
||||
onChange ,
|
||||
imgFlag,
|
||||
permission
|
||||
}){
|
||||
const [ menus , setMenus ] = useState([]);
|
||||
const [ searchValue , setSearchValue ]= useState(undefined);
|
||||
const [ showValue , setShowValue ] = useState(undefined);
|
||||
const [ valueId , setValueId ] = useState([]);
|
||||
const [ visible , setVisible ] = useState(false);
|
||||
|
||||
const refFa = useRef(null);
|
||||
const refBox = useRef(null);
|
||||
|
||||
useEffect(()=>{
|
||||
setMenus(list);
|
||||
setValueId(value);
|
||||
setShowValue(names && names.length >0 ? names : undefined);
|
||||
},[names,value,list])
|
||||
|
||||
useEffect(() => {
|
||||
document.addEventListener('click', clickMe , false);
|
||||
}, [])
|
||||
|
||||
const clickMe = ({ target }) => {
|
||||
// 查找父组件
|
||||
const faComponent = findDOMNode(refFa.current);
|
||||
const boxComponent = findDOMNode(refBox.current);
|
||||
if (faComponent && boxComponent) {
|
||||
const isChild = faComponent.contains(target);
|
||||
const isBox = boxComponent.contains(target);
|
||||
if(!isChild && !isBox){
|
||||
setVisible(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function chooseMenu(i){
|
||||
if(!double){
|
||||
setVisible(false);
|
||||
}
|
||||
let l = valueId;
|
||||
let idStr = i && i.id ? i.id.toString() :i.name;
|
||||
// 分支列表没有id,只能根据name判断
|
||||
if(double){
|
||||
l = valueId || [] ;
|
||||
let nameArr = names || [] ;
|
||||
if(l && l.indexOf(idStr)>=0){
|
||||
l = l.filter(k=>k.toString() !== idStr);
|
||||
nameArr = nameArr.filter(k=>k.toString() !== i.name);
|
||||
}else{
|
||||
if(valueId && valueId.length >= double){
|
||||
message.info(`最多只能添加${double}个${name}`);
|
||||
return;
|
||||
}
|
||||
l.push(idStr);
|
||||
nameArr.push(i.name);
|
||||
}
|
||||
setValueId(l);
|
||||
setShowValue(nameArr);
|
||||
onChange(l,nameArr);
|
||||
}else{
|
||||
if(l && l.indexOf(idStr)>=0){
|
||||
setValueId([]);
|
||||
onChange([]);
|
||||
setShowValue(undefined);
|
||||
}else{
|
||||
setValueId([`${i.id || i.name}`]);
|
||||
onChange([`${i.id || i.name}`],[i.name]);
|
||||
setShowValue(i.name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 搜索
|
||||
function changeSearchvalue(e){
|
||||
setSearchValue(e.target.value);
|
||||
searchFunc(e.target.value);
|
||||
}
|
||||
|
||||
function renderNames(nameArrs){
|
||||
return <React.Fragment>
|
||||
{
|
||||
nameArrs && nameArrs.length>0?
|
||||
nameArrs.map((i,k)=>{
|
||||
return(
|
||||
<p className="task-hide">{i}</p>
|
||||
)
|
||||
})
|
||||
:""
|
||||
}
|
||||
</React.Fragment>
|
||||
}
|
||||
|
||||
|
||||
return(
|
||||
<li>
|
||||
<span>
|
||||
{name}
|
||||
{!editFlag && <a ref={refBox} onClick={()=>setVisible(visible ? false : true)}><i className="iconfont icon-a-bianji12 font-13" style={{color:"#898d9d"}}></i></a>}
|
||||
</span>
|
||||
<Dropdown
|
||||
visible={visible}
|
||||
overlayClassName={"overlayStyle"}
|
||||
placement="bottomLeft"
|
||||
trigger={['click']}
|
||||
overlay={
|
||||
<div ref={refFa}>
|
||||
{ searchFlag &&
|
||||
<div className="searchbox">
|
||||
<Search
|
||||
placeholder={`搜索${name}`}
|
||||
value={searchValue}
|
||||
onChange={changeSearchvalue}
|
||||
style={{marginRight:"18px"}}
|
||||
/>
|
||||
</div>
|
||||
}
|
||||
{
|
||||
menus && menus.length >0?
|
||||
<Menu className="piecemenu" selectedKeys={valueId}>
|
||||
{
|
||||
menus.map((i,k)=>{
|
||||
return(
|
||||
<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>}
|
||||
<span className="task-hide">{i.name}</span>
|
||||
</Menu.Item>
|
||||
)
|
||||
})
|
||||
}
|
||||
</Menu>
|
||||
:
|
||||
<div className="menusEmpty">
|
||||
<p>{searchValue ? <span>暂无{name}“{searchValue}”</span>: `暂无${name}`}</p>
|
||||
{ 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>
|
||||
}>
|
||||
<div className={showValue?"operatevalue color-grey-3":"operatevalue"}>{ names ? renderNames(names) : emptyName}</div>
|
||||
</Dropdown>
|
||||
</li>
|
||||
)
|
||||
}
|
||||
export default EditMenus;
|
|
@ -4,7 +4,6 @@ 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';
|
||||
import DropMenu from '../Component/dropMenu';
|
||||
import NewPanel from '../Component/newPanel';
|
||||
import Attachments from "../../Upload/attachment";
|
||||
|
@ -15,6 +14,7 @@ import moment from 'moment';
|
|||
import Copy from '../Component/copy';
|
||||
import axios from 'axios';
|
||||
import CommentList from '../Component/comments/list';
|
||||
import Claims from '../../claims/claims';
|
||||
|
||||
function Details(props){
|
||||
const [ details , setDetails ] = useState(undefined);
|
||||
|
@ -33,14 +33,7 @@ function Details(props){
|
|||
const [ branchList , setBranchList ] = useState(undefined);
|
||||
const [ branch , setBranch ] = useState(undefined);
|
||||
|
||||
const [ charegeId , setCharegeId ] = useState([]);
|
||||
const [ statusId , setStatusId ] = useState([`1`]);
|
||||
const [ prioritiesId , setPrioritiesId ] = useState([`2`]);
|
||||
const [ tagId , setTagId ] = useState([]);
|
||||
const [ millstoneId , setMillstoneId ] = useState([]);
|
||||
const [ branchId , setBranchId ] = useState([]);
|
||||
|
||||
const [ names , setNames ] = useState({author_name:undefined,issue_priorities_name:undefined,issue_tag_name:undefined,milestone_name:undefined,sortby_name:undefined,status_name:undefined,assigner_name:undefined});
|
||||
const [ orderId , setOrderId ] = useState(undefined);
|
||||
|
||||
const [ visible , setVisible ] = useState(false);
|
||||
const [ delVisible , setDelVisible] = useState(false);
|
||||
|
@ -59,8 +52,9 @@ function Details(props){
|
|||
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"];
|
||||
let colors = ["#1abcb1","#28be6c","#e67e22","#db3d1d"];
|
||||
|
||||
const {projectDetail} = props;
|
||||
useEffect(()=>{
|
||||
if(pathname === `/${owner}/${projectsId}/issues/${index}/copy`){
|
||||
setEdit(true);
|
||||
|
@ -71,6 +65,13 @@ function Details(props){
|
|||
}
|
||||
},[pathname])
|
||||
|
||||
useEffect(()=>{
|
||||
if(projectDetail && details){
|
||||
const { author, name} = projectDetail;
|
||||
document.title = `${details.subject}-疑修-${author.name}/${name}`;
|
||||
}
|
||||
},[details,projectDetail])
|
||||
|
||||
useEffect(()=>{
|
||||
if(index){
|
||||
Init();
|
||||
|
@ -98,11 +99,7 @@ function Details(props){
|
|||
data.start_date && setStartDate(moment(data.start_date).format('YYYY-MM-DD'));
|
||||
data.due_date && setDueDate(moment(data.due_date).format('YYYY-MM-DD'));
|
||||
|
||||
const {projectDetail} = props;
|
||||
if(projectDetail){
|
||||
const { author, name} = projectDetail;
|
||||
document.title = `${data.subject}-疑修-${author.name}/${name}`;
|
||||
}
|
||||
setOrderId(data.id);
|
||||
}
|
||||
}).catch(error=>{})
|
||||
}
|
||||
|
@ -312,6 +309,11 @@ function Details(props){
|
|||
setEdit(false);
|
||||
}
|
||||
}
|
||||
|
||||
function refreshFunc(){
|
||||
// 更新操作日志
|
||||
setCommentReload(Math.random());
|
||||
}
|
||||
return(
|
||||
details ?
|
||||
<Box>
|
||||
|
@ -350,7 +352,7 @@ function Details(props){
|
|||
<p className="name">{details.subject}</p>
|
||||
</div>
|
||||
<div>
|
||||
<div className="ilog">
|
||||
<div className="ilog mt5">
|
||||
<Copy value={`/${owner}/${projectsId}/issues/${index}`}><span className="number">#{details.project_issues_index}</span></Copy>
|
||||
</div>
|
||||
{
|
||||
|
@ -392,74 +394,64 @@ function Details(props){
|
|||
}
|
||||
</LongWidth>
|
||||
<div className="shortwidth mt25">
|
||||
<DropMenu
|
||||
placeholder="负责人"
|
||||
menus={chargeList}
|
||||
searchFunc={(value)=>{setCharge(value)}}
|
||||
headImg
|
||||
selectValueList={assigner_choose}
|
||||
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}
|
||||
removeFlag
|
||||
/>
|
||||
|
||||
{/* <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="1"
|
||||
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)=>{setTag(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}
|
||||
colorFlag="2"
|
||||
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)=>{setMillstone(value)}}
|
||||
selectValueList={millstone_choose}
|
||||
editFlag={details && !details.user_permission}
|
||||
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)=>{setBranch(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}/>
|
||||
{orderId && <div className="claimpart"><Claims issue_id={orderId} {...props} refreshFunc={refreshFunc}/></div>}
|
||||
<DropMenu
|
||||
placeholder="负责人"
|
||||
menus={chargeList}
|
||||
searchFunc={(value)=>{setCharge(value)}}
|
||||
headImg
|
||||
selectValueList={assigner_choose}
|
||||
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}
|
||||
removeFlag
|
||||
/>
|
||||
<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="1"
|
||||
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);}}
|
||||
/>
|
||||
<DropMenu
|
||||
placeholder="标记"
|
||||
menus={tagList}
|
||||
searchFunc={(value)=>{setTag(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}
|
||||
colorFlag="2"
|
||||
editFlag={details && !details.user_permission}
|
||||
onAdd={permission && permission !== "Reporter" ? ()=>setVisible(true) :false}
|
||||
/>
|
||||
<DropMenu
|
||||
placeholder="里程碑"
|
||||
menus={millstoneList}
|
||||
searchFunc={(value)=>{setMillstone(value)}}
|
||||
selectValueList={millstone_choose}
|
||||
editFlag={details && !details.user_permission}
|
||||
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)=>{setBranch(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);}}
|
||||
/>
|
||||
<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>
|
||||
:
|
||||
|
|
|
@ -12,7 +12,7 @@ import axios from 'axios';
|
|||
import cookie from 'react-cookies';
|
||||
import emp from '../Img/emp.png';
|
||||
const { Search } = Input;
|
||||
const defaultLimit = 10;
|
||||
const defaultLimit = 15;
|
||||
|
||||
function List(props){
|
||||
const [ visible , setVisible ] = useState(false);
|
||||
|
@ -34,7 +34,7 @@ function List(props){
|
|||
const [ updateIds , setUpdateIds ] = useState(undefined);
|
||||
|
||||
const [ page , setPage ] = useState(1);
|
||||
const [ limit , setLimit ] = useState(10);
|
||||
const [ limit , setLimit ] = useState(15);
|
||||
const [ total , setTotal ] = useState(undefined);
|
||||
const [ issueTotal , setIssueTotal ] = useState(0);
|
||||
|
||||
|
@ -61,10 +61,10 @@ function List(props){
|
|||
setAboutMe(states.participant_category);
|
||||
setCategory(states.category);
|
||||
setPage(states.page);
|
||||
setLimit(states.limit || 10);
|
||||
setLimit(states.limit || defaultLimit);
|
||||
setUpdateIds({...states});
|
||||
setNames(states.names);
|
||||
if(states.participant_category ==="all" && states.category === "opened" && states.page === 1 && states.limit===10)
|
||||
if(states.participant_category ==="all" && states.category === "opened" && states.page === 1 && states.limit===defaultLimit)
|
||||
Init({...states},states.page,states.names);
|
||||
}else{
|
||||
Init();
|
||||
|
@ -404,9 +404,9 @@ function List(props){
|
|||
</div>
|
||||
</Checkbox.Group>
|
||||
{
|
||||
total > 10 &&
|
||||
total > defaultLimit &&
|
||||
<div className="pt25 pb30" style={{textAlign:"right"}}>
|
||||
<Pagination total={total} onShowSizeChange={chageLimit} current={page} pageSize={limit} onChange={changepage} showSizeChanger showQuickJumper />
|
||||
<Pagination total={total} onShowSizeChange={chageLimit} current={page} pageSize={limit} onChange={changepage} showSizeChanger pageSizeOptions={[15,30,40,50]} showQuickJumper />
|
||||
</div>
|
||||
}
|
||||
</React.Fragment>
|
||||
|
|
|
@ -88,7 +88,7 @@ function New(props){
|
|||
if(result && result.data){
|
||||
let priorities = result.data.priorities;
|
||||
let array =[];
|
||||
let colors = ["#1abcb1","#28be6c","#db3d1d","#db3d1d"];
|
||||
let colors = ["#1abcb1","#28be6c","#e67e22","#db3d1d"];
|
||||
if(priorities && priorities.length>0){
|
||||
array = priorities.map((i,k)=>{
|
||||
let arr = {...i,color:colors[k]}
|
||||
|
|
|
@ -226,11 +226,11 @@
|
|||
padding:0px 6px;
|
||||
border-radius: 3px;
|
||||
height: 20px;
|
||||
line-height: 18px;
|
||||
line-height: 20px;
|
||||
max-width: 108px;
|
||||
border:1px solid ;
|
||||
font-size: 13px;
|
||||
cursor: default;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
.infos{
|
||||
|
@ -293,24 +293,28 @@
|
|||
.status{
|
||||
display: block;
|
||||
height:22px;
|
||||
border-radius:6px;
|
||||
border-radius:3px;
|
||||
text-align: center;
|
||||
margin-right: 10px;
|
||||
line-height: 22px;
|
||||
color: #fff;
|
||||
line-height: 20px;
|
||||
width: 45px;
|
||||
font-size: 15px;
|
||||
border:1px solid #fff;
|
||||
&.normals{
|
||||
background-color:#28be6c;
|
||||
border-color:#28be6c;
|
||||
color:#28be6c;
|
||||
}
|
||||
&.hight{
|
||||
background-color: #db3d1d;
|
||||
border-color: #e67e22;
|
||||
color: #e67e22;
|
||||
}
|
||||
&.urgent{
|
||||
background-color: #db3d1d;
|
||||
border-color: #db3d1d;
|
||||
color: #db3d1d;
|
||||
}
|
||||
&.low{
|
||||
background-color: #1abcb1;
|
||||
border-color: #1abcb1;
|
||||
color: #1abcb1;
|
||||
}
|
||||
}
|
||||
.ilog{
|
||||
|
@ -449,13 +453,14 @@
|
|||
a{
|
||||
position: absolute;
|
||||
right: 0px;
|
||||
bottom: -12px;
|
||||
}
|
||||
}
|
||||
.operatevalue{
|
||||
line-height: 30px;
|
||||
color: #acb0bf;
|
||||
margin-top: 10px;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
.colorsborder{
|
||||
padding: 0px 8px;
|
||||
height: 20px;
|
||||
|
@ -478,12 +483,15 @@
|
|||
margin-top: 8px!important;
|
||||
height: 20px;
|
||||
line-height: 20px;
|
||||
position: relative;
|
||||
margin-right: 15px;
|
||||
&.removeFlag>span{
|
||||
width: 230px;
|
||||
margin-right: 8px;
|
||||
max-width: 230px;
|
||||
}
|
||||
.removeicon{
|
||||
display: none;
|
||||
position: absolute;
|
||||
right: -13px;
|
||||
}
|
||||
}
|
||||
.removeFlag:hover{
|
||||
|
@ -614,7 +622,7 @@
|
|||
flex: 1;
|
||||
&>div{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
align-items: flex-start;
|
||||
}
|
||||
.name{
|
||||
font-size: 16px;
|
||||
|
@ -622,6 +630,7 @@
|
|||
color:#333;
|
||||
line-height: 22px;
|
||||
max-width: 580px;
|
||||
word-break: break-all;
|
||||
}
|
||||
.author{
|
||||
img{
|
||||
|
@ -701,4 +710,11 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 声明
|
||||
.claimpart{
|
||||
padding-bottom: 10px;
|
||||
border-bottom: 1px solid #eee;
|
||||
margin-bottom: 20px;
|
||||
}
|
|
@ -22,7 +22,8 @@ function CoderDepotReadme({ operate , history , readme , ChangeFile }){
|
|||
const items = $.map($("#readme").find("h1,h2,h3,h4,h5,h6"), function (el, _) {
|
||||
const anchor = el.id;
|
||||
const level = el.tagName.replace("H", "");
|
||||
const href = `#${anchor}`;
|
||||
let id = anchor.replace(/[.,/#!$%^&*;:{}=\-_`~():,。¥;「」|?》《~·【】‘、!]/g,"");
|
||||
const href = `#${id}`;
|
||||
return { href:`${href}`,text:el.textContent , level:level }
|
||||
});
|
||||
setMenuList(items);
|
||||
|
|
|
@ -40,7 +40,7 @@ function ReadmeCatelogue({ menuList , hash }) {
|
|||
menu.map((item,key)=>{
|
||||
return(
|
||||
<div style={{paddingLeft:`${item.level *15}px`}} className={goHref===item.href?"items active":"items"}>
|
||||
<Link href={`#${item.text}`} title={item.text} />
|
||||
<Link href={`${item.href}`} title={item.text} />
|
||||
</div>
|
||||
)
|
||||
})
|
||||
|
|
|
@ -25,7 +25,9 @@ class MergeForm extends Component {
|
|||
issue_tags: undefined,
|
||||
issue_versions: undefined,
|
||||
issue_priories: undefined,
|
||||
atWhoLoginList:undefined
|
||||
atWhoLoginList:undefined,
|
||||
issue_lists:undefined,
|
||||
issue_id:undefined
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -33,6 +35,7 @@ class MergeForm extends Component {
|
|||
// this.check_is_login();
|
||||
this.get_default_selects();
|
||||
this.set_defatul();
|
||||
this.getIssueList();
|
||||
};
|
||||
componentDidUpdate=(prevPros)=>{
|
||||
const { projectsId ,owner } = this.props.match.params;
|
||||
|
@ -47,6 +50,22 @@ class MergeForm extends Component {
|
|||
return
|
||||
}
|
||||
}
|
||||
|
||||
getIssueList=()=>{
|
||||
const { projectsId ,owner } = this.props.match.params;
|
||||
const url = `/v1/${owner}/${projectsId}/issues`;
|
||||
axios.get(url,{
|
||||
params:{
|
||||
only_name:true
|
||||
}
|
||||
}).then(result=>{
|
||||
if(result && result.data){
|
||||
this.setState({
|
||||
issue_lists:result.data.issues
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
get_default_selects = () => {
|
||||
const { projectsId ,owner } = this.props.match.params;
|
||||
|
@ -78,6 +97,7 @@ class MergeForm extends Component {
|
|||
fixed_version_id: data.fixed_version_id ? String(data.fixed_version_id) : undefined,
|
||||
assigned_to_id: data.assigned_to_id ? String(data.assigned_to_id) : undefined,
|
||||
priority_id: data.priority_id ? String(data.priority_id) :undefined,
|
||||
issue_id:data.attached_issue_ids ? data.attached_issue_ids :undefined,
|
||||
title: data.title,
|
||||
});
|
||||
}
|
||||
|
@ -125,7 +145,7 @@ class MergeForm extends Component {
|
|||
return list.map((item, key) => {
|
||||
return (
|
||||
<Option key={key + 1} value={item.id + ""}>
|
||||
{item.name}
|
||||
{item.name || item.subject}
|
||||
</Option>
|
||||
);
|
||||
});
|
||||
|
@ -161,6 +181,7 @@ class MergeForm extends Component {
|
|||
files_count,
|
||||
commits_count,
|
||||
receivers_login:atWhoLoginList,
|
||||
attached_issue_ids:values.issue_id ? [values.issue_id] :undefined
|
||||
})
|
||||
.then((result) => {
|
||||
if (result) {
|
||||
|
@ -249,6 +270,8 @@ class MergeForm extends Component {
|
|||
issue_tags,
|
||||
issue_versions,
|
||||
issue_priories,
|
||||
issue_lists,
|
||||
issue_id
|
||||
} = this.state;
|
||||
return (
|
||||
<div>
|
||||
|
@ -381,6 +404,25 @@ class MergeForm extends Component {
|
|||
</Select>
|
||||
)}
|
||||
</Form.Item>
|
||||
<Form.Item>
|
||||
{getFieldDecorator("issue_id", {
|
||||
initialValue: issue_id,
|
||||
})(
|
||||
<Select
|
||||
placeholder={"关联疑修"}
|
||||
showSearch
|
||||
className="searchIcon"
|
||||
suffixIcon={<i className="iconfont icon-sousuo1"></i>}
|
||||
optionFilterProp="children"
|
||||
filterOption={(input, option) =>
|
||||
option.props.value && option.props.children && option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
|
||||
}
|
||||
>
|
||||
<Option key={0} value={""}>{issue_lists && issue_lists.length > 0 ? "未选择疑修" : "当前仓库还没有疑修"}</Option>
|
||||
{this.renderSelect(issue_lists)}
|
||||
</Select>
|
||||
)}
|
||||
</Form.Item>
|
||||
{/* <Form.Item label="其他">
|
||||
{getFieldDecorator("checkbox-group")(
|
||||
<Checkbox.Group>
|
||||
|
|
Loading…
Reference in New Issue