leftCenter.vue
7.52 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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
<template>
<div class="live_item acea-row acea-column" style="height:100%">
<div class="ctit">
<p class="tit">实况信息</p>
<div class="line"></div>
</div>
<div class="container_center">
<div class="container_center_all">
<img src="./imgs/dianpuyoukuang.png" alt="">
<div class="container_center_all_totla">
<div class="container_center_all_div">游逛店铺个数</div>
<div class="container_center_all_right">
<span style="color:#32C5FF;fontSize:24px">{{dataObj.zone_average_visited?dataObj.zone_average_visited.today:'--'}}<small class="small_title">个</small></span>
<span style="color:#fff;fontSize:12px">昨日:<i :style="{color:dataObj.zone_average_visited&&dataObj.zone_average_visited.yesterdayRatio.toString().includes('-')?'#E02020':'#6DD400'}" class="resset">
<span v-if="dataObj.zone_average_visited&&dataObj.zone_average_visited.yesterdayRatio.toString().includes('-')">-</span>
{{dataObj.zone_average_visited?dataObj.zone_average_visited.yesterday:'--'}}个
</i>
</span>
<span style="color:#fff;fontSize:12px">上周:<i :style="{color:dataObj.zone_average_visited&&dataObj.zone_average_visited.lastWeekDayRatio.toString().includes('-')?'#E02020':'#6DD400'}" class="resset">
<span v-if="dataObj.zone_average_visited&&dataObj.zone_average_visited.lastWeekDayRatio.toString().includes('-')">-</span>
{{dataObj.zone_average_visited?dataObj.zone_average_visited.lastWeekDay:'--'}}个
</i>
</span>
</div>
</div>
</div>
<div class="container_center_all">
<img src="./imgs/yetaiyouguanshengdu.png" alt="">
<div class="container_center_all_totla">
<div class="container_center_all_div">游逛业态个数</div>
<div class="container_center_all_right">
<span style="color:#FAEC32;fontSize:24px">{{dataObj.format_average_visited?dataObj.format_average_visited.today:'--'}}<small class="small_title">个</small></span>
<span style="color:#fff;fontSize:12px">昨日:<i :style="{color:dataObj.format_average_visited&&dataObj.format_average_visited.yesterdayRatio.toString().includes('-')?'#E02020':'#6DD400'}" class="resset">
<span v-if="dataObj.format_average_visited&&dataObj.format_average_visited.yesterdayRatio.toString().includes('-')">-</span>
{{dataObj.format_average_visited?dataObj.format_average_visited.yesterday:'--'}}个
</i>
</span>
<span style="color:#fff;fontSize:12px">上周:<i :style="{color:dataObj.format_average_visited&&dataObj.format_average_visited.lastWeekDayRatio.toString().includes('-')?'#E02020':'#6DD400'}" class="resset">
<span v-if="dataObj.format_average_visited&&dataObj.format_average_visited.lastWeekDayRatio.toString().includes('-')">-</span>
{{dataObj.format_average_visited?dataObj.format_average_visited.lastWeekDay:'--'}}个
</i>
</span>
</div>
</div>
</div>
<div class="container_center_all">
<img src="./imgs/loucengyouguna.png" alt="">
<div class="container_center_all_totla">
<div class="container_center_all_div">游逛楼层层数</div>
<div class="container_center_all_right">
<span style="color:#18D2DA;fontSize:24px">{{dataObj.floor_average_visited?dataObj.floor_average_visited.today:'--'}}<small class="small_title">层</small></span>
<span style="color:#fff;fontSize:12px">昨日:<i :style="{color:dataObj.floor_average_visited&&dataObj.floor_average_visited.yesterdayRatio.toString().includes('-')?'#E02020':'#6DD400'}" class="resset">
<span v-if="dataObj.floor_average_visited&&dataObj.floor_average_visited.yesterdayRatio.toString().includes('-')">-</span>
{{dataObj.floor_average_visited?dataObj.floor_average_visited.yesterday:'--'}}层
</i>
</span>
<span style="color:#fff;fontSize:12px">上周:<i :style="{color:dataObj.floor_average_visited&&dataObj.floor_average_visited.lastWeekDayRatio.toString().includes('-')?'#E02020':'#6DD400'}" class="resset">
<span v-if="dataObj.floor_average_visited&&dataObj.floor_average_visited.lastWeekDayRatio.toString().includes('-')">-</span>
{{dataObj.floor_average_visited?dataObj.floor_average_visited.lastWeekDay:'--'}}层
</i></span>
</div>
</div>
</div>
<div class="container_center_all">
<img src="./imgs/shebeizaixianqing.png" alt="">
<div class="container_center_all_totla">
<div class="container_center_all_div">设备在线情况</div>
<div class="container_center_all_right">
<span style="color:#597EF7;fontSize:24px">{{deviceNum.total?deviceNum.total:'--'}}</span>
<span style="color:#fff;fontSize:12px">在线:<i style="color:#6DD400" class="resset">{{deviceNum.online?deviceNum.online:'--'}}</i></span>
<span style="color:#fff;fontSize:12px">离线:<i style="color:#E02020" class="resset">{{deviceNum.offline?deviceNum.offline:'--'}}</i></span>
</div>
</div>
</div>
</div>
<!-- <div class="live_chart">
<div class="chart" :id="chartId"></div>
</div> -->
</div>
</template>
<script>
export default {
inject: ["addModule"],
props: {
mallId: Number,
},
data() {
return {
dataObj: {},
deviceNum: {},
};
},
components: {},
watch: {
mallId: {
handler(newVal) {
if (newVal) {
this.loadData();
}
},
immediate: true,
},
},
methods: {
loadData() {
let dateStr = dateUnit.dateFormat(new Date(), "yyyy-MM-dd");
// let params = {
// chartIds: 471,
// orgType: "mall",
// orgIds: this.mallId,
// dateType: "day",
// startDate: dateStr,
// endDate: dateStr,
// };
let params = {
mallId: this.mallId,
countDate: dateStr,
};
this.$api.bigScreen.getLiveInfo(params).then((res) => {
this.dataObj = res.data.data;
});
this.$api.bigScreen
.getDeviceInfo({
mallId: this.mallId,
status: 1,
page: 1,
pageSize: 1,
})
.then((res) => {
this.deviceNum = {
online: res.data.data && res.data.data.online,
offline: res.data.data && res.data.data.offline,
total: res.data.data && res.data.data.total,
};
});
},
},
created() {
this.addModule(this);
},
mounted() {},
};
</script>
<style lang="less" scoped>
.container_center {
width: 100%;
height: calc(100% - 30px);
display: flex;
flex-direction: column;
justify-content: space-around;
.container_center_all {
display: flex;
height: 20%;
align-items: center;
justify-content: space-between;
> img {
width: 42px;
height: 36px;
}
.container_center_all_totla {
width: calc(100% - 60px);
display: flex;
flex-direction: column;
.container_center_all_right {
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
> span {
flex: 1;
}
.small_title {
font-size: 18px;
}
}
.container_center_all_div {
color: #fff;
font-size: 16px;
}
}
}
}
.resset {
font-style: normal;
}
</style>