-
- {
- data ?
- 【{data.issue_classify === "issue" ? (data.tracker ? data.tracker : "缺陷") : "合并请求"}】
- :
- ""
- }
- {data && data.subject}
+
+
+
+
+

+
+
+
+
+
+ 【
+ {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.priority && (
+ {data.priority}
+ )}
+
+
+
由
+
+ {data && data.author_name}
+
+
+ 添加于 {data && data.created_at}
+
+ {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 ? (
+
+ ) : (
+ ""
+ )}
+
+
+
+
+
+
+ 分支:
+ {data && data.branch_name ? data.branch_name : "--"}
+
+
+ 是否上链:
+ {data && data.issue_type==="2" ? '是' : "--"}
+
+ {
+ data && data.issue_type==="2" &&
+
+ token值:
+ {data && data.token ? data.token : "--"}
+
+ }
+
+
+ 标签:
+
+ {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.start_date ? data.start_date : "--"}
+
+
+ 结束日期:
+ {data && data.due_date ? data.due_date : "--"}
-
-
-
-
-

-
-
- {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 : "--"}
-
-
-
+
+ 完成度:
+ {data && data.done_ratio ? data.done_ratio : "--"}
+
-
-
-
- )
+ );
}
}
-const WrappedDetailForm = Form.create({ name: 'DetailOrderForm' })(Detail);
-export default WrappedDetailForm;
\ No newline at end of file
+const WrappedDetailForm = Form.create({ name: "DetailOrderForm" })(Detail);
+export default WrappedDetailForm;
diff --git a/src/forge/Order/New.js b/src/forge/Order/New.js
index ef259e1e..6f41fea7 100644
--- a/src/forge/Order/New.js
+++ b/src/forge/Order/New.js
@@ -1,311 +1,17 @@
+
import React, { Component } from "react";
-import { Form, Input, Select, Spin } from 'antd';
-import { getImageUrl } from 'educoder';
-import UploadComponent from '../Upload/Index';
-import MDEditor from '../../modules/tpm/challengesnew/tpm-md-editor';
-
-import './order.css';
-
-import axios from 'axios';
-import { Link } from "react-router-dom";
-
-const Option = Select.Option;
+import OrderItem from './order_form'
class New extends Component {
constructor(props) {
super(props);
- this.state = {
- branch_name: "",
- issue_tag_ids: "",
- fixed_version_id: "",
- tracker_id: "缺陷",
- issue_type: "普通",
- status_id: '新增',
- assigned_to_id: "",
- priority_id: "正常",
- done_ratio: "0%",
- issue_chosen: undefined,
- branches: undefined,
- fileList: undefined,
- description: undefined,
- isSpin: false
- }
- }
-
- componentDidMount = () => {
- if (!this.props.checkIfLogin()) {
- this.props.showLoginDialog();
- return;
- }
- this.InitData();
- this.getSelectList();
- }
-
- InitData = () => {
- this.props.form.setFieldsValue({
- ...this.state
- });
- }
-
- getSelectList = () => {
- let projectsId = ""
- if (this.props.match.params.milepostId) {
- projectsId = this.props.match.params.projectsId;
- this.props.form.setFieldsValue({
- fixed_version_id: this.props.match.params.milepostId
- });
- } else {
- projectsId = this.props.match.params.projectsId;
- }
-
- const url = `/projects/${projectsId}/issues/new.json`;
- axios.get(url).then((result) => {
- if (result) {
- this.setState({
- issue_chosen: result.data.issue_chosen,
- branches: result.data.branches
- })
- }
- }).catch((error) => {
- console.log(error);
- })
- }
-
- renderSelect = (list) => {
- if (list && list.length > 0) {
- return (
- list.map((item, key) => {
- return (
-
- )
- })
- )
- }
- }
-
- // 创建
- handleSubmit = () => {
- this.setState({
- isSpin: true
- })
- this.props.form.validateFieldsAndScroll((err, values) => {
- if (!err) {
-
- const { projectsId } = this.props.match.params;
- const { fileList } = this.state;
- const url = `/projects/${projectsId}/issues.json`;
- if (values.status_id === "新增") {
- values.status_id = "1"
- }
- // if(values.issue_type==="普通"){
- // values.issue_type="1"
- // }
- if (values.tracker_id === "缺陷") {
- values.tracker_id = "1"
- }
- if (values.priority_id === "正常") {
- values.priority_id = "2"
- }
- if (values.done_ratio === "0%") {
- values.done_ratio = "0"
- }
- if (values.issue_tag_ids.length > 0) {
- values.issue_tag_ids = [values.issue_tag_ids]
- }
- const { description } = this.state;
-
- axios.post(url, {
- ...values,
- description: description,
- attachment_ids: fileList
- }).then(result => {
- if (result) {
- this.props.showNotification("任务创建成功!");
- this.props.history.push(`/projects/${projectsId}/orders`);
- this.setState({
- description: '',
- isSpin: false
- })
- const { getDetail } = this.props;
- getDetail && getDetail();
- }
- }).catch(error => {
- this.setState({
- isSpin: false
- })
- console.log(error);
- })
- }else{
- this.setState({
- isSpin: false
- })
- }
- })
- }
-
- // 获取上传后的文件id数组
- UploadFunc = (fileList) => {
- this.setState({
- fileList
- })
- }
-
- onContentChange = (value) => {
- this.setState({
- description: value
- })
}
render() {
- const { getFieldDecorator } = this.props.form;
- const { current_user } = this.props;
- const { description, issue_chosen, branches, isSpin } = this.state;
return (
-
+
)
}
+
}
-const WrappedNewForm = Form.create({ name: 'NewOrderForm' })(New);
-export default WrappedNewForm;
\ No newline at end of file
+export default New;
diff --git a/src/forge/Order/OrderItem.js b/src/forge/Order/OrderItem.js
index 0b087093..85fa0800 100644
--- a/src/forge/Order/OrderItem.js
+++ b/src/forge/Order/OrderItem.js
@@ -1,6 +1,6 @@
import React, { Component } from 'react';
import { Link } from 'react-router-dom';
-import { Popconfirm } from 'antd'
+import { Popconfirm, Tag } from 'antd'
import { TagInfo } from '../Utils/TagColor';
@@ -18,7 +18,7 @@ class OrderItem extends Component {
return (
issue_tags.map((item, key) => {
return (
-
{item.name}
+
{item.name}
)
})
)
diff --git a/src/forge/Order/UpdateDetail.js b/src/forge/Order/UpdateDetail.js
index d759fcb5..e50c1240 100644
--- a/src/forge/Order/UpdateDetail.js
+++ b/src/forge/Order/UpdateDetail.js
@@ -1,403 +1,17 @@
-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, Input, Select, Spin } from 'antd'
-
-import Attachments from '../Upload/attachment';
-import MDEditor from '../../modules/tpm/challengesnew/tpm-md-editor';
-
-
-const Option = Select.Option;
+import React, { Component } from "react";
+import OrderItem from './order_form'
class UpdateDetail extends Component {
constructor(props) {
super(props);
- this.state = {
- data: undefined,
- isShow: false,
- imgsrc: '',
- journalsdata: undefined,
- //图片区域是否显示 none 隐藏 block 显示
- display: 'none',
- titledisplay: 'none',
- subject: '',
- branch_name: "",
- issue_tag_ids: "",
- fixed_version_id: "",
- tracker_id: 0,
- issue_type: 0,
- status_id: 0,
- assigned_to_id: "",
- priority_id: 0,
- done_ratio: 0,
- textcount: "",
- fileList: undefined,
- get_attachments: undefined,
- isSpin: false
- }
}
- componentDidMount = () => {
- this.getDetail();
- }
-
- getDetail = () => {
- const { projectsId, orderId } = this.props.match.params;
- const url = `/projects/${projectsId}/issues/${orderId}/edit.json`;
- axios.get(url).then((result) => {
- if (result) {
- this.setState({
- data: result.data,
- subject: result.data.subject,
- issue_chosen: result.data.issue_chosen,
- branches: result.data.branches,
- tracker_id: result.data.tracker_id,
- issue_type: result.data.issue_type,
- status_id: result.data.status_id,
- priority_id: result.data.priority_id,
- done_ratio: result.data.done_ratio,
- 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
- })
- }
- }).catch((error) => {
- console.log(error);
- })
- }
-
- handleok = () => {
- this.setState({
- isShow: false
- });
- };
- handleCancel = () => {
- this.setState({
- isShow: false
- });
- }
-
- imgshow = () => {
- this.setState({
- isShow: true
- });
- };
-
- onContentChange = (value) => {
- this.setState({
- textcount: value
- })
- }
-
-
- changmodelname = (e) => {
- this.setState({
- subject: e.target.value
- })
- }
- changmodelcount = (e) => {
- this.setState({
- textcount: e.target.value
- })
- }
-
- renderSelect = (list) => {
- if (list && list.length > 0) {
- return (
- list.map((item, key) => {
- return (
-
- )
- })
- )
- }
- }
-
- // 切换完成度
- changeRatio = (e) => {
- if (e === 0) {
- this.props.form.setFieldsValue({
- status_id: 1
- })
- this.setState({
- status_id: 1
- })
- } else if (e === 100) {
- this.props.form.setFieldsValue({
- status_id: 3
- })
- this.setState({
- status_id: 3
- })
- } else {
- this.props.form.setFieldsValue({
- status_id: 2
- })
- this.setState({
- status_id: 2
- })
- }
- }
- // 切换状态
- changeStatus = (e) => {
- // console.log(e);
- if (e === 1) {
- this.props.form.setFieldsValue({
- done_ratio: 0
- })
- this.setState({
- done_ratio: 0
- })
- } else if (e === 3) {
- this.props.form.setFieldsValue({
- done_ratio: 100
- })
- this.setState({
- done_ratio: 100
- })
- }
- }
- // 获取上传后的文件id数组
- UploadFunc = (fileList) => {
- this.setState({
- fileList
- })
- }
- handleSubmit = () => {
- this.setState({
- isSpin: true
- })
- const { fileList } = this.state;
- this.props.form.validateFieldsAndScroll((err, values) => {
- if (!err) {
- 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 = ""
- }
- const { textcount } = this.state;
-
- axios.put(url, {
- project_id: projectsId,
- subject: subject,
- id: orderId,
- description: textcount,
- attachment_ids: fileList,
- ...values
- }).then(result => {
- if (result) {
- this.props.history.push(`/projects/${projectsId}/orders/${orderId}/detail`);
- }
- }).catch(error => {
- this.setState({
- isSpin: false
- })
- console.log(error);
- })
-
- }else{
- this.setState({
- isSpin: false
- })
- }
- })
- }
-
-
render() {
- const { projectsId, orderId } = this.props.match.params;
- 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, get_attachments, isSpin } = this.state;
+
return (
-
-
-
-
-
-
+
)
}
-}
-const UpdateDetailForm = Form.create({ name: 'UpdateDetailForm' })(UpdateDetail);
-export default UpdateDetailForm;
\ No newline at end of file
+}
+export default UpdateDetail;
diff --git a/src/forge/Order/order.css b/src/forge/Order/order.css
index 48403fe6..a65ddc9c 100644
--- a/src/forge/Order/order.css
+++ b/src/forge/Order/order.css
@@ -1,24 +1,24 @@
.topWrapper {
- padding-bottom:20px;
+ padding-bottom: 20px;
box-sizing: border-box;
display: flex;
justify-content: space-between;
flex-wrap: wrap;
}
-.quillContent{
+.quillContent {
position: relative;
margin-bottom: 4px;
}
-.quillFlag{
+.quillFlag {
position: absolute;
- bottom:0px;
- left:6px;
+ bottom: 0px;
+ left: 6px;
height: 20px;
line-height: 18px;
color: red;
}
-.topmilepost{
+.topmilepost {
padding: 20px 0;
box-sizing: border-box;
display: flex;
@@ -26,18 +26,17 @@
flex-wrap: wrap;
}
-.miledetail{
+.miledetail {
padding: 20px 0;
box-sizing: border-box;
justify-content: space-between;
- border-bottom: 1px solid #EEEEEE;
+ border-bottom: 1px solid #eeeeee;
flex-wrap: wrap;
}
-.topWrapper_nav{
+.topWrapper_nav {
display: flex;
-
}
-.detail_p{
+.detail_p {
display: flex;
/*padding:10px;*/
/*width: 80%;*/
@@ -45,7 +44,7 @@
/*margin: auto;*/
}
-.detail_right{
+.detail_right {
/*display: flex;*/
flex-grow: 1;
text-align: right;
@@ -53,99 +52,102 @@
/*padding-left: 15px;*/
/*margin: auto; */
}
-.commit_p{
+.commit_p {
font-size: 12px;
padding-top: 10px;
padding-left: 5px;
}
-.ul_width{
+.ul_width {
width: 100%;
}
-.a_btn{
- border-radius:4px;
- padding:0 12px;
+.a_btn {
+ border-radius: 4px;
+ padding: 0 12px;
margin-right: 15px;
line-height: 30px;
}
-.cancel_btn{
- border:1px solid #e6e6e6;
+.cancel_btn {
+ border: 1px solid #e6e6e6;
color: #333 !important;
}
-.delete_btn{
- border:1px solid red;
+.delete_btn {
+ border: 1px solid red;
color: red !important;
}
-.cancel_btn:hover{background: #e6e6e6}
-.Closeor_btn{
- border:1px solid red;
+.cancel_btn:hover {
+ background: #e6e6e6;
+}
+.Closeor_btn {
+ border: 1px solid red;
color: red;
height: 32px;
text-align: center;
- border-radius:4px;
- padding:0px 12px;
+ border-radius: 4px;
+ padding: 0px 12px;
margin-right: 15px;
line-height: 32px;
-
}
.rectangle {
- width: 8px;
- height: 8px;
- border-radius: 100%;
- margin-top: 15px;
- margin-left: -4px;
- margin-bottom: 10px;
- background: green;
- }
- .order_line{
- display: flex;
- height: 32px;
- margin: auto;
- border-left:1px solid #eee;
- }
- .comment_img{
- height: 25px;
- width: 25px;
- margin-top: 5px;
- border-radius: 100%;
- }
+ width: 8px;
+ height: 8px;
+ border-radius: 100%;
+ margin-top: 15px;
+ margin-left: -4px;
+ margin-bottom: 10px;
+ background: green;
+}
+.order_line {
+ display: flex;
+ height: 32px;
+ margin: auto;
+ border-left: 1px solid #eee;
+}
+.comment_img {
+ height: 25px;
+ width: 25px;
+ margin-top: 5px;
+ border-radius: 100%;
+}
-.topWrapper_nav a,.topWrapper_nav span{
- border:1px solid #f4f4f4;
+.topWrapper_nav a,
+.topWrapper_nav span {
+ border: 1px solid #f4f4f4;
border-radius: 5px 0px 0px 5px;
height: 34px;
line-height: 34px;
text-align: center;
- padding:0px 10px;
+ padding: 0px 10px;
display: block;
cursor: pointer;
}
-.topWrapper_nav a:hover{
+.topWrapper_nav a:hover {
background: #f4f4f4;
}
-.topWrapper_nav a:last-child,.topWrapper_nav span:last-child{
+.topWrapper_nav a:last-child,
+.topWrapper_nav span:last-child {
border-left: none;
border-radius: 0px 5px 5px 0px;
}
.topWrapper_btn {
background: #fff;
- border:1px solid #5091FF;
- color: #5091FF!important;
- padding:0px 12px;
+ border: 1px solid #5091ff;
+ color: #5091ff !important;
+ padding: 0px 12px;
text-align: center;
height: 32px;
line-height: 32px;
border-radius: 4px;
}
-.topWrapper_type{
+.topWrapper_type {
display: flex;
}
-.topWrapper_type li{
+.topWrapper_type li {
display: flex;
align-items: center;
margin-right: 30px;
}
-.topWrapper_type li >span{
+.topWrapper_type li > span {
display: block;
height: 30px;
line-height: 30px;
@@ -154,23 +156,23 @@
min-width: 60px;
box-sizing: border-box;
text-align: center;
- background:rgba(250,250,250,1);
- border:1px solid rgba(221,221,221,1);
+ background: rgba(250, 250, 250, 1);
+ border: 1px solid rgba(221, 221, 221, 1);
cursor: pointer;
}
-.topWrapper_type li > span.active{
- color: #4CACFF;
- border:1px solid rgba(80,145,255,1);
+.topWrapper_type li > span.active {
+ color: #4cacff;
+ border: 1px solid rgba(80, 145, 255, 1);
}
-.topWrapper_select{
+.topWrapper_select {
display: flex;
flex-wrap: wrap;
align-items: center;
}
-.topWrapper .ant-btn.ant-input-search-button{
+.topWrapper .ant-btn.ant-input-search-button {
height: 30px;
}
-.title_overflow{
+.title_overflow {
max-width: 220px;
white-space: nowrap;
overflow: hidden;
@@ -179,11 +181,11 @@
-o-text-overflow: ellipsis;
text-overflow: ellipsis;
}
-.topWrapper_select li{
+.topWrapper_select li {
text-align: center;
cursor: pointer;
color: #666;
- width:90px;
+ width: 90px;
text-align: center;
display: inline-block;
overflow: hidden;
@@ -191,39 +193,41 @@
-o-text-overflow: ellipsis;
text-overflow: ellipsis;
}
-.topWrapper_select li:active{
+.topWrapper_select li:active {
background: #f4f4f4;
border-radius: 4px;
}
-.no-cursor li{cursor: default !important;}
-.ant-dropdown-menu .ant-dropdown-menu-item{
+.no-cursor li {
+ cursor: default !important;
+}
+.ant-dropdown-menu .ant-dropdown-menu-item {
text-align: center;
- padding:6px 30px;
+ padding: 6px 30px;
cursor: pointer;
}
-.issueItem{
+.issueItem {
display: flex;
flex-wrap: wrap;
align-content: center;
- border-bottom:1px dashed #cecdcd;
- padding:16px 0px 16px 20px;
+ border-bottom: 1px dashed #cecdcd;
+ padding: 16px 0px 16px 20px;
}
-.issueNo{
- padding:0px 5px;
+.issueNo {
+ padding: 0px 5px;
border-radius: 4px;
background: #f4f4f4;
display: block;
margin-right: 8px;
- color:#666;
+ color: #666;
height: 30px;
line-height: 30px;
}
-.issueOpen{
+.issueOpen {
background: #21ba45 !important;
color: #fff !important;
}
-.margin_detail{
+.margin_detail {
margin-left: 15px;
margin-right: 15px;
}
@@ -241,7 +245,7 @@
margin-left: 15px;
padding: 15px;
position: relative;
- background: #FFFFFF;
+ background: #ffffff;
}
.new_context:before {
position: absolute;
@@ -265,41 +269,41 @@
top: 14px;
right: 100%;
}
-.list-l-panel{
- border:1px solid #f4f4f4;
+.list-l-panel {
+ border: 1px solid #f4f4f4;
border-radius: 4px;
- padding:10px 15px;
+ padding: 10px 15px;
}
-.list-l-panel .ant-row{
+.list-l-panel .ant-row {
margin-bottom: 0px;
}
- /*编辑任务*/
- .editingsheet{
+/*编辑任务*/
+.editingsheet {
background: #ffffff;
- color: #21ba45!important;
- padding:0px 12px;
+ color: #21ba45 !important;
+ padding: 0px 12px;
text-align: center;
height: 32px;
line-height: 32px;
}
/*开启中 关闭中*/
-.opendetail{
+.opendetail {
display: inline-block;
background: #21ba45;
- color: #ffffff!important;
- padding:0px 12px;
+ color: #ffffff !important;
+ padding: 0px 12px;
text-align: center;
height: 32px;
/*width: 110px;*/
border-radius: 4px;
line-height: 32px;
}
-.closedetail{
+.closedetail {
display: inline-block;
background: #e60b0b;
- color: #ffffff!important;
- padding:0px 12px;
+ color: #ffffff !important;
+ padding: 0px 12px;
text-align: center;
height: 32px;
/*width: 110px;*/
@@ -307,30 +311,29 @@
line-height: 32px;
}
-.commenttitle{
- color: #21ba45!important;
+.commenttitle {
+ color: #21ba45 !important;
}
-.topWrapper_detali{
+.topWrapper_detali {
display: flex;
/*height: 35px;*/
background-color: #eee;
align-items: center;
margin-bottom: 10px;
}
-.towwrapper_img_detali{
+.towwrapper_img_detali {
display: flex;
padding-left: 80px;
margin-left: 80px;
margin-right: 20px;
- border: 1px solid #4CACFF;
+ border: 1px solid #4cacff;
}
-.div_line{
+.div_line {
width: 100%;
- border: 10px solid #4CACFF;
-
+ border: 10px solid #4cacff;
}
-.list_img{
+.list_img {
height: 145px;
padding: 15px;
width: 145px;
@@ -345,7 +348,7 @@
/*padding-left: 0px;*/
/*margin-right: 15px;*/
position: relative;
- background: #FFFFFF;
+ background: #ffffff;
border-radius: 4px;
width: 0;
}
@@ -372,34 +375,38 @@
right: 100%;
}
/* 任务标签列表 */
-.tagList > div{
+.tagList > div {
border-bottom: 1px dashed #f4f4f4;
display: flex;
justify-content: space-around;
- padding:15px 0px;
+ padding: 15px 0px;
}
-.divwidth{
+.divwidth {
width: 74%;
}
-.listTowItems{
+.listTowItems {
width: 80%;
padding-left: 80px;
}
-.tagList > div:last-child{
+.tagList > div:last-child {
border-bottom: none;
}
-.mr10{margin-right: 10px;}
-.text-right{text-align: right;}
+.mr10 {
+ margin-right: 10px;
+}
+.text-right {
+ text-align: right;
+}
/*.tagList > div > span{*/
- /*display: block*/
+/*display: block*/
/*}*/
/*.tagList > div > span:nth-child(2){*/
- /*width: 450px;*/
+/*width: 450px;*/
/*}*/
-.tagColor{
+.tagColor {
display: inline-block;
- width:28px;
+ width: 28px;
height: 14px;
border-radius: 4px;
margin-right: 5px;
@@ -407,87 +414,87 @@
}
/*里程碑*/
-.milepostdiv{
+.milepostdiv {
display: flex;
}
-.milepostwidth{
+.milepostwidth {
display: flex;
width: 60%;
}
-.mileposwidth{
+.mileposwidth {
background: #21ba45;
border-radius: 4px;
width: 40%;
}
-.milepostrighe{
+.milepostrighe {
display: flex;
width: 80%;
}
-.milepostleft{
+.milepostleft {
display: flex;
justify-content: center;
}
-.textwidth{
+.textwidth {
display: flex;
width: 100%;
}
-.newmilepostleft{
+.newmilepostleft {
padding: 15px;
margin-right: 50px;
width: 60%;
}
-.newmilepostrighe{
+.newmilepostrighe {
margin-left: 50px;
padding: 15px;
width: 30%;
}
/* 任务详情 */
-.detailContent{
- padding:15px 0px;
+.detailContent {
+ padding: 15px 0px;
border-bottom: 1px solid #f4f4f4;
}
-.DetailRight{
- padding: 10px 15px;
- border:1px solid #f4f4f4;
+.DetailRight {
+ padding: 10px 15px;
+ border: 1px solid #f4f4f4;
border-radius: 4px;
}
-.DetailRight > p{
+.DetailRight > p {
height: 30px;
- line-height:30px;
+ line-height: 30px;
}
-.inptwidth{
+.inptwidth {
width: 20%;
}
-.inputcount{
+.inputcount {
width: 40%;
}
-.loginDiv{
+.loginDiv {
border: 1px solid #f7c977;
- background: rgb(255, 204, 113,0.3);
+ background: rgb(255, 204, 113, 0.3);
text-align: center;
- padding:8px 0px;
+ padding: 8px 0px;
border-radius: 4px;
width: 100%;
color: #999;
margin-top: 15px;
}
-.loginDiv a{
+.loginDiv a {
text-decoration: underline;
- color: #4CACFF;
+ color: #4cacff;
margin-right: 3px;
}
-.tagdiv{
+.tagdiv {
padding: 15px;
height: 75px;
box-sizing: border-box;
display: flex;
justify-content: space-between;
- border: 1px solid #EEEEEE;
+ border: 1px solid #eeeeee;
flex-wrap: wrap;
}
-.dialogdiv{
+.dialogdiv {
padding: 5px;
height: 45px;
box-sizing: border-box;
@@ -495,64 +502,183 @@
justify-content: space-between;
flex-wrap: wrap;
}
-.issue-tag-show{padding: 3px 8px; color: #fff; border-radius: 6px;}
-.journal-list-item{padding: 12px 15px}
+.issue-tag-show {
+ padding: 3px 8px;
+ color: #fff;
+ border-radius: 6px;
+}
+.journal-list-item {
+ padding: 10px;
+}
/*.DetailRight > p >span:nth-child(1){*/
- /*min-width: 90px;*/
- /*margin-right: 15px;*/
- /*text-align: right;*/
+/*min-width: 90px;*/
+/*margin-right: 15px;*/
+/*text-align: right;*/
/*}*/
-.span_title{
- min-width: 90px;
+.span_title {
+ min-width: 40px;
margin-right: 15px;
text-align: right;
color: rgba(0, 0, 0, 0.65);
}
-.target-detail-search .ant-input-group-addon{border: none !important;}
-.target-detail-search .ant-input-search-button{height: 32px !important;}
-a.issue-type-button.active{background: #4CACFF; color: #fff;}
-a.issue-type-button.active:hover{background: #f4f4f4; color: #4CACFF;}
-@media screen and (max-width: 700px){
- .topWrapper_select li{
- width:auto;
+.target-detail-search .ant-input-group-addon {
+ border: none !important;
+}
+.target-detail-search .ant-input-search-button {
+ height: 32px !important;
+}
+a.issue-type-button.active {
+ background: #4cacff;
+ color: #fff;
+}
+a.issue-type-button.active:hover {
+ background: #f4f4f4;
+ color: #4cacff;
+}
+@media screen and (max-width: 700px) {
+ .topWrapper_select li {
+ width: auto;
}
}
-.ml10{margin-left: 10px;}
-.lineH32{line-height: 32px;}
-.lineH40{line-height: 40px;}
-.item-list-right{width: 74%; padding: 0px 15px 10px 0}
-.detail_edit_action{padding:10px; color: #999; cursor: pointer; line-height: 40px;}
-.attachmentsList{
- margin-left:4px;
+.ml10 {
+ margin-left: 10px;
+}
+.lineH32 {
+ line-height: 32px;
+}
+.lineH40 {
+ line-height: 40px;
+}
+.item-list-right {
+ width: 74%;
+ padding: 0px 15px 10px 0;
+}
+.detail_edit_action {
+ padding: 10px;
+ color: #999;
+ cursor: pointer;
+ line-height: 40px;
+}
+.attachmentsList {
+ margin-left: 4px;
+}
+.paper-clip-color {
+ color: #29bd8b !important;
+}
+.attachment-list-delete {
+ display: none;
+}
+.attachment-list-div:hover {
+ background-color: #e6f7ff;
+}
+.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;
}
-.paper-clip-color{color:#29bd8b !important}
-.attachment-list-delete{display: none;}
-.attachment-list-div:hover{background-color: #e6f7ff;}
-.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;}
-.fwb{font-weight: bold;}
/* 发布人、指派人数量过多时要出现滚动条 */
-.ant-dropdown-menu{
+.ant-dropdown-menu {
max-height: 350px;
- overflow-y:auto;
+ overflow-y: auto;
}
-.ql-bubble .ql-editor img{
- min-width:100px!important;
+.ql-bubble .ql-editor img {
+ min-width: 100px !important;
}
-.AmplifyImg .ant-modal{
- padding:0px;
+.AmplifyImg .ant-modal {
+ padding: 0px;
}
-.AmplifyImg img{
+.AmplifyImg img {
max-width: 100%;
margin: 0px auto;
}
-.AmplifyImg .ant-modal-body{
- padding:25px;
+.AmplifyImg .ant-modal-body {
+ padding: 25px;
}
-.amplifyContent{
+.amplifyContent {
text-align: center;
}
-.mb-0{margin-bottom: 0 !important;}
\ No newline at end of file
+.mb-0 {
+ margin-bottom: 0 !important;
+}
+.text-yellow {
+ color: #ff6e21;
+}
+.border-1f {
+ border-bottom: 1px solid #f4f4f4;
+}
+.background-f {
+ background: #fff;
+}
+.issue_detail_info {
+ width: 65px;
+ 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: 16px;
+}
+/* .comment-background .ant-list-split .ant-list-item:last-child{border-bottom: 1px solid #e8e8e8;} */
+.border-top-e {
+ border-top: 1px solid #e8e8e8;
+}
+.commentStyle {
+ background-color: #fff !important;
+}
+.reply-comment-input .add_reply_button {
+ background-color: #fff !important;
+ color: #bbb;
+ width: 100%;
+ text-align: left;
+ border: 1px solid rgba(238, 238, 238, 1);
+ box-shadow: none;
+}
+.children-comment-bg {
+ background: rgba(241, 248, 255, 1);
+ border: 1px solid rgba(238, 238, 238, 1);
+}
+
+.display-in{
+ display: inherit;
+}
+.issue-form-right .ant-form-item{
+ margin-bottom: 8px !important;
+}
+.issue-form-right .ant-row label{font-size: 14px !important; font-weight: 500;}
+.issue-edit-form-right{margin-bottom: 0 !important;}
+.plr10{padding: 0 10px;}
+.issue-form-index .editormd-toolbar{position: absolute !important;}
\ No newline at end of file
diff --git a/src/forge/Order/order.js b/src/forge/Order/order.js
index 674fe8ea..d4fe72ad 100644
--- a/src/forge/Order/order.js
+++ b/src/forge/Order/order.js
@@ -37,7 +37,7 @@ class order extends Component {
assigned_to_id: undefined,
search_count: undefined,
issue_type: undefined,
- status_type: undefined,
+ status_type: "1", // 默认显示开启中的
issue_tag_ids: "标签",
tracker_ids: "类型",
author_ids: "发布人",
@@ -55,7 +55,7 @@ class order extends Component {
allValue: [],
all: false,
select_params: {
- status_type: undefined, //开启中和关闭中,全部,默认为全部
+ status_type: "1", //开启中和关闭中,全部,默认为全部
assigned_to_id: undefined, // 负责人
author_id: undefined, // 发布人
issue_tag_id: undefined, // 标签
diff --git a/src/forge/Order/order_form.js b/src/forge/Order/order_form.js
new file mode 100644
index 00000000..ae4816dd
--- /dev/null
+++ b/src/forge/Order/order_form.js
@@ -0,0 +1,604 @@
+import React, { Component } from "react";
+import { Form, Input, Select, Button, DatePicker, Switch } from "antd";
+import Upload from "../Upload/Index";
+import UploadImg from "../Images/upload.png";
+import MDEditor from "../../modules/tpm/challengesnew/tpm-md-editor";
+import moment from "moment";
+import "./order.css";
+import Attachments from "../Upload/attachment";
+
+import axios from "axios";
+
+const Option = Select.Option;
+class order_form extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ branch_name: "",
+ issue_tag_ids: "",
+ fixed_version_id: "",
+ tracker_id: "缺陷",
+ issue_type: "1",
+ status_id: "新增",
+ assigned_to_id: "",
+ priority_id: "正常",
+ done_ratio: "0%",
+ issue_chosen: undefined,
+ branches: undefined,
+ fileList: undefined,
+ description: undefined,
+ isSpin: false,
+ token: undefined,
+ start_date: "",
+ due_date: "",
+ subject: "",
+ get_attachments: undefined,
+ show_token: false,
+ };
+ }
+
+ componentDidMount = () => {
+ this.getSelectList();
+ this.get_detail();
+ };
+ get_detail = () => {
+ const { form_type } = this.props;
+ if (form_type === "new") {
+ this.InitData();
+ this.getSelectList();
+ } else {
+ this.state.isSpin = true;
+ const { projectsId, orderId } = this.props.match.params;
+ const url = `/projects/${projectsId}/issues/${orderId}/edit.json`;
+ axios
+ .get(url)
+ .then((result) => {
+ if (result) {
+ this.setState(
+ {
+ branch_name: result.data.branch_name,
+ issue_tag_ids: [
+ result.data.issue_tags && result.data.issue_tags[0].id
+ ? String(
+ result.data.issue_tags && result.data.issue_tags[0].id
+ )
+ : "",
+ ],
+ fixed_version_id: result.data.fixed_version_id
+ ? String(result.data.fixed_version_id)
+ : "",
+ tracker_id: result.data.tracker_id
+ ? String(result.data.tracker_id)
+ : "",
+ issue_type: result.data.issue_type,
+ status_id: result.data.status_id
+ ? String(result.data.status_id)
+ : "",
+ assigned_to_id: result.data.assigned_to_id
+ ? String(result.data.assigned_to_id)
+ : "",
+ priority_id: result.data.priority_id
+ ? String(result.data.priority_id)
+ : "",
+ done_ratio: result.data.done_ratio,
+ fileList: undefined,
+ description: result.data.description,
+ isSpin: false,
+ token: result.data.token,
+ get_attachments: result.data.attachments,
+ start_date: result.data.start_date,
+ due_date: result.data.due_date,
+ subject: result.data.subject,
+ },
+ () => this.InitData()
+ );
+ }
+ })
+ .catch((error) => {
+ this.state.isSpin = false;
+ console.log(error);
+ });
+ }
+ };
+
+ InitData = () => {
+ // this.props.form.setFieldsValue({
+ // ...this.state,
+ // });
+ };
+
+ getSelectList = () => {
+ let projectsId = "";
+ if (this.props.match.params.milepostId) {
+ projectsId = this.props.match.params.projectsId;
+ this.props.form.setFieldsValue({
+ fixed_version_id: this.props.match.params.milepostId,
+ });
+ } else {
+ projectsId = this.props.match.params.projectsId;
+ }
+
+ const url = `/projects/${projectsId}/issues/new.json`;
+ axios
+ .get(url)
+ .then((result) => {
+ if (result) {
+ this.setState({
+ issue_chosen: result.data.issue_chosen,
+ branches: result.data.branches,
+ });
+ }
+ })
+ .catch((error) => {
+ console.log(error);
+ });
+ };
+
+ renderSelect = (list) => {
+ if (list && list.length > 0) {
+ return list.map((item, key) => {
+ return (
+
+ );
+ });
+ }
+ };
+
+ // 创建
+ handleSubmit = () => {
+ this.setState({
+ isSpin: true,
+ });
+ this.props.form.validateFieldsAndScroll((err, values) => {
+ if (!err) {
+ const { form_type } = this.props;
+ const { projectsId, orderId } = this.props.match.params;
+
+ // const { projectsId } = this.props.match.params;
+ const { fileList } = this.state;
+
+ if (values.status_id === "新增") {
+ values.status_id = "1";
+ }
+ if (values.tracker_id === "缺陷") {
+ values.tracker_id = "1";
+ }
+ if (values.priority_id === "正常") {
+ values.priority_id = "2";
+ }
+ if (values.done_ratio === "0%") {
+ values.done_ratio = "0";
+ }
+ if (values.issue_tag_ids.length > 0) {
+ values.issue_tag_ids = [values.issue_tag_ids];
+ }
+ const { description, start_date, due_date, issue_type } = this.state;
+ if (form_type === "new") {
+ const url = `/projects/${projectsId}/issues.json`;
+ axios
+ .post(url, {
+ ...values,
+ description: description,
+ attachment_ids: fileList,
+ start_date: start_date,
+ due_date: due_date,
+ issue_type: issue_type,
+ })
+ .then((result) => {
+ if (result) {
+ this.props.showNotification("任务创建成功!");
+ this.props.history.push(`/projects/${projectsId}/orders`);
+ this.setState({
+ description: "",
+ isSpin: false,
+ });
+ const { getDetail } = this.props;
+ getDetail && getDetail();
+ }
+ })
+ .catch((error) => {
+ this.setState({
+ isSpin: false,
+ });
+ console.log(error);
+ });
+ } else {
+ const url = `/projects/${projectsId}/issues/${orderId}.json`;
+ axios
+ .put(url, {
+ description: description,
+ attachment_ids: fileList,
+ start_date: start_date,
+ due_date: due_date,
+ issue_type: issue_type,
+ ...values,
+ })
+ .then((result) => {
+ if (result) {
+ this.props.history.push(
+ `/projects/${projectsId}/orders/${orderId}/detail`
+ );
+ this.props.showNotification("任务更新成功!");
+ }
+ })
+ .catch((error) => {
+ this.setState({
+ isSpin: false,
+ });
+ console.log(error);
+ });
+ }
+ }
+ this.setState({
+ isSpin: false,
+ });
+ });
+ };
+
+ // 获取上传后的文件id数组
+ UploadFunc = (fileList) => {
+ this.setState({
+ fileList,
+ });
+ };
+
+ onContentChange = (value) => {
+ this.setState({
+ description: value,
+ });
+ };
+ // 修改开始时间
+ changeBeginTime = (start_date, value) => {
+ this.setState({
+ start_date: value,
+ });
+ };
+ changeEndTime = (due_date, value) => {
+ this.setState({
+ due_date: value,
+ });
+ };
+ // 切换完成度
+ changeRatio = (e) => {
+ if (e === "0") {
+ this.props.form.setFieldsValue({
+ status_id: "1",
+ });
+ this.setState({
+ status_id: "1",
+ });
+ } else if (e === "100") {
+ this.props.form.setFieldsValue({
+ status_id: "3",
+ });
+ this.setState({
+ status_id: "3",
+ });
+ } else {
+ this.props.form.setFieldsValue({
+ status_id: "2",
+ });
+ this.setState({
+ status_id: "2",
+ });
+ }
+ };
+ //切换状态
+ changeStatus = (e) => {
+ if (e === "1") {
+ this.props.form.setFieldsValue({
+ done_ratio: "0",
+ });
+ this.setState({
+ done_ratio: "0",
+ });
+ } else if (e === "3") {
+ this.props.form.setFieldsValue({
+ done_ratio: "100",
+ });
+ this.setState({
+ done_ratio: "100",
+ });
+ }
+ };
+
+ //切换是否上链操作
+ change_issue_type = (e) => {
+ if (e) {
+ this.setState({
+ issue_type: "2",
+ show_token: true,
+ });
+ } else {
+ this.setState({
+ issue_type: "1",
+ show_token: false,
+ });
+ }
+ };
+
+ render() {
+ const { getFieldDecorator } = this.props.form;
+ const projectsId = this.props.match.params.projectsId;
+ const { orderId } = this.props.match.params;
+ const { form_type } = 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,
+ description,
+ get_attachments,
+ isSpin,
+ start_date,
+ due_date,
+ token,
+ show_token,
+ } = this.state;
+ return (
+
+ );
+ }
+}
+const WrappedNewForm = Form.create({ name: "NewOrderForm" })(order_form);
+export default WrappedNewForm;
diff --git a/src/forge/Upload/attachment.js b/src/forge/Upload/attachment.js
index d1f099f2..812156f3 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/UsersList/focus_button.js b/src/forge/UsersList/focus_button.js
index 9ea17173..8a640307 100644
--- a/src/forge/UsersList/focus_button.js
+++ b/src/forge/UsersList/focus_button.js
@@ -1,6 +1,6 @@
import React, { Component } from "react";
import axios from "axios";
-import { Spin, Button } from "antd";
+import { Button } from "antd";
import "./list.css";
class FocusButton extends Component {
@@ -10,6 +10,9 @@ class FocusButton extends Component {
is_watch: false,
id: "",
isSpin: false,
+ fontClass: "font-12",
+ starText: "关注",
+ is_block: false
};
}
@@ -22,6 +25,9 @@ class FocusButton extends Component {
is_watch: this.props.is_watch,
id: this.props.id,
isSpin: false,
+ fontClass: this.props.fontClass ? this.props.fontClass : "font-12",
+ starText: this.props.starText ? this.props.starText : "关注",
+ is_block: this.props.is_block === undefined ? false : this.props.is_block
});
};
@@ -46,23 +52,24 @@ class FocusButton extends Component {
}
})
.catch((error) => {
+ this.setState({isSpin: false})
console.log(error);
});
};
render() {
- const { is_watch, isSpin } = this.state;
+ const { is_watch, isSpin,fontClass,starText,is_block } = this.state;
return (
-
+ );
+ }
+}
+
+export default comments;
diff --git a/src/forge/comments/new.js b/src/forge/comments/new.js
new file mode 100644
index 00000000..1498e36f
--- /dev/null
+++ b/src/forge/comments/new.js
@@ -0,0 +1,636 @@
+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";
+
+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,
+ quillFlag,
+ countvalue,
+ 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 5065fac3..c8d05f63 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
diff --git a/src/forge/users/Infos.js b/src/forge/users/Infos.js
new file mode 100644
index 00000000..00070b84
--- /dev/null
+++ b/src/forge/users/Infos.js
@@ -0,0 +1,191 @@
+import React, { Component } from "react";
+import { Link } from "react-router-dom";
+import { Avatar, Tag, Button, Pagination, Spin, Dropdown, Menu } from "antd";
+import FocusButton from "../UsersList/focus_button";
+
+import axios from "axios";
+import { getImageUrl } from "educoder";
+import { Route, Switch } from "react-router-dom";
+import { withRouter } from "react-router";
+
+import { SnackbarHOC } from "educoder";
+import { CNotificationHOC } from "../../modules/courses/common/CNotificationHOC";
+import { TPMIndexHOC } from "../../modules/tpm/TPMIndexHOC";
+import "./new_user.css";
+import "../css/index.css";
+
+import Loadable from "react-loadable";
+import Loading from "../../Loading";
+import { ImageLayerOfCommentHOC } from "../../modules/page/layers/ImageLayerOfCommentHOC";
+
+const InfosIndex = Loadable({
+ loader: () => import("./InfosUser"),
+ loading: Loading,
+});
+
+class Infos extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ isSpin: false,
+ user: undefined,
+ };
+ }
+
+ componentDidMount = () => {
+ this.fetchUser();
+ };
+
+ fetchUser = () => {
+ let url = `/users/${this.props.match.params.username}.json`;
+ axios
+ .get(url)
+ .then((result) => {
+ this.setState({
+ user: result.data,
+ });
+ })
+ .catch((error) => {
+ console.log(error);
+ this.setState({
+ isSpin: false,
+ });
+ });
+ };
+
+ render() {
+ const { current_user, mygetHelmetapi } = this.props;
+ const { user } = this.state;
+ return (
+
+
+
+
+
+
+ {user && user.user_identity && (
+
+ {user && user.user_identity}
+
+ )}
+
+
+ {user && current_user && user.login === current_user.login && (
+
+
+ {" "}
+
+ 修改资料
+
+
+ )}
+ {current_user && user && user.login !== current_user.login && (
+
+
+
+ )}
+
+
+
+
我关注的
+
{user && user.watching_count}
+
+
+
关注我的
+
{user && user.watched_count}
+
+
+
+
+ {current_user && user && current_user.id === user.id && (
+
+
+
+
+
+ 待办事项
+
+
+ {user.undo_events}
+
+
+
+
+ )}
+
+
+
+
+
+
+
+
+ 组织
+
+
+ {user && user.undo_events}
+
+
+
+
+
+
+
+ {
+ return ;
+ }}
+ >
+
+
+
+
+ );
+ }
+}
+export default withRouter(
+ ImageLayerOfCommentHOC({
+ imgSelector: ".imageLayerParent img, .imageLayerParent .imageTarget",
+ parentSelector: ".newMain",
+ })(CNotificationHOC()(SnackbarHOC()(TPMIndexHOC(Infos))))
+);
diff --git a/src/forge/users/InfosUser.js b/src/forge/users/InfosUser.js
new file mode 100644
index 00000000..967ca151
--- /dev/null
+++ b/src/forge/users/InfosUser.js
@@ -0,0 +1,105 @@
+import React, { Component } from "react";
+// import { SnackbarHOC } from 'educoder';
+import { Link } from "react-router-dom";
+import { Avatar, Tag, Button, Pagination, Spin, Dropdown, Menu } from "antd";
+import FocusButton from "../UsersList/focus_button";
+
+import axios from "axios";
+import { getImageUrl } from "educoder";
+import NoneData from "../Nodata";
+
+// import "./new_user.css";
+import "../css/index.css";
+
+class InfosUser extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ category: undefined,
+ status: undefined,
+ page: 1,
+ per_page: 16,
+ sort_by: "updated_on",
+ sort_direction: "desc",
+ totalCount: undefined,
+ data: undefined,
+ isSpin: false,
+
+ };
+ }
+
+ componentDidMount = () => {
+ };
+
+
+
+ //切换种类
+ changeCategory = (cate) => {
+ this.setState({
+ category: cate,
+ page: 1,
+ isSpin: true,
+ });
+ let { status, sort_by, sort_direction } = this.state;
+ this.getCourses(cate, status, 1, sort_by, sort_direction);
+ };
+ //切换状态
+ changeStatus = (status) => {
+ this.setState({
+ status: status,
+ page: 1,
+ isSpin: true,
+ });
+ let { category, sort_by, sort_direction } = this.state;
+ this.getCourses(category, status, 1, sort_by, sort_direction);
+ };
+ //切换页数
+ changePage = (page) => {
+ this.setState({
+ page,
+ isSpin: true,
+ });
+ let { category, status, sort_by, sort_direction } = this.state;
+ this.getCourses(category, status, page, sort_by, sort_direction);
+ };
+
+ //切换种类
+ updatedlist(sort_by) {
+ //按照什么样子排序
+ this.setState({
+ isSpin: true,
+ });
+ let { category, status, page, sort_direction } = this.state;
+ this.getCourses(category, status, 1, sort_by, "desc");
+ }
+
+ //排序
+ updatedlists(sort_directions) {
+ //是否是倒序
+ this.setState({
+ isSpin: true,
+ });
+ let { category, status, page, sort_by, sort_direction } = this.state;
+ let sort_directiony = sort_directions;
+ if (sort_directions === "asc") {
+ if (sort_directions === sort_direction) {
+ sort_directiony = "desc";
+ }
+ } else if (sort_directions === "desc") {
+ if (sort_directions === sort_direction) {
+ sort_directiony = "asc";
+ }
+ }
+ this.getCourses(category, status, page, sort_by, sort_directiony);
+ }
+
+ render() {
+
+ return (
+
+ ddddd
+
+ );
+ }
+}
+export default InfosUser;
diff --git a/src/forge/users/new_user.css b/src/forge/users/new_user.css
new file mode 100644
index 00000000..7bed9599
--- /dev/null
+++ b/src/forge/users/new_user.css
@@ -0,0 +1,101 @@
+.new-content-flex{
+ width: 1200px;
+ margin: 20px auto;
+ display: -ms-flexbox;
+ display: flex;
+ -ms-flex-align: start;
+ align-items: flex-start;
+ -ms-flex-wrap: wrap;
+ flex-wrap: wrap;
+}
+.list-left{
+ width: 26%;
+ padding-right: 20px;
+ box-sizing: border-box;
+ margin-bottom: 20px;
+}
+.list-right{
+ width:74%;
+ background: #fff;
+ padding:10px;
+}
+.list-l-Menu{
+ margin-bottom: 12px;
+ border-radius:2px;
+ background-color: #fff;
+}
+.list-l-Menu>li{
+ font-size: 1rem;
+ padding:0px 0px 0px 20px;
+ box-sizing: border-box;
+ position: relative;
+}
+.list-l-Menu>li > p{
+ height: 62px;
+ line-height: 62px;
+ width: 100%;
+ border-bottom: 1px solid #eee;
+ display: flex;
+ justify-content: space-between;
+ cursor: pointer;
+ padding-right: 20px;
+}
+.list-l-Menu>li:last-child > p{
+ border-bottom: none;
+}
+.list-l-Menu li p span:last-child{
+ color: #999;
+}
+.list-l-Menu .MenuTitle{
+ font-size: 16px;
+ background-size: 100% 100%;
+ height: 62px;
+ line-height: 62px;
+ border-bottom: 1px solid #E0E0E0;
+}
+.list-l-Menu > li:not(.MenuTitle):hover{
+ background-color: #fafafa;
+}
+
+/* 左侧menu */
+.list-l-Menu .ant-menu-inline{
+ border:none;
+}
+.list-l-Menu .ant-menu-inline .ant-menu-item{
+ width:100%!important;
+}
+.list-l-Menu .ant-menu-item-group-title{
+ padding:0px;
+}
+.list-l-Menu li.active{
+ background-color: #fafafa;
+}
+.list-l-Menu li.active::before{
+ position: absolute;
+ left: 0px;
+ top: 10px;
+ width: 6px;
+ content: '';
+ height: 33px;
+ background: #4CACFF;
+}
+.text-center{text-align: center;}
+.mt-n15{margin-top: -15px;}
+.position-relative{position: relative;}
+.mr-5{margin-right: 5px;}
+a.text-button-grey{
+ color: rgba(0, 0, 0, 0.65)
+}
+.user-info-star-button{margin: 20px 50px 0 50px}
+.list-l-p{
+ width: 100%;
+ display: -ms-flexbox;
+ display: flex;
+ -ms-flex-pack: justify;
+ justify-content: space-between;
+ cursor: pointer;
+ padding-right: 20px;
+}
+.fwb {
+ font-weight: bold;
+}
\ No newline at end of file
diff --git a/src/modules/tpm/NewHeader.js b/src/modules/tpm/NewHeader.js
index 4c2f499d..4d89f6a9 100644
--- a/src/modules/tpm/NewHeader.js
+++ b/src/modules/tpm/NewHeader.js
@@ -922,12 +922,13 @@ class NewHeader extends Component {
-
- {user.username}
+ 个人中心
+ {/* {user.username} */}
- {
+ {/* {
mygetHelmetapi2 && mygetHelmetapi2.new_course && mygetHelmetapi2.new_course.edit_account &&
- 修改资料
- }
+ } */}
{
mygetHelmetapi2 && mygetHelmetapi2.new_course && mygetHelmetapi2.new_course.my_courses &&
- 我的课程
diff --git a/src/modules/tpm/TPMIndex.css b/src/modules/tpm/TPMIndex.css
index dde8c34c..1f40ed79 100644
--- a/src/modules/tpm/TPMIndex.css
+++ b/src/modules/tpm/TPMIndex.css
@@ -96,7 +96,7 @@ body>.-task-title {
}
.newContainer {
- background: #fafafa !important;
+ background: #EAEBEC !important;
}
.ant-modal-title {
diff --git a/src/modules/tpm/TPMIndexHOC.js b/src/modules/tpm/TPMIndexHOC.js
index 4136ae3a..a196967a 100644
--- a/src/modules/tpm/TPMIndexHOC.js
+++ b/src/modules/tpm/TPMIndexHOC.js
@@ -581,7 +581,7 @@ export function TPMIndexHOC(WrappedComponent) {
}
render() {
- let { Headertop, Footerdown, isRender, AccountProfiletype, AccountPhoneemailtype } = this.state;
+ let { Headertop, Footerdown, isRender, AccountProfiletype, AccountPhoneemailtype, current_user } = this.state;
const common = {
isSuperAdmin: this.isSuperAdmin,
isAdminOrCreator: this.isAdminOrCreator,
diff --git a/src/modules/tpm/challengesnew/tpm-md-editor.js b/src/modules/tpm/challengesnew/tpm-md-editor.js
index 34507ff4..9105f23f 100644
--- a/src/modules/tpm/challengesnew/tpm-md-editor.js
+++ b/src/modules/tpm/challengesnew/tpm-md-editor.js
@@ -75,14 +75,14 @@ function md_elocalStorage(editor, mdu, id) {
}
-export default ({ mdID, onChange, onCMBeforeChange, onCMBlur, error = false, className = '', noStorage = false, imageExpand = true, placeholder = '', width = '100%', height = 400, initValue = '', emoji, watch, showNullButton = false, showResizeBar = false, startInit = true }) => {
+export default ({ mdID,onChange,autoFocus,onCMBeforeChange, onCMBlur, error = false, className = '', noStorage = false, imageExpand = true, placeholder = '', width = '100%', height = 400, initValue = '', emoji, watch, showNullButton = false, showResizeBar = false, startInit = true }) => {
const editorEl = useRef()
const resizeBarEl = useRef()
const [editorInstance, setEditorInstance] = useState()
const containerId = `mdEditor_${mdID}`
const editorBodyId = `mdEditors_${mdID}`
- const tipId = `e_tips_mdEditor_${mdID}`
+ const tipId = `e_tips_mdEditor_${mdID}`
function onLayout() {
let ro
@@ -92,7 +92,10 @@ export default ({ mdID, onChange, onCMBeforeChange, onCMBlur, error = false, cla
if (entry.target.offsetHeight > 0 || entry.target.offsetWidth > 0) {
editorInstance.resize()
editorInstance.cm.refresh()
- editorInstance.cm.focus()
+ // if(autofocus){
+ // editorInstance.cm.focus()
+ // }
+
}
}
})
@@ -102,6 +105,7 @@ export default ({ mdID, onChange, onCMBeforeChange, onCMBlur, error = false, cla
}
useEffect(() => {
+
if (editorInstance) {
return
}
@@ -120,7 +124,7 @@ export default ({ mdID, onChange, onCMBeforeChange, onCMBlur, error = false, cla
searchReplace: true,
htmlDecode: "style,script,iframe",
sequenceDiagram: true,
- autoFocus: false,
+ autoFocus: autoFocus === undefined ? false : autoFocus,
watch: watch === undefined ? true : watch,
saveHTMLToTextarea: true,