dev_forge
sylor_huang@126.com 5 years ago
commit 2c56fddec7

@ -107,7 +107,14 @@ const NewVersionIndex = Loadable({
loader: () => import('../Version/NewVersion'),
loading: Loading,
})
const UpVersionIndex = Loadable({
loader: () => import('../Version/UpdateVersion'),
loading: Loading,
})
const MilepostDetail = Loadable({
loader: () => import('../Order/MilepostDetail'),
loading: Loading,
})
const TrendsIndex = Loadable({
@ -377,7 +384,12 @@ class Detail extends Component{
(props) => (<OrdernewMilepost {...this.props} {...props} {...this.state}/>)
}
></Route>
{/*里程碑详情*/ }
<Route path="/projects/:projectsId/orders/:meilid/MilepostDetail"
render={
(props) => (<MilepostDetail {...this.props} {...props} {...this.state}/>)
}
></Route>
{/*修改里程碑*/}
<Route path="/projects/:projectsId/orders/:meilid/meilpost"
render={
@ -453,6 +465,13 @@ class Detail extends Component{
></Route>
<Route path="/projects/:projectsId/version/:versionId/upversion"
render={
(props) => (<UpVersionIndex {...this.props} {...props} {...this.state}/>)
}
></Route>
<Route path="/projects/:projectsId/version"
render={
(props) => (<VersionIndex {...this.props} {...props} {...this.state}/>)

@ -1,6 +1,6 @@
import React , {Component} from 'react';
import { Link } from 'react-router-dom';
import { Dropdown , Icon , Menu , Pagination,Typography} from 'antd';
import { Dropdown , Icon , Menu , Pagination,Typography,Popconfirm} from 'antd';
import Nav from './Nav';
import NoneData from '../../modules/courses/coursesPublic/NoneData';
import reactCSS from 'reactcss'
@ -179,7 +179,7 @@ class Milepost extends Component{
<div className="milepostdiv">
<div className="milepostwidth">
<i className="iconfont icon-lubiaosignpost3 font-12 mr3"></i>
<p>{item.name}</p>
<Link to={`/projects/${projectsId}/orders/${item.id}/MilepostDetail`}>{item.name}</Link>
</div>
{/* <div className="mileposwidth">
</div> */}
@ -191,7 +191,7 @@ class Milepost extends Component{
</p>
<p>{item.effective_date}</p>
<p style={{width:20}}>
<i className="iconfont icon-jinggao2 font-28 mr3"></i>
<i className="iconfont icon-jinggao2 font-25 mr3"></i>
</p>
<p>{item.open_issues_count}个开启</p>
<p style={{width:20,marginLeft:15}}>
@ -211,7 +211,10 @@ class Milepost extends Component{
<p style={{width:20}}>
<i className="iconfont icon-lajitong font-12 mr3"></i>
</p>
<p onClick={()=>this.closemile(item)} >删除</p>
<Popconfirm placement="bottom" title={'是否删除里程碑?'} okText="是" cancelText="否" onConfirm={()=>this.closemile(item)}>
<p>删除</p>
</Popconfirm>
</div>
</div>
<div className="milepostdiv"style={{marginTop:5}}>

@ -0,0 +1,238 @@
import React , { Component } from "react";
import {Link, NavLink} from 'react-router-dom';
import { Input ,Dropdown , Menu , Icon , Pagination , Spin } from 'antd';
import './order.css';
import NoneData from '../../modules/courses/coursesPublic/NoneData';
import Nav from './Nav';
import OrderItem from './OrderItem';
import axios from 'axios';
const Search = Input.Search;
/**
* issue_chosen:下拉的筛选列表,
* data:列表接口返回的所有数据,
* issues:列表数组,
* isSpin:加载中,
* search:搜索关键字,
* author_id:发布者id,
* assigned_to_id:指派给的id
* limit:每页条数,
* page:当前页,
* search_count:列表总条数
* issue_type:搜索条件
* status_type: issue的关闭和开启1表示开启中的2表示关闭的
*/
class MilepostDetail extends Component{
constructor(props){
super(props);
this.state={
issue_chosen:undefined,
data:undefined,
issues:undefined,
isSpin:false,
search:undefined,
author_id:undefined,
assigned_to_id:undefined,
limit:15,
page:1,
search_count:undefined,
issue_type:undefined,
status_type:'1',
//设置选择高亮
openselect:1,
closeselect:undefined,
// status_type: undefined
}
}
componentDidMount=()=>{
this.getSelectList();
this.getIssueList();
}
getSelectList=()=>{
const { projectsId } = this.props.match.params;
const url = `/projects/${projectsId}/issues/index_chosen.json`;
axios.get(url).then((result)=>{
if(result){
this.setState({
issue_chosen:result.data.issue_chosen
})
}
}).catch((error)=>{
console.log(error);
})
}
// 获取列表数据
getIssueList=(page,limit,search,author_id,assigned_to_id,id,value,status_type)=>{
const { projectsId } = this.props.match.params;
const url = `/projects/${projectsId}/issues.json`;
axios.get(url,{
params:{
page,limit,search,author_id,assigned_to_id,status_type,
[id]:value
}
}).then((result)=>{
if(result){
this.setState({
data:result.data,
issues:result.data.issues,
search_count:result.data.search_count,
isSpin:false
})
}
}).catch((error)=>{
console.log(error);
})
}
getOption=(e,id)=>{
this.setState({
[id]:e.key
})
const { page,limit,search,author_id,assigned_to_id } = this.state;
if(e.key==="all"){
this.getIssueList(page,limit,search,author_id,assigned_to_id,id);
}else{
this.getIssueList(page,limit,search,author_id,assigned_to_id,id,e.key);
}
}
renderMenu =(array,name,id)=>{
return(
<Menu>
<Menu.Item key={"all"} onClick={(e)=>this.getOption(e,id)}>{name}</Menu.Item>
{
array && array.length > 0 && array.map((item,key)=>{
return(
<Menu.Item key={item.id} onClick={(e)=>this.getOption(e,id)}>{item.name}</Menu.Item>
)
})
}
</Menu>
)
}
// 翻页
ChangePage=(page)=>{
this.setState({
page,
isSpin:true
})
const {limit,search} = this.state;
this.getIssueList(page,limit,search);
}
// 搜索
searchFunc=(value)=>{
this.setState({
search:value,
isSpin:true
})
const {page,limit} = this.state;
this.getIssueList(page,limit,value);
}
openorder=(type)=>{
if(type){
const { current_user } = this.props;
if(type===1){
this.setState({
status_type:'1',
openselect:current_user.user_id,
closeselect:undefined
})
this.getIssueList("","","","","","","",1);
}else{
this.setState({
status_type:'2',
openselect:undefined,
closeselect:current_user.user_id
})
this.getIssueList("","","","","","","",2);
}
}
}
render(){
const { issue_chosen , issues , limit , page , search_count , data , assigned_to_id , author_id , isSpin,openselect,closeselect } = this.state;
const { projectsId,meilid } = this.props.match.params;
const Paginations = (
<React.Fragment>
{
search_count > limit ?
<div className="mt30 mb50 edu-txt-center">
<Pagination simple defaultCurrent={page} total={search_count} pageSize={limit} onChange={this.ChangePage}></Pagination>
</div>:""
}
</React.Fragment>
)
return(
<div className="main">
<div className="topWrapper">
<p></p>
<div className="topWrapper">
<Link to={`/projects/${projectsId}/orders/${meilid}/meilpost`} className="topWrapper_btn" style={{marginRight:15}}>编辑里程碑</Link>
<Link to={`/projects/${projectsId}/orders/new`} className="topWrapper_btn">创建工单</Link>
</div>
</div>
<div className="topWrapper" style={{borderBottom:"none"}}>
<p className="topWrapper_type">
<li className={openselect ? "active":""} onClick={()=>this.openorder(1)}>{data && data.open_count}个开启中</li>
<li className={closeselect ? "active":""} onClick={()=>this.openorder(2)}>{data && data.close_count}个已关闭</li>
{/* <span onClick={this.openorder} className={author_id ? "active":""}>{data && data.open_count}</span>
<span onClick={this.closeorder} className={author_id ? "active":""}>{data && data.close_count}个已关闭</span> */}
</p>
</div>
<Spin spinning={isSpin}>
<div className="f-wrap-between mb20">
<ul className="topWrapper_type">
{/* <li>@我的</li> */}
</ul>
<ul className="topWrapper_select">
<li>
<Dropdown className="topWrapperSelect" overlay={this.renderMenu(issue_chosen && issue_chosen.issue_tag,'标签','issue_tag_id')} trigger={['click']} placement="bottomCenter">
<span>标签<Icon type="caret-down" className="ml5" /></span>
</Dropdown>
</li>
<li>
<Dropdown className="topWrapperSelect" overlay={this.renderMenu(issue_chosen && issue_chosen.issue_type,'所有类型','issue_type')} trigger={['click']} placement="bottomCenter">
<span>类型<Icon type="caret-down" className="ml5" /></span>
</Dropdown>
</li>
<li>
<Dropdown className="topWrapperSelect" overlay={this.renderMenu(issue_chosen && issue_chosen.assign_user,'指派人','assigned_to_id')} trigger={['click']} placement="bottomCenter">
<span>指派人<Icon type="caret-down" className="ml5" /></span>
</Dropdown>
</li>
</ul>
</div>
{
search_count === 0 ?
<NoneData></NoneData>
:
<OrderItem issues={issues} search_count={search_count} page={page} limit={limit} {...this.props} {...this.state}></OrderItem>
}
{ Paginations }
</Spin>
</div>
)
}
}
export default MilepostDetail;

@ -90,6 +90,11 @@ class UpdateMilepost extends Component{
}
})
}
claertime=()=>{
this.setState({
selectedValue: undefined,
})
}
render(){
const { getFieldDecorator } = this.props.form;
@ -134,7 +139,7 @@ class UpdateMilepost extends Component{
</Form.Item>
</div>
<div className="newmilepostrighe" >
截止日期(可选) <a style={{color:'red'}}>清除</a>
截止日期(可选) <a style={{color:'red'}} onClick={this.claertime}>清除</a>
<div>
<Input style={{width:"120px"}} value={this.state.selectedValue && this.state.selectedValue.format('YYYY-MM-DD')}/>
</div>
@ -173,12 +178,12 @@ class UpdateMilepost extends Component{
}
return (
<div style={{ padding: 10 }}>
<div style={{ marginBottom: '10px' }}>Custom header </div>
<Row type="flex" justify="space-between">
<Col>
<Group size="small" onChange={e => onTypeChange(e.target.value)} value={type}>
<Button value="month">Month</Button>
<Button value="year">Year</Button>
<Button value="month">月份</Button>
<Button value="year">年份</Button>
</Group>
</Col>
<Col>

@ -16,7 +16,7 @@ class NewMilepost extends Component{
this.state={
data:undefined,
value: moment('2017-01-25'),
selectedValue: moment('2020-2-12'),
selectedValue: undefined,
}
}
@ -59,6 +59,11 @@ class NewMilepost extends Component{
}
})
}
cleartime=()=>{
this.setState({
selectedValue:undefined
})
}
render(){
const { getFieldDecorator } = this.props.form;
@ -101,7 +106,7 @@ class NewMilepost extends Component{
</Form.Item>
</div>
<div className="newmilepostrighe" >
<a style={{color:'black'}}>截止日期(可选)</a> <a style={{color:'red'}}></a>
<a style={{color:'black'}}>截止日期(可选)</a> <a style={{color:'red'}} onClick={this.cleartime}></a>
<div>
<Input style={{width:"120px"}} value={this.state.selectedValue && this.state.selectedValue.format('YYYY-MM-DD')}/>
</div>
@ -140,7 +145,6 @@ class NewMilepost extends Component{
}
return (
<div style={{ padding: 10 }}>
<div style={{ marginBottom: '10px' }}>Custom header </div>
<Row type="flex" justify="space-between">
<Col>
<Group size="small" onChange={e => onTypeChange(e.target.value)} value={type}>

@ -39,7 +39,7 @@ class NewVersion extends Component{
getSelectList=()=>{
const { projectsId } = this.props.match.params;
const url = `/projects/${projectsId}/pull_requests/new.json`;
const url = `/projects/${projectsId}/version_releases/new.json`;
axios.get(url).then((result)=>{
if(result){
this.setState({
@ -70,7 +70,7 @@ class NewVersion extends Component{
this.props.form.validateFieldsAndScroll((err, values) => {
if(!err){
const { projectsId } = this.props.match.params;
const { pull,tag_name,ischeck } = this.state;
const { pull,tag_name,ischeck,fileList} = this.state;
const url = `/projects/${projectsId}/version_releases.json`;
// if(values.issue_type==="普通"){
// values.issue_type="1"
@ -80,7 +80,7 @@ class NewVersion extends Component{
tag_name:tag_name,
draft:draft,
prerelease:ischeck,
target_commitish:pull
target_commitish:pull,
}).then(result=>{
if(result){
this.props.history.push(`/projects/${projectsId}/version`);
@ -178,7 +178,7 @@ class NewVersion extends Component{
)}
</Form.Item>
<UploadComponent load={this.UploadFunc} style={{width:80,marginLeft:15}}></UploadComponent>
{/* <UploadComponent load={this.UploadFunc} style={{width:80,marginLeft:15}}></UploadComponent> */}
</div>
</div>

@ -27,16 +27,9 @@ class NewVersion extends Component{
}
componentDidMount=()=>{
this.InitData();
this.getSelectList();
}
InitData=()=>{
this.props.form.setFieldsValue({
...this.state
});
}
getSelectList=()=>{
const { projectsId,versionId} = this.props.match.params;
const url = `/projects/${projectsId}/version_releases/${versionId}/edit.json`;
@ -53,18 +46,6 @@ class NewVersion extends Component{
}
renderSelect=(list)=>{
if(list && list.length >0){
return(
list.map((item,key)=>{
return(
<Option key={key+1} value={item.id+""}>{item.name}</Option>
)
})
)
}
}
//delete
deleteversion=()=>{
const { projectsId , versionId} = this.props.match.params;
@ -86,15 +67,15 @@ class NewVersion extends Component{
handleSubmit=()=>{
this.props.form.validateFieldsAndScroll((err, values) => {
if(!err){
const { projectsId} = this.props.match.params;
const { pull,tag_name,ischeck } = this.state;
const url = `/projects/${projectsId}/version_releases/.json`;
const { projectsId,versionId} = this.props.match.params;
const { pull,ischeck } = this.state;
const url = `/projects/${projectsId}/version_releases/${versionId}.json`;
// if(values.issue_type==="普通"){
// values.issue_type="1"
// }
axios.post(url,{
axios.put(url,{
...values,
tag_name:tag_name,
tag_name:this.state.data&&this.state.data.tag_name,
draft:false,
prerelease:ischeck,
target_commitish:pull
@ -110,19 +91,13 @@ class NewVersion extends Component{
})
}
// 获取上传后的文件id数组
UploadFunc=(fileList)=>{
this.setState({
fileList
})
}
RedieonChange=(e)=>{
this.setState({
ischeck:e.target.checked
})
}
Preservation=()=>{
alert(this.state.ischeck)
alert(this.state.data.tag_name)
}
renderMenu =(array,id)=>{
@ -154,17 +129,15 @@ class NewVersion extends Component{
render(){
const { getFieldDecorator } = this.props.form;
const { current_user,projectsId} = this.props;
const {data,pull,tag_name} = this.state;
const { projectsId } = this.props.match.params;
return(
<div className="main">
<Form>
<h1 style={{marginLeft:15,marginTop:20}}>发布新版</h1>
<h5 style={{marginLeft:15}}>版本发布组织项目的版本</h5>
<Divider/>
<div style={{display:'flex'}}>
{data.tag_name}@{pull}
<div style={{display:'flex',marginLeft:15}}>
{this.state.data&&this.state.data.tag_name}@{this.state.data&&this.state.data.target_commitish}
</div>
<div style={{display:'flex'}}>
<div className="versionmilepostleft">
@ -175,7 +148,7 @@ class NewVersion extends Component{
rules: [{
required: true, message: '请输入标题'
}],
initialValue: data.name
initialValue:this.state.data&&this.state.data.name
})(
<Input placeholder="标题"/>
@ -188,13 +161,13 @@ class NewVersion extends Component{
rules: [{
required: true, message: '请输入描述内容'
}],
initialValue: data.body
initialValue:this.state.data&&this.state.data.body
})(
<TextArea placeholder="添加一个可选的扩展描述。。。" style={{height:"300px"}}/>
)}
</Form.Item>
<UploadComponent load={this.UploadFunc} style={{width:80,marginLeft:15}}></UploadComponent>
{/* <UploadComponent load={this.UploadFunc} style={{width:80,marginLeft:15}}></UploadComponent> */}
</div>
</div>
@ -204,9 +177,9 @@ class NewVersion extends Component{
<p>标记此版本不适合生产使用</p>
</div>
<div className="clearfix mt15" style={{marginTop:5}} >
<a className='topWrapper_btn_delete fr' onClick={this.deleteversion} style={{marginLeft:15}}>删除发布</a>
<a className='topWrapper_btn fr' onClick={this.handleSubmit} style={{marginRight:15}}>编辑发布信息</a>
<Link to={`/projects/${projectsId}/version`} className='topWrapper_btn fr'>取消</Link>
<a className='topWrapper_btn_delete fr' onClick={()=>this.deleteversion()} style={{marginLeft:15}}>删除发布</a>
<a className='topWrapper_btn fr' onClick={()=>this.handleSubmit()} style={{marginRight:15}}>编辑发布信息</a>
<Link to={`/projects/${projectsId}/version`} style={{marginRight:30}} className='topWrapper_btn fr'>取消</Link>
</div>
</Form>

@ -1,14 +0,0 @@
import React , { Component } from 'react';
import { Link } from 'react-router-dom';
class VersionItem extends Component{
render(){
return(
<div>
1111111111
</div>
)
}
}
export default VersionItem;

@ -22,3 +22,26 @@
line-height: 32px;
border-radius: 4px;
}
.versionrighe{
flex: 2;
height: 20px;
}
.versionleft{
flex: 1;
text-align: right;
display: flex;
justify-content: right;
}
.version_line{
display: flex;
height: 60px;
width: 2%;
margin: auto;
border-left:1px solid #eee;
}
.versiondiv{
display: flex;
}

@ -3,7 +3,6 @@ import {Link} from 'react-router-dom';
import { Input ,Dropdown , Menu , Icon , Pagination , Spin } from 'antd';
import NoneData from '../../modules/courses/coursesPublic/NoneData';
import Nav from '../Order/Nav';
import VersionItem from './VersionItem';
@ -42,36 +41,13 @@ class version extends Component{
}
componentDidMount=()=>{
this.getSelectList();
this.getIssueList();
}
getSelectList=()=>{
const { projectsId } = this.props.match.params;
const url = `/projects/${projectsId}/issues/index_chosen.json`;
axios.get(url).then((result)=>{
if(result){
this.setState({
issue_chosen:result.data.issue_chosen
})
}
}).catch((error)=>{
console.log(error);
})
}
// 获取列表数据
getIssueList=(page,limit,search,author_id,assigned_to_id,id,value)=>{
const { projectsId } = this.props.match.params;
const url = `/projects/${projectsId}/issues.json`;
axios.get(url,{
params:{
page,limit,search,author_id,assigned_to_id,
[id]:value
}
}).then((result)=>{
const url = `/projects/${projectsId}/version_releases.json`;
axios.get(url).then((result)=>{
if(result){
this.setState({
data:result.data,
@ -85,86 +61,54 @@ class version extends Component{
})
}
getOption=(e,id)=>{
this.setState({
[id]:e.key
})
const { page,limit,search,author_id,assigned_to_id } = this.state;
this.getIssueList(page,limit,search,author_id,assigned_to_id,id,e.key);
}
renderMenu =(array,name,id)=>{
render(){
const { projectsId } = this.props.match.params;
const{data}=this.state
const renderList =()=>{
if(data && data.releases && data.releases.length>0 ){
return(
<Menu>
<Menu.Item key={undefined} onClick={(e)=>this.getOption(e,id)}>{name}</Menu.Item>
<div className="tagList">
{
array && array.length > 0 && array.map((item,key)=>{
data.releases.map((item,key)=>{
return(
<Menu.Item key={item.id} onClick={(e)=>this.getOption(e,id)}>{item.name}</Menu.Item>
<div style={{display:'block'}}>
<div className="milepostdiv" style={{marginTop:5}}>
<span className={item&&item.draft==="稳定"?"opendetail":"closedetail"}>{item.draft} </span>
<span style={{marginLeft:30}}> {item.name}<Link to={`/projects/${projectsId}/version/${item.version_id}/upversion`} style={{color:'blue',marginLeft:15}}>(编辑)</Link> </span>
</div>
<div className="milepostdiv"style={{marginTop:5}}>
{item.body}
</div>
<div className="milepostdiv"style={{marginTop:5}}>
<div className="milepostrighe">
</div>
<div className="milepostleft">
<a href={item.zipball_url} download="源代码(ZIP)" style={{color:'blue',marginLeft:15}}>源代码(ZIP)</a>
</div>
</div>
<div className="milepostdiv"style={{marginTop:5}}>
<div className="milepostrighe">
</div>
<div className="milepostleft">
<a href={item.tarball_url} download="源文件(TAR.GZ)" style={{color:'blue',marginLeft:15}}>源文件(TAR.GZ)</a>
</div>
</div>
</div>
)
})
}
</Menu>
</div>
)
}
// 翻页
ChangePage=(page)=>{
this.setState({
page,
isSpin:true
})
const {limit,search} = this.state;
this.getIssueList(page,limit,search);
}
// 搜索
searchFunc=(value)=>{
this.setState({
search:value,
isSpin:true
})
const {page,limit} = this.state;
this.getIssueList(page,limit,value);
}
// 筛选:全部、指派给我、由我创建
ChangeAssign=(type)=>{
const { limit, search} = this.state;
this.setState({
isSpin:true
})
if(type){
const { current_user } = this.props;
if(type===1){
this.setState({
page:1,
author_id:current_user.user_id,
assigned_to_id:undefined
})
this.getIssueList(1,limit,search,current_user.user_id,undefined);
}else{
this.setState({
page:1,
author_id:undefined,
assigned_to_id:current_user.user_id
})
this.getIssueList(1,limit,search,undefined,current_user.user_id);
}
}else{
this.setState({
page:1,
author_id:undefined,
assigned_to_id:undefined
})
this.getIssueList(1,limit,search,undefined,undefined);
return(
<NoneData />
)
}
}
render(){
const { projectsId } = this.props.match.params;
return(
<div className="main">
<div className="topWrapper">
@ -172,12 +116,7 @@ class version extends Component{
<Link to={`/projects/${projectsId}/version/new`} className="topWrapper_btn">发布新版</Link>
</div>
<div>
1
1
1
1
1
{VersionItem}
{renderList()}
</div>
</div>

Loading…
Cancel
Save