Commit fb803fe2 by 王志慧

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

2 parents f31b7a68 edf15d3c
...@@ -97,7 +97,6 @@ export default { ...@@ -97,7 +97,6 @@ export default {
}, },
tooltipFormatter(obj) { tooltipFormatter(obj) {
var currentItem = this.dataList[obj[0].dataIndex] var currentItem = this.dataList[obj[0].dataIndex]
console.log(currentItem, 'currentItem')
var txt = '' var txt = ''
txt = currentItem.statDate txt = currentItem.statDate
this.tooltipFormatterObj.forEach(item => { this.tooltipFormatterObj.forEach(item => {
...@@ -133,18 +132,18 @@ export default { ...@@ -133,18 +132,18 @@ export default {
}) })
// 移除图表 // 移除图表
this[this.domId].on('globalout', () => { // this[this.domId].on('globalout', () => {
this.chartAction() // this.chartAction()
}) // })
}, },
chartAction(type) { // chartAction(type) {
this[this.domId].dispatchAction({ // 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
}) // })
}, // },
getRankList(idx, attrName = 'topList') { getRankList(idx, attrName = 'topList') {
this.dataList[idx][attrName].length ? this.$set(this, 'rankList', this.dataList[idx][attrName]) : this.resetRankList() this.dataList[idx][attrName].length ? this.$set(this, 'rankList', this.dataList[idx][attrName]) : this.resetRankList()
...@@ -162,7 +161,7 @@ export default { ...@@ -162,7 +161,7 @@ export default {
this[this.domId].setOption(this.lineOptions) this[this.domId].setOption(this.lineOptions)
// 默认展示tooltip // 默认展示tooltip
this.chartAction() // this.chartAction()
this.getRankList(0) this.getRankList(0)
}, },
...@@ -242,4 +241,18 @@ p { ...@@ -242,4 +241,18 @@ p {
} }
} }
} }
::v-deep.line-chart {
width: 100%;
height: 100%;
div {
&:nth-child(1) {
width: 100% !important;
height: 100% !important;
canvas {
width: 100% !important;
height: 100% !important;
}
}
}
}
</style> </style>
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
src="@/assets/images/time.svg" src="@/assets/images/time.svg"
class="icon" class="icon"
/> />
{{now}} <div class="now">{{now}}</div>
</div> </div>
<div class="bottom flex"> <div class="bottom flex">
<div class="merchant">已同步门店数:68</div> <div class="merchant">已同步门店数:68</div>
......
...@@ -10,7 +10,6 @@ function getLineOptions(obj) { ...@@ -10,7 +10,6 @@ function getLineOptions(obj) {
color: '#FFFFFF', color: '#FFFFFF',
fontSize: '8px' fontSize: '8px'
}, },
extraCssText: 'width: 100px;',
formatter: tooltipFormatter || '' formatter: tooltipFormatter || ''
}, },
grid: { grid: {
...@@ -34,7 +33,8 @@ function getLineOptions(obj) { ...@@ -34,7 +33,8 @@ function getLineOptions(obj) {
lineStyle: { lineStyle: {
color: '#606266' color: '#606266'
} }
} },
splitNumber: 3
}, },
series: [ series: [
{ {
......
...@@ -84,13 +84,13 @@ export default { ...@@ -84,13 +84,13 @@ export default {
Object.keys(topTempList).forEach(item => { Object.keys(topTempList).forEach(item => {
topList.push({ topList.push({
label: item, label: item,
value: this.numAddSymbol(topTempList[item]) value: topTempList[item] ? this.numAddSymbol(topTempList[item]) : '- -'
}) })
}) })
Object.keys(lastTempList).forEach(item => { Object.keys(lastTempList).forEach(item => {
lastList.push({ lastList.push({
label: item, label: item,
value: this.numAddSymbol(lastTempList[item]) value: lastTempList[item] ? this.numAddSymbol(lastTempList[item]) : '- -'
}) })
}) })
this.dataList.push({ this.dataList.push({
......
...@@ -86,13 +86,13 @@ export default { ...@@ -86,13 +86,13 @@ export default {
Object.keys(topTempList).forEach(item => { Object.keys(topTempList).forEach(item => {
topList.push({ topList.push({
label: item, label: item,
value: this.numAddSymbol(topTempList[item]) value: topTempList[item] ? this.numAddSymbol(topTempList[item]) : '- -'
}) })
}) })
Object.keys(lastTempList).forEach(item => { Object.keys(lastTempList).forEach(item => {
lastList.push({ lastList.push({
label: item, label: item,
value: this.numAddSymbol(lastTempList[item]) value: lastTempList[item] ? this.numAddSymbol(lastTempList[item]) : '- -'
}) })
}) })
this.dataList.push({ this.dataList.push({
......
...@@ -101,13 +101,13 @@ export default { ...@@ -101,13 +101,13 @@ export default {
Object.keys(topTempList).forEach(item => { Object.keys(topTempList).forEach(item => {
topList.push({ topList.push({
label: item, label: item,
value: topTempList[item].num?this.numAddSymbol(topTempList[item].num):'- -' value: topTempList[item].num ? this.numAddSymbol(topTempList[item].num) : '- -'
}) })
}) })
Object.keys(lastTempList).forEach(item => { Object.keys(lastTempList).forEach(item => {
lastList.push({ lastList.push({
label: item, label: item,
value: this.numAddSymbol(lastTempList[item].num) value: lastTempList[item].num ? this.numAddSymbol(lastTempList[item].num) : '- -'
}) })
}) })
this.dataList.push({ this.dataList.push({
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<div v-if="isEmpty" class="empty"> <div v-if="isEmpty" class="empty">
<img src="../../assets/images/empty.png" alt="" /> <img src="../../assets/images/empty.png" alt="" />
</div> </div>
<LineChart v-else ref="lineChartRef" domId="keepChart" :dataList.sync="dataList" :storeOrBrandTxt="storeOrBrandTxt" :queryType="queryType" :tooltipFormatterObj="tooltipFormatterObj"></LineChart> <LineChart v-else ref="lineChartRef" domId="keepChart" :dataList.sync="dataList" :storeOrBrandTxt="storeOrBrandTxt" :queryType="queryType"></LineChart>
</div> </div>
</div> </div>
</template> </template>
...@@ -101,13 +101,13 @@ export default { ...@@ -101,13 +101,13 @@ export default {
Object.keys(topTempList).forEach(item => { Object.keys(topTempList).forEach(item => {
topList.push({ topList.push({
label: item, label: item,
value: this.numAddSymbol(topTempList[item]) value: topTempList[item] ? this.numAddSymbol(topTempList[item]) : '- -'
}) })
}) })
Object.keys(lastTempList).forEach(item => { Object.keys(lastTempList).forEach(item => {
lastList.push({ lastList.push({
label: item, label: item,
value: this.numAddSymbol(lastTempList[item]) value: lastTempList[item] ? this.numAddSymbol(lastTempList[item]) : '- -'
}) })
}) })
this.dataList.push({ this.dataList.push({
......
...@@ -37,23 +37,24 @@ export default { ...@@ -37,23 +37,24 @@ export default {
storeOrBrandTxt: '品牌', storeOrBrandTxt: '品牌',
queryType: 0, queryType: 0,
dataList: [], dataList: [],
tooltipFormatterObj:[ tooltipFormatterObj:
{ [
label: '流失率', {
attrName: 'rate', label: '流失率',
addSymbol: '%' attrName: 'rate',
}, addSymbol: '%'
{ },
label: '环比', {
attrName: 'hrate', label: '环比',
addSymbol: '%' attrName: 'hrate',
}, addSymbol: '%'
{ },
label: '同比', {
attrName: 'trate', label: '同比',
addSymbol: '%' attrName: 'trate',
} addSymbol: '%'
] }
]
} }
}, },
mounted() { }, mounted() { },
...@@ -101,13 +102,13 @@ export default { ...@@ -101,13 +102,13 @@ export default {
Object.keys(topTempList).forEach(item => { Object.keys(topTempList).forEach(item => {
topList.push({ topList.push({
label: item, label: item,
value: this.numAddSymbol(topTempList[item]) value: topTempList[item] ? this.numAddSymbol(topTempList[item]) : '- -'
}) })
}) })
Object.keys(lastTempList).forEach(item => { Object.keys(lastTempList).forEach(item => {
lastList.push({ lastList.push({
label: item, label: item,
value: this.numAddSymbol(lastTempList[item]) value: lastTempList[item] ? this.numAddSymbol(lastTempList[item]) : '- -'
}) })
}) })
this.dataList.push({ this.dataList.push({
......
...@@ -84,13 +84,13 @@ export default { ...@@ -84,13 +84,13 @@ export default {
Object.keys(topTempList).forEach(item => { Object.keys(topTempList).forEach(item => {
topList.push({ topList.push({
label: item, label: item,
value: this.numAddSymbol(topTempList[item].num) value: topTempList[item].num ? this.numAddSymbol(topTempList[item].num) : '- -'
}) })
}) })
Object.keys(lastTempList).forEach(item => { Object.keys(lastTempList).forEach(item => {
lastList.push({ lastList.push({
label: item, label: item,
value: this.numAddSymbol(lastTempList[item].num) value: lastTempList[item].num ? this.numAddSymbol(lastTempList[item].num) : '- -'
}) })
}) })
this.dataList.push({ this.dataList.push({
......
...@@ -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-07-04 17:32:35 * @LastEditTime: 2022-07-04 18:39:00
--> -->
<template> <template>
<div> <div>
...@@ -183,15 +183,13 @@ export default { ...@@ -183,15 +183,13 @@ export default {
] ]
} }
this.echartsFunnel.setOption(this.option) this.echartsFunnel.setOption(this.option)
// 鼠标划入 this.echartsFunnel.on(
utils.debounce( 'mouseover',
this.echartsFunnel.on('mouseover', data => { utils.debounce(data => {
this.getSaleTrans(this.paramsData, data.data.type) this.getSaleTrans(this.paramsData, data.data.type)
}) }),
1000 / 60
) )
// this.echartsFunnel.on('mouseover', data => {
// this.getSaleTrans(this.paramsData, data.data.type)
// })
}, },
getSaleTrans(val, queryItem = 'enter') { getSaleTrans(val, queryItem = 'enter') {
const params = { const params = {
......
...@@ -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-07-04 17:40:52 * @LastEditTime: 2022-07-04 18:25:19
--> -->
<template> <template>
<div> <div>
...@@ -132,12 +132,14 @@ export default { ...@@ -132,12 +132,14 @@ export default {
}, },
extraCssText: 'width: 80px;', extraCssText: 'width: 80px;',
formatter: e => { formatter: e => {
var txt = '' const index = e[0].dataIndex
const date = this.dataList[0][index].statDate
var txt = date + '<br />'
e.forEach(item => { e.forEach(item => {
if (txt) { // if (txt) {
txt = txt + '<br />' // txt = txt + '<br />'
} // }
txt = txt + item.seriesName + ':' + item.value txt = txt + item.seriesName + ':' + item.value + '<br />'
}) })
return txt return txt
} }
...@@ -165,7 +167,7 @@ export default { ...@@ -165,7 +167,7 @@ export default {
color: '#606266' color: '#606266'
} }
}, },
splitNumber: 4 splitNumber: 3
}, },
series: [ series: [
{ {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!