From 417fc53c901675db744b31bfabf8e5bdc1313e8f Mon Sep 17 00:00:00 2001 From: "sylor_huang@126.com" Date: Thu, 28 May 2020 11:37:17 +0800 Subject: [PATCH 1/9] =?UTF-8?q?=E4=BF=AE=E6=94=B9issue=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/forge/Order/CopyDetail.js | 5 +- src/forge/Order/Detail.js | 1112 +++++++++++++++++++++------------ src/forge/Order/order.css | 15 +- src/forge/Order/order.js | 60 +- 4 files changed, 726 insertions(+), 466 deletions(-) diff --git a/src/forge/Order/CopyDetail.js b/src/forge/Order/CopyDetail.js index 2fac366c..0a7703c4 100644 --- a/src/forge/Order/CopyDetail.js +++ b/src/forge/Order/CopyDetail.js @@ -198,8 +198,9 @@ class CopyDetail extends Component {
- + + +
{getFieldDecorator('subject', { diff --git a/src/forge/Order/Detail.js b/src/forge/Order/Detail.js index 7a662eeb..e4e719e1 100644 --- a/src/forge/Order/Detail.js +++ b/src/forge/Order/Detail.js @@ -1,15 +1,15 @@ -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 } from 'antd' -import Attachments from '../Upload/attachment'; -import MDEditor from '../../modules/tpm/challengesnew/tpm-md-editor'; -import RenderHtml from '../../components/render-html'; -import AmplifyImg from './AmplifyImg'; +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 RenderHtml from "../../components/render-html"; +import "./order.css"; +// import AmplifyImg from "./AmplifyImg"; class Detail extends Component { constructor(props) { @@ -17,12 +17,12 @@ class Detail extends Component { this.state = { data: undefined, isShow: false, - imgsrc: '', + imgsrc: "", journalsdata: undefined, //图片区域是否显示 none 隐藏 block 显示 - display: 'none', - titledisplay: 'none', - countvalue: '', + display: "none", + titledisplay: "none", + countvalue: "", //是否需要编辑 isedit: undefined, fileList: undefined, @@ -31,314 +31,345 @@ class Detail extends Component { search_count: undefined, isSpin: false, showFiles: true, - quillValue: '', + quillValue: "", quillFlag: false, // 点击放大的图片路径 imageUrl: undefined, visible: false, journal_spin: false, - edit_spin: false - } + edit_spin: false, + }; } componentDidMount = () => { this.getDetail(); - } + }; getDetail = () => { const { projectsId, orderId } = this.props.match.params; const url = `/projects/${projectsId}/issues/${orderId}.json`; - axios.get(url).then((result) => { - if (result) { - this.setState({ - data: result.data - }) - this.getjournalslist(); - } - }).catch((error) => { - console.log(error); - }) - } + axios + .get(url) + .then((result) => { + if (result) { + this.setState({ + data: result.data, + }); + this.getjournalslist(); + } + }) + .catch((error) => { + console.log(error); + }); + }; handleok = () => { this.setState({ - isShow: false + isShow: false, }); }; handleCancel = () => { this.setState({ - isShow: false - }); - } - - imgshow = () => { - this.setState({ - isShow: true + isShow: false, }); }; - //添加评论 + imgshow = () => { + this.setState({ + isShow: true, + }); + }; + + //添加评论 addjournals = () => { const { quillValue } = this.state; this.setState({ - journal_spin: true - }) + journal_spin: true, + }); if (!quillValue) { this.setState({ quillFlag: true, - journal_spin: false - }) + 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 + axios + .post(url, { + ...values, + content: quillValue, + issue_id: data.id, + attachment_ids: fileList, }) - console.log(error); - }) - }else{ + .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 - }) + 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); - }) - } + 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) => { const { projectsId, orderId } = this.props.match.params; const url = `/projects/${projectsId}/issues/${orderId}.json`; - axios.delete(url, { - data: { - project_id: projectsId, - id: id - } - }).then((result) => { - if (result) { - this.props.history.push(`/projects/${projectsId}/orders`); - } - }).catch((error) => { - console.log(error); - }) - } + axios + .delete(url, { + data: { + project_id: projectsId, + id: id, + }, + }) + .then((result) => { + if (result) { + this.props.history.push(`/projects/${projectsId}/orders`); + } + }) + .catch((error) => { + console.log(error); + }); + }; //关闭任务 closedetail = (id) => { const { projectsId, orderId } = this.props.match.params; const url = `/projects/${projectsId}/issues/${orderId}/close_issue.json`; - axios.post(url, { - project_id: projectsId, - id: orderId, - status_id: id, - }).then(result => { - if (result) { - this.getDetail(); - } - }).catch(error => { - console.log(error); - }) - } + axios + .post(url, { + project_id: projectsId, + id: orderId, + status_id: id, + }) + .then((result) => { + if (result) { + this.getDetail(); + } + }) + .catch((error) => { + console.log(error); + }); + }; //修改评论 updatedetail = (id) => { const { page, limit, countvalue } = this.state; const { orderId } = this.props.match.params; this.setState({ - edit_spin: true - }) + 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 + axios + .put(url, { + issue_id: orderId, + id: id, + content: countvalue, }) - console.log(error); - }) - } + .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 - }) - } + 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); - }) - } - + 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 - }) - } + 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 - : - "无" - } - -
- ) - }) - ) + 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 = () => { const { projectsId, orderId } = this.props.match.params; const url = `/projects/${projectsId}/issues/${orderId}/copy.json`; - axios.post(url, { - project_id: projectsId, - id: orderId, - }).then(result => { - if (result) { - this.props.history.push(`/projects/${projectsId}/orders/${result.data.issue_id}/copyetail`); - } - }).catch(error => { - console.log(error); - }) - } + axios + .post(url, { + project_id: projectsId, + id: orderId, + }) + .then((result) => { + if (result) { + this.props.history.push( + `/projects/${projectsId}/orders/${result.data.issue_id}/copyetail` + ); + } + }) + .catch((error) => { + console.log(error); + }); + }; // 翻页 ChangePage = (page) => { this.setState({ page, - isSpin: true - }) + isSpin: true, + }); const { limit } = this.state; this.getjournalslist(page, limit); - } + }; // 判断是否重新上传文件 changeIsComplete = (flag) => { this.setState({ - showFiles: flag - }) - } + showFiles: flag, + }); + }; // 新建评论 onContentChange = (value) => { if (value) { this.setState({ quillValue: value, - quillFlag: false - }) + quillFlag: false, + }); } - } + }; // 编辑评论 onEditContentChange = (value) => { if (value) { this.setState({ - countvalue: value - }) + countvalue: value, + }); } - } + }; handleShowImage = (value) => { this.setState({ imageUrl: value, - visible: true - }) - } + visible: true, + }); + }; setVisible = (flag) => { this.setState({ - visible: flag - }) - } + visible: flag, + }); + }; stringJson = (value) => { let _value = null; @@ -348,46 +379,80 @@ class Detail extends Component { } catch (e) { _value = value; } - return _value - } + return _value; + }; commentCtx = (v) => { - return ( - - ) + 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 { + 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 ? -
- -
: "" - } + {search_count > limit ? ( +
+ +
+ ) : ( + "" + )}
- ) + ); const renderList = () => { - if (journalsdata && journalsdata.issue_journals && journalsdata.issue_journals.length > 0) { + if ( + journalsdata && + journalsdata.issue_journals && + journalsdata.issue_journals.length > 0 + ) { return ( -
{ - journalsdata.issue_journals.map((item, key) => { +
+ {journalsdata.issue_journals.map((item, key) => { return (
  • - { - key > 0 && -
    - } + {key > 0 && ( +
    + )}
    - - + + -
    +

    {item.user_name} @@ -396,221 +461,450 @@ class Detail extends Component { {item.created_at}

    -
    - this.editdetail(item.content, item.id)} className="detail_edit_action">编辑 - this.deleteorder(item.id)}> +
    + + 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.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"; + } else if (type === "正常") { + return "#28be6c"; + } else if (type === "低") { + return "#1abc9c"; + } else { + return "#e74c3c"; + } + }; return ( -
    - {visible && } -
    -
    -

    - { - 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 ? - - : - "" - } -
    + )}
    -
    - -
      - {renderList()} -
    -
    - - {Paginations} - { - current_user && current_user.login ? - -
    -
    - -
    -
    - -

    - {quillFlag && 请输入评论内容} -

    -
    - -

    - - 评论 - { - data && data.user_permission ? - this.closedetail(data && data.issue_status === "关闭" ? 2 : 5)}>{data && data.issue_status === "关闭" ? "重新开启" : "关闭"} - : - "" - } - - - -

    -
    -
    -
    - : -
    登录并参与到对话中
    - } -
    -
    -

    - 分支 - { - 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.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_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 : "--"} +

    +

    + token值: + {data && data.token ? data.token : "--"} +

    +

    + 完成度: + {data && data.done_ratio ? data.done_ratio : "--"} +

    - - -
    - ) + //
    + // {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 ? + // + // : + // "" + // } + //
    + //
    + //
    + // + //
      + // {renderList()} + //
    + //
    + + // {Paginations} + // { + // current_user && current_user.login ? + // + //
    + //
    + // + //
    + //
    + // + //

    + // {quillFlag && 请输入评论内容} + //

    + //
    + // + //

    + // + // 评论 + // { + // data && data.user_permission ? + // this.closedetail(data && data.issue_status === "关闭" ? 2 : 5)}>{data && data.issue_status === "关闭" ? "重新开启" : "关闭"} + // : + // "" + // } + // + + //

    + //
    + //
    + //
    + // : + //
    登录并参与到对话中
    + // } + + //
    + //
    + //

    + // 分支 + // { + // 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 : "--"} + //

    + + //
    + //
    + //
    + // + // + // + //
    + ); } } -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/order.css b/src/forge/Order/order.css index 4d91b372..c083942b 100644 --- a/src/forge/Order/order.css +++ b/src/forge/Order/order.css @@ -503,7 +503,7 @@ /*text-align: right;*/ /*}*/ .span_title{ - min-width: 90px; + min-width: 40px; margin-right: 15px; text-align: right; color: rgba(0, 0, 0, 0.65); @@ -532,6 +532,8 @@ a.issue-type-button.active:hover{background: #f4f4f4; color: #4CACFF;} .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;} /* 发布人、指派人数量过多时要出现滚动条 */ @@ -555,4 +557,13 @@ a.issue-type-button.active:hover{background: #f4f4f4; color: #4CACFF;} .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; +} \ No newline at end of file diff --git a/src/forge/Order/order.js b/src/forge/Order/order.js index 3051f17d..80ff7396 100644 --- a/src/forge/Order/order.js +++ b/src/forge/Order/order.js @@ -1,8 +1,7 @@ import React, { Component } from "react"; -import { Input, Dropdown, Menu, Icon, Pagination, Spin, Button, DatePicker } from "antd"; +import { Input, Dropdown, Menu, Icon, Pagination, Spin } from "antd"; import "./order.css"; -const { RangePicker } = DatePicker; import NoneData from "../Nodata"; import OrderItem from "./OrderItem"; @@ -60,8 +59,6 @@ class order extends Component { order_name: undefined, order_type: undefined, search: undefined, - start_date:undefined, - due_date: undefined, page: 1, limit: 15, }, @@ -158,20 +155,13 @@ class order extends Component { 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 - ) { + 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 - ) { + 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; } else { this.state.assigned_to_id = undefined; @@ -228,8 +218,6 @@ class order extends Component { }); if (type) { this.setState({ - author_id: undefined, - assigned_to_id: undefined, status_type: type, issue_tag_ids: "标签", tracker_ids: "所有分类", @@ -377,42 +365,8 @@ class order extends Component { ); return (
    -
    -
    - - 所有: - - - - 开启中: - - - - 已关闭: - - -
    - - -
    -
    - -
    - -
    - - {/*

    +

  • this.openorder("1")} @@ -425,9 +379,9 @@ class order extends Component { > {data && data.close_count}个已关闭
  • -

    */} +

    - {/*
    +
    this.islogin()}> 创建任务 -
    */} +
    From c365868ebb8ed68dd9bf4351c0d6763088e97026 Mon Sep 17 00:00:00 2001 From: "sylor_huang@126.com" Date: Fri, 29 May 2020 17:45:46 +0800 Subject: [PATCH 2/9] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E5=BC=B9=E6=A1=86=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/forge/Main/Detail.js | 1 - src/forge/Order/New.js | 9 +- src/forge/Order/order.css | 3 +- src/forge/comments/children_comments.js | 58 ++++--- src/forge/comments/children_journals.js | 211 ++++++++++++++++++++++++ src/forge/comments/comments.js | 17 +- src/modules/tpm/TPMIndexHOC.js | 2 +- 7 files changed, 258 insertions(+), 43 deletions(-) create mode 100644 src/forge/comments/children_journals.js diff --git a/src/forge/Main/Detail.js b/src/forge/Main/Detail.js index b0c173ae..45cde09c 100644 --- a/src/forge/Main/Detail.js +++ b/src/forge/Main/Detail.js @@ -238,7 +238,6 @@ class Detail extends Component { // fork项目 forkFunc = () => { - const { checkIfLogin } = this.props; if (!checkIfLogin) { this.props.showLoginDialog(); return; diff --git a/src/forge/Order/New.js b/src/forge/Order/New.js index fad9b46a..97c27b2c 100644 --- a/src/forge/Order/New.js +++ b/src/forge/Order/New.js @@ -32,10 +32,11 @@ class New extends Component { } componentDidMount = () => { - if (!this.props.checkIfLogin()) { - this.props.showLoginDialog(); - return; - } + // console.log("current_user", this.props.current_user) + // if (!this.props.checkIfLogin()) { + // this.props.showLoginDialog(); + // return; + // } this.InitData(); this.getSelectList(); } diff --git a/src/forge/Order/order.css b/src/forge/Order/order.css index 1c1319cd..94d9d3fb 100644 --- a/src/forge/Order/order.css +++ b/src/forge/Order/order.css @@ -579,7 +579,8 @@ a.issue-type-button.active:hover{background: #f4f4f4; color: #4CACFF;} .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;} +.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); diff --git a/src/forge/comments/children_comments.js b/src/forge/comments/children_comments.js index 02ad3040..032168cd 100644 --- a/src/forge/comments/children_comments.js +++ b/src/forge/comments/children_comments.js @@ -5,11 +5,10 @@ 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 { +class children_comments extends Component { constructor(props) { super(props); this.state = { @@ -17,26 +16,25 @@ class comments extends Component { limit: 10, page: 1, journal_spin: false, - search_count:0, - orderId: this.props.order_id, - parent_id: this.props.parent_id + search_count: 0, }; } - componentDidMount(){ - this.getChildrenJournals() -} -componentDidUpdate(prevProps, prevState) { - if (this.props.children_comment_id) { - if (prevProps.children_comment_id !== this.props.children_comment_id) - this.getChildrenJournals() + 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 + getChildrenJournals = (i_order_id, i_parentId) => { + const { order_id, parent_id } = this.props; + const { page, limit } = this.state; + let new_order_id = i_order_id ? i_order_id : order_id; + let new_parent_id = i_parentId ? i_parentId : parent_id; const url = `/issues/${new_order_id}/journals/${new_parent_id}/get_children_journals.json`; axios .get(url, { @@ -50,7 +48,7 @@ componentDidUpdate(prevProps, prevState) { this.setState({ journalsdata: result.data, search_count: result.data.journals_count, - isSpin: false + isSpin: false, }); } }) @@ -61,12 +59,12 @@ componentDidUpdate(prevProps, prevState) { //删除评论 deleteorder = (id) => { - const { orderId } = this.state; - const url = `/issues/${orderId}/journals/${id}.json`; + const { order_id } = this.props; + const url = `/issues/${order_id}/journals/${id}.json`; axios .delete(url, { data: { - issue_id: orderId, + issue_id: order_id, id: id, }, }) @@ -82,8 +80,8 @@ componentDidUpdate(prevProps, prevState) { // 翻页 ChangePage = (page) => { - this.state.page = page - this.state.isSpin = true + this.state.page = page; + this.state.isSpin = true; this.getChildrenJournals(); }; @@ -97,7 +95,8 @@ componentDidUpdate(prevProps, prevState) { page, limit, search_count, - isSpin + isSpin, + parent_id, } = this.state; const { current_user } = this.props; @@ -188,21 +187,20 @@ componentDidUpdate(prevProps, prevState) { return (
    - { - search_count > 0 && + {search_count > 0 && (
    - {renderList(item)}} /> {Paginations} -
    - } +
    + )}
    ); } } -export default comments; +export default children_comments; diff --git a/src/forge/comments/children_journals.js b/src/forge/comments/children_journals.js new file mode 100644 index 00000000..67e8ea2f --- /dev/null +++ b/src/forge/comments/children_journals.js @@ -0,0 +1,211 @@ +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 children_journals extends Component { + constructor(props) { + super(props); + this.state = { + journalsdata: this.props.comments, + limit: 10, + page: 1, + journal_spin: false, + search_count: this.props.comments && this.props.comments.journals_count, + 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, parent_id, 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.props.getChildrenJournals(orderId,parent_id,1,limit); + // this.getChildrenJournals(); + } + }) + .catch((error) => { + console.log(error); + }); + }; + + // 翻页 + ChangePage = (page) => { + const { orderId, parent_id, limit } = this.state; + this.state.page = page + this.state.isSpin = true + this.props.getChildrenJournals(orderId,parent_id,page,limit); + // 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 children_journals; diff --git a/src/forge/comments/comments.js b/src/forge/comments/comments.js index 788335b6..1c1b062e 100644 --- a/src/forge/comments/comments.js +++ b/src/forge/comments/comments.js @@ -86,16 +86,22 @@ class comments extends Component { 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); + // if (is_reply) { + + // // this.getjournalslist(page, limit); + // // this.getjournalslist(page, limit); + // // this.child.getChildrenJournals(orderId, reply_id); + // } + if (is_reply){ // this.child.getChildrenJournals(orderId, reply_id); + this.state.new_journal_id = result.data.id; + }else{ + this.state.new_journal_id = undefined } + this.getjournalslist(page, limit); } this.props.showNotification(result.data.message); - // this.state.success_journal = false }) .catch((error) => { this.setState({ @@ -452,7 +458,6 @@ class comments extends Component { ) : ( "" )} - Date: Fri, 29 May 2020 18:08:25 +0800 Subject: [PATCH 3/9] some change --- src/forge/Main/Detail.js | 8 +- src/forge/Order/Detail.js | 154 ---------------- src/forge/Order/New.js | 10 +- src/forge/Order/order_form.js | 318 ++++++++++++++++++++++++++++++++++ 4 files changed, 327 insertions(+), 163 deletions(-) create mode 100644 src/forge/Order/order_form.js diff --git a/src/forge/Main/Detail.js b/src/forge/Main/Detail.js index 895f1092..ae4caf05 100644 --- a/src/forge/Main/Detail.js +++ b/src/forge/Main/Detail.js @@ -238,10 +238,10 @@ class Detail extends Component { // fork项目 forkFunc = () => { - if (!checkIfLogin) { - this.props.showLoginDialog(); - return; - } + // if (!checkIfLogin) { + // this.props.showLoginDialog(); + // return; + // } this.setState({ isSpin: true }) diff --git a/src/forge/Order/Detail.js b/src/forge/Order/Detail.js index f01465d8..a29ffc71 100644 --- a/src/forge/Order/Detail.js +++ b/src/forge/Order/Detail.js @@ -749,160 +749,6 @@ class Detail extends Component {
    - //
    - // {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 ? - // - // : - // "" - // } - //
    - //
    - //
    - // - //
      - // {renderList()} - //
    - //
    - - // {Paginations} - // { - // current_user && current_user.login ? - // - //
    - //
    - // - //
    - //
    - // - //

    - // {quillFlag && 请输入评论内容} - //

    - //
    - // - //

    - // - // 评论 - // { - // data && data.user_permission ? - // this.closedetail(data && data.issue_status === "关闭" ? 2 : 5)}>{data && data.issue_status === "关闭" ? "重新开启" : "关闭"} - // : - // "" - // } - // - - //

    - //
    - //
    - //
    - // : - //
    登录并参与到对话中
    - // } - - //
    - //
    - //

    - // 分支 - // { - // 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 : "--"} - //

    - - //
    - //
    - //
    - // - // - // - //
    ); } } diff --git a/src/forge/Order/New.js b/src/forge/Order/New.js index 97c27b2c..aa066021 100644 --- a/src/forge/Order/New.js +++ b/src/forge/Order/New.js @@ -32,11 +32,11 @@ class New extends Component { } componentDidMount = () => { - // console.log("current_user", this.props.current_user) - // if (!this.props.checkIfLogin()) { - // this.props.showLoginDialog(); - // return; - // } + console.log("current_user", this.props.current_user) + if (!this.props.checkIfLogin()) { + this.props.showLoginDialog(); + return; + } this.InitData(); this.getSelectList(); } diff --git a/src/forge/Order/order_form.js b/src/forge/Order/order_form.js new file mode 100644 index 00000000..0a215fc6 --- /dev/null +++ b/src/forge/Order/order_form.js @@ -0,0 +1,318 @@ +// 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; +// class order_form 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 = () => { +// // console.log("current_user", this.props.current_user) +// // 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 ( +//
    +// +//
    + +//
    +//
    + +//
    +//
    +//
    +// +// +// + +//
    +// +// {getFieldDecorator('subject', { +// rules: [{ +// required: true, message: '请填写任务标题' +// }], +// })( +// +// )} +// +//
    +// +//
    +// +//

    +// +// 创建任务 +// +//

    +//
    +//
    +//
    +//
    +// +// {getFieldDecorator('branch_name', { +// rules: [], +// })( +// +// )} +// +// +// {getFieldDecorator('issue_tag_ids', { +// rules: [], +// })( +// +// )} +// +// +// {getFieldDecorator('fixed_version_id', { +// rules: [], + +// })( +// +// )} +// +// +// {getFieldDecorator('status_id', { +// rules: [{ +// required: true, message: '请选择完成状态' +// }], +// })( +// +// )} +// +// +// {getFieldDecorator('tracker_id', { +// rules: [{ +// required: true, message: '请选择分类' +// }], +// })( +// +// )} +// +// +// {getFieldDecorator('assigned_to_id', { +// rules: [{ +// }], +// })( +// +// )} +// +// +// {getFieldDecorator('priority_id', { +// rules: [{ +// required: true, message: '请选择优先度' +// }], +// })( +// +// )} +// +// +// {getFieldDecorator('done_ratio', { +// rules: [{ +// required: true, message: '请选择完成度' +// }], +// })( +// +// )} +// +//
    +//
    +//
    +// +//
    +// ) +// } +// } +// const WrappedNewForm = Form.create({ name: 'NewOrderForm' })(order_form); +// export default WrappedNewForm; \ No newline at end of file From 4eb2c407c3561d5424537c12b95ae2d448e1a33b Mon Sep 17 00:00:00 2001 From: "sylor_huang@126.com" Date: Fri, 29 May 2020 18:23:39 +0800 Subject: [PATCH 4/9] =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/forge/Order/order.css | 5 +++-- src/forge/comments/comments.js | 16 ++++++++-------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/forge/Order/order.css b/src/forge/Order/order.css index 22720c9a..6898f2bd 100644 --- a/src/forge/Order/order.css +++ b/src/forge/Order/order.css @@ -576,8 +576,9 @@ a.issue-type-button.active:hover{background: #f4f4f4; color: #4CACFF;} } .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;} +.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;} diff --git a/src/forge/comments/comments.js b/src/forge/comments/comments.js index 1c1b062e..23f8485b 100644 --- a/src/forge/comments/comments.js +++ b/src/forge/comments/comments.js @@ -92,13 +92,13 @@ class comments extends Component { // // this.getjournalslist(page, limit); // // this.child.getChildrenJournals(orderId, reply_id); // } - if (is_reply){ - // this.child.getChildrenJournals(orderId, reply_id); - this.state.new_journal_id = result.data.id; - }else{ - this.state.new_journal_id = undefined - } - + // if (is_reply){ + // // this.child.getChildrenJournals(orderId, reply_id); + + // }else{ + // this.state.new_journal_id = undefined + // } + this.state.new_journal_id = result.data.id; this.getjournalslist(page, limit); } this.props.showNotification(result.data.message); @@ -520,7 +520,7 @@ class comments extends Component {
    )} {Paginations} -
    {new_comment()}
    +
    {new_comment()}
    ); From 7bd87013bc9df24a63368cba1578a888e30038b1 Mon Sep 17 00:00:00 2001 From: "sylor_huang@126.com" Date: Mon, 1 Jun 2020 18:28:42 +0800 Subject: [PATCH 5/9] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E7=9A=84=E6=96=B0=E5=BB=BA=E5=92=8C=E7=BC=96=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/forge/Newfile/UserSubmitComponent.js | 4 +- src/forge/Newfile/m_editor.js | 2 +- src/forge/Order/Detail.js | 366 +--------- src/forge/Order/New.js | 305 +------- src/forge/Order/UpdateDetail.js | 398 +--------- src/forge/Order/order.css | 496 ++++++++----- src/forge/Order/order.js | 4 +- src/forge/Order/order_form.js | 885 +++++++++++++++-------- 8 files changed, 909 insertions(+), 1551 deletions(-) diff --git a/src/forge/Newfile/UserSubmitComponent.js b/src/forge/Newfile/UserSubmitComponent.js index 6618fc15..12f2cb6a 100644 --- a/src/forge/Newfile/UserSubmitComponent.js +++ b/src/forge/Newfile/UserSubmitComponent.js @@ -121,7 +121,7 @@ class UserSubmitComponent extends Component { }; return (
    - +
    -
    +
    + +

    +
    +
    +
    +
    + + {getFieldDecorator("branch_name", { + rules: [], + initialValue: branch_name, + })( + + )} + + + {getFieldDecorator("status_id", { + rules: [ + { + required: true, + message: "请选择完成状态", + }, + ], + initialValue: status_id, + })( + + )} + + + {getFieldDecorator("tracker_id", { + rules: [ + { + required: true, + message: "请选择类型", + }, + ], + initialValue: tracker_id, + })( + + )} + -// return ( -//
    -// -//
    + + {getFieldDecorator("priority_id", { + rules: [ + { + required: true, + message: "请选择优先度", + }, + ], + initialValue: priority_id, + })( + + )} + + + {getFieldDecorator("done_ratio", { + rules: [ + { + required: true, + message: "请选择完成度", + }, + ], + initialValue: done_ratio, + })( + + )} + + + {getFieldDecorator("fixed_version_id", { + rules: [], + initialValue: fixed_version_id, + })( + + )} + + + {getFieldDecorator("issue_tag_ids", { + rules: [], + initialValue: issue_tag_ids, + })( + + )} + -//
    -//
    - -//
    -//
    -//
    -// -// -// - -//
    -// -// {getFieldDecorator('subject', { -// rules: [{ -// required: true, message: '请填写任务标题' -// }], -// })( -// -// )} -// -//
    -// -//
    -// -//

    -// -// 创建任务 -// -//

    -//
    -//
    -//
    -//
    -// -// {getFieldDecorator('branch_name', { -// rules: [], -// })( -// -// )} -// -// -// {getFieldDecorator('issue_tag_ids', { -// rules: [], -// })( -// -// )} -// -// -// {getFieldDecorator('fixed_version_id', { -// rules: [], - -// })( -// -// )} -// -// -// {getFieldDecorator('status_id', { -// rules: [{ -// required: true, message: '请选择完成状态' -// }], -// })( -// -// )} -// -// -// {getFieldDecorator('tracker_id', { -// rules: [{ -// required: true, message: '请选择分类' -// }], -// })( -// -// )} -// -// -// {getFieldDecorator('assigned_to_id', { -// rules: [{ -// }], -// })( -// -// )} -// -// -// {getFieldDecorator('priority_id', { -// rules: [{ -// required: true, message: '请选择优先度' -// }], -// })( -// -// )} -// -// -// {getFieldDecorator('done_ratio', { -// rules: [{ -// required: true, message: '请选择完成度' -// }], -// })( -// -// )} -// -//
    -//
    -//
    -// -//
    -// ) -// } -// } -// const WrappedNewForm = Form.create({ name: 'NewOrderForm' })(order_form); -// export default WrappedNewForm; \ No newline at end of file + + {getFieldDecorator("assigned_to_id", { + rules: [{}], + initialValue: assigned_to_id, + })( + + )} + + + + + + + + + + + {(show_token || (issue_type && issue_type === "2")) && ( + + {getFieldDecorator("token", { + rules: [ + { + required: true, + message: "请填写token值", + }, + ], + initialValue: token, + })()} + + )} +
    +
    + +
    + ); + } +} +const WrappedNewForm = Form.create({ name: "NewOrderForm" })(order_form); +export default WrappedNewForm; From 570aa9cfbba669736ff096a59f6d4a952564972c Mon Sep 17 00:00:00 2001 From: "sylor_huang@126.com" Date: Mon, 1 Jun 2020 18:37:35 +0800 Subject: [PATCH 6/9] =?UTF-8?q?=E4=BF=AE=E6=94=B9tag?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/forge/Order/OrderItem.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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} ) }) ) From 201516f29f035ad20b51658720131d358713cba6 Mon Sep 17 00:00:00 2001 From: "sylor_huang@126.com" Date: Tue, 2 Jun 2020 09:46:41 +0800 Subject: [PATCH 7/9] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=A4=8D=E5=88=B6?= =?UTF-8?q?=E7=9A=84=E5=B7=A5=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/forge/Order/CopyDetail.js | 749 +++++++++--------- src/forge/Order/order_form.js | 17 +- src/forge/comments/children_journals.js | 36 - src/forge/comments/comments.js | 14 +- src/forge/comments/new.js | 7 +- .../tpm/challengesnew/tpm-md-editor.js | 2 +- 6 files changed, 399 insertions(+), 426 deletions(-) diff --git a/src/forge/Order/CopyDetail.js b/src/forge/Order/CopyDetail.js index 0a7703c4..6c2332ba 100644 --- a/src/forge/Order/CopyDetail.js +++ b/src/forge/Order/CopyDetail.js @@ -1,376 +1,395 @@ -import React, { Component } from 'react'; -import { Link } from 'react-router-dom'; - -import axios from 'axios'; -import Nav from './Nav'; -import UploadComponent from '../Upload/Index'; -import { getImageUrl } from 'educoder'; -import { Modal, Form, Input, Select } from 'antd'; -import MDEditor from '../../modules/tpm/challengesnew/tpm-md-editor'; -import Attachments from '../Upload/attachment' - -const Option = Select.Option; - +import React, { Component } from "react"; +import OrderItem from './order_form' class CopyDetail 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, - } } - 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 - - }) - this.getjournalslist(); - } - }).catch((error) => { - console.log(error); - }) - } - - handleok = () => { - this.setState({ - isShow: false - }); - }; - handleCancel = () => { - this.setState({ - isShow: false - }); - } - - imgshow = () => { - this.setState({ - isShow: true - }); - }; - stringJson = (value) => { - let _value = null; - - try { - _value = JSON.parse(value); - } catch (e) { - _value = value; - } - return _value - } - - //删除任务 - deleteorder = (id) => { - const { projectsId, orderId } = this.props.match.params; - const url = `/projects/${projectsId}/issues/${orderId}.json`; - axios.delete(url, { - data: { - project_id: projectsId, - id: id - } - }).then((result) => { - if (result) { - this.props.history.push(`/projects/${projectsId}/orders`); - } - }).catch((error) => { - console.log(error); - }) - } - - 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 ( - - ) - }) - ) - } - } - - handleSubmit = () => { - 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`); - } - }).catch(error => { - console.log(error); - }) - } - }) - } - - 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 } = this.state; return ( -
    -
    -
    -
    -
    -
    -
    - - - -
    - - {getFieldDecorator('subject', { - rules: [{ - required: true, message: '请填写任务标题' - }], - initialValue: subject - })( - - )} - -
    -
    - - - { - get_attachments ? - - : - "" - } -

    - 保存 - 取消 -

    -
    -
    -
    -
    - - {getFieldDecorator('branch_name', { - initialValue: branch_name, - rules: [], - })( - - )} - - - {getFieldDecorator('issue_tag_ids', { - initialValue: issue_tag_ids ? [issue_tag_ids] : "", - rules: [], - })( - - )} - - - {getFieldDecorator('fixed_version_id', { - initialValue: fixed_version_id ? fixed_version_id : "", - rules: [], - })( - - )} - - - {getFieldDecorator('status_id', { - initialValue: status_id, - rules: [{ - required: true, message: '请选择完成状态' - }], - })( - - )} - - - {getFieldDecorator('tracker_id', { - initialValue: tracker_id, - rules: [{ - required: true, message: '请选择分类' - }], - })( - - )} - - - {getFieldDecorator('assigned_to_id', { - initialValue: assigned_to_id ? assigned_to_id : "" - })( - - )} - - - {getFieldDecorator('priority_id', { - - initialValue: priority_id, - rules: [{ - required: true, message: '请选择优先度' - }], - })( - - )} - - - {getFieldDecorator('done_ratio', { - initialValue: done_ratio, - rules: [{ - required: true, message: '请选择完成度' - }], - })( - - )} - -
    -
    -
    -
    -
    - - - -
    + ) } -} -const CopyDetailForm = Form.create({ name: 'CopyDetailForm' })(CopyDetail); -export default CopyDetailForm; \ No newline at end of file +} +export default CopyDetail; + + + +// import React, { Component } from 'react'; +// import { Link } from 'react-router-dom'; + +// import axios from 'axios'; +// import Nav from './Nav'; +// import UploadComponent from '../Upload/Index'; +// import { getImageUrl } from 'educoder'; +// import { Modal, Form, Input, Select } from 'antd'; +// import MDEditor from '../../modules/tpm/challengesnew/tpm-md-editor'; +// import Attachments from '../Upload/attachment' + +// const Option = Select.Option; + + +// class CopyDetail 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, +// } +// } + +// 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 + +// }) +// this.getjournalslist(); +// } +// }).catch((error) => { +// console.log(error); +// }) +// } + +// handleok = () => { +// this.setState({ +// isShow: false +// }); +// }; +// handleCancel = () => { +// this.setState({ +// isShow: false +// }); +// } + +// imgshow = () => { +// this.setState({ +// isShow: true +// }); +// }; +// stringJson = (value) => { +// let _value = null; + +// try { +// _value = JSON.parse(value); +// } catch (e) { +// _value = value; +// } +// return _value +// } + +// //删除任务 +// deleteorder = (id) => { +// const { projectsId, orderId } = this.props.match.params; +// const url = `/projects/${projectsId}/issues/${orderId}.json`; +// axios.delete(url, { +// data: { +// project_id: projectsId, +// id: id +// } +// }).then((result) => { +// if (result) { +// this.props.history.push(`/projects/${projectsId}/orders`); +// } +// }).catch((error) => { +// console.log(error); +// }) +// } + +// 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 ( +// +// ) +// }) +// ) +// } +// } + +// handleSubmit = () => { +// 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`); +// } +// }).catch(error => { +// console.log(error); +// }) +// } +// }) +// } + + +// 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 } = this.state; +// return ( +//
    +//
    +//
    +//
    +//
    +//
    +//
    +// +// +// +//
    +// +// {getFieldDecorator('subject', { +// rules: [{ +// required: true, message: '请填写任务标题' +// }], +// initialValue: subject +// })( +// +// )} +// +//
    +//
    +// +// +// { +// get_attachments ? +// +// : +// "" +// } +//

    +// 保存 +// 取消 +//

    +//
    +//
    +//
    +//
    +// +// {getFieldDecorator('branch_name', { +// initialValue: branch_name, +// rules: [], +// })( +// +// )} +// +// +// {getFieldDecorator('issue_tag_ids', { +// initialValue: issue_tag_ids ? [issue_tag_ids] : "", +// rules: [], +// })( +// +// )} +// +// +// {getFieldDecorator('fixed_version_id', { +// initialValue: fixed_version_id ? fixed_version_id : "", +// rules: [], +// })( +// +// )} +// +// +// {getFieldDecorator('status_id', { +// initialValue: status_id, +// rules: [{ +// required: true, message: '请选择完成状态' +// }], +// })( +// +// )} +// +// +// {getFieldDecorator('tracker_id', { +// initialValue: tracker_id, +// rules: [{ +// required: true, message: '请选择分类' +// }], +// })( +// +// )} +// +// +// {getFieldDecorator('assigned_to_id', { +// initialValue: assigned_to_id ? assigned_to_id : "" +// })( +// +// )} +// +// +// {getFieldDecorator('priority_id', { + +// initialValue: priority_id, +// rules: [{ +// required: true, message: '请选择优先度' +// }], +// })( +// +// )} +// +// +// {getFieldDecorator('done_ratio', { +// initialValue: done_ratio, +// rules: [{ +// required: true, message: '请选择完成度' +// }], +// })( +// +// )} +// +//
    +//
    +//
    +//
    +//
    +// +// +// +//
    +// ) +// } +// } + +// const CopyDetailForm = Form.create({ name: 'CopyDetailForm' })(CopyDetail); +// export default CopyDetailForm; \ No newline at end of file diff --git a/src/forge/Order/order_form.js b/src/forge/Order/order_form.js index 69721ab3..ae4816dd 100644 --- a/src/forge/Order/order_form.js +++ b/src/forge/Order/order_form.js @@ -43,7 +43,10 @@ class order_form extends Component { }; get_detail = () => { const { form_type } = this.props; - if (form_type === "edit") { + 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`; @@ -95,9 +98,6 @@ class order_form extends Component { this.state.isSpin = false; console.log(error); }); - } else { - this.InitData(); - this.getSelectList(); } }; @@ -322,6 +322,7 @@ class order_form extends Component { 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, @@ -350,7 +351,7 @@ class order_form extends Component {

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

    {getFieldDecorator("subject", { @@ -412,7 +413,11 @@ class order_form extends Component {
    Date: Tue, 2 Jun 2020 18:54:46 +0800 Subject: [PATCH 8/9] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E4=B8=BB=E9=A1=B5?= =?UTF-8?q?=E5=B7=A6=E4=BE=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.js | 9 +- src/AppConfig.js | 4 +- src/forge/Index.js | 86 ++-- src/forge/Main/Detail.js | 1 + src/forge/Order/CopyDetail.js | 379 ------------------ src/forge/UsersList/focus_button.js | 17 +- src/forge/comments/comments.js | 2 - src/forge/comments/new.js | 2 +- src/forge/users/Infos.js | 42 ++ src/forge/users/InfosUser.js | 293 ++++++++++++++ src/forge/users/new_user.css | 101 +++++ src/modules/tpm/NewHeader.js | 7 +- src/modules/tpm/TPMIndex.css | 2 +- .../tpm/challengesnew/tpm-md-editor.js | 12 +- 14 files changed, 520 insertions(+), 437 deletions(-) create mode 100644 src/forge/users/Infos.js create mode 100644 src/forge/users/InfosUser.js create mode 100644 src/forge/users/new_user.css diff --git a/src/App.js b/src/App.js index e958782c..beaa0a36 100644 --- a/src/App.js +++ b/src/App.js @@ -68,12 +68,15 @@ const http500 = Loadable({ loading: Loading, }) // 个人主页 +// const InfosIndex = Loadable({ +// loader: () => import('./modules/user/usersInfo/InfosIndex'), +// loading: Loading, +// }) const InfosIndex = Loadable({ - loader: () => import('./modules/user/usersInfo/InfosIndex'), + loader: () => import('./forge/users/Infos'), loading: Loading, }) - class App extends Component { constructor(props) { super(props) @@ -257,8 +260,6 @@ class App extends Component { return () } }> - - () diff --git a/src/AppConfig.js b/src/AppConfig.js index 42ac4c23..b74dd678 100644 --- a/src/AppConfig.js +++ b/src/AppConfig.js @@ -98,9 +98,9 @@ export function initAxiosInterceptors(props) { // TODO 避免重复的请求 https://github.com/axios/axios#cancellation // TODO 读取到package.json中的配置? - // var proxy = "http://localhost:3000" + var proxy = "http://localhost:3000" // proxy = "https://pre-newweb.educoder.net" - var proxy = "https://testforgeplus.trustie.net/" + // var proxy = "https://testforgeplus.trustie.net/" // 在这里使用requestMap控制,避免用户通过双击等操作发出重复的请求; // 如果需要支持重复的请求,考虑config里面自定义一个allowRepeat参考来控制 diff --git a/src/forge/Index.js b/src/forge/Index.js index 8d61a77a..9c4a90c5 100644 --- a/src/forge/Index.js +++ b/src/forge/Index.js @@ -1,62 +1,76 @@ -import React, { Component } from 'react'; +import React, { Component } from "react"; -import { Route, Switch } from 'react-router-dom'; -import { withRouter } from 'react-router' +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 { SnackbarHOC } from 'educoder'; -import { CNotificationHOC } from '../modules/courses/common/CNotificationHOC'; -import { TPMIndexHOC } from '../modules/tpm/TPMIndexHOC'; +import "./css/index.css"; -import './css/index.css'; - -import Loadable from 'react-loadable'; -import Loading from '../Loading'; -import { ImageLayerOfCommentHOC } from '../modules/page/layers/ImageLayerOfCommentHOC'; +import Loadable from "react-loadable"; +import Loading from "../Loading"; +import { ImageLayerOfCommentHOC } from "../modules/page/layers/ImageLayerOfCommentHOC"; const ProjectNew = Loadable({ - loader: () => import('./New/Index'), + loader: () => import("./New/Index"), loading: Loading, -}) +}); const ProjectIndex = Loadable({ - loader: () => import('./Main/Index'), + loader: () => import("./Main/Index"), loading: Loading, -}) +}); const ProjectDetail = Loadable({ - loader: () => import('./Main/Detail'), + loader: () => import("./Main/Detail"), loading: Loading, -}) +}); + class Index extends Component { - render() { return (
    - () - } + ( + + )} > - () - } + ( + + )} > - () - } + ( + + )} > - () - } + ( + + )} />
    - ) + ); } } -export default withRouter(ImageLayerOfCommentHOC({ imgSelector: '.imageLayerParent img, .imageLayerParent .imageTarget', parentSelector: '.newMain' })(CNotificationHOC()(SnackbarHOC()(TPMIndexHOC(Index))))); +export default withRouter( + ImageLayerOfCommentHOC({ + imgSelector: ".imageLayerParent img, .imageLayerParent .imageTarget", + parentSelector: ".newMain", + })(CNotificationHOC()(SnackbarHOC()(TPMIndexHOC(Index)))) +); diff --git a/src/forge/Main/Detail.js b/src/forge/Main/Detail.js index ae4caf05..5f1bce10 100644 --- a/src/forge/Main/Detail.js +++ b/src/forge/Main/Detail.js @@ -112,6 +112,7 @@ const TrendsIndex = Loadable({ loader: () => import('../Activity/Activity'), loading: Loading, }) + /** * permission:Manager:管理员,Reporter:报告人员(只有读取权限),Developer:开发人员(除不能设置仓库信息外) */ diff --git a/src/forge/Order/CopyDetail.js b/src/forge/Order/CopyDetail.js index 6c2332ba..3cfd0938 100644 --- a/src/forge/Order/CopyDetail.js +++ b/src/forge/Order/CopyDetail.js @@ -14,382 +14,3 @@ class CopyDetail extends Component { } export default CopyDetail; - - - -// import React, { Component } from 'react'; -// import { Link } from 'react-router-dom'; - -// import axios from 'axios'; -// import Nav from './Nav'; -// import UploadComponent from '../Upload/Index'; -// import { getImageUrl } from 'educoder'; -// import { Modal, Form, Input, Select } from 'antd'; -// import MDEditor from '../../modules/tpm/challengesnew/tpm-md-editor'; -// import Attachments from '../Upload/attachment' - -// const Option = Select.Option; - - -// class CopyDetail 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, -// } -// } - -// 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 - -// }) -// this.getjournalslist(); -// } -// }).catch((error) => { -// console.log(error); -// }) -// } - -// handleok = () => { -// this.setState({ -// isShow: false -// }); -// }; -// handleCancel = () => { -// this.setState({ -// isShow: false -// }); -// } - -// imgshow = () => { -// this.setState({ -// isShow: true -// }); -// }; -// stringJson = (value) => { -// let _value = null; - -// try { -// _value = JSON.parse(value); -// } catch (e) { -// _value = value; -// } -// return _value -// } - -// //删除任务 -// deleteorder = (id) => { -// const { projectsId, orderId } = this.props.match.params; -// const url = `/projects/${projectsId}/issues/${orderId}.json`; -// axios.delete(url, { -// data: { -// project_id: projectsId, -// id: id -// } -// }).then((result) => { -// if (result) { -// this.props.history.push(`/projects/${projectsId}/orders`); -// } -// }).catch((error) => { -// console.log(error); -// }) -// } - -// 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 ( -// -// ) -// }) -// ) -// } -// } - -// handleSubmit = () => { -// 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`); -// } -// }).catch(error => { -// console.log(error); -// }) -// } -// }) -// } - - -// 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 } = this.state; -// return ( -//
    -//
    -//
    -//
    -//
    -//
    -//
    -// -// -// -//
    -// -// {getFieldDecorator('subject', { -// rules: [{ -// required: true, message: '请填写任务标题' -// }], -// initialValue: subject -// })( -// -// )} -// -//
    -//
    -// -// -// { -// get_attachments ? -// -// : -// "" -// } -//

    -// 保存 -// 取消 -//

    -//
    -//
    -//
    -//
    -// -// {getFieldDecorator('branch_name', { -// initialValue: branch_name, -// rules: [], -// })( -// -// )} -// -// -// {getFieldDecorator('issue_tag_ids', { -// initialValue: issue_tag_ids ? [issue_tag_ids] : "", -// rules: [], -// })( -// -// )} -// -// -// {getFieldDecorator('fixed_version_id', { -// initialValue: fixed_version_id ? fixed_version_id : "", -// rules: [], -// })( -// -// )} -// -// -// {getFieldDecorator('status_id', { -// initialValue: status_id, -// rules: [{ -// required: true, message: '请选择完成状态' -// }], -// })( -// -// )} -// -// -// {getFieldDecorator('tracker_id', { -// initialValue: tracker_id, -// rules: [{ -// required: true, message: '请选择分类' -// }], -// })( -// -// )} -// -// -// {getFieldDecorator('assigned_to_id', { -// initialValue: assigned_to_id ? assigned_to_id : "" -// })( -// -// )} -// -// -// {getFieldDecorator('priority_id', { - -// initialValue: priority_id, -// rules: [{ -// required: true, message: '请选择优先度' -// }], -// })( -// -// )} -// -// -// {getFieldDecorator('done_ratio', { -// initialValue: done_ratio, -// rules: [{ -// required: true, message: '请选择完成度' -// }], -// })( -// -// )} -// -//
    -//
    -//
    -//
    -//
    -// -// -// -//
    -// ) -// } -// } - -// const CopyDetailForm = Form.create({ name: 'CopyDetailForm' })(CopyDetail); -// export default CopyDetailForm; \ No newline at end of file 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 ( - diff --git a/src/forge/comments/comments.js b/src/forge/comments/comments.js index 6f8866b0..8d14961c 100644 --- a/src/forge/comments/comments.js +++ b/src/forge/comments/comments.js @@ -322,8 +322,6 @@ class comments extends Component {
    import("./InfosUser"), + loading: Loading, +}); + +class Infos extends Component { + render() { + return ( +
    + + { + 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..59df0f68 --- /dev/null +++ b/src/forge/users/InfosUser.js @@ -0,0 +1,293 @@ +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 NoneData from "../Nodata"; +import { getImageUrl } from "educoder"; +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, + user: undefined, + }; + } + + componentDidMount = () => { + this.fetchUser(); + // this.setState({ + // isSpin:true + // }) + // let {category, status, page, sort_by, sort_direction} = this.state; + // this.getCourses(category, status, page, sort_by, sort_direction); + }; + + 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, + }); + }); + }; + + getCourses = (category, status, page, sort_by, sort_direction) => { + let url = `/users/${this.props.match.params.username}/projects.json`; + axios + .get(url, { + params: { + category, + status, + page, + sort_by, + sort_direction, + per_page: this.props.is_current && category && page == 1 ? 17 : 16, + }, + }) + .then((result) => { + if (result) { + if ( + result.data.status === 403 || + result.data.status === 401 || + result.data.status === 500 || + result.data.status === 404 + ) { + this.setState({ + isSpin: false, + totalCount: 0, + }); + } else { + this.setState({ + totalCount: result.data.count, + data: result.data, + sort_by: sort_by, + sort_direction: sort_direction, + isSpin: false, + }); + } + } + }) + .catch((error) => { + console.log(error); + this.setState({ + isSpin: false, + }); + }); + }; + + //切换种类 + 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() { + // let{ + // category, + // status, + // page, + // data, + // totalCount, + // isSpin, + // sort_by, + // sort_direction + // } = this.state; + // let isStudent = this.props.isStudent(); + // let is_current=this.props.is_current; + const { current_user, mygetHelmetapi } = this.props; + const { user } = this.state; + + console.log(this.props); + + 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} + +

    +
    +
    + )} +
    +
      + +
    • +

      + 托管项目 + 3773 +

      +
    • +
    • +

      + 镜像项目 + 3 +

      +
    • +
    +
    +
    +
    +

    + + + 组织 + + + {user && user.undo_events} + +

    +
    +
    +
    +
    + ); + } +} +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/challengesnew/tpm-md-editor.js b/src/modules/tpm/challengesnew/tpm-md-editor.js index 2a4d5e56..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, From 0bfcd40fb3469e6f7b2a2f272d7a811bd5819da0 Mon Sep 17 00:00:00 2001 From: "sylor_huang@126.com" Date: Wed, 3 Jun 2020 09:40:16 +0800 Subject: [PATCH 9/9] users --- src/forge/users/Infos.js | 167 +++++++++++++++++++++++++++-- src/forge/users/InfosUser.js | 200 ++--------------------------------- 2 files changed, 164 insertions(+), 203 deletions(-) diff --git a/src/forge/users/Infos.js b/src/forge/users/Infos.js index db23f07d..00070b84 100644 --- a/src/forge/users/Infos.js +++ b/src/forge/users/Infos.js @@ -1,12 +1,17 @@ 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"; @@ -19,17 +24,161 @@ const InfosIndex = Loadable({ }); 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 (
      - - { - 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} + +

      +
      +
      + )} +
      +
        + +
      • +

        + 托管项目 + 3773 +

        +
      • +
      • +

        + 镜像项目 + 3 +

        +
      • +
      +
      +
      +
      +

      + + + 组织 + + + {user && user.undo_events} + +

      +
      +
      +
      +
      + + { + return ; + }} + > + +
      +
      ); } diff --git a/src/forge/users/InfosUser.js b/src/forge/users/InfosUser.js index 59df0f68..967ca151 100644 --- a/src/forge/users/InfosUser.js +++ b/src/forge/users/InfosUser.js @@ -5,9 +5,10 @@ import { Avatar, Tag, Button, Pagination, Spin, Dropdown, Menu } from "antd"; import FocusButton from "../UsersList/focus_button"; import axios from "axios"; -import NoneData from "../Nodata"; import { getImageUrl } from "educoder"; -import "./new_user.css"; +import NoneData from "../Nodata"; + +// import "./new_user.css"; import "../css/index.css"; class InfosUser extends Component { @@ -23,79 +24,14 @@ class InfosUser extends Component { totalCount: undefined, data: undefined, isSpin: false, - user: undefined, + }; } componentDidMount = () => { - this.fetchUser(); - // this.setState({ - // isSpin:true - // }) - // let {category, status, page, sort_by, sort_direction} = this.state; - // this.getCourses(category, status, page, sort_by, sort_direction); }; - 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, - }); - }); - }; - getCourses = (category, status, page, sort_by, sort_direction) => { - let url = `/users/${this.props.match.params.username}/projects.json`; - axios - .get(url, { - params: { - category, - status, - page, - sort_by, - sort_direction, - per_page: this.props.is_current && category && page == 1 ? 17 : 16, - }, - }) - .then((result) => { - if (result) { - if ( - result.data.status === 403 || - result.data.status === 401 || - result.data.status === 500 || - result.data.status === 404 - ) { - this.setState({ - isSpin: false, - totalCount: 0, - }); - } else { - this.setState({ - totalCount: result.data.count, - data: result.data, - sort_by: sort_by, - sort_direction: sort_direction, - isSpin: false, - }); - } - } - }) - .catch((error) => { - console.log(error); - this.setState({ - isSpin: false, - }); - }); - }; //切换种类 changeCategory = (cate) => { @@ -158,134 +94,10 @@ class InfosUser extends Component { } render() { - // let{ - // category, - // status, - // page, - // data, - // totalCount, - // isSpin, - // sort_by, - // sort_direction - // } = this.state; - // let isStudent = this.props.isStudent(); - // let is_current=this.props.is_current; - const { current_user, mygetHelmetapi } = this.props; - const { user } = this.state; - - console.log(this.props); 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} - -

      -
      -
      - )} -
      -
        - -
      • -

        - 托管项目 - 3773 -

        -
      • -
      • -

        - 镜像项目 - 3 -

        -
      • -
      -
      -
      -
      -

      - - - 组织 - - - {user && user.undo_events} - -

      -
      -
      -
      +
      + ddddd
      ); }