123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193 |
- <template>
- <el-container >
- <el-aside width="140px" style="margin-bottom: 20px">
- <sidebarA class="sidebar-container" />
- </el-aside>
- <el-container>
- <el-header class="header">
- <!-- 头部 导航 -->
- <navbar :nameshow="nameshow" @helpcenterEvent="showhelp" />
- </el-header>
- <el-main>
- <div :class="{hasTagsView:needTagsView}" class="main-container">
- <div :class="{'fixed-header':fixedHeader}">
- <div style="margin: 10px 0 0 10px">
- <tags-view v-if="needTagsView" />
- <app-main />
- <CozeChat></CozeChat>
- </div>
- </div>
- </div>
- </el-main>
- <right-panel v-if="showSettings">
- <settings />
- </right-panel>
- </el-container>
- </el-container>
- </template>
- <script>
- import RightPanel from '@/components/RightPanel'
- import { AppMain, Navbar, Settings, Sidebar, TagsView, HelpWord,CozeChat } from './components'
- import SubSidebar from './components/subSidebar'
- import ResizeMixin from './mixin/ResizeHandler'
- import sidebarA from './components/SidebarA'
- import { mapState } from 'vuex'
- export default {
- name: 'Layout',
- components: {
- AppMain,
- Navbar,
- RightPanel,
- Settings,
- Sidebar,
- SubSidebar,
- TagsView,
- HelpWord,
- sidebarA,
- CozeChat
- },
- 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'
- }
- }
- },
- data() {
- return {
- sidebarType:1,
- currRouter: null,
- nameshow: false,
- showhelped: false
- }
- },
- methods: {
- handleClickOutside() {
- this.$store.dispatch('app/closeSideBar', {
- withoutAnimation: false
- })
- },
- byChildByParent(currRouter) {
- this.currRouter = currRouter;
- if(currRouter === null) {
- this.nameshow = false
- } else {
- this.nameshow = true
- }
- },
- showhelp(data) {
- this.showhelped = data
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- @import "../styles/mixin.scss";
- @import "../styles/variablesSingleLayer.scss";
- ::v-deep .el-main {
- padding: 0;
- }
- .el-header {
- padding: 0;
- position: fixed;
- width: -webkit-calc(100% - #{$sideBarWidth});
- width: -moz-calc(100% - #{$sideBarWidth});
- width: calc(100% - #{$sideBarWidth});
- top: 0;
- z-index: 1000;
- }
- .el-main {
- margin-top: 50px;
- }
- .app-wrapper {
- @include clearfix;
- position: relative;
- height: 100%;
- width: 100%;
- &.mobile.openSidebar {
- position: fixed;
- top: 0;
- }
- }
- .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%;
- }
- .helpcenter {
- flex: 1.5;
- margin-left: 10px;
- margin-right: -20px;
- margin-top: 10px;
- border-radius: 5px;
- box-shadow: 0 0 5px rgba(100, 100, 100, .2);
- }
- .min_width{
- width: calc(100vw - 250px);
- }
- .max_width{
- width: calc(100vw - 130px);
- }
- .left_main{
- display: flex;
- padding: 0px 20px;
- background-color: #f8f8f8;
- height: calc(100vh - 50px);
- overflow: hidden;
- padding-right: 10px;
- }
- #main_work{
- margin-top: 10px;
- /*overflow-y: scroll;*/
- height: calc(100vh - 100px);
- }
- </style>
|