diff --git a/src/AppConfig.js b/src/AppConfig.js index 1a241cead..7a8272a7a 100644 --- a/src/AppConfig.js +++ b/src/AppConfig.js @@ -32,7 +32,7 @@ export function initAxiosInterceptors(props) { // 判断网络是否连接 initOnlineOfflineListener(); - var proxy = "https://testforgeplus.trustie.net"; + var proxy = "https://testforgeplus.educoder.net"; //响应前的设置 axios.interceptors.request.use( config => { diff --git a/src/forge/Order/Milepost.js b/src/forge/Order/Milepost.js index 7009dc7eb..0ececf94f 100644 --- a/src/forge/Order/Milepost.js +++ b/src/forge/Order/Milepost.js @@ -45,7 +45,7 @@ class Milepost extends Component { getList = (page, status, order_type, order_name) => { const { projectsId ,owner } = this.props.match.params; - const { limit } = this.state; + const { limit,keyword } = this.state; const url = `/${owner}/${projectsId}/milestones.json`; axios.get(url, { params: { diff --git a/src/forge/Order/UpdateMilepost.js b/src/forge/Order/UpdateMilepost.js index fdede8ec1..2c4511b3a 100644 --- a/src/forge/Order/UpdateMilepost.js +++ b/src/forge/Order/UpdateMilepost.js @@ -1,5 +1,8 @@ import React, { Component } from 'react'; import { Calendar, Select, Radio, Col, Row, Divider, Input, Form, Spin } from 'antd'; +import Upload from "../Upload/Index"; +import UploadImg from "../Images/upload.png"; +import Attachments from "../Upload/attachment"; import axios from 'axios'; import moment from 'moment'; import '../Order/order.css'; @@ -14,7 +17,8 @@ class UpdateMilepost extends Component { data: undefined, value: moment('2017-01-25'), selectedValue: moment('2020-2-12'), - isSpin: false + isSpin: false, + get_attachments: undefined, } } @@ -34,6 +38,12 @@ class UpdateMilepost extends Component { selectedValue: time, }); } + // 获取上传后的文件id数组 + UploadFunc = (fileList) => { + this.setState({ + fileList, + }); + }; getmeil = () => { const { projectsId , owner } = this.props.match.params; @@ -47,11 +57,13 @@ class UpdateMilepost extends Component { if (result) { this.setState({ data: result.data, - selectedValue: result.data.effective_date && moment(result.data.effective_date) + selectedValue: result.data.effective_date && moment(result.data.effective_date), + get_attachments: result.data.attachments, }) this.props.form.setFieldsValue({ name: result.data.name, - description: result.data.description + description: result.data.description, + get_attachments: result.data.attachments, }); } @@ -101,7 +113,7 @@ class UpdateMilepost extends Component { render() { const { getFieldDecorator } = this.props.form; - const { isSpin , selectedValue } = this.state; + const { isSpin , selectedValue, get_attachments } = this.state; return (
@@ -135,6 +147,32 @@ class UpdateMilepost extends Component { )} + {get_attachments && get_attachments.length > 0 ? ( +
+ +
+ ) : ( + "" + )} + + } + size={100} + showNotification={this.props.showNotification} + />
截止日期(可选) 清除 diff --git a/src/forge/Order/newMilepost.js b/src/forge/Order/newMilepost.js index abfe84335..707ccbc29 100644 --- a/src/forge/Order/newMilepost.js +++ b/src/forge/Order/newMilepost.js @@ -1,5 +1,8 @@ import React, { Component } from 'react'; import { Calendar, Select, Radio, Col, Row, Divider, Input, Form, Spin } from 'antd'; +import Upload from "../Upload/Index"; +import UploadImg from "../Images/upload.png"; +import Attachments from "../Upload/attachment"; import axios from 'axios'; import moment from 'moment'; import '../Order/order.css'; @@ -13,7 +16,9 @@ class NewMilepost extends Component { data: undefined, value: moment('2017-01-25'), selectedValue: undefined, - isSpin: false + isSpin: false, + get_attachments: undefined, + fileList: undefined, } } componentDidUpdate=(prevPros)=>{ @@ -35,6 +40,13 @@ class NewMilepost extends Component { // return // } // }; + + // 获取上传后的文件id数组 + UploadFunc = (fileList) => { + this.setState({ + fileList, + }); + }; onPanelChange = (time, mode) => { this.setState({ @@ -54,6 +66,7 @@ class NewMilepost extends Component { this.props.form.validateFieldsAndScroll((err, values) => { if (!err) { const { projectsId , owner } = this.props.match.params; + const { fileList } = this.state; const url = `/${owner}/${projectsId}/milestones.json`; let time = undefined; if (this.state.selectedValue) { @@ -62,11 +75,13 @@ class NewMilepost extends Component { axios.post(url, { ...values, project_id: projectsId, + attachment_ids: fileList, effective_date: time, status: 'open' }).then(result => { if (result) { this.setState({ isSpin: false }) + this.props.showNotification("里程碑创建成功!"); this.props.history.push(`/${owner}/${projectsId}/milestones`); const { getDetail } = this.props; getDetail && getDetail(); @@ -87,7 +102,7 @@ class NewMilepost extends Component { render() { const { getFieldDecorator } = this.props.form; - const { isSpin } = this.state + const { isSpin,get_attachments } = this.state return (
@@ -121,6 +136,33 @@ class NewMilepost extends Component { )} + {get_attachments && get_attachments.length > 0 ? ( +
+ +
+ ) : ( + "" + )} + + } + size={100} + showNotification={this.props.showNotification} + />
截止日期(可选) 清除 diff --git a/src/forge/Order/order.css b/src/forge/Order/order.css index ab9a591f5..4a9fa5d54 100644 --- a/src/forge/Order/order.css +++ b/src/forge/Order/order.css @@ -672,6 +672,9 @@ a.issue-type-button.active:hover { .commentStyle { background-color: #fff !important; } +.uploadHeight{ + height: 110px !important; +} .reply-comment-input .add_reply_button { background-color: #fff !important; color: #bbb;