This commit is contained in:
caishi 2021-09-02 14:13:16 +08:00
parent adc134ec44
commit 375ad38364
10 changed files with 58 additions and 18 deletions

View File

@ -7,11 +7,15 @@ import './Index.scss';
function ProfileModal({visible,onCancel,history}) {
const [ modalVis , setModalVis ] = useState(visible);
const [ addMemberCheck , setAddMemberCheck ] = useState(false);
useEffect(()=>{
axios.interceptors.response.use((response) => {
if (response && response.data.status === 411) {
if (response && (response.data.status === 411 || response.data.status === 412)) {
setModalVis(true);
if(response.data.status === 412){
setAddMemberCheck(true);
}
}
return response;
}, (error) => {
@ -41,13 +45,23 @@ function ProfileModal({visible,onCancel,history}) {
onCancel={onNo}
visible={modalVis}
btn={
addMemberCheck?
<div>
<Button type={'primary'} size={"large"} onClick={onNo}>好的</Button>
</div>
:
<div>
<Button size={"large"} onClick={onNo}>暂不补充</Button>
<Button type={'primary'} size={"large"} onClick={onOk}>好的</Button>
</div>
}
>
<p>您目前的个人资料不完整需要补充资料以进行后续操作是否前往补充个人信息</p>
{
addMemberCheck ?
<p>目标用户个人资料不完整需提醒目标用户补充资料后以进行后续操作</p>
:
<p>您目前的个人资料不完整需要补充资料以进行后续操作是否前往补充个人信息</p>
}
</Modals>
)
}

View File

@ -41,15 +41,19 @@ function DivertModal({form , visible , onSuccess , onCancel,owner,repo}){
//
function onOk(){
validateFields((error,values)=>{
console.log(...values);
if(!error){
const url = `/${owner}/${repo}/applied_transfer_projects.json`;
Axios.post(url,{
...values
}).then(result=>{
if(result){
onSuccess(result.data && result.data.owner);
if(result.data.status === 0){
onSuccess(result.data && result.data.owner);
}else{
onSuccess();
}
}
}).catch(error=>{})
}
})

View File

@ -455,7 +455,10 @@ function CoderDepot(props){
<Gap style={{paddingLeft:"30px"}}>
<div className="panelmenu">
<FlexAJ className="font-18 color-grey-6 mb20" style={{lineHeight:"28px"}}>简介
{projectDetail.permission && (projectDetail.permission==="Admin" || projectDetail.permission==="Owner") && <i onClick={()=>setOpenModal(true)} className="iconfont icon-anquanshezhi color-grey-9 font-15"></i>}
{
projectDetail.permission && (projectDetail.permission==="Admin" || projectDetail.permission==="Owner" || projectDetail.permission==="Manager") &&
<i onClick={()=>setOpenModal(true)} className="iconfont icon-anquanshezhi color-grey-9 font-15"></i>
}
</FlexAJ>
{desc && <p className="font-14 color-grey-9 mb15 task-hide-2" style={{lineHeight:"22px",WebkitLineClamp:"4",textAlign:"justify",wordBreak:"break-all"}}>{desc}</p>}
{

View File

@ -2,7 +2,8 @@ import React, { Component } from "react";
import { Link } from 'react-router-dom';
import { Dropdown, Menu, Icon, Pagination, Spin } from 'antd';
import './order.css';
import { FlexAJ } from '../Component/layout'
import { FlexAJ } from '../Component/layout';
import CheckProfile from '../Component/ProfileModal/Profile';
import NoneData from '../Nodata';
import OrderItem from './OrderItem';
@ -239,7 +240,7 @@ class MilepostDetail extends Component {
</span>
<div className="milepostdiv">
<Link to={`/${owner}/${projectsId}/milestones/${meilid}/edit`} className="topWrapper_btn" style={{ marginRight: 15 }} >编辑里程碑</Link>
<Link to={`/${owner}/${projectsId}/issues/${meilid}/new`} className="topWrapper_btn">创建易修</Link>
<CheckProfile {...this.props} sureFunc={()=>{this.props.history.push(`/${owner}/${projectsId}/issues/${meilid}/new`)}} className="topWrapper_btn">创建易修</CheckProfile>
</div>
</FlexAJ>
</div>

View File

@ -223,10 +223,14 @@ class Setting extends Component {
}
// 确定转移仓库
onSuccess=(owner)=>{
if(owner){
this.setState({
is_transfering:true,
transfer:owner
})
}
this.setState({
is_transfering:true,
divertVisible:false,
transfer:owner
divertVisible:false
})
}

View File

@ -111,7 +111,13 @@ function List(props){
</div>
}
</div>
<Right admin={organizeDetail && organizeDetail.is_admin} OIdentifier={OIdentifier} history={props.history}/>
<Right
admin={organizeDetail && organizeDetail.is_admin}
OIdentifier={OIdentifier}
showCompeleteDialog={props.showCompeleteDialog}
completeProfile={props.completeProfile}
history={props.history}
/>
</div>
)
}

View File

@ -145,7 +145,6 @@ export default Form.create()(
<p className="mt20">
<Button type="primary" className="mr30" onClick={createOrganize}>创建组织</Button>
<Button className="grey" onClick={()=>{window.history.back(-1)}}>取消</Button>
<Button className="grey" onClick={()=>{test}}>test</Button>
</p>
</div>
)

View File

@ -1,5 +1,4 @@
import React , { useEffect , useState } from 'react';
import { Button } from 'antd';
import styled from 'styled-components';
import Box from './Box';
import axios from 'axios';
@ -7,6 +6,8 @@ import { getImageUrl } from 'educoder';
import { Link } from 'react-router-dom';
import Nodata from '../Nodata';
import CheckProfile from '../Component/ProfileModal/Profile';
const Span = styled.span`{
color:#888;
font-size:12px;
@ -36,7 +37,7 @@ const Img = styled.img`{
height:45px;
margin-right:12px;
}`
function RightBox({ OIdentifier , history , admin }) {
function RightBox({ OIdentifier , history , admin , showCompeleteDialog ,completeProfile }) {
const [ memberData, setMemberData ] = useState(undefined);
const [ groupData, setGroupData ] = useState(undefined);
@ -87,7 +88,15 @@ function RightBox({ OIdentifier , history , admin }) {
<Box
name="组织团队"
count={groupData && groupData.total_count}
bottom={admin && <Button type={'primary'} onClick={()=>history.push(`/${OIdentifier}/group/new`)}>新建团队</Button>}
bottom={
admin &&
<CheckProfile
showCompeleteDialog={showCompeleteDialog}
completeProfile={completeProfile}
sureFunc={()=>history.push(`/${OIdentifier}/group/new`)}
className={"ant-btn ant-btn-primary"}
>新建团队</CheckProfile>
}
url={`/${OIdentifier}/group`}
>
{

View File

@ -34,7 +34,7 @@ export default Form.create()(
const url = `/users/${current_user && current_user.login}.json`;
const params={
user: {
nickname: values.real_name,
nickname: values.nickname,
user_extension_attributes: {
province: values.location && values.location[0],
city: values.location && values.location[1],
@ -68,7 +68,7 @@ export default Form.create()(
)}
</Form.Item>
<Form.Item label="姓名">
{getFieldDecorator("real_name",{
{getFieldDecorator("nickname",{
rules:[{required:true,message:"请输入姓名"}]
})(
<Input placeholder="请输入您的姓名" maxLength={20} style={{width:"400px"}}/>

View File

@ -58,7 +58,7 @@ function Team(props){
<p>
{
checkIfLogin() &&
<CheckProfile {...props} sureFunc={()=>{this.props.history.push('/organize/new')}}><i className="iconfont icon-xinjian1 mr3 font-14"></i>新建组织</CheckProfile>
<CheckProfile {...props} sureFunc={()=>{props.history.push('/organize/new')}}><i className="iconfont icon-xinjian1 mr3 font-14"></i>新建组织</CheckProfile>
}
<Dropdown overlay={menu}>
<a>排序<i className="iconfont icon-sanjiaoxing-down ml3 font-14"></i></a>