-
-
Notifications
You must be signed in to change notification settings - Fork 676
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(server-client): impl layout for app
- Loading branch information
Showing
6 changed files
with
108 additions
and
198 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,103 +1,63 @@ | ||
<template> | ||
<div :class="classObj" class="app-wrapper"> | ||
<div v-if="device==='mobile'&&sidebar.opened" class="drawer-bg" @click="handleClickOutside" /> | ||
<sidebar class="sidebar-container" /> | ||
<div :class="{hasTagsView:needTagsView}" class="main-container"> | ||
<div :class="{'fixed-header':fixedHeader}" style="display: flex; justify-content: space-between"> | ||
<tags-view v-if="needTagsView" style="" /> | ||
|
||
<navbar style="width: 220px" /> | ||
<div class="app-wrapper"> | ||
<navbar :title="title" class="fixed-header" /> | ||
<div class="main"> | ||
<div class="sidebar"> | ||
<sidebar class="sidebar-container" /> | ||
</div> | ||
<app-main /> | ||
<!-- <right-panel v-if="showSettings"> | ||
<settings /> | ||
</right-panel> --> | ||
<app-main v-if="app" /> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
// import RightPanel from '@/components/RightPanel' | ||
import { AppMain, Navbar, Sidebar, TagsView } from './components' | ||
import store from '@/store' | ||
import { AppMain, Navbar, Sidebar } from './components' | ||
import ResizeMixin from './mixin/ResizeHandler' | ||
import { mapState } from 'vuex' | ||
import { resetRouter } from '@/router' | ||
export default { | ||
name: 'Layout', | ||
name: 'AppLayout', | ||
components: { | ||
AppMain, | ||
Navbar, | ||
// RightPanel, | ||
// Settings, | ||
Sidebar, | ||
TagsView | ||
Sidebar | ||
}, | ||
mixins: [ResizeMixin], | ||
computed: { | ||
...mapState({ | ||
sidebar: state => state.app.sidebar, | ||
device: state => state.app.device, | ||
showSettings: state => state.settings.showSettings, | ||
needTagsView: state => state.settings.tagsView, | ||
fixedHeader: state => state.settings.fixedHeader | ||
}), | ||
classObj() { | ||
return { | ||
hideSidebar: !this.sidebar.opened, | ||
openSidebar: this.sidebar.opened, | ||
withoutAnimation: this.sidebar.withoutAnimation, | ||
mobile: this.device === 'mobile' | ||
} | ||
title() { | ||
return this.app?.name | ||
}, | ||
app() { | ||
return store.state.app.application | ||
} | ||
}, | ||
async created() { | ||
console.log('app layout created', this.$route) | ||
}, | ||
beforeDestroy() { | ||
resetRouter() | ||
store.dispatch('tagsView/delAllViews') | ||
}, | ||
methods: { | ||
handleClickOutside() { | ||
this.$store.dispatch('app/closeSideBar', { withoutAnimation: false }) | ||
} | ||
} | ||
} | ||
</script> | ||
<style lang="scss" scoped> | ||
@import "~@/styles/mixin.scss"; | ||
@import "~@/styles/variables.scss"; | ||
.app-wrapper { | ||
@include clearfix; | ||
position: relative; | ||
height: 100%; | ||
width: 100%; | ||
&.mobile.openSidebar { | ||
position: fixed; | ||
top: 0; | ||
.sidebar { | ||
} | ||
.main { | ||
padding-top: 50px; | ||
display: flex; | ||
} | ||
} | ||
.drawer-bg { | ||
background: #000; | ||
opacity: 0.3; | ||
width: 100%; | ||
top: 0; | ||
height: 100%; | ||
position: absolute; | ||
z-index: 999; | ||
} | ||
.fixed-header { | ||
position: fixed; | ||
top: 0; | ||
right: 0; | ||
z-index: 9; | ||
width: calc(100% - #{$sideBarWidth}); | ||
transition: width 0.28s; | ||
} | ||
.hideSidebar .fixed-header { | ||
width: calc(100% - 54px) | ||
} | ||
.mobile .fixed-header { | ||
width: 100%; | ||
transition: width 0.28s; | ||
} | ||
</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
88 changes: 0 additions & 88 deletions
88
packages/system-client/src/layout/components/Sidebar/Logo.vue
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.