fix:首页+大屏问题修改

This commit is contained in:
SunTao 2024-10-31 09:20:08 +08:00
parent 8d356de312
commit 3b65a08f56
11 changed files with 226 additions and 113 deletions

View File

@ -2,7 +2,7 @@
* @Author: SunTao 328867980@qq.com * @Author: SunTao 328867980@qq.com
* @Date: 2024-10-22 15:30:25 * @Date: 2024-10-22 15:30:25
* @LastEditors: SunTao 328867980@qq.com * @LastEditors: SunTao 328867980@qq.com
* @LastEditTime: 2024-10-29 14:34:32 * @LastEditTime: 2024-10-30 17:01:57
* @FilePath: \znxjxt-ui\src\views\big-screen\components\img-dialog.vue * @FilePath: \znxjxt-ui\src\views\big-screen\components\img-dialog.vue
* @Description: 大屏查看图片弹窗 * @Description: 大屏查看图片弹窗
--> -->
@ -379,6 +379,7 @@ export default {
}, },
mounted() { mounted() {
this.getList(); this.getList();
this.showImage(0);
window.addEventListener("keydown", this.handleKeydown); window.addEventListener("keydown", this.handleKeydown);
window.addEventListener("resize", this.updateRects); window.addEventListener("resize", this.updateRects);
}, },

View File

@ -2,7 +2,7 @@
* @Author: SunTao 328867980@qq.com * @Author: SunTao 328867980@qq.com
* @Date: 2024-10-18 10:31:31 * @Date: 2024-10-18 10:31:31
* @LastEditors: SunTao 328867980@qq.com * @LastEditors: SunTao 328867980@qq.com
* @LastEditTime: 2024-10-24 15:35:02 * @LastEditTime: 2024-10-30 16:21:25
* @FilePath: \znxjxt-ui\src\views\big-screen\disease-components\pic-rank.vue * @FilePath: \znxjxt-ui\src\views\big-screen\disease-components\pic-rank.vue
* @Description: 病害巡检-pic排名 * @Description: 病害巡检-pic排名
--> -->
@ -94,7 +94,7 @@ export default {
getPicData() { getPicData() {
roadPic().then(({ data, code }) => { roadPic().then(({ data, code }) => {
if (code === 200) { if (code === 200) {
this.picList = data; this.picList = data.slice(0, 5);
} }
}); });
}, },
@ -159,27 +159,47 @@ export default {
.pic-bottom-0 { .pic-bottom-0 {
height: 0.3rem; height: 0.3rem;
background: linear-gradient(90deg, #322707 0%, #ffc000 100%); background: linear-gradient(
90deg,
rgba(3, 25, 56, 0.2) 0%,
#ffc000 100%
);
} }
.pic-bottom-1 { .pic-bottom-1 {
height: 0.3rem; height: 0.3rem;
background: linear-gradient(90deg, #322707 0%, #00fcff 100%); background: linear-gradient(
90deg,
rgba(3, 25, 56, 0.2) 0%,
#00fcff 100%
);
} }
.pic-bottom-2 { .pic-bottom-2 {
height: 0.3rem; height: 0.3rem;
background: linear-gradient(90deg, #322707 0%, #22b5ff 100%); background: linear-gradient(
90deg,
rgba(3, 25, 56, 0.2) 0%,
#22b5ff 100%
);
} }
.pic-bottom-3 { .pic-bottom-3 {
height: 0.3rem; height: 0.3rem;
background: linear-gradient(90deg, #322707 0%, #00fcff 100%); background: linear-gradient(
90deg,
rgba(3, 25, 56, 0.2) 0%,
#00fcff 100%
);
} }
.pic-bottom-4 { .pic-bottom-4 {
height: 0.3rem; height: 0.3rem;
background: linear-gradient(90deg, #322707 0%, #22b5ff 100%); background: linear-gradient(
90deg,
rgba(3, 25, 56, 0.2) 0%,
#22b5ff 100%
);
} }
} }
} }

View File

@ -114,13 +114,15 @@ export default {
getRoadList() { getRoadList() {
roadRankList({ type: this.select }).then(({ data, code }) => { roadRankList({ type: this.select }).then(({ data, code }) => {
if (code === 200) { if (code === 200) {
this.roadList = data.map((item) => { this.roadList = data
.map((item) => {
return { return {
...item, ...item,
tongbi: item.tongbi.slice(0, 3), tongbi: item.tongbi.slice(0, 3),
huanbi: item.huanbi.slice(0, 3), huanbi: item.huanbi.slice(0, 3),
}; };
}); })
.slice(0, 5);
} }
}); });
}, },

View File

@ -2,7 +2,7 @@
* @Author: SunTao 328867980@qq.com * @Author: SunTao 328867980@qq.com
* @Date: 2024-10-18 15:21:24 * @Date: 2024-10-18 15:21:24
* @LastEditors: SunTao 328867980@qq.com * @LastEditors: SunTao 328867980@qq.com
* @LastEditTime: 2024-10-25 15:37:00 * @LastEditTime: 2024-10-30 17:13:17
* @FilePath: \znxjxt-ui\src\views\big-screen\road-components\anomaly-facilities.vue * @FilePath: \znxjxt-ui\src\views\big-screen\road-components\anomaly-facilities.vue
* @Description: 附属设施异常统计 * @Description: 附属设施异常统计
--> -->
@ -88,17 +88,7 @@ export default {
}; };
anomalyList(data).then(({ code, data }) => { anomalyList(data).then(({ code, data }) => {
if (code === 200) { if (code === 200) {
// this.anomalyData = data; this.anomalyData = data;
this.anomalyData = [
{ label: "sss", value: 52 },
{ label: "sss", value: 52 },
{ label: "sss", value: 52 },
{ label: "sss", value: 52 },
{ label: "sss", value: 52 },
{ label: "sss", value: 52 },
{ label: "sss", value: 52 },
{ label: "sss", value: 52 },
];
this.$nextTick(() => { this.$nextTick(() => {
this.drawChart(); this.drawChart();
}); });
@ -170,7 +160,7 @@ export default {
this.chart.setOption({ this.chart.setOption({
// backgroundColor: "#041139", // backgroundColor: "#041139",
tooltip: { tooltip: {
trigger: "item", trigger: "axis",
backgroundColor: "rgba(9, 24, 48, 0.5)", backgroundColor: "rgba(9, 24, 48, 0.5)",
borderColor: "rgba(75, 253, 238, 0.4)", borderColor: "rgba(75, 253, 238, 0.4)",
textStyle: { textStyle: {
@ -238,7 +228,7 @@ export default {
series: [ series: [
// //
{ {
name: "数", name: "",
type: "bar", type: "bar",
barWidth: 10, barWidth: 10,
itemStyle: { itemStyle: {
@ -249,9 +239,6 @@ export default {
backgroundStyle: { backgroundStyle: {
color: "rgba(105,160,231,0.1)", color: "rgba(105,160,231,0.1)",
}, },
// itemStyle: {
// },
label: { label: {
show: false, // show: false, //
formatter: "{c}", formatter: "{c}",

View File

@ -39,7 +39,7 @@ export default {
getRoadList() { getRoadList() {
roadRankStatistics().then(({ code, data }) => { roadRankStatistics().then(({ code, data }) => {
if (code === 200) { if (code === 200) {
this.mileage = data.mileage; this.mileage = (data.mileage / 1000).toFixed();
this.count = data.count; this.count = data.count;
} }
}); });

View File

@ -2,13 +2,19 @@
* @Author: SunTao 328867980@qq.com * @Author: SunTao 328867980@qq.com
* @Date: 2024-10-18 15:22:31 * @Date: 2024-10-18 15:22:31
* @LastEditors: SunTao 328867980@qq.com * @LastEditors: SunTao 328867980@qq.com
* @LastEditTime: 2024-10-25 16:11:56 * @LastEditTime: 2024-10-30 16:04:22
* @FilePath: \znxjxt-ui\src\views\big-screen\road-components\road-statistic.vue * @FilePath: \znxjxt-ui\src\views\big-screen\road-components\road-statistic.vue
* @Description: 道路资产大屏-路产统计 * @Description: 道路资产大屏-路产统计
--> -->
<template> <template>
<div class="content"> <div class="content">
<vue-seamless-scroll
class="vue-scroll"
:class-option="defaultOption"
:data="roadList"
v-if="roadList.length > 9"
>
<div <div
class="road-div" class="road-div"
v-for="(item, index) in roadList" v-for="(item, index) in roadList"
@ -32,13 +38,43 @@
></div> ></div>
</div> </div>
</div> </div>
</vue-seamless-scroll>
<template v-else>
<div
class="road-div"
v-for="(item, index) in roadList"
:key="`road-${index}`"
>
<div class="road-top">
<div class="road-top-name">
<a>{{ index + 1 < 10 ? "0" + (index + 1) : index + 1 }}</a
>{{ item.label }}
</div>
<div class="road-top-value">
<span>{{ item.value }}</span
><a></a>
</div>
</div>
<div class="road-bottom">
<div
class="road-bottom-div"
:style="{ width: `${item.rate * 100}%` }"
:class="`bottom-${index}`"
></div>
</div>
</div>
</template>
</div> </div>
</template> </template>
<script> <script>
import { roadStatisticList } from "@/api/xj/screen/road-screen"; import { roadStatisticList } from "@/api/xj/screen/road-screen";
import vueSeamlessScroll from "vue-seamless-scroll";
export default { export default {
name: "RoadStatistic", name: "RoadStatistic",
components: {
vueSeamlessScroll,
},
props: { props: {
select: { select: {
type: String, type: String,
@ -47,6 +83,18 @@ export default {
}, },
data() { data() {
return { return {
//
defaultOption: {
step: 0.2, //
limitMoveNum: 1,
hoverStop: true, // stop
direction: 1, // 0 1 2 3
openWatch: true, // dom
singleHeight: 0, // (0)direction => 0/1
singleWidth: 0, // (0) direction => 2/3
waitTime: 2000, // (1000ms)
},
//
roadList: [], roadList: [],
}; };
}, },
@ -85,6 +133,7 @@ export default {
.content { .content {
width: 100%; width: 100%;
height: 100%; height: 100%;
overflow: hidden;
color: #ffffff; color: #ffffff;
.road-div { .road-div {
@ -163,6 +212,7 @@ export default {
width: 100%; width: 100%;
height: 100%; height: 100%;
display: flex; display: flex;
background: linear-gradient(90deg, #0e183e 0%, #4087e8 100%);
} }
.bottom-0 { .bottom-0 {

View File

@ -2,7 +2,7 @@
* @Author: SunTao 328867980@qq.com * @Author: SunTao 328867980@qq.com
* @Date: 2024-10-21 10:12:55 * @Date: 2024-10-21 10:12:55
* @LastEditors: SunTao 328867980@qq.com * @LastEditors: SunTao 328867980@qq.com
* @LastEditTime: 2024-10-28 13:35:47 * @LastEditTime: 2024-10-30 16:58:54
* @FilePath: \znxjxt-ui\src\views\big-screen\traffic-components\traffic-emergency.vue * @FilePath: \znxjxt-ui\src\views\big-screen\traffic-components\traffic-emergency.vue
* @Description: 交安事件大屏-交安突发事件 * @Description: 交安事件大屏-交安突发事件
--> -->

View File

@ -2,7 +2,7 @@
* @Author: SunTao 328867980@qq.com * @Author: SunTao 328867980@qq.com
* @Date: 2024-10-21 10:11:03 * @Date: 2024-10-21 10:11:03
* @LastEditors: SunTao 328867980@qq.com * @LastEditors: SunTao 328867980@qq.com
* @LastEditTime: 2024-10-21 14:04:49 * @LastEditTime: 2024-10-31 09:12:01
* @FilePath: \znxjxt-ui\src\views\big-screen\traffic-components\traffic-rank.vue * @FilePath: \znxjxt-ui\src\views\big-screen\traffic-components\traffic-rank.vue
* @Description: 交安事件大屏-交安事件排名 * @Description: 交安事件大屏-交安事件排名
--> -->
@ -10,6 +10,12 @@
<template> <template>
<div class="content"> <div class="content">
<vue-seamless-scroll
class="vue-scroll"
:class-option="defaultOption"
:data="rankList"
v-if="rankList.length > 9"
>
<div <div
class="rank-div" class="rank-div"
v-for="(item, index) in rankList" v-for="(item, index) in rankList"
@ -21,19 +27,41 @@
</div> </div>
<div class="rank-bottom"> <div class="rank-bottom">
<div <div
:style="{ width: `${(item.value / 600) * 100}%` }" :style="{ width: `${item.rate}%` }"
:class="`rank-bottom-${index}`" :class="`rank-bottom-${index}`"
></div> ></div>
<div class="rank-bottom-tip"></div> <div class="rank-bottom-tip"></div>
</div> </div>
</div> </div>
</vue-seamless-scroll>
<template v-else>
<div
class="rank-div"
v-for="(item, index) in rankList"
:key="`rank-${index}`"
>
<div class="rank-top" :class="`rank-top-${index}`">
<div class="name">{{ item.name }}</div>
<div class="value">{{ item.value }}</div>
</div>
<div class="rank-bottom">
<div
:style="{ width: `${item.rate}%` }"
:class="`rank-bottom-${index}`"
></div>
<div class="rank-bottom-tip"></div>
</div>
</div>
</template>
</div> </div>
</template> </template>
<script> <script>
import vueSeamlessScroll from "vue-seamless-scroll";
import { rankCount } from "@/api/xj/screen/traffic-screen"; import { rankCount } from "@/api/xj/screen/traffic-screen";
export default { export default {
name: "TrafficRank", name: "TrafficRank",
components: { vueSeamlessScroll },
props: { props: {
select: { select: {
type: String, type: String,
@ -42,6 +70,17 @@ export default {
}, },
data() { data() {
return { return {
//
defaultOption: {
step: 0.2, //
limitMoveNum: 1,
hoverStop: true, // stop
direction: 1, // 0 1 2 3
openWatch: true, // dom
singleHeight: 0, // (0)direction => 0/1
singleWidth: 0, // (0) direction => 2/3
waitTime: 2000, // (1000ms)
},
// //
rankList: [], rankList: [],
}; };
@ -63,7 +102,18 @@ export default {
getData() { getData() {
rankCount({ type: this.select }).then(({ code, data }) => { rankCount({ type: this.select }).then(({ code, data }) => {
if (code === 200) { if (code === 200) {
this.rankList = data; let sum = 0;
data.forEach((element) => {
sum += element.value * 1;
});
this.rankList = data
.map((item) => {
return {
...item,
rate: (item.value * 100) / sum,
};
})
.slice(0, 10);
} }
}); });
}, },
@ -75,6 +125,7 @@ export default {
.content { .content {
width: 100%; width: 100%;
height: 100%; height: 100%;
overflow: hidden;
padding-left: 1rem; padding-left: 1rem;
.rank-div { .rank-div {

View File

@ -2,7 +2,7 @@
* @Author: SunTao 328867980@qq.com * @Author: SunTao 328867980@qq.com
* @Date: 2024-10-21 10:06:24 * @Date: 2024-10-21 10:06:24
* @LastEditors: SunTao 328867980@qq.com * @LastEditors: SunTao 328867980@qq.com
* @LastEditTime: 2024-10-28 13:17:29 * @LastEditTime: 2024-10-31 09:12:24
* @FilePath: \znxjxt-ui\src\views\big-screen\traffic-components\traffic-statistic.vue * @FilePath: \znxjxt-ui\src\views\big-screen\traffic-components\traffic-statistic.vue
* @Description: 交安事件大屏-交安事件统计 * @Description: 交安事件大屏-交安事件统计
--> -->
@ -68,41 +68,12 @@ export default {
"#4C21D5", "#4C21D5",
"#6669DB", "#6669DB",
], ],
// // echart
echartList: [ echartList: [],
{ //
value: 335, sum: 0,
name: "脱岗",
rate: "110%",
},
{
value: 234,
name: "在岗",
rate: "110%",
},
{
value: 335,
name: "比骚大苏打是",
rate: "110%",
},
{
value: 234,
name: "发士大夫",
rate: "110%",
},
{
value: 335,
name: "的风格",
rate: "110%",
},
{
value: 234,
name: "返回",
rate: "110%",
},
],
// echart // echart
echart:null echart: null,
}; };
}, },
watch: { watch: {
@ -141,7 +112,16 @@ export default {
}; };
statisticData(data).then(({ data, code }) => { statisticData(data).then(({ data, code }) => {
if (code === 200) { if (code === 200) {
this.echartList = data; this.sum = 0;
data.forEach((element) => {
this.sum += element.value;
});
this.echartList = data.map((item) => {
return {
...item,
name: item.typeName,
};
});
this.$nextTick(() => { this.$nextTick(() => {
this.drawChart(); this.drawChart();
}); });
@ -165,6 +145,29 @@ export default {
color: "#808C9F", color: "#808C9F",
}, },
}, },
title: [
//
{
text: "交安事件总数",
left: "center",
top: "50%",
textStyle: {
fontFamily: "DinBm",
fontSize: 12,
color: "#ffffff",
},
},
{
text: this.sum,
left: "center",
top: "40%",
textStyle: {
fontFamily: "DouYu",
fontSize: 20,
color: "rgba(255, 183, 89, 0.8)",
},
},
],
grid: { grid: {
top: "0%", top: "0%",
left: "0%", left: "0%",
@ -218,7 +221,7 @@ export default {
}, },
emphasis: { emphasis: {
label: { label: {
show: true, show: false,
fontSize: 20, fontSize: 20,
fontWeight: "bold", fontWeight: "bold",
}, },

View File

@ -2,7 +2,7 @@
* @Author: SunTao 328867980@qq.com * @Author: SunTao 328867980@qq.com
* @Date: 2024-10-21 10:03:08 * @Date: 2024-10-21 10:03:08
* @LastEditors: SunTao 328867980@qq.com * @LastEditors: SunTao 328867980@qq.com
* @LastEditTime: 2024-10-29 13:50:21 * @LastEditTime: 2024-10-30 16:32:10
* @FilePath: \znxjxt-ui\src\views\big-screen\traffic-components\traffic-trend.vue * @FilePath: \znxjxt-ui\src\views\big-screen\traffic-components\traffic-trend.vue
* @Description: 交安事件大屏-交安事件趋势 * @Description: 交安事件大屏-交安事件趋势
--> -->
@ -87,7 +87,6 @@ export default {
}; };
eventLog(data).then(({ data, code }) => { eventLog(data).then(({ data, code }) => {
if (code === 200) { if (code === 200) {
console.log(data, "ffff");
this.echartData = data; this.echartData = data;
this.$nextTick(() => { this.$nextTick(() => {
this.drawChart(); this.drawChart();
@ -160,7 +159,7 @@ export default {
this.chart.setOption({ this.chart.setOption({
// backgroundColor: "#041139", // backgroundColor: "#041139",
tooltip: { tooltip: {
trigger: "item", trigger: "axis",
backgroundColor: "rgba(9, 24, 48, 0.5)", backgroundColor: "rgba(9, 24, 48, 0.5)",
borderColor: "rgba(75, 253, 238, 0.4)", borderColor: "rgba(75, 253, 238, 0.4)",
textStyle: { textStyle: {

View File

@ -2,7 +2,7 @@
* @Author: SunTao 328867980@qq.com * @Author: SunTao 328867980@qq.com
* @Date: 2024-10-29 15:17:58 * @Date: 2024-10-29 15:17:58
* @LastEditors: SunTao 328867980@qq.com * @LastEditors: SunTao 328867980@qq.com
* @LastEditTime: 2024-10-30 13:55:08 * @LastEditTime: 2024-10-31 09:15:52
* @FilePath: \znxjxt-ui\src\views\index-components\disease-index.vue * @FilePath: \znxjxt-ui\src\views\index-components\disease-index.vue
* @Description: 首页-病害识别 * @Description: 首页-病害识别
--> -->
@ -298,13 +298,13 @@ export default {
fontWeight: "bold", fontWeight: "bold",
rich: { rich: {
a: { a: {
fontSize: 40, fontSize: 18,
lineHeight: 50, lineHeight: 18,
color: "#000", color: "#000",
}, },
b: { b: {
color: "#000", color: "#000",
fontSize: 30, fontSize: 16,
lineHeight: 30, lineHeight: 30,
}, },
}, },