diff --git a/src/forge/Order/Detail.js b/src/forge/Order/Detail.js index 4d1b47cf..3be8cc2b 100644 --- a/src/forge/Order/Detail.js +++ b/src/forge/Order/Detail.js @@ -7,8 +7,11 @@ import { Form, Popconfirm, Tag, Spin } from "antd"; import Attachments from "../Upload/attachment"; import RenderHtml from "../../components/render-html"; import Comments from "../comments/comments"; +import Claims from "../claims/claims" import "./order.css"; + + class Detail extends Component { constructor(props) { super(props); @@ -309,7 +312,16 @@ class Detail extends Component { {...this.props} /> + +
负责人: diff --git a/src/forge/claims/claims.js b/src/forge/claims/claims.js new file mode 100644 index 00000000..97991270 --- /dev/null +++ b/src/forge/claims/claims.js @@ -0,0 +1,112 @@ +import React, { Component } from "react"; +import axios from "axios"; +import { List, Button} from "antd"; +import { Link } from "react-router-dom"; +import { getImageUrl } from "educoder"; +import "../Order/order.css"; + +class claims extends React.Component { + constructor(props) { + super(props); + this.state = { + claimerdata: new Array(), + currentUserClaimed:0, + issue_id:this.props.issue_id + }; + + } + getClaimers = ()=>{ + const {issue_id} = this.state; + axios.get(`/issues/${issue_id}/claims`) + .then((result) => { + if(result){ + console.log(result.data), + this.setState({ + claimerdata: result.data.claimers, + currentUserClaimed: result.data.currentUserclaimed, + }); + } + }).catch(function (error) { + console.log(error); + }); + } + + claimFun = (flag) => { + const {issue_id} = this.state; + axios({ + method: flag==1? 'delete' : 'post', + url: `/issues/${issue_id}/claims` + }).then(result => { + this.setState({ + claimerdata: result.data.claimers, + currentUserClaimed: result.data.currentUserclaimed + }); + }) + .catch(error => { + console.log(error); + }); + } + + componentDidMount = () => { + this.getClaimers(); + // this.props.bindCommentRef && this.props.bindCommentRef(this); + }; + render() { + const { + claimerdata, + currentUserClaimed, + issue_id + } = this.state; + + const rednerlist = (item)=>{ + return ( +