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

View File

@ -130,30 +130,6 @@ function echarts4(id) {
fontSize: 12, fontSize: 12,
}, },
itemStyle: { 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) => { color: (params) => {
const colorList = [ const colorList = [
{ {
@ -211,7 +187,6 @@ function echarts4(id) {
return colorList[params.dataIndex]; return colorList[params.dataIndex];
}, },
opacity: 0.7, opacity: 0.7,
},
// 鼠标移入柱子上 透明度变为 1 // 鼠标移入柱子上 透明度变为 1
emphasis: { emphasis: {
opacity: 1, opacity: 1,

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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