relevanceDetailChart.vue
2.42 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
<template>
<div style="overflow:hidden">
<div class="detail-box">
<div class="chart-box">
<img
:src="floorPath"
id="shopfloorpic"
@load="imgLoaded('shopfloorpic')"
class="detail-floor-img"
/>
<div id="linkgraphChart" class="graph-box graph-chart-container"></div>
</div>
<div class="floor-nav">
<div v-for="(item,index) in floorData" :key="index" @click="changeFloor(item,index)" :class="{'floorTab':true,'activefloor':index==cindex}">{{item.name}}</div>
</div>
</div>
</div>
</template>
<script>
import {mapState} from 'vuex'
export default {
data() {
return {
floorPath:"",
imgWidth: 0,
cindex:0,
floorData:""
}
},
computed: {
...mapState(["account"])
},
methods:{
getFloorData() {
let account_id = this.$cookie.get('accountId');
let localMallId = window.sessionStorage.getItem('mallId');
this.dataMsg = this.$t("echartsTitle.loading");
this.tableData = [];
var tabelParams = {
accountId: account_id,
mallId: localMallId,
status: null,
page: 0,
pageSize: 100
// _t: Date.parse(new Date()) / 1000
};
this.$api.base
.floor(tabelParams, null, true)
.then(data => {
var result = data.data.data;
this.floorData = result;
this.floorPath =
window._vionConfig.picUrl +
result[0].floorPlan;
})
.catch(error => {});
},
imgLoaded(domId){
const { offsetWidth } = this.queryIdDom(domId);
this.imgWidth = offsetWidth > this.imgWidth ? offsetWidth : this.imgWidth;
console.log(this.imgWidth )
this.$nextTick(() => {
});
},
changeFloor(item,index){
this.floorPath =
window._vionConfig.picUrl +
item.floorPlan;
this.cindex = index;
}
},
created(){
console.log(this.account)
this.getFloorData()
}
}
</script>
<style scoped>
.detail-box{
display:flex;
flex-direction: row;
margin-top:50px
}
.chart-box{
flex:1;
}
.detail-floor-img{
width:100%;
}
.floor-nav{
width: 100px;
}
.floorTab{
height:25px;
width:80px;
text-align: center;
line-height: 25px;
border:1px solid #ccc;
border-radius: 5px;
margin-top: 10px;
overflow: hidden;
}
.activefloor{
background: #4BBEFF;
color: #fff;
border: 1px solid #4BBEFF;
}
</style>