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'; ...@@ -14,6 +14,8 @@ import LoginAction from '../user/login/login';
import styles from './index.less'; import styles from './index.less';
import { useHistory } from '@wisdom-utils/runtime'; import { useHistory } from '@wisdom-utils/runtime';
import { initMicroApps } from '@/micro'; import { initMicroApps } from '@/micro';
import usingIcon from '@/assets/bootPage/using-icon.png';
import { appService } from '@/api';
const industries = [ const industries = [
{ name: '供水', type: '供水', subTitle: 'WATER SUPPLY' }, { name: '供水', type: '供水', subTitle: 'WATER SUPPLY' },
...@@ -58,8 +60,8 @@ const renderIndustries = (config, callback) => ...@@ -58,8 +60,8 @@ const renderIndustries = (config, callback) =>
let loginAction = null; let loginAction = null;
const BootPage = props => { const BootPage = props => {
const [loadding, setLoadding] = useState(false); const [loadding, setLoadding] = useState(false);
const [hasRole, setHasRole] = useState(false);
const [scale, setScale] = useState(1); const [scale, setScale] = useState(1);
const history = useHistory(); const history = useHistory();
useDocumentTitle( useDocumentTitle(
...@@ -105,7 +107,7 @@ const BootPage = props => { ...@@ -105,7 +107,7 @@ const BootPage = props => {
useEffect(() => { useEffect(() => {
window.addEventListener('resize', handleResize); window.addEventListener('resize', handleResize);
loginAction = new LoginAction(props); loginAction = new LoginAction(props);
loginAction.events.on('toggleIndustry', async (event) => { loginAction.events.on('toggleIndustry', event => {
setLoadding(false); setLoadding(false);
props.history.push(`/?client=${props.global.client}`); props.history.push(`/?client=${props.global.client}`);
initMicroApps(); initMicroApps();
...@@ -126,10 +128,26 @@ const BootPage = props => { ...@@ -126,10 +128,26 @@ const BootPage = props => {
); );
const intl = useIntl(); const intl = useIntl();
// const toOMSUsingAnalysis = e => { const toOMSUsingAnalysis = e => {
// e && e.stopPropagation(); e && e.stopPropagation();
// props.history.push(`/omsUsingAnalysis`); 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 ( return (
<SecurityLayout> <SecurityLayout>
...@@ -171,11 +189,14 @@ const BootPage = props => { ...@@ -171,11 +189,14 @@ const BootPage = props => {
<Spin spinning={loadding} size="large" /> <Spin spinning={loadding} size="large" />
</Space> </Space>
</div> </div>
{/* <div class={styles['cloud-using-anaylysis-btn']}> {hasRole ? (
<div class="" onClick={toOMSUsingAnalysis}> <div className={styles.cloudMonitorBtns}>
<span>平台使用分析</span> <div class="cloud-using-anaylysis-btn" onClick={toOMSUsingAnalysis}>
<img src={usingIcon} alt="" title="点击查看平台使用监控" />
<span>平台使用分析</span>
</div>
</div> </div>
</div> */} ) : null}
</div> </div>
</SecurityLayout> </SecurityLayout>
); );
......
...@@ -127,7 +127,7 @@ ...@@ -127,7 +127,7 @@
transform: translate(-50%, -50%); transform: translate(-50%, -50%);
} }
.cloud-using-anaylysis-btn { .cloudMonitorBtns {
position: fixed; position: fixed;
height: 120px; height: 120px;
width: 100%; width: 100%;
...@@ -135,11 +135,27 @@ ...@@ -135,11 +135,27 @@
padding: 0 20px; padding: 0 20px;
display: flex; display: flex;
justify-content: end; justify-content: end;
cursor: pointer; :global {
.cloud-using-anaylysis-btn {
color: #fff; cursor: pointer;
font-size: 20px; 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) { @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