ViewContentLeft.vue 3.54 KB
<!--
 * @Description:
 * @Author: huyue
 * @Date: 2023-02-27 11:29:02
 * @LastEditors: huyue
 * @LastEditTime: 2023-02-27 14:52:17
-->
<template>
  <div class='left'>
    <div class='top'>
      <view-sub-title title='整体的业务趋势' />

      <view-surface
        :isMonthDay = 'true'
        domId='thirtyChart'
        :isEqually='false'
        boxHeight='41.5vh'
        :showSeletion='true'
        :isDatazoom='true'
        :dataList='springbudAtionList' />
      <!--      <div class='topWrp'>-->
      <!--        <view-surface domId='transworkChart' title='1.1转化+业务' :dataList='transworkList' />-->
      <!--        <view-surface domId='expandedgoldChart' title='1.2膨胀金业务' :dataList='expandedgoldList' />-->
      <!--        <view-surface domId='crowdfundingChart' title='1.3众筹业务' :dataList='crowdfundingList' />-->
      <!--        <view-surface domId='noworriesChart' title='2.1车损无忧' :dataList='noworriesList' />-->
      <!--      </div>-->
    </div>
    <div class='bottom'>
      <view-sub-title title='门店每月各业务展业情况' />
      <box-chart :boxList='boxList'></box-chart>
    </div>
  </div>
</template>

<script type='text/ecmascript-6'>
import datas from '../utils/data'
import Area from '../views/customer/area'
import Store from '../views/customer/store'
import Brand from '../views/customer/brand'
import OverSize from '../views/saas/overview.vue'
import { clientMixin } from '../mixins/index'
import BoxChart from 'plugins/boxChart'
import SelectCpn from 'views/sassPlus/componts/selectCpn'

export default {
  name: 'ViewContentLeft',
  mixins: [clientMixin],
  components: {
    BoxChart,
    Area,
    Store,
    Brand,
    OverSize,
    SelectCpn
  },
  data() {
    return {
      defaultHeight: datas.DefaultData.defaultPieHeight,
      springbudAtionList: [],


      boxList: [],
      current: 0,
      springbudAtionBackup: '',
      monthDayBackUp: ''
    }
  },
  created() {
    this.getMerchantMonthlyTrend('transwork', '1')
  },
  mounted() {
    this.$bus.$on('changeSpringbudAtion', data => {
      // this.springbudAtionBackup = data.action
      this.getMerchantMonthlyTrend(data.action, this.monthDayBackUp)
    })
    // monthDayEvent
    this.$bus.$on('monthDayEvent', data => {
      // this.monthDayBackUp = data.queryItem
      this.getMerchantMonthlyTrend(this.springbudAtionBackup, data.queryItem)
    })
  },
  methods: {
    getMerchantMonthlyTrend(val, monthday ) {
      this.springbudAtionBackup = val
      this.monthDayBackUp = monthday
      this.api.springbudAtion.getAllMerchantMonthlyTrend({
        queryItem: val,
        queryType: monthday
      }).then(res => {
        if (res.code == 0) {
          this.springbudAtionList = res.data.dataList
        }
      })
    }
  }
}
</script>

<style scoped lang='scss'>
.left {
  display: flex;
  flex-direction: column;
  width: 43.89vw;
  overflow: hidden;

  .top {
    height: 50.49vh;
    width: 100%;
    //background-image: url('../assets/images/bg-1.png');
    background-image: url('../assets/images/bg-3.png');
    background-repeat: no-repeat;
    background-size: 100% 100%;
    padding: 0 16px;
    box-sizing: border-box;

    .topWrp {
      display: flex;
      justify-content: space-between;
      flex-wrap: wrap;
      align-content: space-between;
    }
  }

  .bottom {
    // height: calc(41% - 16px);
    height: 38.05vh;
    margin-top: auto;
    background-image: url('../assets/images/bg-2.png');
    background-repeat: no-repeat;
    background-size: 100% 100%;
    padding: 0 16px;
    box-sizing: border-box;
  }
}
</style>