ViewClue.vue 4.76 KB
<template>
  <div>
    <StatisticsBox :list="digitalMarketingList"></StatisticsBox>
    <div class="trend-box">
      <div class="patch-title">注册门店趋势</div>
      <BarChart ref="signChartRef" domId="signChart" :height="chartHeight" :dataList.sync="dataList" :colorList="colorList" :tooltipFormatterObj="tooltips"></BarChart>
    </div>
    <div class="trend-box">
      <div class="patch-title">活跃门店趋势</div>
      <BarChart ref="dynamicChartRef" domId="dynamicChart" :height="chartHeight" :dataList.sync="dataList" :colorList="greenColorList" :tooltipFormatterObj="tooltips"></BarChart>
    </div>
    <div class="trend-box">
      <div class="patch-title">月收入趋势</div>
      <LineChart ref="monthIncomeChartRef" domId="monthIncomeChart" :height="chartHeight" :dataList.sync="dataList" :colorList="colorList" :tooltipFormatterObj="tooltips" :valName="tooltips.attrName"></LineChart>
    </div>
    <div class="trend-box">
      <div class="patch-title">销售渠道趋势</div>
      <BarChart ref="saleChartRef" domId="saleChart" :height="chartHeight" :dataList.sync="dataList" :colorList="colorList" :tooltipFormatterObj="tooltips"></BarChart>
    </div>
    <div class="trend-box">
      <div class="patch-title">按年统计客户销售金额的合理性-门店数</div>
      <BarChart ref="rationalityChartRef" domId="rationalityChart" :height="chartHeight" :dataList.sync="dataList" :colorList="greenColorList" :tooltipFormatterObj="tooltips"></BarChart>
    </div>
    <div class="trend-box">
      <div class="patch-title">设备订阅数量和线索相关性分析</div>
      <BarChart ref="correlationChartRef" domId="correlationChart" :height="chartHeight" :dataList.sync="dataList" :colorList="colorList" :tooltipFormatterObj="tooltips"></BarChart>
    </div>
  </div>
</template>

<script>
import BarChart from './BarChart.vue'
import LineChart from './LineCharts.vue'
export default {
  name: 'InternalRight',
  components: {
    BarChart,
    LineChart
  },
  data() {
    return {
      digitalMarketingList: [
        {
          name: '注册门店总数',
          valueName: 'count',
          value: '0',
          unit: '¥',
          unitType: 'left',
          bottomType: 'ratio',
          ratioLeftLabel: '周同比',
          ratioLeftValueName: 'outputvalueTb',
          ratioLeftValue: '0',
          ratioRightLabel: '日环比',
          ratioRightValueName: 'outputvalueHb',
          ratioRightValue: '0'
        },
        {
          name: '活跃门店总数',
          valueName: 'countvalue',
          value: '0',
          unit: '¥',
          unitType: 'left',
          bottomType: 'ratio',
          ratioLeftLabel: '周同比',
          ratioLeftValueName: 'outputvalueTb',
          ratioLeftValue: '0',
          ratioRightLabel: '日环比',
          ratioRightValueName: 'outputvalueHb',
          ratioRightValue: '0'
        },
        {
          name: '设备订阅数量总数',
          valueName: 'count',
          value: '0',
          unit: '¥',
          unitType: 'left',
          bottomType: 'ratio',
          ratioLeftLabel: '周同比',
          ratioLeftValueName: 'outputvalueTb',
          ratioLeftValue: '0',
          ratioRightLabel: '日环比',
          ratioRightValueName: 'outputvalueHb',
          ratioRightValue: '0'
        },
        {
          name: '总收入',
          valueName: 'countvalue',
          value: '0',
          unit: '¥',
          unitType: 'left',
          bottomType: 'ratio',
          ratioLeftLabel: '周同比',
          ratioLeftValueName: 'outputvalueTb',
          ratioLeftValue: '0',
          ratioRightLabel: '日环比',
          ratioRightValueName: 'outputvalueHb',
          ratioRightValue: '0'
        }
      ],
      chartHeight: '19vh',
      colorList: ['#22D8FF', '#223FA9', '#061422'],
      greenColorList: ['#2AD191', '#0E958D', '#063139'],
      dataList: [
        {
          statMonth: '2021',
          actiNum: 400
        },
        {
          statMonth: '2022',
          actiNum: 600
        },
        {
          statMonth: '2023',
          actiNum: 800
        }
      ],
      tooltips: {
        label: '场次',
        attrName: 'actiNum'
      }
    }
  },
  mounted() {
    this.$refs.signChartRef.drawBar()
    this.$refs.dynamicChartRef.drawBar()
    this.$refs.monthIncomeChartRef.drawLine()
    this.$refs.saleChartRef.drawBar()
    this.$refs.rationalityChartRef.drawBar()
    this.$refs.correlationChartRef.drawBar()
  },
  methods: {
  }
}
</script>
<style lang="scss">
.trend-box {
  display: inline-block;
  margin-top: 0.89vh;
  width: 50%;
  &:nth-child(1),
  &:nth-child(2) {
    margin-top: 1.78vh;
  }
}
</style>