Commit 34eefc91 by 胡悦

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

2 parents 9abe597e e47ee55c
...@@ -23,4 +23,9 @@ const aftersaleother = params => { ...@@ -23,4 +23,9 @@ const aftersaleother = params => {
return request.get('brand/aftersaleother', params) return request.get('brand/aftersaleother', params)
} }
export default { getAfterSale, getMerchantAfterSale, aftersaleother } // 获取门店品牌售后其他信息
const afterMerchantSaleother = params => {
return request.get('merchant/aftersaleother', params)
}
export default { getAfterSale, aftersaleother,afterMerchantSaleother,getMerchantAfterSale }
...@@ -10,8 +10,7 @@ export default { ...@@ -10,8 +10,7 @@ export default {
getBrandList () { getBrandList () {
return request.get('brand/getBrandName', { return request.get('brand/getBrandName', {
req: { req: {
corporateGroupName: '集团1', queryTime: window.vm.getCurrentDate()
queryTime: '2022-06-23'
} }
}) })
} }
......
...@@ -4,7 +4,11 @@ var request = new Request() ...@@ -4,7 +4,11 @@ var request = new Request()
// window.$HTTP // window.$HTTP
export default { export default {
/**获取品牌---总体模块信息(包括:总客户:total,企微客户:wechat,企微群:wechatGroup,小程序:applet,公众号:publiccus 的基础数据 和 前五排行/后五排行 ) */ /**获取品牌---总体模块信息(包括:总客户:total,企微客户:wechat,企微群:wechatGroup,小程序:applet,公众号:publiccus 的基础数据 和 前五排行/后五排行 ) */
getBrandOverallbase(params){ getBrandOverallbase (req) {
return request.get('brand/overallbase', params) return request.get('brand/overallbase', { req })
},
/*获取品牌---总体模块趋势图指标(包括:总客户:total,企微客户:wechat,企微群:wechatGroup,小程序:applet,公众号:publiccus) */
getBrandOveralltrend (req) {
return request.get('brand/overalltrend', { req })
} }
} }
...@@ -3,13 +3,13 @@ class Request { ...@@ -3,13 +3,13 @@ class Request {
constructor(_request_) { constructor(_request_) {
this.DOMAIN = _request_ ? _request_.baseURL : this.DOMAIN this.DOMAIN = _request_ ? _request_.baseURL : this.DOMAIN
} }
get(url, params, returnAll) { get (url, params, returnAll) {
return this.request('GET', url, params, returnAll) return this.request('GET', url, params, returnAll)
} }
post(url, params, returnAll) { post (url, params, returnAll) {
return this.request('POST', url, params, returnAll) return this.request('POST', url, params, returnAll)
} }
request(method, url, params, returnAll) { request (method, url, params, returnAll) {
var requestConfig = { var requestConfig = {
headers: { headers: {
// 'Content-Type': method == 'GET' ? 'application/json' : 'application/x-www-form-urlencoded; charset=UTF-8' // 'Content-Type': method == 'GET' ? 'application/json' : 'application/x-www-form-urlencoded; charset=UTF-8'
...@@ -17,7 +17,7 @@ class Request { ...@@ -17,7 +17,7 @@ class Request {
}, },
method method
} }
params.req.corporateGroupName = '集团1'
if (method === 'GET') { if (method === 'GET') {
var paramsArray = [] var paramsArray = []
Object.keys(params.req).forEach(key => paramsArray.push('req.' + key + '=' + params.req[key])) Object.keys(params.req).forEach(key => paramsArray.push('req.' + key + '=' + params.req[key]))
...@@ -39,9 +39,9 @@ class Request { ...@@ -39,9 +39,9 @@ class Request {
.then(res => { .then(res => {
return res.json() return res.json()
}) })
// .catch(error => { // .catch(error => {
// alert(error) // alert(error)
// }) // })
} }
} }
......
...@@ -178,7 +178,7 @@ export default { ...@@ -178,7 +178,7 @@ export default {
this.setAnamiteText() this.setAnamiteText()
}, },
setAnamiteText() { setAnamiteText() {
document.querySelector(`.${this.id}`).style = `--step:${this.mainValue}` if( document.querySelector(`.${this.id}`)) document.querySelector(`.${this.id}`).style = `--step:${this.mainValue}`
}, },
//高亮 //高亮
pieActive() { pieActive() {
......
<template> <template>
<div class="tabs"> <div class="tabs">
<div class="tab pointer"> <div class="tab pointer">
<div class="tab-left box"> <div
class="tab-left box"
@click="changeType('total')"
>
<div class="tab-total-box"> <div class="tab-total-box">
<div class="total-title-box flex"> <div class="total-title-box flex">
<div class="title inline total">客户总数</div> <div class="title inline total">客户总数</div>
...@@ -29,6 +32,7 @@ ...@@ -29,6 +32,7 @@
<div <div
:key="index" :key="index"
class="item flex" class="item flex"
@click="changeType(i.key)"
> >
<div class="item-title">{{i.title}}</div> <div class="item-title">{{i.title}}</div>
<transition-number <transition-number
...@@ -48,41 +52,82 @@ ...@@ -48,41 +52,82 @@
</template> </template>
</div> </div>
</div> </div>
<div class=" <div class="tabs-content box">
tabs-content <div class="tabs-title">客户增长趋势</div>
box"> <div class="tabs-content-chart flex">
<div class="title inline">客户增长趋势</div> <div
class="line"
id="total-chart"
></div>
<div class="table user-select pointer">
<div class="table-head">
<template v-for="(i,index) in tabHead">
<div
:class="['table-head-item flex',{'active':index == tabIndex}]"
:key="index"
@click="changeTab(index)"
>
{{i}}
</div>
</template>
</div>
<div class="table-body flex">
<template v-for="(i,index) in tabIndex == 0 ? pageData[tabType].top : pageData[tabType].last">
<div
class="table-body-item flex"
:key="index"
>
<div class="table-num flex">{{index + 1}}</div>
<div class="table-key">
<marquee
:direction="directionTimer"
:delay="delayTimer"
:text="i.name"
/>
</div>
<div class="table-value">{{i.num}}</div>
</div>
</template>
</div>
</div>
</div>
</div> </div>
</div> </div>
</template> </template>
<script type="text/ecmascript-6"> <script type="text/ecmascript-6">
const tabs = [
{
title: '企微客户',
key: 'wechat'
},
{
title: '企微群数',
key: 'wechatGroup'
},
{
title: '小程序客户数',
key: 'applet'
},
{
title: '公众号客户数',
key: 'publiccus'
}
]
let tabHead = ['前5品牌', '后5品牌']
import { changeMixin } from '@/mixins' import { changeMixin } from '@/mixins'
import * as echarts from 'echarts'
export default { export default {
name: 'ViewTabs', name: 'ViewTabs',
mixins: [changeMixin], mixins: [changeMixin],
data () { data () {
return { return {
tabs: [ tabs,
{ tabHead,
title: '企微客户', tabType: 'total',
key: 'wechat' tabIndex: 0,
}, delayTimer: 3000,
{ directionTimer: 3000,
title: '企微群数',
key: 'wechatGroup'
},
{
title: '小程序客户数',
key: 'applet'
},
{
title: '公众号客户数',
key: 'publiccus'
}
],
queryItem: 'total',
id: '10086',
pageData: { pageData: {
total: {}, total: {},
wechat: {}, wechat: {},
...@@ -104,24 +149,49 @@ export default { ...@@ -104,24 +149,49 @@ export default {
this.getBrandOverallbase('wechatGroup') this.getBrandOverallbase('wechatGroup')
this.getBrandOverallbase('applet') this.getBrandOverallbase('applet')
this.getBrandOverallbase('publiccus') this.getBrandOverallbase('publiccus')
this.getBrandOveralltrend('total')
},
changeType (type) {
console.log(type)
this.tabType = type
this.getBrandOveralltrend(type)
},
changeTab (index) {
this.tabIndex = index
}, },
getBrandOverallbase (queryItem) { getBrandOverallbase (queryItem) {
const params = { const params = {
req: { queryItem,
queryItem, queryTime: '2022-06-23',
queryTime: '2022-06-23', corporateGroupName: '集团1',
corporateGroupName: '集团1', queryType: 0
queryType: 0
}
} }
this.api.overview.getBrandOverallbase(params).then(res => { this.api.overview.getBrandOverallbase(params).then(({ code, data }) => {
const { code, data } = res
if (code == 0) { if (code == 0) {
let [dataList] = data.dataList let [dataList] = data.dataList
console.log(`________________${queryItem}_______________________`, data) dataList.top = this.ObjectToArray(dataList.topList)
dataList.last = this.ObjectToArray(dataList.lastList)
this.pageData[queryItem] = dataList this.pageData[queryItem] = dataList
} }
}) })
},
ObjectToArray (obj) {
let arr = []
obj = JSON.parse(obj)
Object.keys(obj).map(name => arr.push({ name, num: obj[name] }))
return arr
},
getBrandOveralltrend (queryItem) {
const params = {
queryItem,
querystartTime: '2022-05-23',
queryendTime: '2022-06-23',
corporateGroupName: '集团1',
queryType: 0
}
this.api.overview.getBrandOverallbase(params).then(res => {
console.log(`________________${queryItem}_______________________`, res)
})
} }
} }
} }
...@@ -200,6 +270,74 @@ export default { ...@@ -200,6 +270,74 @@ export default {
} }
&-content { &-content {
height: 24.4vh; height: 24.4vh;
box-sizing: border-box;
padding: 1vh 8px;
display: flex;
flex-direction: column;
.tabs-title {
font-size: 12px;
color: #e8e8e8;
}
&-chart {
height: 20.2vh;
margin-top: auto;
justify-content: space-between;
gap: 0 8px;
.line {
flex: 7;
background: #022;
}
.table {
flex: 3;
background: #262525;
&-head {
display: grid;
grid-template-columns: repeat(2, 50%);
height: 2.4vh;
&-item {
height: 100%;
font-size: 10px;
background: #353535;
color: rgba($color: #fff, $alpha: 0.7);
justify-content: center;
&:hover {
opacity: 0.9;
}
}
.active {
background: #eb6001;
color: #fff;
}
}
&-body {
height: calc(100% - 2.4vh);
flex-direction: column;
justify-content: space-between;
&-item {
line-height: 3.4vh;
width: 100%;
font-size: 10px;
color: #ffffff;
.table-num {
width: 22px;
justify-content: center;
color: #606266;
}
.table-key {
width: calc(100% - 96px);
}
.tab-value {
width: 52px;
margin-left: auto;
padding-right: 4px;
}
}
}
}
> div {
height: 100%;
}
}
} }
} }
</style> </style>
...@@ -15,7 +15,7 @@ export default { ...@@ -15,7 +15,7 @@ export default {
}, },
methods: { methods: {
getClientData() { getClientData() {
let clientApi = this.isBrand ? 'overalldistribution' : 'merchantOveralldistribution' let clientApi = !this.isBrand ? 'overalldistribution' : 'merchantOveralldistribution'
const params = { const params = {
req: { req: {
corporateGroupName: '集团1', corporateGroupName: '集团1',
...@@ -27,6 +27,9 @@ export default { ...@@ -27,6 +27,9 @@ export default {
} }
if (this.isBrand) params.req.brandName = this.brandName if (this.isBrand) params.req.brandName = this.brandName
this.api.customer[clientApi](params).then(res => { this.api.customer[clientApi](params).then(res => {
this.clientData = []
this.brandList = []
this.distributionRank = ''
if (res.data.dataList.length > 0) { if (res.data.dataList.length > 0) {
let distribution = JSON.parse(res.data.dataList[0].distribution) let distribution = JSON.parse(res.data.dataList[0].distribution)
const keys = Object.keys(distribution) const keys = Object.keys(distribution)
...@@ -37,13 +40,10 @@ export default { ...@@ -37,13 +40,10 @@ export default {
}) })
}) })
this.distributionRank = JSON.parse(res.data.dataList[0].distributionRank) this.distributionRank = JSON.parse(res.data.dataList[0].distributionRank)
} else {
this.clientData = []
} }
}) })
}, },
init(newVal) { init(newVal) {
console.log(newVal, 99999999999999999)
this.isBrand = false this.isBrand = false
if (newVal.brand) { if (newVal.brand) {
this.isBrand = true this.isBrand = true
......
...@@ -15,7 +15,7 @@ export default { ...@@ -15,7 +15,7 @@ export default {
}, },
methods: { methods: {
getSalesData() { getSalesData() {
let salesApi = this.isBrand ? 'getSales' : 'getMerchantSales' let salesApi = !this.isBrand ? 'getSales' : 'getMerchantSales'
const params = { const params = {
req: { req: {
corporateGroupName: '集团1', corporateGroupName: '集团1',
...@@ -27,6 +27,9 @@ export default { ...@@ -27,6 +27,9 @@ export default {
} }
if (this.isBrand) params.req.brandName = this.brandName if (this.isBrand) params.req.brandName = this.brandName
this.api.sales[salesApi](params).then(res => { this.api.sales[salesApi](params).then(res => {
this.salesData = []
this.typeRanking = ''
this.brandList = []
if (res.data.dataList.length > 0) { if (res.data.dataList.length > 0) {
let typeNum = JSON.parse(res.data.dataList[0].typeNum) let typeNum = JSON.parse(res.data.dataList[0].typeNum)
Object.keys(typeNum).forEach((item, index) => { Object.keys(typeNum).forEach((item, index) => {
...@@ -37,8 +40,6 @@ export default { ...@@ -37,8 +40,6 @@ export default {
}) })
this.typeRanking = JSON.parse(res.data.dataList[0].typeRanking) this.typeRanking = JSON.parse(res.data.dataList[0].typeRanking)
}else{
this.salesData = []
} }
}) })
}, },
......
...@@ -8,13 +8,18 @@ ...@@ -8,13 +8,18 @@
<template> <template>
<div> <div>
<div class="title">售后客户价值分析</div> <div class="title">售后客户价值分析</div>
<div class="analyze-content" :style="{ height: height - 4.9 + 'vh' }"> <template v-if="barData.length > 0">
<div class="content-left bg"> <div class="analyze-content" :style="{ height: height - 4.9 + 'vh' }">
<div id="analyzeBar" style="height: 100%"></div> <div class="content-left bg">
</div> <div id="analyzeBar" style="height: 100%"></div>
<div class="contetn-right bg"> </div>
<pie-chart :id="chart.id" :list="analyzeData" :height="height - 4.9 + 'vh'" :radius="chart.radius"></pie-chart> <div class="contetn-right bg">
<pie-chart :id="chart.id" :list="analyzeData" :height="height - 4.9 + 'vh'" :radius="chart.radius"></pie-chart>
</div>
</div> </div>
</template>
<div class="empty" :style="{ height: height - 4.9 + 'vh' }" v-else>
<img src="../../assets/images/empty.png" alt="" />
</div> </div>
</div> </div>
</template> </template>
...@@ -22,9 +27,11 @@ ...@@ -22,9 +27,11 @@
<script> <script>
import * as echarts from 'echarts' import * as echarts from 'echarts'
import datas from '../../utils/data' import datas from '../../utils/data'
import { changeMixin } from '../../mixins/index'
export default { export default {
name: 'Analyze', name: 'Analyze',
props: ['height'], props: ['height'],
mixins: [changeMixin],
data() { data() {
return { return {
analyzeData: [], analyzeData: [],
...@@ -35,15 +42,12 @@ export default { ...@@ -35,15 +42,12 @@ export default {
barChart: '', barChart: '',
option: {}, option: {},
barData: [], barData: [],
key: 1 key: 1,
isBrand: false,
brandName: ''
} }
}, },
mounted() { mounted() {
this.barChart = echarts.init(document.getElementById('analyzeBar'))
// resize
window.addEventListener('resize', () => {
this.barChart.resize()
})
this.init() this.init()
}, },
methods: { methods: {
...@@ -51,6 +55,11 @@ export default { ...@@ -51,6 +55,11 @@ export default {
this.getValueType() this.getValueType()
}, },
getChart() { getChart() {
this.barChart = echarts.init(document.getElementById('analyzeBar'))
// resize
window.addEventListener('resize', () => {
this.barChart.resize()
})
this.option = { this.option = {
grid: { grid: {
left: '3%', left: '3%',
...@@ -114,6 +123,7 @@ export default { ...@@ -114,6 +123,7 @@ export default {
} }
] ]
} }
this.barChart.clear()
this.barChart.setOption(this.option) this.barChart.setOption(this.option)
// 鼠标划入 // 鼠标划入
this.barChart.on('mouseover', data => { this.barChart.on('mouseover', data => {
...@@ -121,24 +131,32 @@ export default { ...@@ -121,24 +131,32 @@ export default {
}) })
}, },
getValueType() { getValueType() {
let analyzeApi = !this.isBrand ? 'aftersaleother' : 'afterMerchantSaleother'
const params = { const params = {
req: { req: {
corporateGroupName: '集团1', corporateGroupName: '集团1',
queryItem: 'valueanalyse', queryItem: 'valueanalyse',
// queryTime: this.getCurrentDate,
queryTime: '2022-06-23', queryTime: '2022-06-23',
queryType: 0 queryType: this.watchReportParams.reportType
} }
} }
this.api.afterSales.aftersaleother(params).then(res => { if (this.isBrand) params.req.brandName = this.brandName
const reqData = JSON.parse(res.data.dataList[0].distribution) this.api.afterSales[analyzeApi](params).then(res => {
this.distributionRank = JSON.parse(res.data.dataList[0].distributionRank) this.analyzeData = []
this.barData = [] this.barData = []
for (let i in reqData) { if (res.data.dataList.length > 0) {
this.barData.push(reqData[i]) const reqData = JSON.parse(res.data.dataList[0].distribution)
this.distributionRank = JSON.parse(res.data.dataList[0].distributionRank)
this.barData = []
for (let i in reqData) {
this.barData.push(reqData[i])
}
this.$nextTick(() => {
this.getChart()
this.initPieData()
})
} }
this.getChart()
this.initPieData()
}) })
}, },
initPieData(name) { initPieData(name) {
...@@ -149,6 +167,14 @@ export default { ...@@ -149,6 +167,14 @@ export default {
value: distributionRank[item] value: distributionRank[item]
}) })
}) })
},
init(newVal) {
this.isBrand = false
if (newVal && newVal.brand) {
this.isBrand = true
this.brandName = newVal.brand.name
}
this.getValueType()
} }
} }
} }
......
...@@ -8,29 +8,36 @@ ...@@ -8,29 +8,36 @@
<template> <template>
<div> <div>
<div class="title">售后车辆里程</div> <div class="title">售后车辆里程</div>
<div class="flex"> <template v-if="mileageData.length > 0">
<pie-chart :id="chart.id" :list="mileageData" :height="height - 4.9 + 'vh'" :radius="chart.radius" @pieAction="pieAction"></pie-chart> <div class="flex">
<div class="ranking-container"> <pie-chart :id="chart.id" :list="mileageData" :height="height - 4.9 + 'vh'" :radius="chart.radius" @pieAction="pieAction"></pie-chart>
<div class="ranking-title"> <div class="ranking-container">
<div class="ranking-title-brand">品牌</div> <div class="ranking-title">
<div>客户数</div> <div class="ranking-title-brand">品牌</div>
</div> <div>客户数</div>
<div class="ranking"> </div>
<div class="brand flex" v-for="(item, index) in rankingData" :key="index"> <div class="ranking">
<span class="brand-num">{{ index + 1 }}</span> <div class="brand flex" v-for="(item, index) in rankingData" :key="index">
<marquee class="marquee" :direction="directionTimer" :delay="delayTimer" :text="item.brand" /> <span class="brand-num">{{ index + 1 }}</span>
<span>{{ item.value }}</span> <marquee class="marquee" :direction="directionTimer" :delay="delayTimer" :text="item.brand" />
<span>{{ item.value }}</span>
</div>
</div> </div>
</div> </div>
</div> </div>
</template>
<div class="empty" :style="{ height: height - 4.9 + 'vh' }" v-else>
<img src="../../assets/images/empty.png" alt="" />
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import { changeMixin } from '../../mixins/index'
export default { export default {
name: 'Mileage', name: 'Mileage',
props: ['height'], props: ['height'],
mixins: [changeMixin],
data() { data() {
return { return {
mileageData: [], mileageData: [],
...@@ -42,7 +49,9 @@ export default { ...@@ -42,7 +49,9 @@ export default {
}, },
delayTimer: 3000, delayTimer: 3000,
directionTimer: 3000, directionTimer: 3000,
brandList: this.list brandList: this.list,
isBrand: false,
brandName: ''
} }
}, },
mounted() { mounted() {
...@@ -50,29 +59,35 @@ export default { ...@@ -50,29 +59,35 @@ export default {
}, },
methods: { methods: {
getValueType() { getValueType() {
let mileageApi = !this.isBrand ? 'aftersaleother' : 'afterMerchantSaleother'
const params = { const params = {
req: { req: {
corporateGroupName: '集团1', corporateGroupName: '集团1',
queryItem: 'mileage', queryItem: 'mileage',
// queryTime: this.getCurrentDate,
queryTime: '2022-06-23', queryTime: '2022-06-23',
queryType: 0 queryType: this.watchReportParams.reportType
} }
} }
this.api.afterSales.aftersaleother(params).then(res => { if (this.isBrand) params.req.brandName = this.brandName
let distribution = JSON.parse(res.data.dataList[0].distribution) this.api.afterSales[mileageApi](params).then(res => {
// console.log() this.mileageData = []
const keys = Object.keys(distribution) this.rankingData = []
keys.forEach((item, index) => { if (res.data.dataList.length > 0) {
this.mileageData.push({ let distribution = JSON.parse(res.data.dataList[0].distribution)
name: item, // console.log()
value: distribution[item] const keys = Object.keys(distribution)
keys.forEach((item, index) => {
this.mileageData.push({
name: item,
value: distribution[item]
})
}) })
}) this.distributionRank = JSON.parse(res.data.dataList[0].distributionRank)
this.distributionRank = JSON.parse(res.data.dataList[0].distributionRank) }
}) })
}, },
pieAction(data) { pieAction(data) {
this.rankingData = []
let distributionRank = this.distributionRank[data.name] let distributionRank = this.distributionRank[data.name]
for (const key in distributionRank) { for (const key in distributionRank) {
this.rankingData.push({ this.rankingData.push({
...@@ -80,6 +95,14 @@ export default { ...@@ -80,6 +95,14 @@ export default {
value: distributionRank[key] value: distributionRank[key]
}) })
} }
},
init(newVal) {
this.isBrand = false
if (newVal && newVal.brand) {
this.isBrand = true
this.brandName = newVal.brand.name
}
this.getValueType()
} }
} }
} }
......
...@@ -38,7 +38,7 @@ export default { ...@@ -38,7 +38,7 @@ export default {
}, },
methods: { methods: {
pieAction(data) { pieAction(data) {
this.brandList = Object.keys(this.distributionRank[data.name]) this.brandList = this.distributionRank&&this.distributionRank[data.name]&&Object.keys(this.distributionRank[data.name])
} }
} }
} }
......
...@@ -38,7 +38,7 @@ export default { ...@@ -38,7 +38,7 @@ export default {
}, },
methods: { methods: {
pieAction(data) { pieAction(data) {
this.brandList = Object.keys(this.distributionRank[data.name]) this.brandList = this.distributionRank&&this.distributionRank[data.name]&&Object.keys(this.distributionRank[data.name])
} }
} }
} }
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
</div> </div>
<div class="container flex"> <div class="container flex">
<template v-if="clientData.length > 0"> <template v-if="clientData.length > 0">
<pie-chart :id="chart.id" :list="clientData" @pieAction="pieAction"></pie-chart> <pie-chart :id="chart.id" :list="clientData" :colors="chart.colors" @pieAction="pieAction"></pie-chart>
<ran-king :list="brandList"></ran-king> <ran-king :list="brandList"></ran-king>
</template> </template>
<div class="empty" style="height:12.7vh" v-else> <div class="empty" style="height:12.7vh" v-else>
...@@ -31,13 +31,15 @@ export default { ...@@ -31,13 +31,15 @@ export default {
return { return {
type: 'gender', type: 'gender',
chart: { chart: {
id: 'sex-pie' id: 'sex-pie',
colors:["#EB6001","#BF98FF","#FF6E76"]
} }
} }
}, },
methods:{ methods:{
pieAction(data){ pieAction(data){
this.brandList=Object.keys(this.distributionRank[data.name]) console.log(this.distributionRank,'客户性别')
this.brandList = this.distributionRank&&this.distributionRank[data.name]&&Object.keys(this.distributionRank[data.name])
} }
} }
} }
......
...@@ -38,7 +38,7 @@ export default { ...@@ -38,7 +38,7 @@ export default {
}, },
methods: { methods: {
pieAction(data) { pieAction(data) {
this.brandList = Object.keys(this.typeRanking[data.name]) this.brandList = this.typeRanking&&this.typeRanking[data.name]&&Object.keys(this.typeRanking[data.name])
} }
} }
} }
......
...@@ -11,12 +11,12 @@ ...@@ -11,12 +11,12 @@
<span class="icon"></span> <span class="icon"></span>
<span>进店类型</span> <span>进店类型</span>
</div> </div>
<div class="flex container"> <div class="flex container">
<template v-if="salesData.length > 0"> <template v-if="salesData.length > 0">
<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>
</template> </template>
<div class="empty" style="height:12.7vh" v-else> <div class="empty" style="height: 12.7vh" v-else>
<img src="../../assets/images/empty.png" alt="" /> <img src="../../assets/images/empty.png" alt="" />
</div> </div>
</div> </div>
...@@ -38,7 +38,7 @@ export default { ...@@ -38,7 +38,7 @@ export default {
}, },
methods: { methods: {
pieAction(data) { pieAction(data) {
this.brandList=Object.keys(this.typeRanking[data.name]) this.brandList = this.typeRanking && this.typeRanking[data.name] && Object.keys(this.typeRanking[data.name])
} }
} }
} }
......
...@@ -38,7 +38,7 @@ export default { ...@@ -38,7 +38,7 @@ export default {
}, },
methods: { methods: {
pieAction(data) { pieAction(data) {
this.brandList = Object.keys(this.typeRanking[data.name]) this.brandList = this.typeRanking&&this.typeRanking[data.name]&&Object.keys(this.typeRanking[data.name])
} }
} }
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!