forked from Gitlink/forgeplus-react
Merge branch 'newVersion_forge' of http://gitea.trustie.net/jasder/forgeplus-react into newVersion_forge
This commit is contained in:
commit
080b1f0e39
|
@ -2696,6 +2696,12 @@ a.edu-txt-w80,
|
|||
.minH-560 {
|
||||
min-height: 560px;
|
||||
}
|
||||
.minH-650{
|
||||
min-height: 650px;
|
||||
}
|
||||
.minH-670{
|
||||
min-height: 670px;
|
||||
}
|
||||
|
||||
/*超出高度出现滚动条--纵向*/
|
||||
|
||||
|
|
|
@ -376,7 +376,7 @@ class CoderRootDirectory extends Component {
|
|||
<React.Fragment>
|
||||
{lastCommitAuthor.login ? (
|
||||
<Link
|
||||
to={`/users/${lastCommitAuthor.login}`}
|
||||
to={`/users/${lastCommitAuthor.login}/projects`}
|
||||
className="show-user-link"
|
||||
>
|
||||
<img
|
||||
|
|
|
@ -114,7 +114,6 @@ class UserSubmitComponent extends Component {
|
|||
|
||||
const { current_user, filepath, projectDetail } = this.props;
|
||||
const { editor_type } = this.props;
|
||||
console.log("88888", filepath)
|
||||
|
||||
const changeSubmitBranch = () => {
|
||||
if (submitType === "1") {
|
||||
|
@ -216,10 +215,10 @@ class UserSubmitComponent extends Component {
|
|||
</Form>
|
||||
</div>
|
||||
</div>
|
||||
<div className="mt20 text-center">
|
||||
<div className="mt20">
|
||||
<Button
|
||||
type="primary"
|
||||
onClick={editor_type === "edit" ? this.UpdateFile : this.subMitFrom}
|
||||
onClick={editor_type === "update" ? this.UpdateFile : this.subMitFrom}
|
||||
className="mr30"
|
||||
>
|
||||
提交变更
|
||||
|
|
|
@ -204,100 +204,103 @@ class Detail extends Component {
|
|||
|
||||
return (
|
||||
<div className="ProjectListIndex">
|
||||
<div className="list-right">
|
||||
<div className="grid-item pd20 border-1f">
|
||||
<Link
|
||||
to={`/users/${data && data.author_login}`}
|
||||
className="show-user-link"
|
||||
>
|
||||
<img
|
||||
className="user_img"
|
||||
src={getImageUrl(`images/${data && data.author_picture}`)}
|
||||
alt=""
|
||||
width="50"
|
||||
height="50"
|
||||
/>
|
||||
</Link>
|
||||
<div className="ml10">
|
||||
<div className="ver-middle">
|
||||
<span className="mr10 ver-middle">
|
||||
<span className="font-16">
|
||||
【
|
||||
{data && data.issue_classify === "issue"
|
||||
? data.tracker
|
||||
<div className="item-list-right">
|
||||
<div className="background-f boder-4">
|
||||
<div className="grid-item border-1f pd20 ">
|
||||
<Link
|
||||
to={`/users/${data && data.author_login}`}
|
||||
className="show-user-link"
|
||||
>
|
||||
<img
|
||||
className="user_img"
|
||||
src={getImageUrl(`images/${data && data.author_picture}`)}
|
||||
alt=""
|
||||
width="50"
|
||||
height="50"
|
||||
/>
|
||||
</Link>
|
||||
<div className="ml10">
|
||||
<div className="ver-middle">
|
||||
<span className="mr10 ver-middle">
|
||||
<span className="font-16">
|
||||
【
|
||||
{data && data.issue_classify === "issue"
|
||||
? data.tracker
|
||||
: "缺陷"
|
||||
: "合并请求"}
|
||||
】
|
||||
? data.tracker
|
||||
: "缺陷"
|
||||
: "合并请求"}
|
||||
】
|
||||
</span>
|
||||
<span className="font-16 fwb">{data && data.subject}</span>
|
||||
</span>
|
||||
<span className="font-16 fwb">{data && data.subject}</span>
|
||||
</span>
|
||||
|
||||
{data && data.priority && (
|
||||
<Tag color={get_color(data.priority)}>{data.priority}</Tag>
|
||||
)}
|
||||
</div>
|
||||
<div className="mt10">
|
||||
<span className="color-grey-9 mr5">由</span>
|
||||
<Link
|
||||
to={`/users/${data && data.author_login}`}
|
||||
className="show-user-link color-blue"
|
||||
>
|
||||
{data && data.author_name}
|
||||
</Link>
|
||||
<span className="color-grey-9 ml5">
|
||||
添加于 {data && data.created_at}
|
||||
</span>
|
||||
{data && data.user_permission ? (
|
||||
<span className="pull-right">
|
||||
<a className="color-blue fr" onClick={this.copydetail}>
|
||||
复制
|
||||
</a>
|
||||
<Popconfirm
|
||||
placement="bottom"
|
||||
title={"您确定要删除吗"}
|
||||
okText="是"
|
||||
cancelText="否"
|
||||
onConfirm={() => this.deletedetail(orderId)}
|
||||
>
|
||||
<a
|
||||
className="color-blue fr"
|
||||
style={{ marginLeft: 20, marginRight: 20 }}
|
||||
>
|
||||
删除
|
||||
{data && data.priority && (
|
||||
<Tag color={get_color(data.priority)}>{data.priority}</Tag>
|
||||
)}
|
||||
</div>
|
||||
<div className="mt10">
|
||||
<span className="color-grey-9 mr5">由</span>
|
||||
<Link
|
||||
to={`/users/${data && data.author_login}`}
|
||||
className="show-user-link color-blue"
|
||||
>
|
||||
{data && data.author_name}
|
||||
</Link>
|
||||
<span className="color-grey-9 ml5">
|
||||
添加于 {data && data.created_at}
|
||||
</span>
|
||||
{data && data.user_permission ? (
|
||||
<span className="pull-right">
|
||||
<a className="color-blue fr" onClick={this.copydetail}>
|
||||
复制
|
||||
</a>
|
||||
</Popconfirm>
|
||||
<Popconfirm
|
||||
placement="bottom"
|
||||
title={"您确定要删除吗"}
|
||||
okText="是"
|
||||
cancelText="否"
|
||||
onConfirm={() => this.deletedetail(orderId)}
|
||||
>
|
||||
<a
|
||||
className="color-blue fr"
|
||||
style={{ marginLeft: 20, marginRight: 20 }}
|
||||
>
|
||||
删除
|
||||
</a>
|
||||
</Popconfirm>
|
||||
|
||||
<Link
|
||||
to={`/projects/${projectsId}/orders/${orderId}/updatedetail`}
|
||||
className="color-blue fr"
|
||||
>
|
||||
编辑
|
||||
</Link>
|
||||
</span>
|
||||
) : (
|
||||
""
|
||||
)}
|
||||
<Link
|
||||
to={`/projects/${projectsId}/orders/${orderId}/updatedetail`}
|
||||
className="color-blue fr"
|
||||
>
|
||||
编辑
|
||||
</Link>
|
||||
</span>
|
||||
) : (
|
||||
""
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="pd20">
|
||||
<div className="detail_p">
|
||||
{data && data.description && data.description.length > 0 ? (
|
||||
this.commentCtx(data.description)
|
||||
<div className="pd20">
|
||||
<div className="detail_p">
|
||||
{data && data.description && data.description.length > 0 ? (
|
||||
this.commentCtx(data.description)
|
||||
) : (
|
||||
<span className="color-grey-9 ml3 mr3">没有描述</span>
|
||||
)}
|
||||
</div>
|
||||
{data && data.attachments && data.attachments.length > 0 ? (
|
||||
<Attachments
|
||||
attachments={data.attachments}
|
||||
showNotification={this.props.showNotification}
|
||||
/>
|
||||
) : (
|
||||
<span className="color-grey-9 ml3 mr3">没有描述</span>
|
||||
""
|
||||
)}
|
||||
</div>
|
||||
{data && data.attachments && data.attachments.length > 0 ? (
|
||||
<Attachments
|
||||
attachments={data.attachments}
|
||||
showNotification={this.props.showNotification}
|
||||
/>
|
||||
) : (
|
||||
""
|
||||
)}
|
||||
</div>
|
||||
|
||||
<Comments
|
||||
order_id={orderId}
|
||||
showNotification={this.props.showNotification}
|
||||
|
@ -305,7 +308,7 @@ class Detail extends Component {
|
|||
/>
|
||||
</div>
|
||||
<div className="list-left list-left-padding">
|
||||
<div className="list-right-item-padding background-f">
|
||||
<div className="list-right-item-padding background-f boder-4">
|
||||
<p className="grid-item-left pb15">
|
||||
<span className="issue_detail_info">分支:</span>
|
||||
<span>{data && data.branch_name ? data.branch_name : "--"}</span>
|
||||
|
|
|
@ -568,7 +568,7 @@ a.issue-type-button.active:hover {
|
|||
}
|
||||
.item-list-right {
|
||||
width: 74%;
|
||||
padding: 0px 15px 10px 0;
|
||||
/* padding: 10px; */
|
||||
}
|
||||
.detail_edit_action {
|
||||
padding: 10px;
|
||||
|
@ -608,6 +608,12 @@ a.issue-type-button.active:hover {
|
|||
align-items: center;
|
||||
grid-template-columns: 1fr max-content;
|
||||
}
|
||||
.grid-item-top {
|
||||
display: grid;
|
||||
align-items: center;
|
||||
grid-template-columns: max-content 1fr;
|
||||
align-items: flex-start;
|
||||
}
|
||||
.fwb {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
@ -655,15 +661,27 @@ a.issue-type-button.active:hover {
|
|||
padding: 0 0 0 20px !important;
|
||||
}
|
||||
.comment-background {
|
||||
background: rgba(250, 250, 250, 1);
|
||||
/* padding: 15px; */
|
||||
border: 1px solid #f4f4f4;
|
||||
background: #fff;
|
||||
border-radius: 4px;
|
||||
padding: 0 15px 15px;
|
||||
/* border: 1px solid #f4f4f4; */
|
||||
}
|
||||
.border-bottom-comment {
|
||||
border-bottom: 1px solid #eee;
|
||||
}
|
||||
.comment-background .ant-list-header {
|
||||
padding: 20px;
|
||||
|
||||
.custom-comment-tabs .ant-tabs-top-bar{
|
||||
border-bottom: none;
|
||||
padding: 15px 0;
|
||||
}
|
||||
.custom-comment-tabs .search-count-button{
|
||||
line-height: 18px;
|
||||
margin-left: 8px;
|
||||
background-color: rgba(235,244,254,1);
|
||||
color: #1890ff;
|
||||
font-size: 12px;
|
||||
padding: 2px 8px;
|
||||
border-radius: 9px;
|
||||
}
|
||||
.comment-background .ant-list-item {
|
||||
padding: 16px;
|
||||
|
@ -684,8 +702,7 @@ a.issue-type-button.active:hover {
|
|||
box-shadow: none;
|
||||
}
|
||||
.children-comment-bg {
|
||||
background: rgba(241, 248, 255, 1);
|
||||
border: 1px solid rgba(238, 238, 238, 1);
|
||||
background:rgba(250,250,250,1);
|
||||
}
|
||||
|
||||
.display-in{
|
||||
|
@ -706,4 +723,6 @@ a.issue-type-button.active:hover {
|
|||
border-radius: 4px;
|
||||
margin-right: 5px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
}
|
||||
.boder-4{border-radius: 4px;}
|
||||
.pbt20{padding: 20px 0;}
|
|
@ -399,12 +399,11 @@ class order_form extends Component {
|
|||
size={100}
|
||||
showNotification={this.props.showNotification}
|
||||
/>
|
||||
<p className="clearfix mt20 text-right">
|
||||
<p className="clearfix mt20">
|
||||
<Button
|
||||
type="primary"
|
||||
loading={isSpin}
|
||||
onClick={this.handleSubmit}
|
||||
size="large"
|
||||
>
|
||||
<span className="plr10">
|
||||
{form_type === "new" ? "创建" : "提交"}
|
||||
|
@ -418,7 +417,6 @@ class order_form extends Component {
|
|||
? `/projects/${projectsId || orderId}/orders` : `/projects/${projectsId}/orders/${orderId}/detail`
|
||||
|
||||
}
|
||||
size="large"
|
||||
>
|
||||
<span className="plr10">取消</span>
|
||||
</Button>
|
||||
|
@ -494,21 +492,7 @@ class order_form extends Component {
|
|||
</Select>
|
||||
)}
|
||||
</Form.Item>
|
||||
<Form.Item label="完成度">
|
||||
{getFieldDecorator("done_ratio", {
|
||||
rules: [
|
||||
{
|
||||
required: true,
|
||||
message: "请选择完成度",
|
||||
},
|
||||
],
|
||||
initialValue: done_ratio,
|
||||
})(
|
||||
<Select onChange={this.changeRatio}>
|
||||
{this.renderSelect(issue_chosen && issue_chosen.done_ratio)}
|
||||
</Select>
|
||||
)}
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item label="里程碑">
|
||||
{getFieldDecorator("fixed_version_id", {
|
||||
rules: [],
|
||||
|
@ -571,6 +555,16 @@ class order_form extends Component {
|
|||
onChange={this.changeEndTime}
|
||||
/>
|
||||
</Form.Item>
|
||||
<Form.Item label="完成度">
|
||||
{getFieldDecorator("done_ratio", {
|
||||
rules: [],
|
||||
initialValue: done_ratio,
|
||||
})(
|
||||
<Select onChange={this.changeRatio}>
|
||||
{this.renderSelect(issue_chosen && issue_chosen.done_ratio)}
|
||||
</Select>
|
||||
)}
|
||||
</Form.Item>
|
||||
{/* <Form.Item label="是否上链">
|
||||
<Switch
|
||||
checkedChildren="是"
|
||||
|
|
|
@ -47,7 +47,7 @@ class Attachment extends Component{
|
|||
<div>
|
||||
{
|
||||
attachments ?
|
||||
<div className="attachmentsList mt20">
|
||||
<div className="attachmentsList mt5">
|
||||
{
|
||||
attachments.map((item,key)=>{
|
||||
return(
|
||||
|
|
|
@ -85,7 +85,7 @@ class CommonUsers extends Component {
|
|||
);
|
||||
return (
|
||||
<div className="background-g pbt15">
|
||||
<div className="main background-f">
|
||||
<div className="main background-f minH-670">
|
||||
<div className="plr-20 user-list-items">
|
||||
<div className="font-18 pb-10 border-b-line">{type_title}</div>
|
||||
<Spin spinning={isSpin}>
|
||||
|
@ -93,7 +93,7 @@ class CommonUsers extends Component {
|
|||
{count === 0 ? (
|
||||
<NoneData _html="暂时还没有相关数据哦!" />
|
||||
) : (
|
||||
<UserList users={users} userClass={'w-25'}></UserList>
|
||||
<UserList users={users} userClass={'w-25'} {...this.props}></UserList>
|
||||
)}
|
||||
</div>
|
||||
</Spin>
|
||||
|
|
|
@ -121,7 +121,7 @@ class ForkUsers extends Component {
|
|||
};
|
||||
return (
|
||||
<div className="background-g pbt15">
|
||||
<div className="main background-f">
|
||||
<div className="main background-f minH-670">
|
||||
<div className="plr-20 user-list-items">
|
||||
<div className="font-18 pb-10 border-b-line">Fork列表</div>
|
||||
<Spin spinning={isSpin}>
|
||||
|
|
|
@ -21,8 +21,8 @@ class PraiseUsers extends Component {
|
|||
render() {
|
||||
const { projectId } = this.state;
|
||||
return (
|
||||
<div>
|
||||
{projectId && <CommonUsers user_type="praise_users" type_title="点赞列表" project_id={projectId} />}
|
||||
<div >
|
||||
{projectId && <CommonUsers user_type="praise_users" type_title="点赞列表" project_id={projectId} current_user={this.props.current_user} />}
|
||||
</div>
|
||||
|
||||
);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import React, { Component } from "react";
|
||||
import { Link } from "react-router-dom";
|
||||
import { getImageUrl } from "educoder";
|
||||
import FocusButton from "./focus_button";
|
||||
import { Button } from "antd";
|
||||
import "./list.css";
|
||||
class UserList extends Component {
|
||||
constructor(props) {
|
||||
|
@ -9,7 +9,7 @@ class UserList extends Component {
|
|||
}
|
||||
|
||||
render() {
|
||||
const { users, userClass } = this.props;
|
||||
const { users, userClass, current_user } = this.props;
|
||||
const renderList = () => {
|
||||
if (users && users.length > 0) {
|
||||
return users.map((item, key) => {
|
||||
|
@ -41,7 +41,12 @@ class UserList extends Component {
|
|||
<i className="iconfont icon-shijian user-join-time"></i>
|
||||
<span className="ml4">加入时间:{item.format_time}</span>
|
||||
</div>
|
||||
<FocusButton is_watch={item.is_watch} id={item.login} />
|
||||
{
|
||||
current_user && current_user.login === item.login ?
|
||||
<Button type="default">当前用户</Button>
|
||||
:
|
||||
<FocusButton is_watch={item.is_watch} id={item.login} />
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -20,9 +20,10 @@ class WatchUsers extends Component {
|
|||
|
||||
render() {
|
||||
const { projectId } = this.state;
|
||||
console.log("watcher_users", this.props.current_user)
|
||||
return (
|
||||
<div>
|
||||
{projectId && <CommonUsers user_type="watch_users" type_title="关注列表" project_id={projectId} />}
|
||||
{projectId && <CommonUsers user_type="watch_users" type_title="关注列表" project_id={projectId} current_user={this.props.current_user} />}
|
||||
</div>
|
||||
|
||||
);
|
||||
|
|
|
@ -121,7 +121,7 @@ class children_comments extends Component {
|
|||
const renderList = (item) => {
|
||||
return (
|
||||
<div className="width100">
|
||||
<div className="grid-item pb10">
|
||||
<div className="grid-item pb5">
|
||||
<Link
|
||||
to={`/users/${item && item.user_login}`}
|
||||
className="show-user-link"
|
||||
|
@ -134,39 +134,14 @@ class children_comments extends Component {
|
|||
height="30"
|
||||
/>
|
||||
</Link>
|
||||
<span className="grid-item">
|
||||
<span>
|
||||
<Link
|
||||
to={`/users/${item && item.user_login}`}
|
||||
className="show-user-link color-blue ml10"
|
||||
>
|
||||
{item && item.user_name}
|
||||
</Link>
|
||||
<span className="color-grey-8 ml20">{item.created_at}</span>
|
||||
</span>
|
||||
|
||||
<span className="text-right">
|
||||
{current_user &&
|
||||
(current_user.admin ||
|
||||
current_user.login === item.user_login) ? (
|
||||
<Popconfirm
|
||||
placement="bottom"
|
||||
title={"确定要删除当前评论吗?"}
|
||||
okText="是"
|
||||
cancelText="否"
|
||||
onConfirm={() => this.deleteorder(item.id)}
|
||||
>
|
||||
<Button type="link">
|
||||
<i className="iconfont icon-shanchu font-15 color-grey-6"></i>
|
||||
</Button>
|
||||
</Popconfirm>
|
||||
) : (
|
||||
""
|
||||
)}
|
||||
</span>
|
||||
</span>
|
||||
<Link
|
||||
to={`/users/${item && item.user_login}`}
|
||||
className="show-user-link color-black ml10 fwb"
|
||||
>
|
||||
{item && item.user_name}
|
||||
</Link>
|
||||
</div>
|
||||
<div className="ml30">
|
||||
<div className="ml40">
|
||||
{this.commentCtx(item.content)}
|
||||
{item && item.attachments && item.attachments.length > 0 ? (
|
||||
<Attachments
|
||||
|
@ -180,6 +155,29 @@ class children_comments extends Component {
|
|||
) : (
|
||||
""
|
||||
)}
|
||||
<div className="mt5">
|
||||
<span className="color-grey-8">{item.created_at}</span>
|
||||
<span className="ml20">
|
||||
{current_user &&
|
||||
(current_user.admin ||
|
||||
current_user.login === item.user_login) ? (
|
||||
<Popconfirm
|
||||
placement="bottom"
|
||||
title={"确定要删除当前评论吗?"}
|
||||
okText="是"
|
||||
cancelText="否"
|
||||
onConfirm={() => this.deleteorder(item.id)}
|
||||
>
|
||||
<Button type="link">
|
||||
<i className="iconfont icon-shanchu3 font-15 color-grey-6 mr5 ver-middle"></i>
|
||||
<span className="font-12 color-grey-6">删除</span>
|
||||
</Button>
|
||||
</Popconfirm>
|
||||
) : (
|
||||
""
|
||||
)}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
@ -188,7 +186,7 @@ class children_comments extends Component {
|
|||
return (
|
||||
<div>
|
||||
{search_count > 0 && (
|
||||
<div className="children-comment-bg">
|
||||
<div className="children-comment-bg mt10">
|
||||
<List
|
||||
size="large"
|
||||
loading={isSpin}
|
||||
|
|
|
@ -5,13 +5,13 @@ import axios from "axios";
|
|||
import Upload from "../Upload/Index";
|
||||
import UploadImg from "../Images/upload.png";
|
||||
import { getImageUrl } from "educoder";
|
||||
import { List, Popconfirm, Pagination, Button } from "antd";
|
||||
import { List, Popconfirm, Pagination, Button, Tabs, Avatar } from "antd";
|
||||
import Attachments from "../Upload/attachment";
|
||||
import MDEditor from "../../modules/tpm/challengesnew/tpm-md-editor";
|
||||
import RenderHtml from "../../components/render-html";
|
||||
import ChildrenComments from "./children_comments";
|
||||
import "../Order/order.css";
|
||||
|
||||
const { TabPane } = Tabs;
|
||||
class comments extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
|
@ -303,99 +303,71 @@ class comments extends Component {
|
|||
</React.Fragment>
|
||||
);
|
||||
|
||||
// const comment_meditor = (
|
||||
|
||||
// )
|
||||
|
||||
const new_comment = (is_reply, item_id) => {
|
||||
return (
|
||||
<div>
|
||||
{(current_user && current_user.login) ? (
|
||||
<div>
|
||||
<div className="grid-item pb10">
|
||||
<Link
|
||||
to={`/users/${current_user && current_user.login}`}
|
||||
className="show-user-link"
|
||||
>
|
||||
<img
|
||||
className="radius"
|
||||
src={getImageUrl(
|
||||
`images/${current_user && current_user.image_url}`
|
||||
)}
|
||||
alt=""
|
||||
width="30"
|
||||
height="30"
|
||||
/>
|
||||
</Link>
|
||||
<Link
|
||||
to={`/users/${current_user && current_user.login}`}
|
||||
className="show-user-link color-blue ml10"
|
||||
>
|
||||
{current_user && current_user.real_name}
|
||||
</Link>
|
||||
</div>
|
||||
<MDEditor
|
||||
placeholder={"添加评论..."}
|
||||
height={200}
|
||||
mdID={
|
||||
item_id
|
||||
? "orderdetail-add-descriptions" + item_id
|
||||
: "orderdetail-add-descriptions"
|
||||
}
|
||||
initValue={is_reply ? reply_content : content}
|
||||
onChange={
|
||||
is_reply ? this.replyContentChange : this.onContentChange
|
||||
}
|
||||
></MDEditor>
|
||||
<p className="quillFlag">
|
||||
{quillFlag && <span className="">请输入评论内容</span>}
|
||||
</p>
|
||||
<Upload
|
||||
className="commentStyle"
|
||||
isComplete={attachment_clean}
|
||||
load={this.UploadFunc}
|
||||
icon={
|
||||
<img
|
||||
src={UploadImg}
|
||||
width="58"
|
||||
alt=""
|
||||
style={{ marginBottom: 15 }}
|
||||
/>
|
||||
}
|
||||
size={100}
|
||||
showNotification={this.props.showNotification}
|
||||
/>
|
||||
<p className="clearfix mt20 text-right">
|
||||
{is_reply && (
|
||||
<Button
|
||||
onClick={this.cancel_reply}
|
||||
size="large"
|
||||
className="mr15"
|
||||
>
|
||||
取消
|
||||
</Button>
|
||||
)}
|
||||
<Button
|
||||
type="primary"
|
||||
onClick={this.addjournals}
|
||||
loading={journal_spin}
|
||||
size="large"
|
||||
>
|
||||
评论
|
||||
</Button>
|
||||
</p>
|
||||
</div>
|
||||
) : (
|
||||
<div className="mt15">
|
||||
<span className="reply-comment-input">
|
||||
<Button
|
||||
className="add_reply_button"
|
||||
onClick={() => this.add_reply("")}
|
||||
>
|
||||
<span>我要回复</span>
|
||||
</Button>
|
||||
</span>
|
||||
{/* <a className="" onClick={() => this.loginModal()}>
|
||||
登录
|
||||
</a>并参与到对话中 */}
|
||||
</div>
|
||||
)}
|
||||
<div className="grid-item-top pb10">
|
||||
<Link
|
||||
to={`/users/${current_user && current_user.login}`}
|
||||
className="show-user-link mr10"
|
||||
>
|
||||
<img
|
||||
className="radius"
|
||||
src={getImageUrl(
|
||||
`images/${current_user && current_user.image_url}`
|
||||
)}
|
||||
alt=""
|
||||
width="30"
|
||||
height="30"
|
||||
/>
|
||||
</Link>
|
||||
<div>
|
||||
<MDEditor
|
||||
placeholder={"添加评论..."}
|
||||
height={200}
|
||||
mdID={
|
||||
item_id
|
||||
? "orderdetail-add-descriptions" + item_id
|
||||
: "orderdetail-add-descriptions"
|
||||
}
|
||||
initValue={is_reply ? reply_content : content}
|
||||
onChange={
|
||||
is_reply ? this.replyContentChange : this.onContentChange
|
||||
}
|
||||
></MDEditor>
|
||||
<p className="quillFlag">
|
||||
{quillFlag && <span className="">请输入评论内容</span>}
|
||||
</p>
|
||||
<Upload
|
||||
className="commentStyle"
|
||||
isComplete={attachment_clean}
|
||||
load={this.UploadFunc}
|
||||
icon={
|
||||
<img
|
||||
src={UploadImg}
|
||||
width="58"
|
||||
alt=""
|
||||
style={{ marginBottom: 15 }}
|
||||
/>
|
||||
}
|
||||
size={100}
|
||||
showNotification={this.props.showNotification}
|
||||
/>
|
||||
<p className="clearfix mt20">
|
||||
<Button
|
||||
type="primary"
|
||||
onClick={this.addjournals}
|
||||
loading={journal_spin}
|
||||
className="mr15"
|
||||
>
|
||||
评论
|
||||
</Button>
|
||||
<Button onClick={this.cancel_reply}>取消</Button>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
@ -403,7 +375,7 @@ class comments extends Component {
|
|||
const renderList = (item) => {
|
||||
return (
|
||||
<div className="width100">
|
||||
<div className="grid-item pb10">
|
||||
<div className="pb5">
|
||||
<Link
|
||||
to={`/users/${item && item.user_login}`}
|
||||
className="show-user-link"
|
||||
|
@ -416,39 +388,14 @@ class comments extends Component {
|
|||
height="30"
|
||||
/>
|
||||
</Link>
|
||||
<span className="grid-item">
|
||||
<span>
|
||||
<Link
|
||||
to={`/users/${item && item.user_login}`}
|
||||
className="show-user-link color-blue ml10"
|
||||
>
|
||||
{item && item.user_name}
|
||||
</Link>
|
||||
<span className="color-grey-8 ml20">{item.created_at}</span>
|
||||
</span>
|
||||
|
||||
<span className="text-right">
|
||||
{current_user &&
|
||||
(current_user.admin ||
|
||||
current_user.login === item.user_login) ? (
|
||||
<Popconfirm
|
||||
placement="bottom"
|
||||
title={"确定要删除当前评论吗?"}
|
||||
okText="是"
|
||||
cancelText="否"
|
||||
onConfirm={() => this.deleteorder(item.id)}
|
||||
>
|
||||
<Button type="link">
|
||||
<i className="iconfont icon-shanchu font-15 color-grey-6"></i>
|
||||
</Button>
|
||||
</Popconfirm>
|
||||
) : (
|
||||
""
|
||||
)}
|
||||
</span>
|
||||
</span>
|
||||
<Link
|
||||
to={`/users/${item && item.user_login}`}
|
||||
className="show-user-link color-black ml10 fwb"
|
||||
>
|
||||
{item && item.user_name}
|
||||
</Link>
|
||||
</div>
|
||||
<div className="ml30">
|
||||
<div className="ml40">
|
||||
{item.content ? (
|
||||
this.commentCtx(item.content)
|
||||
) : (
|
||||
|
@ -466,6 +413,46 @@ class comments extends Component {
|
|||
) : (
|
||||
""
|
||||
)}
|
||||
<div className="grid-item mt5">
|
||||
<span className="color-grey-8">{item.created_at}</span>
|
||||
<span className="text-right">
|
||||
{current_user &&
|
||||
(current_user.admin ||
|
||||
current_user.login === item.user_login) ? (
|
||||
<Popconfirm
|
||||
placement="bottom"
|
||||
title={"确定要删除当前评论吗?"}
|
||||
okText="是"
|
||||
cancelText="否"
|
||||
onConfirm={() => this.deleteorder(item.id)}
|
||||
>
|
||||
<Button type="link">
|
||||
<i className="iconfont icon-shanchu3 font-15 color-grey-6 mr5 ver-middle"></i>
|
||||
<span className="font-12 color-grey-6">删除</span>
|
||||
</Button>
|
||||
</Popconfirm>
|
||||
) : (
|
||||
""
|
||||
)}
|
||||
<Button
|
||||
type="link"
|
||||
className="ml-10"
|
||||
onClick={() => this.add_reply(item.id)}
|
||||
>
|
||||
<i className="iconfont icon-huifu1 font-15 color-grey-6 mr5 ver-middle"></i>
|
||||
<span className="font-12 color-grey-6">回复</span>
|
||||
</Button>
|
||||
</span>
|
||||
</div>
|
||||
{current_user && (
|
||||
<div>
|
||||
{is_reply && reply_id && reply_id === item.id ? (
|
||||
<div className="pt20">{new_comment(is_reply, item.id)}</div>
|
||||
) : (
|
||||
""
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
<ChildrenComments
|
||||
order_id={orderId}
|
||||
parent_id={item.id}
|
||||
|
@ -474,61 +461,66 @@ class comments extends Component {
|
|||
{...this.props}
|
||||
></ChildrenComments>
|
||||
</div>
|
||||
|
||||
{current_user && (
|
||||
<div>
|
||||
{is_reply && reply_id && reply_id === item.id ? (
|
||||
<div className="pd20">{new_comment(is_reply, item.id)}</div>
|
||||
) : (
|
||||
<div className="grid-item mt15">
|
||||
<Link
|
||||
to={`/users/${current_user && current_user.login}`}
|
||||
className="show-user-link mr10"
|
||||
>
|
||||
<img
|
||||
className="radius"
|
||||
src={getImageUrl(
|
||||
`images/${current_user && current_user.image_url}`
|
||||
)}
|
||||
alt=""
|
||||
width="30"
|
||||
height="30"
|
||||
/>
|
||||
</Link>
|
||||
<span className="reply-comment-input">
|
||||
<Button
|
||||
className="add_reply_button"
|
||||
onClick={() => this.add_reply(item.id)}
|
||||
>
|
||||
<span>我要回复</span>
|
||||
</Button>
|
||||
</span>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="pd20">
|
||||
<div className="comment-background">
|
||||
{journalsdata && journalsdata.journals_total_count > 0 ? (
|
||||
<List
|
||||
size="large"
|
||||
loading={isSpin}
|
||||
header={<div>回复({journalsdata.journals_total_count})</div>}
|
||||
dataSource={journalsdata.issue_journals}
|
||||
renderItem={(item) => <List.Item>{renderList(item)}</List.Item>}
|
||||
/>
|
||||
) : (
|
||||
<div className="ant-list-header border-bottom-comment">
|
||||
<div>回复({search_count})</div>
|
||||
</div>
|
||||
)}
|
||||
<div className="mt20">
|
||||
<div className="comment-background pd10 mb10">
|
||||
<Tabs defaultActiveKey="1" className="custom-comment-tabs">
|
||||
<TabPane
|
||||
tab={
|
||||
<span className="ml-3 font-16">
|
||||
评论
|
||||
{search_count > 0 && (
|
||||
<span className="search-count-button">{search_count}</span>
|
||||
)}
|
||||
</span>
|
||||
}
|
||||
key="1"
|
||||
>
|
||||
<div className="mb10">
|
||||
{is_reply && !reply_id ? (
|
||||
<div className="pd20">{new_comment(is_reply, undefined)}</div>
|
||||
) : (
|
||||
<div className="children-comment-bg pd20 grid-item">
|
||||
<img
|
||||
className="radius"
|
||||
src={
|
||||
current_user && current_user.image_url
|
||||
? getImageUrl(`images/${current_user.image_url}`)
|
||||
: "images/avatars/User/b"
|
||||
}
|
||||
alt=""
|
||||
width="30"
|
||||
height="30"
|
||||
/>
|
||||
<span className="reply-comment-input mr20">
|
||||
<Button
|
||||
className="add_reply_button ml10"
|
||||
onClick={() => this.add_reply(undefined)}
|
||||
>
|
||||
<span>添加评论...</span>
|
||||
</Button>
|
||||
</span>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
{journalsdata && journalsdata.journals_total_count > 0 && (
|
||||
<List
|
||||
size="large"
|
||||
loading={isSpin}
|
||||
header=""
|
||||
dataSource={journalsdata.issue_journals}
|
||||
renderItem={(item) => (
|
||||
<List.Item>{renderList(item)}</List.Item>
|
||||
)}
|
||||
/>
|
||||
)}
|
||||
</TabPane>
|
||||
</Tabs>
|
||||
{Paginations}
|
||||
<div className="pd20 border-top-e">{new_comment()}</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
|
|
@ -191,7 +191,7 @@ class Infos extends Component {
|
|||
<div className="bgcF">
|
||||
<div className="list-l-Menu">
|
||||
<p className="list-l-p pd20" onClick={() => this.undo_link()}>
|
||||
<span className="font-16 fwb">
|
||||
<span className="font-16 color-grey-3">
|
||||
<i className="iconfont icon-dahuizhongzuo3x font-15 mr5"></i>
|
||||
待办事项
|
||||
</span>
|
||||
|
@ -204,10 +204,10 @@ class Infos extends Component {
|
|||
)}
|
||||
<div className="bgcF">
|
||||
<ul className="list-l-Menu">
|
||||
<li className="MenuTitle fwb" onClick={() => this.change_project_type(undefined)}>
|
||||
<li className="MenuTitle" onClick={() => this.change_project_type(undefined)}>
|
||||
<i className="iconfont icon-xiangmuleixing font-15 mr5"></i>
|
||||
项目类型
|
||||
<i className="iconfont icon-youjiantou font-15 mr10 color-grey-9 pull-right"></i>
|
||||
<i className="iconfont icon-youjiantou font-15 mr20 color-grey-9 pull-right"></i>
|
||||
</li>
|
||||
<li className={project_type && project_type === "common" ? "active" : ""} onClick={() => this.change_project_type("common")}>
|
||||
<p>
|
||||
|
@ -230,7 +230,7 @@ class Infos extends Component {
|
|||
<div className="bgcF">
|
||||
<div className="list-l-Menu">
|
||||
<p className="list-l-p pd20" onClick={() => this.organize_link()} >
|
||||
<span className="font-16 fwb">
|
||||
<span className="font-16 color-grey-3">
|
||||
<i className="iconfont icon-itsm-liuchengguanli font-15 mr5"></i>
|
||||
组织
|
||||
</span>
|
||||
|
@ -287,22 +287,6 @@ class Infos extends Component {
|
|||
)}
|
||||
</div>
|
||||
</div>
|
||||
<div className="list-right">
|
||||
<Switch {...this.props}>
|
||||
<Route
|
||||
path="/users/:username/organize"
|
||||
render={(props) => {
|
||||
return <Organize {...this.props} {...this.state} />;
|
||||
}}
|
||||
></Route>
|
||||
{/* <Route
|
||||
path="/users/:username/projects"
|
||||
render={(props) => {
|
||||
return <InfosIndex {...this.props} {...this.state} />;
|
||||
}}
|
||||
></Route> */}
|
||||
</Switch>
|
||||
</div>
|
||||
</Spin>
|
||||
</div>
|
||||
);
|
||||
|
|
|
@ -29,10 +29,10 @@ class InfosUser extends Component {
|
|||
};
|
||||
|
||||
componentDidUpdate = (prevProps) => {
|
||||
if (prevProps.project_type!= this.props.project_type) {
|
||||
this.get_projects();
|
||||
}
|
||||
}
|
||||
if (prevProps.project_type != this.props.project_type) {
|
||||
this.get_projects();
|
||||
}
|
||||
};
|
||||
|
||||
get_projects = () => {
|
||||
const { user, project_type } = this.props;
|
||||
|
@ -49,7 +49,7 @@ class InfosUser extends Component {
|
|||
search,
|
||||
sort_by,
|
||||
category,
|
||||
project_type
|
||||
project_type,
|
||||
},
|
||||
})
|
||||
.then((result) => {
|
||||
|
@ -112,37 +112,37 @@ class InfosUser extends Component {
|
|||
</Menu.Item>
|
||||
</Menu>
|
||||
);
|
||||
const button_lists =
|
||||
user && current_user && user.login === current_user.login ?
|
||||
[
|
||||
{ type: undefined, name: "所有" },
|
||||
{ type: "manage", name: "我自己的" },
|
||||
{ type: "join", name: "我参与的" },
|
||||
{ type: "watched", name: "我关注的" },
|
||||
{ type: "forked", name: "我Fork的" },
|
||||
{ type: "public", name: "公开的" },
|
||||
{ type: "private", name: "私有的" }
|
||||
]
|
||||
: [ { type: undefined, name: "所有" },
|
||||
{ type: "manage", name: "TA自己的" },
|
||||
{ type: "join", name: "TA参与的" },
|
||||
{ type: "watched", name: "TA关注的" },
|
||||
{ type: "forked", name: "TAFork的" },
|
||||
{ type: "public", name: "公开的" }]
|
||||
const button_lists =
|
||||
user && current_user && user.login === current_user.login
|
||||
? [
|
||||
{ type: undefined, name: "所有" },
|
||||
{ type: "manage", name: "我自己的" },
|
||||
{ type: "join", name: "我参与的" },
|
||||
{ type: "watched", name: "我关注的" },
|
||||
{ type: "forked", name: "我Fork的" },
|
||||
{ type: "public", name: "公开的" },
|
||||
{ type: "private", name: "私有的" },
|
||||
]
|
||||
: [
|
||||
{ type: undefined, name: "所有" },
|
||||
{ type: "manage", name: "TA自己的" },
|
||||
{ type: "join", name: "TA参与的" },
|
||||
{ type: "watched", name: "TA关注的" },
|
||||
{ type: "forked", name: "TAFork的" },
|
||||
{ type: "public", name: "公开的" },
|
||||
];
|
||||
|
||||
const category_button = button_lists.map((item, key) => {
|
||||
return (
|
||||
<span key={key} className="pr15">
|
||||
<Button
|
||||
type={
|
||||
(category && category === item.type) ||
|
||||
(!category && !item.type)
|
||||
(category && category === item.type) || (!category && !item.type)
|
||||
? "primary"
|
||||
: "default"
|
||||
}
|
||||
ghost={
|
||||
(category && category === item.type) ||
|
||||
(!category && !item.type)
|
||||
(category && category === item.type) || (!category && !item.type)
|
||||
}
|
||||
value={item.type}
|
||||
onClick={this.changeCategory}
|
||||
|
@ -173,54 +173,54 @@ class InfosUser extends Component {
|
|||
return (
|
||||
<Spin spinning={isSpin}>
|
||||
<div className="list-r-operation">
|
||||
<Search
|
||||
placeholder="输入项目名称关键字进行搜索"
|
||||
enterButton="搜索"
|
||||
size="large"
|
||||
onSearch={this.get_projects}
|
||||
className="list-r-Search"
|
||||
value={search}
|
||||
onChange={this.changeSearchValue}
|
||||
/>
|
||||
<div>
|
||||
{current_user && user && current_user.login === user.login && (
|
||||
<Popover
|
||||
content={newItem}
|
||||
trigger={["click"]}
|
||||
placement="bottom"
|
||||
className="mr50"
|
||||
>
|
||||
<Search
|
||||
placeholder="输入项目名称关键字进行搜索"
|
||||
enterButton="搜索"
|
||||
size="large"
|
||||
onSearch={this.get_projects}
|
||||
className="list-r-Search"
|
||||
value={search}
|
||||
onChange={this.changeSearchValue}
|
||||
/>
|
||||
<div>
|
||||
{current_user && user && current_user.login === user.login && (
|
||||
<Popover
|
||||
content={newItem}
|
||||
trigger={["click"]}
|
||||
placement="bottom"
|
||||
className="mr50"
|
||||
>
|
||||
<a className="ant-dropdown-link">
|
||||
<span className="color-blue font-16">
|
||||
<img src={img_new} alt="" width="13px" /> 新建
|
||||
</span>
|
||||
</a>
|
||||
</Popover>
|
||||
)}
|
||||
|
||||
<Popover content={menu} trigger={["click"]} placement="bottom">
|
||||
<a className="ant-dropdown-link">
|
||||
<span className="color-blue font-16">
|
||||
<img src={img_new} alt="" width="13px" /> 新建
|
||||
排序 <img src={img_array} alt="" width="10px" />
|
||||
</span>
|
||||
</a>
|
||||
</Popover>
|
||||
)}
|
||||
|
||||
<Popover content={menu} trigger={["click"]} placement="bottom">
|
||||
<a className="ant-dropdown-link">
|
||||
<span className="color-blue font-16">
|
||||
排序 <img src={img_array} alt="" width="10px" />
|
||||
</span>
|
||||
</a>
|
||||
</Popover>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="project-list mt20">{category_button}</div>
|
||||
<div className="project-list mt20">{category_button}</div>
|
||||
|
||||
{projectsList && projectsList.length > 0 ? (
|
||||
<div>
|
||||
<ListItem
|
||||
{...this.props}
|
||||
{...this.state}
|
||||
projects={projectsList}
|
||||
></ListItem>
|
||||
</div>
|
||||
) : (
|
||||
<Nodata _html={`暂时没有项目`} />
|
||||
)}
|
||||
{pagination}
|
||||
{projectsList && projectsList.length > 0 ? (
|
||||
<div>
|
||||
<ListItem
|
||||
{...this.props}
|
||||
{...this.state}
|
||||
projects={projectsList}
|
||||
></ListItem>
|
||||
</div>
|
||||
) : (
|
||||
<Nodata _html={`暂时没有项目`} />
|
||||
)}
|
||||
{pagination}
|
||||
</Spin>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -86,7 +86,7 @@ class CommonList extends Component {
|
|||
|
||||
return (
|
||||
<Spin spinning={isSpin}>
|
||||
<div className="pd20">
|
||||
<div className="pd20 minH-670">
|
||||
<div className="grid-item pb20 bbt">
|
||||
<h3>{userType === "watch_users" ? `${title_type}关注的` : `关注${title_type}的`}</h3>
|
||||
<div className="text-right">
|
||||
|
@ -104,7 +104,7 @@ class CommonList extends Component {
|
|||
|
||||
{users && users.length > 0 ? (
|
||||
<div className="w-100 inline-block">
|
||||
<UserList users={users} userClass={"w-33"}></UserList>
|
||||
<UserList users={users} userClass={"w-33"} current_user={current_user}></UserList>
|
||||
</div>
|
||||
) : (
|
||||
<Nodata _html={`暂时没有数据~`} />
|
||||
|
|
|
@ -10,10 +10,10 @@ class FanUsers extends Component {
|
|||
}
|
||||
|
||||
render() {
|
||||
const {user} = this.props
|
||||
const {user, current_user} = this.props
|
||||
return (
|
||||
<div>
|
||||
{user && user.login && <CommonLists userType="fan_users" login={user.login} />}
|
||||
{user && user.login && <CommonLists userType="fan_users" login={user.login} current_user={current_user} />}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
.list-right{
|
||||
width:74%;
|
||||
background: #fff;
|
||||
padding:0px;
|
||||
padding:0px !important;
|
||||
}
|
||||
.list-l-Menu{
|
||||
margin-bottom: 12px;
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import React, { Component } from "react";
|
||||
// import { Input, Spin, Pagination } from "antd";
|
||||
import CommonLists from "./common_lists"
|
||||
class WatcherUsers extends Component {
|
||||
constructor(props) {
|
||||
|
@ -10,10 +9,10 @@ class WatcherUsers extends Component {
|
|||
}
|
||||
|
||||
render() {
|
||||
const {user} = this.props
|
||||
const {user, current_user} = this.props
|
||||
return (
|
||||
<div>
|
||||
{user && user.login && <CommonLists userType="watch_users" login={user.login} {...this.props} />}
|
||||
<div className="minH-650">
|
||||
{user && user.login && <CommonLists userType="watch_users" login={user.login} current_user={current_user} />}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue