Commit 79238d23 authored by 崔佳豪's avatar 崔佳豪

fix: 引导页添加使用分析入口

parent 11194a89
This diff was suppressed by a .gitattributes entry.
......@@ -14,6 +14,8 @@ import LoginAction from '../user/login/login';
import styles from './index.less';
import { useHistory } from '@wisdom-utils/runtime';
import { initMicroApps } from '@/micro';
import usingIcon from '@/assets/bootPage/using-icon.png';
import { appService } from '@/api';
const industries = [
{ name: '供水', type: '供水', subTitle: 'WATER SUPPLY' },
......@@ -58,8 +60,8 @@ const renderIndustries = (config, callback) =>
let loginAction = null;
const BootPage = props => {
const [loadding, setLoadding] = useState(false);
const [hasRole, setHasRole] = useState(false);
const [scale, setScale] = useState(1);
const history = useHistory();
useDocumentTitle(
......@@ -105,7 +107,7 @@ const BootPage = props => {
useEffect(() => {
window.addEventListener('resize', handleResize);
loginAction = new LoginAction(props);
loginAction.events.on('toggleIndustry', async (event) => {
loginAction.events.on('toggleIndustry', event => {
setLoadding(false);
props.history.push(`/?client=${props.global.client}`);
initMicroApps();
......@@ -126,10 +128,26 @@ const BootPage = props => {
);
const intl = useIntl();
// const toOMSUsingAnalysis = e => {
// e && e.stopPropagation();
// props.history.push(`/omsUsingAnalysis`);
// }
const toOMSUsingAnalysis = e => {
e && e.stopPropagation();
props.history.push(`/usingAnalysis`);
};
useEffect(() => {
appService.getUserInfo({
token: props.global.token,
subOID: 'subOID',
site: 'cloud',
ignoreSite: true,
})
.then(res => {
const roles = res && !res.errMsg ? res.roles : null;
const _hasRole = roles && Array.isArray(roles) && roles.filter(r => {
return r.name == '客户运维管理员';
}).length;
setHasRole(!!_hasRole);
});
}, []);
return (
<SecurityLayout>
......@@ -171,11 +189,14 @@ const BootPage = props => {
<Spin spinning={loadding} size="large" />
</Space>
</div>
{/* <div class={styles['cloud-using-anaylysis-btn']}>
<div class="" onClick={toOMSUsingAnalysis}>
<span>平台使用分析</span>
{hasRole ? (
<div className={styles.cloudMonitorBtns}>
<div class="cloud-using-anaylysis-btn" onClick={toOMSUsingAnalysis}>
<img src={usingIcon} alt="" title="点击查看平台使用监控" />
<span>平台使用分析</span>
</div>
</div>
</div> */}
) : null}
</div>
</SecurityLayout>
);
......
......@@ -127,7 +127,7 @@
transform: translate(-50%, -50%);
}
.cloud-using-anaylysis-btn {
.cloudMonitorBtns {
position: fixed;
height: 120px;
width: 100%;
......@@ -135,11 +135,27 @@
padding: 0 20px;
display: flex;
justify-content: end;
cursor: pointer;
color: #fff;
font-size: 20px;
:global {
.cloud-using-anaylysis-btn {
cursor: pointer;
width: 100px;
display: flex;
flex-direction: column;
justify-content: center;
& > img {
width: 50px;
margin: 0 25px;
}
& > span {
color: #fff;
font-size: 14px;
width: 100%;
text-align: center;
}
}
}
}
}
@media screen and (max-width: 1440px) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment