-
-
- -
-
-
- -
-
-
-
-
+
+
+
-
-
-
-
)
}
}
diff --git a/public/react/src/forge/Order/Detail.js b/public/react/src/forge/Order/Detail.js
index a9a045b7f..662b2260e 100644
--- a/public/react/src/forge/Order/Detail.js
+++ b/public/react/src/forge/Order/Detail.js
@@ -5,7 +5,7 @@ import axios from 'axios';
import Nav from './Nav';
import UploadComponent from '../Upload/Index';
import { getImageUrl } from 'educoder';
-import{ Modal,Col,Form,Input,Tooltip,Popconfirm } from 'antd'
+import {Modal, Col, Form, Input, Tooltip, Popconfirm, Pagination , Spin} from 'antd'
import NoneData from '../../modules/courses/coursesPublic/NoneData';
import Attachments from '../Upload/attachment'
@@ -26,7 +26,12 @@ class Detail extends Component{
titledisplay:'none',
countvalue:'',
//是否需要编辑
- isedit:'block'
+ isedit:undefined,
+ fileList:undefined,
+ limit:10,
+ page:1,
+ search_count:undefined,
+ isSpin:false,
}
}
@@ -72,12 +77,15 @@ class Detail extends Component{
if(!err){
const { data } = this.state;
const url = `/issues/${data.id}/journals.json`;
+ const { fileList } = this.state;
axios.post(url,{
...values,
issue_id:data.id,
+ attachment_ids:fileList
}).then(result=>{
if(result){
this.getjournalslist();
+ this.props.showNotification("评论成功!");
}
}).catch(error=>{
console.log(error);
@@ -86,18 +94,20 @@ class Detail extends Component{
})
}
//获取评论信息
- getjournalslist=()=>{
- const { data } = this.state;
+ getjournalslist=(page, limit)=>{
+ const { data} = this.state;
const url = `/issues/${data.id}/journals.json`;
let id=data.id;
axios.get(url,{
params:{
- id
+ id,page,limit
}
}).then(result=>{
if(result){
this.setState({
- journalsdata:result.data
+ journalsdata:result.data,
+ search_count:result.data.journals_count,
+ isSpin:false
})
}
}).catch(error=>{
@@ -105,7 +115,7 @@ class Detail extends Component{
})
}
- //删除评论信息
+ //删除工单信息
deletedetail=(id)=>{
const { projectsId , orderId} = this.props.match.params;
const url = `/projects/${projectsId}/issues/${orderId}.json`;
@@ -141,6 +151,7 @@ class Detail extends Component{
//修改评论
updatedetail=(id)=>{
+ const {page, limit } = this.state;
const {orderId} = this.props.match.params;
const url = `/issues/${orderId}/journals/${id}.json`;
axios.put(url,{
@@ -149,19 +160,26 @@ class Detail extends Component{
content:this.state.countvalue
}).then(result=>{
if(result){
- this.setState({
- isedit:'block'
- })
- this.getjournalslist();
+ // this.setState({
+ // journalsdata: 'block'
+ // })
+ this.getjournalslist(page, limit);
}
}).catch(error=>{
console.log(error);
})
}
+ // 获取上传后的文件id数组
+ UploadFunc=(fileList)=>{
+ this.setState({
+ fileList
+ })
+ }
- //删除工单
+ //删除评论
deleteorder=(id)=>{
const { orderId} = this.props.match.params;
+ const { page, limit } = this.state;
const url = `/issues/${orderId}/journals/${id}.json`;
axios.delete(url,{ data: {
issue_id: orderId,
@@ -169,7 +187,7 @@ class Detail extends Component{
}
}).then((result)=>{
if(result){
- this.getjournalslist()
+ this.getjournalslist(page,limit)
}
}).catch((error)=>{
console.log(error);
@@ -188,6 +206,39 @@ class Detail extends Component{
})
}
+ renderJournalList=(list)=>{
+ if(list && list.length >0){
+ return(
+ list.map((item,key)=>{
+ return(
+
+
+ {item.detail}:
+
+
+ {item.old_value.length > 0 ? "更新为" : "新增"}
+
+
+ {item.value && item.value.length > 0 ?
+ item.detail === "标签" ? {item.value[0].name} : item.value
+ :
+ "无"
+ }
+
+
+ )
+ })
+ )
+ }else{
+ return(
+
+ 没有评论~
+
+
+ )
+ }
+ }
+
//复制
copydetail=()=>{
const {projectsId,orderId} = this.props.match.params;
@@ -204,11 +255,31 @@ class Detail extends Component{
})
}
+ // 翻页
+ ChangePage=(page)=>{
+ this.setState({
+ page,
+ isSpin:true
+ })
+ const {limit} = this.state;
+ this.getjournalslist(page,limit);
+ }
+
render(){
const { projectsId,orderId} = this.props.match.params;
- const { data,journalsdata } = this.state;
+ const { data,journalsdata, page, limit, search_count, isSpin, isedit } = this.state;
const { getFieldDecorator } = this.props.form;
const { current_user } = this.props;
+ const Paginations = (
+
+ {
+ search_count > limit ?
+ :""
+ }
+
+ )
const renderList =()=>{
if(journalsdata && journalsdata.issue_journals && journalsdata.issue_journals.length>0 ){
return(
@@ -217,38 +288,47 @@ class Detail extends Component{
return(
-
+
-
+
{item.user_name}
- 评论于
+ 评论于
{item.created_at}
-
-
this.editdetail(item.content,'none')} className="detail_edit_action">编辑
-
this.deletedetail(item.id)}>
+
+
this.editdetail(item.content,item.id)} className="detail_edit_action">编辑
+
this.deleteorder(item.id)}>
删除
- {/*
this.editdetail(item.content,'none')}> */}
- {/*
*/}
- {/*
this.deletedetail(item.id)}>*/}
- {/* */}
- {/**/}
-
-
+
-
{item.content}
-
+
+ {
+ item.content ?
+
{item.content}
+ :
+
+ {this.renderJournalList(item.journal_details)}
+
+ }
+ {
+ item && item.attachments.length > 0 ?
+
+ :
+ ""
+ }
+
+
@@ -257,7 +337,7 @@ class Detail extends Component{
dataSource={valuse}
renderItem={obj => (
-
+
)}
/> */}
@@ -318,36 +398,40 @@ class Detail extends Component{
:
""
}
- {/*{renderAttachments()}*/}
-
-
- {renderList()}
- -
-
-
-
+
+
+
+
+
+ { Paginations }
+
+
+
+
-
-
-
+
diff --git a/public/react/src/forge/Order/UpdateDetail.js b/public/react/src/forge/Order/UpdateDetail.js
index 8c195d6a9..ed716d34d 100644
--- a/public/react/src/forge/Order/UpdateDetail.js
+++ b/public/react/src/forge/Order/UpdateDetail.js
@@ -8,6 +8,7 @@ import { getImageUrl } from 'educoder';
import{ Modal,Col,Form,Input,Tooltip,Select } from 'antd'
import NoneData from '../../modules/courses/coursesPublic/NoneData';
+import Attachments from '../Upload/attachment'
const TextArea = Input.TextArea;
const Option = Select.Option;
@@ -35,7 +36,8 @@ class UpdateDetail extends Component{
priority_id:0,
done_ratio:0,
textcount:"",
- fileList:undefined
+ fileList:undefined,
+ get_attachments: undefined
}
}
@@ -66,7 +68,13 @@ class UpdateDetail extends Component{
status_id:result.data.status_id,
priority_id:result.data.priority_id,
done_ratio:result.data.done_ratio,
- textcount:result.data.description
+ textcount:result.data.description,
+ branch_name: result.data.branch_name,
+ get_attachments: result.data.attachments,
+ fileList:undefined,
+ issue_tag_ids: result.data.issue_tags && result.data.issue_tags[0].id,
+ fixed_version_id: result.data.fixed_version_id,
+ assigned_to_id: result.data.assigned_to_id
})
// this.getjournalslist();
}
@@ -128,11 +136,15 @@ class UpdateDetail extends Component{
const { projectsId,orderId} = this.props.match.params;
const { subject } = this.state;
const url = `/projects/${projectsId}/issues/${orderId}.json`;
+
if(values.issue_tag_ids===0){
values.issue_tag_ids = ""
}else{
values.issue_tag_ids = [values.issue_tag_ids]
}
+ if(values.assigned_to_id===0){
+ values.assigned_to_id = ""
+ }
axios.put(url,{
project_id:projectsId,
subject:subject,
@@ -158,7 +170,7 @@ class UpdateDetail extends Component{
const { getFieldDecorator } = this.props.form;
const { current_user } = this.props;
const { issue_tag_ids , fixed_version_id , branch_name , status_id , tracker_id , issue_type ,assigned_to_id , priority_id , done_ratio,
- issue_chosen , branches, subject, textcount } = this.state;
+ issue_chosen , branches, subject, textcount,get_attachments } = this.state;
return(
@@ -189,23 +201,29 @@ class UpdateDetail extends Component{
)}
+ {
+ get_attachments ?
+
+ :
+ ""
+ }
保存
取消
-
+
{getFieldDecorator('branch_name', {
- initialValue:0,
+ initialValue: branch_name,
rules: [],
})(
-