import { inject, observer } from "mobx-react"; import { toJS } from "mobx" import React from 'react'; import { WeaLeftRightLayout, WeaTop, WeaTab, WeaNewScroll, WeaLocaleProvider, WeaBrowser, WeaAlertPage } from 'ecCom'; import { WeaTableNew } from 'comsMobx'; const WeaTable = WeaTableNew.WeaTable; const getLabel = WeaLocaleProvider.getLabel; import '../style/taskCardNew.less'; import ListView from "../../comp/task-view-list"; import { Row, Tooltip, Col, Icon, Modal, message } from "antd"; import { TaskDynamic } from "./TaskDynamic"; import TabDiscuss from '../../common/TabDiscuss' import RelateWorkFlow from '../../common/relateWorkFlow' import RelateDocument from "../../common/relateDocument" import TaskSub from '../../common/taskSub'; import { TabComponent as TabSelf } from '../../common/tabComponent'; import TaskShare from '../../common/sharePage' //import TaskNewInfo from './TaskNewInfo' import RealteCrmDialog from '../../dialog/relateCrmDialog' import ProjectLogDialog from "../../dialog/modifyLogDialog" import ProjectFieldLogDialog from '../../dialog/projectFieldLogDialog'; import ProjectFieldDetailLogDialog from '../../dialog/ProjectFieldDetailLogDialog'; import TaskInfoDialog from '../../dialog/taskDialog' import PrjForm from "../../prjForm.js"; import classnames from 'classnames'; // const rightMenus = [ // [ // { isTop: "1", menuFun: "", menuIcon: "icon-coms-edit", menuName: "编辑", type: "BTN_EDIT" }, // { isTop: "1", menuFun: "", menuIcon: "icon-coms-delete", menuName: "删除", type: "BTN_DELETE" } // ], // [ // { isTop: "1", menuFun: "", menuIcon: "icon-coms-New-Flow", menuName: "添加", type: "BTN_APPEND" }, // { isControl: "1", isTop: "1", menuFun: "", menuIcon: "icon-coms-delete", menuName: "批量删除", type: "BTN_DELETEBATCH" } // ], // [ // { isTop: "1", menuFun: "", menuIcon: "icon-coms-New-Flow", menuName: "添加子任务", type: "BTN_NEWSUB" }, // { isTop: "0", menuFun: "", menuIcon: "icon-coms-Custom", menuName: "显示列定制", type: "BTN_COLUMN" }, // { isTop: "1", type: "searchsAd" } // ], // [ // ], // [ // { isTop: "1", menuFun: "", menuIcon: "icon-coms-New-Flow", menuName: "新建流程", type: "BTN_NEWREQ" } // ], // [ // { isTop: "1", menuFun: "", menuIcon: "icon-coms-New-Flow", menuName: "新建文档", type: "BTN_NEWDOC" } // ], // [ // { isTop: "1", menuFun: "", menuIcon: "icon-coms-New-Flow", menuName: "添加", type: "BTN_APPEND" }, // { isTop: "1", menuFun: "", menuIcon: "icon-coms-delete", menuName: "批量删除", type: "BTN_DELETEBATCH" } // ], // [ // { isTop: "1", menuFun: "", menuIcon: "icon-coms-New-Flow", menuName: "添加", type: "BTN_APPEND" }, // { isTop: "1", menuFun: "", menuIcon: "icon-coms-delete", menuName: "批量删除", type: "BTN_DELETEBATCH" } // ] // ] @inject("taskCardNewStore","taskDynamicStore") @observer class TaskCardNew extends React.Component { static defaultProps = { prefixCls: 'new' }; constructor(props) { super(props); this.state = { selectedKey : "", showdt : false } } componentDidMount(){ const { prjid, taskCardNewStore, hasList, taskid } = this.props; if(hasList){ taskCardNewStore.initData(prjid); }else{ taskCardNewStore.initTaskData(taskid); } } componentWillReceiveProps(nextProps) { if (this.props.prjid !== nextProps.prjid) { const { prjid, taskCardNewStore, hasList, taskid } = nextProps; if(hasList){ taskCardNewStore.initData(prjid); }else{ taskCardNewStore.initTaskData(taskid); } } } render() { const { taskCardNewStore, taskid, hasList, prefixCls, taskInfoStore, prjid, isDialog, taskDynamicStore, delCallBack, fromPortal } = this.props; const { taskinfo, loading, changeTabs } = taskCardNewStore; const { tabDatas, selectTabKey, shareStore, taskLogTableStore, taskFieldLogTableStore, taskFieldDetailLogTableStore, fieldname, fieldinfo, getTaskList, breadcrumb, rightMenu, getTaskForm, initData, initTaskData } = taskCardNewStore; const { getPortalProjectDynamicInfo } = taskDynamicStore; const tabDatas1 = toJS(tabDatas); let _this = this; const titleStyle = { fontSize : "15px" } const height = document.body.offsetHeight - $(".prj-portal-page .wea-new-top-wapper").height() - 57 - 52.4 - $(".task_card_new .task_card_new_l_top").height() - 20 - 30; const scrollHeight = ($(".e9theme-layout-header").length > 0 || $(".e8theme-layout-header").length > 0) ? height - 55 - 22 : height - 15; const { showdt } = this.state; const textdt = showdt ? getLabel('518183','显示动态') : getLabel('518184','隐藏动态'); const classdtArrow = classnames({ 'new-show-dt-arrow': showdt, 'new-show-dt-arrow-r': !showdt }); const classdtLine = classnames('new-dt-container',{ 'new-show-dt-line': showdt, 'new-show-dt-line-r': !showdt }); const classCardL = classnames('task_card_new_l',{ 'task_card_new_l_contents': showdt }) const bWidth = !showdt?"62%":"100%"; const showDynamic = !showdt?"":"none"; const tabRenderNode = { [selectTabKey]: { 'taskinfo':
< ProjectLogDialog ecId={`${this && this.props && this.props.ecId || ''}_ProjectLogDialog@t80d3f`} ref="taskLogDialog" title={getLabel('83926', '任务日志')} tableStore={taskLogTableStore} store={taskCardNewStore} /> { if(hasList){ initData(prjid); }else{ initTaskData(taskid); } getTaskForm({ viewtype: 'view', taskid: taskCardNewStore.taskid }); getPortalProjectDynamicInfo("alltask"); getPortalProjectDynamicInfo("tasklog"); }} />
, 'tasksub':
{ if(hasList){ initData(prjid); }else{ initTaskData(taskid); } }} />
, 'exchange':
, 'taskshare':
, 'req':
, 'doc':
, 'crm':
{_this.getReleateCrmOrCpt("crm")}
, 'cpt':
{_this.getReleateCrmOrCpt("cpt")} _this.addCapital(ids, names, datas)} customized={true} hasAdvanceSerach={true} />
} } const tabRenderHandle = (id, shortname, linkurl) => { if (shortname !== '') { return tabRenderNode[id][shortname] } else if (shortname === "") { if (linkurl.indexOf("noright") > -1) { return
{getLabel(2012, "对不起,您暂时没有权限!")}
} else { return linkurl; } } } let tabUrl = function () { if (tabDatas1) { const prefixCls = 'new-tab-bar-menu' for (let i = 0; i < tabDatas1.length; i++) { if (tabDatas1[i].id == selectTabKey) { if (tabDatas1[i].shortname !== ''){ return ( { rightMenu&&rightMenu.length>1&&
} 1)?'45px':'0px',bottom: '0px',width: '100%'}}> { tabRenderHandle(tabDatas1[i].id, tabDatas1[i].shortname, tabDatas[i].linkurl) }
) }else if (tabDatas1[i].shortname === ""){ return tabRenderHandle(tabDatas1[i].id, tabDatas1[i].shortname, tabDatas[i].linkurl); } } } return "" } }(); if (hasList) { if(taskCardNewStore.taskList.length==0){ return
{getLabel(83553, '暂无数据')}
{ if(hasList){ initData(prjid); if(delCallBack){ delCallBack(); } }else{ initTaskData(taskid); } }} />
} return ( } onCollapse={showLeft => {}} > {/* 任务1 展开收起按钮 */}
{ this.setState(pre => ({ showdt: !pre.showdt })) }}>{textdt}
]} loading={loading} breadcrumb={breadcrumb || [{ name: "#9" }, { name: "#12" }, { name: "#13" }]} />
{taskinfo.subject}
{ taskinfo.hrmid&& taskinfo.hrmid.length>0? window.pointerXY(e)} > : window.pointerXY(e)} > }
0?taskinfo.hrmidname.join(' '):taskinfo.hrmidname}>
{taskinfo.hrmidname&&taskinfo.hrmidname.length>0?taskinfo.hrmidname.join(' '):taskinfo.hrmidname}
{getLabel('15285', '任务负责人')}
{ taskinfo.finish == 100 ? : taskinfo.islater ? : // taskinfo.wks ? : }
{ taskinfo.finish == 100 ? getLabel('23774','已完成') : taskinfo.islater ? getLabel('21984', "已超期") : taskinfo.wks ? getLabel(1979,"未开始") : getLabel('1960','进行中') }
{getLabel('1929','当前状态')}
{taskinfo.islandmark == 0 ? getLabel('30587', '否') : getLabel('163', '是')}
{getLabel('2232', '里程碑任务')}
{taskinfo.begindate ||getLabel('514133','未设置')}~{taskinfo.enddate ||getLabel('514133','未设置')}
{getLabel('518186','开始结束时间')}
changeTabs(v) } />
{ typeof tabUrl === "object" ? tabUrl :