title()}
/>
-
+
)
}
}
diff --git a/src/forge/Merge/merge.js b/src/forge/Merge/merge.js
index 749dc860f..37124417b 100644
--- a/src/forge/Merge/merge.js
+++ b/src/forge/Merge/merge.js
@@ -290,7 +290,7 @@ class merge extends Component {
this.islogin()}>创建合并请求
-
+
-
diff --git a/src/forge/Order/Detail.js b/src/forge/Order/Detail.js
index e4e719e16..f01465d8e 100644
--- a/src/forge/Order/Detail.js
+++ b/src/forge/Order/Detail.js
@@ -2,12 +2,12 @@ import React, { Component } from "react";
import { Link } from "react-router-dom";
import axios from "axios";
-import UploadComponent from "../Upload/Index";
import { getImageUrl } from "educoder";
import { Modal, Form, Tooltip, Popconfirm, Pagination, Spin, Tag } from "antd";
import Attachments from "../Upload/attachment";
-import MDEditor from "../../modules/tpm/challengesnew/tpm-md-editor";
+// import MDEditor from "../../modules/tpm/challengesnew/tpm-md-editor";
import RenderHtml from "../../components/render-html";
+import Comments from "../comments/comments"
import "./order.css";
// import AmplifyImg from "./AmplifyImg";
@@ -55,7 +55,7 @@ class Detail extends Component {
this.setState({
data: result.data,
});
- this.getjournalslist();
+ // this.getjournalslist();
}
})
.catch((error) => {
@@ -74,91 +74,91 @@ class Detail extends Component {
});
};
- imgshow = () => {
- this.setState({
- isShow: true,
- });
- };
+ // imgshow = () => {
+ // this.setState({
+ // isShow: true,
+ // });
+ // };
//添加评论
- addjournals = () => {
- const { quillValue } = this.state;
- this.setState({
- journal_spin: true,
- });
- if (!quillValue) {
- this.setState({
- quillFlag: true,
- journal_spin: false,
- });
- return;
- }
- this.props.form.validateFieldsAndScroll((err, values) => {
- if (!err) {
- const { data, page, limit, fileList } = this.state;
- const url = `/issues/${data.id}/journals.json`;
- axios
- .post(url, {
- ...values,
- content: quillValue,
- issue_id: data.id,
- attachment_ids: fileList,
- })
- .then((result) => {
- if (result) {
- this.props.showNotification("评论成功!");
- this.props.form.setFieldsValue({
- content: "",
- });
- this.setState({
- showFiles: false,
- quillValue: "",
- quillFlag: false,
- journal_spin: false,
- });
- this.getjournalslist(page, limit);
- }
- })
- .catch((error) => {
- this.setState({
- journal_spin: false,
- });
- console.log(error);
- });
- } else {
- this.setState({
- journal_spin: false,
- });
- }
- });
- };
+ // addjournals = () => {
+ // const { quillValue } = this.state;
+ // this.setState({
+ // journal_spin: true,
+ // });
+ // if (!quillValue) {
+ // this.setState({
+ // quillFlag: true,
+ // journal_spin: false,
+ // });
+ // return;
+ // }
+ // this.props.form.validateFieldsAndScroll((err, values) => {
+ // if (!err) {
+ // const { data, page, limit, fileList } = this.state;
+ // const url = `/issues/${data.id}/journals.json`;
+ // axios
+ // .post(url, {
+ // ...values,
+ // content: quillValue,
+ // issue_id: data.id,
+ // attachment_ids: fileList,
+ // })
+ // .then((result) => {
+ // if (result) {
+ // this.props.showNotification("评论成功!");
+ // this.props.form.setFieldsValue({
+ // content: "",
+ // });
+ // this.setState({
+ // showFiles: false,
+ // quillValue: "",
+ // quillFlag: false,
+ // journal_spin: false,
+ // });
+ // this.getjournalslist(page, limit);
+ // }
+ // })
+ // .catch((error) => {
+ // this.setState({
+ // journal_spin: false,
+ // });
+ // console.log(error);
+ // });
+ // } else {
+ // this.setState({
+ // journal_spin: false,
+ // });
+ // }
+ // });
+ // };
//获取评论信息
- getjournalslist = (page, limit) => {
- const { data } = this.state;
- const url = `/issues/${data.id}/journals.json`;
- let id = data.id;
- axios
- .get(url, {
- params: {
- id,
- page,
- limit,
- },
- })
- .then((result) => {
- if (result) {
- this.setState({
- journalsdata: result.data,
- search_count: result.data.journals_count,
- isSpin: false,
- fileList: undefined,
- });
- }
- })
- .catch((error) => {
- console.log(error);
- });
- };
+ // getjournalslist = (page, limit) => {
+ // const { data } = this.state;
+ // const url = `/issues/${data.id}/journals.json`;
+ // let id = data.id;
+ // axios
+ // .get(url, {
+ // params: {
+ // id,
+ // page,
+ // limit,
+ // },
+ // })
+ // .then((result) => {
+ // if (result) {
+ // this.setState({
+ // journalsdata: result.data,
+ // search_count: result.data.journals_count,
+ // isSpin: false,
+ // fileList: undefined,
+ // });
+ // }
+ // })
+ // .catch((error) => {
+ // console.log(error);
+ // });
+ // };
//删除任务信息
deletedetail = (id) => {
@@ -202,63 +202,63 @@ class Detail extends Component {
};
//修改评论
- updatedetail = (id) => {
- const { page, limit, countvalue } = this.state;
- const { orderId } = this.props.match.params;
- this.setState({
- edit_spin: true,
- });
- const url = `/issues/${orderId}/journals/${id}.json`;
- axios
- .put(url, {
- issue_id: orderId,
- id: id,
- content: countvalue,
- })
- .then((result) => {
- if (result) {
- this.setState({
- isedit: undefined,
- edit_spin: false,
- });
- this.getjournalslist(page, limit);
- }
- })
- .catch((error) => {
- this.setState({
- edit_spin: false,
- });
- console.log(error);
- });
- };
+ // updatedetail = (id) => {
+ // const { page, limit, countvalue } = this.state;
+ // const { orderId } = this.props.match.params;
+ // this.setState({
+ // edit_spin: true,
+ // });
+ // const url = `/issues/${orderId}/journals/${id}.json`;
+ // axios
+ // .put(url, {
+ // issue_id: orderId,
+ // id: id,
+ // content: countvalue,
+ // })
+ // .then((result) => {
+ // if (result) {
+ // this.setState({
+ // isedit: undefined,
+ // edit_spin: false,
+ // });
+ // this.getjournalslist(page, limit);
+ // }
+ // })
+ // .catch((error) => {
+ // this.setState({
+ // edit_spin: false,
+ // });
+ // console.log(error);
+ // });
+ // };
// 获取上传后的文件id数组
- UploadFunc = (fileList) => {
- this.setState({
- fileList,
- });
- };
+ // 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,
- id: id,
- },
- })
- .then((result) => {
- if (result) {
- this.getjournalslist(page, limit);
- }
- })
- .catch((error) => {
- console.log(error);
- });
- };
+ // 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,
+ // id: id,
+ // },
+ // })
+ // .then((result) => {
+ // if (result) {
+ // this.getjournalslist(page, limit);
+ // }
+ // })
+ // .catch((error) => {
+ // console.log(error);
+ // });
+ // };
editdetail = (count, status) => {
this.setState({
@@ -267,42 +267,42 @@ class Detail extends Component {
});
};
- renderJournalList = (list) => {
- if (list && list.length > 0) {
- return list.map((item, key) => {
- return (
-
- {item.detail}:
-
- {item.old_value && item.old_value.length > 0 ? "更新为" : "新增"}
-
-
- {item.value && item.value.length > 0 ? (
- item.detail === "标签" ? (
-
- {item.value[0].name}
-
- ) : (
- item.value
- )
- ) : (
- "无"
- )}
-
-
- );
- });
- } else {
- return (
-
- 没有评论~
-
- );
- }
- };
+ // renderJournalList = (list) => {
+ // if (list && list.length > 0) {
+ // return list.map((item, key) => {
+ // return (
+ //
+ // {item.detail}:
+ //
+ // {item.old_value && item.old_value.length > 0 ? "更新为" : "新增"}
+ //
+ //
+ // {item.value && item.value.length > 0 ? (
+ // item.detail === "标签" ? (
+ //
+ // {item.value[0].name}
+ //
+ // ) : (
+ // item.value
+ // )
+ // ) : (
+ // "无"
+ // )}
+ //
+ //
+ // );
+ // });
+ // } else {
+ // return (
+ //
+ // 没有评论~
+ //
+ // );
+ // }
+ // };
//复制
copydetail = () => {
@@ -341,23 +341,23 @@ class Detail extends Component {
showFiles: flag,
});
};
- // 新建评论
- onContentChange = (value) => {
- if (value) {
- this.setState({
- quillValue: value,
- quillFlag: false,
- });
- }
- };
- // 编辑评论
- onEditContentChange = (value) => {
- if (value) {
- this.setState({
- countvalue: value,
- });
- }
- };
+ // // 新建评论
+ // onContentChange = (value) => {
+ // if (value) {
+ // this.setState({
+ // quillValue: value,
+ // quillFlag: false,
+ // });
+ // }
+ // };
+ // // 编辑评论
+ // onEditContentChange = (value) => {
+ // if (value) {
+ // this.setState({
+ // countvalue: value,
+ // });
+ // }
+ // };
handleShowImage = (value) => {
this.setState({
@@ -390,193 +390,193 @@ class Detail extends Component {
const { projectsId, orderId } = this.props.match.params;
const {
data,
- journalsdata,
- page,
- limit,
- search_count,
- isSpin,
- isedit,
- showFiles,
- quillValue,
- quillFlag,
- countvalue,
- imageUrl,
- visible,
- journal_spin,
- edit_spin,
+ // journalsdata,
+ // page,
+ // limit,
+ // search_count,
+ // isSpin,
+ // isedit,
+ // showFiles,
+ // quillValue,
+ // quillFlag,
+ // countvalue,
+ // imageUrl,
+ // visible,
+ // journal_spin,
+ // edit_spin,
} = this.state;
- const { current_user } = this.props;
- const Paginations = (
-
- {search_count > limit ? (
-
- ) : (
- ""
- )}
-
- );
- const renderList = () => {
- if (
- journalsdata &&
- journalsdata.issue_journals &&
- journalsdata.issue_journals.length > 0
- ) {
- return (
-
- {journalsdata.issue_journals.map((item, key) => {
- return (
-
-
- {key > 0 && (
-
- )}
-
-
-

-
+ // const { current_user } = this.props;
+ // const Paginations = (
+ //
+ // {search_count > limit ? (
+ //
+ // ) : (
+ // ""
+ // )}
+ //
+ // );
+ // const renderList = () => {
+ // if (
+ // journalsdata &&
+ // journalsdata.issue_journals &&
+ // journalsdata.issue_journals.length > 0
+ // ) {
+ // return (
+ //
+ // {journalsdata.issue_journals.map((item, key) => {
+ // return (
+ //
-
+ // {key > 0 && (
+ //
+ // )}
+ //
+ //
+ //

+ //
-
-
-
- {item.user_name}
- 评论于
-
- {item.created_at}
-
-
-
-
- this.editdetail(item.content, item.id)
- }
- className="detail_edit_action"
- >
- 编辑
-
-
this.deleteorder(item.id)}
- >
- 删除
-
-
-
-
-
- {item.content ? (
- this.commentCtx(item.content)
- ) : (
-
- {this.renderJournalList(item.journal_details)}
-
- )}
- {item &&
- item.attachments &&
- item.attachments.length > 0 ? (
-
- ) : (
- ""
- )}
-
-
-
-
-
-
-
- );
- })}
-
- );
- }
- };
+ //
+ //
+ //
+ // {item.user_name}
+ // 评论于
+ //
+ // {item.created_at}
+ //
+ //
+ //
+ //
+ // this.editdetail(item.content, item.id)
+ // }
+ // className="detail_edit_action"
+ // >
+ // 编辑
+ //
+ //
this.deleteorder(item.id)}
+ // >
+ // 删除
+ //
+ //
+ //
+ //
+ //
+ // {item.content ? (
+ // this.commentCtx(item.content)
+ // ) : (
+ //
+ // {this.renderJournalList(item.journal_details)}
+ //
+ // )}
+ // {item &&
+ // item.attachments &&
+ // item.attachments.length > 0 ? (
+ //
+ // ) : (
+ // ""
+ // )}
+ //
+ //
+ //
+ //
+ //
+ //
+ //
+ // );
+ // })}
+ //
+ // );
+ // }
+ // };
const get_color = (type) => {
if (type === "高") {
return "#e67e22";
@@ -685,8 +685,9 @@ class Detail extends Component {
""
)}
+
-
+
分支:
@@ -791,56 +792,56 @@ class Detail extends Component {
//
// {data && data.description && (data.description.length > 0) ? this.commentCtx(data.description) : 没有描述}
//
- // {
- // data && data.attachments && data.attachments.length > 0 ?
- //
- // :
- // ""
- // }
+ // {
+ // data && data.attachments && data.attachments.length > 0 ?
+ //
+ // :
+ // ""
+ // }
//
//
- //
- //
- //
- //
+ //
+ //
+ //
+ //
- // {Paginations}
- // {
- // current_user && current_user.login ?
- //
- //
- //
- //

- //
+ //
+ //
+ // :
+ //
登录并参与到对话中
+ // }
//
//
diff --git a/src/forge/Order/New.js b/src/forge/Order/New.js
index 18fd5dd1c..fad9b46ac 100644
--- a/src/forge/Order/New.js
+++ b/src/forge/Order/New.js
@@ -125,6 +125,8 @@ class New extends Component {
description: '',
isSpin: false
})
+ const { getDetail } = this.props;
+ getDetail && getDetail();
}
}).catch(error => {
this.setState({
@@ -181,7 +183,7 @@ class New extends Component {
-
+
创建任务
diff --git a/src/forge/Order/OrderItem.js b/src/forge/Order/OrderItem.js
index c2d731d53..0b0870932 100644
--- a/src/forge/Order/OrderItem.js
+++ b/src/forge/Order/OrderItem.js
@@ -1,7 +1,7 @@
import React, { Component } from 'react';
import { Link } from 'react-router-dom';
import { Popconfirm } from 'antd'
-
+import { TagInfo } from '../Utils/TagColor';
class OrderItem extends Component {
@@ -18,7 +18,7 @@ class OrderItem extends Component {
return (
issue_tags.map((item, key) => {
return (
- {item.name}
+ {item.name}
)
})
)
@@ -43,88 +43,79 @@ class OrderItem extends Component {
isdisplay: false
})
}
-
render() {
- const { issues, search_count, page, limit } = this.props;
+ const { item, key, checkbox } = this.props;
const { projectsId } = this.props.match.params;
const { current_user } = this.props
const renderList = () => {
- if (issues && issues.length > 0) {
+ if (item) {
return (
- issues.map((item, key) => {
- return (
-
-
-
- # {search_count - (key + (page - 1) * limit)}
- {item.name}
-
-
- {item.format_time}发布
- {
- item.updated_at === item.format_time ?
- ""
- :
- {item.updated_at}更新
- }
-
-
-
this.onMouseMove(item.id)} onMouseOut={() => this.onMouseOut()} >
- - {this.set_issue_tags(item.issue_tags)}
- - {item.tracker || "--"}
- -
- {
- item.author_name ?
-
- {item.author_name}
-
- : "--"
- }
-
- -
- {
- item.assign_user_name ?
-
- {item.assign_user_name}
-
- : "--"
- }
-
- {item.priority || "--"}
- - {item.done_ratio || "--"}
- -
-
-
- {item.journals_count ? {item.journals_count} : ""}
-
- {
- current_user && current_user.login ?
-
-
-
-
-
-
this.deletedetail(item.id)}>
-
-
-
-
- : ""
- }
+
+ {current_user && current_user.login && checkbox}
+
+
+ {item.name}
+ {TagInfo(item.priority,"ml10")}
+
+
+ {item.format_time}发布
+ {
+ item.updated_at === item.format_time ? "" :
+ {item.updated_at}更新
+ }
+
+
+
this.onMouseMove(item.id)} onMouseOut={() => this.onMouseOut()} >
+ - {this.set_issue_tags(item.issue_tags)}
+ -
+ {
+ item.author_name ?
+
+ {item.author_name}
+
+ : "--"
+ }
+
+ -
+ {
+ item.assign_user_name ?
+
+ {item.assign_user_name}
+
+ : "--"
+ }
+
+ - {item.tracker || "--"}
+ - {item.version || "--"}
+ - {item.issue_status || "--"}
+ - {item.done_ratio || "--"}
+ -
+
+
{item.journals_count}
+ {
+ current_user && current_user.login ?
+
+
+
+
+
+
this.deletedetail(item.id)}>
+
+
+
-
-
-
- )
- })
+ : ""
+ }
+
+
+
+
)
}
}
return (
-
- {renderList()}
-
+ renderList()
)
}
}
diff --git a/src/forge/Order/index.scss b/src/forge/Order/index.scss
new file mode 100644
index 000000000..f6b760b6a
--- /dev/null
+++ b/src/forge/Order/index.scss
@@ -0,0 +1,72 @@
+.screenWrap{
+ background:rgba(250,250,250,1);
+ border:1px solid rgba(221,221,221,1);
+}
+
+.searchBanner{
+ display: flex;
+ height: 50px;
+ line-height: 50px;
+ li{
+ margin-right: 30px;
+ display: flex;
+ align-items: center;
+ }
+ li > label{
+ position: relative;
+ cursor: pointer;
+ }
+ li > span{
+ display: block;
+ padding:0px 8px;
+ border-radius: 10px;
+ background-color: #eee;
+ margin-left: 5px;
+ cursor: pointer;
+ height: 20px;
+ line-height: 20px;
+ }
+ li.active > label::after{
+ position: absolute;
+ width: 100%;
+ height: 2px;
+ content: '';
+ left: 0px;
+ bottom:0px;
+ background-color:#5091FF;
+ }
+}
+.milepostleft{
+ &>div{
+ display: flex;
+ align-items: center;
+ justify-content: center
+ }
+}
+.statusTag{
+ display: block;
+ height: 24px;
+ line-height: 24px;
+ border-radius: 4px;
+ padding:0px 12px;
+ color: #fff;
+ margin:3px 0px 0px 10px;
+}
+
+.updateBtn{
+ display: block;
+ width:60px;
+ text-align: center;
+ height: 26px;
+ line-height: 26px;
+ background-color: #fff;
+ border-radius: 5px;
+}
+.updateBtn.blue{
+ border:1px solid #5091FF;
+ color: #5091FF;
+}
+.updateBtn.red{
+ border:1px solid #F73030;
+ color: #F73030;
+}
\ No newline at end of file
diff --git a/src/forge/Order/order.css b/src/forge/Order/order.css
index c083942b4..1c1319cd0 100644
--- a/src/forge/Order/order.css
+++ b/src/forge/Order/order.css
@@ -1,9 +1,8 @@
.topWrapper {
- padding: 20px 0;
+ padding-bottom:20px;
box-sizing: border-box;
display: flex;
justify-content: space-between;
- border-bottom: 1px solid #EEEEEE;
flex-wrap: wrap;
}
.quillContent{
@@ -129,8 +128,9 @@
border-radius: 0px 5px 5px 0px;
}
.topWrapper_btn {
- background: #21ba45;
- color: #FFFFFF!important;
+ background: #fff;
+ border:1px solid #5091FF;
+ color: #5091FF!important;
padding:0px 12px;
text-align: center;
height: 32px;
@@ -138,23 +138,29 @@
border-radius: 4px;
}
.topWrapper_type{
- border:1px solid #f4f4f4;
- border-radius: 6px;
display: flex;
}
.topWrapper_type li{
+ display: flex;
+ align-items: center;
+ margin-right: 30px;
+}
+.topWrapper_type li >span{
+ display: block;
height: 30px;
line-height: 30px;
- border-left:1px solid #f4f4f4;
- padding:0px 8px;
+ padding: 0px 13px;
+ border-radius: 5px;
+ min-width: 60px;
+ box-sizing: border-box;
+ text-align: center;
+ background:rgba(250,250,250,1);
+ border:1px solid rgba(221,221,221,1);
cursor: pointer;
- color: #666
}
-.topWrapper_type li.active{
+.topWrapper_type li > span.active{
color: #4CACFF;
-}
-.topWrapper_type li:first-child{
- border-left: none;
+ border:1px solid rgba(80,145,255,1);
}
.topWrapper_select{
display: flex;
@@ -202,9 +208,6 @@
border-bottom:1px dashed #cecdcd;
padding:16px 0px;
}
-.issueItem:first-child{
- border-top:1px dashed #cecdcd;
-}
.issueNo{
padding:0px 5px;
border-radius: 4px;
@@ -421,10 +424,8 @@
width: 80%;
}
.milepostleft{
- text-align: right;
display: flex;
- justify-content: right;
- width: 20%;
+ justify-content: center;
}
.textwidth{
display: flex;
@@ -495,7 +496,7 @@
flex-wrap: wrap;
}
.issue-tag-show{padding: 3px 8px; color: #fff; border-radius: 6px;}
-.journal-list-item{padding: 12px 15px}
+.journal-list-item{padding: 10px}
/*.DetailRight > p >span:nth-child(1){*/
/*min-width: 90px;*/
@@ -531,9 +532,9 @@ a.issue-type-button.active:hover{background: #f4f4f4; color: #4CACFF;}
.attachment-list-div:hover .attachment-list-delete{display: block !important;}
.attachment-list-a{color: rgba(0, 0, 0, 0.65) !important;}
.btp1{border-top: 1px solid #f4f4f4;}
+
.grid-item{display: grid; align-items: center; grid-template-columns: max-content 1fr;}
.grid-item-left{display: grid; align-items: center; grid-template-columns: 1fr max-content ;}
-
.fwb{font-weight: bold;}
/* 发布人、指派人数量过多时要出现滚动条 */
@@ -566,4 +567,20 @@ a.issue-type-button.active:hover{background: #f4f4f4; color: #4CACFF;}
margin-right: 15px;
text-align: right;
color:#888888;
+}
+.list-left-padding{padding: 0 0 0 20px !important;}
+.comment-background{
+ background:rgba(250,250,250,1);
+ /* padding: 15px; */
+ border: 1px solid #f4f4f4;
+}
+.border-bottom-comment{border-bottom: 1px solid #eee;}
+.comment-background .ant-list-header{padding: 20px;}
+.comment-background .ant-list-item{padding: 10px;}
+.comment-background .ant-list-split .ant-list-item:last-child{border-bottom: 1px solid #e8e8e8;}
+.commentStyle{background-color: #fff !important;}
+.reply-comment-input .add_reply_button{background-color: #fff !important; color: #888; width: 100%; text-align: left;}
+.children-comment-bg{
+ background:rgba(241,248,255,1);
+border:1px solid rgba(238,238,238,1);
}
\ No newline at end of file
diff --git a/src/forge/Order/order.js b/src/forge/Order/order.js
index 80ff73964..2b9fd2043 100644
--- a/src/forge/Order/order.js
+++ b/src/forge/Order/order.js
@@ -1,6 +1,8 @@
import React, { Component } from "react";
-import { Input, Dropdown, Menu, Icon, Pagination, Spin } from "antd";
+import { Input, Dropdown, Menu, Icon, Pagination, Spin, DatePicker, Checkbox } from "antd";
import "./order.css";
+import './index.scss';
+import moment from 'moment';
import NoneData from "../Nodata";
import OrderItem from "./OrderItem";
@@ -33,32 +35,40 @@ class order extends Component {
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,
issue_tag_ids: "标签",
- tracker_ids: "所有分类",
+ tracker_ids: "类型",
author_ids: "发布人",
- assigned_to_ids: "指派人",
- priority_ids: "优先度",
+ assigned_to_ids: "负责人",
+ fixed_version_ids: "里程碑",
+ status_ids: "状态",
done_ratios: "完成度",
paix: "排序",
+ update_author_ids:"更换负责人",
+ update_fixed_version_ids:'更换里程碑',
+ update_status_ids:"修改状态",
+ begin: '',
+ end: '',
+ checkedValue: [],
+ allValue: [],
+ all: false,
select_params: {
- status_type: "1", //开启中和关闭中,默认为开启中的
- assigned_to_id: undefined, // 指派人
+ status_type: undefined, //开启中和关闭中,全部,默认为全部
+ assigned_to_id: undefined, // 负责人
author_id: undefined, // 发布人
issue_tag_id: undefined, // 标签
- tracker_id: undefined, //所有分类
+ tracker_id: undefined, //类型
done_ratio: undefined, // 完成度
- priority_id: undefined, // 优先级
+ status_id: undefined, // 优先级
+ fixed_version_id: undefined,//里程碑
order_name: undefined,
order_type: undefined,
search: undefined,
+ update_author_id:undefined,
+ update_fixed_version_id:undefined,
+ update_status_id:undefined,
page: 1,
limit: 15,
},
@@ -71,39 +81,52 @@ class order extends Component {
};
getSelectList = () => {
+ this.setState({
+ isSpin: true
+ })
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,
- });
- }
- })
+ axios.get(url).then((result) => {
+ if (result) {
+ this.setState({
+ issue_chosen: result.data.issue_chosen,
+ isSpin: false
+ });
+ }
+ })
.catch((error) => {
console.log(error);
});
};
// 获取列表数据
- getIssueList = () => {
+ getIssueList = (begin, end) => {
+ this.setState({
+ isSpin: true
+ })
const { select_params } = this.state;
const { projectsId } = this.props.match.params;
const url = `/projects/${projectsId}/issues.json`;
axios
.get(url, {
- params: select_params,
+ params: {
+ ...select_params,
+ start_date: begin,
+ due_date: end
+ }
})
.then((result) => {
if (result) {
+ const issues = result.data.issues
this.setState({
data: result.data,
- issues: result.data.issues,
+ issues: issues,
search_count: result.data.search_count,
isSpin: false,
+ allValue: issues && issues.length > 0 && issues.map((item) => {
+ return (item.id)
+ })
});
}
})
@@ -145,35 +168,38 @@ class order extends Component {
this.getIssueList();
};
- getOption = (e, id, name) => {
+ getOption = (e, id, name,toGet) => {
const { current_user } = this.props;
- this.setState({
- isSpin: true,
- });
let option_id = e.key === "all" ? undefined : e.key;
- this.state.select_params[`${id}`] = option_id;
- this.state.select_params.page = 1;
- this.state[`${id}s`] = name;
- if (current_user) {
- if ( this.state.select_params.author_id && parseInt(this.state.select_params.author_id) === current_user.user_id) {
- this.state.author_id = current_user.user_id;
- } else {
- this.state.author_id = undefined;
- }
- if (this.state.select_params.assigned_to_id && parseInt(this.state.select_params.assigned_to_id) === current_user.user_id ) {
- this.state.assigned_to_id = current_user.user_id;
+ let select_params = this.state.select_params;
+ select_params[`${id}`] = option_id;
+ select_params.page = 1;
+ if (current_user) {
+ if (this.state.select_params.author_id && parseInt(this.state.select_params.author_id) === current_user.user_id) {
+ select_params.author_id = current_user.user_id;
} else {
- this.state.assigned_to_id = undefined;
+ select_params.author_id = undefined;
+ }
+ if (this.state.select_params.assigned_to_id && parseInt(this.state.select_params.assigned_to_id) === current_user.user_id) {
+ select_params.assigned_to_id = current_user.user_id;
+ } else {
+ select_params.assigned_to_id = undefined;
}
}
- this.getIssueList();
+ this.setState({
+ [`${id}s`] : name,
+ select_params
+ });
+ if(!toGet){
+ this.getIssueList();
+ }
};
- renderMenu = (array, name, id) => {
+ renderMenu = (array, name, id,toGet) => {
return (
) : (
- ""
- )}
+ ""
+ )}
);
return (
-
-
-
this.openorder("1")}
- >
- {data && data.open_count}个开启中
+
+
+ -
+
+ this.openorder()}
+ >{data && data.all_count}
- - this.openorder("2")}
- >
- {data && data.close_count}个已关闭
+
-
+
+ this.openorder("1")}
+ >{data && data.open_count}
-
-
-
+
-
-
- - this.ChangeAssign()}
- >
- 全部
-
- - this.ChangeAssign(1)}
- >
- 指派给我
-
- - this.ChangeAssign(2)}
- >
- 由我创建
-
-
-
- -
-
-
- {this.state.issue_tag_ids}
-
-
-
-
- -
-
-
- {this.state.tracker_ids}
-
-
-
-
- -
-
-
- {this.state.author_ids}
-
-
-
-
- -
-
-
- {this.state.assigned_to_ids}
-
-
-
-
- -
-
-
- {this.state.priority_ids}
-
-
-
-
- -
-
-
- {this.state.done_ratios}
-
-
-
-
- -
-
-
- {this.state.paix}
-
-
-
-
-
+
+
+
+ {checkedValue && checkedValue.length > 0 ?
+
选中{checkedValue.length}个issue
+ :
+
+ - this.ChangeAssign()}
+ >
+
+ {data && data.search_count}
+
+ - this.ChangeAssign(1)}
+ >
+
+ {data && data.assign_me_count}
+
+ - this.ChangeAssign(2)}
+ >
+
+ {data && data.my_published_count}
+
+
+ }
+
+ {
+ checkedValue && checkedValue.length>0 ?
+
+ -
+
+
+ {this.state.update_author_ids}
+
+
+
+
+ -
+
+
+ {this.state.update_fixed_version_ids}
+
+
+
+
+ -
+
+
+ {this.state.update_status_ids}
+
+
+
+
+ 确定
+ 删除
+
+ :
+
+ -
+
+
+ {this.state.issue_tag_ids}
+
+
+
+
+ -
+
+
+ {this.state.author_ids}
+
+
+
+
+ -
+
+
+ {this.state.assigned_to_ids}
+
+
+
+
+ -
+
+
+ {this.state.tracker_ids}
+
+
+
+
+ -
+
+
+ {this.state.fixed_version_ids}
+
+
+
+
+ -
+
+
+ {this.state.status_ids}
+
+
+
+
+ -
+
+
+ {this.state.done_ratios}
+
+
+
+
+ -
+
+
+ {this.state.paix}
+
+
+
+
+
+ }
+
{search_count === 0 ? (
) : (
-
- )}
+
+
+ {issues && issues.length > 0 && issues.map((item, key) => {
+ return (
+ }
+ search_count={search_count}
+ page={select_params.page}
+ limit={select_params.limit}
+ {...this.props}
+ {...this.state}
+ deletedetail={this.deletedetail}
+ >
+ )
+ })}
+
+
+ )}
{Paginations}
diff --git a/src/forge/Upload/Index.js b/src/forge/Upload/Index.js
index 9aba86bb7..4d49c415e 100644
--- a/src/forge/Upload/Index.js
+++ b/src/forge/Upload/Index.js
@@ -73,9 +73,18 @@ class Index extends Component {
array && this.props.load && this.props.load(array);
}
+ beforeUpload = (file)=>{
+ const { size } = this.props;
+ const isLt100M = file.size / 1024 / 1024 < size;
+ if (!isLt100M) {
+ this.props.showNotification(`文件大小必须小于${size}MB!`);
+ }
+ return isLt100M;
+ }
+
render() {
//判断是否已经提交,如已提交评论则上一条评论数据清除
- const { isComplete } = this.props;
+ const { isComplete , icon } = this.props;
const { fileList } = this.state;
let list = isComplete === true ? fileList : undefined;
@@ -85,13 +94,14 @@ class Index extends Component {
action: `${getUploadActionUrl()}`,
onChange: this.handleChange,
onRemove: this.onAttachmentRemove,
+ beforeUpload:this.beforeUpload
};
return (
-
-
- 拖动文件或者点击此处上传
+
+ { icon || }
+ 拖动文件或点击此处上传
)
diff --git a/src/forge/Upload/attachment.js b/src/forge/Upload/attachment.js
index d1f099f22..812156f30 100644
--- a/src/forge/Upload/attachment.js
+++ b/src/forge/Upload/attachment.js
@@ -47,11 +47,11 @@ class Attachment extends Component{
{
attachments ?
-
+
{
attachments.map((item,key)=>{
return(
-
0 && Deleted.indexOf(item.id) !== -1) ? "none" : "block"}} className="mt10 attachment-list-div" >
+
0 && Deleted.indexOf(item.id) !== -1) ? "none" : "block"}} className="pd510 attachment-list-div" >
{item.title}
diff --git a/src/forge/Utils/TagColor.jsx b/src/forge/Utils/TagColor.jsx
new file mode 100644
index 000000000..451ba0aa0
--- /dev/null
+++ b/src/forge/Utils/TagColor.jsx
@@ -0,0 +1,20 @@
+import React from 'react';
+import { Tag } from 'antd';
+
+/**
+ * tagname:标签名字
+ * className:额外需要添加的样式
+ */
+export function TagInfo (tagname,className){
+ let color = '#e74c3c';
+ if(tagname === "高"){
+ color = '#e67e22';
+ }else if(tagname === "正常"){
+ color = '#28be6c';
+ }else if(tagname === "低"){
+ color = '#1abc9c';
+ }else{
+ color = '#e74c3c';
+ }
+ return (
{tagname});
+}
\ No newline at end of file
diff --git a/src/forge/Utils/Time.js b/src/forge/Utils/Time.js
index 921d9c4aa..55d73441b 100644
--- a/src/forge/Utils/Time.js
+++ b/src/forge/Utils/Time.js
@@ -1,5 +1,5 @@
-function getDateTime(value, dataformat) {
+export function getDateTime(value, dataformat) {
Date.prototype.format = function (format) {
var date = {
"M+": this.getMonth() + 1,
diff --git a/src/forge/Version/New.jsx b/src/forge/Version/New.jsx
index 08dda807a..bed9a6428 100644
--- a/src/forge/Version/New.jsx
+++ b/src/forge/Version/New.jsx
@@ -1,70 +1,275 @@
-import React , { useState, useEffect } from 'react';
-import styled from 'styled-components';
-import { AutoComplete } from 'antd';
-import axios from 'axios';
-import './version.css';
+import React, { useState, useEffect, useCallback, forwardRef } from "react";
+import styled from "styled-components";
+import { AutoComplete, Select, Input, Checkbox, Button, Form } from "antd";
-export default (projectDetail)=>{
- const [ tagList , setTagList ] = useState(undefined);
+import Editor from "../../modules/tpm/challengesnew/tpm-md-editor";
+import Upload from "../Upload/Index";
+import Attachments from "../Upload/attachment";
+import axios from "axios";
+import "./version.css";
+import UploadImg from "../Images/upload.png";
- const SelectDiv = styled.div`
- display:flex;
- align-item:center;
- margin-bottom:5px;
- & span{
- margin:0px 15px;
- color:#BBB;
- line-height:35px;
- }
- `;
+const { Option } = AutoComplete;
- const repo_id = projectDetail && projectDetail.repo_id;
- useEffect(() => {
- if (repo_id) {
- const url = `/repositories/${repo_id}/tags.json`;
- axios.get(url).then((result) => {
- if (result) {
- setTagList(result.data);
+export default Form.create()(
+ forwardRef(
+ (
+ { form, projectDetail, branchs, match, showNotification, history },
+ ref
+ ) => {
+ const { getFieldDecorator, validateFields, setFieldsValue } = form;
+ const [tagList, setTagList] = useState(undefined);
+ const [branchList, setBranchList] = useState(undefined);
+ const [desc, setDesc] = useState(null);
+ const [fileList, setFileList] = useState(undefined);
+ const [attachment, setAttachment] = useState(undefined);
+
+ const SelectDiv = styled.div`
+ display: flex;
+ align-item: center;
+ margin-bottom: 5px;
+ & .ant-row {
+ margin-bottom: 0px;
}
- }).catch(error => {
- console.log(error);
- })
- }
- }, [repo_id]);
- return(
-
-
-
创建发行版
-
-
-
-
-
-
+ `;
+ const Span = styled.span`
+ margin: 0px 15px;
+ color: #bbb;
+ line-height: 35px;
+ `;
+
+ const repo_id = projectDetail && projectDetail.repo_id;
+ const { projectsId, versionId } = match.params;
+
+ useEffect(() => {
+ if (branchs) {
+ setBranchList(branchs);
+ }
+ }, [branchs]);
+
+ useEffect(() => {
+ if (versionId) {
+ const url = `/projects/${projectsId}/version_releases/${versionId}/edit.json`;
+ axios.get(url).then(result => {
+ if (result) {
+ setFieldsValue(result.data);
+ setDesc(result.data.body);
+ setAttachment(result.data.attachments);
+ }
+ });
+ }
+ }, [versionId]);
+
+ useEffect(() => {
+ if (repo_id) {
+ const url = `/repositories/${repo_id}/tags.json`;
+ axios
+ .get(url)
+ .then(result => {
+ if (result) {
+ setTagList(result.data);
+ }
+ })
+ .catch(error => {
+ console.log(error);
+ });
+ }
+ }, [repo_id]);
+
+ function renderTagList(list) {
+ if (list) {
+ let array = list.map((item, key) => {
+ return (
+
+ );
+ });
+ return array || undefined;
+ }
+ }
+ function changeT(value) {
+ // let l = tagList.filter(item => item.name.indexOf(value) > -1);
+ // setTagList(l);
+ }
+ function submit() {
+ validateFields((err, value) => {
+ if (versionId) {
+ let url = `/projects/${projectsId}/version_releases/${versionId}.json`;
+ axios
+ .put(url, {
+ ...value,
+ body: desc,
+ attachment_ids: fileList
+ })
+ .then(result => {
+ if (result) {
+ showNotification("版本修改成功!");
+ history.push(`/projects/${projectsId}/coders/version`);
+ }
+ });
+ } else {
+ let url = `/projects/${projectsId}/version_releases.json`;
+ axios
+ .post(url, {
+ ...value,
+ body: desc,
+ attachment_ids: fileList
+ })
+ .then(result => {
+ if (result) {
+ showNotification("版本发布成功!");
+ history.push(`/projects/${projectsId}/coders/version`);
+ }
+ });
+ }
+ });
+ }
+
+ const helper = useCallback(
+ (label, name, rules, widget, isRequired = true) => (
+
+ {label}
+
+ {getFieldDecorator(name, { rules, validateFirst: true })(widget)}
+
+
+ ),
+ []
+ );
+ return (
+
+
+
+
+
标签命名建议
+
+ 通常的做法是在版本名称前加上字母 v 前缀, v1.0 或者 v2.3.4。
+
+
+ 如果标签不适合在生产环境下使用,请在版本名称后添加预发行版本。例如:v0.2-alpha
+ 或者 v5.9-beta.3。
+
+
+
+
语义化版本
+
+ 如果你是第一次发布版本,我们强烈建议你阅读语义化版本。
+
+
+
+
附件大小说明
+
+ 单个附件不能超过 100M(GVP 项目200M),每个仓库总附件不可超过
+ 1G(推荐项目不可超过 5G;GVP 项目不可超过
+ 20G)。附件总容量统计包括仓库附件和发行版附件。
+
+
+
-
-
-
-
标签命名建议
-
通常的做法是在版本名称前加上字母 v 前缀, v1.0 或者 v2.3.4。
-
如果标签不适合在生产环境下使用,请在版本名称后添加预发行版本。例如:v0.2-alpha 或者 v5.9-beta.3。
-
-
-
语义化版本
-
如果你是第一次发布版本,我们强烈建议你阅读语义化版本。
-
-
-
附件大小说明
-
单个附件不能超过 100M(GVP 项目200M),每个仓库总附件不可超过 1G(推荐项目不可超过 5G;GVP 项目不可超过 20G)。附件总容量统计包括仓库附件和发行版附件。
-
-
-
+ );
+ }
)
-}
\ No newline at end of file
+);
diff --git a/src/forge/Version/version.css b/src/forge/Version/version.css
index 38fb93128..3b68d5091 100644
--- a/src/forge/Version/version.css
+++ b/src/forge/Version/version.css
@@ -186,18 +186,12 @@
margin-bottom: 22px;
color: #333;
}
-.tagComplete{
- border:1px solid #d9d9d9;
- padding:0px 10px;
- border-radius: 4px;
+.versionStyle{
+ height: 200px!important;
+ border: 1px dashed rgba(80,145,255,1)!important;
+}
+.set-ant-row .ant-row{
display: flex;
+ height: 20px;
align-items: center;
- width: 240px;
-}
-.tagComplete .ant-select{
- flex: 1;
-}
-.tagComplete .ant-select-auto-complete.ant-select .ant-input{
- border:none!important;
- background-color: #fff!important;
}
\ No newline at end of file
diff --git a/src/forge/comments/children_comments.js b/src/forge/comments/children_comments.js
new file mode 100644
index 000000000..02ad3040a
--- /dev/null
+++ b/src/forge/comments/children_comments.js
@@ -0,0 +1,208 @@
+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";
+
+class comments extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ journalsdata: undefined,
+ limit: 10,
+ page: 1,
+ journal_spin: false,
+ search_count:0,
+ orderId: this.props.order_id,
+ parent_id: this.props.parent_id
+ };
+ }
+
+ componentDidMount(){
+ this.getChildrenJournals()
+}
+componentDidUpdate(prevProps, prevState) {
+ if (this.props.children_comment_id) {
+ if (prevProps.children_comment_id !== this.props.children_comment_id)
+ this.getChildrenJournals()
+ }
+}
+ //获取评论信息
+ getChildrenJournals = (order_id, parentId) => {
+ const { orderId, parent_id, page, limit } = this.state;
+ let new_order_id = order_id ? order_id : orderId
+ let new_parent_id = parentId ? parentId : parent_id
+ const url = `/issues/${new_order_id}/journals/${new_parent_id}/get_children_journals.json`;
+ axios
+ .get(url, {
+ params: {
+ page,
+ limit,
+ },
+ })
+ .then((result) => {
+ if (result) {
+ this.setState({
+ journalsdata: result.data,
+ search_count: result.data.journals_count,
+ isSpin: false
+ });
+ }
+ })
+ .catch((error) => {
+ console.log(error);
+ });
+ };
+
+ //删除评论
+ deleteorder = (id) => {
+ const { orderId } = this.state;
+ const url = `/issues/${orderId}/journals/${id}.json`;
+ axios
+ .delete(url, {
+ data: {
+ issue_id: orderId,
+ id: id,
+ },
+ })
+ .then((result) => {
+ if (result) {
+ this.getChildrenJournals();
+ }
+ })
+ .catch((error) => {
+ console.log(error);
+ });
+ };
+
+ // 翻页
+ ChangePage = (page) => {
+ this.state.page = page
+ this.state.isSpin = true
+ this.getChildrenJournals();
+ };
+
+ commentCtx = (v) => {
+ return
;
+ };
+
+ render() {
+ const {
+ journalsdata,
+ page,
+ limit,
+ search_count,
+ isSpin
+ } = this.state;
+ const { current_user } = this.props;
+
+ const Paginations = (
+
+ {search_count > limit ? (
+
+ ) : (
+ ""
+ )}
+
+ );
+
+ const renderList = (item) => {
+ 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 ? (
+
+ ) : (
+ ""
+ )}
+
+
+ );
+ };
+
+ return (
+
+ {
+ search_count > 0 &&
+
+ {renderList(item)}}
+ />
+ {Paginations}
+
+ }
+
+ );
+ }
+}
+
+export default comments;
diff --git a/src/forge/comments/comments.js b/src/forge/comments/comments.js
new file mode 100644
index 000000000..788335b64
--- /dev/null
+++ b/src/forge/comments/comments.js
@@ -0,0 +1,525 @@
+import React, { Component } from "react";
+import { Link } from "react-router-dom";
+
+import axios from "axios";
+import Upload from "../Upload/Index";
+import UploadImg from "../Images/upload.png";
+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 ChildrenComments from "./children_comments";
+import "../Order/order.css";
+
+class comments extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ content: undefined,
+ journalsdata: undefined,
+ isedit: undefined,
+ fileList: undefined,
+ limit: 10,
+ page: 1,
+ journal_spin: false,
+ edit_spin: false,
+ attachment_clean: true,
+ orderId: this.props.order_id,
+ is_reply: false,
+ reply_id: undefined,
+ reply_content: undefined,
+ new_journal_id: undefined,
+ };
+ }
+
+ componentDidMount = () => {
+ this.getjournalslist();
+ };
+
+ //添加评论
+ addjournals = () => {
+ const { content, reply_content } = this.state;
+ this.setState({
+ journal_spin: true,
+ });
+ if (!content && !reply_content) {
+ this.setState({
+ journal_spin: false,
+ });
+ return;
+ }
+ this.props.form.validateFieldsAndScroll((err, values) => {
+ if (!err) {
+ const {
+ page,
+ limit,
+ fileList,
+ orderId,
+ reply_id,
+ is_reply,
+ } = this.state;
+
+ const url = `/issues/${orderId}/journals.json`;
+
+ axios
+ .post(url, {
+ ...values,
+ content: is_reply ? reply_content : content,
+ issue_id: orderId,
+ attachment_ids: fileList,
+ parent_id: reply_id,
+ })
+ .then((result) => {
+ if (result && result.data.status === 0) {
+ this.props.form.setFieldsValue({
+ content: "",
+ reply_content: undefined,
+ });
+ this.setState({
+ showFiles: false,
+ content: "",
+ is_reply: false,
+ reply_id: undefined,
+ reply_content: undefined,
+ quillFlag: false,
+ journal_spin: false,
+ attachment_clean: false,
+ });
+ if (is_reply) {
+ this.state.new_journal_id = result.data.id;
+ // this.getjournalslist(page, limit);
+ // this.getjournalslist(page, limit);
+ // this.child.getChildrenJournals(orderId, reply_id);
+ }
+ this.getjournalslist(page, limit);
+ }
+ this.props.showNotification(result.data.message);
+ // this.state.success_journal = false
+ })
+ .catch((error) => {
+ this.setState({
+ journal_spin: false,
+ });
+ console.log(error);
+ });
+ } else {
+ this.setState({
+ journal_spin: false,
+ });
+ }
+ });
+ };
+ add_reply = (id) => {
+ this.setState({
+ is_reply: true,
+ success_journal: false,
+ reply_id: id,
+ });
+ };
+
+ cancel_reply = () => {
+ this.setState({
+ is_reply: false,
+ reply_id: undefined,
+ success_journal: false,
+ reply_content: undefined,
+ });
+ };
+ //获取评论信息
+ getjournalslist = (page, limit) => {
+ const { orderId } = this.state;
+ const url = `/issues/${orderId}/journals.json`;
+ let id = orderId;
+ axios
+ .get(url, {
+ params: {
+ id,
+ page,
+ limit,
+ },
+ })
+ .then((result) => {
+ if (result) {
+ this.setState({
+ journalsdata: result.data,
+ search_count: result.data.journals_count,
+ isSpin: false,
+ fileList: undefined,
+ });
+ }
+ })
+ .catch((error) => {
+ console.log(error);
+ });
+ };
+
+ // 获取上传后的文件id数组
+ UploadFunc = (fileList) => {
+ this.setState({
+ fileList,
+ attachment_clean: true,
+ });
+ };
+
+ //删除评论
+ deleteorder = (id) => {
+ const { page, limit, orderId } = this.state;
+ const url = `/issues/${orderId}/journals/${id}.json`;
+ axios
+ .delete(url, {
+ data: {
+ issue_id: orderId,
+ id: id,
+ },
+ })
+ .then((result) => {
+ if (result) {
+ this.getjournalslist(page, limit);
+ }
+ })
+ .catch((error) => {
+ console.log(error);
+ });
+ };
+
+ renderJournalList = (list) => {
+ if (list && list.length > 0) {
+ return list.map((item, key) => {
+ return (
+
+ {item.detail}:
+
+ {item.old_value && item.old_value.length > 0 ? "更新为" : "新增"}
+
+
+ {item.value && item.value.length > 0 ? (
+ item.detail === "标签" ? (
+
+ {item.value[0].name}
+
+ ) : (
+ item.value
+ )
+ ) : (
+ "无"
+ )}
+
+
+ );
+ });
+ } else {
+ return (
+
+ 没有评论~
+
+ );
+ }
+ };
+
+ // 翻页
+ ChangePage = (page) => {
+ this.setState({
+ page,
+ isSpin: true,
+ });
+ const { limit } = this.state;
+ this.getjournalslist(page, limit);
+ };
+
+ // 判断是否重新上传文件
+ changeIsComplete = (flag) => {
+ this.setState({
+ showFiles: flag,
+ });
+ };
+ // 新建评论
+ onContentChange = (value) => {
+ if (value) {
+ this.setState({
+ content: value,
+ quillFlag: false,
+ });
+ }
+ };
+ replyContentChange = (value) => {
+ if (value) {
+ this.setState({
+ reply_content: value,
+ quillFlag: false,
+ });
+ }
+ };
+
+ onRef = (ref) => {
+ this.child = ref;
+ };
+
+ commentCtx = (v) => {
+ return
;
+ };
+
+ render() {
+ const {
+ journalsdata,
+ page,
+ limit,
+ search_count,
+ isSpin,
+ content,
+ quillFlag,
+ journal_spin,
+ attachment_clean,
+ is_reply,
+ reply_id,
+ reply_content,
+ orderId,
+ new_journal_id,
+ } = this.state;
+ const { current_user } = this.props;
+
+ const Paginations = (
+
+ {search_count > limit ? (
+
+ ) : (
+ ""
+ )}
+
+ );
+
+ const new_comment = (is_reply, item_id) => {
+ return (
+
+ {current_user && current_user.login ? (
+
+
+
+

+
+
+ {current_user && current_user.real_name}
+
+
+
+
+ {quillFlag && 请输入评论内容}
+
+
+ }
+ size={100}
+ showNotification={this.props.showNotification}
+ />
+
+ {is_reply && (
+
+ )}
+
+
+
+ ) : (
+
+ 登录并参与到对话中
+
+ )}
+
+ );
+ };
+
+ const renderList = (item) => {
+ return (
+
+
+
+

+
+
+
+
+ {item && item.user_name}
+
+ {item.created_at}
+
+
+
+ {current_user &&
+ (current_user.admin ||
+ current_user.login === item.user_login) ? (
+ this.deleteorder(item.id)}
+ >
+
+
+ ) : (
+ ""
+ )}
+
+
+
+
+ {item.content ? (
+ this.commentCtx(item.content)
+ ) : (
+
{this.renderJournalList(item.journal_details)}
+ )}
+ {item && item.attachments && item.attachments.length > 0 ? (
+
+ ) : (
+ ""
+ )}
+
+
+
+
+ {current_user && (
+
+ {is_reply && reply_id && reply_id === item.id ? (
+
{new_comment(is_reply, item.id)}
+ ) : (
+
+
+

+
+
+
+
+
+ )}
+
+ )}
+
+ );
+ };
+
+ return (
+
+
+ {journalsdata && journalsdata.journals_total_count > 0 ? (
+ 回复({journalsdata.journals_total_count})
}
+ dataSource={journalsdata.issue_journals}
+ renderItem={(item) =>
{renderList(item)}}
+ />
+ ) : (
+
+ )}
+ {Paginations}
+
{new_comment()}
+
+
+ );
+ }
+}
+
+export default comments;
diff --git a/src/forge/comments/new.js b/src/forge/comments/new.js
new file mode 100644
index 000000000..d7e8c9cb9
--- /dev/null
+++ b/src/forge/comments/new.js
@@ -0,0 +1,641 @@
+import React, { Component } from "react";
+import { Link } from "react-router-dom";
+
+import axios from "axios";
+import Upload from "../Upload/Index";
+import UploadImg from "../Images/upload.png";
+import { getImageUrl } from "educoder";
+import { List } from "antd";
+import Attachments from "../Upload/attachment";
+import MDEditor from "../../modules/tpm/challengesnew/tpm-md-editor";
+import RenderHtml from "../../components/render-html";
+import new_comment from "./new"
+import "./order.css";
+// import AmplifyImg from "./AmplifyImg";
+
+class comments extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ };
+ }
+
+ componentDidMount = () => {
+ this.getjournalslist();
+ };
+
+ handleok = () => {
+ this.setState({
+ isShow: false,
+ });
+ };
+ handleCancel = () => {
+ this.setState({
+ isShow: false,
+ });
+ };
+
+ imgshow = () => {
+ this.setState({
+ isShow: true,
+ });
+ };
+
+ //添加评论
+ addjournals = () => {
+ const { quillValue } = this.state;
+ this.setState({
+ journal_spin: true,
+ });
+ if (!quillValue) {
+ this.setState({
+ quillFlag: true,
+ journal_spin: false,
+ });
+ return;
+ }
+ this.props.form.validateFieldsAndScroll((err, values) => {
+ if (!err) {
+ const { data, page, limit, fileList } = this.state;
+ const url = `/issues/${data.id}/journals.json`;
+ axios
+ .post(url, {
+ ...values,
+ content: quillValue,
+ issue_id: data.id,
+ attachment_ids: fileList,
+ })
+ .then((result) => {
+ if (result) {
+ this.props.showNotification("评论成功!");
+ this.props.form.setFieldsValue({
+ content: "",
+ });
+ this.setState({
+ showFiles: false,
+ quillValue: "",
+ quillFlag: false,
+ journal_spin: false,
+ });
+ this.getjournalslist(page, limit);
+ }
+ })
+ .catch((error) => {
+ this.setState({
+ journal_spin: false,
+ });
+ console.log(error);
+ });
+ } else {
+ this.setState({
+ journal_spin: false,
+ });
+ }
+ });
+ };
+ //获取评论信息
+ getjournalslist = (page, limit) => {
+ const { data } = this.state;
+ const url = `/issues/${data.id}/journals.json`;
+ let id = data.id;
+ axios
+ .get(url, {
+ params: {
+ id,
+ page,
+ limit,
+ },
+ })
+ .then((result) => {
+ if (result) {
+ this.setState({
+ journalsdata: result.data,
+ search_count: result.data.journals_count,
+ isSpin: false,
+ fileList: undefined,
+ });
+ }
+ })
+ .catch((error) => {
+ console.log(error);
+ });
+ };
+
+ //修改评论
+ updatedetail = (id) => {
+ const { page, limit, countvalue } = this.state;
+ const { orderId } = this.props.match.params;
+ this.setState({
+ edit_spin: true,
+ });
+ const url = `/issues/${orderId}/journals/${id}.json`;
+ axios
+ .put(url, {
+ issue_id: orderId,
+ id: id,
+ content: countvalue,
+ })
+ .then((result) => {
+ if (result) {
+ this.setState({
+ isedit: undefined,
+ edit_spin: false,
+ });
+ this.getjournalslist(page, limit);
+ }
+ })
+ .catch((error) => {
+ this.setState({
+ edit_spin: false,
+ });
+ 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,
+ id: id,
+ },
+ })
+ .then((result) => {
+ if (result) {
+ this.getjournalslist(page, limit);
+ }
+ })
+ .catch((error) => {
+ console.log(error);
+ });
+ };
+
+ editdetail = (count, status) => {
+ this.setState({
+ countvalue: this.stringJson(count),
+ isedit: status,
+ });
+ };
+
+ renderJournalList = (list) => {
+ if (list && list.length > 0) {
+ return list.map((item, key) => {
+ return (
+
+ {item.detail}:
+
+ {item.old_value && item.old_value.length > 0 ? "更新为" : "新增"}
+
+
+ {item.value && item.value.length > 0 ? (
+ item.detail === "标签" ? (
+
+ {item.value[0].name}
+
+ ) : (
+ item.value
+ )
+ ) : (
+ "无"
+ )}
+
+
+ );
+ });
+ } else {
+ return (
+
+ 没有评论~
+
+ );
+ }
+ };
+
+ // 翻页
+ ChangePage = (page) => {
+ this.setState({
+ page,
+ isSpin: true,
+ });
+ const { limit } = this.state;
+ this.getjournalslist(page, limit);
+ };
+
+ // 判断是否重新上传文件
+ changeIsComplete = (flag) => {
+ this.setState({
+ showFiles: flag,
+ });
+ };
+ // 新建评论
+ onContentChange = (value) => {
+ if (value) {
+ this.setState({
+ quillValue: value,
+ quillFlag: false,
+ });
+ }
+ };
+ // 编辑评论
+ onEditContentChange = (value) => {
+ if (value) {
+ this.setState({
+ countvalue: value,
+ });
+ }
+ };
+
+ handleShowImage = (value) => {
+ this.setState({
+ imageUrl: value,
+ visible: true,
+ });
+ };
+ setVisible = (flag) => {
+ this.setState({
+ visible: flag,
+ });
+ };
+
+ stringJson = (value) => {
+ let _value = null;
+
+ try {
+ _value = JSON.parse(value);
+ } catch (e) {
+ _value = value;
+ }
+ return _value;
+ };
+
+ commentCtx = (v) => {
+ return
;
+ };
+
+ render() {
+ const { projectsId, orderId } = this.props.match.params;
+ const {
+ data,
+ journalsdata,
+ page,
+ limit,
+ search_count,
+ isSpin,
+ isedit,
+ showFiles,
+ quillValue,
+ quillFlag,
+ countvalue,
+ imageUrl,
+ visible,
+ journal_spin,
+ edit_spin,
+ } = this.state;
+ const { current_user } = this.props;
+ const Paginations = (
+
+ {search_count > limit ? (
+
+ ) : (
+ ""
+ )}
+
+ );
+ const renderList = () => {
+ if (
+ journalsdata &&
+ journalsdata.issue_journals &&
+ journalsdata.issue_journals.length > 0
+ ) {
+ return (
+
+ {journalsdata.issue_journals.map((item, key) => {
+ return (
+
-
+ {key > 0 && (
+
+ )}
+
+
+

+
+
+
+
+
+ {item.user_name}
+ 评论于
+
+ {item.created_at}
+
+
+
+
+ this.editdetail(item.content, item.id)
+ }
+ className="detail_edit_action"
+ >
+ 编辑
+
+
this.deleteorder(item.id)}
+ >
+ 删除
+
+
+
+
+
+ {item.content ? (
+ this.commentCtx(item.content)
+ ) : (
+
+ {this.renderJournalList(item.journal_details)}
+
+ )}
+ {item &&
+ item.attachments &&
+ item.attachments.length > 0 ? (
+
+ ) : (
+ ""
+ )}
+
+
+
+
+
+
+
+ );
+ })}
+
+ );
+ }
+ };
+
+ return (
+
+
+ //
+ // {visible &&
}
+ //
+ //
+ //
+ // {
+ // data ?
+ // 【{data.issue_classify === "issue" ? (data.tracker ? data.tracker : "缺陷") : "合并请求"}】
+ // :
+ // ""
+ // }
+ // {data && data.subject}
+
+ //
+ //
+ // {data && data.issue_status === "关闭" ? "关闭中" : "开启中"}
+ //
+ // 由 {data && data.author_name} 于 {data && data.created_at}创建{data && data.journals_count && data.journals_count > 0 ? ` · ${data.journals_count} 条评论` : ""}
+ //
+ // {
+ // data && data.user_permission ?
+ //
+ // 复制
+ // this.deletedetail(orderId)}>
+ // 删除
+ //
+
+ // 编辑
+ //
+ // :
+ // ""
+ // }
+ //
+
+ //
+ //
+ //
+ //
+ //

+ //
+ //
+ // {data && data.description && (data.description.length > 0) ? this.commentCtx(data.description) : 没有描述}
+ //
+ // {
+ // data && data.attachments && data.attachments.length > 0 ?
+ //
+ // :
+ // ""
+ // }
+ //
+ //
+ //
+ //
+ //
+ //
+
+ // {Paginations}
+ // {
+ // current_user && current_user.login ?
+ //
+ //
+ //
+ //

+ //
+ //
+ //
+ // :
+ //
登录并参与到对话中
+ // }
+
+ //
+ //
+ //
+ // 分支
+ // {
+ // data && data.branch_name ? data.branch_name : "--"
+ // }
+ //
+ //
+ // 标签
+ // {
+ // data && data.issue_tags ? {data.issue_tags[0].name} : "--"
+ // }
+ //
+ //
+ // 里程碑
+ // {
+ // data && data.version ? data.version : "--"
+ // }
+ //
+ //
+ // 当前状态
+ // {
+ // data && data.issue_status ? data.issue_status : "--"
+ // }
+ //
+ //
+ // 分类
+ // {
+ // data && data.tracker ? data.tracker : "--"
+ // }
+ //
+ //
+ // 指派给
+ // {data && data.assign_user_name ? data.assign_user_name : "--"}
+ //
+ //
+ // 优先级
+ // {data && data.priority ? data.priority : "--"}
+ //
+ //
+ // 完成度
+ // {data && data.done_ratio ? data.done_ratio : "--"}
+ //
+
+ //
+ //
+ //
+ //
+ //
+ //
+ //
+ );
+ }
+}
+
+export default comments;
diff --git a/src/forge/css/index.css b/src/forge/css/index.css
index 5065fac37..c8d05f639 100644
--- a/src/forge/css/index.css
+++ b/src/forge/css/index.css
@@ -115,4 +115,5 @@ ul,ol,dl{
}
.ver-middle{
vertical-align: middle;
-}
\ No newline at end of file
+}
+.pd510{padding: 5px 10px;}
\ No newline at end of file