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 @@
*/
import Request from '../request'
const request = new Request()
const getSales = params => {
return request.get('brand/sale', params)
}
......
......@@ -72,6 +72,7 @@ img {
.box {
background: #1d1c1c;
overflow: hidden;
}
.inline {
display: inline-block;
......@@ -97,8 +98,8 @@ img {
margin-right: 6px;
}
}
.container {
margin-top:0.5vh;
.container{
margin:0 8px;
}
.empty {
......
<template>
<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="[id, 'center-content-num']"></div>
<div class="center-content-desc">{{ numDesc }}</div>
......@@ -26,17 +26,13 @@ export default {
type: String,
default: '12.7vh'
},
width: {
type: String,
default: '7.2vw'
},
list: {
type: Array,
default: () => []
},
radius: {
type: Array,
default: () => ['55%', '72%']
default: () => ['55%', '75%']
},
colors: {
type: Array,
......@@ -62,7 +58,8 @@ export default {
handler(newVal) {
this.initData()
this.draw()
}
},
immediate:false
}
},
......@@ -215,14 +212,19 @@ export default {
.pie-box {
background: #262525;
position: relative;
flex:1;
.center-content {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
text-align: center;
max-width: 40%;
&-num {
font-size: 0.24vw;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-size: 0.8vw;
color: #fff;
--step: 0;
counter-reset: count var(--step);
......@@ -233,8 +235,10 @@ export default {
}
}
&-desc {
font-size: 0.2vw;
font-size: 0.5vw;
color: #606266;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
animation: rotateIn 2s infinite;
}
......
<template>
<div class="ranking-container">
<div class="title">品牌排名</div>
<div class="ranking-title">品牌排名</div>
<div class="ranking">
<div class="brand flex" v-for="(item, index) in brandList" :key="index">
<span class="brand-num">{{ index + 1 }}</span>
......@@ -36,27 +36,27 @@ export default {
</script>
<style lang="scss" scoped>
.ranking-container {
margin-left: 0.6vw;
flex: 1;
margin-left: 8px;
box-sizing: border-box;
height: 12.7vh;
background: #262525;
.title {
width: 6.7vw;
.ranking-title {
width: 100%;
background: rgba(53, 53, 53, 0.6);
font-size: 10px;
color: #eb6001;
font-weight: 400;
text-align: center;
line-height: 2.4vh;
padding: 0.4vh 0;
box-sizing: border-box;
}
.ranking {
font-size: 10px;
color: #ffffff;
letter-spacing: 0;
font-weight: 400;
padding-left: 0.6vw;
padding-top: 0.1vh;
padding-bottom: 0.4vh;
padding:0.1vh 0 0.4vh 8px;
.brand {
line-height: 1.9vh;
.brand-num {
......@@ -64,7 +64,7 @@ export default {
margin-right: 0.6vw;
}
.marquee {
width: calc(100% - 2.2vw);
// width: calc(100% - 2.2vw);
height: 1.9vh;
}
}
......
......@@ -23,10 +23,16 @@ export default {
height: 100%;
box-sizing: border-box;
position: relative;
padding: 1vh 24px 2vh;
display: grid;
grid-template-columns: repeat(2, 1fr);
padding: 1vh 24px 1.1vh;
// display: grid;
// grid-template-columns: 688px 680px;
gap: 0 24px;
display: flex;
justify-content: space-between;
> div {
height: 100%;
flex: 1;
}
&::after {
content: '';
position: absolute;
......
......@@ -11,9 +11,9 @@
</div>
<div class="bottom">
<view-sub-title title="销售数据总览" />
<view-line-group height="14.9vh">
<div slot="1"><Flow height="14.9"></Flow></div>
<div slot="2"><Trend height="14.9"></Trend></div>
<view-line-group height="15.9vh">
<div slot="1"><Flow height="15.9"></Flow></div>
<div slot="2"><Trend height="15.9"></Trend></div>
</view-line-group>
<view-pie-group>
<div slot="1"><EnterCategory :height="defaultHeight"></EnterCategory></div>
......@@ -68,7 +68,7 @@ export default {
}
.bottom {
// height: calc(41% - 16px);
height: 35.9vh;
height: 36.8vh;
margin-top: auto;
}
}
......
......@@ -20,9 +20,9 @@
<div slot="1"><First :height="defaultHeight"></First></div>
<div slot="2"><Sadayasu :height="defaultHeight"></Sadayasu></div>
</view-line-group>
<view-line-group height="25.6vh" hideMargin>
<div slot="1"><Analyze height="25.6"></Analyze></div>
<div slot="2"><Mileage height="25.6"></Mileage></div>
<view-line-group height="26.5vh" hideMargin>
<div slot="1"><Analyze height="26.5"></Analyze></div>
<div slot="2"><Mileage height="26.5"></Mileage></div>
</view-line-group>
</div>
</template>
......
......@@ -94,7 +94,7 @@ export default {
emit () {
let { reportIndex, tabIndex, brands } = this
let params = {
reportType: reportIndex
reportType: reportIndex == 0 ? 1 : 0 //月表0,日表1
}
if (tabIndex == 1) brands.map(e => {
if (e.active) params.brand = e
......@@ -177,6 +177,9 @@ export default {
&:hover {
display: block;
}
&:hover .brand{
background-color: #096;
}
.options-item {
height: 2.9vh;
font-size: 12px;
......
......@@ -16,7 +16,7 @@
import { changeMixin } from '@/mixins'
export default {
name: 'ViewTabs',
mixins: [changeMixin],
mixins: [changeMixin],
data () {
return {
}
......@@ -30,7 +30,7 @@ export default {
<style scoped lang="scss">
.tabs {
margin-bottom: 0.5vh;
margin-bottom: 0.6vh;
.tab {
height: 7.8vh;
display: grid;
......
......@@ -3,6 +3,7 @@ export default {
return {
now: new Date().format('yyyy-MM-dd'),
clientData: [],
brandList: [],
distributionRank: ''
}
},
......@@ -29,9 +30,7 @@ export default {
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')
})
}
}
......
import changeMixin from './changeMixin'
import clientMixin from './clientMixin'
import salesMixin from './salesMixin'
export {
changeMixin,
clientMixin
clientMixin,
salesMixin
}
\ 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 @@
* @LastEditTime: 2021-07-06 12:02:21
*/
const state = {
reportParams: {}
reportParams: {
reportType: 0 //月表0,日表1
}
}
const mutations = {
SET_PAGE_META (state, meta) {
......
......@@ -3,7 +3,7 @@
* @Author: huyue
* @Date: 2022-06-23 15:05:21
* @LastEditors: huyue
* @LastEditTime: 2022-06-28 19:35:21
* @LastEditTime: 2022-06-29 11:30:36
-->
<template>
<div>
......@@ -12,7 +12,10 @@
<div class="content-left bg">
<div id="analyzeBar" style="height: 100%"></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>
</template>
......@@ -25,6 +28,11 @@ export default {
props: ['height'],
data() {
return {
analyzeData: [],
chart: {
id: 'analyzePie',
radius: ['60%', '78%']
},
barChart: '',
option: {},
barData: []
......@@ -34,11 +42,21 @@ export default {
this.barChart = echarts.init(document.getElementById('analyzeBar'))
// resize
window.addEventListener('resize', () => {
this.echartsFunnel.resize()
this.barChart.resize()
})
this.init()
},
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()
},
......@@ -118,14 +136,14 @@ export default {
}
}
this.api.afterSales.aftersaleother(params).then(res => {
console.log(res)
const reqData = JSON.parse(res.data.dataList[0].distribution)
console.log(reqData)
this.barData = []
for (let i in reqData) {
this.barData.push(reqData[i])
}
console.log(this.barData)
this.getChart()
})
......
......@@ -77,7 +77,7 @@ export default {
})
},
handleRankChange(value) {
console.log(value)
// console.log(value)
}
}
}
......
......@@ -8,11 +8,73 @@
<template>
<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>
</template>
<script>
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>
<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 {
data() {
return {
type:'age',
brandList:[],
chart: {
id: 'age-pie'
}
......
......@@ -26,7 +26,6 @@ export default {
data() {
return {
type: 'buycarRange',
brandList: [],
chart: {
id: 'car-pie'
}
......
<!-- home -->
<template>
<div class="container">
<div class="data-view-container">
<transition name="fade">
<keep-alive v-if="$route.meta.keepAlive">
<router-view></router-view>
......
......@@ -12,7 +12,7 @@
<span>客户级别</span>
</div>
<div class="flex container">
<pie-chart :id="chart.id"></pie-chart>
<!-- <pie-chart :id="chart.id"></pie-chart> -->
<ran-king></ran-king>
</div>
</div>
......
......@@ -11,22 +11,29 @@
<span class="icon"></span>
<span>进店类型</span>
</div>
<div class="container flex">
<pie-chart :id="chart.id"></pie-chart>
<ran-king></ran-king>
<div class="container flex">
<!-- <pie-chart :id="chart.id" :list="salesData" @pieAction="pieAction"></pie-chart> -->
<ran-king :list="brandList"></ran-king>
</div>
</div>
</template>
<script>
import { salesMixin } from '../../mixins/index'
export default {
name: 'EnterCategory',
data() {
mixins: [salesMixin],
data() {
return {
type: 'entertype',
brandList: [],
chart: {
id: 'enterCategory-pie'
}
}
},
methods: {
pieAction(data) {}
}
}
</script>
......@@ -3,7 +3,7 @@
* @Author: huyue
* @Date: 2022-06-23 15:05:21
* @LastEditors: huyue
* @LastEditTime: 2022-06-29 13:59:45
* @LastEditTime: 2022-06-29 14:39:49
-->
<template>
<div>
......@@ -126,7 +126,7 @@ export default {
console.log(val)
this.getSaletTotal()
},
getSaletTotal() {
getSaleTrans() {
const params = {
req: {
corporateGroupName: '集团1',
......@@ -135,7 +135,7 @@ export default {
}
}
this.api.sales.saleTotal(params).then(res => {
console.log(res.data)
// console.log(res.data)
if (res.code === '0') {
res.data.dataList[0].num.forEach((item, index) => {
this.funnelData[index].value = item
......@@ -206,7 +206,7 @@ export default {
this.echartsFunnel.setOption(this.option)
// 鼠标划入
this.echartsFunnel.on('mouseover', data => {
console.log(data.data)
// console.log(data.data)
})
}
}
......
......@@ -12,7 +12,7 @@
<span>信息来源</span>
</div>
<div class="container flex">
<pie-chart :id="chart.id"></pie-chart>
<!-- <pie-chart :id="chart.id"></pie-chart> -->
<ran-king></ran-king>
</div>
</div>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!