<template>
  <div class="content-app">
    <div class="up">
      <SecurityCheckHeader title="航空货物关联统计" @change="change" />
    </div>
    <div class="content_top">
      <div class="header">
        <p>不同综合风险等级货物对应不同航线比例</p>
      </div>
      <div id="echarts-proportion"></div>
    </div>
    <div class="content_bottom">
      <div class="header">
        <p>不同综合风险等级货物分布比例</p>
      </div>
      <div class="content_classification">
        <div class="chart"><GraphicEchart :id="1" :texter="dataall" /></div>
        <div class="chart"><GraphicEchart :id="2" :texter="datarisk" /></div>
        <div class="chart"><GraphicEchart :id="3" :texter="dataLowrisk" /></div>
        <div class="chart"><GraphicEchart :id="4" :texter="datafirst" /></div>
        <div class="chart">
          <GraphicEchart :id="5" :texter="dataordinary" />
        </div>
        <div class="chart">
          <GraphicEchart :id="6" :texter="datastrictly" />
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import { eleCake } from "@/utils/app-ecahrts";
import GraphicEchart from "../components/graphicHome.vue";
import SecurityCheckHeader from "../components/securityCheckHeader.vue";
export default {
  data() {
    return {
      dataall: {
        name: "总件数",
        cont: "20000",
        top: "35%",
        textStyle: {
          fontSize: "16",
          color: "#ffffff",
        },
        subtextStyle: {
          fontSize: "28",
          fontWeight: "800",
          color: "#ffffff",
        },
        color: ["#E7EBF4", "#6161BD"],
      },
      datarisk: {
        name: "高风险货物级",
        cont: "70%",
        top: "35%",
        textStyle: {
          fontSize: "16",
          color: "#ffffff",
        },
        subtextStyle: {
          fontSize: "28",
          fontWeight: "800",
          color: "#ffffff",
        },
        color: ["#E7EBF4", "#EE50A6"],
      },
      dataLowrisk: {
        name: "低风险货物级",
        cont: "70%",
        top: "35%",
        textStyle: {
          fontSize: "16",
          color: "#ffffff",
        },
        subtextStyle: {
          fontSize: "28",
          fontWeight: "800",
          color: "#ffffff",
        },
        color: ["#E7EBF4", "#F3C742"],
      },
      datafirst: {
        name: "优先级",
        cont: "10%",
        top: "35%",
        textStyle: {
          fontSize: "16",
          color: "#ffffff",
        },
        subtextStyle: {
          fontSize: "28",
          fontWeight: "800",
          color: "#ffffff",
        },
        color: ["#E7EBF4", "#5AC591"],
      },
      dataordinary: {
        name: "普通级",
        cont: "10%",
        top: "35%",
        textStyle: {
          fontSize: "16",
          color: "#ffffff",
        },
        subtextStyle: {
          fontSize: "28",
          fontWeight: "800",
          color: "#ffffff",
        },
        color: ["#E7EBF4", "#70B4D4"],
      },
      datastrictly: {
        name: "严控级",
        cont: "10%",
        top: "35%",
        textStyle: {
          fontSize: "16",
          color: "#ffffff",
        },
        subtextStyle: {
          fontSize: "28",
          fontWeight: "800",
          color: "#ffffff",
        },
        color: ["#E7EBF4", "#E64545"],
      },
    };
  },
  components: {
    GraphicEchart,
    SecurityCheckHeader,
  },
  mounted() {
    this.init();
  },
  methods: {
    change() {
      this.$router.push("./cargoRelevanceTable");
    },
    init() {
      let myChart = this.$echarts.init(
        document.getElementById("echarts-proportion")
      ); //统计折线
      myChart.setOption(eleCake);
      window.onresize = () => {
        myChart.resize();
      };
    },
  },
};
</script>

<style lang="scss" scoped>
.header {
  > p {
    font-size: 18px;
    font-family: Microsoft YaHei;
    font-weight: bold;
    color: #101116;
    margin: 0 0 24px 0;
  }
}
.content_top {
  width: 100%;
  height: 45vh;
  background: #ffffff;
  box-shadow: 0px 3px 10px 0px rgba(0, 0, 0, 0.1);
  border-radius: 4px;
  margin-bottom: 16px;
  padding: 24px;
}
#echarts-proportion {
  width: 100%;
  height: 90%;
}
.content_bottom {
  width: 100%;
  height: 33vh;
  background: #ffffff;
  box-shadow: 0px 3px 10px 0px rgba(0, 0, 0, 0.1);
  border-radius: 4px;
  padding: 24px;
  > .content_classification {
    width: 100%;
    height: 90%;
    display: flex;
    align-items: center;
    justify-content: space-around;
  }
}
#echarts-distribution {
  width: 100%;
  height: 80%;
}
.chart {
  width: 16%;
  height: 200px;
}
</style>