forked from Gitlink/forgeplus-react
loading
This commit is contained in:
parent
fd7d32de41
commit
fd0f26a043
|
|
@ -3,7 +3,7 @@ import { Link } from "react-router-dom";
|
|||
|
||||
import axios from "axios";
|
||||
import { getImageUrl } from "educoder";
|
||||
import { Form , Popconfirm , Tag } from "antd";
|
||||
import { Form , Popconfirm , Tag , Spin } from "antd";
|
||||
import Attachments from "../Upload/attachment";
|
||||
import RenderHtml from "../../components/render-html";
|
||||
import Comments from "../comments/comments";
|
||||
|
|
@ -27,7 +27,7 @@ class Detail extends Component {
|
|||
limit: 10,
|
||||
page: 1,
|
||||
search_count: undefined,
|
||||
isSpin: false,
|
||||
isSpins: true,
|
||||
showFiles: true,
|
||||
quillValue: "",
|
||||
quillFlag: false,
|
||||
|
|
@ -52,6 +52,7 @@ class Detail extends Component {
|
|||
if (result) {
|
||||
this.setState({
|
||||
data: result.data,
|
||||
isSpins:false
|
||||
});
|
||||
}
|
||||
})
|
||||
|
|
@ -144,7 +145,7 @@ class Detail extends Component {
|
|||
ChangePage = (page) => {
|
||||
this.setState({
|
||||
page,
|
||||
isSpin: true,
|
||||
isSpins: true,
|
||||
});
|
||||
const { limit } = this.state;
|
||||
this.getjournalslist(page, limit);
|
||||
|
|
@ -186,7 +187,7 @@ class Detail extends Component {
|
|||
|
||||
render() {
|
||||
const { projectsId, orderId } = this.props.match.params;
|
||||
const { data } = this.state;
|
||||
const { data , isSpins } = this.state;
|
||||
const get_color = (type) => {
|
||||
if (type === "高") {
|
||||
return "#e67e22";
|
||||
|
|
@ -200,111 +201,112 @@ class Detail extends Component {
|
|||
};
|
||||
|
||||
return (
|
||||
<div className="ProjectListIndex">
|
||||
<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
|
||||
<Spin spinning={isSpins}>
|
||||
<div className="ProjectListIndex">
|
||||
<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>
|
||||
</div>
|
||||
|
||||
<Comments
|
||||
order_id={orderId}
|
||||
showNotification={this.props.showNotification}
|
||||
{...this.props}
|
||||
/>
|
||||
</div>
|
||||
<div className="list-left list-left-padding">
|
||||
<Comments
|
||||
order_id={orderId}
|
||||
showNotification={this.props.showNotification}
|
||||
{...this.props}
|
||||
/>
|
||||
</div>
|
||||
<div className="list-left list-left-padding">
|
||||
<div className="list-right-item-padding background-f boder-4">
|
||||
<p className="grid-item-left pb15">
|
||||
<span className="issue_detail_info">分支:</span>
|
||||
|
|
@ -375,7 +377,8 @@ class Detail extends Component {
|
|||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Spin>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import React, { Component } from 'react';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { Dropdown, Icon, Menu, Pagination, Typography, Popconfirm } from 'antd';
|
||||
import { Dropdown, Icon, Menu, Pagination, Typography, Popconfirm , Spin } from 'antd';
|
||||
import NoneData from '../Nodata';
|
||||
import axios from 'axios';
|
||||
import './order.css';
|
||||
|
|
@ -20,7 +20,9 @@ class Milepost extends Component {
|
|||
status: 'open',
|
||||
openselect: 1,
|
||||
closeselect: undefined,
|
||||
order_name: undefined
|
||||
order_name: undefined,
|
||||
|
||||
spinings:true
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -38,9 +40,9 @@ class Milepost extends Component {
|
|||
}
|
||||
}).then((result) => {
|
||||
if (result) {
|
||||
|
||||
this.setState({
|
||||
data: result.data
|
||||
data: result.data,
|
||||
spinings:false
|
||||
})
|
||||
}
|
||||
}).catch((error) => {
|
||||
|
|
@ -56,7 +58,8 @@ class Milepost extends Component {
|
|||
this.setState({
|
||||
status: 'open',
|
||||
openselect: current_user.user_id,
|
||||
closeselect: undefined
|
||||
closeselect: undefined,
|
||||
|
||||
})
|
||||
this.getList(1, 'open', 'desc', order_name);
|
||||
} else {
|
||||
|
|
@ -144,7 +147,7 @@ class Milepost extends Component {
|
|||
|
||||
|
||||
render() {
|
||||
const { data, limit, page, openselect, closeselect } = this.state;
|
||||
const { data, limit, page, openselect, closeselect , spinings } = this.state;
|
||||
const { projectsId } = this.props.match.params;
|
||||
const menu = (
|
||||
<Menu onClick={this.arrayList}>
|
||||
|
|
@ -159,7 +162,8 @@ class Milepost extends Component {
|
|||
|
||||
|
||||
return (
|
||||
<div className="main">
|
||||
<Spin spinning={spinings}>
|
||||
<div className="main">
|
||||
<div style={{ display: this.state.display }}>
|
||||
<div className="tagdiv" >
|
||||
<span>里程碑{data && data.issue_tags_count}已创建</span>
|
||||
|
|
@ -266,6 +270,7 @@ class Milepost extends Component {
|
|||
</div> : ""
|
||||
}
|
||||
</div>
|
||||
</Spin>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ class MilepostDetail extends Component {
|
|||
issue_chosen: undefined,
|
||||
data: undefined,
|
||||
issues: undefined,
|
||||
isSpin: false,
|
||||
isSpin: true,
|
||||
search: undefined,
|
||||
author_id: undefined,
|
||||
assigned_to_id: undefined,
|
||||
|
|
|
|||
Loading…
Reference in New Issue