Newer
Older
GDT_FRONT / src / views / popup / bottom.vue
wangxitong on 11 Sep 4 KB Default Changelist
<template>
  <div class="bottom">
<!--    <div class="block1" style="border-top-left-radius: 0px;margin-left: 5px">-->
<!--      <inout-list style="flex:1;"/>-->
<!--    </div>-->
    <div class="block">
      <div :style="{backgroundImage:'url('+titleImg+')'}" class="title">安防事件列表</div>
      <case-table style="flex:1;"/>
    </div>
    <div class="block1" style="flex-direction: row;width: 700px">
      <div style="width: 200px">
        <div class="item0" style="margin: 36px 0">
          <el-image :src="require('@/assets/popup/事件.png')" class="base-map-image" mode="fill" />
          <div class="item-text">
            <div class="num">{{caseNum.all}}<span class="unit"> 件</span></div>
            <div style="color: #B3F3F6;">今日总事件</div>
          </div>
        </div>
        <div class="item0">
          <el-image :src="require('@/assets/popup/事件1.png')" class="base-map-image" mode="fill" />
          <div class="item-text">
            <div class="num"><span style="color: #08f102;text-shadow: 0 0 5px #08f102;">{{caseNum.solve}}</span><span class="unit"> 件</span></div>
            <div style="color: #B3F3F6;">今日已解决</div>
          </div>
        </div>
      </div>
      <case-pie style="width: calc(100% - 200px);height: 100%"/>
    </div>
    <div class="block">
      <div :style="{backgroundImage:'url('+titleImg+')'}" class="title">安防事件频率统计</div>
      <case-bar style="flex:1;"/>
    </div>
  </div>
</template>

<script>

import CaseTable from '@/views/popup/components/caseTable'
import CasePie from '@/views/popup/components/casePie'
import { caseTodayStatistics } from '@/api/pop'
import CaseBar from '@/views/popup/components/caseBar'
import InoutList from '@/views/popup/components/inoutList'

export default {
  name: 'Bottom',
  components: { InoutList, CaseBar, CasePie, CaseTable },
  data() {
    return {
      timer: null,
      titleImg: require('@/assets/popup/title.png'), // 背景图片
      titleAll: require('@/assets/popup/title-all.png'), // 背景图片
      list: [2156, 2144, 455, 314, 98],
      caseNum: {
        all: 0,
        solve: 0
      }
    }
  },
  mounted() {
    clearInterval(this.timer)
    this.search()
  },
  beforeDestroy() {
    clearInterval(this.timer)
    this.timer = null
  },
  methods: {
    search() {
      this.timer = setInterval(() => {
        caseTodayStatistics().then(response => {
          if (response.code === 200) {
            this.caseNum = response.data
          }
        })
      }, 10000)
    }
  }
}
</script>

<style rel="stylesheet/scss" lang="scss" scoped>
.bottom{
  width: 100%;
  height: 220px;
  display: flex;
  overflow: hidden;
  padding: 0px 0px;
  .block{
    flex: 1;
    height: 100%;
    display: flex;
    flex-wrap: wrap;
    background: linear-gradient(to top left, rgba(5, 30, 61, 0.62), #0D3F7E9D);
    border-radius: 5px;
    box-shadow: 4px 4px 40px rgba(0, 0, 0, .05);
    border-color: rgba(0, 0, 0, .05);
    margin: 0px 5px;
    flex-direction: column;
  }
  .block1{
    width: 750px;
    height: 100%;
    display: flex;
    flex-wrap: wrap;
    background: linear-gradient(to top left, rgba(5, 30, 61, 0.62), #0D3F7E9D);
    border-radius: 5px;
    box-shadow: 4px 4px 40px rgba(0, 0, 0, .05);
    border-color: rgba(0, 0, 0, .05);
    margin: 0px 5px;
    flex-direction: column;
  }
  .title{
    text-shadow: 0 0 5px #d1ffff;
    width: 100%;
    height: 35px;
    background-repeat: no-repeat;
    -webkit-background-size: 100% 100%;
    background-size: 100% 100%;
    color: white;
    font-weight: bold;
    padding-top: 8px;
    padding-left: 30px;
    font-family: 黑体;
    letter-spacing: 1px;
  }
  .item{
    width: 33%;
    font-weight: bold;
    text-align: center;
    font-size: 15px;

  }
  .item0{
    width: 100%;
    height: 50px;
    display: flex;
    justify-content: left;
    align-items: center;
    padding: 0 8%;
  }
  .item-text{
    text-shadow: 0 0 2px #d1ffff;
    flex: 1;
    font-weight: bold;
    text-align: center;
    font-size: 18px;
  }
  .num{
    text-shadow: 0 0 5px #ffb441;
    color: #ffb441;
    font-size: 20px;
    padding-top: 2px;
  }
  .unit{
    color: #B3F3F6;
    font-size: 14px;
    margin-left: 1px;
  }
}
</style>