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,12 +3,19 @@ ...@@ -3,12 +3,19 @@
* @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>
<!-- <div v-show="!hasData">
<div class="title">客流转化</div>
<div class="empty">
<img src="../../assets/images/empty.png" alt="" />
</div>
</div> -->
<div class="flow-box"> <div class="flow-box">
<div class="flow-left"> <div class="flow-left">
<div class="title inline">客流转化</div> <div class="title inline">客流转化{{ hasData }}</div>
<div class="chart-box"> <div class="chart-box">
<div id="flow" :style="{ height: height - 4.1 + 'vh' }"></div> <div id="flow" :style="{ height: height - 4.1 + 'vh' }"></div>
</div> </div>
...@@ -29,13 +36,16 @@ ...@@ -29,13 +36,16 @@
</div> </div>
</div> </div>
</div> </div>
</div>
</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!