import React from 'react'; import { Button, Tabs, Row, Col, InputNumber, Modal, message } from 'antd'; import { inject, observer } from 'mobx-react'; import { toJS } from "mobx" import { WeaRightMenu, WeaReqTop, WeaNewScroll, WeaTools, WeaAlertPage, WeaDialog, WeaBrowser, WeaLocaleProvider, WeaTop, WeaTab } from "ecCom" import { WeaTableNew, WeaSwitch } from 'comsMobx'; const WeaTable = WeaTableNew.WeaTable; const getKey = WeaTools.getKey; const getLabel = WeaLocaleProvider.getLabel; import RelareExchange from '../common/relateExchange' import TabDiscuss from '../common/TabDiscuss' import RelateWorkFlow from '../common/relateWorkFlow' import RelateDocument from "../common/relateDocument" import TaskSub from '../projectBoard/taskSub' import TaskShare from '../common/sharePage' import TaskInfo from '../common/taskInfo' import RealteCrmDialog from '../dialog/relateCrmDialog' import "../projectBoard/style/slide.less" @observer export default class TaskCard extends React.Component { componentDidMount() { const { taskCardStore, taskid } = this.props; const { getTaskTabs } = taskCardStore; getTaskTabs({taskid: taskid }); } componentWillUnmount() { } componentWillReceiveProps(nextprops) { const { taskCardStore } = this.props; const { clearStatus, getTaskTabs } = taskCardStore; if (this.props.taskid !== nextprops.taskid) { clearStatus(); getTaskTabs({ taskid: nextprops.taskid }); } } render() { const { taskCardStore, callBack } = this.props; const { tabDatas, selectTabKey, loading, taskname, shareStore, hasRight, verified, form, taskid, saveAndReLoadWf } = taskCardStore; if (verified && !hasRight) { return (
{getLabel(2012, "对不起,您暂时没有权限!")}
) } if (verified && hasRight) { const tabDatas1 = toJS(tabDatas); let _this = this; let tabUrl = function (key) { if (tabDatas1) { for (let i = 0; i < tabDatas1.length; i++) { if (tabDatas1[i].id == key && tabDatas1[i].shortname == "taskinfo") { return
} else if (tabDatas1[i].id == key && tabDatas1[i].shortname == "tasksub") { return
} else if (tabDatas1[i].id == key && tabDatas1[i].shortname == "exchange") { return
} else if (tabDatas1[i].id == key && tabDatas1[i].shortname == "taskshare") { return
} else if (tabDatas1[i].id == key && tabDatas1[i].shortname == "req") { return
} else if (tabDatas1[i].id == key && tabDatas1[i].shortname == "doc") { return
} else if (tabDatas1[i].id == key && tabDatas1[i].shortname == "crm") { return
{_this.getReleateCrmOrCpt("crm")}
} else if (tabDatas1[i].id == key && tabDatas1[i].shortname == "cpt") { return
{_this.getReleateCrmOrCpt("cpt")} _this.addCapital(ids, names, datas)} customized={true} hasAdvanceSerach={true}>
} else if (tabDatas1[i].id == key && tabDatas1[i].shortname == "") { if (tabDatas[i].linkurl.indexOf("noright") > -1) { return
{getLabel(2012, "对不起,您暂时没有权限!")}
} else { return tabDatas1[i].linkurl; } } } return "" } }(selectTabKey); return (
} iconBgcolor='#217346' buttons={this.getButtons()} buttonSpace={10} showDropIcon={true} dropMenuDatas={this.getRightMenu()} onDropMenuClick={this.onRightMenuClick.bind(this)} tabDatas={tabDatas} selectedKey={selectTabKey} onChange={this.taskCardChangeTab.bind(this)} >
{ typeof tabUrl === "object" ? tabUrl :