Commit 96aa38df by 匡雅琴

提交

1 parent a531739b
...@@ -2,12 +2,12 @@ ...@@ -2,12 +2,12 @@
<div class="pie-box"> <div class="pie-box">
<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', 'center-content-num-color']"></div> <div :class="[id, 'center-content-num', 'center-content-num-color']"></div>
</div> --> </div> -->
<!-- <div class="content-desc"> <!-- <div class="content-desc">
<div class="content-desc-icon" :style="{ background: descColor }"></div> <div class="content-desc-icon" :style="{ background: descColor }"></div>
{{ numDesc }} {{ numDesc }}
</div> --> </div> -->
</div> </div>
</template> </template>
...@@ -105,36 +105,11 @@ export default { ...@@ -105,36 +105,11 @@ export default {
color: this.colors, color: this.colors,
series: [ 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: '客户年龄分布', name: '客户年龄分布',
type: 'pie', type: 'pie',
radius: this.radius, radius: this.radius,
roseType: 'radius',
center: ['50%', '50%'], center: ['50%', '50%'],
roseType: 'radius',
avoidLabelOverlap: false, avoidLabelOverlap: false,
label: { label: {
normal: { normal: {
...@@ -158,6 +133,35 @@ export default { ...@@ -158,6 +133,35 @@ export default {
}, },
data: this.viewData, data: this.viewData,
minAngle: 30 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 { ...@@ -166,22 +170,24 @@ export default {
this.numDesc = '' this.numDesc = ''
this.echartsPie.setOption(this.option) this.echartsPie.setOption(this.option)
this.pieActive() this.pieActive()
this.mTime = setInterval(this.pieActive, 1500) this.mTime = setInterval(this.pieActive, 1000)
// 鼠标划出 // 鼠标划出
// this.echartsPie.on('mouseout', () => { this.echartsPie.on('mouseout', () => {
// if (this.mTime) clearInterval(this.mTime) if (this.mTime) clearInterval(this.mTime)
// this.mTime = setInterval(this.pieActive, 1500) this.mTime = setInterval(this.pieActive, 15000)
// }) })
// this.echartsPie.on('mouseover', data => { this.echartsPie.on('mouseover', data => {
// this.mainValue = data.data.value console.log(222);
// this.numDesc = data.data.name console.log(data);
// this.descColor = data.color this.mainValue = data.data.value
// // 停止定时器,清除之前的高亮 this.numDesc = data.data.name
// clearInterval(this.mTime) this.descColor = data.color
// this.currentIndex = data.dataIndex // 停止定时器,清除之前的高亮
// this.highlightPie() clearInterval(this.mTime)
// this.emitEvent(data.data) this.currentIndex = data.dataIndex
// }) this.highlightPie()
this.emitEvent(data.data)
})
}, },
// 事件触发 // 事件触发
emitEvent(data) { emitEvent(data) {
...@@ -204,11 +210,11 @@ export default { ...@@ -204,11 +210,11 @@ export default {
seriesIndex: 0, seriesIndex: 0,
dataIndex: this.currentIndex dataIndex: this.currentIndex
}) })
// this.descColor = this.option.color[this.currentIndex] this.descColor = this.option.color[this.currentIndex]
}, },
// 高亮 // 高亮
pieActive() { pieActive() {
const dataLen = this.option.series[1].data.length const dataLen = this.option.series[0].data.length
this.currentIndex = (this.currentIndex + 1) % dataLen this.currentIndex = (this.currentIndex + 1) % dataLen
this.highlightPie() this.highlightPie()
this.emitEvent(this.viewData[this.currentIndex]) this.emitEvent(this.viewData[this.currentIndex])
......
...@@ -5,7 +5,13 @@ ...@@ -5,7 +5,13 @@
<template v-if="inx === 0"> <template v-if="inx === 0">
<div class="ranking-box-item-left"> <div class="ranking-box-item-left">
<div class="circle" :style="{ 'background-image': index < 3 ? RankColor[index] : '' }">{{ index + 1 }}</div> <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> </div>
</template> </template>
<template v-else> <template v-else>
...@@ -31,11 +37,18 @@ export default { ...@@ -31,11 +37,18 @@ export default {
rankingDataObj: { rankingDataObj: {
type: Array, type: Array,
default: () => [] default: () => []
},
// 是否是多个
isMultiple: {
type: Boolean,
default: true
} }
}, },
data() { data() {
return { return {
RankColor: datas.RankColor RankColor: datas.RankColor,
delayTimer: 3000,
directionTimer: 3000
} }
}, },
...@@ -77,6 +90,10 @@ export default { ...@@ -77,6 +90,10 @@ export default {
margin-left: 1.11vw; margin-left: 1.11vw;
cursor: default; cursor: default;
} }
.marquee {
width: 17vw;
height: 20px;
}
.text:hover { .text:hover {
box-sizing: border-box; box-sizing: border-box;
// padding-bottom: 1px; // padding-bottom: 1px;
......
<template> <template>
<div class="storage-box"> <div class="storage-box">
<box-title title="入库使用情况"></box-title> <box-title title="入库使用情况"></box-title>
<pie-chart-shadow :id="chart.id" :list="listData" :height="chart.height"></pie-chart-shadow> <pie-chart-shadow :id="chart.id" :list="listData" :height="chart.height" :colors="chart.colors"></pie-chart-shadow>
<Legend class="legend" :list="listData" :legentList="legentList"></Legend> <Legend class="legend" :list="listData" :legentList="legentList" :colors="chart.colors"></Legend>
</div> </div>
</template> </template>
...@@ -14,7 +14,8 @@ export default { ...@@ -14,7 +14,8 @@ export default {
return { return {
chart: { chart: {
id: 'shadowPie', id: 'shadowPie',
height: '15.34vh' height: '17.7vh',
colors: ['#34AFFF', '#16E193']
}, },
listData: [ listData: [
{ {
...@@ -53,5 +54,8 @@ export default { ...@@ -53,5 +54,8 @@ export default {
width: 19.72vw; width: 19.72vw;
height: 32vh; height: 32vh;
box-shadow: inset 0 0 20px 0 #3d57ff69; box-shadow: inset 0 0 20px 0 #3d57ff69;
.legend {
padding: 0.96vh 2.78vw 0;
}
} }
</style> </style>
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
</div> </div>
<!-- 门店排行 --> <!-- 门店排行 -->
<div class="merchant-box"> <div class="merchant-box">
<ranking :rankingsList="merchantsList" :rankingDataObj="merchantsDataObj"></ranking> <ranking :rankingsList="merchantsList" :rankingDataObj="merchantsDataObj" :isMultiple="false"></ranking>
</div> </div>
</div> </div>
</div> </div>
...@@ -35,7 +35,7 @@ export default { ...@@ -35,7 +35,7 @@ export default {
// 采购额排名门店数据 // 采购额排名门店数据
merchantsList: [ merchantsList: [
{ {
name: '公转一号店', name: '公转一号店公转一号店公转一号店公转一号店',
// merchant: '云南宏胜瑞达汽车销售', // merchant: '云南宏胜瑞达汽车销售',
value: '345489' value: '345489'
}, },
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!