Left.vue 2.41 KB
Newer Older
耿迪迪's avatar
耿迪迪 committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104
<!--
 * @Author: 纪泽龙 jizelong@qq.com
 * @Date: 2022-09-06 10:42:53
 * @LastEditors: 纪泽龙 jizelong@qq.com
 * @LastEditTime: 2022-09-14 11:15:59
 * @FilePath: /danger-manage-web/src/views/indexComponents/Left.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
  <div class="left-wrapper flex" :class="{ active: !show }">
    <div @click="clickShow" class="closeList flex" :class="{ active: !show }">
      <div>
        {{ show ? "收起功能菜单" : "打开功能菜单" }}
      </div>
      <img :src="show ? close : open" alt="" />
    </div>
    <DeviceYx @dangerDeviceChange="dangerDeviceChange"/>
    <WarmChars />
    <DeviceNum />
  </div>
</template>

<script>
import DeviceYx from "@/views/indexComponents/leftComponents/DeviceYx";
import WarmChars from "@/views/indexComponents/leftComponents/WarmChars";
import DeviceNum from "@/views/indexComponents/leftComponents/DeviceNum";
import open from "@/assets/indexImages/open.png";
import close from "@/assets/indexImages/close.png";
export default {
  name: "indexLeft",
  components: {
    DeviceYx,
    WarmChars,
    DeviceNum,
  },
  data() {
    return {
      show: true,
      open,
      close,
    };
  },
  methods: {
    clickShow() {
      this.$emit("clickShow", !this.show);
    },
    domShow(boolean) {
      this.show = boolean;
    },
    dangerDeviceChange(e){
      this.$emit('dangerDeviceChange',e)
    }
  },
};
</script>
<style lang="scss" scoped>
.left-wrapper {
  transition: all 1s;
  left: 0;
  position: absolute;
  z-index:1;
  // 空出一点缝隙,可缩回
  box-sizing: border-box;
  padding: 20px 20px 31px 22px;
  top: 10.74%;
  bottom: 19px;
  background: rgba(2, 19, 37, 0.8);
  width: 426px;
  max-height: 1080px;
  flex-direction: column;
  &.active {
    left: -426px;
  }
  .closeList {
    transition: all 1s;
    position: absolute;
    width: 148px;
    height: 36px;
    font-size: 14px;
    font-weight: 400;
    color: #58faf4;
    background: #021325;
    right: 0px;
    top: -45px;
    justify-content: center;
    align-items: center;
    box-shadow: 0px 0px 10px 1px #58faf4;
    vertical-align: middle;
    cursor: pointer;
    &.active {
      right: -44px;
    }
    &:hover {
      opacity: 0.8;
    }
    img {
      margin-left: 6px;
    }
  }
  > div:last-child {
    flex: 1;
  }
}
</style>