修改echarts警告、数字增加滚动效果

pull/1/head
LiuJiaNan 2024-02-26 17:59:52 +08:00
parent cb1f9bae82
commit 5751d75241
11 changed files with 190 additions and 242 deletions

View File

@ -107,7 +107,6 @@ function echarts1(id, legend, echartCount) {
},
},
itemStyle: {
normal: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 1,
@ -122,7 +121,6 @@ function echarts1(id, legend, echartCount) {
]),
barBorderRadius: [0, 0, 0, 0],
},
},
data: echartCount,
},
{
@ -138,7 +136,6 @@ function echarts1(id, legend, echartCount) {
},
},
itemStyle: {
normal: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 1,
@ -153,7 +150,6 @@ function echarts1(id, legend, echartCount) {
]),
barBorderRadius: [0, 0, 0, 0],
},
},
data: echartCount,
barGap: 0,
legendHoverLink: false,
@ -165,10 +161,8 @@ function echarts1(id, legend, echartCount) {
},
type: "pictorialBar",
itemStyle: {
normal: {
color: "rgba(183, 195, 226, 1)",
},
},
symbol: "diamond",
symbolRotate: 0,
symbolSize: ["17", "7"],

View File

@ -130,30 +130,6 @@ function echarts4(id) {
fontSize: 12,
},
itemStyle: {
// normal: {
// color: {
// type: 'linear',
// x: 0,
// y: 0,
// x2: 0,
// y2: 1,
// colorStops: [
// {
// offset: 0,
// color: '#3b89f4',
// },
// {
// offset: 1,
// color: '#cce7fc',
// },
// ],
// global: false, // 缺省为 false
// },
// },
// emphasis: {
// opacity: 1,
// },
normal: {
color: (params) => {
const colorList = [
{
@ -211,7 +187,6 @@ function echarts4(id) {
return colorList[params.dataIndex];
},
opacity: 0.7,
},
// 鼠标移入柱子上 透明度变为 1
emphasis: {
opacity: 1,

View File

@ -248,53 +248,45 @@ const fnInitEcharts = (data) => {
type: "line",
data: data.one,
itemStyle: {
normal: {
color: "red",
lineStyle: {
color: "red",
},
},
},
},
{
name: "二级聚集",
type: "line",
data: data.two,
itemStyle: {
normal: {
color: "orange",
lineStyle: {
color: "orange",
},
},
},
},
{
name: "三级聚集",
type: "line",
data: data.three,
itemStyle: {
normal: {
color: "#ffeb3b",
lineStyle: {
color: "#ffeb3b",
},
},
},
},
{
name: "聚集总计",
type: "line",
data: data.zong,
itemStyle: {
normal: {
color: "#0385f4",
lineStyle: {
color: "#0385f4",
},
},
},
},
],
};
myChart1.setOption(option);

View File

@ -92,7 +92,6 @@ const fnInitEcharts = (data) => {
},
barWidth: 15,
itemStyle: {
normal: {
color: function (params) {
const colorList = [
"#ee6666",
@ -106,7 +105,6 @@ const fnInitEcharts = (data) => {
},
},
},
},
],
};
myChart3.setOption(option);

View File

@ -21,9 +21,7 @@ const fnInitEcharts = (data) => {
text: "清单检查类型统计",
textStyle: {
fontSize: "14",
normal: {
fontWeight: "700",
},
color: "#fff",
},
},
@ -79,40 +77,34 @@ const fnInitEcharts = (data) => {
type: "line",
data: data.xcqd,
itemStyle: {
normal: {
color: "#3ca272",
lineStyle: {
color: "#3ca272",
},
},
},
},
{
name: "基础清单",
type: "line",
data: data.jcqd,
itemStyle: {
normal: {
color: "#5470c6",
lineStyle: {
color: "#5470c6",
},
},
},
},
{
name: "综合清单",
type: "line",
data: data.zhqd,
itemStyle: {
normal: {
color: "#ee6666",
lineStyle: {
color: "#ee6666",
},
},
},
},
],
};
myChart1.setOption(option);

View File

@ -85,7 +85,6 @@ const fnInitEcharts = (data) => {
data: yData,
barWidth: "10px",
itemStyle: {
normal: {
color: new echarts.graphic.LinearGradient(
0,
0,
@ -105,7 +104,6 @@ const fnInitEcharts = (data) => {
),
},
},
},
],
};
myChart.setOption(option);

View File

@ -33,7 +33,7 @@ const fnInitEcharts = (data) => {
},
legend: {
icon: "rect",
top: "5%",
top: "8%",
right: "5%",
itemWidth: 12,
itemHeight: 12,
@ -103,48 +103,40 @@ const fnInitEcharts = (data) => {
data: data.all,
smooth: true,
itemStyle: {
normal: {
color: colorList[0],
borderColor: colorList[0],
},
},
},
{
name: "未整改隐患数",
type: "line",
data: data.wzg,
smooth: true,
itemStyle: {
normal: {
color: colorList[1],
borderColor: colorList[1],
},
},
},
{
name: "已整改隐患数",
type: "line",
data: data.yzg,
smooth: true,
itemStyle: {
normal: {
color: colorList[2],
borderColor: colorList[2],
},
},
},
{
name: "已验收隐患数",
type: "line",
data: data.yys,
smooth: true,
itemStyle: {
normal: {
color: colorList[3],
borderColor: colorList[3],
},
},
},
],
};
myChart.setOption(option);

View File

@ -3,20 +3,21 @@
<div class="title">风险管控统计分析</div>
<div class="round-box">
<div class="content">
<h1>{{ info.unitcount }}</h1>
<span>风险点单元</span>
<count-to :end-val="info.unitcount" class="value" />
<span class="label">风险点单元</span>
</div>
<div class="round-jt" />
<div class="content">
<h1>{{ info.idcount }}</h1>
<span>辨识部位</span>
<count-to :end-val="info.idcount" class="value" />
<span class="label">辨识部位</span>
</div>
<div class="round-jt" />
<div class="content">
<h1>
{{ info.acount + info.bcount + info.ccount + info.dcount }}
</h1>
<span>存在风险</span>
<count-to
:end-val="info.acount + info.bcount + info.ccount + info.dcount"
class="value"
/>
<span class="label">存在风险</span>
</div>
</div>
</div>
@ -25,6 +26,7 @@
<script setup>
import { ref } from "vue";
import { getRiskManagement } from "@/request/large_screen_data_display.js";
import CountTo from "vue-countup-v3";
const info = ref({
unitcount: 0,
@ -89,13 +91,16 @@ fnGetData();
text-align: center;
position: relative;
h1 {
padding-top: 25px;
.value {
color: #70c5ff;
font-size: 20px;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
span {
.label {
display: inline-block;
width: 100%;
color: #aaddff;

View File

@ -8,8 +8,8 @@
<img src="/src/assets/images/bi/faxianico.png" alt="" />
</div>
<div>
<span>{{ info.all }}</span>
<span>发现隐患数</span>
<count-to :end-val="info.all" />
<div>发现隐患数</div>
</div>
</div>
<div class="item">
@ -17,8 +17,8 @@
<img src="/src/assets/images/bi/noonico.png" alt="" />
</div>
<div>
<span>{{ info.wzg }}</span>
<span>未完成整改隐患</span>
<count-to :end-val="info.wzg" />
<div>未完成整改隐患</div>
</div>
</div>
<div class="item">
@ -26,12 +26,13 @@
<img src="/src/assets/images/bi/yinhuan.png" alt="" />
</div>
<div>
<span>
{{
<count-to
:end-val="
info.all !== 0 ? ((info.wzg / info.all) * 100).toFixed(2) : 0.0
}}%
</span>
<span>未整改率</span>
"
:options="{ suffix: '%' }"
/>
<div>未整改率</div>
</div>
</div>
</div>
@ -41,6 +42,7 @@
<script setup>
import { ref } from "vue";
import { getHiddenCount } from "@/request/large_screen_data_display.js";
import CountTo from "vue-countup-v3";
const info = ref({
all: 0,
@ -108,19 +110,15 @@ fnGetData();
height: 34px;
}
div:nth-child(2) {
> div:nth-child(2) {
margin-left: 10px;
span {
display: block;
&:first-child {
.countup-wrap {
color: #f8b62d;
font-size: 20px;
}
}
}
}
}
}
</style>

View File

@ -4,16 +4,25 @@
<div class="p-20">
<div class="top">
<div>
<div>现场类清单数</div>
<div>{{ info["现场清单"] || 0 }}</div>
<div class="top_title">现场类清单数</div>
<count-to
:end-val="info['现场清单'] || 0"
:options="{ suffix: '个' }"
/>
</div>
<div>
<div>基础类清单数</div>
<div>{{ info["基础类清单"] || 0 }}</div>
<div class="top_title">基础类清单数</div>
<count-to
:end-val="info['基础类清单'] || 0"
:options="{ suffix: '个' }"
/>
</div>
<div>
<div>综合类清单数</div>
<div>{{ info["综合类清单"] || 0 }}</div>
<div class="top_title">综合类清单数</div>
<count-to
:end-val="info['综合类清单'] || 0"
:options="{ suffix: '个' }"
/>
</div>
</div>
<div class="bottom">
@ -46,6 +55,7 @@ import {
import { sumBy } from "lodash-es";
import { arrayObjectDeduplication } from "@/assets/js/utils.js";
import * as echarts from "echarts";
import CountTo from "vue-countup-v3";
const info = ref({});
@ -98,11 +108,9 @@ const fnInitEcharts = (count, total, color, el) => {
type: "bar",
zlevel: 1,
itemStyle: {
normal: {
barBorderRadius: 0,
color,
},
},
label: {
show: true,
position: "inside",
@ -117,12 +125,10 @@ const fnInitEcharts = (count, total, color, el) => {
barGap: "-100%",
data: [total],
itemStyle: {
normal: {
color: "#101f48",
barBorderRadius: 0,
},
},
},
],
};
myChart.setOption(option);
@ -156,11 +162,11 @@ const fnInitEcharts = (count, total, color, el) => {
border: 4px solid #0d2565;
padding: 5px 20px 5px 5px;
div:nth-child(1) {
.top_title {
color: #fff;
}
div:nth-child(2) {
.countup-wrap {
color: #04cbfd;
text-align: right;
padding-top: 5px;

View File

@ -503,14 +503,12 @@ const fnInitEcharts = (echartsData, example, id) => {
{
name: echartsData.legend[0],
itemStyle: {
normal: {
color: echartsData.color[0],
lineStyle: {
color: echartsData.color[0],
width: 2,
},
},
},
smooth: true,
type: "line",
data: echartsData.dataY[0],