diff --git a/public/react/src/forge/Order/MilepostDetail.js b/public/react/src/forge/Order/MilepostDetail.js
new file mode 100644
index 000000000..048ec4e36
--- /dev/null
+++ b/public/react/src/forge/Order/MilepostDetail.js
@@ -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(
+
+ )
+ }
+
+ // 翻页
+ 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 = (
+
+ {
+ search_count > limit ?
+ :""
+ }
+
+ )
+ return(
+
+
+
+
+
this.openorder(1)}>{data && data.open_count}个开启中
+
this.openorder(2)}>{data && data.close_count}个已关闭
+ {/*
{data && data.open_count}个开启中
+
{data && data.close_count}个已关闭 */}
+
+
+
+
+
+
+ -
+
+ 标签
+
+
+ -
+
+ 类型
+
+
+ -
+
+ 指派人
+
+
+
+
+ {
+ search_count === 0 ?
+
+ :
+
+ }
+ { Paginations }
+
+
+
+ )
+ }
+}
+export default MilepostDetail;
\ No newline at end of file
diff --git a/public/react/src/forge/Order/UpdateMilepost.js b/public/react/src/forge/Order/UpdateMilepost.js
index 8386306f4..4975fb39f 100644
--- a/public/react/src/forge/Order/UpdateMilepost.js
+++ b/public/react/src/forge/Order/UpdateMilepost.js
@@ -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{
- 截止日期(可选)
清除
+ 截止日期(可选)
清除
@@ -173,12 +178,12 @@ class UpdateMilepost extends Component{
}
return (
-
Custom header
+
onTypeChange(e.target.value)} value={type}>
-
-
+
+
diff --git a/public/react/src/forge/Order/newMilepost.js b/public/react/src/forge/Order/newMilepost.js
index b4e6fd0ba..1e4571487 100644
--- a/public/react/src/forge/Order/newMilepost.js
+++ b/public/react/src/forge/Order/newMilepost.js
@@ -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{
-
截止日期(可选) 清除
+
截止日期(可选) 清除
@@ -140,7 +145,6 @@ class NewMilepost extends Component{
}
return (
-
Custom header
onTypeChange(e.target.value)} value={type}>
diff --git a/public/react/src/forge/Version/NewVersion.js b/public/react/src/forge/Version/NewVersion.js
index 2efc824c9..d2ceebaf1 100644
--- a/public/react/src/forge/Version/NewVersion.js
+++ b/public/react/src/forge/Version/NewVersion.js
@@ -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{
)}
-
+ {/* */}
diff --git a/public/react/src/forge/Version/UpdateVersion.js b/public/react/src/forge/Version/UpdateVersion.js
index 8b3367c02..4b2c332f0 100644
--- a/public/react/src/forge/Version/UpdateVersion.js
+++ b/public/react/src/forge/Version/UpdateVersion.js
@@ -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(
-
- )
- })
- )
- }
- }
-
//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(
diff --git a/public/react/src/forge/Version/VersionItem.js b/public/react/src/forge/Version/VersionItem.js
deleted file mode 100644
index d21a9fa8c..000000000
--- a/public/react/src/forge/Version/VersionItem.js
+++ /dev/null
@@ -1,14 +0,0 @@
-import React , { Component } from 'react';
-import { Link } from 'react-router-dom';
-
-class VersionItem extends Component{
- render(){
- return(
-
- 1111111111
-
- )
- }
-}
-
-export default VersionItem;
\ No newline at end of file
diff --git a/public/react/src/forge/Version/version.css b/public/react/src/forge/Version/version.css
index 66b5d61d1..a6d0125c4 100644
--- a/public/react/src/forge/Version/version.css
+++ b/public/react/src/forge/Version/version.css
@@ -21,4 +21,27 @@
height: 32px;
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;
}
\ No newline at end of file
diff --git a/public/react/src/forge/Version/version.js b/public/react/src/forge/Version/version.js
index c86e2c904..ad4d09244 100644
--- a/public/react/src/forge/Version/version.js
+++ b/public/react/src/forge/Version/version.js
@@ -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,85 +61,53 @@ 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)=>{
- return(
-
- )
- }
-
- // 翻页
- 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);
- }
- }
render(){
-
const { projectsId } = this.props.match.params;
+ const{data}=this.state
+ const renderList =()=>{
+ if(data && data.releases && data.releases.length>0 ){
+ return(
+
+ {
+ data.releases.map((item,key)=>{
+ return(
+
+
+ {item.draft}
+ {item.name}(编辑)
+
+
+ {item.body}
+
+
+
+
+ )
+ })
+ }
+
+ )
+ }else{
+ return(
+
+ )
+ }
+ }
return(
@@ -172,12 +116,7 @@ class version extends Component{
发布新版
- 1
- 1
- 1
- 1
- 1
- {VersionItem}
+ {renderList()}