Commit 38087fec by 徐忆琳

Merge branch 'xuyl_v3.13_0' into 'scrmv3.13.0'

二轮bug修复

See merge request !18
2 parents 7ac0dd15 5f4e3223
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
</span> </span>
</div> </div>
<line-bar :isDatazoom='true' domId='viewTrendDomId' :dataList='viewTrendList' boxHeight='190px'></line-bar> <line-bar :isDatazoom='true' domId='viewTrendDomId' :lineTitle='linaBarTitle' :dataList='viewTrendList' boxHeight='190px'></line-bar>
</div> </div>
</div> </div>
</template> </template>
...@@ -62,6 +62,7 @@ export default { ...@@ -62,6 +62,7 @@ export default {
dataOverView: null, dataOverView: null,
viewTrendList: null, viewTrendList: null,
linaBarTitle: '', linaBarTitle: '',
tabType: '',
tabTitleList: [ tabTitleList: [
{ title: '访问量', type: 'views' }, { title: '访问量', type: 'views' },
{ title: '转发量', type: 'forward' }, { title: '转发量', type: 'forward' },
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
--> -->
<template> <template>
<div class='line-box'> <div class='line-box'>
<div :id='domId' class='line-chart' :style='{ height: boxHeight }'></div> <div :id='domId' class='line-chart' :lineTitle='lineTitle' :style='{ height: boxHeight }'></div>
</div> </div>
</template> </template>
<script> <script>
...@@ -23,6 +23,10 @@ export default { ...@@ -23,6 +23,10 @@ export default {
type: String, type: String,
default: 'line-chart' default: 'line-chart'
}, },
lineTitle: {
type: String,
default: ''
},
isDatazoom: { isDatazoom: {
type: Boolean, type: Boolean,
default: false default: false
...@@ -94,7 +98,7 @@ export default { ...@@ -94,7 +98,7 @@ export default {
watch: { watch: {
dataList: { dataList: {
handler() { handler() {
this.lineOptions = this.isDatazoom ? lineAndBarZoomOptions(this.dataList,this.displayName) : lineAndBarOptions(this.dataList,this.displayName) this.lineOptions = this.isDatazoom ? lineAndBarZoomOptions(this.dataList, this.displayName,this.lineTitle) : lineAndBarOptions(this.dataList, this.displayName,this.lineTitle)
this.chartBindEvent() this.chartBindEvent()
}, },
deep: true deep: true
...@@ -112,12 +116,16 @@ export default { ...@@ -112,12 +116,16 @@ export default {
this[this.domId].on('click', (params) => { this[this.domId].on('click', (params) => {
const month = params.name const month = params.name
const type = this.domId const type = this.domId
if (this.domId === 'glLineBar') ( if (this.domId === 'glLineBar') {
(
this.$bus.$emit('updataGLRank', { month, type }) this.$bus.$emit('updataGLRank', { month, type })
) )
if (this.domId === 'ghLineBar') ( }
if (this.domId === 'ghLineBar') {
(
this.$bus.$emit('updataGHRank', { month, type }) this.$bus.$emit('updataGHRank', { month, type })
) )
}
}) })
// ) // )
} }
......
...@@ -483,8 +483,7 @@ function getLineDoubleOptions(obj) { ...@@ -483,8 +483,7 @@ function getLineDoubleOptions(obj) {
return options return options
} }
function lineAndBarZoomOptions(list, namelist, lineTitle) {
function lineAndBarZoomOptions(list, namelist) {
const statDate = namelist ? list.map(item => item[namelist.xName]) : list.map(item => item.statDate) const statDate = namelist ? list.map(item => item[namelist.xName]) : list.map(item => item.statDate)
const orderNum = namelist ? list.map(item => item[namelist.leftYName]) : list.map(item => item.viewsincr) const orderNum = namelist ? list.map(item => item[namelist.leftYName]) : list.map(item => item.viewsincr)
const orderMoney = namelist ? list.map(item => item[namelist.rightYName]) : list.map(item => item.viewstotal) const orderMoney = namelist ? list.map(item => item[namelist.rightYName]) : list.map(item => item.viewstotal)
...@@ -509,7 +508,7 @@ function lineAndBarZoomOptions(list, namelist) { ...@@ -509,7 +508,7 @@ function lineAndBarZoomOptions(list, namelist) {
}, },
formatter: function(item) { formatter: function(item) {
const items = list[item[0].dataIndex] const items = list[item[0].dataIndex]
return `${items.statDate}<br>总访问量:${items.viewstotal}<br>当日新增:${items.viewsincr}` return `${items.statDate}<br>总${lineTitle}:${items.viewstotal}<br>当日新增:${items.viewsincr}`
} }
}, },
xAxis: [ xAxis: [
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!