Commit f5c2d8b7 by 王志慧

commit

1 parent 8f20ebe3
......@@ -11,9 +11,13 @@
<div class="line-item">
<marquee :direction="directionTimer" :delay="delayTimer" :text="item.label"></marquee>
</div>
<div class="line-item">
<marquee class="txt-orange" :direction="directionTimer" :delay="delayTimer" :text="item.value"></marquee>
<span class="txt-orange" :direction="directionTimer" :delay="delayTimer">{{ item.value }}</span>
</div>
<!-- <div class="line-item">
<marquee class="txt-orange" :direction="directionTimer" :delay="delayTimer" :text="item.value"></marquee>
</div> -->
</div>
</div>
</div>
......@@ -137,17 +141,17 @@ export default {
// 移除图表
this[this.domId].on('globalout', () => {
// this.chartAction()
this.chartAction()
this.getRankList(this.dataList.length - 1, this.rankFlag + 'List')
})
},
// chartAction(type) {
// this[this.domId].dispatchAction({
// type: type || 'showTip',
// seriesIndex: +this.moveAttr.seriesIndex,
// dataIndex: +this.moveAttr.dataIndex
// })
// },
chartAction(type) {
this[this.domId].dispatchAction({
type: type || 'showTip',
seriesIndex: 0,
dataIndex: this.dataList.length - 1
})
},
getRankList(idx, attrName = 'topList') {
this.dataList[idx][attrName].length ? this.$set(this, 'rankList', this.dataList[idx][attrName]) : this.resetRankList()
},
......@@ -160,7 +164,7 @@ export default {
this.lineOptions.series[0].data = this.dataList.map(item => item.num)
this[this.domId].setOption(this.lineOptions)
// 默认展示tooltip
// this.chartAction()
this.chartAction()
this.getRankList(this.dataList.length - 1)
},
handleRankChange(value) {
......
......@@ -3,7 +3,10 @@
<div :id="id" :style="{ height: height }" class="pie-chart"></div>
<div class="center-content" :style="{ fontSize: size }">
<div :class="[id, 'center-content-num']"></div>
<div class="center-content-desc">{{ numDesc }}</div>
</div>
<div class="content-desc">
<div class="content-desc-icon" :style="{ background: descColor }"></div>
{{ numDesc }}
</div>
</div>
</template>
......@@ -54,7 +57,8 @@ export default {
subtext: '',
currentIndex: -1,
mainValue: 0,
numDesc: ''
numDesc: '',
descColor: ''
}
},
watch: {
......@@ -145,8 +149,10 @@ export default {
this.mTime = setInterval(this.pieActive, 15000)
})
this.echartsPie.on('mouseover', data => {
console.log(data, 'data')
this.mainValue = data.data.value
this.numDesc = data.data.name
this.descColor = data.color
this.setAnamiteText()
// 停止定时器,清除之前的高亮
clearInterval(this.mTime)
......@@ -178,16 +184,18 @@ export default {
dataIndex: this.currentIndex
})
//高亮项this.currentIndex
this.mainValue = this.option.series[0].data[this.currentIndex].value
this.numDesc = this.option.series[0].data[this.currentIndex].name
this.descColor = this.option.color[this.currentIndex]
this.setAnamiteText()
},
setAnamiteText() {
document.querySelector(`.${this.id}`).nextElementSibling.style = 'animation-iteration-count:infinite;'
// document.querySelector(`.${this.id}`).nextElementSibling.style = 'animation-iteration-count:infinite;'
if (document.querySelector(`.${this.id}`)) document.querySelector(`.${this.id}`).style = `--step:${this.mainValue}`
setTimeout(() => {
document.querySelector(`.${this.id}`).nextElementSibling.style = 'animation-iteration-count:0'
}, 3000)
// setTimeout(() => {
// document.querySelector(`.${this.id}`).nextElementSibling.style = 'animation-iteration-count:0'
// }, 3000)
},
//高亮
pieActive() {
......@@ -235,7 +243,26 @@ export default {
animation: rotateIn 3s infinite;
}
}
.pie-chart {
.content-desc {
display:flex;
align-items: center;
font-size: 8px;
color: #c8c8c8;
text-align: center;
font-weight: 400;
position: absolute;
top: 93%;
left: 50%;
transform: translateX(-50%);
text-align: center;
height: 14px !important;
white-space: nowrap;
&-icon {
width: 8px;
height: 4px;
border-radius: 2px;
margin-right:4px;
}
}
}
@property --step {
......
......@@ -140,6 +140,7 @@ export default {
this.getOveralltrend('total')
},
changeType (type) {
console.log(type,'type')
this.tabType = type
this.getOveralltrend(type)
},
......
......@@ -98,8 +98,8 @@ export default {
})
this.dataList.push({
num: item.num || 0,
hrate: item.hrate.toFixed(2) || 0,
trate: item.trate.toFixed(2) || 0,
hrate: item.hrate.toFixed(4) || 0,
trate: item.trate.toFixed(4) || 0,
statDate: item.statDate,
topList: topList,
lastList: lastList
......
......@@ -100,8 +100,8 @@ export default {
})
this.dataList.push({
num: item.num || 0,
hrate: item.hrate.toFixed(2) || 0,
trate: item.trate.toFixed(2) || 0,
hrate: item.hrate.toFixed(4) || 0,
trate: item.trate.toFixed(4) || 0,
statDate: item.statDate,
topList: topList,
lastList: lastList
......
......@@ -116,20 +116,20 @@ export default {
Object.keys(topTempList).forEach(item => {
topList.push({
label: item,
value: topTempList[item].rate ? topTempList[item].rate.toFixed(2) + '%' : '- -'
value: topTempList[item].rate ? topTempList[item].rate.toFixed(4) + '%' : '- -'
})
})
Object.keys(lastTempList).forEach(item => {
lastList.push({
label: item,
value: lastTempList[item].rate ? lastTempList[item].rate.toFixed(2) + '%' : '- -'
value: lastTempList[item].rate ? lastTempList[item].rate.toFixed(4) + '%' : '- -'
})
})
this.dataList.push({
num: item.num || 0,
rate: item.rate.toFixed(2) || 0,
hrate: item.hrate.toFixed(2) || 0,
trate: item.trate.toFixed(2) || 0,
rate: item.rate.toFixed(4) || 0,
hrate: item.hrate.toFixed(4) || 0,
trate: item.trate.toFixed(4) || 0,
statDate: item.statDate,
topList: topList,
lastList: lastList
......
......@@ -108,20 +108,20 @@ export default {
Object.keys(topTempList).forEach(item => {
topList.push({
label: item,
value: topTempList[item].rate ? topTempList[item].rate.toFixed(2) + '%' : '- -'
value: topTempList[item].rate ? topTempList[item].rate.toFixed(4) + '%' : '- -'
})
})
Object.keys(lastTempList).forEach(item => {
lastList.push({
label: item,
value: lastTempList[item].rate ? lastTempList[item].rate.toFixed(2) + '%' : '- -'
value: lastTempList[item].rate ? lastTempList[item].rate.toFixed(4) + '%' : '- -'
})
})
this.dataList.push({
num: item.num || 0,
rate: item.rate.toFixed(2) || 0,
hrate: item.hrate.toFixed(2) || 0,
trate: item.trate.toFixed(2) || 0,
rate: item.rate.toFixed(4) || 0,
hrate: item.hrate.toFixed(4) || 0,
trate: item.trate.toFixed(4) || 0,
statDate: item.statDate,
topList: topList,
lastList: lastList
......
......@@ -108,20 +108,20 @@ export default {
Object.keys(topTempList).forEach(item => {
topList.push({
label: item,
value: topTempList[item].rate ? topTempList[item].rate.toFixed(2) + '%' : '- -'
value: topTempList[item].rate ? topTempList[item].rate.toFixed(4) + '%' : '- -'
})
})
Object.keys(lastTempList).forEach(item => {
lastList.push({
label: item,
value: lastTempList[item].rate ? lastTempList[item].rate.toFixed(2) + '%' : '- -'
value: lastTempList[item].rate ? lastTempList[item].rate.toFixed(4) + '%' : '- -'
})
})
this.dataList.push({
num: item.num || 0,
rate: item.rate.toFixed(2) || 0,
hrate: item.hrate.toFixed(2) || 0,
trate: item.trate.toFixed(2) || 0,
rate: item.rate.toFixed(4) || 0,
hrate: item.hrate.toFixed(4) || 0,
trate: item.trate.toFixed(4) || 0,
statDate: item.statDate,
topList: topList,
lastList: lastList
......
......@@ -116,20 +116,20 @@ export default {
Object.keys(topTempList).forEach(item => {
topList.push({
label: item,
value: topTempList[item].rate ? topTempList[item].rate.toFixed(2) + '%' : '- -'
value: topTempList[item].rate ? topTempList[item].rate.toFixed(4) + '%' : '- -'
})
})
Object.keys(lastTempList).forEach(item => {
lastList.push({
label: item,
value: lastTempList[item].rate ? lastTempList[item].rate.toFixed(2) + '%' : '- -'
value: lastTempList[item].rate ? lastTempList[item].rate.toFixed(4) + '%' : '- -'
})
})
this.dataList.push({
num: item.num || 0,
rate: item.rate.toFixed(2) || 0,
hrate: item.hrate.toFixed(2) || 0,
trate: item.trate.toFixed(2) || 0,
rate: item.rate.toFixed(4) || 0,
hrate: item.hrate.toFixed(4) || 0,
trate: item.trate.toFixed(4) || 0,
statDate: item.statDate,
topList: topList,
lastList: lastList
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!