import React from 'react' import { toJS } from 'mobx' import { inject, observer, } from 'mobx-react' import { WeaTop, WeaAlertPage, WeaBrowser } from 'ecCom' import { Spin, } from 'antd'; import { i18n } from '../../public/i18n'; import '../../style/import.css'; import { addContentPath } from '../../util/index.js'; import StepDialog from './stepDialog'; import { renderNoright } from '../../util'; @inject("newImport") @observer export default class newImport extends React.Component { constructor(props) { super(props); this.state = ({ title: '数据导入', }) } componentDidMount() { const {newImport} = this.props; newImport.getHasRight(); } componentWillMount() { } getImportCard = () => { const { newImport } = this.props, { isMouseOver, curIndex, cardConfig, setMouseStatus, } = newImport; let arr = []; cardConfig.map((c, index) => { arr.push(
setMouseStatus(index, true)} onMouseLeave={() => setMouseStatus(index, false)}>
{curIndex == index && isMouseOver ? this.getLinkName(c.linkName, index) : this.getIcon(c.icon)} {curIndex == index && isMouseOver ? this.getSubTitle(c.subTitle, c.url) : this.getTitle(c.title)}
) }); return arr; } getIcon = (icon) => { return (
) } getTitle = (title) => { return (
{title}
) } getLinkName = (linkName, index) => { return (
this.handleClick(index)} style={{ color: '#fff', textDecoration: 'underline', fontSize: 15 }}>{linkName}
) } getSubTitle = (subTitle, url) => { return (
{subTitle}
) } handleClick = (index) => { const { newImport } = this.props, { } = newImport; switch (index) { case 0: newImport.importType = 'company'; break; case 1: newImport.importType = 'department'; break; case 2: newImport.importType = 'jobtitle'; break; case 3: newImport.importType = 'resource'; break; case 4: newImport.importType = 'joblevel'; break; } newImport.buttonTitle = i18n.button.nextStep(); newImport.current = 0; newImport.visible = true; newImport.getImportField(); } render() { const { newImport, } = this.props, { visible, hasRight } = newImport, { title, } = this.state; if (hasRight === false) { return renderNoright(); } return ( hasRight && } iconBgcolor='#217346' loading={true} showDropIcon={true} >
{this.getImportCard()}
{visible && }
) } }