<template>
  <div class="left2-container">
    <InfoHeader
      name="维修电梯数统计"
      eName="Statistics of Maintenance Qualification Rate"
    ></InfoHeader>
    <InfoContent height="2.8rem">
      <LineCharts
        chartId="rescue1ssssse"
        :chartLineXData="chartLineXData"
        :chartSettingData="chartSettingData"
        :chartLineYData="chartLineYData"
      ></LineCharts>
    </InfoContent>
  </div>
</template>

<script>
import InfoHeader from "@/components/infoHeader";
import InfoContent from "@/components/infoContent";
import PieChart from "@/components/pieEcharts";
import LineCharts from "@/components/lineCharts";
import { getWorkInfoTrend } from "@/api/elevator";
export default {
  components: {
    InfoHeader,
    InfoContent,
    LineCharts,
    PieChart,
  },
  data() {
    return {
      chartSettingData: {
        lineColor: "#06FCEB",
        areaColor: "#06FCEB",
        seriesName: "电梯数",
        height: "3.4rem",
        showYaxis: true,
      },
      chartLineXData: [
        "1月",
        "2月",
        "3月",
        "4月",
        "5月",
        "6月",
        "7月",
        "8月",
        "9月",
        "10月",
        "11月",
        "12月",
      ],
      chartLineYData: [],
    };
  },

  created() {
    this.getWorkInfoTrendApi();
  },
  methods: {
    getWorkInfoTrendApi() {
      getWorkInfoTrend().then((res) => {
        this.chartLineYData = res.data.map((item) => item.elevatorTotal);
      });
    },
  },
};
</script>
<style lang="scss" scoped>
.left2-container {
  position: fixed;
  top: 8.5rem;
  left: 0.22rem;
  width: 31%;
  pointer-events: all;
  .title1 {
    background-image: url("../../../assets/images/biaoti-bck.png");
    width: 1.875rem;
    height: 0.375rem;
    line-height: 0.375rem;
    margin: 0 auto;

    font-size: 0.2rem;
    color: white;
  }
  .order {
    background: url("../../../assets/images/tiling_bck_24.png");
    background-repeat: no-repeat;
    background-size: 100% 100%;
    height: 3.25rem;
    .item {
      margin: 0.375rem 0;
      .num-title {
        font-size: 0.3rem;
        color: white;
      }
      .num-value {
        font-size: 0.36rem;
        color: white;
        margin-left: 0.15rem;
      }
    }
  }
}
</style>
