import React from 'react'; import {inject, observer} from 'mobx-react'; import { WeaTop, WeaTab, WeaRightMenu, WeaErrorPage, WeaFormItem, WeaDialog, WeaSearchGroup, WeaSelect, WeaTree, WeaProgress, WeaAlertPage, WeaLocaleProvider, WeaNewScroll, } from 'ecCom'; import {WeaTableNew} from 'comsMobx'; import {Row, Col, Icon, Button, Spin} from 'antd'; import * as mobx from 'mobx'; import '../style/total.less'; import {InfoGroup4Formal1} from '../coms/infoGroup4Formal'; import {i18n} from '../public/i18n'; import Tabs from "../coms/Tabs"; import findIndex from 'lodash/findIndex'; const toJS = mobx.toJS; const getLabel = WeaLocaleProvider.getLabel; const { WeaTable } = WeaTableNew; @inject('hrmCard') @inject('hrmResourceTotal') @observer class HrmResourceTotal extends React.Component { constructor(props) { super(props); } componentDidMount() { const {hrmResourceTotal, hrmCard} = this.props; const hrmId = this.props.params.hrmId || ''; // hrmCard.setTopRightMenus(this.getRightMenu.bind(this)); hrmResourceTotal.hrmId = hrmId; hrmResourceTotal.getHasRight(); } renderCol = (cols) => { let idx = findIndex(cols, item => item.dataIndex === 'finish'); idx != -1 && (cols[idx].render = (text, record) => { return }) } render() { const {hrmResourceTotal} = this.props; const {title, loading, verified, hasRight, dialogParams, tabConfig, getTabIndex, formTarget, refreshDialog} = hrmResourceTotal; let {condition} = hrmResourceTotal; const {query} = this.props.location; const { conditionForm: form, conditionFormFields: fields } = formTarget; const tabProps = { tabConfig: tabConfig, tabChangeHandle: tabConfig.tabChangeHandle, activeTabInfo: { activeTabKey: tabConfig.activeTabKey, activeTabIndex: getTabIndex(tabConfig.tabs, tabConfig.activeTabKey) }, store: hrmResourceTotal, conditionForm: form, conditionFormFields: fields, tabBtnDef: tabConfig.buttons } const scrollProps = { scroll: { y: 480 } } if (verified && hasRight) { return (
} iconBgcolor='#217346' buttons={[]} buttonSpace={10} showDropIcon={false} >
{ condition && condition.map((c, index) => { if (index == 0) { const colArr = []; c.items && c.items.forEach((obj, index) => { colArr.push( {obj.label ? obj.label :
 
}: {obj.value} { obj.codeName ? this.onSelectHandle(obj, index)}>{getLabel(17463, '明细')} : }
) }) return ( {/* */}
{c.title}
{colArr}
) } }) }
{ condition && condition.map((c, index) => { if (index > 0) { return ( ) } }) }
{ form != null && form.isFormInit && { dialogParams.cType === 'table' ? : } }
); } if (verified && !hasRight) { return (
{i18n.message.authFailed()}
) } return (
) } onSelectHandle(obj, index) { this.props.hrmResourceTotal.onSelectHandle(obj, index); } getRightMenu() { const arr = [{ icon: , content: i18n.button.search() }, { icon: , content: i18n.button.columnVisibleSetting() } ]; return arr; } onRightMenuClick(key) { const {hrmResourceTotal} = this.props; switch (key) { case '0': //hrmResourceTotal.doSearch(); break; case '1': //this.definedColumn(); break; } } } export default HrmResourceTotal