-
-
-

-
-
- {item && item.user_name}
-
-
-
- {this.commentCtx(item.content)}
- {item && item.attachments && item.attachments.length > 0 ? (
-
- ) : (
- ""
- )}
-
-
{item.created_at}
-
- {current_user &&
- (current_user.admin ||
- current_user.login === item.user_login) ? (
- this.deleteorder(item.id)}
- >
-
-
- ) : (
- ""
- )}
-
-
-
+ return (
+
+
+
+

+
+
+ {item && item.user_name}
+
- );
- };
+
+ {this.commentCtx(item.content)}
+ {item && item.attachments && item.attachments.length > 0 ? (
+
+ ) : (
+ ""
+ )}
+
+
{item.created_at}
+
+ {current_user &&
+ (current_user.admin ||
+ current_user.login === item.user_login) ? (
+ this.deleteorder(item.id)}
+ >
+
+
+ ) : (
+ ""
+ )}
+
+
+
+
+ );
+ }
+ render() {
+ const { journalsdata , search_count , isSpin } = this.state;
return (
{search_count > 0 && (
@@ -191,9 +183,9 @@ class children_comments extends Component {
size="large"
loading={isSpin}
dataSource={journalsdata.issue_journals}
- renderItem={(item) => {renderList(item)}}
+ renderItem={(item) => {this.renderList(item)}}
/>
- {Paginations}
+ {this.Paginations()}
)}
diff --git a/src/forge/comments/children_journals.js b/src/forge/comments/children_journals.js
index b3a29fb72..92ecde737 100644
--- a/src/forge/comments/children_journals.js
+++ b/src/forge/comments/children_journals.js
@@ -1,11 +1,9 @@
import React, { Component } from "react";
import { Link } from "react-router-dom";
-
import axios from "axios";
import { getImageUrl } from "educoder";
import { List, Popconfirm, Pagination, Button } from "antd";
import Attachments from "../Upload/attachment";
-// import MDEditor from "../../modules/tpm/challengesnew/tpm-md-editor";
import RenderHtml from "../../components/render-html";
import "../Order/order.css";
@@ -25,7 +23,7 @@ class children_journals extends Component {
//删除评论
deleteorder = (id) => {
- const { orderId, parent_id, page, limit } = this.state;
+ const { orderId, parent_id , limit } = this.state;
const url = `/issues/${orderId}/journals/${id}.json`;
axios
.delete(url, {
@@ -37,7 +35,6 @@ class children_journals extends Component {
.then((result) => {
if (result) {
this.props.getChildrenJournals(orderId,parent_id,1,limit);
- // this.getChildrenJournals();
}
})
.catch((error) => {
@@ -51,108 +48,99 @@ class children_journals extends Component {
this.state.page = page
this.state.isSpin = true
this.props.getChildrenJournals(orderId,parent_id,page,limit);
- // this.getChildrenJournals();
};
commentCtx = (v) => {
return
-
-
-

-
-
-
-
- {item && item.user_name}
-
- {item.created_at}
-
-
-
- {current_user &&
- (current_user.admin ||
- current_user.login === item.user_login) ? (
- this.deleteorder(item.id)}
- >
-
-
- ) : (
- ""
- )}
-
-
-
-
- {this.commentCtx(item.content)}
- {item && item.attachments && item.attachments.length > 0 ? (
-
- ) : (
- ""
- )}
-
+ Paginations =()=> {
+ const { page, limit, search_count } = this.state;
+ if(search_count > limit){
+ return(
+
- );
- };
+ )
+ }
+ }
+ renderList = (item) => {
+ const { current_user } = this.props;
+ return (
+
+
+
+

+
+
+
+
+ {item && item.user_name}
+
+ {item.created_at}
+
+
+
+ {current_user &&
+ (current_user.admin ||
+ current_user.login === item.user_login) ? (
+ this.deleteorder(item.id)}
+ >
+
+
+ ) : (
+ ""
+ )}
+
+
+
+
+ {this.commentCtx(item.content)}
+ {item && item.attachments && item.attachments.length > 0 ? (
+
+ ) : (
+ ""
+ )}
+
+
+ );
+ }
+
+ render() {
+ const { journalsdata , search_count , isSpin } = this.state;
return (
{
@@ -162,13 +150,13 @@ class children_journals extends Component {
size="large"
loading={isSpin}
dataSource={journalsdata.issue_journals}
- renderItem={(item) => {renderList(item)}}
+ renderItem={(item) => {this.renderList(item)}}
/>
- {Paginations}
+ {this.Paginations()}
}
- );
+ )
}
}
diff --git a/src/forge/comments/comments.js b/src/forge/comments/comments.js
index c1a037bc5..5791d77af 100644
--- a/src/forge/comments/comments.js
+++ b/src/forge/comments/comments.js
@@ -265,7 +265,22 @@ class comments extends Component {
commentCtx = (v) => {
return
@@ -501,7 +498,7 @@ class comments extends Component {
renderItem={(item) => {renderList(item)}}
/>
)}
- {Paginations}
+ {this.Paginations()}
) : (
@@ -562,7 +559,7 @@ class comments extends Component {
)}
- {Paginations}
+ {this.Paginations()}