screen.vue 7.83 KB
Newer Older
乐宝呗666's avatar
乐宝呗666 committed
1
<template>
xulili's avatar
xulili committed
2 3 4
  <div class="screen-container">
    <div class="page-title">
      <p>- 播放数据统计 -</p>
乐宝呗666's avatar
乐宝呗666 committed
5
    </div>
xulili's avatar
xulili committed
6
    <div class="user-info">
xulili's avatar
xulili committed
7
      <!-- <img src="@/assets/images/screen/user.png" alt="" class="icon-user" />
xulili's avatar
xulili committed
8
      <span class="user-name">中国国家博物馆</span>
xulili's avatar
xulili committed
9
      <img src="@/assets/images/screen/close.png" alt="" class="signup" />
xulili's avatar
xulili committed
10
      <img
xulili's avatar
xulili committed
11
        src="@/assets/images/screen/manager.png"
xulili's avatar
xulili committed
12 13 14
        @click="goManager"
        alt=""
        class="manager"
xulili's avatar
xulili committed
15
      /> -->
xulili's avatar
xulili committed
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
    </div>
    <div class="middel-part">
      <!--地区展板播放统计-->
      <areas class="table-list"></areas>
      <!--中间地图-->
      <div class="map-container">
        <borderNums></borderNums>
        <mapDiv></mapDiv>
      </div>
      <!--全国点播板块-->
      <top10 class="table-list"></top10>
    </div>
    <div class="echartspanel">
      <demand
        ref="interactEcharts"
        class="echarts-box left"
        :data="interactEcharts"
        @itemClick="itemClick"
      >
      </demand>
      <interaction
        ref="trendEcharts"
        class="echarts-box right"
        :data="trendEcharts"
        @itemClick="itemClick"
      ></interaction>
    </div>
    <!-- 弹框 -->
    <m-dialog
      ref="mdialog"
      :is-show.sync="showDialog"
      :dialog-data="dialogData"
    />
  </div>
乐宝呗666's avatar
乐宝呗666 committed
50 51
</template>
<script>
xulili's avatar
xulili committed
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
import {
  demand,
  interaction,
  areas,
  top10,
  mapDiv,
  borderNums,
  MDialog,
} from "../components";
import { getCurDate } from "../components/util.time.js";
export default {
  data() {
    return {
      showDialog: false,
      dialogData: {}, // 1 是互动频次弹框 2 是趋势图弹框
      trendList: [],
      trendEcharts: {},
      interactList: [],
      interactEcharts: {},
    };
  },
  components: {
乐宝呗666's avatar
乐宝呗666 committed
74 75 76 77 78 79
    demand,
    interaction,
    areas,
    top10,
    mapDiv,
    borderNums,
xulili's avatar
xulili committed
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106
    MDialog,
  },
  mounted() {
    let clientWidth = document.body.clientWidth;
    clientWidth = clientWidth > 1920 ? 1920 : clientWidth;
    let fontSize = (clientWidth / 1920) * 100;
    document.getElementsByTagName("html")[0].style.fontSize = fontSize + "px";
    this.getList();
  },
  methods: {
    // 接收柱状图传来的数据
    itemClick(params) {
      let type = "";
      // 互动
      if (params.type == "1") {
        type = "interact";
        this.dialogData = {
          data: this.interactEcharts,
          list: this.interactList,
        };
      } else if (params.type == "2") {
        type = "trend";
        // 趋势
        this.dialogData = {
          data: this.trendEcharts,
          list: this.trendList,
        };
乐宝呗666's avatar
乐宝呗666 committed
107
      }
xulili's avatar
xulili committed
108 109
      this.dialogData = Object.assign(this.dialogData, params);
      this.showDialog = true;
乐宝呗666's avatar
乐宝呗666 committed
110
    },
xulili's avatar
xulili committed
111 112
    goManager() {
      location.href = "http://121.4.56.121:84";
乐宝呗666's avatar
乐宝呗666 committed
113
    },
xulili's avatar
xulili committed
114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171
    getList() {
      let curTime = getCurDate();
      let frequencyDate = curTime.year + curTime.month;
      this.getPageList("interact", frequencyDate);
      this.getPageList("trend", frequencyDate);
    },
    getPageList(type, frequencyDate) {
      let httpUrl = "";
      let _this = this;
      if (type === "interact") {
        httpUrl =
          "tBoardStatistic/getInteractionFrequencyPageList?frequencyDate=";
      }
      if (type === "trend") {
        httpUrl = "tBoardStatistic/getBoardTrendPageList?playDate=";
      }
      _this
        .$https({
          method: "post",
          url: `${httpUrl}${frequencyDate}`,
        })
        .then((res) => {
          if (res.status == 200) {
            if (res.data.resultCode == 200) {
              _this.setDataWithSus(type, res.data.data);
            } else {
              _this.setDataWithErr(type);
            }
          } else {
            _this.setDataWithErr(type);
          }
        })
        .catch((err) => {
          _this.$message.error(err.message);
          _this.setDataWithErr(type);
        });
    },
    setDataWithSus(type, data) {
      this[`${type}Echarts`] = {};
      this[`${type}List`] = data.page.records;
      this[`${type}Echarts`].yAxisData = data.cntList;
      if (type == "interact") {
        this[`${type}Echarts`].xAxisData = data.organList;
      }
      if (type == "trend") {
        this[`${type}Echarts`].xAxisData = data.dateList;
      }
      let _this = this;
      setTimeout(() => {
        _this.$refs[`${type}Echarts`].init();
      }, 1000);
    },
    setDataWithErr(type) {
      this[`${type}Echarts`] = {};
      this[`${type}List`] = [];
    },
  },
};
乐宝呗666's avatar
乐宝呗666 committed
172 173
</script>
<style lang="scss">
xulili's avatar
xulili committed
174 175 176 177 178 179 180 181 182 183 184
.screen-container {
  ::-webkit-scrollbar {
    width: 8px;
    height: 10px;
    //background-color: rgba(255, 255, 255, 0.2) !important;
  }
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #08214c;
  /*background: url("/images/screen/bg.png") no-repeat;*/
xulili's avatar
xulili committed
185
  background: url("~@/assets/images/screen/bg@1x.png") no-repeat;
xulili's avatar
xulili committed
186 187 188 189
  background-size: 100% 100%;
  padding: 0 0.32rem;
  box-sizing: border-box;
  .page-title {
乐宝呗666's avatar
乐宝呗666 committed
190
    width: 100%;
xulili's avatar
xulili committed
191
    height: 0.67rem;
xulili's avatar
xulili committed
192
    background: url("~@/assets/images/screen/top_bg.png") no-repeat;
乐宝呗666's avatar
乐宝呗666 committed
193
    background-size: 100% 100%;
xulili's avatar
xulili committed
194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233
    p {
      font-size: 0.32rem;
      color: #62baff;
      position: absolute;
      left: 50%;
      transform: translate(-50%, 0.1rem);
      margin: 0;
    }
  }
  .user-info {
    position: absolute;
    right: 0.56rem;
    top: 0.31rem;
    display: flex;
    align-items: center;
    .icon-user,
    .signup {
      width: 0.28rem;
      height: 0.28rem;
    }
    .user-name {
      font-size: 0.18rem;
      color: #4ffffd;
      margin-left: 0.12rem;
    }
    .signup {
      margin-left: 0.4rem;
    }
    .manager {
      cursor: pointer;
      width: 0.32rem;
      height: 0.32rem;
      margin-left: 0.2rem;
    }
  }
  .echartspanel {
    height: 34vh;
    width: 100%;
    bottom: 0rem;
    padding: 0.24rem 0;
乐宝呗666's avatar
乐宝呗666 committed
234
    box-sizing: border-box;
xulili's avatar
xulili committed
235 236 237 238 239 240 241 242 243 244 245 246 247
    .echarts-box {
      height: 100%;
      width: 50%;
      display: inline-block;
      box-sizing: border-box;
      &.left {
        padding-right: 0.12rem;
        float: left;
      }
      &.right {
        padding-left: 0.12rem;
        float: right;
      }
乐宝呗666's avatar
乐宝呗666 committed
248
    }
xulili's avatar
xulili committed
249 250 251 252 253 254 255 256 257
  }
  .middel-part {
    display: flex;
    margin-top: 4.16vh;
    height: 56.48vh;
    justify-content: space-between;
    .table-list {
      width: 25vw;
      height: 100%;
乐宝呗666's avatar
乐宝呗666 committed
258
    }
xulili's avatar
xulili committed
259 260 261 262 263 264 265 266 267 268 269
  }
  .table-list {
    .list-of-body {
      padding-top: 0.7rem;
      height: 100%;
      box-sizing: border-box;
      ul {
        display: flex;
        align-items: flex-start;
        font-size: 0.16rem;
        padding-left: 0.24rem;
乐宝呗666's avatar
乐宝呗666 committed
270
        box-sizing: border-box;
xulili's avatar
xulili committed
271 272 273 274 275 276 277 278 279 280 281 282
        li {
          line-height: 0.4rem;
          &.f1 {
            width: 10%;
          }
          &.f2 {
            width: 20%;
          }
          &.f3 {
            width: 30%;
          }
          &.f5 {
乐宝呗666's avatar
乐宝呗666 committed
283
            width: 50%;
xulili's avatar
xulili committed
284 285 286 287 288 289 290 291 292 293 294 295
          }
          &.f6 {
            width: 60%;
          }
          &.f7 {
            width: 70%;
          }
          div.title {
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
          }
乐宝呗666's avatar
乐宝呗666 committed
296
        }
xulili's avatar
xulili committed
297 298 299 300 301 302 303 304 305 306 307 308 309
      }
      .body-title {
        color: #62baff;
        margin-bottom: 0.07rem;
      }
      .body-content {
        height: calc(100% - 0.8rem);
        overflow-y: auto;
        .body-item {
          height: 0.4rem;
          background-color: #62baff33;
          margin-bottom: 0.04rem;
          color: #4efffd;
乐宝呗666's avatar
乐宝呗666 committed
310
        }
xulili's avatar
xulili committed
311
      }
乐宝呗666's avatar
乐宝呗666 committed
312
    }
xulili's avatar
xulili committed
313 314 315 316 317 318 319
  }
  .common-title {
    .icon-title {
      position: absolute;
      top: 0.1rem;
      left: 0.1rem;
      width: 0.4rem;
乐宝呗666's avatar
乐宝呗666 committed
320
    }
xulili's avatar
xulili committed
321 322 323 324 325 326 327
    .title {
      position: absolute;
      top: 0.2rem;
      left: 0.52rem;
      font-size: 0.2rem;
      line-height: 0.2rem;
      color: #4efffd;
乐宝呗666's avatar
乐宝呗666 committed
328
    }
xulili's avatar
xulili committed
329 330 331 332 333
    .bg {
      position: absolute;
      width: calc(100% - 0.48rem);
      left: 0.24rem;
      top: 0.24rem;
乐宝呗666's avatar
乐宝呗666 committed
334
    }
xulili's avatar
xulili committed
335 336 337 338 339 340 341 342
  }
  .map-container {
    flex: 1;
    height: 100%;
    position: relative;
    padding-top: 0.7rem;
    box-sizing: border-box;
  }
乐宝呗666's avatar
乐宝呗666 committed
343 344
}
</style>