-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
431 additions
and
575 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,92 +1,74 @@ | ||
<!-- | ||
@file 框架页布局 | ||
@author BoBo | ||
@author ytyang | ||
@copyright NanJing Anshare Tech .Com | ||
@createDate 2018年11月13日14:50:08 | ||
--> | ||
<template> | ||
<div class="app-wrapper"> | ||
<div :class="classObj" | ||
class="app-wrapper"> | ||
<!-- 导航栏 --> | ||
<Header /> | ||
<!-- 左侧边栏 --> | ||
<div class="main-container"> | ||
<!-- 面包屑导航 --> | ||
<Breadcrumb></Breadcrumb> | ||
<!-- TAB标签页 --> | ||
<!-- <TagsView /> --> | ||
<!-- <Breadcrumb></Breadcrumb> --> | ||
<!-- 包含二级路由,可以继续嵌套子页面 --> | ||
<AppMain /> | ||
</div> | ||
|
||
<el-backtop target=".main-container"></el-backtop> | ||
<div class="elevator"> | ||
<!-- 消息中心 --> | ||
<MessageBox></MessageBox> | ||
</div> | ||
|
||
</div> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import { mapGetters } from 'vuex'; | ||
import MessageBox from '@/components/MessageBox/MessageBox.vue'; | ||
<script> | ||
|
||
import { | ||
AppMain, | ||
Header, // TagsView 暂时去掉tab | ||
} from '@/views/layout/components/index.ts'; | ||
import { Component, Vue, Watch } from 'vue-property-decorator'; | ||
import Breadcrumb from '@/components/Breadcrumb/index.vue'; | ||
import { AppMain, Header } from '@/views/layout/components/index.ts'; | ||
// import Breadcrumb from '@/components/Breadcrumb/index.vue'; | ||
|
||
@Component({ | ||
export default { | ||
name: 'Layout', | ||
data() { | ||
return {}; | ||
}, | ||
components: { | ||
AppMain, | ||
MessageBox, | ||
// TagsView, | ||
Header, | ||
Breadcrumb, | ||
// Breadcrumb, | ||
}, | ||
}) | ||
export default class Layout extends Vue { | ||
created() { | ||
this.$store.dispatch('initFlowTree'); | ||
} | ||
} | ||
computed: { | ||
sidebar() { | ||
return this.$store.state.app.sidebar; | ||
}, | ||
classObj() { | ||
return { | ||
hideSidebar: !this.sidebar.opened, | ||
openSidebar: this.sidebar.opened, | ||
}; | ||
}, | ||
}, | ||
|
||
mounted() { | ||
window.addEventListener('scroll', () => {}); | ||
}, | ||
}; | ||
</script> | ||
|
||
<style rel="stylesheet/scss" lang="scss" scoped> | ||
@import 'src/styles/mixin.scss'; | ||
.app-wrapper { | ||
@include clearfix; | ||
position: relative; | ||
height: 100%; | ||
width: 100%; | ||
background: #eee; | ||
overflow: auto; | ||
.elevator { | ||
position: fixed; | ||
top: 45%; | ||
padding: 0 8px; | ||
border-top-left-radius: 8px; | ||
border-bottom-left-radius: 8px; | ||
margin-top: -140px; | ||
right: 0; | ||
background-color: #fff; | ||
box-shadow: 0px 4px 12px 0px rgba(7, 17, 27, 0.1); | ||
} | ||
height: 100%; | ||
background: #f0f3f7; | ||
// 主体区域 | ||
.main-container { | ||
left: 0px; | ||
top: 80px; | ||
right: 0; | ||
height: auto; | ||
position: absolute; | ||
width: 90%; | ||
margin: 10px auto 10px; | ||
background: #f0f3f7; | ||
padding: 10px 50px; | ||
height: calc(100% - 120px); | ||
} | ||
} | ||
.drawer-bg { | ||
background: #000; | ||
opacity: 0.3; | ||
width: 100%; | ||
top: 0; | ||
height: 100%; | ||
position: absolute; | ||
z-index: 999; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,53 @@ | ||
<!-- | ||
@file 本页面用于加载其他二级路由对应的子页面,被layout/layout.vue引用 | ||
嵌套顺序App.vue->Layout.vue->AppMain.vue | ||
@author BoBo | ||
@author ytyang | ||
@copyright NanJing Anshare Tech .Com | ||
@createDate 2018年11月13日14:48:28 | ||
--> | ||
<template> | ||
<section class="app-main" | ||
ref="appmain" | ||
@scroll="handleScroll"> | ||
<router-view :scrollTop="scrollTop" | ||
:key="key" | ||
@viewScroll="viewScroll" /> | ||
@scroll="handleScroll" | ||
> | ||
<router-view :scrollTop="scrollTop" | ||
:key="key" | ||
@viewScroll="viewScroll" /> | ||
</section> | ||
</template> | ||
<script lang="ts"> | ||
import { Component, Vue, Prop } from 'vue-property-decorator'; | ||
|
||
@Component({ | ||
<script> | ||
export default { | ||
name: 'AppMain', | ||
}) | ||
export default class AppMain extends Vue { | ||
$refs!: { | ||
appmain: HTMLFormElement; | ||
}; | ||
|
||
scrollTop = 0; | ||
|
||
ISPUBLIC = process.env.VUE_APP_ISPUBLIC; | ||
|
||
get cachedViews() { | ||
return this.$store.state.tagsView.cachedViews; | ||
} | ||
|
||
get key() { | ||
return this.$route.fullPath; | ||
} | ||
|
||
// 根据右侧滚动条实时刷新滚动条距离顶部的位置,并通过<router-view>传入子页面 | ||
handleScroll() { | ||
this.scrollTop = this.$refs.appmain.scrollTop; | ||
} | ||
|
||
// 重定位滚动条 | ||
viewScroll(v) { | ||
this.$refs.appmain.scrollTop = v; | ||
} | ||
} | ||
data() { | ||
return { | ||
scrollTop: 0, | ||
ISPUBLIC: process.env.VUE_APP_ISPUBLIC, | ||
}; | ||
}, | ||
computed: { | ||
cachedViews() { | ||
return this.$store.state.tagsView.cachedViews; | ||
}, | ||
key() { | ||
return this.$route.fullPath; | ||
}, | ||
}, | ||
methods: { | ||
// 根据右侧滚动条实时刷新滚动条距离顶部的位置,并通过<router-view>传入子页面 | ||
handleScroll() { | ||
this.scrollTop = this.$refs.appmain.scrollTop; | ||
}, | ||
// 重定位滚动条 | ||
viewScroll(v) { | ||
this.$refs.appmain.scrollTop = v; | ||
}, | ||
}, | ||
}; | ||
</script> | ||
<style lang="scss" scoped> | ||
.app-main { | ||
// padding-top: 16px; | ||
height: 100%; | ||
height:100%; | ||
} | ||
</style> |
Oops, something went wrong.