ViewContentRight.vue 2.62 KB
<!--
 * @Description: 
 * @Author: huyue
 * @Date: 2022-06-23 10:52:23
 * @LastEditors: 前端 qianduan01@didihu.com.cn
 * @LastEditTime: 2022-10-28 09:34:04
-->
<template>
  <div class="right">
    <div class="top">
      <view-sub-title title="SaaS+增值转化业务" />
      <Business></Business>
      <Project></Project>
    </div>
    <div class="bottom">
      <view-sub-title title="私域用户池总览" />
      <UserTab></UserTab>
      <view-chart></view-chart>
      <view-line-group>
        <div slot="1"><Analyse :height="defaultHeight"></Analyse></div>
        <div slot="2"><Brand :height="defaultHeight" :brandList="brandList"></Brand></div>
        <div slot="3"><Area :height="defaultHeight" :areaList="areaList"></Area></div>
      </view-line-group>
    </div>
  </div>
</template>

<script type="text/ecmascript-6">
const queryItem = ['Importantvalue', 'Importantdevelopments', 'Importantrecall', 'Importantretention', 'Generalvalue', 'Generaldevelopments', 'Generalrecall','Generalretention']
import datas from '../utils/data'
import Business from '../views/saas/business'
import Project from '../views/saas/project'
import Analyse from '../views/user/analyse'
import Brand from '../views/user/brand'
import Area from '../views/user/area'
import UserTab from '../views/user/usertab'
export default {
  name: 'ViewContentRight',
  components: {
    Business,
    Project,
    Analyse,
    Brand,
    Area,
    UserTab
  },
  data() {
    return {
      defaultHeight: datas.DefaultData.defaultLineHeight,
      brandList: [],
      areaList: []
    }
  },
  mounted() {
    this.getValueDistribution(7);
        this.$bus.$on('drawChart', data => {
      this.getValueDistribution(data)
    })
  },
  methods: {
    getValueDistribution(itemKey) {
      const params = {
        req: {
          queryItem:  queryItem[7-itemKey]
        }
      }
      this.api.user.getValueDistribution(params).then(res => {
        if(res.code ==0) {
          this.areaList = res.data.dataList[0].rankDistributions
          this.brandList = res.data.dataList[1].rankDistributions
        }
      })
  }
  }
}
</script>

<style scoped lang="scss">
.right {
  width: 51.67vw;
  display: flex;
  flex-direction: column;
  .top {
    height: 33.41vh;
    background-image: url('../assets/images/bg-3.png');
    background-repeat: no-repeat;
    background-size: 100% 100%;
    padding: 0 16px;
    box-sizing: border-box;
  }
  .bottom {
    height: 55.12vh;
    margin-top: auto;
    background-image: url('../assets/images/bg-4.png');
    background-repeat: no-repeat;
    background-size: 100% 100%;
    padding: 0 16px;
    box-sizing: border-box;
  }
}
</style>