Newer
Older
ganzhou-feidu / src / pages / ywts / shms / tcy / popup.vue
dutingting 21 days ago 12 KB 停车云完成
<template>
  <div>
    <div class="top" :style="{ left: `${windowPostion.x}px`, top: `${windowPostion.y}px`  }">
      <i class="el-icon-close close-pop" @click="$emit('close')" />
      <div class="list-down" style="width: 100%;margin: 0 auto;">
        <div class="list-item">
          <div style="width:100%;">
            <div style="width: 100%">
              <i class="el-icon-office-building item-line one-line" style="width: 100%;" :title="tcyInfo.name"><span style="margin-left: 5px">名称: {{ tcyInfo.name }}</span></i>
              <!-- <i class="el-icon-film item-line one-line" style="width: 100%;"><span style="margin-left: 5px">占用车位/全部车位: {{ tcyInfo.in }} / {{ tcyInfo.total }}</span></i> -->
              <!-- <i class="el-icon-location item-line one-line" style="width: 100%;" ><span style="margin-left: 5px">利用率: {{ tcyInfo.rate }}</span></i> -->
              <!-- <i class="el-icon-news item-line one-line" style="width: 100%;"><span style="margin-left: 5px">车场总收入: {{ tcyInfo.income }}</span></i> -->
              <i class="el-icon-news item-line one-line" style="width: 100%;" :title="tcyInfo.location"><span style="margin-left: 5px">位置: {{ tcyInfo.location }}</span></i>
            </div>
          </div>
        </div>
      </div>
    </div>
    <div class="bottom" >
      <i class="el-icon-close close-pop" @click="$emit('close')" />
      <div class="block block-base" style="width: 220px;">
        <div :style="{backgroundImage:'url('+titleImg+')'}" class="title ellipsis" :title="tcyInfo.name">{{ tcyInfo.name }}</div>
        <!-- 占用车位/全部车位 -->
        <div class="info-item">
          <div class="info-icon">
            <i class="el-icon-film"></i>
            <span class="info-text">占用车位/全部车位:</span>
          </div>
          <div class="info-value">{{ tcyInfo.in }} / {{ tcyInfo.total }}</div>
        </div>

        <!-- 利用率 -->
        <div class="info-item">
          <div class="info-icon">
            <i class="el-icon-pie-chart"></i>
            <span class="info-text">利用率:</span>
          </div>
          <div class="info-value">{{ tcyInfo.rate }}</div>
        </div>

        <!-- 车场总收入 -->
        <div class="info-item">
          <div class="info-icon">
            <i class="el-icon-money"></i>
            <span class="info-text">车场总收入:</span>
          </div>
          <div class="info-value"> {{ tcyInfo.income }}</div>
        </div>

        <!-- 位置 -->
        <div class="info-item" style="padding-bottom: 0;">
          <div class="info-icon">
            <i class="el-icon-location"></i>
            <span>位置:</span>
          </div>
          <div class="info-value ellipsis-multiline" :title="tcyInfo.location">{{ tcyInfo.location }}</div>
        </div>
      </div>
      <div class="block">
        <div :style="{backgroundImage:'url('+titleImg+')'}" class="title">近1月车辆进出趋势</div>
        <cars style="flex:1;" ref="carsRef"/>
      </div>
      <div class="block">
        <div :style="{backgroundImage:'url('+titleImg+')'}" class="title">近1月车辆类型分析</div>
        <CarsType style="flex:1;" ref="carsTypeRef"/>
      </div>
      <div class="block">
        <div :style="{backgroundImage:'url('+titleImg+')'}" class="title">近1月车场利用率</div>
        <CarsRate style="flex:1;" ref="carsRateRef"/>
      </div>
      <div class="block">
        <div :style="{backgroundImage:'url('+titleImg+')'}" class="title">近1年车场僵尸车辆趋势</div>
        <ZombieCar style="flex:1;" ref="zombieCarRef"/>
      </div>
      <div class="block">
        <div :style="{backgroundImage:'url('+titleImg+')'}" class="title">近1年车场收入态势</div>
        <Income style="flex:1;" ref="IncomeRef"/>
      </div>
    </div>
  </div>
</template>

<script>
import { showPositin } from '@/utils/freedo/index'

import PersonBar from "../../cszl/gd/components/personBar.vue";
import CasePie from "../../cszl/gd/components/casePie";
import CaseLineBar from "../../cszl/gd/components/caseLineBar";
import EduLineBar from "../../cszl/gd/components/eduLineBar";
import ScoreLineBar from "../../cszl/gd/components/scoreLineBar";
import Cars from './components/cars.vue'
import CarsType from './components/carsType.vue'
import CarsRate from './components/carsRate.vue'
import ZombieCar from './components/zombieCar.vue'
import Income from './components/income.vue'
export default {
  name: 'tcyPopup',
  components: {CarsRate, Cars, CarsType, Income, ZombieCar, ScoreLineBar, EduLineBar, CaseLineBar, CasePie, PersonBar},
  data() {
    return {
      titleImg: require('@/assets/images/popup/title.png'),  // 背景图片
      titleAll: require('@/assets/images/popup/title-all.png'), // 背景图片
      list: ['', '', '', ''],
      tcyInfo: {},
      windowPostion: { x: window.innerWidth - 165, y: window.innerHeight }, // 弹窗的位置
      defaultPhoto: require('@/assets/images/global_images/photo_error.png'),
      statusColor: {
        1: '#a1a1a1',
        2: '#f8e31a',
        3: '#5ab1fc',
        4: '#f89835',
        5: '#3def83',
      },
      urgencyColor: {
        'C': '#2f8d00',
        'B': '#c4ad00',
        'A': '#8d0000'
      },
      heightDict: {
        normal: '135px',
        video: '300px'
      }
    }
  },
  methods: {
    initData(item) {
      console.log(item, '弹窗内容')
      if (!item.lon || !item.lat) { return }
      showPositin(item.lon, item.lat)

      item.showType = 'normal'
      // 弹窗位置
      if (window.localStorage.getItem('mousePosition')) {
        this.windowPostion = {
          x: window.innerWidth / 2 - 165,
          y: window.innerHeight / 2
        }
      }
      else {
        this.windowPostion = {
          x: window.innerWidth / 2 - 165,
          y: window.innerHeight / 2
        }
      }
      this.tcyInfo = item

      this.$refs.carsRef.fetchData(item.id)
      this.$refs.carsTypeRef.fetchData(item.id)
      this.$refs.carsRateRef.fetchData(item.id)
      this.$refs.zombieCarRef.fetchData(item.id)
      this.$refs.IncomeRef.fetchData(item.id)
    },
  },
}
</script>

<style rel="stylesheet/scss" lang="scss" scoped>
.children-item {
  width: 96% !important;
  margin: 10px auto !important;
  color: #fff !important;
  // border: 1px solid #fff;
  border-radius: 6px;
  padding: 10px;
  box-sizing: border-box;

}

.video-area {
  padding: 10px;
  padding-right: 20px;
  background: url("../../../../assets/images/popup/case/事件看板背景.png") !important;
  background-size: 100% 100% !important;
  overflow: hidden;
}
.top {
  z-index: 111111111111;
  width: 100%;
  height: 80px;
  width: 27rem;
  position: absolute;
  bottom: 10px;
  left: 0px;
  display: flex;
  overflow: hidden;
  padding: 10px;
  padding-right: 20px;
  background: url("../../../../assets/images/popup/case/事件看板背景.png") !important;
  background-size: 100% 100% !important;
  overflow: hidden;
}

.bottom {

  z-index: 111111111111;
  width: 100%;
  height: 250px;
  position: absolute;
  bottom: 10px;
  left: 0px;
  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: 500px;
    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 10px;
    flex-direction: column;
  }

  .title {
    text-shadow: 0 0 5px #d1ffff;
    height: 35px;
    width: 80%;
    float: left;
    text-align: left;
    background-repeat: no-repeat;
    -webkit-background-size: 100% 100%;
    background-size: 100% 100% !important;
    color: white;
    font-weight: bold;
    padding-top: 4px;
    padding-left: 30px;
    font-family: 黑体;
    letter-spacing: 1px;
  }

  .item-text {
    text-shadow: 0 0 2px #d1ffff;
    flex: 1;
    font-weight: bold;
    text-align: center;
    font-size: 18px;
  }

  .base-map-image {
    width: 60px;
    height: 60px;
  }

  .num {
    text-shadow: 0 0 5px #ffb441;
    color: #ffb441;
    font-size: 20px;
    padding-top: 2px;
  }

  .unit {
    color: #B3F3F6;
    font-size: 14px;
    margin-left: 1px;
  }

  .item {
    width: 25%;
    height: 32%;
    display: flex;
    justify-content: left;
    align-items: center;
  }
}

.list-down {
  // margin-top: 10px;
  // overflow-y: scroll;
  width: 100%;
  // height: calc(100% - 6rem);
  padding: 0px 10px;
}

.list-item {
  width: calc(100% - 35px);
  // height: 12rem;
  display: flex;
  justify-content: flex-start;
  flex-direction: column;
  flex-wrap: wrap;
  font-size: 1.4rem;
  padding: 0.8rem 10px;
  margin: 0.2rem 0rem;
  letter-spacing: 2px;
  cursor: pointer;
  background-size: 100% 100% !important;
  color: white;
  border-top: 2px solid #0494f3;
  border-radius: 10px;
}

.list-item:hover {
  background-size: cover !important;
  background: url('../../../../assets/images/right/选中.png') !important;
  background-size: 100% 100% !important;
}

.item-title {
  width: 90%;
  text-align: left;
  margin-bottom: 5px;
  white-space: nowrap;
  /* 防止换行 */
  overflow: hidden;
  /* 溢出隐藏 */
  text-overflow: ellipsis;
  /* 文本显示为省略号 */
}

.item-line {
  display: flex;
  font-size: 1.2rem;
  color: #aed2f3;
  padding-left: 20px;
  line-height: 1.8rem;
  width: 95%;
  word-break: break-all;
  text-align: left;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  /* 设置最大行数 */
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.colorbox-text {
  background-color: #0a88fc;
  border-radius: 10px;
  color: white;
  font-size: 1rem;
  padding: 0rem 0.4rem;
  margin-left: 5px;
  text-align: center;
  width: 5rem;
  margin-bottom: 4px;
  cursor: pointer;
}

.one-line {
  display: block !important;
  white-space: nowrap;
  /* 防止换行 */
  overflow: hidden;
  /* 溢出隐藏 */
  text-overflow: ellipsis;
  /* 文本显示为省略号 */
}


.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;
  color: white;
  padding: 15px;
  max-width: 400px;
  margin: 0 auto;

    .info-item {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 8px 0;
      border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .info-item:last-child {
      border-bottom: none;
    }

    .info-icon {
      display: flex;
      align-items: center;
      opacity: 0.8;
      white-space: nowrap;
      margin-right: 6px;
    }

    .info-text {
      flex: 1;
      font-size: 14px;
      text-align: left;
      white-space: nowrap;
    }

    .info-value {
      font-weight: 600;
      font-size: 15px;
    }

    .name {
      font-size: 16px;
      font-weight: 600;
    }

    .location {
      font-size: 13px;
      opacity: 0.8;
    }

    .rate-bar {
      height: 6px;
      background-color: rgba(255, 255, 255, 0.2);
      border-radius: 3px;
      margin-top: 5px;
    }

    .rate-fill {
      height: 100%;
      background-color: #409EFF;
      border-radius: 3px;
    }
}

.block-base {
  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);
}

.ellipsis {
  white-space: nowrap;      /* 防止文本换行 */
  overflow: hidden;         /* 隐藏溢出的文本 */
  text-overflow: ellipsis;  /* 用省略号表示溢出的文本 */
}
.ellipsis-multiline {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2; /* 限制显示的行数 */
  overflow: hidden;
  text-overflow: ellipsis;
}
</style>