fix:修改部分页面适配,设置地图最大最小缩放等级

This commit is contained in:
SunTao 2024-10-31 14:39:01 +08:00
parent 3b65a08f56
commit 95782c60fc
8 changed files with 224 additions and 85 deletions

View File

@ -2,30 +2,35 @@ import request from "@/utils/request";
// 获取数据栏右上角选择数据接口 // 获取数据栏右上角选择数据接口
export function selectTypeList(query) { export function selectTypeList(query) {
return request({ return request({
url: "/bigscreen/getSwitch", url: "/bigscreen/getSwitch",
method: "get", method: "get",
params: query, params: query,
}); });
} }
// 获取地图打点数据接口 // 获取地图打点数据接口
export function mapPointList(query) { export function mapPointList(query) {
return request({ return request({
url: "/bigscreen/getMapPoint", url: "/bigscreen/getMapPoint",
method: "get", method: "get",
params: query, params: query,
}); });
} }
// 获取地图绘制线段数据接口 // 获取地图绘制线段数据接口
export function mapPciList(query) { export function mapPciList(query) {
return request({ return request({
url: "/bigscreen/roadPci", url: "/bigscreen/roadPci",
method: "get", method: "get",
params: query, params: query,
}); });
} }
// 获取图片背景下地图坐标信息
export function comppanyImg() {
return request({
url: "/bigscreen/getCompanyInfo",
method: "get",
});
}

View File

@ -2,7 +2,7 @@
* @Author: SunTao 328867980@qq.com * @Author: SunTao 328867980@qq.com
* @Date: 2024-10-14 10:46:23 * @Date: 2024-10-14 10:46:23
* @LastEditors: SunTao 328867980@qq.com * @LastEditors: SunTao 328867980@qq.com
* @LastEditTime: 2024-10-24 17:17:45 * @LastEditTime: 2024-10-31 13:58:48
* @FilePath: \znxjxt-ui\src\views\xj\inspection\task-management\components\fssm-map.vue * @FilePath: \znxjxt-ui\src\views\xj\inspection\task-management\components\fssm-map.vue
* @Description: 公共地图 * @Description: 公共地图
--> -->
@ -203,6 +203,8 @@ export default {
center: [this.centerPoint.lat, this.centerPoint.lon], // center: [this.centerPoint.lat, this.centerPoint.lon], //
zoom: this.zoom, // zoom: this.zoom, //
projection: "EPSG:4326", projection: "EPSG:4326",
minZoom: 7,
maxZoom: 14,
}), }),
layers: [tianditu_vec_c, tianditu_img_c, tianditu_cva_c], layers: [tianditu_vec_c, tianditu_img_c, tianditu_cva_c],
}); });
@ -255,7 +257,7 @@ export default {
} }
}); });
// //
map.on("moveend",(e)=> { map.on("moveend", (e) => {
const zoom = map.getView().getZoom().toFixed(); // const zoom = map.getView().getZoom().toFixed(); //
this.$emit("map-moveend", zoom); this.$emit("map-moveend", zoom);
}); });

View File

@ -96,12 +96,12 @@ export default {
padding: 1rem; padding: 1rem;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: center; justify-content: space-around;
color: #ffffff; color: #ffffff;
.right-sum { .right-sum {
width: 100%; width: 100%;
height: 4rem; height: 45%;
display: flex; display: flex;
padding-left: 1rem; padding-left: 1rem;
justify-content: center; justify-content: center;
@ -129,7 +129,7 @@ export default {
.right-rate { .right-rate {
width: 100%; width: 100%;
height: 4rem; height: 45%;
padding-left: 1rem; padding-left: 1rem;
display: flex; display: flex;
justify-content: center; justify-content: center;

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 14:00:48 * @LastEditTime: 2024-10-31 13:32:00
* @FilePath: \znxjxt-ui\src\views\big-screen\index.vue * @FilePath: \znxjxt-ui\src\views\big-screen\index.vue
* @Description: 大屏首页 * @Description: 大屏首页
--> -->
@ -115,7 +115,7 @@
<div class="map-care"> <div class="map-care">
<div <div
class="map-care-div" class="map-care-div"
:class="`map-care-div-${index + 1}`" :class="`map-care-div-${item.tip}`"
v-for="(item, index) in mapCareList" v-for="(item, index) in mapCareList"
:key="`map-care-${index}`" :key="`map-care-${index}`"
:style="{ left: item.left, top: item.top }" :style="{ left: item.left, top: item.top }"
@ -211,6 +211,7 @@ import {
selectTypeList, selectTypeList,
mapPointList, mapPointList,
mapPciList, mapPciList,
comppanyImg,
} from "@/api/xj/screen/index"; } from "@/api/xj/screen/index";
export default { export default {
name: "BigScreen", name: "BigScreen",
@ -251,7 +252,7 @@ export default {
leftModuleList: [ leftModuleList: [
{ {
width: "100%", width: "100%",
height: "14rem", height: "27%",
title: "今日巡查", title: "今日巡查",
component: TodayInspection, component: TodayInspection,
selectIsShow: false, selectIsShow: false,
@ -259,7 +260,7 @@ export default {
}, },
{ {
width: "100%", width: "100%",
height: "14rem", height: "27%",
title: "病害趋势", title: "病害趋势",
component: DiseaseTrends, component: DiseaseTrends,
selectIsShow: false, selectIsShow: false,
@ -267,7 +268,7 @@ export default {
}, },
{ {
width: "100%", width: "100%",
height: "15rem", height: "29%",
title: "病害趋势", title: "病害趋势",
component: DiseaseCurrent, component: DiseaseCurrent,
selectIsShow: true, selectIsShow: true,
@ -279,7 +280,7 @@ export default {
rightModuleList: [ rightModuleList: [
{ {
width: "100%", width: "100%",
height: "13rem", height: "25%",
title: "工单统计", title: "工单统计",
component: WorkOrder, component: WorkOrder,
selectIsShow: false, selectIsShow: false,
@ -287,7 +288,7 @@ export default {
}, },
{ {
width: "100%", width: "100%",
height: "17rem", height: "33%",
title: "PIC排名", title: "PIC排名",
component: PicRank, component: PicRank,
selectIsShow: false, selectIsShow: false,
@ -295,7 +296,7 @@ export default {
}, },
{ {
width: "100%", width: "100%",
height: "13rem", height: "25%",
title: "路面状况排名", title: "路面状况排名",
component: RoadRank, component: RoadRank,
selectIsShow: true, selectIsShow: true,
@ -392,6 +393,11 @@ export default {
}, },
/* 获取图片背景下坐标数据 */ /* 获取图片背景下坐标数据 */
getMapCare() { getMapCare() {
comppanyImg().then(({ code, data }) => {
if (code === 200) {
console.log(data, "ffff");
}
});
this.mapCareList = [ this.mapCareList = [
{ {
name: "沈抚", name: "沈抚",
@ -399,9 +405,63 @@ export default {
top: "15%", top: "15%",
tip: "1", tip: "1",
}, },
{
name: "葫芦岛",
left: "24%",
top: "38%",
tip: "1",
},
{
name: "阜新",
left: "40%",
top: "10%",
tip: "1",
},
{
name: "盘锦",
left: "44%",
top: "27%",
tip: "1",
},
{
name: "铁岭",
left: "70%",
top: "3%",
tip: "1",
},
{
name: "抚顺",
left: "75%",
top: "17%",
tip: "1",
},
{
name: "本溪",
left: "67%",
top: "26%",
tip: "1",
},
{
name: "辽阳",
left: "60%",
top: "30%",
tip: "1",
},
{
name: "营口",
left: "48%",
top: "42%",
tip: "1",
},
{
name: "鞍山",
left: "57%",
top: "38%",
tip: "1",
},
{ {
name: "沈阳", name: "沈阳",
left: "55%", left: "54%",
top: "12%", top: "12%",
tip: "2", tip: "2",
}, },
@ -419,14 +479,14 @@ export default {
}, },
{ {
name: "大连", name: "大连",
left: "50%", left: "43%",
top: "50%", top: "53%",
tip: "5", tip: "5",
}, },
{ {
name: "丹东", name: "丹东",
left: "70%", left: "71%",
top: "40%", top: "39%",
tip: "6", tip: "6",
}, },
]; ];
@ -463,11 +523,10 @@ 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){ if (item.geometry) {
return [item.geometry[0], item.geometry[1]]; return [item.geometry[0], item.geometry[1]];
} }
return [] return [];
}); });
this.drawPoint(); this.drawPoint();
} }
@ -500,8 +559,8 @@ export default {
features.push(feature); features.push(feature);
}); });
const clusterSource = new Cluster({ const clusterSource = new Cluster({
distance: 40, distance: 60,
minDistance: 40, minDistance: 60,
source: new VectorSource({ source: new VectorSource({
features, features,
}), }),
@ -681,7 +740,7 @@ export default {
if (this.clusters && zoom > 13) { if (this.clusters && zoom > 13) {
this.clusters.getSource().setDistance(0); this.clusters.getSource().setDistance(0);
} else if (this.clusters && zoom <= 13) { } else if (this.clusters && zoom <= 13) {
this.clusters.getSource().setDistance(40); this.clusters.getSource().setDistance(60);
} }
}, },
/* 地图选中feature事件 */ /* 地图选中feature事件 */
@ -722,7 +781,7 @@ export default {
this.leftModuleList = [ this.leftModuleList = [
{ {
width: "100%", width: "100%",
height: "14rem", height: "27%",
title: "今日巡查", title: "今日巡查",
component: TodayInspection, component: TodayInspection,
selectIsShow: false, selectIsShow: false,
@ -730,7 +789,7 @@ export default {
}, },
{ {
width: "100%", width: "100%",
height: "14rem", height: "27%",
title: "病害趋势", title: "病害趋势",
component: DiseaseTrends, component: DiseaseTrends,
selectIsShow: false, selectIsShow: false,
@ -738,7 +797,7 @@ export default {
}, },
{ {
width: "100%", width: "100%",
height: "15rem", height: "29%",
title: "病害趋势", title: "病害趋势",
component: DiseaseCurrent, component: DiseaseCurrent,
selectIsShow: true, selectIsShow: true,
@ -749,7 +808,7 @@ export default {
this.rightModuleList = [ this.rightModuleList = [
{ {
width: "100%", width: "100%",
height: "13rem", height: "25%",
title: "工单统计", title: "工单统计",
component: WorkOrder, component: WorkOrder,
selectIsShow: false, selectIsShow: false,
@ -757,7 +816,7 @@ export default {
}, },
{ {
width: "100%", width: "100%",
height: "17rem", height: "33%",
title: "PIC排名", title: "PIC排名",
component: PicRank, component: PicRank,
selectIsShow: false, selectIsShow: false,
@ -765,7 +824,7 @@ export default {
}, },
{ {
width: "100%", width: "100%",
height: "13rem", height: "25%",
title: "路面状况排名", title: "路面状况排名",
component: RoadRank, component: RoadRank,
selectIsShow: true, selectIsShow: true,
@ -777,7 +836,7 @@ export default {
this.leftModuleList = [ this.leftModuleList = [
{ {
width: "100%", width: "100%",
height: "9rem", height: "17%",
title: "管养道路统计", title: "管养道路统计",
component: ManageMaintain, component: ManageMaintain,
selectIsShow: false, selectIsShow: false,
@ -785,7 +844,7 @@ export default {
}, },
{ {
width: "100%", width: "100%",
height: "28rem", height: "55%",
title: "附属设施分布", title: "附属设施分布",
component: AncillaryFacilities, component: AncillaryFacilities,
selectIsShow: false, selectIsShow: false,
@ -795,7 +854,7 @@ export default {
this.rightModuleList = [ this.rightModuleList = [
{ {
width: "100%", width: "100%",
height: "15rem", height: "29%",
title: "附属设施异常统计", title: "附属设施异常统计",
component: AnomalyFacilities, component: AnomalyFacilities,
selectIsShow: true, selectIsShow: true,
@ -804,7 +863,7 @@ export default {
}, },
{ {
width: "100%", width: "100%",
height: "29rem", height: "57%",
title: "路产统计", title: "路产统计",
component: RoadStatistic, component: RoadStatistic,
selectIsShow: true, selectIsShow: true,
@ -816,7 +875,7 @@ export default {
this.leftModuleList = [ this.leftModuleList = [
{ {
width: "100%", width: "100%",
height: "14rem", height: "27%",
title: "交安事件", title: "交安事件",
component: TrafficSafety, component: TrafficSafety,
selectIsShow: false, selectIsShow: false,
@ -824,7 +883,7 @@ export default {
}, },
{ {
width: "100%", width: "100%",
height: "14rem", height: "27%",
title: "交安事件趋势", title: "交安事件趋势",
component: TrafficTrend, component: TrafficTrend,
selectIsShow: true, selectIsShow: true,
@ -832,7 +891,7 @@ export default {
}, },
{ {
width: "100%", width: "100%",
height: "17rem", height: "33%",
title: "交安事件统计", title: "交安事件统计",
component: TrafficStatistic, component: TrafficStatistic,
selectIsShow: true, selectIsShow: true,
@ -843,7 +902,7 @@ export default {
this.rightModuleList = [ this.rightModuleList = [
{ {
width: "100%", width: "100%",
height: "29rem", height: "50%",
title: "交安事件排名", title: "交安事件排名",
component: TrafficRank, component: TrafficRank,
selectIsShow: true, selectIsShow: true,
@ -852,7 +911,7 @@ export default {
}, },
{ {
width: "100%", width: "100%",
height: "15rem", height: "29%",
title: "交安突发事件", title: "交安突发事件",
component: TrafficEmergency, component: TrafficEmergency,
selectIsShow: false, selectIsShow: false,
@ -894,23 +953,6 @@ export default {
background-image: url("../../assets/screen/index/bg-left.png"); background-image: url("../../assets/screen/index/bg-left.png");
background-repeat: no-repeat; background-repeat: no-repeat;
background-size: 100% 100%; background-size: 100% 100%;
grid-template-columns: 94.4rem 94.4rem;
grid-template-areas:
"one "
"two "
"three ";
.one {
grid-area: one;
}
.two {
grid-area: two;
}
.three {
grid-area: three;
}
::v-deep .screen-checkBox { ::v-deep .screen-checkBox {
.el-radio-button__inner { .el-radio-button__inner {

View File

@ -61,7 +61,7 @@ export default {
background-size: 100% 100%; background-size: 100% 100%;
.header-title { .header-title {
width: 18rem; width: 75%;
height: 100%; height: 100%;
padding-left: 6rem; padding-left: 6rem;
line-height: 2rem; line-height: 2rem;
@ -74,7 +74,7 @@ export default {
} }
.header-operation { .header-operation {
width: calc(100% - 18rem); width: 25%;
height: 2.5rem; height: 2.5rem;
line-height: 2rem; line-height: 2rem;
} }

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-30 17:13:17 * @LastEditTime: 2024-10-31 14:24:19
* @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: 附属设施异常统计
--> -->
@ -48,7 +48,7 @@ export default {
// echart // echart
anomalyData: [], anomalyData: [],
// echart // echart
chart:null chart: null,
}; };
}, },
watch: { watch: {
@ -97,8 +97,8 @@ export default {
}, },
/* 绘制echart */ /* 绘制echart */
drawChart() { drawChart() {
if(this.chart){ if (this.chart) {
this.chart.dispose() this.chart.dispose();
} }
const xData = this.anomalyData.map((item) => { const xData = this.anomalyData.map((item) => {
return item.label; return item.label;
@ -249,6 +249,51 @@ export default {
data: yData, data: yData,
}, },
], ],
dataZoom: [
{
//
show: false,
//
type: "slider",
//
backgroundColor: "rgba(225,225,225,0.2)",
//
fillerColor: "#ccc",
//
borderColor: "rgba(225,225,225,0.2)",
// detail
showDetail: false,
//
startValue: 0,
//
endValue: 10,
// empty
//
filterMode: "empty",
//
width: "80%",
//
height: 5,
//
left: "center",
//
zoomLoxk: true,
//
handleSize: 10,
// dataZoom-slider
bottom: 0,
},
{
//
//
type: "inside",
//
zoomOnMouseWheel: false,
//
moveOnMouseMove: true,
moveOnMouseWheel: true,
},
],
}); });
window.addEventListener("resize", () => { window.addEventListener("resize", () => {
this.chart.resize(); this.chart.resize();

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-31 09:12:01 * @LastEditTime: 2024-10-31 14:25:18
* @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: 交安事件大屏-交安事件排名
--> -->
@ -14,7 +14,7 @@
class="vue-scroll" class="vue-scroll"
:class-option="defaultOption" :class-option="defaultOption"
:data="rankList" :data="rankList"
v-if="rankList.length > 9" v-if="rankList.length > 7"
> >
<div <div
class="rank-div" class="rank-div"

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-30 16:32:10 * @LastEditTime: 2024-10-31 14:34:36
* @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: 交安事件大屏-交安事件趋势
--> -->
@ -248,6 +248,51 @@ export default {
data: yData, data: yData,
}, },
], ],
dataZoom: [
{
//
show: false,
//
type: "slider",
//
backgroundColor: "rgba(225,225,225,0.2)",
//
fillerColor: "#ccc",
//
borderColor: "rgba(225,225,225,0.2)",
// detail
showDetail: false,
//
startValue: 0,
//
endValue: 6,
// empty
//
filterMode: "empty",
//
width: "80%",
//
height: 5,
//
left: "center",
//
zoomLoxk: true,
//
handleSize: 10,
// dataZoom-slider
bottom: 0,
},
{
//
//
type: "inside",
//
zoomOnMouseWheel: false,
//
moveOnMouseMove: true,
moveOnMouseWheel: true,
},
],
}); });
window.addEventListener("resize", () => { window.addEventListener("resize", () => {
this.chart.resize(); this.chart.resize();