|
@@ -1,61 +1,92 @@
|
|
|
<template>
|
|
|
<a-layout :class="['layout', device]">
|
|
|
- <!-- SideMenu -->
|
|
|
- <a-drawer
|
|
|
- v-if="isMobile()"
|
|
|
- placement="left"
|
|
|
- :wrapClassName="`drawer-sider ${navTheme}`"
|
|
|
- :closable="false"
|
|
|
- :visible="collapsed"
|
|
|
- @close="drawerClose"
|
|
|
- >
|
|
|
+ <template v-if="!isMixMenu()">
|
|
|
+ <!-- SideMenu -->
|
|
|
+ <a-drawer
|
|
|
+ v-if="isMobile()"
|
|
|
+ placement="left"
|
|
|
+ :wrapClassName="`drawer-sider ${navTheme}`"
|
|
|
+ :closable="false"
|
|
|
+ :visible="collapsed"
|
|
|
+ @close="drawerClose"
|
|
|
+ >
|
|
|
+ <side-menu
|
|
|
+ mode="inline"
|
|
|
+ :menus="menus"
|
|
|
+ :theme="navTheme"
|
|
|
+ :collapsed="false"
|
|
|
+ :collapsible="true"
|
|
|
+ ></side-menu>
|
|
|
+ </a-drawer>
|
|
|
+
|
|
|
<side-menu
|
|
|
+ v-else-if="isSideMenu()"
|
|
|
mode="inline"
|
|
|
- :menus="mobileMenus"
|
|
|
+ :menus="menus"
|
|
|
:theme="navTheme"
|
|
|
- :collapsed="false"
|
|
|
+ :collapsed="collapsed"
|
|
|
:collapsible="true"
|
|
|
- @menuSelect="menuSelect"
|
|
|
></side-menu>
|
|
|
- </a-drawer>
|
|
|
|
|
|
- <side-menu
|
|
|
- v-else-if="isSideMenu()"
|
|
|
- mode="inline"
|
|
|
- :menus="menus"
|
|
|
- :theme="navTheme"
|
|
|
- :collapsed="collapsed"
|
|
|
- :collapsible="true"
|
|
|
- ></side-menu>
|
|
|
-
|
|
|
- <a-layout :class="[layoutMode, `content-width-${contentWidth}`]" :style="{ paddingLeft: contentPaddingLeft, minHeight: '100vh' }">
|
|
|
- <!-- layout header -->
|
|
|
- <global-header
|
|
|
- :mode="layoutMode"
|
|
|
- :menus="menus"
|
|
|
- :theme="navTheme"
|
|
|
- :collapsed="collapsed"
|
|
|
- :device="device"
|
|
|
- @toggle="toggle"
|
|
|
- />
|
|
|
+ <a-layout :class="[layoutMode, `content-width-${contentWidth}`]" :style="{ paddingLeft: contentPaddingLeft, minHeight: '100vh' }">
|
|
|
+ <!-- layout header -->
|
|
|
+ <global-header
|
|
|
+ :mode="layoutMode"
|
|
|
+ :menus="menus"
|
|
|
+ :theme="navTheme"
|
|
|
+ :collapsed="collapsed"
|
|
|
+ :device="device"
|
|
|
+ @toggle="toggle"
|
|
|
+ />
|
|
|
|
|
|
- <!-- layout content -->
|
|
|
- <a-layout-content :style="{ height: '100%', margin: '24px 24px 0', paddingTop: fixedHeader ? '64px' : '0' }">
|
|
|
- <multi-tab v-if="multiTab"></multi-tab>
|
|
|
- <transition name="page-transition">
|
|
|
- <route-view />
|
|
|
- </transition>
|
|
|
- </a-layout-content>
|
|
|
+ <!-- layout content -->
|
|
|
+ <a-layout-content :style="{ height: '100%', margin: '24px 24px 0', paddingTop: fixedHeader ? '64px' : '0' }">
|
|
|
+ <multi-tab v-if="multiTab"></multi-tab>
|
|
|
+ <transition name="page-transition">
|
|
|
+ <route-view />
|
|
|
+ </transition>
|
|
|
+ </a-layout-content>
|
|
|
|
|
|
- <!-- layout footer -->
|
|
|
- <a-layout-footer>
|
|
|
- <global-footer />
|
|
|
- </a-layout-footer>
|
|
|
+ <!-- layout footer -->
|
|
|
+ <a-layout-footer>
|
|
|
+ <global-footer />
|
|
|
+ </a-layout-footer>
|
|
|
|
|
|
- <!-- Setting Drawer (show in development mode) -->
|
|
|
- <!-- <setting-drawer v-if="!production"></setting-drawer>-->
|
|
|
- <setting-drawer></setting-drawer>
|
|
|
- </a-layout>
|
|
|
+ <!-- Setting Drawer (show in development mode) -->
|
|
|
+ <!-- <setting-drawer v-if="!production"></setting-drawer>-->
|
|
|
+ <setting-drawer></setting-drawer>
|
|
|
+ </a-layout>
|
|
|
+ </template>
|
|
|
+ <template v-else>
|
|
|
+ <a-layout :class="[layoutMode, `content-width-${contentWidth}`]" :style="{ paddingLeft: contentPaddingLeft, minHeight: '100vh' }">
|
|
|
+ <!-- layout header -->
|
|
|
+ <MixGlobalHeader
|
|
|
+ :mode="layoutMode"
|
|
|
+ :menus="mainMenu.find(item => item.path === '/').children"
|
|
|
+ :theme="navTheme"
|
|
|
+ :collapsed="collapsed"
|
|
|
+ :device="device"
|
|
|
+ @toggle="toggle"
|
|
|
+ />
|
|
|
+ <!-- layout content -->
|
|
|
+ <a-layout-content :style="{ height: '100%', margin: '24px 24px 0', paddingTop: fixedHeader ? '64px' : '0' }">
|
|
|
+ <multi-tab v-if="multiTab"></multi-tab>
|
|
|
+ <transition name="page-transition">
|
|
|
+ <SideMenuRouteView
|
|
|
+ :collapsed="collapsed"
|
|
|
+ :menus="mixMenu"
|
|
|
+ :theme="navTheme" />
|
|
|
+ </transition>
|
|
|
+ </a-layout-content>
|
|
|
+ <!-- layout footer -->
|
|
|
+ <a-layout-footer>
|
|
|
+ <global-footer />
|
|
|
+ </a-layout-footer>
|
|
|
+ <!-- Setting Drawer (show in development mode) -->
|
|
|
+ <!-- <setting-drawer v-if="!production"></setting-drawer>-->
|
|
|
+ <setting-drawer></setting-drawer>
|
|
|
+ </a-layout>
|
|
|
+ </template>
|
|
|
</a-layout>
|
|
|
|
|
|
</template>
|
|
@@ -67,8 +98,10 @@ import { mixin, mixinDevice } from '@/utils/mixin'
|
|
|
import config from '@/config/defaultSettings'
|
|
|
|
|
|
import RouteView from './RouteView'
|
|
|
+import SideMenuRouteView from './SideMenuRouteView'
|
|
|
import SideMenu from '@/components/Menu/SideMenu'
|
|
|
import GlobalHeader from '@/components/GlobalHeader'
|
|
|
+import MixGlobalHeader from '@/components/GlobalHeader/MixGlobalHeader.vue'
|
|
|
import GlobalFooter from '@/components/GlobalFooter'
|
|
|
import SettingDrawer from '@/components/SettingDrawer'
|
|
|
|
|
@@ -80,46 +113,14 @@ export default {
|
|
|
SideMenu,
|
|
|
GlobalHeader,
|
|
|
GlobalFooter,
|
|
|
+ MixGlobalHeader,
|
|
|
+ SideMenuRouteView,
|
|
|
SettingDrawer
|
|
|
},
|
|
|
data () {
|
|
|
return {
|
|
|
production: config.production,
|
|
|
collapsed: false,
|
|
|
- menus: [],
|
|
|
- analysisFinance: {
|
|
|
- 'path': '/mobile/analysisFinance',
|
|
|
- 'name': 'MobileAnalysisFinance',
|
|
|
- 'meta': {
|
|
|
- 'title': '财务指标',
|
|
|
- 'keepAlive': false,
|
|
|
- 'hiddenHeaderContent': false,
|
|
|
- 'target': null,
|
|
|
- 'permission': null
|
|
|
- }
|
|
|
- },
|
|
|
- analysisFinancing: {
|
|
|
- 'path': '/mobile/analysisFinancing',
|
|
|
- 'name': 'MobileAnalysisFinancing',
|
|
|
- 'meta': {
|
|
|
- 'title': '融资指标',
|
|
|
- 'keepAlive': false,
|
|
|
- 'hiddenHeaderContent': false,
|
|
|
- 'target': null,
|
|
|
- 'permission': null
|
|
|
- }
|
|
|
- },
|
|
|
- analysisInvest: {
|
|
|
- 'path': '/mobile/analysisInvest',
|
|
|
- 'name': 'MobileAnalysisInvest',
|
|
|
- 'meta': {
|
|
|
- 'title': '投资指标',
|
|
|
- 'keepAlive': false,
|
|
|
- 'hiddenHeaderContent': false,
|
|
|
- 'target': null,
|
|
|
- 'permission': null
|
|
|
- }
|
|
|
- },
|
|
|
analysisLiquidate: {
|
|
|
'path': '/mobile/analysisLiquidate',
|
|
|
'name': 'MobileAnalysisLiquidate',
|
|
@@ -131,38 +132,28 @@ export default {
|
|
|
'permission': null
|
|
|
}
|
|
|
},
|
|
|
- mobileMenus: [
|
|
|
- {
|
|
|
- 'path': '/dashboard',
|
|
|
- 'name': 'dashboard',
|
|
|
- 'component': {
|
|
|
- 'name': 'RouteView',
|
|
|
- 'props': {
|
|
|
- 'keepAlive': {
|
|
|
- 'default': true
|
|
|
- }
|
|
|
- },
|
|
|
- 'beforeCreate': [
|
|
|
- null
|
|
|
- ],
|
|
|
- 'beforeDestroy': [
|
|
|
- null
|
|
|
- ],
|
|
|
- '__file': 'src/layouts/RouteView.vue',
|
|
|
- '_Ctor': {}
|
|
|
- },
|
|
|
- 'meta': {
|
|
|
- 'title': '指标分析',
|
|
|
- 'icon': 'form',
|
|
|
- 'keepAlive': false,
|
|
|
- 'hiddenHeaderContent': false,
|
|
|
- 'target': null,
|
|
|
- 'permission': 'test:test'
|
|
|
- },
|
|
|
- 'redirect': '/dashboard/workplace',
|
|
|
- 'children': []
|
|
|
+ menus: [],
|
|
|
+ mixMenu: {}
|
|
|
+ }
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ mainMenu: {
|
|
|
+ deep: true,
|
|
|
+ handler (val) {
|
|
|
+ if (this.isMixMenu()) {
|
|
|
+ const that = this
|
|
|
+ const menus = this.mainMenu.find(item => item.path === '/').children
|
|
|
+ this.menus = menus.map(item => {
|
|
|
+ that.mixMenu[item.name] = item
|
|
|
+ return item
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.menus = this.mainMenu.find(item => item.path === '/').children
|
|
|
}
|
|
|
- ]
|
|
|
+ }
|
|
|
+ },
|
|
|
+ sidebarOpened (val) {
|
|
|
+ this.collapsed = !val
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
@@ -180,14 +171,7 @@ export default {
|
|
|
return '80px'
|
|
|
}
|
|
|
},
|
|
|
- watch: {
|
|
|
- sidebarOpened (val) {
|
|
|
- this.collapsed = !val
|
|
|
- }
|
|
|
- },
|
|
|
created () {
|
|
|
- this.menus = this.mainMenu.find(item => item.path === '/').children
|
|
|
- this.setMobileMenus()
|
|
|
this.collapsed = !this.sidebarOpened
|
|
|
},
|
|
|
mounted () {
|
|
@@ -202,24 +186,6 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
- setMobileMenus () {
|
|
|
- if (this.BaseTool.Object.isBlank(this.menus)) {
|
|
|
- return
|
|
|
- }
|
|
|
- const menuJson = JSON.stringify(this.menus)
|
|
|
- if (menuJson.indexOf('财务指标') !== -1) {
|
|
|
- this.mobileMenus[0].children.push(this.analysisFinance)
|
|
|
- }
|
|
|
- if (menuJson.indexOf('融资指标') !== -1) {
|
|
|
- this.mobileMenus[0].children.push(this.analysisFinancing)
|
|
|
- }
|
|
|
- if (menuJson.indexOf('投资指标') !== -1) {
|
|
|
- this.mobileMenus[0].children.push(this.analysisInvest)
|
|
|
- }
|
|
|
- if (menuJson.indexOf('清收指标') !== -1) {
|
|
|
- this.mobileMenus[0].children.push(this.analysisLiquidate)
|
|
|
- }
|
|
|
- },
|
|
|
...mapActions(['setSidebar']),
|
|
|
toggle () {
|
|
|
this.collapsed = !this.collapsed
|