diff --git a/src/AppConfig.js b/src/AppConfig.js index 7a8272a7a..0ed1a106e 100644 --- a/src/AppConfig.js +++ b/src/AppConfig.js @@ -32,7 +32,7 @@ export function initAxiosInterceptors(props) { // 判断网络是否连接 initOnlineOfflineListener(); - var proxy = "https://testforgeplus.educoder.net"; + var proxy = "https://testforgeplus.educoder.net/"; //响应前的设置 axios.interceptors.request.use( config => { diff --git a/src/forge/Issues/Img/millestones-big.png b/src/forge/Issues/Img/millestones-big.png new file mode 100644 index 000000000..b57f83f31 Binary files /dev/null and b/src/forge/Issues/Img/millestones-big.png differ diff --git a/src/forge/Main/Detail.js b/src/forge/Main/Detail.js index 04541655c..e52be3a40 100644 --- a/src/forge/Main/Detail.js +++ b/src/forge/Main/Detail.js @@ -93,7 +93,7 @@ const UpdateMerge = Loadable({ }) const MilepostDetail = Loadable({ - loader: () => import('../Order/MilepostDetail'), + loader: () => import('../Order/MilepostDetail.jsx'), loading: Loading, }) const WatchUsers = Loadable({ @@ -736,7 +736,7 @@ class Detail extends Component { } > {/*里程碑详情*/} - () } diff --git a/src/forge/Order/AmplifyImg.js b/src/forge/Order/AmplifyImg.js index 568ac7f92..114fa7e6a 100644 --- a/src/forge/Order/AmplifyImg.js +++ b/src/forge/Order/AmplifyImg.js @@ -1,7 +1,7 @@ import React from 'react'; import { Modal } from 'antd'; -import './order.css'; +import './order.scss'; function AmplifyImg(props) { return ( diff --git a/src/forge/Order/Detail.js b/src/forge/Order/Detail.js index 4e6c92a29..e76c24451 100644 --- a/src/forge/Order/Detail.js +++ b/src/forge/Order/Detail.js @@ -1,4 +1,4 @@ -import React, { Component, useRef } from "react"; +import React, { Component } from "react"; import { Link } from "react-router-dom"; import axios from "axios"; @@ -8,7 +8,7 @@ import Attachments from "../Upload/attachment"; import RenderHtml from "../../components/render-html"; import Comments from "../comments/comments"; import Claims from "../claims/claims" -import "./order.css"; +import "./order.scss"; class Detail extends Component { constructor(props) { @@ -44,6 +44,20 @@ class Detail extends Component { this.getDetail(); }; + componentDidUpdate=()=>{ + this.updateDocumentTitle(); + } + + // 更新网页标题 + updateDocumentTitle(){ + const {projectDetail} = this.props; + const {data} = this.state; + if(projectDetail && data){ + const { author, name} = projectDetail; + document.title = `${data.subject}-疑修-${author.name}/${name}`; + } + } + getDetail = () => { const { projectsId, orderId, owner } = this.props.match.params; const url = `/${owner}/${projectsId}/issues/${orderId}.json`; @@ -55,11 +69,6 @@ class Detail extends Component { data: result.data, isSpins: false }); - const {projectDetail} = this.props; - if(projectDetail){ - const { author, name} = projectDetail; - document.title = `${result.data && result.data.subject}-疑修-${author.name}/${name}`; - } } }) .catch((error) => { diff --git a/src/forge/Order/Milepost.js b/src/forge/Order/Milepost.js index a6f0c3cb6..e228dd452 100644 --- a/src/forge/Order/Milepost.js +++ b/src/forge/Order/Milepost.js @@ -1,54 +1,49 @@ import React, { Component } from 'react'; import { Link } from 'react-router-dom'; -import { Dropdown, Icon, Menu, Pagination, Typography, Popconfirm, Spin } from 'antd'; -import NoneData from '../Nodata'; +import { Dropdown, Icon, Menu, Pagination, Popconfirm, Spin, Button, Tooltip } from 'antd'; +import emp from '../../forge/Issues/Img/emp.png'; import axios from 'axios'; -import './order.css'; -import CheckProfile from '../Component/ProfileModal/Profile'; - -const { Text } = Typography; - +import './milepost.scss'; class Milepost extends Component { constructor(props) { super(props); this.state = { data: undefined, - limit: 15, + limit: 10, page: 1, order_type: undefined, - //新建标签区域是否显示 none 隐藏 block 显示 - display: 'none', + // 里程碑 开启/关闭 状态 status: 'open', - openselect: 1, - closeselect: undefined, order_name: undefined, - - spinings: true + spinings: true, + // tooltip显隐 + visible: false } } + componentDidUpdate(){ + this.updateDocumentTitle(); + } componentDidMount = () => { - this.getList(1, this.state.status, 'desc'); - } - componentDidUpdate = () => { + this.getList(1, this.state.limit, this.state.status); this.updateDocumentTitle(); } + // 更新网页标题 updateDocumentTitle(){ const {projectDetail} = this.props; if(projectDetail){ const { author, name} = projectDetail; - document.title = `新建合并请求-${author.name}/${name}`; + document.title = `里程碑-${author.name}/${name}`; } } - getList = (page, status, order_type, order_name) => { + getList = (page, limit, category, sort_by, sort_direction) => { const { projectsId ,owner } = this.props.match.params; - const { limit } = this.state; - const url = `/${owner}/${projectsId}/milestones.json`; + const url = `/v1/${owner}/${projectsId}/milestones.json`; axios.get(url, { params: { - projectsId, page, limit, status, order_type, order_name + page, limit: limit, category, sort_by, sort_direction } }).then((result) => { if (result) { @@ -63,45 +58,24 @@ class Milepost extends Component { } opneMilelist = (type) => { - const { order_name } = this.state; if (type) { - const { current_user } = this.props; - if (type === 1) { - this.setState({ - status: 'open', - openselect: current_user.user_id, - closeselect: undefined, - - }) - this.getList(1, 'open', 'desc', order_name); - } else { - this.setState({ - status: 'closed', - openselect: undefined, - closeselect: current_user.user_id - }) - this.getList(1, 'closed', 'desc', order_name); - } + this.setState({ + status: type === 1 ? 'open' : 'closed' + }) + this.getList(1, this.state.limit, type === 1 ? 'open' : 'closed', this.state.order_name, this.state.order_type); } - } updatestatusemile = (status, arr) => { const { projectsId , owner } = this.props.match.params; const url = `/${owner}/${projectsId}/milestones/${arr.id}/update_status.json`; - const { current_user } = this.props; axios.post(url, { project_id: projectsId, id: arr.id, status: status }).then(result => { if (result) { - this.setState({ - status: status, - closeselect: status === "closed" ? current_user.user_id : undefined, - openselect: status === "closed" ? undefined : current_user.user_id - }) - this.getList(1, status, 'desc'); + this.getList(1, this.state.limit, this.state.status, this.state.order_name, this.state.order_type); const { getDetail } = this.props; getDetail && getDetail(); } @@ -120,7 +94,7 @@ class Milepost extends Component { } }).then((result) => { if (result) { - this.getList(1, this.state.status, 'desc'); + this.getList(1, this.state.limit, this.state.status, this.state.order_name, this.state.order_type); const { getDetail } = this.props; getDetail && getDetail(); } @@ -134,39 +108,44 @@ class Milepost extends Component { this.setState({ page }) - const { status } = this.state; - this.getList( page , status ); + this.getList(page, this.state.limit, this.state.status, this.state.order_name, this.state.order_type); } // 排序 arrayList = (e) => { + const name = e.key !== 'order' ? e.key : undefined; + const type = e.item.props.value !== 'order' ? e.item.props.value : undefined; this.setState({ - order_name: e.key, - order_type: e.item.props.value + order_name: name, + order_type: type }) - this.getList(1, this.state.status, e.item.props.value, e.key); + this.getList(1, this.state.limit, this.state.status, name, type); } - - //控制新建标签页是否显示 - newshow = () => { + // 分页组件 + onShowSizeChange = (current, pageSize) =>{ this.setState({ - display: 'block' - }); - - }; - newclose = () => { - this.setState({ - display: 'none' - }); - }; + page: 1, + limit: pageSize + }) + this.getList(1, pageSize, this.state.status, this.state.order_name, this.state.order_type); + } + // tooltip判断是否显示 + // onVisibleChange = (visible, value) => { + // console.log('visible, value', visible, value); + // this.setState({ + // visible: value.length >24 ? visible : false + // }) + // } render() { - const { data, limit, page, openselect, closeselect, spinings } = this.state; + const { data, limit, page, spinings, status, order_name, order_type, visible } = this.state; const { projectsId , owner } = this.props.match.params; + const { isManager, isDeveloper} = this.props; const menu = ( - + + 默认排序 到期日从后到先 到期日从先到后 完成度从低到高 @@ -176,103 +155,90 @@ class Milepost extends Component { ) + // 排序字段 选中显示文本 + const sortByMile = { + 'effective_date':{ + 'desc': '到期日从后到先', + 'asc': '到期日从先到后' + }, + 'percent':{ + 'desc': '完成度从低到高', + 'asc': '完成度从高到低' + }, + 'issues_count':{ + 'desc': '任务从多到少', + 'asc': '任务从少到多' + }, + 'order':{ + 'order': '排序' + } + } return ( -
-
-
- 里程碑{data && data.issue_tags_count}已创建 +
+ {/* 创建里程碑按钮 */} + {/*
+ {(isManager || isDeveloper) && } +
*/} + {/* 里程碑列表表头 */} +
+
+ this.opneMilelist(1)}>开启中{data && data.opening_milestone_count} + this.opneMilelist(2)}>已关闭{data && data.closed_milestone_count} +
+
+ {(isManager || isDeveloper) && } + + {order_name ? sortByMile[order_name][order_type] : '排序'} +
-
-
-
  • this.opneMilelist(1)}>{data && data.open_count}个开启中
  • -
  • this.opneMilelist(2)}>{data && data.closed_count}个已关闭
  • -
    -
    -
      -
    • - - 排序 - -
    • -
    - { - data && data.user_admin_or_member ? - {this.props.history.push(`/${owner}/${projectsId}/milestones/new`)}}>新的里程碑 - : '' - } -
    -
    - { - data && data.versions && data.versions.length > 0 - && -
    - { - data.versions.map((item, key) => { - return ( -
    -
    -
    -
    - - {item.name} -
    -
    -
    -
    -
    -
    - - {item.effective_date || "暂无截止时间"} -
    -
    - - {item.open_issues_count}个开启 -
    -
    - - {item.close_issues_count}个关闭 -
    -
    - { - data && data.user_admin_or_member ? - - : '' - } -
    -
    -
    - {item.description} -
    -
    + {/* 里程碑列表展示 */} + {data && data.milestones && data.milestones.length === 0 &&
    暂无数据~
    } + {data && data.milestones && data.milestones.length > 0 &&
    + {data.milestones.map((item, key)=>{ + return
    +
    +
    + + {item.name} +
    + {item.description && item.description.length > 44 ? {item.description} : {item.description}} +
    +
    +
    + + 0 ? 'outTime' : ''}`}>{item.effective_date || "暂无截止时间"} +
    +
    + {item.opened_issues_count || 0}个开启 + | + {item.close_issues_count || 0}个关闭 +
    + { + (isManager || isDeveloper) && + } +
    - } - { data && data.versions && data.versions.length === 0 && } + })} +
    } { - data && data.versions_count > limit ? -
    - + data && data.total_count > limit ? +
    +
    : "" }
    diff --git a/src/forge/Order/MilepostDetail.js b/src/forge/Order/MilepostDetail.js index cfed74efc..4829485ca 100644 --- a/src/forge/Order/MilepostDetail.js +++ b/src/forge/Order/MilepostDetail.js @@ -110,7 +110,7 @@ class MilepostDetail extends Component { getIssueList = ( page , item , value , update , updateValue , type ) => { const { projectsId, meilid , owner } = this.props.match.params; const { limit , order_name , order_type , issue_tag_id , author_id , assigned_to_id , tracker_id , status_id , done_ratio , status_type } = this.state; - + console.log(this.props); const url = `/${owner}/${projectsId}/milestones/${meilid}.json`; let params = update ? { page, limit , order_name:value , order_type:updateValue , issue_tag_id , diff --git a/src/forge/Order/MilepostDetail.jsx b/src/forge/Order/MilepostDetail.jsx new file mode 100644 index 000000000..ba1fc49bc --- /dev/null +++ b/src/forge/Order/MilepostDetail.jsx @@ -0,0 +1,264 @@ +import React , { useRef , useState , useEffect } from 'react'; +import { Menu, Input , Checkbox , Pagination, Button , Tooltip ,Spin } from 'antd'; +import { Link } from "react-router-dom"; +import AllMenus from './component/allMenus'; +import Datas from '../Issues/Component/datas'; +import axios from 'axios'; +import { FlexAJ } from '../Component/layout'; +import CheckProfile from '../Component/ProfileModal/Profile'; +import millestones from '../../forge/Issues/Img/millestones-big.png'; +import './milepost.scss'; +import './order.scss'; +import '../Issues/index.scss'; + +function MilepostDetail(props){ + const [ milepost, setMilepost] = useState(undefined); + const [ issueList , setIssueList ] = useState(undefined); + const [ closedCount , setClosedCount ] = useState(0); + const [ openedCount , setOpenedCount ] = useState(0); + + + const [ category , setCategory] = useState("opened"); + + const [ allValue , setAllValue ] = useState([]); + const [ allIds , setAllIds ] = useState([]); + const [ checkAll , setCheckAll ] = useState(false); + + const [ updateIds , setUpdateIds ] = useState([]); + const [ limit, setLimit] = useState(10); + const [ page , setPage ] = useState(1); + const [ total , setTotal ] = useState(undefined); + const [ issuesCount, setIssueCount] = useState(undefined); + + const [ chooseValue, setChooseValue ] = useState(undefined); + + const menuRef = useRef(null); + const { projectsId, mileId , owner } = props.match.params; + const {current_user, projectDetail, showLoginDialog, history} = props; + const permission = props && props.projectDetail && props.projectDetail.permission; + // 排序字段 + const sortBy = { + '1': {'sort_by': 'issues.created_on', 'sort_direction': 'desc'}, + '2': {'sort_by': 'issues.created_on', 'sort_direction': 'asc'}, + '3': {'sort_by': 'issues.updated_on', 'sort_direction': 'desc'}, + '4': {'sort_by': 'issues.updated_on', 'sort_direction': 'asc'}, + '5': {'sort_by': 'issue_priorities.position', 'sort_direction': 'desc'}, + '6': {'sort_by': 'issue_priorities.position', 'sort_direction': 'asc'} + } + + useEffect(()=>{ + Init(chooseValue); + },[category, page, limit]) + + useEffect(()=>{ + updateDocumentTitle() + }, [projectDetail, milepost]) + + // 更新网页标题 + function updateDocumentTitle(){ + if(projectDetail && milepost){ + const { author, name} = projectDetail; + document.title = `${milepost.name}-里程碑-${author.name}/${name}`; + } + } + + // 获取issue列表数据 + function Init(params){ + const url = `/v1/${owner}/${projectsId}/milestones/${mileId}.json`; + axios.get(url,{ + params:{ + page, + limit, + category, + ...params + } + }).then(result=>{ + if(result){ + const {milestone, issues, total_count, closed_issues_count, opened_issues_count, total_issues_count} = result.data; + if(issues.length === 0 && page>1){ + setPage(page-1); + return; + } + setMilepost(milestone); + setIssueList(issues); + setTotal(total_count); + setClosedCount(closed_issues_count); + setOpenedCount(opened_issues_count); + setIssueCount(total_issues_count) + const ids = issues.length>0 ? issues.map(i=>{return i.id}) : []; + setAllIds(ids); + } + }).then(error=>{console.log("error:",error)}) + } + + + // 全选所有issue + function chooseAll(e){ + setCheckAll(e.target.checked); + if(e.target.checked){ + setAllValue(allIds); + }else{ + setAllValue([]); + } + } + + // 选择列表里的issue + function checkIssues(value){ + setAllValue(value); + if(value.length === allIds.length){ + setCheckAll(true); + }else{ + setCheckAll(false); + } + } + + // 取消 + function cancelUpdate(){ + setAllValue([]); + setCheckAll(false); + // 清除下拉选项 + menuRef.current && menuRef.current.clearChoose(); + } + + // 确认修改 allValue updateIds + function sureUpdate(){ + const url = `/v1/${owner}/${projectsId}/issues/batch_update`; + axios.patch(url,{ + assigner_ids: updateIds && updateIds.assigner_id && updateIds.assigner_id.split(","), + ids: allValue, + issue_tag_ids: updateIds && updateIds.issue_tag_ids && updateIds.issue_tag_ids.split(","), + milestone_id: updateIds && updateIds.milestone_id, + }).then(result=>{ + if(result){ + setUpdateIds(undefined); + setAllValue([]); + setTotal(undefined); + Init(); + cancelUpdate(); + } + }).catch(error=>{}) + } + + // 切换页码 + function changepage(page){ + setPage(page); + window.scrollTo(0,0); + } + + function chooseFunc(ids){ + if(allValue && allValue.length>0){ + // 将ids保存下来以便修改 + setUpdateIds(ids); + setChooseValue(undefined); + }else{ + const {sort_by} = ids; + const params = {...ids, ...sortBy[sort_by]} + setChooseValue(params); + page===1 && Init(params); + setPage(1); + } + } + + return( +
    + {milepost && +
    +

    {milepost.name}

    +

    + + + {milepost.effective_date || '暂无截止时间'} + + {(milepost.percent || milepost.percent===0) ? {milepost.percent > 0 ? parseInt(milepost.percent*100):milepost.percent}%完成 :"" } +

    +
    +
    + { + (current_user && current_user.login) && (permission && permission !== "Reporter") ? + 编辑里程碑 + :"" + } + {/* { + current_user && current_user.login ? + + : + } */} + {history.push(`/${owner}/${projectsId}/issues/${mileId}/new`)}} checklogin className="operateButton ml20">+ 创建疑修 +
    +
    } + {/* 里程碑描述 */} +
    {milepost && milepost.description}
    +
    +
    +
    + + { + allValue && allValue.length>0 ? + 选择{allValue.length}个issue + : +
      +
    • setCategory("all")}>全部{issuesCount}
    • +
    • setCategory("opened")}>开启中{openedCount}
    • +
    • setCategory("closed")}>已关闭{closedCount}
    • +
    + } +
    +
    + 0} + owner={owner} + projectsId={projectsId} + chooseFunc={chooseFunc} + /> + { + allValue && allValue.length>0 ? +
    + + +
    + :"" + } +
    +
    + { + total === 0 && +
    + +

    欢迎使用里程碑

    +

    里程碑用于集中归类管理项目的疑修及进度。在使用之前,您可以先{props.history.push(`/${owner}/${projectsId}/issues/${mileId}/new`)}} className="color-blue">创建一个疑修

    +
    + } + { + total > 0 && + + +
    + {issueList.map((item,key)=>{ + return( + } + item={item} + owner={owner} + projectsId={projectsId} + /> + ) + }) + } +
    +
    + { + total > 10 && +
    + {setPage(1);setLimit(pageSize);}}/> +
    + } +
    + } + {total === undefined &&
    } +
    +
    + ) +} +export default MilepostDetail; \ No newline at end of file diff --git a/src/forge/Order/MilepostDetail_old.js b/src/forge/Order/MilepostDetail_old.js new file mode 100644 index 000000000..eb7c30dbb --- /dev/null +++ b/src/forge/Order/MilepostDetail_old.js @@ -0,0 +1,407 @@ +import React, { Component } from "react"; +import { Link } from 'react-router-dom'; +import { Dropdown, Menu, Icon, Pagination, Spin, Button, Checkbox } from 'antd'; +import './order.scss'; +import { FlexAJ } from '../Component/layout'; +import CheckProfile from '../Component/ProfileModal/Profile'; +import AllMenus from "../Issues/Component/allMenus"; +import NoneData from '../Nodata'; +import OrderItem from './OrderItem'; + +import axios from 'axios'; +import './milepost.scss'; + +/** + * issue_chosen:下拉的筛选列表, + * data:列表接口返回的所有数据, + * issues:列表数组, + * isSpin:加载中, + * author_id:发布者id, + * assigned_to_id:指派给。。。的id, + * limit:每页条数, + * page:当前页, + * search_count:列表总条数 + * issue_type:搜索条件 + * status_type: issue的关闭和开启,1表示开启中的,2表示关闭的 + * category: issue状态: 全部、开启、关闭 + */ +class MilepostDetail extends Component { + constructor(props) { + super(props); + this.state = { + issue_chosen: undefined, + data: undefined, + issues: undefined, + isSpin: true, + author_id: undefined, + status_id: undefined, + assigned_to_id: undefined, + limit: 15, + page: 1, + search_count: undefined, + issue_type: undefined, + status_type: '1', + //设置选择高亮 + issue_tag_ids: '标记', + tracker_ids: '类型', + author_ids: '发布人', + assigned_to_ids: '负责人', + status_ids: "状态", + done_ratios: '完成度', + paix: '排序', + issueFlag:true, + checkAll: false, + allValue: [], + allIds: [], + category: 'all' + } + } + + componentDidMount = () => { + this.getSelectList(); + const { page } = this.state; + this.getIssueList(page); + } + + componentDidUpdate=(prevProps)=>{ + this.updateDocumentTitle(); + const prebannerList = prevProps && prevProps.bannerList; + const bannerList = this.props && this.props.bannerList; + if(prebannerList !== bannerList){ + if(bannerList && bannerList.length>0){ + let i = bannerList.filter(i=>i.menu_name === "issues"); + this.setState({ + issueFlag:i && i.length === 0 ? false :true + }) + } + } + } + + // 更新网页标题 + updateDocumentTitle(){ + const {projectDetail} = this.props; + const {data} = this.state; + if(projectDetail && data){ + const { author, name} = projectDetail; + document.title = `${data.name}-里程碑-${author.name}/${name}`; + } + } + + getSelectList = () => { + const { projectsId , owner } = this.props.match.params; + const url = `/${owner}/${projectsId}/issues/index_chosen.json`; + axios.get(url).then((result) => { + if (result) { + this.setState({ + issue_chosen: result.data.issue_chosen + }) + } + }).catch((error) => { + console.log(error); + }) + } + + deletedetail = (id) => { + const { projectsId , owner } = this.props.match.params; + const url = `/${owner}/${projectsId}/issues/${id}.json`; + axios.delete(url, { + data: { + project_id: projectsId, + id: id, + }, + }) + .then((result) => { + if (result) { + const { page } = this.state; + this.getIssueList(page); + const { getDetail } = this.props; + getDetail && getDetail(); + } + }) + .catch((error) => { + console.log(error); + }); + }; + // 获取列表数据 + getIssueList = ( page , item , value , update , updateValue , type ) => { + const { projectsId, meilid , owner } = this.props.match.params; + const { limit , order_name , order_type , issue_tag_id , author_id , assigned_to_id , tracker_id , status_id , done_ratio , status_type } = this.state; + + const url = `/v1/${owner}/${projectsId}/milestones/${meilid}.json`; + let params = update ? { + page, limit , order_name:value , order_type:updateValue , issue_tag_id , + author_id , assigned_to_id , tracker_id , status_id , done_ratio, + status_type:type || status_type, + }:{ + page, limit , order_name , order_type , issue_tag_id , + author_id , assigned_to_id , tracker_id , status_id , done_ratio, + status_type:type || status_type, + [item]:value + } + axios.get(url, { + params: params + }).then((result) => { + if (result) { + this.setState({ + data: result.data.milestone, + issues: result.data.issues, + search_count: params.status_type ==="1" ? result.data.open_issues_count : result.data.close_issues_count, + isSpin: false + }) + } + }).catch((error) => { + console.log(error); + }) + } + + getOption = (e, id, name) => { + if (e.key === "created_on") { + if (e.item.props.value === "desc") { + this.setState({ + paix: '最新创建' + }) + } else { + this.setState({ + paix: '最早创建' + }) + } + } else if (e.key === "updated_on") { + if (e.item.props.value === "desc") { + this.setState({ + paix: '最新更新' + }) + } else { + this.setState({ + paix: '最早更新' + }) + } + } + this.setState({ + [id]: e.key, + [id+"s"]:name, + page:1 + }) + if (e.key === "created_on" || e.key === "updated_on") { + this.setState({ + order_name: e.key, + order_type: e.item.props.value + }) + this.getIssueList(1,id,e.key,true,e.item.props.value); + }else{ + this.getIssueList(1,id,e.key); + } + } + + renderMenu = (array, name, id) => { + return ( + + this.getOption(e, id, name)}>{name} + { + array && array.length > 0 && array.map((item, key) => { + return ( + this.getOption(e, id, item.name)}>{item.name} + ) + }) + } + + ) + } + + // 翻页 + ChangePage = (page) => { + this.setState({ + page, + isSpin: true + }) + this.getIssueList(page); + } + + category = (type) => { + this.setState({ + status_type: type, + issue_tag_id : undefined, + author_id : undefined, + tracker_id : undefined, + done_ratio : undefined, + status_id: undefined, + assigned_to_id: undefined, + issue_tag_ids: '标记', + tracker_ids: '类型', + author_ids: '发布人', + assigned_to_ids: '负责人', + status_ids: "状态", + done_ratios: '完成度', + paix: '排序' + },() => { + this.getIssueList(1,undefined,undefined,undefined,undefined,type); + }); + + } + + // 全选所有issue + chooseAll = (e) =>{ + const {allIds} = this.state; + this.setState({ + checkAll: e.target.checked, + allValue: e.target.checked ? allIds : [] + }); + } + + render() { + + const { issue_chosen, issues, limit, page, search_count, data, isSpin , status_type , issueFlag, checkAll, allValue, category } = this.state; + const { projectsId, meilid ,owner} = this.props.match.params; + const { current_user , showLoginDialog , projectDetail } = this.props; + const menu = ( + this.getOption(e)}> + 最新创建 + 最早创建 + 最新更新 + 最早更新 + + ) + return ( +
    + +
    +

    {data && data.name}

    +

    + + + + { + data && data.effective_date ? + {data && data.effective_date} + : + 暂无截止时间 + } + + {data && (data.percent || data.percent===0) ? {data.percent > 0 ? data.percent.toFixed(2):data.percent}%完成 :"" } +

    +
    +
    + { + (current_user && current_user.login) && ( projectDetail && projectDetail.permission && projectDetail.permission !== "Reporter") ? + 编辑里程碑 + :"" + } + { + issueFlag ? (current_user && current_user.login ? + + :) + :"" + } +
    +
    + + +
    +
    + + { + allValue && allValue.length>0 ? + 选择{allValue.length}个issue + : +
      +
    • this.category("all")}>全部{total}
    • +
    • this.category("opened")}>开启中{openedCount}
    • +
    • this.category("closed")}>已关闭{closedCount}
    • +
    + } +
    +
    + 0} + owner={owner} + projectsId={projectsId} + chooseFunc={chooseFunc} + /> + { + allValue && allValue.length>0 ? +
    + + + +
    + :"" + } +
    +
    + {/*
    +
    +
      +
    • this.openorder("1")}>{data && data.open_issues_count}个开启中
    • +
    • this.openorder("2")}>{data && data.close_issues_count}个已关闭
    • +
    +
      +
    • + + {this.state.issue_tag_ids} + +
    • +
    • + + {this.state.author_ids} + +
    • +
    • + + {this.state.assigned_to_ids} + +
    • +
    • + + {this.state.tracker_ids} + +
    • +
    • + + {this.state.status_ids} + +
    • +
    • + + {this.state.done_ratios} + +
    • +
    • + + {this.state.paix} + +
    • +
    +
    +
    + { + search_count === 0 ? + + : + issues && issues.length>0 && issues.map((item,key)=>{ + return( + + ) + }) + } +
    + { + search_count > limit? +
    + +
    :"" + } +
    */} +
    +
    + ) + } +} +export default MilepostDetail; \ No newline at end of file diff --git a/src/forge/Order/Nav.js b/src/forge/Order/Nav.js index 3f5a20c59..c3f967184 100644 --- a/src/forge/Order/Nav.js +++ b/src/forge/Order/Nav.js @@ -1,6 +1,6 @@ import React , { Component } from "react"; import { NavLink } from 'react-router-dom'; -import './order.css' +import './order.scss' class Nav extends Component{ render(){ diff --git a/src/forge/Order/OrderItem.js b/src/forge/Order/OrderItem.js index 4455d7bad..0da644c28 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,Tooltip } from 'antd' import { TagInfo } from '../Utils/TagColor'; class OrderItem extends Component { constructor(props) { @@ -84,7 +84,9 @@ class OrderItem extends Component { }
  • {item.tracker || "--"}
  • - { !mile ?
  • {item.version || "--"}
  • :""} + {!mile ?
  • + {item.version ? {item.version} : "--"} +
  • : ""}
  • {item.issue_status || "--"}
  • {item.done_ratio || "--"}
  • diff --git a/src/forge/Order/Tags.js b/src/forge/Order/Tags.js index 221db711c..4082c022a 100644 --- a/src/forge/Order/Tags.js +++ b/src/forge/Order/Tags.js @@ -76,11 +76,6 @@ class Tags extends Component { componentDidMount = () => { this.getList(); - const {projectDetail} = this.props; - if(projectDetail){ - const { author, name} = projectDetail; - document.title = `标签列表-${author.name}/${name}`; - } } @@ -110,7 +105,6 @@ class Tags extends Component { const url = `/projects/${owner}/${projectsId}/labels.json`; axios.post(url, { ...values, - project_id: projectsId, color: this.state.textcolor }).then(result => { if (result) { diff --git a/src/forge/Order/UpdateMilepost.js b/src/forge/Order/UpdateMilepost.js index c4f386575..4bb410409 100644 --- a/src/forge/Order/UpdateMilepost.js +++ b/src/forge/Order/UpdateMilepost.js @@ -2,7 +2,7 @@ import React, { Component } from 'react'; import { Calendar, Select, Radio, Col, Row, Divider, Input, Form, Spin } from 'antd'; import axios from 'axios'; import moment from 'moment'; -import '../Order/order.css'; +import '../Order/order.scss'; const TextArea = Input.TextArea; @@ -22,6 +22,20 @@ class UpdateMilepost extends Component { this.getmeil(); } + componentDidUpdate=()=>{ + this.updateDocumentTitle(); + } + + // 更新网页标题 + updateDocumentTitle(){ + const {projectDetail} = this.props; + const {data} = this.state; + if(projectDetail && data){ + const { author, name} = projectDetail; + document.title = `${data.name}-里程碑-${author.name}/${name}`; + } + } + onPanelChange = (time, mode) => { this.setState({ value: time @@ -53,7 +67,6 @@ class UpdateMilepost extends Component { name: result.data.name, description: result.data.description }); - } }).catch((error) => { console.log(error); @@ -79,8 +92,8 @@ class UpdateMilepost extends Component { }).then(result => { if (result) { this.setState({ isSpin: false }) - this.props.history.push(`/${owner}/${projectsId}/milestones`); - + window.scrollTo(0,0); + this.props.history.push(`/${owner}/${projectsId}/milestones/${meilid}`); } }).catch(error => { @@ -120,7 +133,7 @@ class UpdateMilepost extends Component { required: true, message: '请输入标题' }], })( - + )}
  • @@ -131,8 +144,7 @@ class UpdateMilepost extends Component { required: true, message: '请输入描述内容' }], })( -