dropdown报错
This commit is contained in:
parent
431f2222ef
commit
7caa517263
|
|
@ -28,7 +28,7 @@ function AddTagsBox({onSuccess , form ,owner , projectsId,onCancel}){
|
|||
|
||||
return(
|
||||
<Form className="addTags_form" hideRequiredMark={true}>
|
||||
<p className="manageTitle" onClick={onCancel}><i className="iconfont icon-xiangzuojiantou font-15 color-grey mr5"/>标记管理</p>
|
||||
<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',{
|
||||
|
|
|
|||
|
|
@ -45,9 +45,7 @@ function ChooseMenu({
|
|||
const refBox = useRef(null);
|
||||
|
||||
useEffect(() => {
|
||||
if(saveList && saveList.length>0){
|
||||
document.addEventListener('click', clickMe , false);
|
||||
}
|
||||
document.addEventListener('click', clickMe , false);
|
||||
}, [])
|
||||
|
||||
const clickMe = ({ target }) => {
|
||||
|
|
@ -57,8 +55,7 @@ function ChooseMenu({
|
|||
if (faComponent && boxComponent) {
|
||||
const isChild = faComponent.contains(target);
|
||||
const isBox = boxComponent.contains(target);
|
||||
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"];
|
||||
console.log(target.className);
|
||||
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);
|
||||
|
|
@ -198,7 +195,9 @@ function ChooseMenu({
|
|||
<li>
|
||||
<span>
|
||||
{placeholder}
|
||||
<Dropdown
|
||||
{
|
||||
!editFlag &&
|
||||
<Dropdown
|
||||
visible={visible}
|
||||
overlayClassName={"overlayChooseStyle"}
|
||||
placement="bottomRight"
|
||||
|
|
@ -285,12 +284,11 @@ function ChooseMenu({
|
|||
}
|
||||
</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>
|
||||
|
|
|
|||
|
|
@ -17,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([]);
|
||||
|
|
@ -42,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([]);
|
||||
|
|
@ -84,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]}]);
|
||||
|
|
@ -105,7 +107,9 @@ function Details(props){
|
|||
|
||||
setOrderId(data.id);
|
||||
}
|
||||
}).catch(error=>{})
|
||||
}).catch(error=>{
|
||||
console.log(error);
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -411,7 +415,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
|
||||
|
|
@ -421,7 +425,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
|
||||
|
|
@ -430,7 +434,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
|
||||
|
|
@ -442,7 +446,7 @@ function Details(props){
|
|||
double={3}
|
||||
colorFlag="2"
|
||||
removeFlag
|
||||
editFlag={details && !details.user_permission}
|
||||
editFlag={editFlag}
|
||||
onAdd={permission && permission !== "Reporter" ? ()=>{getSign();} :false}
|
||||
owner
|
||||
projectsId
|
||||
|
|
@ -452,7 +456,7 @@ function Details(props){
|
|||
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
|
||||
|
|
@ -460,7 +464,7 @@ 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);}}
|
||||
/>
|
||||
{
|
||||
|
|
@ -468,13 +472,13 @@ function Details(props){
|
|||
<li style={{paddingBottom:"0px"}}>
|
||||
<span>
|
||||
悬赏金额
|
||||
{!(details && !details.user_permission) && <a onClick={editReward}><i className="iconfont icon-a-bianji12 font-13" style={{color:"#898d9d"}}></i></a> }
|
||||
{!(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"}} ref={ref} value={rewardAmount} onChange={(value)=>setRewardAmount(value)} className="borderNo mt5" disabled={!rewardFlag}/>
|
||||
</li>
|
||||
}
|
||||
<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}/>
|
||||
<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>
|
||||
:
|
||||
|
|
|
|||
|
|
@ -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) { // 可以排除不需要置顶的页面
|
||||
|
|
|
|||
Loading…
Reference in New Issue