Commit e2ca2e40 by 胡悦

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

2 parents a4a9fc41 faeb3e8d
...@@ -8,7 +8,9 @@ ...@@ -8,7 +8,9 @@
</div> </div>
<div class="rank-block"> <div class="rank-block">
<div class="rank-line" v-for="(item, index) in rankList" :key="index"> <div class="rank-line" v-for="(item, index) in rankList" :key="index">
<marquee class="line-item" :direction="directionTimer" :delay="delayTimer" :text="item.label"></marquee> <div class="line-item">
<marquee :direction="directionTimer" :delay="delayTimer" :text="item.label"></marquee>
</div>
<p class="line-item txt-orange">{{ item.value }}</p> <p class="line-item txt-orange">{{ item.value }}</p>
</div> </div>
</div> </div>
...@@ -67,9 +69,9 @@ export default { ...@@ -67,9 +69,9 @@ export default {
rankList: [], rankList: [],
echartsLine: '', echartsLine: '',
moveAttr: { moveAttr: {
speed: 900, // speed: 900,
seriesIndex: 0, seriesIndex: 0,
dataIndex: -1 dataIndex: 0
}, },
timer: null timer: null
} }
...@@ -81,12 +83,12 @@ export default { ...@@ -81,12 +83,12 @@ export default {
mounted() { mounted() {
this.lineDom = document.getElementById(this.domId) this.lineDom = document.getElementById(this.domId)
this.echartsLine = echarts.init(this.lineDom) this[this.domId] = echarts.init(this.lineDom)
}, },
methods: { methods: {
resetRankList() { resetRankList() {
this.rankList = new Array(5).fill({ label: '-', value: '-' }) this.rankList = new Array(5).fill({ label: '- -', value: '- -' })
}, },
tooltipFormatter(obj) { tooltipFormatter(obj) {
var currentItem = this.dataList[obj[0].dataIndex] var currentItem = this.dataList[obj[0].dataIndex]
...@@ -100,41 +102,44 @@ export default { ...@@ -100,41 +102,44 @@ export default {
return txt return txt
}, },
autoMove() { // autoMove() {
clearInterval(this.timer) // clearInterval(this.timer)
this.timer = setInterval(() => { // this.timer = setInterval(() => {
this.moveAttr.dataIndex = this.moveAttr.dataIndex + 1 // this.moveAttr.dataIndex = this.moveAttr.dataIndex + 1
if (this.moveAttr.dataIndex === this.dataList.length) { // if (this.moveAttr.dataIndex === this.dataList.length) {
this.moveAttr.dataIndex = 0 // this.moveAttr.dataIndex = 0
} // }
this.chartAction() // this.chartAction()
this.autoMove() // this.autoMove()
this.getRankList(this.moveAttr.dataIndex, this.rankFlag + 'List') // this.getRankList(this.moveAttr.dataIndex, this.rankFlag + 'List')
}, this.moveAttr.speed) // }, this.moveAttr.speed)
}, // },
chartBindEvent() { chartBindEvent() {
// resize // resize
window.addEventListener('resize', () => { window.addEventListener('resize', () => {
this.echartsLine.resize() this[this.domId].resize()
}) })
// 鼠标划入 // 鼠标划入
this.lineDom.addEventListener('mouseover', () => { this[this.domId].on('mouseover', data => {
clearInterval(this.timer) this.moveAttr.seriesIndex = data.dataIndex
this.chartAction('downplay') this.getRankList(this.moveAttr.seriesIndex, this.rankFlag + 'List')
}) })
// 鼠标划出 // 鼠标划出
this.lineDom.addEventListener('mouseout', () => { this[this.domId].on('mouseout', () => {
this.moveAttr.dataIndex = -1 console.log('0000000000')
this.autoMove() setTimeout(() => {
this.chartAction()
}, 1000)
}) })
}, },
chartAction(type) { chartAction(type) {
this.echartsLine.dispatchAction({ console.log(this.moveAttr, '???/cwq')
this[this.domId].dispatchAction({
type: type || 'showTip', type: type || 'showTip',
seriesIndex: this.moveAttr.seriesIndex, seriesIndex: this.moveAttr.seriesIndex,
dataIndex: this.moveAttr.dataIndex dataIndex: this.moveAttr.dataIndex
...@@ -150,26 +155,16 @@ export default { ...@@ -150,26 +155,16 @@ export default {
this.lineOptions.series[0].data = this.dataList.map(item => item.num) this.lineOptions.series[0].data = this.dataList.map(item => item.num)
this.echartsLine.setOption(this.lineOptions) this[this.domId].setOption(this.lineOptions)
// // 鼠标划入
// this.echartsLine.on('click', data => {
// clearInterval(this.timer)
// this.chartAction('downplay')
// })
// // 鼠标划出
// this.echartsLine.on('mouseout', () => {
// this.moveAttr.dataIndex = -1
// this.autoMove()
// })
// console.log(this.echartsLine)
this.chartBindEvent() this.chartBindEvent()
// 默认展示tooltip
this.chartAction()
this.getRankList(0) this.getRankList(0)
this.autoMove() // this.autoMove()
}, },
handleRankChange(value) { handleRankChange(value) {
...@@ -232,6 +227,7 @@ p { ...@@ -232,6 +227,7 @@ p {
border-left: 1px solid rgba(96, 98, 102, 0.4); border-left: 1px solid rgba(96, 98, 102, 0.4);
.line-item { .line-item {
height: 1.8vh; height: 1.8vh;
width: 100%;
font-size: 10px; font-size: 10px;
padding-bottom: 0.6vh; padding-bottom: 0.6vh;
} }
......
...@@ -36,7 +36,7 @@ export default { ...@@ -36,7 +36,7 @@ export default {
}, },
colors: { colors: {
type: Array, type: Array,
default: () => ['#4FA0FF', '#7CFFB2', '#FDF006', '#EB6001', '#F5AA01', '#BF98FF', '#58D9F9'] default: () => ['#4FA0FF', '#FF6E76', '#7CFFB2','#FDF006','#EB6001','#F5AA01','#BF98FF','#4FA0FF']
} }
}, },
......
...@@ -43,20 +43,23 @@ export default { ...@@ -43,20 +43,23 @@ export default {
background: #262525; background: #262525;
.ranking-title { .ranking-title {
background: rgba(53, 53, 53, 0.6); background: rgba(53, 53, 53, 0.6);
font-size: 10px; font-size: 0.694vw;
color: #eb6001; color: #eb6001;
font-weight: 400; font-weight: 400;
padding: 0.4vh 0 0.4vh 20%; padding: 0.4vh 0 0.4vh 20%;
box-sizing: border-box; box-sizing: border-box;
} }
.ranking { .ranking {
font-size: 10px; font-size: 0.694vw;
color: #ffffff; color: #ffffff;
letter-spacing: 0; letter-spacing: 0;
font-weight: 400; font-weight: 400;
padding:0.1vh 0 0.4vh 8px; padding: 0.2vh 0 0.3vh 8px;
.brand { .brand {
line-height: 1.9vh; // line-height: 1.9vh;
height: 1.9vh;
display:flex;
align-items: center;
.brand-num { .brand-num {
color: #606266; color: #606266;
margin-right: 0.6vw; margin-right: 0.6vw;
...@@ -64,6 +67,7 @@ export default { ...@@ -64,6 +67,7 @@ export default {
.marquee { .marquee {
width: 80%; width: 80%;
height: 1.9vh; height: 1.9vh;
font-weight: 400;
} }
} }
} }
......
...@@ -4,6 +4,7 @@ function getLineOptions(obj) { ...@@ -4,6 +4,7 @@ function getLineOptions(obj) {
tooltip: { tooltip: {
trigger: 'axis', trigger: 'axis',
borderWidth: 0, borderWidth: 0,
show: true,
backgroundColor: 'rgba(68,68,68,0.80)', backgroundColor: 'rgba(68,68,68,0.80)',
textStyle: { textStyle: {
color: '#FFFFFF', color: '#FFFFFF',
...@@ -38,13 +39,14 @@ function getLineOptions(obj) { ...@@ -38,13 +39,14 @@ function getLineOptions(obj) {
series: [ series: [
{ {
type: 'line', type: 'line',
symbol: 'circle',
itemStyle: { itemStyle: {
color: '#F5AA01' color: '#F5AA01'
}, },
// 节点,平滑曲线 // 平滑曲线
symbol: 'none',
smooth: true, smooth: true,
showSymbol: false,
// 折线背景色 // 折线背景色
areaStyle: { areaStyle: {
color: { color: {
......
...@@ -11,7 +11,7 @@ export default { ...@@ -11,7 +11,7 @@ export default {
}, },
mixins: [changeMixin], mixins: [changeMixin],
created() { created() {
this.getClientData() // this.getClientData()
}, },
methods: { methods: {
getClientData() { getClientData() {
...@@ -22,7 +22,7 @@ export default { ...@@ -22,7 +22,7 @@ export default {
queryItem: this.type, queryItem: this.type,
// queryTime: this.getCurrentDate, // queryTime: this.getCurrentDate,
queryTime: '2022-06-23', queryTime: '2022-06-23',
queryType: this.watchReportParams.reportType // queryType: this.watchReportParams.reportType
} }
} }
if (this.isBrand) params.req.brandName = this.brandName if (this.isBrand) params.req.brandName = this.brandName
......
...@@ -11,7 +11,7 @@ export default { ...@@ -11,7 +11,7 @@ export default {
}, },
mixins: [changeMixin], mixins: [changeMixin],
created() { created() {
this.getSalesData() // this.getSalesData()
}, },
methods: { methods: {
getSalesData() { getSalesData() {
......
...@@ -9,12 +9,12 @@ ...@@ -9,12 +9,12 @@
<div> <div>
<div class="title">售后客户价值分析</div> <div class="title">售后客户价值分析</div>
<template v-if="barData.length > 0"> <template v-if="barData.length > 0">
<div class="analyze-content" :style="{ height: height - 4.9 + 'vh' }"> <div class="analyze-content" :style="{ height: height - 5 + 'vh'}">
<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 class="contetn-right bg">
<pie-chart :id="chart.id" :list="analyzeData" :height="height - 4.9 + 'vh'" :radius="chart.radius"></pie-chart> <pie-chart :id="chart.id" :list="analyzeData" :height="height - 5 + 'vh'" :radius="chart.radius"></pie-chart>
</div> </div>
</div> </div>
</template> </template>
...@@ -186,6 +186,9 @@ export default { ...@@ -186,6 +186,9 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.title{
padding:1vh 0.556vw;
}
.analyze-content { .analyze-content {
display: flex; display: flex;
padding: 0 8px 1.8vh; padding: 0 8px 1.8vh;
......
...@@ -9,15 +9,15 @@ ...@@ -9,15 +9,15 @@
<div> <div>
<div class="title">售后车辆里程</div> <div class="title">售后车辆里程</div>
<template v-if="mileageData.length > 0"> <template v-if="mileageData.length > 0">
<div class="flex"> <div class="flex container">
<pie-chart :id="chart.id" :list="mileageData" :height="height - 4.9 + 'vh'" :radius="chart.radius" @pieAction="pieAction"></pie-chart> <pie-chart :id="chart.id" :list="mileageData" :height="height - 5 + 'vh'" :radius="chart.radius" @pieAction="pieAction"></pie-chart>
<div class="ranking-container"> <div class="ranking-container">
<div class="ranking-title"> <div class="ranking-title">
<div class="ranking-title-brand">品牌</div> <div class="ranking-title-brand">品牌</div>
<div>客户数</div> <div>客户数</div>
</div> </div>
<div class="ranking"> <div class="ranking">
<div class="brand flex" v-for="(item, index) in rankingData" :key="index"> <div class="brand flex" v-for="(item, index) in rankingData.slice(0,5)" :key="index">
<span class="brand-num">{{ index + 1 }}</span> <span class="brand-num">{{ index + 1 }}</span>
<marquee class="marquee" :direction="directionTimer" :delay="delayTimer" :text="item.brand" /> <marquee class="marquee" :direction="directionTimer" :delay="delayTimer" :text="item.brand" />
<span>{{ item.value }}</span> <span>{{ item.value }}</span>
...@@ -108,6 +108,9 @@ export default { ...@@ -108,6 +108,9 @@ export default {
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.title{
padding:1vh 0.556vw;
}
.ranking-container { .ranking-container {
flex: 1; flex: 1;
margin-left: 0.6vw; margin-left: 0.6vw;
...@@ -117,20 +120,23 @@ export default { ...@@ -117,20 +120,23 @@ export default {
background: #262525; background: #262525;
.ranking-title { .ranking-title {
padding: 0.5vh 1.5vw 0.4vh 1.5vw; padding: 0.5vh 1.5vw 0.4vh 1.5vw;
font-size: 12px; font-size: 0.833vw;
color: #eb6001; color: #eb6001;
letter-spacing: 0; letter-spacing: 0;
font-weight: 400; font-weight: 400;
background: rgba(53, 53, 53, 0.6); background: rgba(53, 53, 53, 0.6);
display: flex; display: flex;
align-items: center; align-items: center;
div{
white-space: nowrap;
}
.ranking-title-brand { .ranking-title-brand {
width: 4.9vw; width: 4.9vw;
margin-right: 0.6vw; margin-right: 0.6vw;
} }
} }
.ranking { .ranking {
font-size: 10px; font-size: 0.694vw;
color: #ffffff; color: #ffffff;
letter-spacing: 0; letter-spacing: 0;
font-weight: 400; font-weight: 400;
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
</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" :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>
...@@ -32,7 +32,8 @@ export default { ...@@ -32,7 +32,8 @@ export default {
return { return {
type: 'entertype', type: 'entertype',
chart: { chart: {
id: 'enterCategory-pie' id: 'enterCategory-pie',
colors: ['#F5AA01', '#FF6E76', '#4FA0FF']
} }
} }
}, },
......
...@@ -32,7 +32,7 @@ export default { ...@@ -32,7 +32,7 @@ export default {
return { return {
type: 'infosource', type: 'infosource',
chart: { chart: {
id: 'infoFrom-pie' id: 'infoFrom-pie',
} }
} }
}, },
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!