Commit f5c2d8b7 by 王志慧

commit

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