diff --git a/public/css/edu-purge.css b/public/css/edu-purge.css index 210eb3726..788f821c7 100644 --- a/public/css/edu-purge.css +++ b/public/css/edu-purge.css @@ -3926,6 +3926,7 @@ html>body #ajax-indicator { .markdown-body { text-align: justify; word-break: break-all; + width:100%; } .RightPaneDrawer .ant-drawer-content { diff --git a/src/forge/Images/handbook.png b/src/forge/Images/handbook.png index 39f24c3d8..93903a6d4 100644 Binary files a/src/forge/Images/handbook.png and b/src/forge/Images/handbook.png differ diff --git a/src/forge/Order/order_form.js b/src/forge/Order/order_form.js index 7ac12c2a6..f8867dd1a 100644 --- a/src/forge/Order/order_form.js +++ b/src/forge/Order/order_form.js @@ -1,6 +1,5 @@ import React, { Component } from "react"; -import { Form, Input, Select, Button, DatePicker } from "antd"; -import { Cancel } from '../Component/layout'; +import { Form, Input, Select, Button, DatePicker ,Spin } from "antd"; import Upload from "../Upload/Index"; import UploadImg from "../Images/upload.png"; import MDEditor from "../../modules/tpm/challengesnew/tpm-md-editor"; @@ -18,17 +17,17 @@ class order_form extends Component { branch_name: "", issue_tag_ids: "", fixed_version_id: "", - tracker_id: "缺陷", + tracker_id: "", issue_type: "1", - status_id: "新增", + status_id: "", assigned_to_id: "", - priority_id: "正常", + priority_id: "", done_ratio: "0%", issue_chosen: undefined, branches: undefined, fileList: undefined, description: undefined, - isSpin: false, + isSpin: true, token: undefined, start_date: "", due_date: "", @@ -38,78 +37,54 @@ class order_form extends Component { }; } componentDidUpdate=(prevPros)=>{ - if(prevPros && this.props && !this.props.checkIfLogin()){ + if(prevPros && this.props && this.props.checkIfLogin()===false){ this.props.history.push("/403") return } } componentDidMount = () => { - // this.check_is_login() this.getSelectList(); - this.get_detail(); + setTimeout(this.get_detail(),800); }; - // check_is_login =() =>{ - // if(!this.props.checkIfLogin()){ - // this.props.history.push("/403") - // return - // } - // } get_detail = () => { - const { form_type } = this.props; - if (form_type === "new") { - 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, - } - ); - } - }) - .catch((error) => { - this.state.isSpin = false; - console.log(error); - }); - } + this.setState({ + isSpin:true + }) + const { projectsId, orderId } = this.props.match.params; + const url = `/projects/${projectsId}/issues/${orderId}/edit.json`; + axios.get(url).then((result) => { + if (result) { + let data ={ + branch_name: result.data.branch_name, + issue_tag_ids: [ + result.data.issue_tags && result.data.issue_tags[0].id ? + String(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.props.form.setFieldsValue({ ...data }); + this.setState({ ...data }); + } + }).catch((error) => { + this.setState({ + isSpin:false + }) + console.log(error); + }); }; getSelectList = () => { let projectsId = ""; @@ -121,28 +96,24 @@ class order_form extends Component { } 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); - }); + 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 ( - ); @@ -180,58 +151,56 @@ class order_form extends Component { 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 && result.data.id) { - this.props.showNotification("任务创建成功!"); - this.props.history.push(`/projects/${projectsId}/orders/${result.data.id}/detail`); - this.setState({ - description: "", - isSpin: false, - }); - const { getDetail } = this.props; - getDetail && getDetail(); - } - }) - .catch((error) => { + 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 && result.data.id) { + this.props.showNotification("任务创建成功!"); + this.props.history.push(`/projects/${projectsId}/orders/${result.data.id}/detail`); this.setState({ + description: "", isSpin: false, }); - console.log(error); + 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); + 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({ @@ -327,270 +296,224 @@ class order_form extends Component { 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; + const {issue_chosen,branches,description,get_attachments,isSpin,start_date,due_date} = this.state; return ( -
-
-
-
-

- {form_type === "new" ? "新建" :( form_type === "copy" ? "复制" : "编辑")}任务 -

- - {getFieldDecorator("subject", { - rules: [ - { - required: true, - message: "请填写任务标题", - }, - ], - initialValue: subject, - })()} - -
- -
- {get_attachments && get_attachments.length > 0 ? ( -
- + +
+ +
+
+

+ {form_type === "new" ? "新建" :( form_type === "copy" ? "复制" : "编辑")}任务 +

+ + {getFieldDecorator("subject", { + rules: [ + { + required: true, + message: "请填写任务标题", + }, + ] + })()} + +
+
- ) : ( - "" - )} - - } - size={100} - showNotification={this.props.showNotification} - /> -

- - -

+ {get_attachments && get_attachments.length > 0 ? ( +
+ +
+ ) : ( + "" + )} + + } + size={100} + showNotification={this.props.showNotification} + /> +

+ + +

+
-
-
-
- - {getFieldDecorator("branch_name", { - rules: [], - initialValue: branch_name, - })( - + + {branches && branches.length > 0 && branches.map((item, key) => { return ( ); })} - - )} - - - {getFieldDecorator("status_id", { - rules: [ - { + + )} + + + {getFieldDecorator("status_id", { + rules: [{ required: true, message: "请选择完成状态", - }, - ], - initialValue: status_id, - })( - - )} - - - {getFieldDecorator("tracker_id", { - rules: [ - { + }] + })( + + )} + + + {getFieldDecorator("tracker_id", { + rules: [{ required: true, message: "请选择类型", - }, - ], - initialValue: tracker_id, - })( - - )} - + }] + })( + + )} + - - {getFieldDecorator("priority_id", { - rules: [ - { + + {getFieldDecorator("priority_id", { + rules: [{ required: true, message: "请选择优先度", - }, - ], - initialValue: priority_id, - })( - - )} - - - - {getFieldDecorator("fixed_version_id", { - rules: [], - initialValue: fixed_version_id, - })( - - )} - - - {getFieldDecorator("issue_tag_ids", { - rules: [], - initialValue: issue_tag_ids, - })( - - )} - - - - {getFieldDecorator("assigned_to_id", { - rules: [{}], - initialValue: assigned_to_id, - })( - - )} - - - - - - - - - {getFieldDecorator("done_ratio", { - rules: [], - initialValue: done_ratio, - })( - - )} - - {/* - - - {(show_token || (issue_type && issue_type === "2")) && ( - - {getFieldDecorator("token", { - rules: [ - { - required: true, - message: "请填写token值", - }, - ], - initialValue: token, - })()} + }] + })( + + )} - )} */} + + + {getFieldDecorator("fixed_version_id", {rules: []})( + + )} + + + {getFieldDecorator("issue_tag_ids", {rules: []})( + + )} + + + + {getFieldDecorator("assigned_to_id", {rules: []})( + + )} + + + + + + + + + {getFieldDecorator("done_ratio", {rules: []})( + + )} + + {/* + + + {(show_token || (issue_type && issue_type === "2")) && ( + + {getFieldDecorator("token", { + rules: [ + { + required: true, + message: "请填写token值", + }, + ], + initialValue: token, + })()} + + )} */} +
-
- -
+ +
+ ); } } diff --git a/src/modules/tpm/NewHeader.js b/src/modules/tpm/NewHeader.js index 7bf19ae05..ec0c8ee86 100644 --- a/src/modules/tpm/NewHeader.js +++ b/src/modules/tpm/NewHeader.js @@ -52,6 +52,7 @@ class NewHeader extends Component { componentDidMount() { this.getAppdata(); window._header_componentHandler = this; + //下拉框的显示隐藏 var hoverTimeout; var hoveredPanel; @@ -761,6 +762,9 @@ class NewHeader extends Component { ) }) } +
  • + 问题反馈 +
  • : ""