Browse Source

update

develop
little4 1 month ago
parent
commit
e745135a64
  1. 43769
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/assets/data.js
  2. 26
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/buttonEvent.js
  3. 416
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/map.js
  4. 146
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/index.vue
  5. 252
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/index_bc.vue

43769
ruoyi-ui/src/views/JiHeExpressway/pages/Home/assets/data.js

File diff suppressed because one or more lines are too long

26
ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/buttonEvent.js

@ -180,6 +180,7 @@ export const eventMap = {
// 设备 需要在地图显示的
async "地图路测设备/map"(item, filterData, isDefault, cb) {
const config = DeviceForMap[item.title];
let loadingMessage;
if (!isDefault) {
loadingMessage = Message.info({
@ -221,14 +222,16 @@ export const eventMap = {
"font-size:15px; background:#83c806; color:#c7ff4a;",
removeData
);
const layerId = 'jhlayer1'+config.deviceType;
addDataPreHandle(removeData);
markerClusterIns.addData(removeData, isDefault);
markerClusterIns.addData(layerId,removeData, isDefault);
this.emitter.emit("selectedCompleted", item);
cacheRemoveFunc[`地图路测设备/${item.title}`] = () => {
cbCall();
removeDataPreHandle(removeData);
markerClusterIns.removeData(removeData);
markerClusterIns.removeData(layerId,removeData);
};
},
"地图路测设备/map_close"(item) {
@ -281,15 +284,18 @@ export const eventMap = {
isDefault
)
);
const layerId = 'jhlayer2'+deviceType;
addDataPreHandle(removeData);
markerClusterIns.addData(removeData, isDefault);
markerClusterIns.addData(layerId,removeData, isDefault);
this.emitter.emit("selectedCompleted", item);
cacheRemoveFunc[`地图事件专题/${item.title}`] = () => {
cbCall();
removeDataPreHandle(removeData);
markerClusterIns.removeData(removeData);
markerClusterIns.removeData(layerId,removeData);
};
},
"地图事件专题/map_close"(item) {
@ -350,14 +356,16 @@ export const eventMap = {
isDefault
)
);
const layerId = 'jhlayer3'+deviceType;
addDataPreHandle(removeData);
markerClusterIns.addData(removeData, isDefault);
markerClusterIns.addData(layerId,removeData, isDefault);
this.emitter.emit("selectedCompleted", item);
cacheRemoveFunc[`路网设施/${item.title}`] = () => {
cbCall();
removeDataPreHandle(removeData);
markerClusterIns.removeData(removeData);
markerClusterIns.removeData(layerId,removeData);
};
},
"路网设施/map_close"(item) {
@ -405,7 +413,9 @@ export const eventMap = {
);
addDataPreHandle(removeData);
markerClusterIns.addData(removeData, isDefault);
const layerId = 'jhlayer4gzsj';
markerClusterIns.addData(layerId,removeData, isDefault);
this.emitter.emit("selectedCompleted", item);
loadingMessage?.close();
@ -421,7 +431,7 @@ export const eventMap = {
this.emitter.emit("updateDialogVisible", false);
} else cbCall(); //非误报执行,需更新选中事件集合
removeDataPreHandle(handleData);
markerClusterIns.removeData(handleData);
markerClusterIns.removeData(layerId,handleData);
};
},
"事件专题/感知事件_close"(item, filter, type) {

416
ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/map.js

@ -33,9 +33,6 @@ const faultTitleBg = require(`@screen/images/mapBg/fault_title.svg`);
const normalTitleBg = require(`@screen/images/mapBg/active_title.svg`);
const eventRegex = "./事件专题";
import pointsObj_new from '../../../assets/data'
/**
* 聚合点
*/
@ -55,7 +52,7 @@ export class MarkerCluster {
return (this.map = Vue.prototype.mapIns);
}
async addData(data, isDefault) {
async addData(_id, _data, isDefault) {
this.infoWindow?.close?.();
//data.forEach(e => {
@ -63,48 +60,17 @@ export class MarkerCluster {
// e.extData.longitude = lnglat[0];//点坐标经度 【必传字段】
// e.extData.latitude = lnglat[1];
//});
marksAddInGraph(data);
marksAddInGraph(_data);
if (!data) return;
if (!Array.isArray(data)) data = [data];
this.data.push(...data);
if (!_data) return;
if (!Array.isArray(data)) data = [_data];
if(this.mapContainer === 'BMapContainer'){
this.refreshLayer();
} else {
// 高德地图接口----------------------
if (
!this.markerCluster ||
this.markerCluster.getMap() !== Vue.prototype.mapIns
){
await this.setMarkerCluster();
}
// console.log(
// "%c [ data ]-227-「map.js」",
// "font-size:15px; background:#641f14; color:#a86358;"
// );
this.markerCluster.addData(data);
// console.log(
// "%c [ this.markerCluster ]-234-「map.js」",
// "font-size:15px; background:#fe94d3; color:#ffd8ff;",
// this.markerCluster
// );
const map = this.getMap();
map.setZoom(10);
setTimeout(() => {
map.setFitView([...this.markerCluster.U], false, [0, 0, 0, 0], 10); //自适应. 覆盖物数组, 动画过渡到指定位置, 周围边距,上、下、左、右, 最大 zoom 级别
}, 150);
}
this.refreshLayer(_id, _data);
}
refreshLayer(){
refreshLayer(_id,_data){
const aryPoints = [];
this.data.forEach(e=>{
_data.forEach(e=>{
if(e.lnglat){
let _name = e.config.item.title;
if(e.config.item.id.indexOf('./路测设备') !== -1){
@ -148,294 +114,28 @@ export class MarkerCluster {
})
}
})
this.data.push(..._data);
if(aryPoints.length > 0){
this.vroot.$emit('refresh-gismap',{pointList:aryPoints});
// map2d.addPointByArr(
// pointsObj_new, // {pointList:aryPoints} 点位数据数组(按以下规范组装)
// 'customLayer111', // jhlayers 当前添加的数据 唯一标识(删除该图层时也会用到)//./事件专题/交通事故.svg
// true // 当前新加图层是否启用聚合效果
// );
// console.log(aryPoints,'点位数组')
map2d.addPointByArr(
{pointList:aryPoints}, // 点位数据数组(按以下规范组装)
_id, // jhlayers 当前添加的数据 唯一标识(删除该图层时也会用到)//./事件专题/交通事故.svg
true // 当前新加图层是否启用聚合效果
);
console.log(aryPoints,_id,'点位数组')
} else {
Vue.prototype.mapIns.removeLayerByName('jhlayers222');
Vue.prototype.mapIns.removeLayerByName(_id);
}
// if(Vue.prototype.isMapStatck){
// Vue.prototype.mapIns.pileIsShow("jhlayers", true);
// setTimeout(() => {
// Vue.prototype.mapIns.pileIsShow("jhlayers", true);
// }, 500);
// }
}
async showInfoWindow(data) {
const AMap = await loadAMap();
const map = this.getMap();
if (!this.infoWindow)
this.infoWindow = new AMap.InfoWindow({
content: "",
isCustom: true,
anchor: "bottom-center",
offset: new AMap.Pixel(0, -60),
});
console.log(
"%c [ this.infoWindow ]-330-「map.js」",
"font-size:15px; background:#6f5757; color:#b39b9b;",
this.infoWindow
);
//data.length 大于 5 取前5个数, 否则直接返回data
const pageSize = 6;
let page = 1;
const totalPages = Math.ceil(data.length / pageSize);
const currentPageData =
totalPages > 1 ? data.slice((page - 1) * pageSize, pageSize) : data;
window.currentPageData = currentPageData;
window.pageSize = pageSize;
window.page = page;
window.totalPages = totalPages;
let num = (page - 1) * pageSize;
function renderData(page) {
if (!data || page < 1 || page > totalPages) return;
window.page = page;
const pageSize = window.pageSize;
const dataContainer = document.getElementById("dataContainer");
const dataPage = document.getElementById("dataPage");
// 清空数据容器
// dataContainer.innerHTML = "";
// 计算当前页起始索引和结束索引
const startIndex = (page - 1) * pageSize;
const endIndex = startIndex + pageSize;
let num = (page - 1) * pageSize;
if (data.length === 0 || data.length === 1) {
return this.infoWindow.close();
}
const { latitude: lat, longitude: lng } = data[0].extData;
const lngLatStr = `${parseFloat(lng)}/${parseFloat(lat)}`; //更新清除节点后的数据
data = lngLatMap[lngLatStr];
// 截取当前页的数据
const currentPageData = data.slice(startIndex, endIndex);
window.currentPageData = currentPageData;
const itemsTpl = currentPageData
.map((item) => {
return `
<div style="cursor: pointer; padding: 3px 6px;display: flex;align-items: center; gap: 6px;" class="info-window-item">
${++num}<img style="width: 18px;" src="${getIcon(item)}" />
<span style="white-space: nowrap; word-break: break-all;">${(
item.extData.deviceName ||
item.extData.warningTitle ||
item.config?.item.title
).replace("G35 ", "")}</span>
</div>
`;
})
.join("");
// 渲染当前页数据
dataContainer.innerHTML = itemsTpl;
dataPage && (dataPage.innerHTML = `${page}`);
bindItemClick();
}
window.renderData = renderData;
// min-width: 240px;
// min-height: 90px;
// width: 90px;
this.infoWindow.setContent(`<div
style="
display: flex;
flex-direction: column;
position: relative;
background: rgba(6,66,88,0.8);
border: 1px solid rgba(42,217,253,0.6);
">
<div style="height: 26px; width: 100%; display: flex;align-items: center; justify-content: space-between; padding: 0 15px; background: linear-gradient(90deg, #237E9B 0%, rgba(23,145,184,0) 100%);">
<span>重叠</span>
<img class="info-close" style="width: 12px;cursor: pointer;" src="${require("@screen/images/dialog/icon-close.svg")}" />
</div>
<div id="dataContainer" style="padding: 15px 9px;flex: 1; overflow: auto;" class="info-window-content">
${currentPageData
.map(
(item) => `
<div style="cursor: pointer; padding: 3px 6px;display: flex;align-items: center; gap: 6px;" class="info-window-item">
${++num} <img style="width: 18px;" src="${getIcon(item)}" />
<span style="white-space: nowrap; word-break: break-all;">${(
item.extData.deviceName ||
item.extData.warningTitle ||
item.config?.item.title
).replace("G35 ", "")}</span>
</div>
`
)
.join("")}
</div>
${
totalPages > 1
? `
<div id="paginationContainer" style="text-align:center;margin-bottom:5px;">
<button style="padding: 0 15px;background: #00B3CC;border-radius: 48px;cursor: pointer;opacity: 1;gap: 6px;font-size: 14px;font-weight: 500;color: #FFFFFF;border: 1px solid rgba(42, 217, 253, 0.6);" onclick="renderData(window.page-1)">上一页</button>
<span id="dataPage" style="font-size: 14px;font-weight: 500;color: #FFFFFF;"> 第${page} </span>
<button style="padding: 0 15px;background: #00B3CC;border-radius: 48px;cursor: pointer;opacity: 1;gap: 6px;font-size: 14px;font-weight: 500;color: #FFFFFF;border: 1px solid rgba(42, 217, 253, 0.6);" onclick="renderData(window.page+1)">下一页</button>
</div>`
: ""
}
</div>`);
window.infoWindow = this.infoWindow;
this.infoWindow.open(map, currentPageData[0].lnglat);
window.openInfoWindow = true;
this.infoWindow.dom.querySelector(".info-close").onclick = () =>
this.infoWindow.close();
this.infoWindow.dom.querySelector(".info-window-content").onmousewheel = (
e
) => e.stopPropagation();
this.infoWindow.dom.querySelector(".info-window-content").onwheel = (e) =>
e.stopPropagation();
function bindItemClick() {
window.infoWindow.dom
.querySelectorAll(".info-window-item")
.forEach((item, index) => {
item.onclick = () => {
const currentPageData = window.currentPageData;
currentPageData[index].config.markerClick?.(
currentPageData[index].extData,
currentPageData[index].config?.item
);
};
});
}
bindItemClick();
}
async setMarkerCluster() {
const AMap = await loadAMap();
const map = this.getMap();
let hasClick = false;
const reset = () => {
if (!window.openInfoWindow) {
// console.log("窗口movestart中", new Date());
this.infoWindow?.close?.();
}
};
map.on("zoomstart", reset);
map.on("zoomend", reset);
map.on("movestart", reset);
map.on("moveend", async () => {
if (window.openInfoWindow) {
// console.log("窗口位移结束", new Date());
window.openInfoWindow = false;
// !window.infoWindow.getIsOpen() && window.infoWindow?.open?.();
}
});
const markerCluster = new AMap.MarkerCluster(map, [], {
// gridSize: 15,
maxZoom: 15,
// 自定义聚合点样式
renderClusterMarker(context) {
// 聚合中点个数
const clusterCount = context.count;
const div = document.createElement("div");
let bgColor = "204,235,197";
div.style.backgroundColor = `rgba(${bgColor}, .6)`;
const size = Math.round(24 + `${clusterCount}`.length * 15);
div.style.borderRadius =
div.style.lineHeight =
div.style.width =
div.style.height =
`${size}px`;
div.style.border = `solid 1px rgba(${bgColor}, 1)`;
div.innerHTML = context.count;
div.style.color = "#ffffff";
div.style.fontSize = "24px";
div.style.textAlign = "center";
context.marker.setOffset(new AMap.Pixel(-size / 2, -size / 2));
context.marker.setContent(div);
},
renderMarker: (context) => {
const markerData = context.data[0];
const {
extData,
lnglat: { lat, lng },
} = markerData;
const lngLatStr = `${lng}/${lat}`;
const data = lngLatMap[lngLatStr];
if (data) {
const state = getState(data);
let nowTitleBg, nowTitleColor;
if (state) {
nowTitleBg = normalTitleBg;
nowTitleColor = "#FFDB82";
} else {
nowTitleBg = faultTitleBg;
nowTitleColor = "#FF7575";
}
const item = data[0];
const { stakeMark } = item.extData;
const titleTemplate = window.showStakeText
? `<p style="background-image: url('${nowTitleBg}');background-size: 100% 100%;background-repeat: no-repeat;padding: 5px;
font-family: PingFang SC, PingFang SC;font-weight: 400;font-size: 14px; line-height: 16px; color: ${nowTitleColor};
"> ${stakeMark} </p>`
: "";
context.marker.setAnchor("bottom-center");
context.marker.setLabel({
direction: "bottom",
// offset: new AMap.Pixel(10, 0), //设置文本标注偏移量
content: titleTemplate, //设置文本标注内容
});
context.marker.setContent(getContent(data));
// if (window.showStakeText) context.marker.setAnchor("center");
// else context.marker.setAnchor("bottom-center");
const offset = new AMap.Pixel(0, 0);
context.marker.setOffset(offset);
context.marker.setExtData(extData);
context.marker.on("click", (e) => {
hasClick = true;
const data = lngLatMap[lngLatStr];
if (data.length > 1) {
this.showInfoWindow(data);
return;
}
console.log(
"%c [ 点击地图坐标 ]-302-「map.js」",
"font-size:15px; background:#8f8c0b; color:#d3d04f;",
data[0]
);
data[0].config.markerClick?.(data[0].extData, data[0].config?.item);
});
}
},
});
markerCluster.on("click", (e) => {
if (hasClick) return (hasClick = false);
map.setCenter(e.lnglat);
map.setZoom(map.getZoom() + 3);
});
this.markerCluster = markerCluster;
removeLayer(id){
Vue.prototype.mapIns.removeLayerByName(id);
}
removeData(data) {
removeData(_id, data) {
data.forEach((item, index) => {
const findIndex = this.data.findIndex(
(removeData) => removeData === item
@ -463,82 +163,18 @@ export class MarkerCluster {
}
if (findIndex > -1) this.data.splice(findIndex, 1);
});
this.setData()
Vue.prototype.mapIns.removeLayerByName(_id);
const self = this;
setTimeout(() => {
self.refreshLayer(_id, _data);
}, 500);
}
setData() {
if(this.mapContainer === 'BMapContainer'){
this.refreshLayer();
} else {
this.markerCluster.setData(this.data); //高德地图
}
}
clear() {
this.data = [];
}
}
export function getContent(data) {
// const faultBg = require(`@screen/images/mapBg/fault.svg`);
// const normalBg = require(`@screen/images/mapBg/active.svg`);
const state = getState(data);
let nowBg, nowTitleBg, nowTitleColor;
if (state) {
nowBg = normalBg;
nowTitleBg = normalTitleBg;
nowTitleColor = "#FFDB82";
} else {
nowBg = faultBg;
nowTitleBg = faultTitleBg;
nowTitleColor = "#FF7575";
}
const item = data[0];
const { stakeMark } = item.extData;
if (data.length === 1) {
return `
<div style="
background-image: url(${nowBg});
background-size: 100% 100%;
background-repeat: no-repeat;
width: 51px;
height: 51px;
display: flex;
align-self: center;
justify-content: center;
">
<img style="
min-width: 24px;
min-height: 24px;
width: 24px;
height: 24px;
margin-top: 8.1px;
" src='${getIcon(item)}'
>
</div>
`;
} else {
const width = `${36 + `${data.length}`.length * 15}px`;
return `
<div style="
background-image: url(${nowBg});
background-size: 100% 100%;
background-repeat: no-repeat;
width: ${width};
height: ${width};
display: flex;
justify-content: center;
align-items: center;
padding-bottom: 9px;
align-self: center;
" onmouseover="this.parentNode.style.zIndex=13;" onmouseout="this.parentNode.style.zIndex=12;">
${data.length}
</div>
`;
}
}
function getIcon({ config, extData }, type = '') {
const normal = require(`@screen/images/layer${type}${config.item.id.replace(
/^\.|[^/]+(?=.svg$)/g,

146
ruoyi-ui/src/views/JiHeExpressway/pages/Home/index.vue

@ -1,20 +1,6 @@
<template>
<div style="width: 100%;height: 100%;">
<div class="btnBox">
<div class="btnItem" @click="bbbbb">添加点位</div>
<div class="btnItem" @click="ccccc">删除图层</div>
<div class="btnItem" @click="ddddd">操作桩号</div>
</div>
<!-- <component :is="mapContainer" ref="MapContainerRef" @update:isGisCompleted="(data) => { this.isGisCompleted = data; }" /> -->
<div class="BMapContainer">
<gisMap2d ref="gisMap2d"
:mapZoom = "mapZoom"
:mapCenter="mapCenter"
radarSliderBottom="33%"
radarSliderRight="14%"
mapBoxHeight="100vh" @clickPointEvent="clickPointEvent" widgetBoxDisplay="none"></gisMap2d>
</div>
<component :is="mapContainer" ref="MapContainerRef" @update:isGisCompleted="(data) => { this.isGisCompleted = data; }" />
<div class="Home">
<section class="content">
<!-- 左侧 -->
@ -74,14 +60,10 @@ import RoadAndEvents from "./components/RoadAndEvents/index.vue";
import Button from "@screen/components/Buttons/Button.vue";
import Vue from "vue";
import BMapContainer from "./components/BMapContainer/index.vue";
import { gisMap2d } from 'gis-map-universal'
const lnglat = [117.16515148266497,35.2797674572588]
import pointsObj_new from './assets/data'
export default {
name: "Home",
components: {
gisMap2d,
FocusedMonitoring,
ConditionStatistics,
Thumbnail,
@ -103,53 +85,22 @@ export default {
return {
selectedDevice: null,
isGisCompleted: false,
mapContainer:'BMapContainer',
mapBoxHeight: '100vh',
mapZoom: '7.5', // '7.5' String
mapCenter: lnglat, //[118.75, 36.46] Array
ttt:null
mapContainer:'BMapContainer'
};
},
provide() {
return {
// 2024-06-04==========================================
getMap: () => {
return this.$refs.gisMap2d //.getMapInstance();
return this.$refs.MapContainerRef.getMapInstance();
},
setMapZoomAndCenter: (zoom,lnglat) => {
this.$refs.gisMap2d.setMapZoomAndCenter(zoom,lnglat);
this.$refs.MapContainerRef.setMapZoomAndCenter(zoom,lnglat);
},
activeDeviceTypes: Vue.observable([]),
};
},
async mounted() {
// this.$refs.gisMap2d.zoomInBylatlon(
// lnglat,7.5
// );
// Vue.prototype.map2d = this.$refs.gisMap2d;
Vue.prototype.mapIns = this.$refs.gisMap2d;
this.isGisCompleted = true;
this.$root.$on('refresh-gismap', this.refreshLayer);
},
methods: {
refreshLayer(layers){
console.log(layers,'更新图标')
//this.$refs.gisMap2d.addPointByArr(
// {pointList:[]}, //
// 'jhlayers', // //.//.svg
// true //
//);
if(layers){
this.ttt=layers;
}
this.$refs.gisMap2d.addPointByArr(
pointsObj_new,//JSON.parse(JSON.stringify(layers)),
"jhlayers1111",
true
);
},
debug(){
this.$refs.Thumbnail.debug()
},
@ -171,79 +122,11 @@ export default {
translateXElement.style.position = `relative`;
}
},
bbbbb() {
console.log(this.ttt)
this.$refs.gisMap2d.addPointByArr(
// this.pointsObj,
pointsObj_new,
"jhlayers1111",
true
);
},
ccccc() {
this.$refs.gisMap2d.removeLayerByName("jhlayers1111");
},
ddddd() {
this.$refs.gisMap2d.pileIsShow("jhlayers1111", this.isShow);
// this.$refs.gisMap2d.pileIsShow("customLayer222", this.isShow);
this.isShow = !this.isShow;
},
clickPointEvent(obj) {
if(obj && obj.otherInfo){
obj.otherInfo.config.markerClick?.(obj.otherInfo.extData, obj.otherInfo.config?.item);
}
// console.log(obj); //
},
setMapZoomAndCenter(zoom,lnglat){
this.$refs.gisMap2d.zoomInBylatlon(lnglat,zoom)
},
showRoadConditions(visible){
if(visible){
// TODO
} else {
// TODO
}
}
},
};
</script>
<style lang="scss" scoped>
.BMapContainer {
position: absolute;
z-index: 0;
width: 100%;
height: 100%;
transform-origin: left top;
background-color: #103253 !important;
transition: all 0.15s linear;
::v-deep {
.el-loading-mask {
user-select: none;
.el-loading-spinner {
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
.el-loading-text,
.el-icon-place {
color: #59d1fe;
font-size: 15px;
}
.el-icon-place {
font-size: 18px;
animation: 1.2s infinite jump;
}
}
}
}
}
.Home {
width: 100%;
height: 100%;
@ -366,25 +249,4 @@ export default {
}
}
}
.btnBox {
display: flex;
align-items: center;
justify-content: space-between;
width: 44%;
position: absolute;
z-index: 999;
top: 5px;
left: 5px;
}
.btnItem {
user-select: none;
border: 1px #fff solid;
padding: 3px;
border-radius: 3px;
color: #fff;
background: linear-gradient(to right, #237d9a, #074055);
cursor: pointer;
}
</style>

252
ruoyi-ui/src/views/JiHeExpressway/pages/Home/index_bc.vue

@ -1,252 +0,0 @@
<template>
<div style="width: 100%;height: 100%;">
<component :is="mapContainer" ref="MapContainerRef" @update:isGisCompleted="(data) => { this.isGisCompleted = data; }" />
<div class="Home">
<section class="content">
<!-- 左侧 -->
<div class="content-l">
<!-- -->
<FocusedMonitoring class="card-menu" style="height: 288px;" />
<!-- -->
<RoadAndEvents ref="RoadAndEventsRef" :isGisCompleted="isGisCompleted" :mapContainer="mapContainer" style="flex:1" class="card-menu" />
</div>
<div class="content-m">
</div>
<div class="home-icons" >
<HomeFilter class="item" />
<HomeFrame class="item" />
<HomeVector class="item" v-hasPermi="['business:home:exportOperationalReport']" />
<HomeWord class="item" />
<HomeFrameControl class="item" v-hasPermi="['business:home:batchControl']" />
<HomeWeather class="item" />
<HomeWeatherLayer class="item" />
<HomeTraffic class="item" />
</div>
<div class="content-r">
<ConditionStatistics class="right card-menu" style="height: 100%;" />
</div>
</section>
<footer class="footer card-menu">
<div class="footer-title">
<span>济菏高速缩略图</span>
<i class="el-icon-s-fold" style="color: #2ad9fd; transform: rotate(-90deg)" @click.stop="handleShrink" />
</div>
<div class="footer-content">
<Thumbnail ref="Thumbnail" />
</div>
</footer>
</div>
</div>
</template>
<script>
import FocusedMonitoring from "./components/FocusedMonitoring/index.vue";
import Thumbnail from "./components/Thumbnail/index.vue";
import ConditionStatistics from "./components/ConditionStatistics/index.vue";
import AMapContainer from "./components/AMapContainer/index.vue";
import HomeFilter from "./components/HomeFilter/index.vue";
import HomeFrame from "./components/HomeFrame/index.vue";
import HomeVector from "./components/HomeVector/index.vue";
import HomeWord from "./components/HomeWord/index.vue";
import HomeFrameControl from "./components/HomeFrameControl/index.vue";
import HomeVectorControl from "./components/HomeVectorControl/index.vue";
import HomeWeather from "./components/HomeWeather/index.vue";
import HomeWeatherLayer from "./components/HomeWeatherLayer/index.vue";
import HomeTraffic from "./components/HomeTraffic/index.vue";
import RoadAndEvents from "./components/RoadAndEvents/index.vue";
import Button from "@screen/components/Buttons/Button.vue";
import Vue from "vue";
import BMapContainer from "./components/BMapContainer/index.vue";
export default {
name: "Home",
components: {
FocusedMonitoring,
ConditionStatistics,
Thumbnail,
RoadAndEvents,
AMapContainer,
BMapContainer,
Button,
HomeFilter,
HomeFrame,
HomeVector,
HomeFrameControl,
HomeVectorControl,
HomeWord,
HomeWeather,
HomeWeatherLayer,
HomeTraffic
},
data() {
return {
selectedDevice: null,
isGisCompleted: false,
mapContainer:'BMapContainer'
};
},
provide() {
return {
// 2024-06-04==========================================
getMap: () => {
return this.$refs.MapContainerRef.getMapInstance();
},
setMapZoomAndCenter: (zoom,lnglat) => {
this.$refs.MapContainerRef.setMapZoomAndCenter(zoom,lnglat);
},
activeDeviceTypes: Vue.observable([]),
};
},
methods: {
debug(){
this.$refs.Thumbnail.debug()
},
handleShrink(e) {
const translateXElement = e.target.parentElement.parentElement;
const result =
(e.target.style.transform.match(/[-0-9]+/)?.[0] || -90) * -1;
e.target.style.transform = `rotate(${result}deg)`;
if (
translateXElement.style.transform !== `translateY(calc(100% - 36px))`
) {
translateXElement.style.transform = `translateY(calc(100% - 36px))`;
translateXElement.style.position = `absolute`;
translateXElement.style.bottom = `0px`;
} else {
translateXElement.style.transform = `translateY(0)`;
translateXElement.style.position = `relative`;
}
},
},
};
</script>
<style lang="scss" scoped>
.Home {
width: 100%;
height: 100%;
// height: 100%;
// z-index: 6;
display: flex;
flex-direction: column;
justify-content: space-between;
// gap: 30px;
padding: 19px 31px 0 25px;
// justify-content: center;
.card-menu {
transition: all 0.24s linear;
}
.content {
width: 100%;
display: flex;
justify-content: space-between;
height: 62vh;
.content-l {
width: 480px;
overflow: hidden;
display: flex;
flex-direction: column;
overflow: hidden;
height: 100%;
gap: 10px;
}
.content-m {
display: flex;
gap: 9px;
flex: 1;
}
.home-icons {
display: flex;
gap: 0px;
flex-direction: column;
z-index: 0;
margin-right: 10px;
.item {
padding-top: 15px;
}
}
.content-r {
width: 480px;
overflow: hidden;
display: flex;
flex-direction: column;
align-items: flex-end;
overflow: hidden;
height: 100%;
}
}
.footer {
width: 100%;
// margin: auto;
pointer-events: none;
overflow: hidden;
height: min-content;
will-change: height;
bottom: 0;
z-index: 0;
>div {
pointer-events: all;
}
// position: fixed;
// bottom: 0;
.footer-title {
width: 164px;
height: 36px;
border-radius: 11px 11px 0px 0px;
opacity: 1;
border: 1px solid #2ad9fd;
display: flex;
justify-content: center;
align-items: center;
overflow: hidden;
display: flex;
align-items: center;
gap: 15px;
span {
font-size: 16px;
font-family: PingFang SC, PingFang SC;
font-weight: 500;
color: #2ad9fd;
}
i {
transition: all 0.24s linear;
cursor: pointer;
}
// img {
// display: inline-block;
// margin-left: 11px;
// width: 16px;
// height: 13px;
// cursor: pointer;
// }
}
.footer-content {
width: 100%;
height: 200px;
background: #005570;
border-top: 1px solid #003354;
}
}
}
</style>
Loading…
Cancel
Save