Commit 400dc1a2 by 李伟康

Merge branch 'dev_v1.0.0' of http://192.168.3.233:8090/gh/data-view into dev_v1.0.0

2 parents 6c44a6bd 0447caf7
/*
* @Description: 售后数据
* @Author: huyue
* @Date: 2022-06-28 16:55:48
* @LastEditors: huyue
* @LastEditTime: 2022-06-28 19:13:34
*/
import Request from '../request' import Request from '../request'
var request = new Request() var request = new Request()
...@@ -6,4 +13,9 @@ const getAfterSale = params => { ...@@ -6,4 +13,9 @@ const getAfterSale = params => {
return request.get('brand/aftersale', params) return request.get('brand/aftersale', params)
} }
export default { getAfterSale } // 获取品牌售后其他信息
const aftersaleother = params => {
return request.get('brand/aftersaleother', params)
}
export default { getAfterSale, aftersaleother }
...@@ -98,7 +98,18 @@ img { ...@@ -98,7 +98,18 @@ img {
margin-right: 6px; margin-right: 6px;
} }
} }
.container { .container{
margin-top:0.5vh; margin:0 8px;
} }
.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
<template> <template>
<div class="pie-box"> <div class="pie-box">
<div :id="id" :style="{ width: width, height: height }" class="pie-chart"></div> <div :id="id" :style="{ height: height }" class="pie-chart"></div>
<div class="center-content"> <div class="center-content">
<div :class="[id, 'center-content-num']"></div> <div :class="[id, 'center-content-num']"></div>
<div class="center-content-desc">{{ numDesc }}</div> <div class="center-content-desc">{{ numDesc }}</div>
......
<template> <template>
<div class="ranking-container"> <div class="ranking-container">
<div class="title">品牌排名</div> <div class="ranking-title">品牌排名</div>
<div class="ranking"> <div class="ranking">
<div class="brand flex" v-for="(item, index) in brandList" :key="index"> <div class="brand flex" v-for="(item, index) in brandList" :key="index">
<span class="brand-num">{{ index + 1 }}</span> <span class="brand-num">{{ index + 1 }}</span>
...@@ -36,27 +36,27 @@ export default { ...@@ -36,27 +36,27 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.ranking-container { .ranking-container {
margin-left: 0.6vw; flex: 1;
margin-left: 8px;
box-sizing: border-box; box-sizing: border-box;
height: 12.7vh; height: 12.7vh;
background: #262525; background: #262525;
.title { .ranking-title {
width: 6.7vw; width: 100%;
background: rgba(53, 53, 53, 0.6); background: rgba(53, 53, 53, 0.6);
font-size: 10px; font-size: 10px;
color: #eb6001; color: #eb6001;
font-weight: 400; font-weight: 400;
text-align: center; text-align: center;
line-height: 2.4vh; padding: 0.4vh 0;
box-sizing: border-box;
} }
.ranking { .ranking {
font-size: 10px; font-size: 10px;
color: #ffffff; color: #ffffff;
letter-spacing: 0; letter-spacing: 0;
font-weight: 400; font-weight: 400;
padding-left: 0.6vw; padding:0.1vh 0 0.4vh 8px;
padding-top: 0.1vh;
padding-bottom: 0.4vh;
.brand { .brand {
line-height: 1.9vh; line-height: 1.9vh;
.brand-num { .brand-num {
...@@ -64,7 +64,7 @@ export default { ...@@ -64,7 +64,7 @@ export default {
margin-right: 0.6vw; margin-right: 0.6vw;
} }
.marquee { .marquee {
width: calc(100% - 2.2vw); // width: calc(100% - 2.2vw);
height: 1.9vh; height: 1.9vh;
} }
} }
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* @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 11:40:13 * @LastEditTime: 2022-06-29 11:30:36
--> -->
<template> <template>
<div> <div>
...@@ -13,8 +13,9 @@ ...@@ -13,8 +13,9 @@
<div id="analyzeBar" style="height: 100%"></div> <div id="analyzeBar" style="height: 100%"></div>
</div> </div>
<div class="contetn-right bg"> <div class="contetn-right bg">
<pie-chart :id="chart.id" :list="analyzeData" :height="height - 4.9 + 'vh'" :radius="chart.radius" @pieAction="pieAction"></pie-chart> <!-- <pie-chart :id="chart.id" :list="analyzeData" :height="height - 4.9 + 'vh'" :radius="chart.radius" @pieAction="pieAction">
</div> </pie-chart> -->
</div>
</div> </div>
</div> </div>
</template> </template>
...@@ -27,25 +28,40 @@ export default { ...@@ -27,25 +28,40 @@ export default {
props: ['height'], props: ['height'],
data() { data() {
return { return {
barChart: '', analyzeData: [],
chart: { chart: {
id: 'analyzePie', id: 'analyzePie',
radius:['60%', '78%'] radius: ['60%', '78%']
}, },
analyzeData:[], barChart: '',
option: {}, option: {},
barData: [] barData: []
} }
}, },
mounted() { mounted() {
this.getChart() this.barChart = echarts.init(document.getElementById('analyzeBar'))
// resize
window.addEventListener('resize', () => {
this.barChart.resize()
})
this.init()
}, },
methods: { methods: {
pieAction(data) {
// let distributionRank = this.distributionRank[data.name]
// for (const key in distributionRank) {
// this.rankingData.push({
// brand: key,
// value: distributionRank[key]
// })
// }
// console.log(this.rankingData, '================')
},
init() {
this.getValueType()
},
getChart() { getChart() {
var chartDom = document.getElementById('analyzeBar') this.option = {
var myChart = echarts.init(chartDom)
var option
option = {
grid: { grid: {
left: '3%', left: '3%',
right: '4%', right: '4%',
...@@ -55,7 +71,7 @@ export default { ...@@ -55,7 +71,7 @@ export default {
}, },
yAxis: { yAxis: {
type: 'category', type: 'category',
data: this.yData, data: datas.Customer.valueType.value.map(item => item.name),
splitLine: { splitLine: {
show: false show: false
}, },
...@@ -77,7 +93,8 @@ export default { ...@@ -77,7 +93,8 @@ export default {
}, },
series: [ series: [
{ {
data: [120, 200, 150, 80, 70, 110, 130, 300], // data: [120, 200, 150, 80, 70, 110, 130, 300],
data: this.barData,
type: 'bar', type: 'bar',
barWidth: 12, barWidth: 12,
itemStyle: { itemStyle: {
...@@ -119,20 +136,17 @@ export default { ...@@ -119,20 +136,17 @@ export default {
} }
} }
this.api.afterSales.aftersaleother(params).then(res => { this.api.afterSales.aftersaleother(params).then(res => {
console.log(res)
const reqData = JSON.parse(res.data.dataList[0].distribution) const reqData = JSON.parse(res.data.dataList[0].distribution)
console.log(reqData)
this.barData = [] this.barData = []
for (let i in reqData) { for (let i in reqData) {
this.barData.push(reqData[i]) this.barData.push(reqData[i])
} }
console.log(this.barData)
this.getChart() this.getChart()
}) })
},
pieAction(data){
} }
} }
} }
......
...@@ -77,7 +77,7 @@ export default { ...@@ -77,7 +77,7 @@ export default {
}) })
}, },
handleRankChange(value) { handleRankChange(value) {
console.log(value) // console.log(value)
} }
} }
} }
......
...@@ -53,7 +53,7 @@ export default { ...@@ -53,7 +53,7 @@ export default {
}) })
}) })
this.distributionRank = JSON.parse(res.data.dataList[0].distributionRank) this.distributionRank = JSON.parse(res.data.dataList[0].distributionRank)
console.log(this.distributionRank, 'mileage') // console.log(this.distributionRank, 'mileage')
}) })
}, },
pieAction(data) { pieAction(data) {
...@@ -64,7 +64,7 @@ export default { ...@@ -64,7 +64,7 @@ export default {
value: distributionRank[key] value: distributionRank[key]
}) })
} }
console.log(this.rankingData, '================') // console.log(this.rankingData, '================')
} }
} }
} }
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<span>客户级别</span> <span>客户级别</span>
</div> </div>
<div class="flex container"> <div class="flex container">
<pie-chart :id="chart.id"></pie-chart> <!-- <pie-chart :id="chart.id"></pie-chart> -->
<ran-king></ran-king> <ran-king></ran-king>
</div> </div>
</div> </div>
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<span>进店类型</span> <span>进店类型</span>
</div> </div>
<div class="container flex"> <div class="container flex">
<pie-chart :id="chart.id" :list="salesData" @pieAction="pieAction"></pie-chart> <!-- <pie-chart :id="chart.id" :list="salesData" @pieAction="pieAction"></pie-chart> -->
<ran-king :list="brandList"></ran-king> <ran-king :list="brandList"></ran-king>
</div> </div>
</div> </div>
......
...@@ -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 18:41:37 * @LastEditTime: 2022-06-29 14:39:49
--> -->
<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,8 +122,9 @@ export default { ...@@ -111,8 +122,9 @@ export default {
this.init() this.init()
}, },
methods: { methods: {
init() { init(val) {
this.getSaleTrans() console.log(val)
this.getSaletTotal()
}, },
getSaleTrans() { getSaleTrans() {
const params = { const params = {
...@@ -123,12 +135,13 @@ export default { ...@@ -123,12 +135,13 @@ export default {
} }
} }
this.api.sales.saleTotal(params).then(res => { this.api.sales.saleTotal(params).then(res => {
console.log(res.data) // console.log(res.data)
if (res.code === '0') { if (res.code === '0') {
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()
} }
}) })
}, },
...@@ -193,7 +206,7 @@ export default { ...@@ -193,7 +206,7 @@ export default {
this.echartsFunnel.setOption(this.option) this.echartsFunnel.setOption(this.option)
// 鼠标划入 // 鼠标划入
this.echartsFunnel.on('mouseover', data => { this.echartsFunnel.on('mouseover', data => {
console.log(data.data) // console.log(data.data)
}) })
} }
} }
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<span>信息来源</span> <span>信息来源</span>
</div> </div>
<div class="container flex"> <div class="container flex">
<pie-chart :id="chart.id"></pie-chart> <!-- <pie-chart :id="chart.id"></pie-chart> -->
<ran-king></ran-king> <ran-king></ran-king>
</div> </div>
</div> </div>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!