Commit bb6dbdc8 authored by 邓晓峰's avatar 邓晓峰

fix: 修复计算容器高度

parent fd2317b0
Pipeline #35101 passed with stages
in 31 minutes 34 seconds
...@@ -11,7 +11,7 @@ export default { ...@@ -11,7 +11,7 @@ export default {
}, },
{ {
name: 'civ_water', name: 'civ_water',
entry: `//${window.location.hostname}:8083/civ_water`, entry: `//${window.location.hostname}:8080/civ_water`,
container: '#micro-container', container: '#micro-container',
activeRule: '/civbase/civ_water', activeRule: '/civbase/civ_water',
}, },
......
import React, { Suspense } from 'react'; import React from 'react';
import { Helmet } from 'react-helmet'; import { Helmet } from 'react-helmet';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { RouteWithSubRoutes, renderRoutes } from '../../utils/routes'; // import { renderRoutes } from 'react-router-config';
import { RouteWithSubRoutes, renderRoutes} from '../../utils/routes'
import BootPage from '../../pages/bootpage';
import { import {
Router, Router,
Switch, Switch,
} from '@wisdom-utils/runtime'; } from '@wisdom-utils/runtime';
import { dyRoutes } from '../../routes/config'; import { dyRoutes } from '../../routes/config';
import { Route } from 'react-router-dom';
const pkg = require('../../../package.json'); const pkg = require('../../../package.json');
const config = require('../../../config/config'); const config = require('../../../config/config');
...@@ -35,12 +38,15 @@ function App(props) { ...@@ -35,12 +38,15 @@ function App(props) {
</Helmet> </Helmet>
<Router basename={config.base || pkg.name.toLocaleLowerCase() || ''}> <Router basename={config.base || pkg.name.toLocaleLowerCase() || ''}>
<Switch> <Switch>
{ {renderRoutes(routes, [])}
{/* <Route path="/industry" component={BootPage}></Route> */}
{/* <Redirect to="/notFound" /> */}
{/* {
routes.map((route, key) => ( routes.map((route, key) => (
<RouteWithSubRoutes key={key} {...route} /> <RouteWithSubRoutes key={key} {...route} />
)) ))
// resultRoutes } */}
}
</Switch> </Switch>
</Router> </Router>
</> </>
......
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
left: 0; left: 0;
z-index: 600; z-index: 600;
height: calc(100% - 46px); height: calc(100% - 46px);
overflow: auto; // overflow: auto;
overflow-x: hidden; overflow-x: hidden;
box-shadow: 2px 0 8px 0 rgb(29 35 41 / 5%); box-shadow: 2px 0 8px 0 rgb(29 35 41 / 5%);
transition: all .2s; transition: all .2s;
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
} }
.sliderMenu { .sliderMenu {
flex: 1 1 0%; flex: 1 1 0%;
overflow: hidden auto; // overflow: hidden auto;
ul { ul {
position: relative; position: relative;
min-height: 100%; min-height: 100%;
...@@ -180,6 +180,10 @@ ...@@ -180,6 +180,10 @@
.basicLayout-content { .basicLayout-content {
position: relative; position: relative;
// margin: 24px 24px 0px 24px; // margin: 24px 24px 0px 24px;
&.hook_web4 {
height: calc(100% - 82px);
margin-top: 98px;
}
} }
.ant-page-header { .ant-page-header {
// padding: 4px 16px; // padding: 4px 16px;
...@@ -299,6 +303,7 @@ ...@@ -299,6 +303,7 @@
& :global { & :global {
.ant-tabs-tab { .ant-tabs-tab {
padding: 7px 0!important; padding: 7px 0!important;
margin: 0 32px 0 0!important;
&:hover { &:hover {
svg path, svg rect, svg circle { svg path, svg rect, svg circle {
fill: @primary-color!important; fill: @primary-color!important;
...@@ -406,6 +411,9 @@ ...@@ -406,6 +411,9 @@
.ant-pro-page-container-children-content { .ant-pro-page-container-children-content {
margin: 0!important; margin: 0!important;
} }
& :global(.ant-pro-page-container-children-content) {
margin: 14px 10px!important
}
.fixedHeader { .fixedHeader {
position: fixed; position: fixed;
......
...@@ -20,6 +20,7 @@ import { ...@@ -20,6 +20,7 @@ import {
Tooltip Tooltip
} from 'antd'; } from 'antd';
import { RouteWithSubRoutes, renderRoutes } from '../utils/routes'; import { RouteWithSubRoutes, renderRoutes } from '../utils/routes';
import { PageContainer } from '@ant-design/pro-layout';
import Icon from '@ant-design/icons'; import Icon from '@ant-design/icons';
import { store } from 'microser-data'; import { store } from 'microser-data';
import classNames from 'classnames'; import classNames from 'classnames';
...@@ -524,7 +525,7 @@ const BasicLayout = props => { ...@@ -524,7 +525,7 @@ const BasicLayout = props => {
</div> </div>
</div> </div>
</aside> </aside>
<div className={layoutStyles.layout}> <div className={layoutStyles.layout} style={{width: 'calc(100% - 100px)'}}>
<Panel <Panel
visible={toggleSystem} visible={toggleSystem}
keyboard keyboard
...@@ -538,7 +539,9 @@ const BasicLayout = props => { ...@@ -538,7 +539,9 @@ const BasicLayout = props => {
onSettingChange={config => updateSettings(config)} onSettingChange={config => updateSettings(config)}
publicPath={`${window.location.origin}/${basename}/theme`} publicPath={`${window.location.origin}/${basename}/theme`}
/> />
<div className={layoutStyles['basicLayout-content']}> <div className={classNames(layoutStyles['basicLayout-content'], {
[layoutStyles['hook_web4']]: location.pathname.startsWith('/civbase/civweb4')
})}>
<div className={layoutStyles['ant-page-container']} style={{paddingTop: '46px'}}> <div className={layoutStyles['ant-page-container']} style={{paddingTop: '46px'}}>
<div className={layoutStyles['ant-pro-page-container-warp']}> <div className={layoutStyles['ant-pro-page-container-warp']}>
<div className={layoutStyles['ant-page-header']} style={{position: 'fixed'}}> <div className={layoutStyles['ant-page-header']} style={{position: 'fixed'}}>
...@@ -562,7 +565,7 @@ const BasicLayout = props => { ...@@ -562,7 +565,7 @@ const BasicLayout = props => {
</div> </div>
</div> </div>
<div className={layoutStyles['menu-item-children']} style={{width: collapse ? 'calc(100% - 46px)': 'calc(100% - 100px)'}}> <div className={layoutStyles['menu-item-children']}>
<Tabs activeKey={tabActiveKey} defaultActiveKey={tabActiveKey} tabBarGutter={30} tabPosition="top" onTabClick={(event) => handleSelectMenuItem(event)}> <Tabs activeKey={tabActiveKey} defaultActiveKey={tabActiveKey} tabBarGutter={30} tabPosition="top" onTabClick={(event) => handleSelectMenuItem(event)}>
{childrenRoutes.map((item, index) => ( {childrenRoutes.map((item, index) => (
<> <>
...@@ -594,7 +597,7 @@ const BasicLayout = props => { ...@@ -594,7 +597,7 @@ const BasicLayout = props => {
</Tabs> </Tabs>
</div> </div>
<div className='ant-pro-grid-content'> {/* <div className='ant-pro-grid-content' style={{width: collapse ? 'calc(100% - 56px)':'calc(100% - 18px)'}}>
<div className="ant-pro-grid-content-children"> <div className="ant-pro-grid-content-children">
<div className={layoutStyles['ant-pro-page-container-children-content']}> <div className={layoutStyles['ant-pro-page-container-children-content']}>
...@@ -608,7 +611,17 @@ const BasicLayout = props => { ...@@ -608,7 +611,17 @@ const BasicLayout = props => {
} }
</div> </div>
</div> </div>
</div> */}
<PageContainer style={{paddingTop: '48px'}}>
{
<div id="micro-container" className="subapp-container">
<Switch>
{props.routes && renderRoutes(props.routes, [])}
</Switch>
</div> </div>
}
</PageContainer>
</div> </div>
</div> </div>
</div> </div>
......
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