salary-management-front/pc4mobx/hrmSalary/pages/mySalary/authority.js

43 lines
1.1 KiB
JavaScript
Raw Normal View History

2022-07-12 17:39:57 +08:00
import { observer } from "mobx-react";
import { WeaAlertPage, WeaLocaleProvider } from "ecCom";
import { Spin } from "antd";
const getLabel = WeaLocaleProvider.getLabel;
@observer
export default class Authority extends React.Component {
render() {
const { store } = this.props;
const { loading, hasRight } = store;
const style = {
position: "absolute",
top: "50%",
left: "50%",
marginLeft: -16,
marginTop: -16
};
if (loading) {
return (
<div style={style}>
<Spin ecId={`${this && this.props && this.props.ecId || ""}_Spin@3zw5ih`} spinning={true} size="large"></Spin>
</div>
);
}
if (hasRight) {
return this.props.children;
} else {
return (
<div style={{ height: "100%" }}>
<WeaAlertPage ecId={`${this && this.props && this.props.ecId || ""}_WeaAlertPage@g7alej`}>
<div style={{ color: "#000" }}>
{getLabel(2012, "对不起,您暂时没有权限!")}
</div>
</WeaAlertPage>
</div>
);
}
}
}