Commit 3621f59b by 胡悦

提交

1 parent 75c12b58
...@@ -99,5 +99,16 @@ img { ...@@ -99,5 +99,16 @@ img {
} }
.container { .container {
margin-top:0.5vh; margin-top:0.5vh;
} }
.empty {
display: flex;
width: 100%;
height: calc(100% - 4.1vh);
align-items: center;
justify-content: center;
img {
width: 20vh;
height: 9.5vh;
}
}
\ No newline at end of file \ No newline at end of file
...@@ -3,28 +3,36 @@ ...@@ -3,28 +3,36 @@
* @Author: huyue * @Author: huyue
* @Date: 2022-06-23 15:05:21 * @Date: 2022-06-23 15:05:21
* @LastEditors: huyue * @LastEditors: huyue
* @LastEditTime: 2022-06-28 19:10:50 * @LastEditTime: 2022-06-29 13:59:45
--> -->
<template> <template>
<div class="flow-box"> <div>
<div class="flow-left"> <!-- <div v-show="!hasData">
<div class="title inline">客流转化</div> <div class="title">客流转化</div>
<div class="chart-box"> <div class="empty">
<div id="flow" :style="{ height: height - 4.1 + 'vh' }"></div> <img src="../../assets/images/empty.png" alt="" />
</div> </div>
</div> </div> -->
<div class="flow-right"> <div class="flow-box">
<div class="ranking-title"> <div class="flow-left">
<div @click="isActive = 1" :class="isActive == 1 ? 'active' : ''">前5品牌</div> <div class="title inline">客流转化{{ hasData }}</div>
<div @click="isActive = 2" :class="isActive == 2 ? 'active' : ''">后5品牌</div> <div class="chart-box">
<div id="flow" :style="{ height: height - 4.1 + 'vh' }"></div>
</div>
</div> </div>
<div class="ranking-content"> <div class="flow-right">
<div class="ranking-item" v-for="(item, index) in flowData" :key="index"> <div class="ranking-title">
<span>{{ item.id }}</span> <div @click="isActive = 1" :class="isActive == 1 ? 'active' : ''">前5品牌</div>
<span class="ranking-name"> <div @click="isActive = 2" :class="isActive == 2 ? 'active' : ''">后5品牌</div>
<marquee :direction="directionTimer" :delay="delayTimer" :text="item.name" /> </div>
</span> <div class="ranking-content">
<span class="ranking-text">{{ item.num }}</span> <div class="ranking-item" v-for="(item, index) in flowData" :key="index">
<span>{{ item.id }}</span>
<span class="ranking-name">
<marquee :direction="directionTimer" :delay="delayTimer" :text="item.name" />
</span>
<span class="ranking-text">{{ item.num }}</span>
</div>
</div> </div>
</div> </div>
</div> </div>
...@@ -32,10 +40,12 @@ ...@@ -32,10 +40,12 @@
</template> </template>
<script> <script>
import { changeMixin } from '@/mixins'
import datas from '../../utils/data' import datas from '../../utils/data'
import * as echarts from 'echarts' import * as echarts from 'echarts'
export default { export default {
name: 'Flow', name: 'Flow',
mixins: [changeMixin],
props: ['height'], props: ['height'],
data() { data() {
return { return {
...@@ -98,7 +108,8 @@ export default { ...@@ -98,7 +108,8 @@ export default {
], ],
option: {}, option: {},
echartsFunnel: '', echartsFunnel: '',
funnelDom: '' funnelDom: '',
hasData: false
} }
}, },
mounted() { mounted() {
...@@ -111,7 +122,8 @@ export default { ...@@ -111,7 +122,8 @@ export default {
this.init() this.init()
}, },
methods: { methods: {
init() { init(val) {
console.log(val)
this.getSaletTotal() this.getSaletTotal()
}, },
getSaletTotal() { getSaletTotal() {
...@@ -128,7 +140,8 @@ export default { ...@@ -128,7 +140,8 @@ export default {
res.data.dataList[0].num.forEach((item, index) => { res.data.dataList[0].num.forEach((item, index) => {
this.funnelData[index].value = item this.funnelData[index].value = item
}) })
this.draw() this.hasData = res.data.dataList[0].num.every(i => i != 0)
if (this.hasData) this.draw()
} }
}) })
}, },
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!