middleground_code_v2/src/layout/index.vue

163 lines
3.3 KiB
Vue
Raw Normal View History

2024-03-26 11:18:19 +08:00
<template>
<div
:class="classObj"
class="app-wrapper"
:style="{ '--current-color': theme }"
>
2024-07-02 09:03:23 +08:00
<div class="newVersionSystem">
<new-menu class="newMenuWidth" />
<div class="newMenuAppMain">
<tags-view v-if="showTagsView" />
<app-main />
2024-03-26 11:18:19 +08:00
</div>
</div>
</div>
</template>
<script>
import router from "@/router";
import RightPanel from "@/components/RightPanel";
import notFound from "@/views/error/404";
2024-07-02 09:03:23 +08:00
import {
AppMain,
Navbar,
Settings,
Sidebar,
TagsView,
NewMenu,
} from "./components";
import ResizeMixin from "./mixin/ResizeHandler";
import { mapState } from "vuex";
import variables from "@/assets/styles/variables.scss";
export default {
name: "Layout",
components: {
2024-03-26 11:18:19 +08:00
AppMain,
Navbar,
RightPanel,
2024-03-26 11:18:19 +08:00
Settings,
Sidebar,
TagsView,
2024-07-02 09:03:23 +08:00
NewMenu,
notFound,
},
mixins: [ResizeMixin],
computed: {
...mapState({
theme: (state) => state.settings.theme,
sideTheme: (state) => state.settings.sideTheme,
sidebar: (state) => state.app.sidebar,
device: (state) => state.app.device,
notFound: (state) => state.app.notFound,
conciseMenu: (state) => state.settings.conciseMenu,
needTagsView: (state) => state.settings.tagsView,
2024-07-02 09:03:23 +08:00
showTagsView: (state) => state.settings.showTagsView,
fixedHeader: (state) => state.settings.fixedHeader,
}),
classObj() {
2024-03-26 11:18:19 +08:00
return {
// hideSidebar: !this.sidebar.opened,
openSidebar: this.sidebar.opened,
withoutAnimation: this.sidebar.withoutAnimation,
mobile: this.device === "mobile",
2024-03-26 11:18:19 +08:00
};
},
variables() {
return variables;
},
},
data() {
return {
childrenType: false,
childrenWidth: "1200px",
};
},
methods: {
handleClickOutside() {
this.$store.dispatch("app/closeSideBar", {
withoutAnimation: false,
});
},
},
};
2024-03-26 11:18:19 +08:00
</script>
<style lang="scss" scoped>
@import "~@/assets/styles/mixin.scss";
@import "~@/assets/styles/variables.scss";
.app-wrapper {
@include clearfix;
position: relative;
height: 100%;
width: 100%;
2024-07-02 09:03:23 +08:00
// padding: 0 8px;
background: #ffffff;
&.mobile.openSidebar {
2024-03-26 11:18:19 +08:00
position: fixed;
top: 0;
}
}
2024-07-02 09:03:23 +08:00
.newVersionSystem {
display: flex;
height: 100%;
width: 100%;
}
.newMenuWidth {
width: 114px;
}
.newMenuAppMain {
width: calc(100% - 114px);
overflow: hidden;
background-color: #f5f5f5;
2024-07-02 09:03:23 +08:00
}
.drawer-bg {
background: #000;
opacity: 0.3;
width: 100%;
top: 0;
height: 100%;
position: absolute;
z-index: 999;
}
.defaultMuneStyle {
width: calc(100% - 160px);
margin-left: 160px;
height: 100%;
// padding:10px;
}
.conciseMenuStyle {
width: calc(100% - 70px);
margin-left: 70px;
padding: 10px;
height: 100%;
}
.fixed-header {
position: fixed;
top: 0;
right: 0;
z-index: 9;
width: calc(100% - #{$base-sidebar-width});
transition: width 0.28s;
}
// .hideSidebar .fixed-header {
// width: calc(100% - 54px);
// }
.sidebarHide .fixed-header {
width: 100%;
}
.mobile .fixed-header {
width: 100%;
}
.webConcat {
position: fixed;
top: 50px;
height: calc(100vh - 50px);
width: 100%;
}
2024-03-26 11:18:19 +08:00
</style>