<template>
  <div class="header">
        <div class="headertitle">
            <img src="../../assets/images/启东市铁路沿线综合治理信息化管理平台@2x.png" />
        </div>
        <div class="mum">
            <div :class='currentindex==1?"active":""' @click="goTarget(1)">首页</div>
            <div :class='currentindex==7?"active":""' @click="goTarget(7)">交通局简介</div>
            <div :class='currentindex==2?"active":""' @click="goTarget(2)">设施监测</div>
             <div :class='currentindex==6?"active":""' @click="goTarget(6)">综合管理</div>
            <div :class='currentindex==3?"active":""' @click="goTarget(3)">治理态势</div>
            <div :class='currentindex==4?"active":""' @click="goTarget(4)">安全态势</div>
            <div :class='currentindex==5?"active":""' @click="goTarget(5)">公众服务</div>

        </div>
        <div class="time">
            <img src="../../assets/images/图层 9@2x.png" /><span>{{ currenttime }}</span>
        </div>
    </div>
</template>

<script>
import moment from "moment";

export default {
  name: "HeaderDiv",
   props: {
      currentindexP:Number
  },
  data() {
    return {
      // 版本号
      version: "3.8.1",
      currenttime: moment().format("YYYY-MM-DD HH:mm:ss"),
      currentindex:this.currentindexP
    };
  },
   mounted() {
        setInterval(() => {
            this.currenttime = moment().format("YYYY-MM-DD HH:mm:ss");
        }, 1000);
    },
  methods: {
    goTarget(index) {
      if(index == 1){
           this.$router.push('/big')
      }else if(index == 2){
           this.$router.push('/video')
      }else if(index == 3){
           this.$router.push('/governance')
      }else if(index == 4){
           this.$router.push('/safe')
      }else if(index == 5){
           this.$router.push('/public')
      }else if(index == 6){
           this.$router.push('/index')
      }else if(index == 7){
           this.$router.push('/introduction')
      }
    },
  },
};
</script>

<style rel="stylesheet/scss" lang="scss">
.header {
    background: url("../../assets/images/top@2x.png") no-repeat;
    background-size: 100% 100%;
    max-height: 5.2rem;
    position: relative;
    z-index: 1;
    .headertitle {
        margin-left: 1.1rem;
        img {
            width: 41.36rem;
            height: 4.2rem;
        }
    }
    .mum {
        font-size: 1.6rem;
        color: #fff;
        position: absolute;
        top: 1.2rem;
        left: 30%;
        >div {
            display: inline-block;
            margin-right: 7.9rem;
            cursor: pointer;
        }
        .active {
            color: #30FFEA;
        }
        .active::before {
            display: inline-block;
            content: "";
            background: url("../../assets/images/左@2x.png") no-repeat;
            width: 2.2rem;
            height: 1.4rem;
            background-size: 100% 100%;
            margin-right: 0.2rem;
        }
        .active::after {
            display: inline-block;
            content: "";
            background: url("../../assets/images/左@2x.png") no-repeat;
            width: 2.2rem;
            height: 1.4rem;
            background-size: 100% 100%;
            margin-left: 0.2rem;
        }
    }
    .time {
        position: absolute;
        top: 1.2rem;
        right: 4.7rem;
        font-size: 1.6rem;
        color: #fff;
        img {
            width: 2.4rem;
            height: 2.4rem;
            vertical-align: middle;
            margin-top: -0.1rem;
            margin-right: 1.6rem;
        }
    }
}
.bottombg{
  background: url("../../assets/images/底部菜单bg@2x.png");
  position: absolute;
  background-size: 100% 100%;
  z-index: 1;
  width: 85.1rem;
  height: 16.3rem;
  bottom: 0;
  left: 50%;
  transform: translate(-50%,-0%);
  display: flex;
  flex-direction: row;
  align-items: center;
  color:#fff;
  font-size:1.6rem;

  .item:hover{
    cursor: pointer;
  }

  .item{
    width: 33%;
    text-align: center;
    justify-content: center;
    position: relative;
    .num{
      font-size:3rem;
      color:#25f8bd;
    }
  }
   .item1{
    width: 33%;
  }
  .item2::after{
    content: "";
    background: url("../../assets/images/图层\ 2@2x.png");
    background-size: 100% 100%;
    width: 0.2rem;
    height: 7.3rem;
    position: absolute;
    top: 0;
    right: 0;
  }
}
.ol-zoom-in,.ol-zoom-out{
  display: none !important;

}

</style>

