import React, { Component } from 'react'; import { Scrollbars } from "react-custom-scrollbars"; import './index.scss' import ProgressList from './progresList' import NoTask from '../../quadrant/noTask' import progress from '../panelimages/jinzhan.png' import tubiao from '../panelimages/4.png' import {RenderTrackHorizontal,RenderTrackVertical} from '../propsSetting' import { getBSGlobal, getApiUrl, taker } from '&/components/helper'; import ProgressItem from './progressItem' import ReactToolTip from 'react-tooltip' interface Props { gotoOkrLink: Function workId: number toUserId?: number workName: string status: number isSuper: boolean progressDescription?:string progressDescriptionDate?:string principalName: string isSelf: boolean } interface State { progressArray: any[] } export default class FourthQuadrant extends Component { constructor(p:Props){ super(p) this.state = { progressArray: [] } } componentDidMount(){ this.getCurrentProgress(this.props.workId) } componentDidUpdate(prevProps:Props) { if(prevProps.workId != this.props.workId){ this.getCurrentProgress(this.props.workId) } } async getCurrentProgress(workId:number) { let url = getApiUrl (`WorkMileStone/kr/progress?workId=${workId}`); taker (url,"GET").then(res => { if (res.Code == 1 && res.Data) { this.setState ({ progressArray: res.Data || [] }) } else { this.setState ({ progressArray: [] }) } }) } render() { const { gotoOkrLink, workId, toUserId, workName ,principalName,status,isSuper,progressDescription,progressDescriptionDate,isSelf} = this.props const {progressArray} = this.state; const { apiPath } = getBSGlobal() const noTaskConfig = { noTaskText: '请先更新关键成果的进展情况', linkText: '去更新', gotoLink: `${apiPath}/u/${toUserId}/Home#okr/manage?relation=1&work_id=${workId}`, taNoTaskText: "尚未反馈关键成果进展", taLinkText: '提醒ta反馈', workName: workName, workId: workId, status: status, titaimg:progress, tubiao:tubiao, isSuper:isSuper, isSelf } const scrollStyle = { 'height': 'calc(100% - 5px)', 'backgroundColor': 'transparent', 'width': '100%' } return (
当前进展
{!progressArray.length && !progressDescription ? : { !!progressDescription &&
}
}
) } }