修改技术监督

This commit is contained in:
GGJ
2025-12-11 15:03:11 +08:00
parent 0fe2d2b911
commit b36f765d07
21 changed files with 546 additions and 300 deletions

View File

@@ -128,8 +128,7 @@ const LngLat = [
import { getAssessOverview } from '@/api/device-boot/panorama'
// narimap.publicKey =
// 'MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCRYFEiMdZVgY8+jIjx4GR1QbN7qVgCE0istwPZN8xRqdSV+hePUPIW1k9eCVh9gxIIWHAw2TfNZLb8l0Tmk9OH3XnZ009TNBjzZ2zWLrbjFQzgutKKI2JRLK+CaJbOZ0LiD78QnTo5Zk+ZuQBKgtyFJdp4T5gQS+Mnbj/c4EnK0QIDAQAB'
narimap.publicKey =
'JBb74325ae94dc49358b7d699660b692'
narimap.publicKey = 'JBb74325ae94dc49358b7d699660b692'
narimap.Require(
[
@@ -198,15 +197,16 @@ const Query = () => {
base: {
outline: {
paint: {
'line-color': '#0D867F',
'line-width': 1,
'line-color': '#fff',
'line-width': 2,
'line-opacity': 1
}
},
fill: {
paint: {
'fill-color': '#0D867F',
'fill-opacity': 0.3
// 'fill-opacity': 0.3
'fill-opacity': 0
}
},
label: {
@@ -226,7 +226,7 @@ const Query = () => {
},
outline: {
paint: {
'line-color': '#0D867F',
'line-color': '#fff',
'line-width': 4,
'line-opacity': 1
}
@@ -248,7 +248,8 @@ const Query = () => {
)
powerManageGridMap.value.on('load', function () {
powerLoad()
// 区分区域颜色
// powerLoad()
})
setTimeout(() => {
@@ -262,7 +263,100 @@ const Query = () => {
}, 500)
}, 500)
}
// 添加热力图
const sourceList: any = ref([])
const addSource = async () => {
// const features = [
// {
// type: 'Feature',
// geometry: {
// type: 'Point',
// coordinates: [117.651148, 41.121061]
// },
// properties: {
// value: 64
// }
// }
// ]
console.log('🚀 ~ sourceList:', sourceList.value)
if (map.value.getSource('themeData')) {
map.value.getSource('themeData').setData({
type: 'FeatureCollection',
features: sourceList.value
})
} else {
map.value.addSource('themeData', {
type: 'geojson',
data: {
type: 'FeatureCollection',
features: sourceList.value
}
})
}
if (map.value.getLayer('earthquakes-paint')) {
} else {
map.value.addLayer({
id: 'earthquakes-paint',
type: 'heatmap',
source: 'themeData',
paint: {
/**
* 数据点的影响力weight=10的点相当于十个weight=1的点
* 下述为插值表达式输入是点geojson的properties的mag输出随mag线性增大
*/
'heatmap-weight': [
'interpolate',
['linear'],
['get', 'value'],
0,
0.1,
1,
0.3,
101,
0.5,
1001,
0.7,
10001,
1
],
'heatmap-color': [
'interpolate',
['linear'],
['heatmap-density'],
0,
'rgba(255, 0, 0, 0)',
0.1,
'rgba(7, 91, 243, .8)',
0.3,
'rgba(7, 208, 255, .6)',
0.5,
'rgba(213, 251, 12, .8)',
0.7,
'rgba(255, 191, 0, .8)',
1,
'rgba(255, 0, 0, .8)'
],
'heatmap-intensity': ['interpolate', ['linear'], ['zoom'], 0, 1, 12, 3],
/**
* 该值越大,热力图越平滑,信息越不详细。
* 下述为插值表达式输出随zoom线性变化zoom为0时值为8zoom为9时值为20
*/
'heatmap-radius': 30,
/**
* 透明度输出为1则不透明
* 下述为插值表达式输出随zoom线性变化zoom为5时值为0.8zoom为12时值为0.4
*/
'heatmap-opacity': 1
},
maxzoom: 12
})
}
}
// 添加变电站线路
const addLine = () => {
//添加电网图层
@@ -569,14 +663,14 @@ const addLayer = () => {
const features = map.value.queryRenderedFeatures(e.point, {
layers: ['spotImg-ZY', 'spotImg-TY', 'spotImg-GJ', 'spotImg-DW']
})
if (features.length > 0) {
popup.value && popup.value.remove()
setTimeout(() => {
deviceCard.value.popup && deviceCard.value.popup.remove()
}, 10)
let data = JSON.parse(features[0].properties.list)
popup.value = new narimap.Popup({ offset: popupOffsets.value, className: 'my-popup' })
.setLngLat([data.lng, data.lat])
.setHTML(
@@ -607,7 +701,7 @@ const addLayer = () => {
</div>`
)
.addTo(map.value)
let html = document.getElementById('ids')
if (html)
html.onclick = function (v: any) {
@@ -629,102 +723,8 @@ const addLayer = () => {
}
})
}
// 测试添加点
const testAddLayer = () => {
// 注册图片
map.value.loadImage(
new URL('@/assets/test5.png', import.meta.url).href, // 图片地址
(error: any, image: any) => {
if (error) throw error
//添加图片到 map.value ,第一个参数为图片设置 id
map.value.addImage('poi5', image)
//添加 layer
map.value.addLayer({
id: 'test',
type: 'symbol',
minzoom: 6.5, //图片层级
source: {
type: 'geojson',
data: {
type: 'FeatureCollection',
features: []
}
},
layout: {
// 为图层设置引用的图片ID
'icon-image': 'poi5',
'icon-pitch-alignment': 'map', //贴地
'icon-ignore-placement': true,
'icon-allow-overlap': true,
'icon-anchor': 'center', // 中心点
'icon-size': ['interpolate', ['linear'], ['zoom'], 6, 0.1, 50, 1] // 图符大小
}
})
}
)
// 添加图片需要先注册图片才能加载
setTimeout(() => {
map.value.getSource('test').setData({
type: 'FeatureCollection',
features: [
{
type: 'Feature',
geometry: {
type: 'Point',
coordinates: [115.3544544, 40.217797]
}
},
{
type: 'Feature',
geometry: {
type: 'Point',
coordinates: [115.4544544, 40.317797]
}
}
]
})
}, 1000)
// 地图连线
map.value.addLayer({
id: 'power-line',
type: 'line',
source: {
type: 'geojson',
data: {
type: 'FeatureCollection',
features: [
{
type: 'Feature',
geometry: {
type: 'MultiLineString', //MultiLineString3层数组可以绘制多条线 LineString2层数组
coordinates: [
[
[117, 39],
[116, 40]
],
[
[116, 39],
[115, 40]
]
]
}
}
]
}
},
paint: {
'line-color': '#ff0000',
'line-width': 3,
'line-opacity': 0.6
}
})
setTimeout(() => {
//先判断是否有图层 'power-line'是图层注册id
if (map.value.getLayer('power-line')) map.value.removeLayer('power-line')
}, 5000)
}
const PollutionList = dictData.getBasicData('Pollution_Calc').filter(item => item.name == '谐波电压')
//添加多个监测点
const addMarkers = async (row?: any, key?: any, num?: any) => {
if (map.value == null) return
@@ -735,6 +735,8 @@ const addMarkers = async (row?: any, key?: any, num?: any) => {
searchBeginTime: datePickerRef.value.timeValue[0],
searchEndTime: datePickerRef.value.timeValue[1],
serverName: 'event-boot',
dicData: [PollutionList[0].id],
isPollution: 1,
statisticalType: {},
...row
}
@@ -744,6 +746,8 @@ const addMarkers = async (row?: any, key?: any, num?: any) => {
let r = 0.0035
let tempFeatureZ: any = []
let tempFeatureT: any = []
sourceList.value = []
data.forEach((item: any) => {
if (item.children.length > 10 && item.children.length < 100) {
r = 0.0055
@@ -792,6 +796,31 @@ const addMarkers = async (row?: any, key?: any, num?: any) => {
break
}
}
let num = 20
if (val.vharmonicValue > 10000) {
num = 100
} else if (val.vharmonicValue > 1000) {
num = 80
} else if (val.vharmonicValue > 100) {
num = 60
} else if (val.vharmonicValue > 0) {
num = 40
} else {
num = 20
}
sourceList.value.push({
type: 'Feature',
geometry: {
type: 'Point',
coordinates: [val.lng, val.lat]
},
properties: {
value: val.vharmonicValue || 0
// value: num //10 //val.vharmonicValue || 0
// value: 0
}
})
})
})
@@ -856,7 +885,10 @@ const addMarkers = async (row?: any, key?: any, num?: any) => {
type: 'FeatureCollection',
features: [...tempFeatureT, ...tempFeatureZ]
})
addSource()
//
}
// 统计弹框数据
const GridDiagramArea = () => {
LngLat.forEach((item: any) => {