<template>
  <div class="main-data building-dialog-area" @click.stop="preventDefault" @mouseleave="leaveFun">
    <div class="dialog-title">
      <img
        src="@/assets/images/main/cont_title_bg.png"
      />
      <div class="title">物业巡更信息</div>
    </div>
    <div class="dialog-cont">
      <div class="dialog-left">
        <div class="dialog-list">
          <div class="dialog-item wid100">
            <div class="content-title">
              <span class="title">人员进出数据</span>
            </div>
            <div class="data-chart">
              <bar-chart
                :chart-data="personInOutBarData"
                :x-axis="personInOutBarAxis"
                :yAxis="personInOutBarYaxis"
                :legend="personInOutBarLegend"
                :grid="barGrid"
                y-color="#FFF"
                l-color="#FFF"
                width="515px"
                height="180px"
              />
            </div>
          </div>
        </div>

        <div class="dialog-list">
          <div class="dialog-item wid100">
            <div class="content-title">
              <span class="title">各单位人员进出数据</span>
            </div>
            <div class="data-chart">
              <bar-chart
                :chart-data="departmentPersonInOutBarData"
                :x-axis="departmentPersonInOutBarAxis"
                :yAxis="departmentPersonInOutBarYaxis"
                :legend="departmentPersonInOutBarLegend"
                :grid="barGrid"
                y-color="#FFF"
                l-color="#FFF"
                width="515px"
                height="180px"
              />
            </div>
          </div>
        </div>

        <div class="dialog-list">
          <div class="dialog-item wid100">
            <div class="content-title">
              <span class="title">访客信息</span>
            </div>
            <div class="content">
              <div class="table-cont">
                <div class="table-top">
                  <div class="fir">序号</div>
                  <div class="snd">姓名</div>
                  <div class="thd">时间</div>
                  <div class="fou">访客部门</div>
                </div>
                <div class="table-bot">
                  <div class="table-list" v-for="(item,index) in visitorDataList" :key="index">
                    <div class="fir">{{index+1}}</div>
                    <div class="snd">{{item.name}}</div>
                    <div class="thd">{{item.time}}</div>
                    <div class="fou">{{item.department}}</div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>

      </div>
    </div>
  </div>
</template>

<script>
import LineChart from "@/components/Echarts/LineChart";
import PieChart from "@/components/Echarts/PieChart";
import BarChart from "@/components/Echarts/BarChart.vue";
import echarts from "echarts";

export default {
  name: "BuildingSaveDialog",
  components: {
    BarChart,
    PieChart,
    LineChart,
  },
  props: {},
  data() {
    return {
      personInOutBarData: [
        {
          name: "员工",
          type: "bar",
          itemStyle: {
            color: "#43DCDB",
            //barBorderRadius: [10, 10, 0, 0], // 统一设置四个角的圆角大小
          },
          barWidth: 10,
          data: [110, 120, 130, 140, 150, 160, 155, 145, 135, 125, 115, 15],
        },
        {
          name: "访客",
          type: "bar",
          itemStyle: {
            color: "#FFD296",
            //barBorderRadius: [10, 10, 0, 0], // 统一设置四个角的圆角大小
          },
          barWidth: 10,
          data: [10, 20, 30, 40, 50, 60, 55, 45, 35, 25, 15, 5],
        },
      ],
      personInOutBarAxis: {
        type: "category",
        data: [
          "01月",
          "02月",
          "03月",
          "04月",
          "05月",
          "06月",
          "07月",
          "08月",
          "09月",
          "10月",
          "11月",
          "12月",
        ],
        axisLabel: {
          color: "white", // 设置横坐标轴字体颜色为红色
        },
        axisLine:{
          show:true,
          lineStyle:{
            color:"#08595B"
          }
        },
        axisTick: {
          show: false,
        },
        splitArea:false
      },
      personInOutBarYaxis: {
        type: "value",
        boundaryGap: [0, 0.01],
        name: '人',
        nameTextStyle: {
          color: '#fff',
        },
        axisLine:{
          show:false
        },
        axisLabel: {
          color: "white", // 设置横坐标轴字体颜色为红色
        },
        splitLine: {
          show: false,
        },
        axisTick: {
          show: false,
        },
        splitArea:false
      },
      personInOutBarLegend: {
        top: 0,
        orient: "horizontal",
        right: 0,
        itemWidth: 17, // 设置图例标记的宽度
        itemHeight: 10, // 设置图例标记的高度
        textStyle: {
          color: "#FFF",
        },
      },
      barGrid: {
        top: 30,
        left: "2%",
        right: "2%",
        containLabel: true,
        bottom: 0,
      },
      departmentPersonInOutBarData: [
        {
          name: "员工",
          type: "bar",
          itemStyle: {
            color: "#43DCDB",
            //barBorderRadius: [10, 10, 0, 0], // 统一设置四个角的圆角大小
          },
          barWidth: 20,
          data: [110,  150, 160, 135, 115, 15],
        },
        {
          name: "访客",
          type: "bar",
          itemStyle: {
            color: "#FFD296",
            //barBorderRadius: [10, 10, 0, 0], // 统一设置四个角的圆角大小
          },
          barWidth: 20,
          data: [10, 20, 30, 40, 50, 60, 55, 45, 35, 25, 15, 5],
        },
      ],
      departmentPersonInOutBarAxis: {
        type: "category",
        data: [
          "财务资产部",
          "离退休工作部",
          "后勤保障部",
          "物资管理部",
          "数字化工作部",
          "纪委办公室",
        ],
        axisLabel: {
          interval: 0,
          color: "white", // 设置横坐标轴字体颜色为红色
        },
        axisLine:{
          show:true,
          lineStyle:{
            color:"#08595B"
          }
        },
        axisTick: {
          show: false,
        },
        splitArea:false
      },
      departmentPersonInOutBarYaxis: {
        type: "value",
        boundaryGap: [0, 0.01],
        name: '人',
        nameTextStyle: {
          color: '#fff',
        },
        axisLine:{
          show:false
        },
        axisLabel: {
          color: "white", // 设置横坐标轴字体颜色为红色
        },
        splitLine: {
          show: false,
        },
        axisTick: {
          show: false,
        },
        splitArea:false
      },
      departmentPersonInOutBarLegend: {
        top: 0,
        orient: "horizontal",
        right: 0,
        itemWidth: 17, // 设置图例标记的宽度
        itemHeight: 10, // 设置图例标记的高度
        textStyle: {
          color: "#FFF",
        },
      },
      visitorDataList: [
        {
          name: "于俊",
          time: "2024 / 11 / 15 15:01",
          department: "财务资产部",
        },
        {
          name: "于俊",
          time: "2024 / 11 / 15 14:58",
          department: "财务资产部",
        },
        {
          name: "于俊",
          time: "2024 / 11 / 15 14:55",
          department: "财务资产部",
        },
        {
          name: "于俊",
          time: "2024 / 11 / 15 14:01",
          department: "财务资产部",
        },
      ],
    };
  },
  created() {

  },
  destroyed() {},
  beforeDestroy() {},
  mounted() {},
  methods: {

    //鼠标移出
    leaveFun(){
      setTimeout(()=>{
        this.$emit("closeDialog")
      },200)
    },

    preventDefault() {
      console.log(11)
    }
  },
};
</script>

<style lang="scss">
.building-dialog-area {
  overflow: hidden;
  width: 580px;
  height:1000px;
  background: url("../../../assets/images/main/main_bg.png") no-repeat;
  background-size: 100% 100%;
  padding: 19px 15px 11px 15px;

  .dialog-title {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-bottom: 10px;
    img {
      width: 284px;
      height: 32px;
    }
    .title {
      font-size: 20px;
      font-weight: 900;
      font-family: "PingFangSC";
      width: 100%;
      position: absolute;
      display: flex;
      align-items: center;
      justify-content: center;
      top: -5px;
      color: #fff;
    }
  }

  .dialog-cont {
    width:100%;
    height: 920px;
    padding: 15px;
    overflow-y: scroll;
    background: url("../../../assets/images/main/components_long_bg.png") no-repeat;
    background-size: 100% 100%;

    .dialog-left{
      width: 520px;
      float: left;
    }
    .dialog-right{
      width: 520px;
      float: right;
    }
  }

  .dialog-list{
    width: 100%;
    display: flex;
    justify-content: space-between !important;
    margin-bottom:20px;

    .dialog-item{
      width: calc(50% - 20px);
    }

    .dialog-item-cont{
      display: flex;
      justify-content: center;
      align-items: center;
      margin-top:40px;
    }

    .wid100{
      width:100%;

      .content-title{
        width:100%;
        background: url("../../../assets/images/main/title_pro_long.png") no-repeat;
      }
    }
  }

  .content-title {
    width: 100%;
    height: 26px;
    background: url("../../../assets/images/main/title_pro.png") no-repeat;
    background-size: 100% 100%;
    font-family: "PingFangSC";
    font-size: 16px;
    font-weight: bold;
    color: #00ffff;
    padding-left: 25px;
    .title {
      display: block;
      position: relative;
      top:-5px;
    }
  }

  .content {
    margin-top: 20px;
    .title-format {
      display: flex;
      flex-direction: row;
      align-items: center;
      img {
        width: 6px;
        height: 24px;
        margin-right: 6px;
      }
      .title-info {
        display: flex;
        flex-direction: column;
        font-size: 12px;
        color: #ffffff;
        .title-en {
          font-size: 8px;
          color: #ffffff;
          opacity: 0.4;
        }
      }
    }
    .total-data {
      display: flex;
      align-items: baseline;
      color: #19fcde;
      margin-top: 4px;
      .total {
        font-size: 40px;
        font-family: 'electronicFont';
      }
      .unit {
        font-size: 12px;
      }
    }
    .data-content{
      display: flex;
      flex-direction: row;
      align-items: center;
      flex-wrap: wrap;
      .data-item{
        position: relative;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        margin-right: 24px;
        img{
          width: 89px;
          height: 82px;
        }
        .desc{
          font-size: 14px;
          color: #FFFFFF;
          margin-top: 7px;
          opacity: 0.4;
        }
        .data{
          position: absolute;
          top:20px;
          left:0;
          width: 89px;
          font-size: 30px;
          display: flex;
          align-items: center;
          justify-content: center;
          color:#19fcde;
          font-family: 'electronicFont';
        }
      }
      .data-item:nth-child(2n){
        margin-right: 0;
      }
    }
    .data-list {
      display: flex;
      flex: 1;
      flex-direction: row;
      align-items: center;
      justify-content: space-between;
      .data-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        flex: 1;
        border-right: 1px solid rgba(25, 252, 222, 0.2);
        .data-detail {
          display: flex;
          flex-direction: row;
          align-items: baseline;
          color: #00ffff;
          margin-top: 11px;
          font-size: 12px;
          .data {
            font-size: 30px;
            font-family: 'electronicFont';
          }
        }
      }
      .data-item:last-child {
        border-right: none;
      }
    }
    .rate-area{
      position: relative;
      img{
        width: 198px;
        height: 114px;
      }
      .rate{
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        width: 100%;
        position: absolute;
        top: 0;
        left: 0;
        color: #FFF;
        .rate-data{
          display: flex;
          flex-direction: row;
          align-items: baseline;
          color: #FFBA44;
          .data{
            font-family: 'electronicFont';
            font-size: 30px;
          }
          .unit{
            font-size: 12px;
          }
        }
        .desc{
          font-size: 12px;
          width: 58px;
          text-align: center;
        }
      }
    }
  }

  .other-cont{
    display: flex;

    .icon{
      display: block;
      width:70px;
      height:auto;
    }
    .other-info{
      padding-left:2px;

      .desc{
        font-size:12px;
        color:#FFFFFF;
        font-weight: bold;
      }
      .num-info{
        width:100%;
        padding-top:2px;
        display: flex;
        align-items: center;

        .num{
          font-size:30px;
          color:#19FCDE;
          font-weight: bold;
          font-family: "electronicFont";
        }
        .unit{
          font-size:12px;
          color:#00FFFF;
          font-weight: 500;
          position: relative;
          top:4px;
        }
        .mar{
          margin-left: 20px;
        }
      }
    }
  }

  .camera-cont {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;

    .camera-item {
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      position: relative;

      .num-info{
        display: flex;
        justify-content: center;
        align-items: center;

        .num{
          font-size: 30px;
          color: #19FCDE;
          font-weight: bold;
          font-family: "electronicFont";
          padding-left:4px;
        }
        .num2{
          font-size: 30px;
          color: #19FCDE;
          font-weight: bold;
          font-family: "electronicFont";
          padding-left:4px;
          position: absolute;
          top:20px;
        }
        .unit{
          font-size: 12px;
          color: #00ffff;
          font-weight: 500;
          position: relative;
          top:3px;
        }
      }
      .icon{
        display: block;
        width:46px;
        height:auto;
      }
      .icon2{
        display: block;
        width:101px;
        height:auto;
      }
      .title{
        font-size: 12px;
        color: #FFFFFF;
        margin-top:6px;
        font-weight: normal;
      }
    }
  }

  .use-energy{
    width:100%;
    padding:0 15px;

    .use-energy-fir{
      width:100%;
      display: flex;
      align-items: center;
      font-size:14px;
      color:#FFFFFF;
      font-weight: 500;

      .num{
        font-weight: 900;
        color:#00FFFF;
        padding:0 8px;
      }
    }

    .use-energy-snd{
      width:100%;
      margin-top:15px;
      display: flex;
      align-items: center;

      .use-energy-snd-list{
        display: flex;
        align-items: center;

        .icon{
          display: block;
          width:34px;
          height: 34px;
        }
        .use-energy-snd-info{
          padding-left: 4px;

          .desc{
            font-size: 12px;
            color:#FFFFFF;
          }
          .num-info{
            display: flex;
            align-items: center;

            .num{
              font-size: 24px;
              color: #19FCDE;
              font-weight: bold;
              font-family: "electronicFont";
            }
            .unit{
              font-size:12px;
              color:#00FFFF;
              font-weight: 500;
              position: relative;
              top:4px;
              left:2px;
            }
          }
        }
      }
      .use-energy-snd-list:last-child{
        margin-left: 36px;
      }
    }
  }

  .circle-cont{
    width:100%;
    display: flex;
    flex-wrap: wrap;
    padding:0 15px;

    .circle-list {
      width:80px;
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      margin-bottom: 10px;

      .name{
        font-size:12px;
        color:#FFFFFF;
        font-weight: 500;
        padding-top:6px;
        width:100%;
        overflow:hidden;
        text-align: center;
        white-space: nowrap;
      }
    }

    .el-progress__text{
      font-size:12px !important;
      color:#fff !important;
    }
  }

  .table-cont{
    width:100%;

    .table-top{
      width:100%;
      height: 26px;
      background: url("../../../assets/images/building_guarantee/img_11.png") no-repeat;
      background-size: 100% 100%;
      padding:0 25px 0 10px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      font-size:12px;
      color:#00FFFF;
    }
    .table-bot{
      width:100%;

      .table-list{
        width:100%;
        height:38px;
        padding:0 25px 0 10px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-size:12px;
        color:#FFFFFF;
        font-weight: 500;
      }
    }
  }
  .table-cont .fir{
    width:20%;
    text-align: left;
  }
  .table-cont .snd{
    width:20%;
    text-align: left;
  }
  .table-cont .thd{
    width:40%;
    text-align: left;
  }
  .table-cont .fou{
    width:20%;
    text-align: left;
  }


  .data-chart {
    margin-top: 12px !important;
    margin-bottom: 10px !important;
  }

  .tab-cont {
    width: 100%;
    display: flex;
    align-items: center;
    padding-left: 15px;
    padding-bottom: 15px;

    .tab-list {
      width: 127px;
      height: 30px;
      background: url("../../../assets/images/building_guarantee/img_2.png")
      no-repeat;
      background-size: 100% 100%;
      font-family: "PingFangSC";
      font-size: 14px;
      font-weight: 500;
      color: #00ffff;
      padding-left: 15px;
      line-height: 30px;
    }
    .tab-list:last-child {
      margin-left: 20px;
    }
  }


  ::-webkit-scrollbar {
    display: none;
    width: 3px;
    height: 3px;
  }

  ::-webkit-scrollbar-thumb {
    //滑块部分
    // border-radius: 5px;
    background-color: #58cbbb;
  }

  ::-webkit-scrollbar-track {
    //轨道部分
    // box-shadow: inset 0 0 5px #ddd;
    background: #ddd;
    // border-radius: 5px;
  }
}
</style>

