<template>
    <div :style="menuPageCss" class="pages page-layout">
        <LayoutHeader v-if="menuPage!=='left'"></LayoutHeader>
        <LayoutHeaderLeft @toggle="toggle" :isOpen="isOpen" v-if="menuPage==='left'" />
        <router-view :class="{'active': !isOpen}" />
    </div>
</template>
<script>
import LayoutHeader from "../components/Header";
import LayoutHeaderLeft from "../components/HeaderLeft";
const isPC = /(iPhone|iPad|iPod|iOS|Android)/i.test(navigator.userAgent);
//菜单位置：取值： left :菜单在左面， top :菜单在上面
const MenuPage = "left";

export default {
    components: {
        LayoutHeader,
        LayoutHeaderLeft,
    },
    data() {
        return {
            isOpen: isPC,
            menuPage: MenuPage,
        };
    },
    computed: {
        menuPageCss() {
            //左面和顶面菜单切换时，动态计划相关css参数
            return {
                "--padding-top": this.menuPage === "left" ? "60px" : "10px",
                "--margin-left": this.menuPage === "left" ? "200px" : "0px",
            };
        },
    },
    methods: {
        toggle() {
            this.isOpen = !this.isOpen;
        },
    },
};
</script>

<style lang="less">
.page {
    position: relative;
    background: #fff;
    padding: var(--padding-top) 5px 5px 5px;
    margin-left: 60px;
    &.active {
        margin-left: var(--margin-left);
    }
}
.page-layout {
    background: #eee;
}
</style>

<style>
.el-card__body {
  padding: 10px;
}
.el-calendar-table .el-calendar-day {
  height: 70px;
}
.is-selected {
  color: #fa3b19;
}
</style>

<style lang="scss" scoped>
.mytree ::v-deep {
  .el-tree--highlight-current
    ::v-deep
    .el-tree-node.is-checked
    > .el-tree-node__content {
    background-color: rgb(255, 255, 255);
    color: rgb(64, 158, 255);
  }
  .el-tree--highlight-current
    ::v-deep
    .el-tree-node.is-current
    > .el-tree-node__content {
    background-color: rgb(255, 255, 255);
    color: rgb(64, 158, 255);
  }
  .el-tree > .el-tree-node:after {
    border-top: none;
  }
  .el-tree-node {
    position: relative;
    padding-left: 16px;
  }
  //节点有间隙，隐藏掉展开按钮就好了,如果觉得空隙没事可以删掉
  .el-tree-node__expand-icon.is-leaf {
    display: none;
  }
  .el-tree-node__children {
    padding-left: 16px;
  }

  .el-tree-node :last-child:before {
    height: 38px;
  }

  .el-tree > .el-tree-node:before {
    border-left: none;
  }

  .el-tree > .el-tree-node:after {
    border-top: none;
  }

  .el-tree-node:before {
    content: "";
    left: -4px;
    position: absolute;
    right: auto;
    border-width: 1px;
  }

  .el-tree-node:after {
    content: "";
    left: -4px;
    position: absolute;
    right: auto;
    border-width: 1px;
  }

  .el-tree-node:before {
    border-left: 1px dashed #4386c6;
    bottom: 0px;
    height: 100%;
    top: -26px;
    width: 1px;
  }

  .el-tree-node:after {
    border-top: 1px dashed #4386c6;
    height: 20px;
    top: 12px;
    width: 24px;
  }

}
</style>


