<template>
  <div class="right1-container">
    <InfoHeader
      name="年度救援数据统计"
      eName="Annual rescue data statistics"
    ></InfoHeader>
    <InfoContent height="5rem">
      <div class="d-flex">
        <LineCharts
          chartId="rescue1s"
          :chartLineYData="chartLineYData"
          :chartLineXData="chartLineXData"
          :chartSettingData="chartSettingData"
        ></LineCharts>
      </div>
    </InfoContent>
  </div>
</template>
  
  <script>
import InfoHeader from "@/components/infoHeader";
import InfoContent from "@/components/infoContent";
import LineCharts from "@/components/lineCharts";
import {getYearRescueAna} from "@/api/elevator";
export default {
  components: {
    InfoHeader,
    InfoContent,
    LineCharts,
  },
  data() {
    return {
      chartSettingData: {
        lineColor: "#46EFF1",
        areaColor: "#2B8E9F",
        seriesName: "次数",
        height: "5.8rem",
      },
      chartLineXData: [
        "1月",
        "2月",
        "3月",
        "4月",
        "5月",
        "6月",
        "7月",
        "8月",
        "9月",
        "10月",
        "11月",
        "12月",
      ],
      chartLineYData: [0, 0, 0, 0, 0, 10, 30, 60, 30, 20, 0, 0],
    };
  },
  created() {
    this.getYearRescueAnaApi();
  },
  methods: {
    getYearRescueAnaApi() {
      getYearRescueAna().then((res) => {

        this.chartLineXData = res.data.map(item=>{
          return `${item.month}月`

        })
        this.chartLineYData = res.data.map(item=>{
          return item.rescumNum

        })
      });
    },
  },
};
</script>
  <style lang="scss" scoped>
.right1-container {
  position: fixed;
  top: 1.25rem;
  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/guzhang_bck.png");
    background-repeat: no-repeat;
    background-size: 100% 35%;
    background-position: bottom;
    height: 3.25rem;
    .rate {
      font-size: 0.55rem;
      color: white;
      font-weight: bolder;
    }
    .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>
  