电网一张图代码提交

This commit is contained in:
wr
2025-08-19 17:48:11 +08:00
parent aa3dbb6c5d
commit d6c494bd96
5 changed files with 19305 additions and 35186 deletions

View File

@@ -1,7 +1,7 @@
NODE_ENV = jibei
VITE_NAME="jibei"
# 电网一张图 地图图层
VITE_NARIMAP="http://25.42.182.218/narimap/libs/narimap.umd.min.js"
VITE_NRGISCOMMON="http://25.42.182.218/narimap/libs/nrgis-common/libs/index.min.js"
VITE_NARIMAP="http://25.42.182.218/sgepriamapsdk/libs/narimap.umd.min.js"
# VITE_NRGISCOMMON="http://25.42.182.218/narimap/libs/nrgis-common/libs/index.min.js"
# <!-- <script src="http://25.42.182.218/narimap/libs/narimap.umd.min.js"></script>
# <script src="http://25.42.182.218/narimap/libs/nrgis-common/libs/index.min.js"></script> -->

View File

@@ -18,7 +18,7 @@
<!-- 冀北地图 -->
<!--引入样式文件-->
<script src="%VITE_NARIMAP%"></script>
<script src="%VITE_NRGISCOMMON%"></script>
<!-- <script src="%VITE_NRGISCOMMON%"></script> -->
<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -3,12 +3,8 @@
<DatePicker ref="datePickerRef" theCurrentTime style="display: none" />
<!-- 搜索框 -->
<div class="query-box-wrap">
<el-input
v-model.trim="inputQuery"
style="height: 46px; width: 334px"
@keyup.enter="DeviceQ"
placeholder="请输入终端名称"
>
<el-input v-model.trim="inputQuery" style="height: 46px; width: 334px" @keyup.enter="DeviceQ"
placeholder="请输入终端名称">
<template #prefix>
<div class="Icon"></div>
</template>
@@ -30,12 +26,9 @@
<span class="ml10" style="color: #0d867f">{{ item.count }}</span>
</template>
<div class="collapseBox">
<div
class="group-list__item"
<div class="group-list__item"
:style="colorKey == k.coordinate ? 'background-color: #009ea81a;' : ''"
v-for="k in item.psrList"
@click="flyTo(k)"
>
v-for="k in item.psrList" @click="flyTo(k)">
<p>{{ k.psrName }}</p>
<p>{{ k.vlevelName }}|{{ k.maintOrgName }}</p>
</div>
@@ -43,169 +36,112 @@
</el-collapse-item>
</el-collapse>
<div
v-if="QueryList.length > 0 && !showCollapse"
class="collapse_none"
style="color: #009ea8"
@click="showCollapse = true"
>
<div v-if="QueryList.length > 0 && !showCollapse" class="collapse_none" style="color: #009ea8"
@click="showCollapse = true">
展开搜索结果
</div>
<div class="collapse_none" style="color: red;cursor: pointer" @click="showWrap = false">关闭</div>
</div>
<baidu-map
class="map"
:style="height"
@ready="initMap"
@zoomend="syncCenterAndZoom"
:center="center"
:zoom="zoomMap"
:scroll-wheel-zoom="true"
>
<baidu-map class="map" :style="height" @ready="initMap" @zoomend='syncCenterAndZoom' :center="center"
:zoom="zoomMap" :scroll-wheel-zoom='true' >
<!-- 线-->
<div v-if="zoom > 13">
<bm-polyline :path="path" v-for="(path, index) in polyline" :key="index"></bm-polyline>
<div v-if='zoom > 13'>
<bm-polyline :path='path' v-for='(path, index) in polyline' :key='index'></bm-polyline>
</div>
<!-- 变电站-->
<template v-if="zoom > 13">
<bm-marker
:position="path"
v-for="path in siteList"
:key="path.subId"
:icon="path.icon"
@click="markerClick(path)"
></bm-marker>
<template v-if='zoom > 13'>
<bm-marker :position='path' v-for='path in siteList' :key='path.subId' :icon='path.icon'
@click='markerClick(path)'></bm-marker>
</template>
<!-- 点 -->
<div :maxZoom="12" v-if="zoom > 9">
<bm-marker
:position="path"
v-for="path in areaLineInfo"
:key="path.lineId"
:icon="path.icon"
@click="markerClick(path)"
:zIndex="1"
>
<bm-label
v-if="zoom > 14"
:content="path.lineName"
:labelStyle="{
color: '#fff',
border: '0px solid #fff',
backgroundColor: 'rgba(0, 0, 0, 0.5)',
borderRadius: '10px',
padding: '2px 5px',
fontSize: '12px',
lineHeight: '15px',
transform: 'translateX(-30%)'
}"
:offset="{ height: 33 }"
/>
<div :maxZoom='12' v-if='zoom > 9'>
<bm-marker :position='path' v-for='path in areaLineInfo' :key='path.lineId' :icon='path.icon'
@click='markerClick(path)' :zIndex="1">
<bm-label v-if='zoom > 14' :content="path.lineName"
:labelStyle="{ color: '#fff', border: '0px solid #fff', backgroundColor: 'rgba(0, 0, 0, 0.5)', borderRadius: '10px', padding: '2px 5px', fontSize: '12px', lineHeight: '15px', transform: 'translateX(-30%)' }"
:offset="{ height: 33 }" />
</bm-marker>
</div>
<!-- 详情 -->
<bm-marker :position="infoWindowPoint" :icon="{ url: '1', size: { width: 0, height: 0 } }">
<bm-info-window :show="infoWindowPoint.show" @close="infoWindowPoint.show = false">
<el-descriptions :title="infoWindowPoint.lineName" :column="1" v-if="infoWindowPoint.lineId">
<el-descriptions-item label="供电公司">{{ infoWindowPoint.gdName }}</el-descriptions-item>
<el-descriptions-item label="变电站(场站)">{{ infoWindowPoint.subName }}</el-descriptions-item>
<el-descriptions-item label="母线">{{ infoWindowPoint.voltageName }}</el-descriptions-item>
<el-descriptions-item label="网络参数">
<bm-marker :position='infoWindowPoint' :icon="{ url: '1', size: { width: 0, height: 0 } }">
<bm-info-window :show='infoWindowPoint.show' @close='infoWindowPoint.show = false'>
<el-descriptions :title='infoWindowPoint.lineName' :column='1' v-if='infoWindowPoint.lineId'>
<el-descriptions-item label='供电公司'>{{ infoWindowPoint.gdName }}</el-descriptions-item>
<el-descriptions-item label='变电站'>{{ infoWindowPoint.subName }}</el-descriptions-item>
<el-descriptions-item label='母线'>{{ infoWindowPoint.voltageName }}</el-descriptions-item>
<el-descriptions-item label='网络参数'>
{{ infoWindowPoint.ip }}
</el-descriptions-item>
<el-descriptions-item label="PT变化">{{ infoWindowPoint.pt2 }}</el-descriptions-item>
<el-descriptions-item label="CT变化">{{ infoWindowPoint.ct2 }}</el-descriptions-item>
<el-descriptions-item label="生产厂家">
<el-descriptions-item label='PT变化'>{{ infoWindowPoint.pt2 }}</el-descriptions-item>
<el-descriptions-item label='CT变化'>{{ infoWindowPoint.ct2 }}</el-descriptions-item>
<el-descriptions-item label='生产厂家'>
{{ infoWindowPoint.manufacturer }}
</el-descriptions-item>
<el-descriptions-item label="终端状态">
<el-descriptions-item label='终端状态'>
{{
infoWindowPoint.runFlag == 0 ? '投运' : infoWindowPoint.runFlag == 1 ? '检修' : '停运'
infoWindowPoint.runFlag == 0 ? '投运' : infoWindowPoint.runFlag == 1 ? '热备用' : '停运'
}}
</el-descriptions-item>
<el-descriptions-item label="通讯状态">
<el-descriptions-item label='通讯状态'>
{{ infoWindowPoint.comFlag == 0 ? '中断' : '正常' }}
</el-descriptions-item>
<el-descriptions-item>
<el-button type="primary" size="small" @click="lookPoint(infoWindowPoint)">
查看详情
</el-button>
<el-button type='primary' size='small' @click='lookPoint(infoWindowPoint)'>查看详情</el-button>
</el-descriptions-item>
</el-descriptions>
<el-descriptions
:title="infoWindowPoint.subName"
:column="1"
v-else-if="infoWindowPoint.subId"
style="padding-top: 10px"
></el-descriptions>
<el-descriptions :title='infoWindowPoint.subName' :column='1' v-else-if='infoWindowPoint.subId'
style='padding-top: 10px'></el-descriptions>
</bm-info-window>
</bm-marker>
<!-- 行政区划 -->
<div v-if="zoom <= 11">
<div v-if='zoom <= 11'>
<div v-for="item in AreaData">
<bm-polygon
v-for="timeK in item.boundary"
:path="timeK"
:strokeWeight="2"
strokeColor="#0e8780"
:strokeOpacity="1"
:fillColor="item.background || ''"
:fillOpacity="0.5"
></bm-polygon>
<bm-polygon v-for="timeK in item.boundary" :path="timeK" :strokeWeight="2" strokeColor="#fff"
:strokeOpacity="1" :fillColor="item.background || ''" :fillOpacity="0.5"></bm-polygon>
</div>
</div>
<!-- 信息弹框 -->
<div v-if="zoom <= 9">
<bm-overlay
v-for="item in AreaData"
pane="labelPane"
:class="{ sample: true }"
@draw="draw($event, item.LngLat)"
>
<div v-if='zoom <= 9'>
<bm-overlay v-for="item in AreaData" pane="labelPane" :class="{ sample: true, }"
@draw="draw($event, item.LngLat)">
<div class="my-radiusPop" :style="{ background: item.background }">
<img :src="PopKey == 2 ? imgUrl2 : PopKey == 1 ? imgUrl1 : PopKey == 0 ? imgUrl0 : ''" />
<div class="infoBox">
<div>
总数
<br />
{{
PopKey == 2
? item.lineNum
: PopKey == 1
? item.deviceNum
: PopKey == 0
? item.subNum
: '/'
}}
总数<br />{{ PopKey == 2 ? item.lineNum : PopKey == 1 ? item.deviceNum : PopKey == 0 ?
item.subNum :
'/' }}
</div>
<div>
{{ PopKey == 2 ? '在线' : PopKey == 1 ? '在运' : '告警' }}
<br />
{{
PopKey == 2
? item.onlineNum
: PopKey == 1
? item.alarmSubNum
: PopKey == 0
? item.onDevice
: '/'
}}
{{ PopKey == 2 ? '在线' : PopKey == 1 ? '在运' : '告警' }}<br />{{ PopKey == 2 ?
item.onlineNum :
PopKey
== 1
?
item.alarmSubNum : PopKey == 0 ?
item.onDevice : '/' }}
</div>
<div v-if="PopKey == 2">
告警
<br />
{{ PopKey == 2 ? item.alarm : PopKey == 1 ? item.xx : PopKey == 0 ? item.xx : '/' }}
告警<br />{{ PopKey == 2 ? item.alarm : PopKey == 1 ? item.xx : PopKey == 0 ? item.xx :
'/' }}
</div>
</div>
</div>
</bm-overlay>
</div>
</baidu-map>
</div>
</template>
<script setup lang="ts">
<script setup lang='ts'>
import { mainHeight } from '@/utils/layout'
import { getAreaLineInfo } from '@/api/event-boot/areaInfo'
import { ref, reactive, onMounted } from 'vue'
@@ -216,7 +152,7 @@ import { BaiduMap, BmOverlay } from 'vue-baidu-map-3x'
import { getAssessOverview } from '@/api/device-boot/panorama'
import { getGridDiagramAreaData } from '@/api/device-boot/panorama'
const emit = defineEmits(['changeValue', 'drop', 'show'])
import mapJson from './boundary'
import mapJson from './boundary';
const datePickerRef = ref()
const height = mainHeight(20)
// 页面中直接引入就可以
@@ -225,7 +161,7 @@ const inputQuery: any = ref('')
const QueryList: any = ref([])
const activeName: any = ref(0)
const zoomMap = ref(8.9)
const zoomMap = ref(8.8)
const colorKey = ref('')
const showCollapse: any = ref(true)
const showWrap: any = ref(false)
@@ -237,100 +173,30 @@ const imgUrl0 = new URL('@/assets/img/BDZ-ZS.png', import.meta.url).href
const imgUrl1 = new URL('@/assets/img/ZD-ZS.png', import.meta.url).href
const imgUrl2 = new URL('@/assets/img/JCD-ZS.png', import.meta.url).href
const boundaryList: any = ref([
// {
// orgName: '唐山',
// LngLat: [118.335849137, 39.7513593355],
// boundary: mapJson.tsJSON
// },
// {
// orgName: '张家口',
// LngLat: [115.032504679, 40.8951549951],
// boundary: mapJson.zjkJSON
// },
// {
// orgName: '秦皇岛',
// LngLat: [119.185113833, 40.1179119754],
// boundary: mapJson.qhdJSON
// },
// {
// orgName: '承德',
// LngLat: [117.548498365, 41.3775890632],
// boundary: mapJson.cdJSON
// },
// {
// orgName: '廊坊',
// LngLat: [116.628004129, 39.0589378611],
// boundary: mapJson.lfJSON
// }
{
orgName: '大连',
LngLat: [122.060077, 39.635794],
boundary: mapJson['大连']
orgName: '唐山',
LngLat: [118.335849137, 39.7513593355],
boundary: mapJson.tsJSON
},
{
orgName: '抚顺',
LngLat: [124.354599, 41.88962],
boundary: mapJson['抚顺']
orgName: '张家口',
LngLat: [115.032504679, 40.8951549951],
boundary: mapJson.zjkJSON
},
{
orgName: '沈阳',
LngLat: [123.0389, 41.992993],
boundary: mapJson['沈阳']
orgName: '秦皇岛',
LngLat: [119.185113833, 40.1179119754],
boundary: mapJson.qhdJSON
},
{
orgName: '丹东',
LngLat: [124.585661, 40.645967],
boundary: mapJson['丹东']
orgName: '承德',
LngLat: [117.548498365, 41.3775890632],
boundary: mapJson.cdJSON
},
{
orgName: '营口',
LngLat: [122.225226, 40.433551],
boundary: mapJson['营口']
},
{
orgName: '盘锦',
LngLat: [121.875362, 41.075416],
boundary: mapJson['盘锦']
},
{
orgName: '铁岭',
LngLat: [124.229492, 42.731873],
boundary: mapJson['铁岭']
},
{
orgName: '朝阳',
LngLat: [119.640944, 41.39657],
boundary: mapJson['朝阳']
},
{
orgName: '葫芦岛',
LngLat: [119.850873, 40.728517],
boundary: mapJson['葫芦岛']
},
{
orgName: '锦州',
LngLat: [121.42, 41.58],
boundary: mapJson['锦州']
},
{
orgName: '阜新',
LngLat: [121.658585, 42.350951],
boundary: mapJson['阜新']
},
{
orgName: '本溪',
LngLat: [124.390785, 41.197021],
boundary: mapJson['本溪']
},
{
orgName: '辽阳',
LngLat: [123.090785, 41.297021],
boundary: mapJson['辽阳']
},
{
orgName: '鞍山',
LngLat: [122.808845, 40.840049],
boundary: mapJson['鞍山']
orgName: '廊坊',
LngLat: [116.628004129, 39.0589378611],
boundary: mapJson.lfJSON
}
])
@@ -340,8 +206,7 @@ const siteList = ref<any>([])
const polyline = ref<any>([])
const lineId = ref('')
const center = ref({
lng: 122.42588,
lat: 40.810977
lng: 116.84428600000001, lat: 40.57707185292256
})
const infoWindowPoint = ref<anyObj>({
lng: 0,
@@ -349,9 +214,11 @@ const infoWindowPoint = ref<anyObj>({
show: false
})
// 地图实例
const initMap = async ({ BMap, map }: any) => {}
const initMap = async ({ BMap, map }: any) => {
}
// 加载点
const addMarkers = async (row?: any, key?: any, num?: any) => {
let params = {
deptIndex: deptIndex.value,
monitorFlag: 2,
@@ -442,12 +309,15 @@ const addMarkers = async (row?: any, key?: any, num?: any) => {
siteList.value = list
// center.value.lng = areaLineInfo.value[0].lng
// center.value.lat = areaLineInfo.value[0].lat
}
// 获取zoom
const syncCenterAndZoom = (e: any) => {
zoom.value = e.target.getZoom()
}
const locatePositions = (e: any) => {
deptIndex.value = e.data.id
// 加载点
addMarkers()
@@ -468,18 +338,20 @@ const markerClick = (e: any) => {
const lookPoint = (e: any) => {
emit('drop', e.lineId)
emit('show', true)
}
// 搜索
const DeviceQ = () => {
showCollapse.value = true
if (inputQuery.value.length == 0) return
let list = []
let regex = new RegExp(inputQuery.value, 'i')
let data = areaLineInfo.value
.filter((item: any) => regex.test(item.lineName))
let data = areaLineInfo.value.filter((item: any) => regex.test(item.lineName))
.map((item: any) => {
return {
psrName: item.lineName,
vlevelName: item.voltageScale,
maintOrgName: item.gdName,
@@ -488,6 +360,7 @@ const DeviceQ = () => {
})
// data.replace(//s/g,',')
if (data.length > 0) {
list.push({
count: data.length,
@@ -501,18 +374,21 @@ const DeviceQ = () => {
// 定位
const flyTo = (e: any, zoom?: number) => {
let regex = new RegExp(e.psrName, 'i')
center.value.lng = e.coordinate[0]
center.value.lat = e.coordinate[1]
if (zoom) {
zoomMap.value = zoom
} else {
if (zoom) { zoomMap.value = zoom }
else {
zoomMap.value = 15
let data = areaLineInfo.value.filter((item: any) => regex.test(item.lineName))[0]
if (data) {
markerClick(data)
}
}
}
// 市级统计数据
const grids = (row: any) => {
@@ -540,15 +416,15 @@ const grids = (row: any) => {
})
}
const radiusPop = (k: any) => {
console.log('🚀 ~ radiusPop ~ k:', k)
console.log("🚀 ~ radiusPop ~ k:", k)
if (k != undefined) PopKey.value = k
}
const GridDiagramArea = () => {
boundaryList.value.forEach((item: any) => {
assessList.value &&
boundaryList.value.forEach((item: any) => {
assessList.value.forEach((y: any) => {
if (item.orgName == y.name) {
if (y.score == 3.14159) {
} else if (y.score > 4.5) {
item.background = '#33996699'
@@ -577,7 +453,7 @@ const GridDiagramArea = () => {
}, 0)
}
// 市级统计
const draw = ({ el, BMap, map }, val = [0, 0]) => {
const draw = ({ el, BMap, map }, val) => {
const pixel = map.pointToOverlayPixel(new BMap.Point(val[0], val[1]))
el.style.left = pixel.x - 60 + 'px'
el.style.top = pixel.y - 20 + 'px'
@@ -587,7 +463,8 @@ const reset = () => {
inputQuery.value = ''
showWrap.value = false
}
onMounted(() => {})
onMounted(() => {
})
defineExpose({ addMarkers, locatePositions, reset, grids, radiusPop, flyTo })
</script>
<style lang="scss" scoped>
@@ -595,6 +472,7 @@ defineExpose({ addMarkers, locatePositions, reset, grids, radiusPop, flyTo })
.map {
width: 100%;
}
.query-box-wrap {
@@ -636,9 +514,7 @@ defineExpose({ addMarkers, locatePositions, reset, grids, radiusPop, flyTo })
}
}
}
}
:deep(.el-descriptions__cell) {
white-space: nowrap;
}
</style>
./cds.js./boundary