Commit 0447caf7 by 胡悦

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

2 parents 3621f59b c57e7d15
import Request from './request'
var request = new Request()
const client = {
// 获取品牌年龄/性别/购车年限
overalldistribution: params => {
return request.get('brand/overalldistribution', params)
}
}
export default client
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
*/ */
import Request from '../request' import Request from '../request'
const request = new Request() const request = new Request()
const getSales = params => { const getSales = params => {
return request.get('brand/sale', params) return request.get('brand/sale', params)
} }
......
...@@ -72,6 +72,7 @@ img { ...@@ -72,6 +72,7 @@ img {
.box { .box {
background: #1d1c1c; background: #1d1c1c;
overflow: hidden;
} }
.inline { .inline {
display: inline-block; display: inline-block;
...@@ -97,8 +98,8 @@ img { ...@@ -97,8 +98,8 @@ img {
margin-right: 6px; margin-right: 6px;
} }
} }
.container { .container{
margin-top:0.5vh; margin:0 8px;
} }
.empty { .empty {
......
<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>
...@@ -26,17 +26,13 @@ export default { ...@@ -26,17 +26,13 @@ export default {
type: String, type: String,
default: '12.7vh' default: '12.7vh'
}, },
width: {
type: String,
default: '7.2vw'
},
list: { list: {
type: Array, type: Array,
default: () => [] default: () => []
}, },
radius: { radius: {
type: Array, type: Array,
default: () => ['55%', '72%'] default: () => ['55%', '75%']
}, },
colors: { colors: {
type: Array, type: Array,
...@@ -62,7 +58,8 @@ export default { ...@@ -62,7 +58,8 @@ export default {
handler(newVal) { handler(newVal) {
this.initData() this.initData()
this.draw() this.draw()
} },
immediate:false
} }
}, },
...@@ -215,14 +212,19 @@ export default { ...@@ -215,14 +212,19 @@ export default {
.pie-box { .pie-box {
background: #262525; background: #262525;
position: relative; position: relative;
flex:1;
.center-content { .center-content {
position: absolute; position: absolute;
top: 50%; top: 50%;
left: 50%; left: 50%;
transform: translate(-50%, -50%); transform: translate(-50%, -50%);
text-align: center; text-align: center;
max-width: 40%;
&-num { &-num {
font-size: 0.24vw; overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-size: 0.8vw;
color: #fff; color: #fff;
--step: 0; --step: 0;
counter-reset: count var(--step); counter-reset: count var(--step);
...@@ -233,8 +235,10 @@ export default { ...@@ -233,8 +235,10 @@ export default {
} }
} }
&-desc { &-desc {
font-size: 0.2vw; font-size: 0.5vw;
color: #606266; color: #606266;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
animation: rotateIn 2s infinite; animation: rotateIn 2s infinite;
} }
......
<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;
} }
} }
......
...@@ -23,10 +23,16 @@ export default { ...@@ -23,10 +23,16 @@ export default {
height: 100%; height: 100%;
box-sizing: border-box; box-sizing: border-box;
position: relative; position: relative;
padding: 1vh 24px 2vh; padding: 1vh 24px 1.1vh;
display: grid; // display: grid;
grid-template-columns: repeat(2, 1fr); // grid-template-columns: 688px 680px;
gap: 0 24px; gap: 0 24px;
display: flex;
justify-content: space-between;
> div {
height: 100%;
flex: 1;
}
&::after { &::after {
content: ''; content: '';
position: absolute; position: absolute;
......
...@@ -11,9 +11,9 @@ ...@@ -11,9 +11,9 @@
</div> </div>
<div class="bottom"> <div class="bottom">
<view-sub-title title="销售数据总览" /> <view-sub-title title="销售数据总览" />
<view-line-group height="14.9vh"> <view-line-group height="15.9vh">
<div slot="1"><Flow height="14.9"></Flow></div> <div slot="1"><Flow height="15.9"></Flow></div>
<div slot="2"><Trend height="14.9"></Trend></div> <div slot="2"><Trend height="15.9"></Trend></div>
</view-line-group> </view-line-group>
<view-pie-group> <view-pie-group>
<div slot="1"><EnterCategory :height="defaultHeight"></EnterCategory></div> <div slot="1"><EnterCategory :height="defaultHeight"></EnterCategory></div>
...@@ -68,7 +68,7 @@ export default { ...@@ -68,7 +68,7 @@ export default {
} }
.bottom { .bottom {
// height: calc(41% - 16px); // height: calc(41% - 16px);
height: 35.9vh; height: 36.8vh;
margin-top: auto; margin-top: auto;
} }
} }
......
...@@ -20,9 +20,9 @@ ...@@ -20,9 +20,9 @@
<div slot="1"><First :height="defaultHeight"></First></div> <div slot="1"><First :height="defaultHeight"></First></div>
<div slot="2"><Sadayasu :height="defaultHeight"></Sadayasu></div> <div slot="2"><Sadayasu :height="defaultHeight"></Sadayasu></div>
</view-line-group> </view-line-group>
<view-line-group height="25.6vh" hideMargin> <view-line-group height="26.5vh" hideMargin>
<div slot="1"><Analyze height="25.6"></Analyze></div> <div slot="1"><Analyze height="26.5"></Analyze></div>
<div slot="2"><Mileage height="25.6"></Mileage></div> <div slot="2"><Mileage height="26.5"></Mileage></div>
</view-line-group> </view-line-group>
</div> </div>
</template> </template>
......
...@@ -94,7 +94,7 @@ export default { ...@@ -94,7 +94,7 @@ export default {
emit () { emit () {
let { reportIndex, tabIndex, brands } = this let { reportIndex, tabIndex, brands } = this
let params = { let params = {
reportType: reportIndex reportType: reportIndex == 0 ? 1 : 0 //月表0,日表1
} }
if (tabIndex == 1) brands.map(e => { if (tabIndex == 1) brands.map(e => {
if (e.active) params.brand = e if (e.active) params.brand = e
...@@ -177,6 +177,9 @@ export default { ...@@ -177,6 +177,9 @@ export default {
&:hover { &:hover {
display: block; display: block;
} }
&:hover .brand{
background-color: #096;
}
.options-item { .options-item {
height: 2.9vh; height: 2.9vh;
font-size: 12px; font-size: 12px;
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
import { changeMixin } from '@/mixins' import { changeMixin } from '@/mixins'
export default { export default {
name: 'ViewTabs', name: 'ViewTabs',
mixins: [changeMixin], mixins: [changeMixin],
data () { data () {
return { return {
} }
...@@ -30,7 +30,7 @@ export default { ...@@ -30,7 +30,7 @@ export default {
<style scoped lang="scss"> <style scoped lang="scss">
.tabs { .tabs {
margin-bottom: 0.5vh; margin-bottom: 0.6vh;
.tab { .tab {
height: 7.8vh; height: 7.8vh;
display: grid; display: grid;
......
...@@ -3,6 +3,7 @@ export default { ...@@ -3,6 +3,7 @@ export default {
return { return {
now: new Date().format('yyyy-MM-dd'), now: new Date().format('yyyy-MM-dd'),
clientData: [], clientData: [],
brandList: [],
distributionRank: '' distributionRank: ''
} }
}, },
...@@ -29,9 +30,7 @@ export default { ...@@ -29,9 +30,7 @@ export default {
value: distribution[item] value: distribution[item]
}) })
}) })
console.log(res.data.dataList[0].distributionRank)
this.distributionRank = JSON.parse(res.data.dataList[0].distributionRank) this.distributionRank = JSON.parse(res.data.dataList[0].distributionRank)
// console.log(this.distributionRank,'this.distributionRank')
}) })
} }
} }
......
import changeMixin from './changeMixin' import changeMixin from './changeMixin'
import clientMixin from './clientMixin' import clientMixin from './clientMixin'
import salesMixin from './salesMixin'
export { export {
changeMixin, changeMixin,
clientMixin clientMixin,
salesMixin
} }
\ No newline at end of file \ No newline at end of file
export default {
data() {
return {
now: new Date().format('yyyy-MM-dd'),
salesData: []
}
},
created() {
this.getSalesData()
},
methods: {
getSalesData() {
const params = {
req: {
corporateGroupName: '集团1',
queryItem: this.type,
// queryTime: this.now,
queryTime: '2022-06-23',
queryType: 0
}
}
this.api.sales.getSales(params).then(res => {
console.log(res,'salesData')
// let distribution = JSON.parse(res.data.dataList[0].distribution)
// const keys = Object.keys(distribution)
// keys.forEach((item, index) => {
// this.clientData.push({
// name: item,
// value: distribution[item]
// })
// })
// console.log(res.data.dataList[0].distributionRank)
// this.distributionRank = JSON.parse(res.data.dataList[0].distributionRank)
// console.log(this.distributionRank,'this.distributionRank')
})
}
}
}
...@@ -7,7 +7,9 @@ ...@@ -7,7 +7,9 @@
* @LastEditTime: 2021-07-06 12:02:21 * @LastEditTime: 2021-07-06 12:02:21
*/ */
const state = { const state = {
reportParams: {} reportParams: {
reportType: 0 //月表0,日表1
}
} }
const mutations = { const mutations = {
SET_PAGE_META (state, meta) { SET_PAGE_META (state, meta) {
......
...@@ -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 19:35:21 * @LastEditTime: 2022-06-29 11:30:36
--> -->
<template> <template>
<div> <div>
...@@ -12,7 +12,10 @@ ...@@ -12,7 +12,10 @@
<div class="content-left bg"> <div class="content-left bg">
<div id="analyzeBar" style="height: 100%"></div> <div id="analyzeBar" style="height: 100%"></div>
</div> </div>
<div class="contetn-right bg">右边</div> <div class="contetn-right bg">
<!-- <pie-chart :id="chart.id" :list="analyzeData" :height="height - 4.9 + 'vh'" :radius="chart.radius" @pieAction="pieAction">
</pie-chart> -->
</div>
</div> </div>
</div> </div>
</template> </template>
...@@ -25,6 +28,11 @@ export default { ...@@ -25,6 +28,11 @@ export default {
props: ['height'], props: ['height'],
data() { data() {
return { return {
analyzeData: [],
chart: {
id: 'analyzePie',
radius: ['60%', '78%']
},
barChart: '', barChart: '',
option: {}, option: {},
barData: [] barData: []
...@@ -34,11 +42,21 @@ export default { ...@@ -34,11 +42,21 @@ export default {
this.barChart = echarts.init(document.getElementById('analyzeBar')) this.barChart = echarts.init(document.getElementById('analyzeBar'))
// resize // resize
window.addEventListener('resize', () => { window.addEventListener('resize', () => {
this.echartsFunnel.resize() this.barChart.resize()
}) })
this.init() 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() { init() {
this.getValueType() this.getValueType()
}, },
...@@ -118,14 +136,14 @@ export default { ...@@ -118,14 +136,14 @@ 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()
}) })
......
...@@ -77,7 +77,7 @@ export default { ...@@ -77,7 +77,7 @@ export default {
}) })
}, },
handleRankChange(value) { handleRankChange(value) {
console.log(value) // console.log(value)
} }
} }
} }
......
...@@ -8,11 +8,73 @@ ...@@ -8,11 +8,73 @@
<template> <template>
<div> <div>
<div class="title">售后车辆里程</div> <div class="title">售后车辆里程</div>
<div class="flex">
<pie-chart :id="chart.id" :list="mileageData" :height="height - 4.9 + 'vh'" :radius="chart.radius" @pieAction="pieAction"></pie-chart>
<div class="ranking-container"></div>
</div>
</div> </div>
</template> </template>
<script> <script>
export default { export default {
name: 'Mileage' name: 'Mileage',
props: ['height'],
data() {
return {
mileageData: [],
distributionRank: '',
rankingData: [],
chart: {
id: 'mileagePie',
radius: ['60%', '78%']
}
}
},
mounted() {
this.getValueType()
},
methods: {
getValueType() {
const params = {
req: {
corporateGroupName: '集团1',
queryItem: 'mileage',
queryTime: '2022-06-23',
queryType: 0
}
}
this.api.afterSales.aftersaleother(params).then(res => {
let distribution = JSON.parse(res.data.dataList[0].distribution)
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)
// console.log(this.distributionRank, 'mileage')
})
},
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, '================')
}
}
} }
</script> </script>
<style lang="scss" scoped>
.ranking-container {
margin-left: 0.6vw;
box-sizing: border-box;
height: 21.5vh;
width:10.8vw;
background: #262525;
}
</style>
...@@ -26,7 +26,6 @@ export default { ...@@ -26,7 +26,6 @@ export default {
data() { data() {
return { return {
type:'age', type:'age',
brandList:[],
chart: { chart: {
id: 'age-pie' id: 'age-pie'
} }
......
...@@ -26,7 +26,6 @@ export default { ...@@ -26,7 +26,6 @@ export default {
data() { data() {
return { return {
type: 'buycarRange', type: 'buycarRange',
brandList: [],
chart: { chart: {
id: 'car-pie' id: 'car-pie'
} }
......
<!-- home --> <!-- home -->
<template> <template>
<div class="container"> <div class="data-view-container">
<transition name="fade"> <transition name="fade">
<keep-alive v-if="$route.meta.keepAlive"> <keep-alive v-if="$route.meta.keepAlive">
<router-view></router-view> <router-view></router-view>
......
...@@ -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>
......
...@@ -11,22 +11,29 @@ ...@@ -11,22 +11,29 @@
<span class="icon"></span> <span class="icon"></span>
<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" :list="salesData" @pieAction="pieAction"></pie-chart> -->
<ran-king></ran-king> <ran-king :list="brandList"></ran-king>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import { salesMixin } from '../../mixins/index'
export default { export default {
name: 'EnterCategory', name: 'EnterCategory',
data() { mixins: [salesMixin],
data() {
return { return {
type: 'entertype',
brandList: [],
chart: { chart: {
id: 'enterCategory-pie' id: 'enterCategory-pie'
} }
} }
},
methods: {
pieAction(data) {}
} }
} }
</script> </script>
...@@ -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-29 13:59:45 * @LastEditTime: 2022-06-29 14:39:49
--> -->
<template> <template>
<div> <div>
...@@ -126,7 +126,7 @@ export default { ...@@ -126,7 +126,7 @@ export default {
console.log(val) console.log(val)
this.getSaletTotal() this.getSaletTotal()
}, },
getSaletTotal() { getSaleTrans() {
const params = { const params = {
req: { req: {
corporateGroupName: '集团1', corporateGroupName: '集团1',
...@@ -135,7 +135,7 @@ export default { ...@@ -135,7 +135,7 @@ 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
...@@ -206,7 +206,7 @@ export default { ...@@ -206,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!