dheat.vue
4.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
<!-- 核心客群分析 -->
<template>
<div>
<!-- 顶部区域 S-->
<div class="ipage_top">
<div class="tit"><img :src="bindIcon('renyuan')"/>{{title||chartData.title}}</div>
<div class="acts">
<!-- <template>
<ul class="condition-box">
<li class="condition-item">
<span class="condition-item-text">筛选条件</span>
<div class="condition-item-option">
<el-select v-model="typeVal" filterable :placeholder="$t('pholder.zoneSelect')" class="floor-sel-box format-sel-box">
<el-option label="全部" value=""></el-option>
<el-option v-for="item in typeData" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select>
</div>
</li>
</ul>
</template> -->
</div>
</div>
<el-row v-loading="loading">
<el-col class="ichart" >
<heat-chart v-show="!isEmpty" :cdata="chartData" tval="heat"></heat-chart>
<heat-chart :cdata="chartData2" tval="heat"></heat-chart>
</el-col>
</el-row>
</div>
</template>
<script>
import mixin from './mixin';
import mallData from '@/components/Echarts/data';
/**********************************************************/
const chartsConfig = {
default:{ //默认
otherConf:{
visualColor:['#7A6DD7','#d0c9ff'],
hideVisualMap:true,
_yAxis:{
name:'女性',
nameRotate:0,
nameLocation:'middle',
nameGap:70,
nameTextStyle:{
fontWeight:'bold'
},
},
_grid:{
left:120,
top:0,
right:0,
bottom:20
}
}
}
};
/*******************************************************/
export default {
mixins: [mixin],
data() {
return {
loading:true,
isEmpty:false,
configObj:{},
chartData2:{},
typeVal:'',
ckeys:'',
typeData:[{
name:'人均逛店数',
id:1
},{
name:'人均到场次数',
id:2
}]
}
},
watch: {
typeVal(){
this.loadChartData();
}
},
created() {
if(this.ckey=='core_customer_analysis_male'){
this.ckeys = 'core_customer_analysis_male,core_customer_analysis_female';
}else{
this.ckeys = this.ckey;
}
},
methods: {
getChartsConfig(){
return chartsConfig;
},
loadChartData(params){
this.loading = true;
this.chartId = [this.getChartId(this.ckeys.split(',')[0]),this.getChartId(this.ckeys.split(',')[1])].join(',');
if(this.chartId){
this.ajaxModuleData().then(data=>{
this.setChartData(data);
});
}
},
setChartData(data){
/*****************男性*****************/
this.chartData = Object.assign({},data[this.ckeys.split(',')[0]],{
otherConf:{...this.configObj.otherConf,hidexAxis:true,_grid:{
left:120,
top:20,
right:0,
bottom:2
},_yAxis:{
...this.configObj.otherConf._yAxis,name:'男性'
}}
});
if(this.chartData.series.length==0){
this.isEmpty = true
}else{
this.isEmpty = false
}
/*****************女性***********************/
this.chartData2 = Object.assign({},data[this.ckeys.split(',')[1]],{
otherConf:this.configObj.otherConf||{}
});
this.loading = false;
}
}
}
</script>
<style lang="less">
</style>