Merge branch 'gitlink_server_issue' of http://106.75.45.236:3000/Gitlink/forgeplus-react into gitlink_server_issue

This commit is contained in:
谢思 2023-03-09 16:19:31 +08:00
commit b3e8545a2f
13 changed files with 312 additions and 175 deletions

View File

@ -1,21 +1,25 @@
import React , { useState } from 'react';
import { Form , Modal , Input, Button } from 'antd';
import { Form , Input, Button } from 'antd';
import ColorCard from './colorCard';
import axios from 'axios';
function AddTagsBox({visible,onCancel, onSuccess , form ,owner , projectsId}){
const { getFieldDecorator , getFieldsValue } = form;
function AddTagsBox({onSuccess , form ,owner , projectsId,onCancel}){
const { getFieldDecorator , getFieldsValue , validateFields } = 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 || defaultColor
}).then(result=>{
result && onSuccess();
}).catch(error=>{})
validateFields((error,values)=>{
if(!error){
const { desc , name } = getFieldsValue();
const url = `/v1/${owner}/${projectsId}/issue_tags`;
axios.post(url,{
name,description:desc,color:colors || defaultColor
}).then(result=>{
result && onSuccess();
}).catch(error=>{})
}
})
}
function getColor(colors){
@ -23,16 +27,10 @@ function AddTagsBox({visible,onCancel, onSuccess , form ,owner , projectsId}){
}
return(
<Modal
visible={visible}
width="475px"
title={"创建新标记"}
onCancel={onCancel}
footer={null}
className="addTagsModal"
>
<Form className="addTags_form" hideRequiredMark={true}>
<Form.Item label="标记名称" colon={false}>
<Form className="addTags_form" hideRequiredMark={true}>
<p className="manageTitle"><i className="iconfont icon-xiangzuojiantou font-15 color-grey mr5 cursor" onClick={onCancel}/>标记管理</p>
<div className="inline">
<Form.Item colon={false} style={{flex:1,marginRight:'20px'}}>
{getFieldDecorator('name',{
rules:[
{
@ -41,20 +39,22 @@ function AddTagsBox({visible,onCancel, onSuccess , form ,owner , projectsId}){
}
],
validateTrigger:"onInput",
})(<Input placeholder="名称15字以内"/>)}
})(<Input placeholder="标记名称15字以内" maxLength={15}/>)}
</Form.Item>
<Form.Item label="标记描述" colon={false}>
{getFieldDecorator('desc',{rules:[],
validateTrigger:"onInput",
})(<Input placeholder="描述30字以内"/>)}
<Form.Item style={{marginTop:"7px"}}>
<ColorCard getColor={getColor} defaultColor={defaultColor}/>
</Form.Item>
<Form.Item label={"标记色值"}>
<ColorCard getColor={getColor}
defaultColor={defaultColor}/>
</Form.Item>
<Button onClick={saveFunc} type="primary" style={{width:'100%',marginTop:45}} className="mb25">保存</Button>
</Form>
</Modal>
</div>
<Form.Item colon={false}>
{getFieldDecorator('desc',{rules:[],
validateTrigger:"onInput",
})(<Input placeholder="描述30字以内" maxLength={30}/>)}
</Form.Item>
<div style={{textAlign:'center'}}>
<Button style={{width:"80px"}} onClick={onCancel}>取消</Button>
<Button style={{width:"80px"}} className="ml20" type="primary" onClick={saveFunc}>确认</Button>
</div>
</Form>
)
}
export default Form.create({ name: 'Bind' })(AddTagsBox);

View File

@ -1,7 +1,8 @@
import React ,{ useState , useEffect , useRef } from 'react';
import React ,{ useState , useEffect , useRef , forwardRef } from 'react';
import { findDOMNode } from 'react-dom';
import { Dropdown , Menu , Input , message, Button} from 'antd';
import { Dropdown , Menu , Input , Button, Form } from 'antd';
import { getImageUrl } from 'educoder';
import AddTagsBox from './addTagsBox';
const { Search } = Input;
/**
@ -30,12 +31,13 @@ function ChooseMenu({
onAdd,
headImg,
menus,
chooseFunc,double,colorFlag,mustFlag,removeFlag
chooseFunc,double,colorFlag,mustFlag,removeFlag,owner,projectsId
}){
const [ visible , setVisible ] = useState(false);
const [ searchValue , setSearchValue ]= useState(undefined);
const [ valuesId , setValuesId ] = useState([]);
const [ count , setCount ] = useState(double);
const [ content , setContent ] = useState(false);
const [ saveList , setSaveList ] = useState(undefined);
@ -53,10 +55,11 @@ function ChooseMenu({
if (faComponent && boxComponent) {
const isChild = faComponent.contains(target);
const isBox = boxComponent.contains(target);
console.log(target);
const pointer = !target || (target && target.className && (target.className.indexOf("removeicon")===-1 && target.className.indexOf("icon-guanbi")===-1));
if(!isChild && !isBox && pointer){
const arr = ["removeicon","iconfont icon-guanbi font-12 color-white","iconfont icon-guanbi font-12 color-blue","icon-a-bianji12","color-blue font-15 tagManage","iconfont icon-xiangzuojiantou font-15 color-grey mr5 cursor","cover"];
const pointer = arr.includes(target.className);
if(!isChild && !isBox && !pointer){
setVisible(false);
setContent(false);
}
}
}
@ -154,6 +157,7 @@ function ChooseMenu({
setCount(relist ? relist.length :0);
if(!double){
setVisible(false);
setContent(false);
chooseFunc(relist);
}
}
@ -161,6 +165,7 @@ function ChooseMenu({
//
function onSureFunc(){
setVisible(false);
setContent(false);
chooseFunc(saveList);
}
//
@ -181,11 +186,18 @@ function ChooseMenu({
setCount(filter ? filter.length :0);
chooseFunc(filter);
}
function onSuccess(){
setContent(false);
onAdd();
}
return(
<li>
<span>
{placeholder}
<Dropdown
{
!editFlag &&
<Dropdown
visible={visible}
overlayClassName={"overlayChooseStyle"}
placement="bottomRight"
@ -193,83 +205,93 @@ function ChooseMenu({
overlay={
<div ref={refFa}>
{
double && saveList && saveList.length>0?
<ul className="choosedul">
{
saveList.map((i,k)=>{
console.log(i)
return(
<li style={{backgroundColor:`${i.color}` || "#eff2ff",borderColor:`${i.color}` || "#466aff",color:`${colorFlag?"#FFF":"#466aff"}`}}>
<span className="task-hide">{i.name}</span>
<a className="removeicon" onClick={()=>removeSaveFunc(i.id)}><i className={`iconfont icon-guanbi font-12 ${colorFlag? "color-white":"color-blue"}`}></i></a>
</li>
)
})
}
</ul>
:""
}
{ searchFunc &&
<div className="searchbox">
<Search
placeholder={`请输入${placeholder}名称进行搜索`}
value={searchValue}
onChange={changeSearchvalue}
style={{marginRight:"18px"}}
/>
</div>
}
{
menus && menus.length >0?
<Menu className="piecemenu" selectedKeys={valuesId}>
{
menus.map((i,k)=>{
return(
<Menu.Item key={i.id || i.name} className={colorFlag ?"colorli":"commonli"} style={{backgroundColor:colorFlag?`${i.color || "#000"}`:"#f4f6fe"}} onClick={()=>chooseMenu(i)}>
<span><span className="task-hide">{i.name}</span></span>
</Menu.Item>
)
})
}
</Menu>
:
<div className="menusEmpty">
<p>{searchValue ? <span>暂无{placeholder}{searchValue}</span>: `暂无${placeholder}`}</p>
</div>
}
<div className="counttips">
!content ?
<div>
{ onAdd &&
<a className="color-blue font-15" onClick={()=>{setVisible(false);onAdd()}}>
<i className="iconfont icon-a-bianji12 font-14 mr5"></i>标记管理</a>
{
double && saveList && saveList.length>0?
<ul className="choosedul">
{
saveList.map((i,k)=>{
return(
<li style={{backgroundColor:`${i.color}` || "#eff2ff",borderColor:`${i.color}` || "#466aff",color:`${colorFlag?"#FFF":"#466aff"}`}}>
<span className="task-hide">{i.name}</span>
<span className="removeicon" onClick={()=>removeSaveFunc(i.id)}><i className={`iconfont icon-guanbi font-12 ${colorFlag? "color-white":"color-blue"}`}></i></span>
</li>
)
})
}
</ul>
:""
}
{ searchFunc &&
<div className="searchbox">
<Search
placeholder={`请输入${placeholder}名称进行搜索`}
value={searchValue}
onChange={changeSearchvalue}
style={{marginRight:"18px"}}
/>
</div>
}
{
menus && menus.length >0?
<Menu className="piecemenu" selectedKeys={valuesId}>
{
menus.map((i,k)=>{
return(
<Menu.Item key={i.id || i.name} className={colorFlag ?"colorli":"commonli"} style={{backgroundColor:colorFlag?`${i.color || "#000"}`:"#f4f6fe"}} onClick={()=>chooseMenu(i)}>
<span><span className="task-hide">{i.name}</span></span>
</Menu.Item>
)
})
}
</Menu>
:
<div className="menusEmpty">
<p>{searchValue ? <span>暂无{placeholder}{searchValue}</span>: `暂无${placeholder}`}</p>
</div>
}
<div className="counttips">
<div>
{ onAdd &&
<a className="color-blue font-15 tagManage" onClick={()=>{setContent(true)}}>
<i className="iconfont icon-a-bianji12 font-14 mr5"></i>标记管理</a>
}
</div>
{
double && (count<0 ?
<p className="color-red font-13">最多添加{double}{placeholder}</p>
:
<p className="font-13" style={{color:"#898d9d"}}>还可添加{double - count}{placeholder}</p>
)
}
</div>
{
double && (count<0 ?
<p className="color-red font-13">最多添加{double}{placeholder}</p>
:
<p className="font-13" style={{color:"#898d9d"}}>还可添加{double - count}{placeholder}</p>
)
double &&
<div style={{textAlign:'center'}}>
<Button style={{width:"80px"}} onClick={()=>setVisible(false)}>取消</Button>
<Button style={{width:"80px"}} className="ml20" type="primary" onClick={onSureFunc}>确认</Button>
</div>
}
</div>
{
double &&
<div style={{textAlign:'center'}}>
<Button style={{width:"80px"}} onClick={()=>setVisible(false)}>取消</Button>
<Button style={{width:"80px"}} className="ml20" type="primary" onClick={onSureFunc}>确认</Button>
</div>
:
<AddTagsBox
owner={owner}
projectsId={projectsId}
visible={visible}
onCancel={()=>setContent(false)}
onSuccess={onSuccess} />
}
</div>
}>
{!editFlag &&
<a ref={refBox} onClick={()=>setVisible(visible ? false : true)}>
<i className="iconfont icon-a-bianji12 font-13" style={{color:"#898d9d"}}></i>
</a>
}
</Dropdown>
</Dropdown>
}
</span>
<div className={selectValueList && selectValueList.length > 0 ? "operatevalue color-grey-3":"operatevalue"} style={{display:colorFlag?"flex":"block"}}>{renderNames(selectValueList)}</div>
</li>
)
}
export default ChooseMenu;
export default Form.create()(forwardRef(ChooseMenu));

View File

@ -58,7 +58,7 @@ function Datas({checkbox ,item , projectsId,owner}){
<span className="mr12">{item.created_at} 发布</span>
<span className="mr20">{item.updated_at}更新</span>
{item.blockchain_token_num && <span className="mr30"><img src={gold} alt="" width="13px" className="mr3"/>{item.blockchain_token_num}</span>}
{item.milestone_name && <span style={{maxWidth:item.blockchain_token_num ? "261px":"340px"}} 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:item.blockchain_token_num ? "261px":"340px"}} title={item.milestone_name} className="task-hide"><i className="iconfont icon-lichengbeiicon1 font-12 mr3"></i>{item.milestone_name}</span> } */}
</div>
</div>
</div>

View File

@ -1,5 +1,5 @@
import React , { useEffect , useState , forwardRef } from 'react';
import { Spin , Form } from 'antd';
import React , { useEffect , useState , forwardRef , useRef } from 'react';
import { Spin , Form , InputNumber } from 'antd';
import { getImageUrl } from 'educoder';
import { Link } from 'react-router-dom';
import { Box , LongWidth } from '../../Component/layout';
@ -7,7 +7,6 @@ import RenderHtml from "../../../components/render-html";
import DropMenu from '../Component/dropMenu';
import NewPanel from '../Component/newPanel';
import Attachments from "../../Upload/attachment";
import AddTagsBox from '../Component/addTagsBox';
import DelBox from '../Component/delBox';
import Date from '../Component/date';
import moment from 'moment';
@ -18,11 +17,11 @@ import Claims from '../../claims/claims';
import ChooseMenu from '../Component/chooseMenu';
function Details(props){
const [ details , setDetails ] = useState(undefined);
const owner = props.match.params.owner;
const projectsId = props.match.params.projectsId;
const index = props.match.params.index;
const [ details , setDetails ] = useState(undefined);
const [ statusList , setStatusList ] = useState([]);
const [ prioritiesList , setPrioritiesList ] = useState([]);
const [ chargeList , setChargeList ] = useState([]);
@ -36,7 +35,6 @@ function Details(props){
const [ orderId , setOrderId ] = useState(undefined);
const [ visible , setVisible ] = useState(false);
const [ delVisible , setDelVisible] = useState(false);
const [ edit , setEdit] = useState(false);
const [ copy , setCopy] = useState(false);
@ -44,6 +42,7 @@ function Details(props){
const [ start_date, setStartDate ] = useState("");
const [ due_date, setDueDate ] = useState("");
const [ commentReload, setCommentReload] = useState(undefined);
const [ editFlag , setEditFlag ] = useState(false);
const [ assigner_choose , setAssigner_choose ] = useState([]);
const [ prioritie_choose , setPrioritie_choose ] = useState([]);
@ -51,11 +50,14 @@ function Details(props){
const [ tag_choose , setTag_choose ] = useState([]);
const [ millstone_choose , setMillstone_choose ] = useState([]);
const [ branch_choose , setBranch_choose ] = useState([]);
const [ rewardAmount , setRewardAmount ] = useState(undefined);
const [ rewardFlag , setRewardFlag ] = useState(false);
const pathname = props.history.location.pathname;
const permission = props && props.projectDetail && props.projectDetail.permission;
let colors = ["#1abcb1","#28be6c","#e67e22","#db3d1d"];
const ref = useRef(null);
const {projectDetail} = props;
const {projectDetail , open_blockchain} = props;
useEffect(()=>{
if(pathname === `/${owner}/${projectsId}/issues/${index}/copy`){
setEdit(true);
@ -83,10 +85,11 @@ function Details(props){
const url = `/v1/${owner}/${projectsId}/issues/${index}`;
axios.get(url).then(result=>{
if(result && result.data){
console.log('result', result);
let data = result.data;
setDetails(data);
let per = data && !data.user_permission;
console.log(per);
setEditFlag(per);
setAssigner_choose(data.assigners);
if(data.priority && data.priority.id){
setPrioritie_choose([{...data.priority,color:colors[data.priority.id-1]}]);
@ -97,13 +100,16 @@ function Details(props){
setTag_choose(data.tags);
setMillstone_choose(data.milestone && data.milestone.id ? [data.milestone]:[]);
setBranch_choose(data.branch_name ? [{name:data.branch_name}] : []);
setRewardAmount(data.blockchain_token_num);
data.start_date && setStartDate(moment(data.start_date).format('YYYY-MM-DD'));
data.due_date && setDueDate(moment(data.due_date).format('YYYY-MM-DD'));
setOrderId(data.id);
}
}).catch(error=>{})
}).catch(error=>{
console.log(error);
})
}
@ -215,13 +221,8 @@ function Details(props){
})
}
function onSuccess(){
getSign();
setVisible(false);
}
// (!copy:)
function saveForeach(c,s,p,t,m,b,sDate,eDate){
function saveForeach(c,s,p,t,m,b,sDate,eDate,rewardAmount){
if(!copy){
const url = `/v1/${owner}/${projectsId}/issues/${index}`;
axios.patch(url,{
@ -232,7 +233,8 @@ function Details(props){
issue_tag_ids: t?t:undefined,
assigner_ids: c?c:undefined,
start_date:sDate,
due_date:eDate
due_date:eDate,
blockchain_token_num:rewardAmount
}).then(result=>{
if(result){
Init();
@ -316,6 +318,25 @@ function Details(props){
//
setCommentReload(Math.random());
}
//
function amountBlur(e){
if(!editFlag){
setRewardFlag(false);
const value = e.target.value;
if(value && value >= 0){
saveForeach(undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,value);
}else{
setRewardAmount(rewardAmount);
}
}
}
function changeAmount(value){
if(editFlag && value > 0){
setRewardAmount(value);
}
}
return(
details ?
<Box>
@ -326,12 +347,6 @@ function Details(props){
onSuccess={deleteFunc}
content={<div style={{paddingTop:"3px"}}><p className="font-15 mb20">您确定要删除当前疑修</p></div>}
/>
<AddTagsBox
owner={owner}
projectsId={projectsId}
visible={visible}
onCancel={()=>setVisible(false)} onSuccess={onSuccess}
/>
{
edit ?
<div style={{paddingTop:"25px"}} >
@ -403,7 +418,7 @@ function Details(props){
searchFunc={(value)=>{setCharge(value)}}
headImg
selectValueList={assigner_choose}
editFlag={details && !details.user_permission}
editFlag={editFlag}
chooseFunc={(list)=>{setAssigner_choose(list);let l = list && list.length>0 ?list.map(i=>{return i.id || i.name}):[];saveForeach(l);}}
double={5}
removeFlag
@ -413,7 +428,7 @@ function Details(props){
menus={statusList}
selectValueList={status_choose}
mustFlag
editFlag={details && !details.user_permission}
editFlag={editFlag}
chooseFunc={(list)=>{setStatus_choose(list);let l = list && list.length>0 ?list.map(i=>{return i.id || i.name}):[];saveForeach(undefined,l);}}
/>
<DropMenu
@ -422,7 +437,7 @@ function Details(props){
selectValueList={prioritie_choose}
colorFlag="1"
mustFlag
editFlag={details && !details.user_permission}
editFlag={editFlag}
chooseFunc={(list)=>{setPrioritie_choose(list);let l = list && list.length>0 ?list.map(i=>{return i.id || i.name}):[];saveForeach(undefined,undefined,l);}}
/>
<ChooseMenu
@ -434,15 +449,17 @@ function Details(props){
double={3}
colorFlag="2"
removeFlag
editFlag={details && !details.user_permission}
onAdd={permission && permission !== "Reporter" ? ()=>setVisible(true) :false}
editFlag={editFlag}
onAdd={permission && permission !== "Reporter" ? ()=>{getSign();} :false}
owner
projectsId
/>
<ChooseMenu
placeholder="里程碑"
menus={millstoneList}
searchFunc={(value)=>{setMillstone(value)}}
selectValueList={millstone_choose}
editFlag={details && !details.user_permission}
editFlag={editFlag}
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);}}
/>
<ChooseMenu
@ -450,11 +467,29 @@ function Details(props){
menus={branchList}
searchFunc={(value)=>{setBranch(value)}}
selectValueList={branch_choose}
editFlag={details && !details.user_permission}
editFlag={editFlag}
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}/>
{
open_blockchain &&
<li style={{paddingBottom:"0px"}}>
<span>
悬赏金额
{/* {!editFlag && <a onClick={editReward}><i className="iconfont icon-a-bianji12 font-13" style={{color:"#898d9d"}}></i></a> } */}
</span>
<InputNumber
onBlur={amountBlur}
placeholder="请输入悬赏金额"
style={{width:"100%",color:rewardAmount?"#333":"#acb0bf"}}
value={rewardAmount}
onChange={changeAmount}
className="borderNo mt5"
disabled={editFlag}
/>
</li>
}
<Date name="开始日期" today={start_date} setDate={(date)=>{setStartDate(date);saveForeach(undefined,undefined,undefined,undefined,undefined,undefined,date)}} editFlag={editFlag}/>
<Date name="结束日期" today={due_date} setDate={(date)=>{setDueDate(date);saveForeach(undefined,undefined,undefined,undefined,undefined,undefined,undefined,date)}} editFlag={editFlag}/>
</div>
</Box>
:

View File

@ -185,6 +185,7 @@ function List(props){
setAllValue([]);
setValue(undefined);
setNames(undefined);
setValue(undefined);
Init();
//
menuRef.current && menuRef.current.clearChoose();

View File

@ -1,5 +1,5 @@
import React , { useEffect , useState , forwardRef } from 'react';
import { Form } from 'antd';
import React , { useEffect , useState , forwardRef , useRef } from 'react';
import { Form , InputNumber } from 'antd';
import { Box , LongWidth } from '../../Component/layout';
import DropMenu from '../Component/dropMenu';
import ChooseMenu from '../Component/chooseMenu';
@ -14,7 +14,6 @@ function New(props){
const feedBack = search && search.indexOf('type=feedback') !== -1;
// id
const milepostId = props.match.params.milepostId;
const [ visible , setVisible ] = useState(false);
const [ statusList , setStatusList ] = useState([]);
@ -39,10 +38,14 @@ function New(props){
const [ start_date, setStartDate ] = useState("");//moment().format('YYYY-MM-DD')
const [ due_date, setDueDate ] = useState("");
const [ rewardAmount , setRewardAmount ] = useState(undefined);
const [ rewardFlag , setRewardFlag ] = useState(false);
const owner = props.match.params.owner;
const projectsId = props.match.params.projectsId;
const permission = props && props.projectDetail && props.projectDetail.permission;
const { open_blockchain } = props;
const ref = useRef(null);
useEffect(()=>{
if(projectDetail){
@ -171,13 +174,6 @@ function New(props){
}
//
function onSuccess(){
//
getSign();
setVisible(false);
}
//
function createFunc(values,fileList,receivers_login,description){
const { subject } = values;
@ -197,7 +193,8 @@ function New(props){
issue_tag_ids:t,
assigner_ids:a,
attachment_ids:fileList,
start_date,due_date,receivers_login
start_date,due_date,receivers_login,
blockchain_token_num:rewardAmount
}).then(result=>{
if(result && result.data && result.data.project_issues_index){
props.showNotification("任务创建成功!");
@ -207,14 +204,15 @@ function New(props){
}
function changeAmount(value){
if(value > 0){
setRewardAmount(value);
}else{
setRewardAmount(rewardAmount);
}
}
return(
<div>
<AddTagsBox
owner={owner}
projectsId={projectsId}
visible={visible}
onCancel={()=>setVisible(false)} onSuccess={onSuccess}
/>
<p className="font-17 color-grey-3 mt20 mb15">新建疑修</p>
<Box>
<LongWidth>
@ -256,7 +254,10 @@ function New(props){
chooseFunc={(list)=>{setTag_choose(list);}}
double={3}
colorFlag="2"
onAdd={permission && permission !== "Reporter" ? ()=>setVisible(true) :false}
removeFlag
onAdd={permission && permission !== "Reporter" ? ()=>{getSign();} :false}
owner={owner}
projectsId={projectsId}
/>
<ChooseMenu
placeholder="里程碑"
@ -273,6 +274,21 @@ function New(props){
selectValueList={branch_choose}
chooseFunc={(list)=>{setBranch_choose(list);}}
/>
{
open_blockchain &&
<li style={{paddingBottom:"0px"}}>
<span>
悬赏金额
{/* {!(milepostId ? true : false) && <a onClick={editReward}><i className="iconfont icon-a-bianji12 font-13" style={{color:"#898d9d"}}></i></a> } */}
</span>
<InputNumber
placeholder="请输入悬赏金额"
style={{width:"100%",color:rewardAmount?"#333":"#acb0bf"}}
value={rewardAmount}
onChange={changeAmount}
className="borderNo mt5" disabled={milepostId ? true : false}/>
</li>
}
<Date name="开始日期" today={start_date} setDate={(date)=>setStartDate(date)}/>
<Date name="结束日期" today={due_date} setDate={(date)=>setDueDate(date)}/>
</div>

View File

@ -23,9 +23,8 @@ const New = Loadable({
function Index(props){
const pathname = props.history.location.pathname;
const {project } = props;
const { project } = props;
const open_blockchain = project && project.open_blockchain;
console.log("是否开启了确权:",open_blockchain);
useEffect(() => {
if (document) { //

View File

@ -1,3 +1,17 @@
.borderNo.ant-input,.borderNo .ant-input-number-input,.borderNo,.borderNo.ant-input-number-focused{
border:none!important;
padding:4px 0px!important;
background-color: transparent!important;
box-shadow: none!important;
.ant-input-number-handler-wrap{
display: none;
}
&:focus{
border:none!important;
box-shadow: none!important;
}
}
.pagebox{
width: 1200px;
margin:0px auto;
@ -136,6 +150,7 @@
&.statusul{
li{
width: 106px;
font-size: 15px;
&>span{
height:19px;
line-height: 17px;
@ -298,7 +313,7 @@
margin-right: 10px;
line-height: 20px;
width: 45px;
font-size: 15px;
font-size: 14px;
border:1px solid #fff;
&.normals{
border-color:#28be6c;
@ -504,6 +519,23 @@
}
}
}
.addTags_form{
.ant-row.ant-form-item{
margin-bottom: 12px;
}
.manageTitle{
margin-bottom: 20px!important;
padding-bottom: 15px;
line-height: 22px;
color:#5f6872;
font-size:16px;
border-bottom:1px solid #e1e3e8;
}
.inline{
display: flex;
align-items: flex-start;
}
}
.addTagsModal{
.ant-modal-content{
background-image:linear-gradient(359.37deg,#ebf3ff 0%,#f8fbff 55.01%,#f1f5ff 100%);
@ -525,15 +557,6 @@
.ant-modal-close{
top:0px !important;
}
.addTags_form{
.ant-row.ant-form-item{
margin-bottom: 12px;
}
.ant-col.ant-form-item-label{
height: 28px;
line-height: 28px;
}
}
.popover{
left: 94px;
top:0px;

View File

@ -42,7 +42,7 @@ class MergeItem extends Component {
};
render() {
const { issues, project_name, project_author_name , user_admin_or_developer} = this.props;
const { issues, project_name, project_author_name , user_admin_or_developer , open_blockchain} = this.props;
const { projectsId , owner } = this.props.match.params;
const { current_user } = this.props;
const renderList = () => {
@ -143,6 +143,17 @@ class MergeItem extends Component {
onMouseMove={() => this.onMouseMove(item.id)}
onMouseOut={() => this.onMouseOut()}
>
{item.attached_issues && item.attached_issues.length>0 && open_blockchain &&
<li>
{
item.attached_issues.map((i,k)=>{
return(
<Link to={`/${owner}/${projectsId}/issues/${i.project_issues_index}`} className="issueIndex">#{i.project_issues_index}</Link>
)
})
}
</li>
}
<li>{item.priority}</li>
<li>{this.set_issue_tags(item.issue_tags)}</li>
<li>

View File

@ -350,7 +350,7 @@ class MessageCount extends Component {
pull_request,
conflict_files
} = this.state;
const { current_user, projectDetail } = this.props;
const { current_user, projectDetail ,project } = this.props;
const menu = (
<Menu onClick={(e) => this.getOption(e)}>
<Menu.Item key={"merge"} value="合并请求">
@ -370,6 +370,7 @@ class MessageCount extends Component {
const permission = projectDetail && (projectDetail.permission === "Admin" || projectDetail.permission === "Owner" || projectDetail.permission === "Manager");
const userLogin = current_user && current_user.login;
const operate = userLogin && projectDetail && pr_status === 0 && permission;
const open_blockchain = project && project.open_blockchain;
return (
<div>
{data ? (
@ -444,6 +445,19 @@ class MessageCount extends Component {
: "更新于"}
</span>
<span className="color-grey-8 ml5">{data.pr_time}</span>
{
open_blockchain && data.attached_issues && data.attached_issues.length>0 ?
<span className="color-grey-8 ml25">关联issue:
{
data.attached_issues.map((i,k)=>{
return(
<Link className="issueIndex ml5" to={`/${owner}/${projectsId}/issues/${i.project_issues_index}`}>#{i.project_issues_index}</Link>
)
})
}
</span>
:""
}
<span className="ml25">
<span className="color-grey-8">审查人员</span>
{data.issue.assign_user_name ? (

View File

@ -236,6 +236,8 @@ class merge extends Component {
}
render() {
const { projectsId , owner } = this.props.match.params;
const { project } = this.props;
const open_blockchain = project && project.open_blockchain;
const {
issue_chosen,
issues,
@ -318,6 +320,7 @@ class merge extends Component {
</ul>
</div>
<ul className="topWrapper_select">
{ open_blockchain && <li>关联疑修</li> }
<li>
<Dropdown
className="topWrapperSelect"
@ -417,6 +420,7 @@ class merge extends Component {
{...this.props}
{...this.state}
user_admin_or_developer={data && data.user_admin_or_developer}
open_blockchain={open_blockchain}
></MergeItem>
</div>
):""}

View File

@ -91,24 +91,25 @@ class MergeForm extends Component {
set_defatul = () => {
const { data, merge_type } = this.props;
if (data && merge_type === "edit") {
console.log("dddddddd",data);
this.setState({
desc: data.body,
issue_tag_ids: data.issue_tag_ids ? data.issue_tag_ids[0] : undefined,
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,
issue_id:data.attached_issues && data.attached_issues.length>0 ? String(data.attached_issues[0].id) :undefined,
title: data.title,
},()=>{
this.InitData();
});
}
this.InitData();
};
InitData = () => {
setTimeout(() => {
this.props.form.setFieldsValue({
...this.state,
});
}, 100);
console.log(this.state.issue_id);
this.props.form.setFieldsValue({
...this.state,
});
};
onPanelChange = (time, mode) => {
@ -212,6 +213,7 @@ class MergeForm extends Component {
head: pull,
base: merge,
receivers_login:atWhoLoginList,
attached_issue_ids:values.issue_id ? [values.issue_id] :undefined
})
.then((result) => {
if (result) {
@ -255,7 +257,8 @@ class MergeForm extends Component {
};
render() {
const { merge_type } = this.props;
const { merge_type , project } = this.props;
const open_blockchain = project && project.open_blockchain;
const { getFieldDecorator } = this.props.form;
const { projectsId, mergeId ,owner } = this.props.match.params;
const {
@ -404,7 +407,7 @@ class MergeForm extends Component {
</Select>
)}
</Form.Item>
<Form.Item>
<Form.Item style={{display:open_blockchain ? "block" :"none"}}>
{getFieldDecorator("issue_id", {
initialValue: issue_id,
})(

View File

@ -224,6 +224,15 @@
border-bottom: 1px solid #eee;
padding: 16px 0px 16px 20px;
}
.issueIndex{
display: inline-block;
height:19px;
line-height:19px;
background-color:rgba(213, 220, 246, 0.36);
border-radius:4px;
padding:0px 8px;
color: #666!important;
}
.issueItem:last-child{
border-bottom: none;
}