update 深色地图, 从内页打开菜单

This commit is contained in:
2021-07-05 14:43:08 +08:00
parent 9a814faf4b
commit 954e5291a3
4 changed files with 56 additions and 4 deletions

View File

@@ -32,7 +32,7 @@
background-color: @component-background; background-color: @component-background;
@box-shadow-focused: 0 0 0 2px fade(@primary-color, 50%); @box-shadow-focused: 0 0 0 2px fade(@primary-color, 50%);
@control-background: darken(@white, 95%) !important; @control-background: darken(@white, 80%) !important;
&::before, &::before,
&::after { &::after {
content: none; content: none;

View File

@@ -20,6 +20,9 @@ import getDictData from 'util/dic'
import { api } from 'common/api' import { api } from 'common/api'
import { CITY } from 'util/global' import { CITY } from 'util/global'
import auth from 'components/authorized/handler' import auth from 'components/authorized/handler'
import store from 'store'
const { getState } = store
const initialValues = { const initialValues = {
type: 1, type: 1,
@@ -47,6 +50,10 @@ export default class form extends Component {
showIndustry: false, showIndustry: false,
} }
theme = getState('layout').theme
nav = getState('nav').nav
// 表单实例 // 表单实例
form = React.createRef() form = React.createRef()
@@ -69,6 +76,8 @@ export default class form extends Component {
this.fillData({ this.fillData({
record: this.props.record, record: this.props.record,
}) })
console.log(this.nav)
} }
componentWillUnmount() { componentWillUnmount() {
@@ -188,6 +197,7 @@ export default class form extends Component {
mask, mask,
zoom: 12, zoom: 12,
center: result.geocodes[0].location, center: result.geocodes[0].location,
mapStyle: `amap://styles/${this.theme}`,
}) })
this.map.on('click', e => { this.map.on('click', e => {
@@ -540,7 +550,15 @@ export default class form extends Component {
<Auth auth="houseProjectInfo:page"> <Auth auth="houseProjectInfo:page">
<Col> <Col>
<Button.Group> <Button.Group>
<Button>项目管理</Button> <Button
onClick={() =>
window.openContentWindowByMenuName(
'bs_house_project_manage'
)
}
>
项目管理
</Button>
<Tooltip <Tooltip
placement="top" placement="top"
title="重新加载项目列表" title="重新加载项目列表"
@@ -651,7 +669,15 @@ export default class form extends Component {
<Auth auth="houseZone:page"> <Auth auth="houseZone:page">
<Col> <Col>
<Button.Group> <Button.Group>
<Button>片区管理</Button> <Button
onClick={() =>
window.openContentWindowByMenuName(
'bs_house_zone_manage'
)
}
>
片区管理
</Button>
<Tooltip placement="top" title="重新加载片区列表"> <Tooltip placement="top" title="重新加载片区列表">
<Button <Button
icon={<AntIcon type="reload" />} icon={<AntIcon type="reload" />}

View File

@@ -19,7 +19,7 @@ import moment from 'moment'
import { CITY } from 'util/global' import { CITY } from 'util/global'
import store from 'store' import store from 'store'
const { dispatch } = store const { getState, dispatch } = store
const layout = { const layout = {
labelCol: { flex: '150px' }, labelCol: { flex: '150px' },
@@ -45,6 +45,8 @@ export default class building extends Component {
showMap: false, showMap: false,
showKeepWarmMaterialText: false, showKeepWarmMaterialText: false,
theme: getState('layout').theme,
} }
form = React.createRef() form = React.createRef()
@@ -233,6 +235,7 @@ export default class building extends Component {
mask, mask,
zoom: 12, zoom: 12,
center: result.geocodes[0].location, center: result.geocodes[0].location,
mapStyle: `amap://styles/${this.state.theme}`,
}) })
this.map.on('click', e => { this.map.on('click', e => {

View File

@@ -18,6 +18,10 @@ export default class index extends Component {
}) })
} }
componentDidMount() {
window.openContentWindowByMenuName = this.onOpenContentWindowByMenuName
}
componentWillUnmount() { componentWillUnmount() {
this.unsubscribe() this.unsubscribe()
} }
@@ -49,6 +53,25 @@ export default class index extends Component {
) )
} }
onOpenContentWindowByMenuName = name => {
for (const item of this.state.nav) {
for (const menu of item.menu) {
if (menu.name === name) {
this.onOpenContentWindow(menu)
return
}
if (menu.children) {
for (const child of menu.children) {
if (child.name === name) {
this.onOpenContentWindow(child)
return
}
}
}
}
}
}
onOpenContentWindow = menu => { onOpenContentWindow = menu => {
const { id, meta, component, link, redirect, openType } = menu const { id, meta, component, link, redirect, openType } = menu