imatrix-ui 2.8.5-tmp1 → 2.8.5-tmp3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,85 @@
1
+ <template>
2
+ <div :class="classObj" class="app-wrapper">
3
+ <div v-if="device==='mobile'&&sidebar.opened" class="drawer-bg" @click="handleClickOutside" />
4
+ <menubar :system-code="systemCode" :collapse="true" class="sidebar-container"/>
5
+ <div class="main-container">
6
+ <breadcrumb v-if="showMenuRoute"/>
7
+ <tab-content/>
8
+ <!-- <app-main /> -->
9
+ </div>
10
+ </div>
11
+ </template>
12
+
13
+ <script>
14
+ import { Menubar, Breadcrumb } from './components'
15
+ import ResizeMixin from './mixin/ResizeHandler'
16
+ import { isShowMenuRoute } from 'imatrix-ui/src/utils/common-util'
17
+ import TabContent from './components/tabs/tab-content'
18
+ import Vue from 'vue'
19
+
20
+ export default {
21
+ name: 'Layout',
22
+ components: {
23
+ Menubar,
24
+ Breadcrumb,
25
+ TabContent
26
+ },
27
+ mixins: [ResizeMixin],
28
+ data() {
29
+ // 是否显示菜单路径,默认是不显示
30
+ const showMenuRoute = isShowMenuRoute()
31
+ return {
32
+ showMenuRoute,
33
+ systemCode: null
34
+ }
35
+ },
36
+ computed: {
37
+ sidebar() {
38
+ return this.$store.state.app.sidebar
39
+ },
40
+ device() {
41
+ return this.$store.state.app.device
42
+ },
43
+ classObj() {
44
+ return {
45
+ hideSidebar: !this.sidebar.opened,
46
+ openSidebar: this.sidebar.opened,
47
+ withoutAnimation: this.sidebar.withoutAnimation,
48
+ mobile: this.device === 'mobile'
49
+ }
50
+ }
51
+ },
52
+ created() {
53
+ this.systemCode = Vue.prototype.customSystem
54
+ console.log('新菜单组件-----systemCode====', this.systemCode)
55
+ },
56
+ methods: {
57
+ handleClickOutside() {
58
+ this.$store.dispatch('closeSidebar', { withoutAnimation: false })
59
+ }
60
+ }
61
+ }
62
+ </script>
63
+
64
+ <style rel="stylesheet/scss" lang="scss" scoped>
65
+ @import "imatrix-ui/src/styles/mixin.scss";
66
+ .app-wrapper {
67
+ @include clearfix;
68
+ position: relative;
69
+ height: 100%;
70
+ width: 100%;
71
+ &.mobile.openSidebar{
72
+ position: fixed;
73
+ top: 0;
74
+ }
75
+ }
76
+ .drawer-bg {
77
+ background: #000;
78
+ opacity: 0.3;
79
+ width: 100%;
80
+ top: 0;
81
+ height: 100%;
82
+ position: absolute;
83
+ z-index: 999;
84
+ }
85
+ </style>