import React, {Component} from 'react'; import {WeaTools, WeaTop, WeaAlertPage, WeaLocaleProvider} from 'ecCom'; import {Spin, Button, message} from 'antd'; const getLabel = WeaLocaleProvider.getLabel; const callApi = WeaTools.callApi; const iconProps = WeaTools.getIconBGC('hrm'); export default class ReplaceSearchPinyin extends Component{ constructor(props){ super(props); this.state = { hasRight: false, spinning: false } } componentDidMount(){ callApi('/api/hrm/resource/getGenSearchPinyinHasRight', 'GET', {}).then(data => { if(data.status == '1') this.setState({hasRight: true}); else this.setState({hasRight: false}); }, error => {this.setState({hasRight: false})}); } doTrans = () => { this.setState({spinning: true}); callApi('/api/hrm/resource/genSearchPinyin', 'POST', {}).then(data => { if(data.status == '1') message.success(getLabel(30700, '操作成功')); else message.error(data.message); this.setState({spinning: false}); }, error => this.setState({spinning: false})); } render(){ return ( } iconBgcolor={iconProps.iconBgcolor}> { this.state.hasRight ?
:
{getLabel(2012, '对不起,您暂时没有权限!')}
}
) } }