graph.vue 1.46 KB
<!-- 逛店数量统计 -->
<!-- 停留时长统计 -->
<template>
  <div>
    <!-- 顶部区域 S-->
    <div class="ipage_top">
      <div class="tit"><img :src="bindIcon('renyuan')" />{{title||chartData.title}}</div>
      <div class="acts"></div>
    </div>
    <div class="ichart">
        <graph-chart ref="chart" :cdata="chartData" tval="heat"></graph-chart>
    </div>
  </div>
</template>
<script>
import _ from 'underscore';
import mixin from './mixin';
import mallData from '@/components/Echarts/data';
/**********************************************************/
const chartsConfig = {
  default: { //默认
    otherConf: {

    }
  }
};
/*******************************************************/
export default {
  mixins: [mixin],
  data() {
    return {
      configObj: {}
    }
  },
  created() {

  },
  methods: {
    getChartsConfig() {
      return chartsConfig;
    },
    loadChartData(params) {
      this.chartId = this.getChartId(this.ckey);
      if (this.chartId) {
        this.ajaxModuleData({...params,pageSize:50}).then(data => {
          this.setChartData(data);
        });
      } else {
        this.setChartData();
      }
    },
    setChartData(data) {
      let zoneData = JSON.parse(JSON.stringify({
          series:_.isEmpty(data.data)?[]:[data]
      }));
      this.chartData = Object.assign({}, zoneData, {
         noProcess:true, 
         otherConf: this.configObj.otherConf || {}
      });
    }
  }
}
</script>

<style  lang="less">
</style>