fix:地图图例,数据栏右上角切换清空选择框绑定,病害弹窗功能完善

This commit is contained in:
SunTao 2024-10-29 14:46:32 +08:00
parent b768ae8d4b
commit fe0d8f9b54
9 changed files with 208 additions and 58 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

View File

@ -7,13 +7,21 @@
* @Description: 滚动条封装样式 * @Description: 滚动条封装样式
--> -->
<template> <template>
<div class="scroll-box"> <div :class="showBar ? `scroll-box` : `scroll-box-disabled`">
<slot></slot> <slot></slot>
</div> </div>
</template> </template>
<script> <script>
export default {}; export default {
name: "FssmScroll",
props: {
showBar: {
type: Boolean,
default: true,
},
},
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@ -36,4 +44,14 @@ export default {};
background: rgba(220, 231, 248, 0.1); background: rgba(220, 231, 248, 0.1);
} }
} }
.scroll-box-disabled {
width: 100%;
height: 100%;
overflow: auto;
&::-webkit-scrollbar {
display: none;
}
}
</style> </style>

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-23 10:38:26 * @LastEditTime: 2024-10-29 14:34:32
* @FilePath: \znxjxt-ui\src\views\big-screen\components\img-dialog.vue * @FilePath: \znxjxt-ui\src\views\big-screen\components\img-dialog.vue
* @Description: 大屏查看图片弹窗 * @Description: 大屏查看图片弹窗
--> -->
@ -97,9 +97,10 @@
></div> ></div>
</div> </div>
<div class="image-info"> <div class="image-info">
采集时间: 2024-08-26 15:44:42<br /> 采集时间: {{ new Date(rectsItem.createdTime).toLocaleString() }}<br />
起始桩号: K0003+204 终止桩号: K0003+204<br /> 起始桩号: {{ rectsItem.stakeStart || "暂无数据" }} 终止桩号:
路产状态: 新增 融合状态: 未融合 {{ rectsItem.stakeEnd || "暂无数据" }}<br />
路产状态: {{ filterState(rectsItem.state) }} 融合状态: 未融合
</div> </div>
</div> </div>
<!-- 小图展示 --> <!-- 小图展示 -->
@ -118,8 +119,7 @@
</template> </template>
<script> <script>
import { listDefect, getSegment } from "@/api/xj/disease"; import { listDefect, getSegment, getDefectStatus } from "@/api/xj/disease";
export default { export default {
name: "ImgDialog", name: "ImgDialog",
data() { data() {
@ -148,7 +148,12 @@ export default {
page: 1, page: 1,
size: 10, size: 10,
}, },
//
rects: [], rects: [],
//
rectsItem: {},
//
defectStatus: [],
}; };
}, },
computed: { computed: {
@ -164,8 +169,27 @@ export default {
}, },
created() { created() {
this.getSegmentList(); this.getSegmentList();
this.getDefectStatusList();
}, },
methods: { methods: {
/* 查询病害状态下拉数据 */
getDefectStatusList() {
getDefectStatus().then(({ data, code }) => {
if (code === 200) {
this.defectStatus = data;
}
});
},
/* 过滤列表病害状态 */
filterState(value) {
let a = null;
[a] = this.defectStatus.filter((item) => {
return item.value === value;
});
if (a) {
return a.label;
}
},
/* 获取路段下拉数据 */ /* 获取路段下拉数据 */
getSegmentList() { getSegmentList() {
getSegment().then(({ code, data }) => { getSegment().then(({ code, data }) => {
@ -219,7 +243,6 @@ export default {
} }
} else { } else {
this.defectData = []; this.defectData = [];
this.params = { this.params = {
page: 1, page: 1,
size: 10, size: 10,
@ -306,10 +329,15 @@ export default {
}, },
/* 图片位置信息获取 */ /* 图片位置信息获取 */
updateRects() { updateRects() {
this.rects = [];
this.rectsItem = {};
if (this.defectData.length > 0) {
const image = this.$refs.mainImage; const image = this.$refs.mainImage;
const rects = const rects =
this.defectData[this.currentIndex]?.media[this.selectedThumbnail]?.rect this.defectData[this.currentIndex]?.media[
.split(",") this.selectedThumbnail
]?.rect
?.split(",")
.map(Number) || []; .map(Number) || [];
this.rects = [ this.rects = [
{ {
@ -319,6 +347,8 @@ export default {
height: rects[3], height: rects[3],
}, },
]; ];
this.rectsItem = this.defectData[this.currentIndex];
}
}, },
/* 图片红框位置 */ /* 图片红框位置 */
getRectStyle({ left, top, width, height }) { getRectStyle({ left, top, width, height }) {
@ -432,7 +462,7 @@ export default {
} }
.el-select { .el-select {
width: 100%; width: 12rem;
.el-input--small .el-input__inner { .el-input--small .el-input__inner {
color: #ffffff; color: #ffffff;

View File

@ -2,7 +2,7 @@
* @Author: SunTao 328867980@qq.com * @Author: SunTao 328867980@qq.com
* @Date: 2024-10-18 10:19:56 * @Date: 2024-10-18 10:19:56
* @LastEditors: SunTao 328867980@qq.com * @LastEditors: SunTao 328867980@qq.com
* @LastEditTime: 2024-10-24 16:37:52 * @LastEditTime: 2024-10-29 13:43:38
* @FilePath: \znxjxt-ui\src\views\big-screen\disease-components\disease-current.vue * @FilePath: \znxjxt-ui\src\views\big-screen\disease-components\disease-current.vue
* @Description: 病害巡检-病害三维饼图 * @Description: 病害巡检-病害三维饼图
--> -->
@ -73,12 +73,15 @@ export default {
], ],
// echart // echart
dataList: [], dataList: [],
// echart
chart: "",
}; };
}, },
watch: { watch: {
select: { select: {
handler(val) { handler(val) {
if (val) { if (val) {
this.itemSelect = "";
this.getCurrentList(); this.getCurrentList();
this.getChartList(); this.getChartList();
} }
@ -132,8 +135,11 @@ export default {
drawChart() { drawChart() {
const data = this.dataList; const data = this.dataList;
if (this.$refs.currentChart) { if (this.$refs.currentChart) {
const chart = echarts.init(this.$refs.currentChart); if (this.chart) {
chart.setOption({ this.chart.dispose();
}
this.chart = echarts.init(this.$refs.currentChart);
this.chart.setOption({
legend: { legend: {
show: false, show: false,
}, },
@ -193,7 +199,7 @@ export default {
series: this.getPie3D(this.dataList, 0.8), series: this.getPie3D(this.dataList, 0.8),
}); });
window.addEventListener("resize", () => { window.addEventListener("resize", () => {
chart.resize(); this.chart.resize();
}); });
} }
}, },

View File

@ -2,7 +2,7 @@
* @Author: SunTao 328867980@qq.com * @Author: SunTao 328867980@qq.com
* @Date: 2024-10-17 11:34:00 * @Date: 2024-10-17 11:34:00
* @LastEditors: SunTao 328867980@qq.com * @LastEditors: SunTao 328867980@qq.com
* @LastEditTime: 2024-10-29 10:25:21 * @LastEditTime: 2024-10-29 14:00:48
* @FilePath: \znxjxt-ui\src\views\big-screen\index.vue * @FilePath: \znxjxt-ui\src\views\big-screen\index.vue
* @Description: 大屏首页 * @Description: 大屏首页
--> -->
@ -463,7 +463,11 @@ export default {
mapPointList({ type: this.mapClick }).then(({ code, data }) => { mapPointList({ type: this.mapClick }).then(({ code, data }) => {
if (code === 200) { if (code === 200) {
this.centerPiont = data.map((item) => { this.centerPiont = data.map((item) => {
if(item.geometry){
return [item.geometry[0], item.geometry[1]]; return [item.geometry[0], item.geometry[1]];
}
return []
}); });
this.drawPoint(); this.drawPoint();
} }
@ -1089,13 +1093,15 @@ export default {
// //
.map-legend { .map-legend {
height: 9rem; height: 7rem;
width: 2rem; width: 2rem;
position: absolute; position: absolute;
top: 13%; top: 13%;
left: 26%; left: 28%;
background-color: #1cb6ff;
z-index: 1; z-index: 1;
background-image: url("../../assets/screen/index/map-legend.png");
background-repeat: no-repeat;
background-size: 100% 100%;
} }
// //

View File

@ -47,12 +47,15 @@ export default {
currentList: [], currentList: [],
// echart // echart
anomalyData: [], anomalyData: [],
// echart
chart:null
}; };
}, },
watch: { watch: {
select: { select: {
handler(val) { handler(val) {
if (val) { if (val) {
this.itemSelect = "";
this.getCurrentList(); this.getCurrentList();
this.getChartData(); this.getChartData();
} }
@ -104,6 +107,9 @@ export default {
}, },
/* 绘制echart */ /* 绘制echart */
drawChart() { drawChart() {
if(this.chart){
this.chart.dispose()
}
const xData = this.anomalyData.map((item) => { const xData = this.anomalyData.map((item) => {
return item.label; return item.label;
}); });
@ -160,8 +166,8 @@ export default {
}; };
} }
}); });
const chart = echarts.init(this.$refs.anomalyChart); this.chart = echarts.init(this.$refs.anomalyChart);
chart.setOption({ this.chart.setOption({
// backgroundColor: "#041139", // backgroundColor: "#041139",
tooltip: { tooltip: {
trigger: "item", trigger: "item",
@ -258,7 +264,7 @@ export default {
], ],
}); });
window.addEventListener("resize", () => { window.addEventListener("resize", () => {
chart.resize(); this.chart.resize();
}); });
}, },
}, },

View File

@ -68,6 +68,7 @@ export default {
"#4C21D5", "#4C21D5",
"#6669DB", "#6669DB",
], ],
//
echartList: [ echartList: [
{ {
value: 335, value: 335,
@ -100,12 +101,15 @@ export default {
rate: "110%", rate: "110%",
}, },
], ],
// echart
echart:null
}; };
}, },
watch: { watch: {
select: { select: {
handler(val) { handler(val) {
if (val) { if (val) {
this.itemSelect = "";
this.getCurrentList(); this.getCurrentList();
this.getChartData(); this.getChartData();
} }
@ -146,8 +150,11 @@ export default {
}, },
/* 绘制echart图 */ /* 绘制echart图 */
drawChart() { drawChart() {
const echart = echarts.init(this.$refs.statisticChart); if (this.echart) {
echart.setOption({ this.echart.dispose();
}
this.echart = echarts.init(this.$refs.statisticChart);
this.echart.setOption({
color: this.colorList, color: this.colorList,
tooltip: { tooltip: {
confine: true, confine: true,
@ -221,7 +228,7 @@ export default {
], ],
}); });
window.addEventListener("resize", () => { window.addEventListener("resize", () => {
echart.resize(); this.echart.resize();
}); });
}, },
}, },

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-28 13:47:21 * @LastEditTime: 2024-10-29 13:50:21
* @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: 交安事件大屏-交安事件趋势
--> -->
@ -47,12 +47,15 @@ export default {
trafficList: [], trafficList: [],
// echart // echart
echartData: [], echartData: [],
// echart
chart: null,
}; };
}, },
watch: { watch: {
select: { select: {
handler(val) { handler(val) {
if (val) { if (val) {
this.itemSelect = "";
this.getCurrentList(); this.getCurrentList();
this.getChartData(); this.getChartData();
} }
@ -94,10 +97,13 @@ export default {
}, },
/* 绘制echart */ /* 绘制echart */
drawChart() { drawChart() {
if (this.chart) {
this.chart.dispose();
}
const xData = this.echartData.map((item) => { const xData = this.echartData.map((item) => {
return item.label; return item.label;
}); });
const yData = this.echartData.map((item,index) => { const yData = this.echartData.map((item, index) => {
if (index % 2 == 0) { if (index % 2 == 0) {
return { return {
...item, ...item,
@ -150,8 +156,8 @@ export default {
}; };
} }
}); });
const chart = echarts.init(this.$refs.trafficChart); this.chart = echarts.init(this.$refs.trafficChart);
chart.setOption({ this.chart.setOption({
// backgroundColor: "#041139", // backgroundColor: "#041139",
tooltip: { tooltip: {
trigger: "item", trigger: "item",
@ -245,7 +251,7 @@ export default {
], ],
}); });
window.addEventListener("resize", () => { window.addEventListener("resize", () => {
chart.resize(); this.chart.resize();
}); });
}, },
}, },

View File

@ -2,39 +2,110 @@
* @Author: SunTao 328867980@qq.com * @Author: SunTao 328867980@qq.com
* @Date: 2024-10-08 09:26:24 * @Date: 2024-10-08 09:26:24
* @LastEditors: SunTao 328867980@qq.com * @LastEditors: SunTao 328867980@qq.com
* @LastEditTime: 2024-10-28 14:33:52 * @LastEditTime: 2024-10-29 13:07:17
* @FilePath: \znxjxt-ui\src\views\index.vue * @FilePath: \znxjxt-ui\src\views\index.vue
* @Description: 系统首页 * @Description: 系统首页
--> -->
<template> <template>
<div class="app-container"> <div class="app-container">
<div>顶栏</div> <fssm-scroll :showBar="false">
<div> <div class="top-content">
<div
class="top-div"
:class="`top-div-${index}`"
v-for="(item, index) in topList"
:key="`top-div-${index}`"
>
<div class="name">{{ item.name }}</div>
<div class="value">
<span>{{ item.value }}</span
>{{ item.unit }}
</div>
</div>
</div>
<div class="middle-content">
<div>日常巡查</div> <div>日常巡查</div>
<div>病害识别</div> <div>病害识别</div>
</div> </div>
<div> <div class="bottom-content">
<div>公路资产</div> <div>公路资产</div>
<div>路况评定</div> <div>路况评定</div>
</div> </div>
</fssm-scroll>
</div> </div>
</template> </template>
<script> <script>
import FssmScroll from "@/components/scroll/fssm-scroll.vue";
export default { export default {
name: "Index", name: "Index",
components: {
FssmScroll,
},
data() { data() {
return { return {
//
topList: [],
}; };
}, },
created() {
this.getTopData();
},
methods: {
/* 获取顶栏数据 */
getTopData() {
this.topList = [
{ name: "巡查总里程", value: 54, unit: "个" },
{ name: "现存病害总数", value: 54, unit: "个" },
{ name: "公路资产总数", value: 54, unit: "个" },
{ name: "交安事件总数", value: 54, unit: "个" },
];
},
},
}; };
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.app-container{ .app-container {
padding: 0px; padding: 1rem;
height: calc(100vh - 5.4rem);
}
.top-content {
width: 100%;
height: 20%;
display: flex;
align-items: center;
justify-content: space-around;
border: 1px salmon solid;
.top-div {
width: 22%;
height: 80%;
padding: 1.5rem;
background-color: aqua;
.name {
font-family: "DouYu";
} }
.value {
line-height: 4rem;
span{
font-size: 1.8rem;
}
}
}
}
.middle-content {
width: 100%;
height: 60%;
}
.bottom-content {
width: 100%;
height: 60%;
}
</style> </style>