OperationalRight.vue 2.76 KB
<!--
 * @Description: 运营数据右侧
 * @Author: huyue
 * @Date: 2022-06-23 10:52:23
 * @LastEditors: huyue
 * @LastEditTime: 2023-08-17 18:02:44
-->
<template>
  <div class="right">
    <div class="top box">
      <box-title title="营销增值服务业务"></box-title>
      <Business></Business>
      <Project></Project>
    </div>
    <div class="bottom">
      <box-title title="私域用户池总览"></box-title>
      <div class="bottom-content">
        <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>
  </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 './components/Business.vue'
import Project from './components/Project.vue'
import Analyse from './components/Analyse.vue'
import Area from './components/AreaSaas.vue'
import Brand from './components/BrandSaas.vue'
import UserTab from './components/UserTab.vue'
import ViewChart from './components/ViewChart.vue'
import ViewLineGroup from './components/ViewLineGroup.vue'
export default {
  name: 'OperationalRight',
  components: {
    Business,
    Project,
    Analyse,
    Brand,
    Area,
    UserTab,
    ViewChart,
    ViewLineGroup
  },
  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.operational.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: 53.89vw;
  display: flex;
  flex-direction: column;
  .top {
    height: 32.68vh;
    box-sizing: border-box;
  }
  .bottom {
    height: 53.66vh;
    margin-top: 1.95vh;
    box-shadow: inset 0 0 20px 0 #3d57ff69;
    box-sizing: border-box;
    &-content {
      padding: 0 0.83vw;
    }
  }
}
</style>