/* 互动频次 */
<template>
  <div class="interaction-wrapper height100 overview-detail">
    <div class="ecahrts-panel-box">
      <div class="panel-box-header">
        <span class="title">互动频次</span>
        <div class="tip">
          <span class="tip-title">页面说明:</span>
          <span>
            可查看当前系统各项数据统计情况。互动频次及点播趋势图展示部分数据，可进入互动统计及趋势分析详情页查看全部数据。</span
          >
        </div>
      </div>
      <div class="panel-box-content">
        <bar :data="echartsData" ref="echarts" />
      </div>
    </div>
    <div class="rank-panel-box">
      <div class="panel-box-header">
        <span class="title">互动频次排行</span>
      </div>
      <div class="panel-box-content">
        <rank-table :tList="tList" :data="data" />
      </div>
    </div>
  </div>
</template>

<script>
import { getCurDate } from "@/utils/util.time.js";
import { bar, rankTable } from "./components";
export default {
  data() {
    return {
      tList: ["排名", "机构名称", "互动频次"],
      echartsData: {},
      data: [],
    };
  },
  components: { bar, rankTable },
  mounted() {
    this.getList();
  },
  methods: {
    getList() {
      let curTime = getCurDate();
      let frequencyDate = curTime.year + curTime.month;
      let _this = this
      _this.$https({
        method: "post",
        url:
          "tBoardStatistic/getInteractionFrequencyPageList?frequencyDate=" +
          frequencyDate,
        authType: this.backToken,
      })
        .then((res) => {
          if (res.status == 200) {
            if (res.data.resultCode == 200) {
              _this.echartsData = {};
              _this.echartsData.xAxisData = res.data.data.organList;
              _this.echartsData.yAxisData = res.data.data.cntList;
              _this.data = res.data.data.page.records;
            } else {
              _this.echartsData = {};
              _this.data = [];
            }
          } else {
            _this.echartsData = {};
            _this.data = [];
          }
          setTimeout(() => {
            _this.init();
          },100);
        })
        .catch((err) => {
          _this.$message.error(err.message);
          _this.echartsData = {};
          _this.data = [];
        });
    },
    init() {
      this.$refs.echarts.init();
    }
  },
};
</script>

<style>
</style>