Commit 96aa38df by 匡雅琴

提交

1 parent a531739b
......@@ -2,12 +2,12 @@
<div class="pie-box">
<div :id="id" :style="{ height: height }" class="pie-chart"></div>
<!-- <div class="center-content" :style="{ fontSize: size }">
<div :class="[id, 'center-content-num', 'center-content-num-color']"></div>
</div> -->
<div :class="[id, 'center-content-num', 'center-content-num-color']"></div>
</div> -->
<!-- <div class="content-desc">
<div class="content-desc-icon" :style="{ background: descColor }"></div>
{{ numDesc }}
</div> -->
<div class="content-desc-icon" :style="{ background: descColor }"></div>
{{ numDesc }}
</div> -->
</div>
</template>
......@@ -105,36 +105,11 @@ export default {
color: this.colors,
series: [
{
type: 'pie',
radius: this.radius,
center: ['50%', '50%'],
tooltip: {
show: false
},
itemStyle: {
normal: {
color: 'rgba(96, 148, 234, 0.5)'
}
},
label: {
normal: {
show: false
}
},
labelLine: {
normal: {
show: false
}
},
data: [0]
},
{
name: '客户年龄分布',
type: 'pie',
radius: this.radius,
roseType: 'radius',
center: ['50%', '50%'],
roseType: 'radius',
avoidLabelOverlap: false,
label: {
normal: {
......@@ -158,6 +133,35 @@ export default {
},
data: this.viewData,
minAngle: 30
},
{
name: '外边框',
type: 'pie',
tooltip: {
show: false
},
clockWise: false, // 顺时加载
hoverAnimation: false, // 鼠标移入变大
center: ['50%', '50%'], // 这里跟上面那组一样即可
radius: ['80%', '80%'], // 这里根据自己的需要自行调整,但是两个值要一样大哦,如果小于上方设置的最小内圆30%则为内阴影,大于外圆60%则为外阴影
label: {
normal: {
show: false // 重点:此处主要是为了不展示data中的value和name
}
},
data: [
{
value: 1, // 此处的值无所谓是多少
name: '', // 因为不展示label,可不填
itemStyle: {
// 边框样式,此处我们设置的浅蓝色,颜色可自行修改
normal: {
borderWidth: 20, // 边框宽度
borderColor: 'rgba(94, 183, 249, 0.13)'// 边框颜色
}
}
}
]
}
]
}
......@@ -166,22 +170,24 @@ export default {
this.numDesc = ''
this.echartsPie.setOption(this.option)
this.pieActive()
this.mTime = setInterval(this.pieActive, 1500)
this.mTime = setInterval(this.pieActive, 1000)
// 鼠标划出
// this.echartsPie.on('mouseout', () => {
// if (this.mTime) clearInterval(this.mTime)
// this.mTime = setInterval(this.pieActive, 1500)
// })
// this.echartsPie.on('mouseover', data => {
// this.mainValue = data.data.value
// this.numDesc = data.data.name
// this.descColor = data.color
// // 停止定时器,清除之前的高亮
// clearInterval(this.mTime)
// this.currentIndex = data.dataIndex
// this.highlightPie()
// this.emitEvent(data.data)
// })
this.echartsPie.on('mouseout', () => {
if (this.mTime) clearInterval(this.mTime)
this.mTime = setInterval(this.pieActive, 15000)
})
this.echartsPie.on('mouseover', data => {
console.log(222);
console.log(data);
this.mainValue = data.data.value
this.numDesc = data.data.name
this.descColor = data.color
// 停止定时器,清除之前的高亮
clearInterval(this.mTime)
this.currentIndex = data.dataIndex
this.highlightPie()
this.emitEvent(data.data)
})
},
// 事件触发
emitEvent(data) {
......@@ -204,11 +210,11 @@ export default {
seriesIndex: 0,
dataIndex: this.currentIndex
})
// this.descColor = this.option.color[this.currentIndex]
this.descColor = this.option.color[this.currentIndex]
},
// 高亮
pieActive() {
const dataLen = this.option.series[1].data.length
const dataLen = this.option.series[0].data.length
this.currentIndex = (this.currentIndex + 1) % dataLen
this.highlightPie()
this.emitEvent(this.viewData[this.currentIndex])
......
......@@ -5,7 +5,13 @@
<template v-if="inx === 0">
<div class="ranking-box-item-left">
<div class="circle" :style="{ 'background-image': index < 3 ? RankColor[index] : '' }">{{ index + 1 }}</div>
<div class="text">{{ item[itm.name] }}</div>
<!-- 证书超过滚动显示 -->
<template v-if="!isMultiple">
<marquee class="marquee text" :direction="directionTimer" :delay="delayTimer" :text="item[itm.name]" />
</template>
<template v-else>
<div class="text">{{ item[itm.name] }}</div>
</template>
</div>
</template>
<template v-else>
......@@ -31,11 +37,18 @@ export default {
rankingDataObj: {
type: Array,
default: () => []
},
// 是否是多个
isMultiple: {
type: Boolean,
default: true
}
},
data() {
return {
RankColor: datas.RankColor
RankColor: datas.RankColor,
delayTimer: 3000,
directionTimer: 3000
}
},
......@@ -77,6 +90,10 @@ export default {
margin-left: 1.11vw;
cursor: default;
}
.marquee {
width: 17vw;
height: 20px;
}
.text:hover {
box-sizing: border-box;
// padding-bottom: 1px;
......
<template>
<div class="storage-box">
<box-title title="入库使用情况"></box-title>
<pie-chart-shadow :id="chart.id" :list="listData" :height="chart.height"></pie-chart-shadow>
<Legend class="legend" :list="listData" :legentList="legentList"></Legend>
<pie-chart-shadow :id="chart.id" :list="listData" :height="chart.height" :colors="chart.colors"></pie-chart-shadow>
<Legend class="legend" :list="listData" :legentList="legentList" :colors="chart.colors"></Legend>
</div>
</template>
......@@ -14,7 +14,8 @@ export default {
return {
chart: {
id: 'shadowPie',
height: '15.34vh'
height: '17.7vh',
colors: ['#34AFFF', '#16E193']
},
listData: [
{
......@@ -53,5 +54,8 @@ export default {
width: 19.72vw;
height: 32vh;
box-shadow: inset 0 0 20px 0 #3d57ff69;
.legend {
padding: 0.96vh 2.78vw 0;
}
}
</style>
......@@ -15,7 +15,7 @@
</div>
<!-- 门店排行 -->
<div class="merchant-box">
<ranking :rankingsList="merchantsList" :rankingDataObj="merchantsDataObj"></ranking>
<ranking :rankingsList="merchantsList" :rankingDataObj="merchantsDataObj" :isMultiple="false"></ranking>
</div>
</div>
</div>
......@@ -35,7 +35,7 @@ export default {
// 采购额排名门店数据
merchantsList: [
{
name: '公转一号店',
name: '公转一号店公转一号店公转一号店公转一号店',
// merchant: '云南宏胜瑞达汽车销售',
value: '345489'
},
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!