添加离线地图
This commit is contained in:
@@ -52,6 +52,7 @@ import { useMonitoringPoint } from '@/stores/monitoringPoint'
|
||||
import { indexOptions, harmonicOptions, inharmonicOptions } from '@/utils/dictionary'
|
||||
import { getHistoryResult } from '@/api/harmonic-boot/harmonic'
|
||||
import { mainHeight } from '@/utils/layout'
|
||||
import { yMethod } from '@/utils/echartMethod'
|
||||
const datePickerRef = ref()
|
||||
const monitoringPoint = useMonitoringPoint()
|
||||
const checked = ref(monitoringPoint.state.showCheckBox)
|
||||
@@ -125,8 +126,9 @@ const init = () => {
|
||||
const shujuchuli = (res: any) => {
|
||||
let shujuData = res.data
|
||||
shujuData.forEach((item: any, i: number) => {
|
||||
let [min, max] = yMethod([ ...(item.value.map(arr => arr.slice(1)).flat()),item.topLimit,,item.lowerLimit])
|
||||
|
||||
//判断是否存在暂降点
|
||||
|
||||
if (item.eventDetail !== null || item.eventDetail.length === 0) {
|
||||
//向项别中添加暂降点
|
||||
let chufa = []
|
||||
@@ -145,8 +147,8 @@ const shujuchuli = (res: any) => {
|
||||
let cvalue = []
|
||||
let topLimit = []
|
||||
let lowerLimit = []
|
||||
item.maxValue = item.topLimit
|
||||
item.minValue = item.lowerLimit
|
||||
item.maxValue = max
|
||||
item.minValue = min
|
||||
//判断数据是否存在
|
||||
if (item.value !== null) {
|
||||
for (let j = 0; j < item.value.length; j++) {
|
||||
@@ -211,8 +213,8 @@ const shujuchuli = (res: any) => {
|
||||
let gvalue = []
|
||||
let topLimit = []
|
||||
let lowerLimit = []
|
||||
item.maxValue = item.topLimit
|
||||
item.minValue = item.lowerLimit
|
||||
item.maxValue = max
|
||||
item.minValue = min
|
||||
//判断数据是否存在
|
||||
if (item.value !== null) {
|
||||
for (let j = 0; j < item.value.length; j++) {
|
||||
@@ -285,7 +287,7 @@ const shujuchuli = (res: any) => {
|
||||
let bvalue = []
|
||||
let cvalue = []
|
||||
let topLimit = []
|
||||
item.maxValue = item.topLimit
|
||||
item.maxValue = max
|
||||
//判断数据是否存在
|
||||
if (item.value !== null) {
|
||||
for (let j = 0; j < item.value.length; j++) {
|
||||
@@ -347,7 +349,7 @@ const shujuchuli = (res: any) => {
|
||||
if (item.phaiscType.length == 3) {
|
||||
let gvalue = []
|
||||
let topLimit = []
|
||||
item.maxValue = item.topLimit
|
||||
item.maxValue = max
|
||||
//判断数据是否存在
|
||||
if (item.value !== null) {
|
||||
for (let j = 0; j < item.value.length; j++) {
|
||||
@@ -413,7 +415,7 @@ const shujuchuli = (res: any) => {
|
||||
let bvalue = []
|
||||
let cvalue = []
|
||||
let lowerLimit = []
|
||||
item.minValue = item.lowerLimit
|
||||
item.minValue = min
|
||||
//判断数据是否存在
|
||||
if (item.value !== null) {
|
||||
for (let j = 0; j < item.value.length; j++) {
|
||||
@@ -470,7 +472,7 @@ const shujuchuli = (res: any) => {
|
||||
if (item.phaiscType.length == 3) {
|
||||
let gvalue = []
|
||||
let lowerLimit = []
|
||||
item.minValue = item.lowerLimit
|
||||
item.minValue = min
|
||||
//判断数据是否存在
|
||||
if (item.value !== null) {
|
||||
for (let j = 0; j < item.value.length; j++) {
|
||||
@@ -661,8 +663,8 @@ const shujuchuli = (res: any) => {
|
||||
let cvalue = []
|
||||
let topLimit = []
|
||||
let lowerLimit = []
|
||||
item.maxValue = item.topLimit
|
||||
item.minValue = item.lowerLimit
|
||||
item.maxValue = max
|
||||
item.minValue = min
|
||||
//判断数据是否存在
|
||||
if (item.value !== null) {
|
||||
for (let j = 0; j < item.value.length; j++) {
|
||||
@@ -715,8 +717,8 @@ const shujuchuli = (res: any) => {
|
||||
let gvalue = []
|
||||
let topLimit = []
|
||||
let lowerLimit = []
|
||||
item.maxValue = item.topLimit
|
||||
item.minValue = item.lowerLimit
|
||||
item.maxValue = max
|
||||
item.minValue = min
|
||||
//判断数据是否存在
|
||||
if (item.value !== null) {
|
||||
for (let j = 0; j < item.value.length; j++) {
|
||||
@@ -778,7 +780,7 @@ const shujuchuli = (res: any) => {
|
||||
let bvalue = []
|
||||
let cvalue = []
|
||||
let topLimit = []
|
||||
item.maxValue = item.topLimit
|
||||
item.maxValue = max
|
||||
// item.minValue=item.lowerLimit
|
||||
//判断数据是否存在
|
||||
if (item.value !== null) {
|
||||
@@ -829,7 +831,7 @@ const shujuchuli = (res: any) => {
|
||||
if (item.phaiscType.length == 2) {
|
||||
let gvalue = []
|
||||
let topLimit = []
|
||||
item.maxValue = item.topLimit
|
||||
item.maxValue = max
|
||||
// item.minValue=item.lowerLimit
|
||||
//判断数据是否存在
|
||||
if (item.value !== null) {
|
||||
@@ -890,7 +892,7 @@ const shujuchuli = (res: any) => {
|
||||
let cvalue = []
|
||||
let lowerLimit = []
|
||||
// item.maxValue=item.topLimit
|
||||
item.minValue = item.lowerLimit
|
||||
item.minValue = min
|
||||
//判断数据是否存在
|
||||
if (item.value !== null) {
|
||||
for (let j = 0; j < item.value.length; j++) {
|
||||
@@ -941,7 +943,7 @@ const shujuchuli = (res: any) => {
|
||||
let gvalue = []
|
||||
let lowerLimit = []
|
||||
// item.maxValue=item.topLimit
|
||||
item.minValue = item.lowerLimit
|
||||
item.minValue = min
|
||||
//判断数据是否存在
|
||||
if (item.value !== null) {
|
||||
for (let j = 0; j < item.value.length; j++) {
|
||||
@@ -1298,6 +1300,8 @@ const rendering = () => {
|
||||
getEcharts()
|
||||
}
|
||||
const getEcharts = () => {
|
||||
console.log("🚀 ~ list.value.forEach ~ list.value:", list.value)
|
||||
|
||||
list.value.forEach((item: any, i: number) => {
|
||||
item.option = {
|
||||
backgroundColor: '#fff',
|
||||
@@ -1436,6 +1440,7 @@ const getEcharts = () => {
|
||||
type: 'value',
|
||||
|
||||
min: item.minValue,
|
||||
max: item.maxValue,
|
||||
name: item.valueName,
|
||||
axisLabel: {
|
||||
interval: 0,
|
||||
|
||||
@@ -36,7 +36,7 @@ import TableStore from '@/utils/tableStore'
|
||||
import { ref, onMounted, provide } from 'vue'
|
||||
import { mainHeight } from '@/utils/layout'
|
||||
import * as echarts from 'echarts/core'
|
||||
import { getEnterpriseSteadyQualify, getSteadyQualifyCensus, IntegrityIcon } from '@/api/harmonic-boot/monitoring';
|
||||
import { getEnterpriseSteadyQualify, getSteadyQualifyCensus, IntegrityIcon, getTHDistortionCensus } from '@/api/harmonic-boot/monitoring';
|
||||
defineOptions({
|
||||
name: 'harmonic-boot/views'
|
||||
})
|
||||
@@ -171,8 +171,8 @@ const tableStore = new TableStore({
|
||||
method: 'POST',
|
||||
column: [],
|
||||
beforeSearchFun: () => { },
|
||||
loadCallback: () => {
|
||||
console.log("🚀 ~ type:", type)
|
||||
loadCallback: async () => {
|
||||
|
||||
mapName.value = header.value.areaRef.areaName
|
||||
if (type == 1) {
|
||||
tableStore.table.params.statisticalType = {}
|
||||
@@ -384,8 +384,7 @@ const tableStore = new TableStore({
|
||||
} else {
|
||||
tableStore.table.params.statisticalType = dictData.getBasicData('Statistical_Type', ['Report_Type'])[0]
|
||||
// 合格率
|
||||
getSteadyQualifyCensus(tableStore.table.params).then(res => {
|
||||
|
||||
await getSteadyQualifyCensus(tableStore.table.params).then(res => {
|
||||
listcard.value[0] = {
|
||||
title: {
|
||||
text: '合格率'
|
||||
@@ -419,15 +418,17 @@ const tableStore = new TableStore({
|
||||
},
|
||||
grid: {
|
||||
left: '60px',
|
||||
}, tooltip: {
|
||||
},
|
||||
tooltip: {
|
||||
formatter: function (params) {
|
||||
|
||||
var tips = ''
|
||||
tips += params[0].name + '</br/>'
|
||||
for (var i = 0; i < params.length; i++) {
|
||||
if (params[i].value == 3.14159) {
|
||||
tips += params[i].seriesName + ':暂无数据<br/>'
|
||||
tips += params[i].seriesName + ':暂无数据<br/>'
|
||||
} else {
|
||||
tips += params[i].seriesName + ':' + params[i].value + '<br/>'
|
||||
tips += params[i].seriesName + ':' + params[i].value + '<br/>'
|
||||
}
|
||||
}
|
||||
return tips
|
||||
@@ -553,9 +554,20 @@ const tableStore = new TableStore({
|
||||
|
||||
|
||||
mapList.value[0] = {
|
||||
tooltip: {
|
||||
formatter: function (params) {
|
||||
var tips = params.name + '</br/>'
|
||||
|
||||
if (params.value == 3.14159) {
|
||||
tips += '合格率:暂无数据<br/>'
|
||||
} else {
|
||||
tips += '合格率:' + (params.data == undefined ? '-' : params.value) + '<br/>'
|
||||
}
|
||||
return tips
|
||||
}
|
||||
},
|
||||
visualMap: {
|
||||
min: 0,
|
||||
max: 2,
|
||||
|
||||
left: 25,
|
||||
bottom: 40,
|
||||
pieces: [
|
||||
@@ -570,6 +582,7 @@ const tableStore = new TableStore({
|
||||
label: '60%≤在线率<90%',
|
||||
color: '#FFCC33'
|
||||
},
|
||||
|
||||
{
|
||||
gt: 0,
|
||||
lt: 60,
|
||||
@@ -577,21 +590,18 @@ const tableStore = new TableStore({
|
||||
color: '#CC0000'
|
||||
},
|
||||
{
|
||||
gt: 3.14159,
|
||||
lt: 3.14159,
|
||||
value: 3.14159,
|
||||
label: '无数据',
|
||||
color: '#ccc'
|
||||
}
|
||||
|
||||
],
|
||||
},
|
||||
|
||||
options: {
|
||||
series: [
|
||||
{
|
||||
|
||||
type: "map",
|
||||
|
||||
|
||||
geoIndex: 0,
|
||||
data: res.data.type.map((item: any, i: any) => {
|
||||
return {
|
||||
@@ -611,7 +621,8 @@ const tableStore = new TableStore({
|
||||
EchartMap.value.GetEchar(header.value.areaRef.areaName)
|
||||
|
||||
})
|
||||
IntegrityIcon(tableStore.table.params).then(res => {
|
||||
// 完整性
|
||||
await IntegrityIcon(tableStore.table.params).then(res => {
|
||||
|
||||
listcard.value[1] = {
|
||||
title: {
|
||||
@@ -631,15 +642,15 @@ const tableStore = new TableStore({
|
||||
},
|
||||
tooltip: {
|
||||
formatter: function (params) {
|
||||
var tips = ''
|
||||
|
||||
var tips = ''
|
||||
for (var i = 0; i < params.length; i++) {
|
||||
if (params[i].value == 3.14159) {
|
||||
tips += params[i].name + '</br>'
|
||||
tips += '数据完整性:暂无数据'
|
||||
tips += '数据完整性:暂无数据'
|
||||
} else {
|
||||
tips += params[i].name + '</br>'
|
||||
tips += '数据完整性:' + params[i].value
|
||||
tips += '数据完整性:' + params[i].value
|
||||
}
|
||||
}
|
||||
return tips
|
||||
@@ -696,6 +707,18 @@ const tableStore = new TableStore({
|
||||
|
||||
|
||||
mapList.value[1] = {
|
||||
tooltip: {
|
||||
formatter: function (params) {
|
||||
var tips = params.name + '<br/>'
|
||||
|
||||
if (params.value == 3.14159) {
|
||||
tips += '完整性' + ':暂无数据<br/>'
|
||||
} else {
|
||||
tips += '完整性' + ':' + (params.data == undefined ? '-' : params.value) + '<br/>'
|
||||
}
|
||||
return tips
|
||||
}
|
||||
},
|
||||
visualMap: {
|
||||
min: 0,
|
||||
max: 2,
|
||||
@@ -720,8 +743,8 @@ const tableStore = new TableStore({
|
||||
color: '#CC0000'
|
||||
},
|
||||
{
|
||||
gt: 3.14159,
|
||||
lt: 3.14159,
|
||||
|
||||
value: 3.14159,
|
||||
label: '无数据',
|
||||
color: '#ccc'
|
||||
}
|
||||
@@ -750,6 +773,211 @@ const tableStore = new TableStore({
|
||||
|
||||
|
||||
})
|
||||
// 畸变率
|
||||
await getTHDistortionCensus(tableStore.table.params).then(res => {
|
||||
listcard.value[2] = {
|
||||
title: {
|
||||
text: '畸变率'
|
||||
},
|
||||
legend: {
|
||||
show: false
|
||||
},
|
||||
xAxis: {
|
||||
type: 'value',
|
||||
name: '%',
|
||||
min: 0,
|
||||
// max: 100,
|
||||
axisLine: {
|
||||
show: true,
|
||||
},
|
||||
},
|
||||
tooltip: {
|
||||
formatter: function (params) {
|
||||
|
||||
var tips = ''
|
||||
for (var i = 0; i < params.length; i++) {
|
||||
if (params[i].value == 0.314159) {
|
||||
tips += params[i].name + '</br>'
|
||||
tips += '畸变率:暂无数据'
|
||||
} else {
|
||||
tips += params[i].name + '</br>'
|
||||
tips += '畸变率:' + params[i].value
|
||||
}
|
||||
}
|
||||
return tips
|
||||
}
|
||||
},
|
||||
yAxis: {
|
||||
type: 'category',
|
||||
name: '区域',// 给X轴加单位
|
||||
data: res.data.type.map((item: any) => item.split('\n')[0]),
|
||||
splitLine: {
|
||||
show: false
|
||||
},
|
||||
axisLabel: {
|
||||
show: true,
|
||||
},
|
||||
axisTick: {
|
||||
alignWithLabel: false
|
||||
},
|
||||
},
|
||||
grid: {
|
||||
left: '60px',
|
||||
},
|
||||
dataZoom: [
|
||||
{
|
||||
type: 'inside',
|
||||
orient: 'vertical',
|
||||
left: '30px',
|
||||
start: 0,
|
||||
width: '13px',
|
||||
end: 100
|
||||
},
|
||||
{
|
||||
orient: 'vertical',
|
||||
start: 0,
|
||||
width: '13px',
|
||||
left: '30px',
|
||||
end: 100
|
||||
}
|
||||
],
|
||||
options: {
|
||||
|
||||
series: [
|
||||
{
|
||||
name: '畸变率',
|
||||
type: 'bar',
|
||||
itemStyle: {
|
||||
normal: {
|
||||
// 随机显示
|
||||
color: function (params) {
|
||||
if (params.value == 0.314159) {
|
||||
return new echarts.graphic.LinearGradient(
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
[
|
||||
{
|
||||
offset: 1,
|
||||
color: '#cccccc'
|
||||
}
|
||||
],
|
||||
false
|
||||
)
|
||||
} else if (params.value > 2) {
|
||||
return new echarts.graphic.LinearGradient(
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
[{ offset: 1, color: '#CC0000' }],
|
||||
false
|
||||
)
|
||||
} else if (params.value <= 2) {
|
||||
return new echarts.graphic.LinearGradient(
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
[{ offset: 1, color: '#07CCCA' }],
|
||||
false
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
markLine: {
|
||||
silent: false,
|
||||
symbol: 'circle',
|
||||
data: [
|
||||
{
|
||||
name: '',
|
||||
xAxis: 2,
|
||||
lineStyle: {
|
||||
color: '#07CCCA'
|
||||
},
|
||||
label: {
|
||||
// position: "middle",
|
||||
formatter: '{b}',
|
||||
textStyle: {
|
||||
color: '#07CCCA'
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
|
||||
|
||||
data: res.data.single.map(item => item == 3.14159 ? 0.314159 : item),
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
mapList.value[2] = {
|
||||
tooltip: {
|
||||
formatter: function (params) {
|
||||
var tips = params.name + '<br/>'
|
||||
|
||||
if (params.value == 0.314159) {
|
||||
tips += '完整性' + ':暂无数据<br/>'
|
||||
} else {
|
||||
tips += '完整性' + ':' + (params.data == undefined ? '-' : params.value) + '<br/>'
|
||||
}
|
||||
return tips
|
||||
}
|
||||
},
|
||||
visualMap: {
|
||||
min: 0,
|
||||
max: 2,
|
||||
left: 25,
|
||||
bottom: 40,
|
||||
pieces: [
|
||||
{
|
||||
gt: 0,
|
||||
lt: 2,
|
||||
label: '畸变率<=2%',
|
||||
color: '#07CCCA'
|
||||
},
|
||||
{
|
||||
gt: 2,
|
||||
lt: 100,
|
||||
label: '畸变率>2%',
|
||||
color: '#CC0000'
|
||||
},
|
||||
|
||||
{
|
||||
|
||||
value: 3.14159,
|
||||
label: '无数据',
|
||||
color: '#ccc'
|
||||
}
|
||||
],
|
||||
},
|
||||
|
||||
options: {
|
||||
series: [
|
||||
{
|
||||
|
||||
type: "map",
|
||||
geoIndex: 0,
|
||||
data: res.data.type.map((item: any, i: any) => {
|
||||
return {
|
||||
name: item.split('\n')[0],
|
||||
value: res.data.single[i] == 3.14159 ? 0.314159 : res.data.single[i],
|
||||
}
|
||||
}),
|
||||
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,18 +1,19 @@
|
||||
<template>
|
||||
<div class="default-main">
|
||||
<div v-show="view">
|
||||
<TableHeader datePicker ref="TableHeaderRef" >
|
||||
<template #select>
|
||||
<el-form-item label="关键字">
|
||||
<el-input v-model="tableStore.table.params.searchValue" clearable placeholder="输入事件关联分析描述" maxlength="32" show-word-limit/>
|
||||
</el-form-item>
|
||||
</template>
|
||||
<template #operation>
|
||||
<el-button icon="el-icon-Download" type="primary" @click="exportEvent">导出</el-button>
|
||||
</template>
|
||||
</TableHeader>
|
||||
<Table ref="tableRef"/>
|
||||
</div>
|
||||
<div v-show="view">
|
||||
<TableHeader datePicker ref="TableHeaderRef">
|
||||
<template #select>
|
||||
<el-form-item label="关键字">
|
||||
<el-input v-model="tableStore.table.params.searchValue" clearable placeholder="输入事件关联分析描述"
|
||||
maxlength="32" show-word-limit />
|
||||
</el-form-item>
|
||||
</template>
|
||||
<template #operation>
|
||||
<el-button icon="el-icon-Download" type="primary" @click="exportEvent">导出</el-button>
|
||||
</template>
|
||||
</TableHeader>
|
||||
<Table ref="tableRef" />
|
||||
</div>
|
||||
<!-- 暂降源定位 -->
|
||||
<el-dialog draggable v-model="dialogAnalysis" title="暂降源定位" width="70%">
|
||||
<div class="mb10" style="display: flex; justify-content: space-between">
|
||||
@@ -48,8 +49,8 @@
|
||||
:total="total" @size-change="onTableSizeChange" @current-change="onTableCurrentChange"></el-pagination>
|
||||
</el-dialog>
|
||||
<!-- 暂降源定位 -->
|
||||
<Map :style="height" :showBut="false" v-if="!view" />
|
||||
<el-button class="close" :icon="Back" @click="view=true" v-if="!view">返回</el-button>
|
||||
<Map :style="height" :showBut="false" v-if="!view" :mapList="mapList" />
|
||||
<el-button class="close" :icon="Back" @click="view = true" v-if="!view">返回</el-button>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
@@ -61,10 +62,11 @@ import { defaultAttribute } from '@/components/table/defaultAttribute'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import { queryEventDetailByAssId } from '@/api/advance-boot/analyse'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
import {Back} from '@element-plus/icons-vue'
|
||||
import { Back } from '@element-plus/icons-vue'
|
||||
import { queryEventsAssPage } from '@/api/advance-boot/analyse'
|
||||
import Map from '@/views/pqs/voltageSags/monitoringPoint/online/navigation/map.vue'
|
||||
import Map from '@/views/pqs/voltageSags/monitoringPoint/online/navigation/map.vue'
|
||||
import { useMonitoringPoint } from '@/stores/monitoringPoint'
|
||||
import { getAreaLineInfo } from '@/api/event-boot/areaInfo'
|
||||
defineOptions({
|
||||
name: 'Advancedanalysis/impactscope'
|
||||
})
|
||||
@@ -78,6 +80,18 @@ const view = ref(true)
|
||||
const tableRef = ref()
|
||||
const TableHeaderRef = ref()
|
||||
const dictData = useDictData()
|
||||
import { useAdminInfo } from '@/stores/adminInfo'
|
||||
const mapList = ref([])
|
||||
const params = ref({
|
||||
deptIndex: '',
|
||||
monitorFlag: 2,
|
||||
powerFlag: 2,
|
||||
searchBeginTime: '',
|
||||
searchEndTime: '',
|
||||
serverName: 'event-boot',
|
||||
statisticalType: {}
|
||||
})
|
||||
const adminInfo = useAdminInfo()
|
||||
const positioningtableRef = ref()
|
||||
const reason = dictData.getBasicData('Event_Reason')
|
||||
const type = dictData.getBasicData('Event_Type')
|
||||
@@ -127,11 +141,19 @@ const tableStore = new TableStore({
|
||||
type: 'primary',
|
||||
|
||||
icon: 'el-icon-Plus',
|
||||
render: 'basicButton' ,
|
||||
render: 'basicButton',
|
||||
click: row => {
|
||||
view.value = false
|
||||
params.value.deptIndex = adminInfo.$state.deptId
|
||||
params.value.searchBeginTime = tableStore.table.params.searchBeginTime
|
||||
params.value.searchEndTime = tableStore.table.params.searchEndTime
|
||||
getAreaLineInfo(params.value).then(res => {
|
||||
mapList.value = res.data
|
||||
view.value = false
|
||||
}).catch(err => {
|
||||
view.value = false
|
||||
})
|
||||
// monitoringPoint.setValue('lineId', row.id)
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
]
|
||||
@@ -250,10 +272,11 @@ const positioningexport = () => {
|
||||
:deep(.highlight-first-row) {
|
||||
color: red !important;
|
||||
}
|
||||
.close{
|
||||
|
||||
.close {
|
||||
position: absolute;
|
||||
right: 10px;
|
||||
top: 50px;
|
||||
|
||||
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -3,6 +3,10 @@
|
||||
<baidu-map class="map" @ready="initMap" :center="{ lng: 116.403765, lat: 39.914850 }" :zoom="10"
|
||||
:scroll-wheel-zoom='true'>
|
||||
<bm-boundary name="北京市海淀区" :strokeWeight="2" strokeColor="blue"></bm-boundary>
|
||||
<bm-boundary name="北京市西城区" :strokeWeight="2" strokeColor="red" fillColor="#ff0000"
|
||||
fillOpacity="0.05"></bm-boundary>
|
||||
<bm-boundary name="北京市东城区" :strokeWeight="2" strokeColor="green" fillColor="green"
|
||||
fillOpacity="0.05"></bm-boundary>
|
||||
<!-- <bm-polygon :path="polygonPath" stroke-color="blue" :stroke-opacity="0.5" :stroke-weight="2" :editing="true"
|
||||
@lineupdate="updatePolygonPath" /> -->
|
||||
|
||||
@@ -27,6 +31,7 @@ const initMap = async ({ BMap, map }: any) => {
|
||||
// let region = "丰台区"
|
||||
// this.drawPolygon(region)
|
||||
// this.addRegionLabel(city,region)
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<div class="default-main" style="position: relative">
|
||||
<el-tabs v-model="activeName" type="border-card" class="demo-tabs">
|
||||
<el-tab-pane label="导航" name="1" :style="height" lazy>
|
||||
<Navigation @changeTab="changeTab" />
|
||||
<Navigation @changeTab="changeTab" ref="navigationRef" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="事件统计" name="2" lazy v-if="!isReload">
|
||||
<EventStatistics />
|
||||
@@ -35,16 +35,28 @@ defineOptions({
|
||||
name: 'Descentsystem/monitoringpoint'
|
||||
})
|
||||
const isReload = ref(false)
|
||||
const navigationRef = ref()
|
||||
const monitoringPoint = useMonitoringPoint()
|
||||
const height = mainHeight(82)
|
||||
const activeName = ref('1')
|
||||
watch(
|
||||
() => router.currentRoute.value.query.lineId,
|
||||
(newLineId, oldLineId) => {
|
||||
|
||||
if (!newLineId) return
|
||||
// 在这里处理 lineId 的变化
|
||||
console.log(123333333);
|
||||
|
||||
monitoringPoint.setValue('lineId', router.currentRoute.value.query.lineId)
|
||||
monitoringPoint.setValue('lineName', router.currentRoute.value.query.lineName)
|
||||
setTimeout(() => {
|
||||
|
||||
|
||||
navigationRef.value?.handleNodeClick({
|
||||
level: 6,
|
||||
id: router.currentRoute.value.query.lineId
|
||||
})
|
||||
}, 500)
|
||||
},
|
||||
{ immediate: true }
|
||||
)
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
<template>
|
||||
<splitpanes style="height: 100%" class="default-theme" id="navigation-splitpanes">
|
||||
<pane :size="size">
|
||||
<PointTree
|
||||
:default-expand-all="false"
|
||||
<PointTree :default-expand-all="false" v-if="showTree"
|
||||
:default-expanded-keys="monitoringPoint.state.lineId ? [monitoringPoint.state.lineId] : []"
|
||||
:current-node-key="monitoringPoint.state.lineId"
|
||||
@node-click="handleNodeClick"
|
||||
@init="handleNodeClick"
|
||||
></PointTree>
|
||||
:current-node-key="monitoringPoint.state.lineId" @node-click="handleNodeClick" @init="handleNodeClick">
|
||||
</PointTree>
|
||||
</pane>
|
||||
<pane>
|
||||
<Map v-bind="$attrs" v-if="flag"></Map>
|
||||
<div style='display: none'>
|
||||
<DatePicker ref='datePickerRef'></DatePicker>
|
||||
</div>
|
||||
<Map v-bind="$attrs" v-if="flag" :mapList="mapList"></Map>
|
||||
</pane>
|
||||
</splitpanes>
|
||||
</template>
|
||||
@@ -21,23 +21,58 @@ import { Splitpanes, Pane } from 'splitpanes'
|
||||
import PointTree from '@/components/tree/pqs/pointTree.vue'
|
||||
import Map from './map.vue'
|
||||
import Tree from '@/components/tree/index.vue'
|
||||
import { getAreaLineInfo } from '@/api/event-boot/areaInfo'
|
||||
import { useMonitoringPoint } from '@/stores/monitoringPoint'
|
||||
|
||||
import { useAdminInfo } from '@/stores/adminInfo'
|
||||
import DatePicker from '@/components/form/datePicker/index.vue'
|
||||
import router from '@/router'
|
||||
const adminInfo = useAdminInfo()
|
||||
const monitoringPoint = useMonitoringPoint()
|
||||
const size = ref(0)
|
||||
const params = ref({
|
||||
deptIndex: '',
|
||||
monitorFlag: 2,
|
||||
powerFlag: 2,
|
||||
searchBeginTime: '',
|
||||
searchEndTime: '',
|
||||
serverName: 'event-boot',
|
||||
statisticalType: {}
|
||||
})
|
||||
const datePickerRef = ref()
|
||||
const mapList: any = ref([])
|
||||
const flag = ref(false)
|
||||
const showTree = ref(false)
|
||||
onMounted(() => {
|
||||
const dom = document.getElementById('navigation-splitpanes')
|
||||
if (dom) {
|
||||
size.value = Math.round((180 / dom.offsetHeight) * 100)
|
||||
}
|
||||
params.value.deptIndex = adminInfo.$state.deptId
|
||||
params.value.searchBeginTime = datePickerRef.value.timeValue[0]
|
||||
params.value.searchEndTime = datePickerRef.value.timeValue[1]
|
||||
getAreaLineInfo(params.value).then(res => {
|
||||
mapList.value = res.data
|
||||
showTree.value = true
|
||||
}).catch(err => {
|
||||
showTree.value = true
|
||||
})
|
||||
})
|
||||
|
||||
const handleNodeClick = (data: any, node: any) => {
|
||||
|
||||
|
||||
if (data.level === 6) {
|
||||
flag.value = false
|
||||
monitoringPoint.setValue('lineId', data.id)
|
||||
flag.value = true
|
||||
|
||||
}
|
||||
setTimeout(() => {
|
||||
flag.value = true
|
||||
}, 0)
|
||||
}
|
||||
defineExpose({
|
||||
handleNodeClick
|
||||
})
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.splitpanes.default-theme .splitpanes__pane {
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
<template>
|
||||
<div style='position: relative; height: 100%' v-loading='loading'>
|
||||
<div style='display: none'>
|
||||
<DatePicker ref='datePickerRef'></DatePicker>
|
||||
</div>
|
||||
|
||||
<div class='iconBox'>
|
||||
<div class='div'>
|
||||
<img src='@/assets/jcd.png' alt='' />
|
||||
@@ -41,7 +39,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<baidu-map class='bm-view' :zoom='zoom' :map-click='false' :scroll-wheel-zoom='true' :center='center'
|
||||
@ready='handler' @zoomend='syncCenterAndZoom' :dragging="true">
|
||||
@ready='handler' @zoomend='syncCenterAndZoom' :dragging="true" >
|
||||
<bm-map-type :map-types="['BMAP_NORMAL_MAP', 'BMAP_HYBRID_MAP']"
|
||||
anchor='BMAP_ANCHOR_TOP_RIGHT'></bm-map-type>
|
||||
<!-- 线-->
|
||||
@@ -105,11 +103,11 @@ const emit = defineEmits(['changeTab'])
|
||||
|
||||
interface Props {
|
||||
showBut?: boolean
|
||||
|
||||
mapList?: any
|
||||
}
|
||||
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
showBut: true
|
||||
showBut: true,
|
||||
mapList:[]
|
||||
})
|
||||
|
||||
|
||||
@@ -118,15 +116,7 @@ const adminInfo = useAdminInfo()
|
||||
const datePickerRef = ref()
|
||||
const zoom = ref(11)
|
||||
const loading = ref(true)
|
||||
const params = ref({
|
||||
deptIndex: '',
|
||||
monitorFlag: 2,
|
||||
powerFlag: 2,
|
||||
searchBeginTime: '',
|
||||
searchEndTime: '',
|
||||
serverName: 'event-boot',
|
||||
statisticalType: {}
|
||||
})
|
||||
|
||||
|
||||
const center = ref({
|
||||
lng: 0,
|
||||
@@ -142,10 +132,7 @@ const siteList = ref<any>([])
|
||||
const polyline = ref<any>([])
|
||||
const lineId = ref('')
|
||||
const handler = async ({ BMap, map }: any) => {
|
||||
params.value.deptIndex = adminInfo.$state.deptId
|
||||
params.value.searchBeginTime = datePickerRef.value.timeValue[0]
|
||||
params.value.searchEndTime = datePickerRef.value.timeValue[1]
|
||||
let { data } = await getAreaLineInfo(params.value)
|
||||
let data = props.mapList
|
||||
let r = 0.0035
|
||||
let list = data.filter((item: any) => item.lng != 0)
|
||||
list.forEach((item: any) => {
|
||||
@@ -241,7 +228,7 @@ const handler = async ({ BMap, map }: any) => {
|
||||
zoom.value = 15
|
||||
setTimeout(() => {
|
||||
loading.value = false
|
||||
}, 1500)
|
||||
}, 0)
|
||||
}
|
||||
|
||||
const syncCenterAndZoom = (e: any) => {
|
||||
|
||||
@@ -159,12 +159,12 @@ import PopupEvent from './popupEvent.vue'
|
||||
import router from '@/router'
|
||||
|
||||
defineOptions({
|
||||
name: 'Descentsystem/overview'
|
||||
// name: 'Descentsystem/overview'
|
||||
})
|
||||
const height = mainHeight(20)
|
||||
const adminInfo = useAdminInfo()
|
||||
const datePickerRef = ref()
|
||||
const zoom = ref(11)
|
||||
const zoom = ref(13)
|
||||
const loading = ref(true)
|
||||
const popupEvent = ref()
|
||||
const params = ref({
|
||||
@@ -267,12 +267,15 @@ const handler = async ({ BMap, map }: any) => {
|
||||
|
||||
areaLineInfo.value.push(...item.children)
|
||||
})
|
||||
setTimeout(() => {
|
||||
loading.value = false
|
||||
}, 0)
|
||||
siteList.value = list
|
||||
center.value.lng = areaLineInfo.value[0].lng
|
||||
center.value.lat = areaLineInfo.value[0].lat
|
||||
infoWindowPoint.value = areaLineInfo.value[0]
|
||||
infoWindowPoint.value.show = true
|
||||
zoom.value = 15
|
||||
zoom.value = 13
|
||||
setTimeout(() => {
|
||||
loading.value = false
|
||||
}, 1500)
|
||||
@@ -288,7 +291,7 @@ const pointChange = (val: string) => {
|
||||
center.value.lat = data.lat
|
||||
infoWindowPoint.value = data
|
||||
infoWindowPoint.value.show = true
|
||||
zoom.value = 15
|
||||
zoom.value = 13
|
||||
}
|
||||
const markerClick = (e: any) => {
|
||||
infoWindowPoint.value = e
|
||||
|
||||
Reference in New Issue
Block a user