Files
admin-sjzx/src/views/pqs/qualityInspeection/panorama/components/mapL.vue

517 lines
16 KiB
Vue
Raw Normal View History

2024-04-26 09:15:20 +08:00
<template>
2024-04-27 22:18:58 +08:00
<div :class="show ? 'show' : 'noshow'">
<div class="boxLeft" :style="height">
2024-04-26 09:15:20 +08:00
<div v-for="(item, i) in list" :style="boxHeight">
<div class="title">
<span @click="GridDiagram(i)">
{{ item.title }}
2024-05-23 17:30:16 +08:00
<span class="ratio">{{ item.ratioTitle }}: {{ item.ratio }}%</span>
</span>
2024-04-26 09:15:20 +08:00
<span class="info" @click="open(i)">
详情
<ArrowRight style="width: 12px" />
</span>
</div>
2024-05-09 18:00:04 +08:00
<div style="display: flex" class="mt2">
<img src="@/assets/img/FGX.png" />
2024-04-26 09:15:20 +08:00
</div>
2024-05-09 18:00:04 +08:00
2024-04-26 09:15:20 +08:00
<div class="cardBox">
2024-05-09 18:00:04 +08:00
<div class="card" style="width: 98%">
<div class="cor">
<img :src="item.img[0]" />
{{ item.titleT[0] }}
<span
:style="`color: ${item.color[0]}; cursor: pointer;`"
@click="LookMap(item.list[4].numOneList, item.list[4].numTwoList, i)"
>
{{ item.list[4].numOne }}
</span>
</div>
<div class="cor">
<img :src="item.img[1]" />
{{ item.titleT[1] }}
<span
:style="`color: ${item.color[1]}; cursor: pointer;`"
@click="LookMap([], item.list[4].numTwoList, i)"
>
{{ item.list[4].numTwo }}
</span>
</div>
<div class="cor" v-if="i == 0">
<img :src="item.img[2]" />
{{ item.titleT[2] }}
<span
:style="`color: ${item.color[2]}; cursor: pointer;`"
@click="LookMap([], item.list[5].numOneList, 1)"
>
{{ item.list[5].numOne }}
</span>
</div>
2024-05-09 18:00:04 +08:00
</div>
<div :style="`height:calc(${boxHeight.height} - 90px);width: 100%;overflow-y: auto;`" class="BoxA">
<div class="card-Box">
<div>
<span class="line"></span>
<span class="vol">500kV</span>
2024-04-26 09:15:20 +08:00
</div>
2024-05-09 18:00:04 +08:00
<div class="num">
2024-05-16 14:56:04 +08:00
<div @click="LookMap(item.list[0].numOneList, item.list[0].numTwoList, i)">
2024-05-09 18:00:04 +08:00
{{ item.titleT[0] }}:
<span :style="`color: ${item.color[0]}`">{{ item.list[0].numOne }}</span>
</div>
2024-05-16 14:56:04 +08:00
<div @click="LookMap([], item.list[0].numTwoList, i)">
2024-05-09 18:00:04 +08:00
{{ item.titleT[1] }}:
<span :style="`color: ${item.color[1]}`">{{ item.list[0].numTwo }}</span>
</div>
2024-04-26 09:15:20 +08:00
</div>
</div>
2024-05-09 18:00:04 +08:00
<div class="card-Box">
<div>
<span class="line"></span>
<span class="vol">220kV</span>
2024-04-26 09:15:20 +08:00
</div>
2024-05-09 18:00:04 +08:00
<div class="num">
2024-05-16 14:56:04 +08:00
<div @click="LookMap(item.list[1].numOneList, item.list[1].numTwoList, i)">
2024-05-09 18:00:04 +08:00
{{ item.titleT[0] }}:
<span :style="`color: ${item.color[0]}`">{{ item.list[1].numOne }}</span>
</div>
2024-05-16 14:56:04 +08:00
<div @click="LookMap([], item.list[1].numTwoList, i)">
2024-05-09 18:00:04 +08:00
{{ item.titleT[1] }}:
<span :style="`color: ${item.color[1]}`">{{ item.list[1].numTwo }}</span>
</div>
2024-04-26 09:15:20 +08:00
</div>
</div>
2024-05-09 18:00:04 +08:00
<div class="card-Box">
<div>
<span class="line"></span>
<span class="vol">110kV</span>
2024-04-26 09:15:20 +08:00
</div>
2024-05-09 18:00:04 +08:00
<div class="num">
2024-05-16 14:56:04 +08:00
<div @click="LookMap(item.list[2].numOneList, item.list[2].numTwoList, i)">
2024-05-09 18:00:04 +08:00
{{ item.titleT[0] }}:
<span :style="`color: ${item.color[0]}`">{{ item.list[2].numOne }}</span>
</div>
2024-05-16 14:56:04 +08:00
<div @click="LookMap([], item.list[2].numTwoList, i)">
2024-05-09 18:00:04 +08:00
{{ item.titleT[1] }}:
<span :style="`color: ${item.color[1]}`">{{ item.list[2].numTwo }}</span>
</div>
2024-04-26 09:15:20 +08:00
</div>
</div>
2024-05-09 18:00:04 +08:00
<div class="card-Box">
<div>
<span class="line"></span>
2024-05-16 14:56:04 +08:00
<span class="vol">35kV</span>
2024-04-26 09:15:20 +08:00
</div>
2024-05-09 18:00:04 +08:00
<div class="num">
2024-05-16 14:56:04 +08:00
<div @click="LookMap(item.list[3].numOneList, item.list[3].numTwoList, i)">
2024-05-09 18:00:04 +08:00
{{ item.titleT[0] }}:
<span :style="`color: ${item.color[0]}`">{{ item.list[3].numOne }}</span>
</div>
2024-05-16 14:56:04 +08:00
<div @click="LookMap([], item.list[3].numTwoList, i)">
2024-05-09 18:00:04 +08:00
{{ item.titleT[1] }}:
<span :style="`color: ${item.color[1]}`">{{ item.list[3].numTwo }}</span>
</div>
2024-04-26 09:15:20 +08:00
</div>
</div>
2024-05-09 18:00:04 +08:00
</div>
2024-04-26 09:15:20 +08:00
</div>
2024-05-09 18:00:04 +08:00
</div>
2024-04-26 09:15:20 +08:00
</div>
2024-04-30 11:18:41 +08:00
<img
2024-04-26 09:15:20 +08:00
class="imgL"
:style="show ? 'transform: rotate(0deg);' : 'transform: rotate(180deg);'"
@click="show = !show"
src="@/assets/img/QH.png"
2024-04-30 11:18:41 +08:00
/>
2024-04-26 09:15:20 +08:00
<!-- 变电站详情 -->
<stand ref="standRef" />
<!-- 终端 -->
<terminal ref="terminalRef" />
<!-- 检测点 -->
<point ref="pointRef" />
</div>
</template>
<script setup lang="ts">
import { onMounted, reactive, ref, provide } from 'vue'
import { useDictData } from '@/stores/dictData'
import { mainHeight } from '@/utils/layout'
import { ArrowRight } from '@element-plus/icons-vue'
import stand from './details/stand.vue'
import terminal from './details/terminal.vue'
import point from './details/point.vue'
import {
getSubLineGiveAnAlarm,
getGridDiagramMonitor,
getGridDiagramDev,
getGridDiagramAreaData
} from '@/api/device-boot/panorama'
const emit = defineEmits(['LookMap', 'GridDiagram'])
2024-04-26 09:15:20 +08:00
const dictData = useDictData()
const show = ref(false)
const standRef = ref()
const terminalRef = ref()
const pointRef = ref()
const list: any = ref([
{
title: '监测点',
img: [
new URL(`@/assets/img/JCD-ZS.png`, import.meta.url),
new URL(`@/assets/img/JCD-ZX.png`, import.meta.url),
new URL(`@/assets/img/JCD-GJ.png`, import.meta.url)
],
2024-05-23 17:30:16 +08:00
ratioTitle: '告警率',
ratio: 0,
titleT: ['总数', '在线', '告警'],
color: ['#000', '#2dcd28', '#bd3124'],
2024-04-26 09:15:20 +08:00
list: [
{
2024-04-29 16:37:07 +08:00
numOne: 0,
2024-05-14 18:28:27 +08:00
numTwo: 0,
numOneList: [],
numTwoList: []
2024-04-26 09:15:20 +08:00
},
{
2024-04-29 16:37:07 +08:00
numOne: 0,
2024-05-14 18:28:27 +08:00
numTwo: 0,
numOneList: [],
numTwoList: []
2024-04-26 09:15:20 +08:00
},
{
2024-04-29 16:37:07 +08:00
numOne: 0,
2024-05-14 18:28:27 +08:00
numTwo: 0,
numOneList: [],
numTwoList: []
2024-04-26 09:15:20 +08:00
},
{
2024-04-29 16:37:07 +08:00
numOne: 0,
2024-05-14 18:28:27 +08:00
numTwo: 0,
numOneList: [],
numTwoList: []
2024-04-26 09:15:20 +08:00
},
{
2024-04-29 16:37:07 +08:00
numOne: 0,
2024-05-14 18:28:27 +08:00
numTwo: 0,
numOneList: [],
numTwoList: []
},
{
numOne: 0,
numOneList: []
2024-04-26 09:15:20 +08:00
}
]
},
{
title: '变电站',
img: [new URL(`@/assets/img/BDZ-ZS.png`, import.meta.url), new URL(`@/assets/img/BDZ-GJ.png`, import.meta.url)],
color: ['#000', '#bd3124'],
2024-05-23 17:30:16 +08:00
ratioTitle: '告警率',
ratio: 0,
titleT: ['总数', '告警'],
2024-04-26 09:15:20 +08:00
list: [
{
2024-04-29 16:37:07 +08:00
numOne: 0,
2024-05-14 18:28:27 +08:00
numTwo: 0,
numOneList: [],
numTwoList: []
2024-04-26 09:15:20 +08:00
},
{
2024-04-29 16:37:07 +08:00
numOne: 0,
2024-05-14 18:28:27 +08:00
numTwo: 0,
numOneList: [],
numTwoList: []
2024-04-26 09:15:20 +08:00
},
{
2024-04-29 16:37:07 +08:00
numOne: 0,
2024-05-14 18:28:27 +08:00
numTwo: 0,
numOneList: [],
numTwoList: []
2024-04-26 09:15:20 +08:00
},
{
2024-04-29 16:37:07 +08:00
numOne: 0,
2024-05-14 18:28:27 +08:00
numTwo: 0,
numOneList: [],
numTwoList: []
2024-04-26 09:15:20 +08:00
},
{
2024-04-29 16:37:07 +08:00
numOne: 0,
2024-05-14 18:28:27 +08:00
numTwo: 0,
numOneList: [],
numTwoList: []
2024-04-26 09:15:20 +08:00
}
]
},
{
title: '终端',
img: [new URL(`@/assets/img/ZD-ZS.png`, import.meta.url), new URL(`@/assets/img/ZD-ZX.png`, import.meta.url)],
titleT: ['总数', '在运'],
2024-05-23 17:30:16 +08:00
ratioTitle: '在运率',
ratio: 0,
2024-05-09 18:00:04 +08:00
color: ['#000', '#2dcd28'],
2024-04-26 09:15:20 +08:00
list: [
{
2024-04-29 16:37:07 +08:00
numOne: 0,
2024-05-14 18:28:27 +08:00
numTwo: 0,
numOneList: [],
numTwoList: []
2024-04-26 09:15:20 +08:00
},
{
2024-04-29 16:37:07 +08:00
numOne: 0,
2024-05-14 18:28:27 +08:00
numTwo: 0,
numOneList: [],
numTwoList: []
2024-04-26 09:15:20 +08:00
},
{
2024-04-29 16:37:07 +08:00
numOne: 0,
2024-05-14 18:28:27 +08:00
numTwo: 0,
numOneList: [],
numTwoList: []
2024-04-26 09:15:20 +08:00
},
{
2024-04-29 16:37:07 +08:00
numOne: 0,
2024-05-14 18:28:27 +08:00
numTwo: 0,
numOneList: [],
numTwoList: []
2024-04-26 09:15:20 +08:00
},
{
2024-04-29 16:37:07 +08:00
numOne: 0,
2024-05-14 18:28:27 +08:00
numTwo: 0,
numOneList: [],
numTwoList: []
2024-04-26 09:15:20 +08:00
}
]
}
])
const formRow: any = ref({})
const height = mainHeight(30)
const boxHeight = mainHeight(40, 3)
2024-05-09 18:00:04 +08:00
2024-04-26 09:15:20 +08:00
// 详情
const open = (e: any) => {
if (e == 0) {
2024-05-23 17:30:16 +08:00
pointRef.value.open(formRow.value)
2024-04-26 09:15:20 +08:00
} else if (e == 1) {
2024-05-23 17:30:16 +08:00
standRef.value.open(formRow.value)
2024-04-26 09:15:20 +08:00
} else if (e == 2) {
2024-05-23 17:30:16 +08:00
terminalRef.value.open(formRow.value)
2024-04-26 09:15:20 +08:00
}
}
const info = async (row: any) => {
2024-04-26 09:15:20 +08:00
let form = {
2024-04-27 22:18:58 +08:00
...row,
2024-04-26 09:15:20 +08:00
id: row.orgNo,
deptIndex: row.orgNo,
orgId: row.orgNo,
ids: [],
statisticalType: dictData.getBasicData('Statistical_Type', ['Report_Type'])[0],
isUpToGrid: row.isUpToGrid,
2024-05-09 18:00:04 +08:00
monitorFlag: row.isUpToGrid == 0 ? null : row.isUpToGrid
2024-04-26 09:15:20 +08:00
}
formRow.value = form
2024-04-29 16:37:07 +08:00
// 监测点
await getGridDiagramMonitor(form).then(res => {
2024-04-29 16:37:07 +08:00
let data = row.isUpToGrid == 1 ? res.data.gwInfo : res.data.info
list.value[0].list = data[0].data.map((item: any) => {
2024-04-29 16:37:07 +08:00
return {
numOne: item.num,
2024-05-16 14:56:04 +08:00
numTwo: item.onLineNum,
numOneList: item.numList,
numTwoList: item.onLineNumList
2024-04-29 16:37:07 +08:00
}
})
list.value[0].list.push({
numOne: 0,
numOneList: []
})
})
getGridDiagramAreaData(form).then((res: any) => {
let numOne = 0
let numOneList: any = []
res.data.forEach((item: any) => {
numOne = numOne + item.alarm
numOneList.push(...item.alarmList)
})
list.value[0].list[5] = {
numOne: numOne,
numOneList: numOneList
}
list.value[0].ratio = ((list.value[0].list[5].numOne / list.value[0].list[4].numOne) * 100).toFixed(2)
})
// 变电站
getSubLineGiveAnAlarm(form).then(res => {
let data = row.isUpToGrid == 1 ? res.data.gwInfo : res.data.info
list.value[1].list = data[0].data
2024-05-23 17:30:16 +08:00
list.value[1].ratio = ((list.value[1].list[4].numTwo / list.value[1].list[4].numOne) * 100).toFixed(2)
})
// 终端
getGridDiagramDev(form).then(res => {
let data = row.isUpToGrid == 1 ? res.data.gwInfo : res.data.info
list.value[2].list = data[0].data
list.value[2].ratio = ((list.value[2].list[4].numTwo / list.value[2].list[4].numOne) * 100).toFixed(2)
2024-04-29 16:37:07 +08:00
})
2024-04-26 09:15:20 +08:00
}
2024-05-14 18:28:27 +08:00
// 点击
2024-05-16 14:56:04 +08:00
const LookMap = (coutList: object, alarmList: object, key?: any) => {
// console.log('🚀 ~ LookMap ~ row:', row)
2024-05-14 18:28:27 +08:00
let form = {
2024-05-16 14:56:04 +08:00
coutList: coutList,
alarmList: alarmList
2024-05-14 18:28:27 +08:00
}
2024-05-16 14:56:04 +08:00
emit('LookMap', form, key)
2024-05-14 18:28:27 +08:00
}
const GridDiagram = (k: any) => {
emit('GridDiagram', k)
}
2024-04-26 09:15:20 +08:00
onMounted(() => {})
2024-05-09 18:00:04 +08:00
defineExpose({ info, show })
2024-04-26 09:15:20 +08:00
</script>
<style lang="scss" scoped>
.boxLeft {
background-color: #fff;
2024-04-27 22:18:58 +08:00
width: 100%;
2024-04-30 11:18:41 +08:00
padding: 10px 10px 10px 10px;
2024-05-09 18:00:04 +08:00
border-radius: 5px;
2024-04-26 09:15:20 +08:00
font-size: 13px;
overflow: hidden;
}
.cardBox {
display: flex;
flex-wrap: wrap;
2024-05-14 18:28:27 +08:00
2024-04-26 09:15:20 +08:00
.card {
margin-top: 10px;
width: 48%;
margin-right: 2%;
display: flex;
2024-05-09 18:00:04 +08:00
.cor {
flex: 1;
2024-05-09 18:00:04 +08:00
display: flex;
align-items: center;
font-size: 12px;
color: #6d6d6d;
span {
font-size: 16px;
font-weight: 550;
}
}
2024-04-26 09:15:20 +08:00
img {
width: 40px;
height: 40px;
2024-05-09 18:00:04 +08:00
margin: 0 5%;
2024-04-26 09:15:20 +08:00
}
2024-05-09 18:00:04 +08:00
}
.BoxA {
display: grid;
grid-template-columns: 1fr 1fr;
grid-template-rows: 80px;
.card-Box {
display: grid;
grid-template-rows: 1fr 1fr;
align-items: center;
margin: 5px;
padding: 10px;
background-color: #edededc0;
border-radius: 10px;
max-height: 80px;
.line {
display: inline-block;
width: 0.5rem;
height: 0.5rem;
border-radius: 0.25rem;
background: var(--el-color-primary);
margin-right: 5px;
margin-bottom: 2px;
}
.num {
margin-left: 10px;
display: grid;
text-align: center;
grid-template-columns: 1fr 1fr;
font-size: 12px;
color: #6d6d6d;
2024-05-14 18:28:27 +08:00
div {
cursor: pointer;
}
2024-05-09 18:00:04 +08:00
span {
font-size: 14px;
font-weight: 550;
}
}
2024-04-26 09:15:20 +08:00
}
}
}
.title {
// height: ;
display: flex;
justify-content: space-between;
2024-05-09 18:00:04 +08:00
font-size: 15px;
2024-04-27 22:18:58 +08:00
line-height: 23px;
2024-04-26 09:15:20 +08:00
padding-left: 5px;
width: 100%;
2024-05-09 18:00:04 +08:00
font-weight: 550;
2024-04-26 09:15:20 +08:00
span:nth-child(1) {
cursor: pointer;
}
2024-04-26 09:15:20 +08:00
.info {
font-weight: normal;
display: flex;
font-size: 12px;
cursor: pointer;
2024-05-09 18:00:04 +08:00
color: #757575;
2024-04-26 09:15:20 +08:00
}
.ratio {
font-weight: 500;
font-size: 12px;
line-height: 12px;
}
2024-04-26 09:15:20 +08:00
}
2024-05-09 18:00:04 +08:00
2024-04-26 09:15:20 +08:00
.imgL {
position: absolute;
padding: 10px;
top: calc(50% - 80px);
right: -23px;
2024-05-09 18:00:04 +08:00
2024-04-26 09:15:20 +08:00
transform: rotate(180deg);
height: 200px;
cursor: pointer;
}
2024-04-27 22:18:58 +08:00
2024-04-26 09:15:20 +08:00
.show {
width: 0px;
transition: all 0.3s ease;
2024-04-27 22:18:58 +08:00
.boxLeft {
padding: 0;
}
2024-04-26 09:15:20 +08:00
}
.noshow {
2024-04-27 22:18:58 +08:00
width: 25%;
2024-04-26 09:15:20 +08:00
transition: all 0.3s ease;
2024-04-27 22:18:58 +08:00
.boxLeft {
2024-04-30 11:18:41 +08:00
padding: 10px 10px 10px 10px;
2024-04-27 22:18:58 +08:00
}
2024-04-26 09:15:20 +08:00
}
:deep(.el-card) {
--el-card-padding: 10px !important;
}
:deep(.el-table thead) {
color: #000;
}
2024-05-27 10:37:50 +08:00
:deep(.el-dialog__body) {
max-height: none !important;
}
2024-04-26 09:15:20 +08:00
</style>