<template> <div id="ZHRQ"> <div :class="['LeftBox', 'animate__animated', showPanel ? 'animate__fadeOutLeft' : 'animate__fadeInLeft']"> <div class="ComBox LeftBox1_1"> <div class="Box_header">管道风险评估</div> <div class="Box_Body"> <div class="TJListBox"> <div class="TJList TJList_RQ"> <img class="TJListImg" src="@/assets/images/Sponge_screen/RQ/RQ_RQ.png" alt="" /> <span class="TJListName">燃气管道</span> <span class="TJListValue">4549k㎡</span> </div> <div class="TJList TJList_GZ"> <img class="TJListImg" src="@/assets/images/Sponge_screen/RQ/RQ_GZ.png" alt="" /> <span class="TJListName">需改造</span> <span class="TJListValue">1922k㎡</span> </div> </div> <div class="RQ_EchartsBox"></div> </div> </div> <div class="ComBox LeftBox1_2"> <div class="Box_header">风险监测</div> <div class="Box_Body"> <div class="TJListBox"> <div class="TJList2"> <span class="TJList2Name">指标超标</span> <span class="TJList2Value">10</span> </div> <div class="TJList2"> <span class="TJList2Name">预警站点数</span> <span class="TJList2Value">1</span> </div> </div> <div class="TableChange"> <div class="TableChangeList" :class="AllData.TableChangeIndex == item.id ? 'TableCheck' : ''" v-for="item in AllData.ChangeData" @click="AllData.TableChangeIndex = item.id" > {{ item.name }} </div> </div> <!-- 弹性盒子 --> <div class="TableBox"> <div class="tableHeader"> <span class="tableHeaderList tableList1">指标</span> <span class="tableHeaderList tableList2">数值</span> <span class="tableHeaderList tableList3">状态</span> <span class="tableHeaderList tableList4">操作</span> </div> <div class="tableBody"> <div class="tableBodyList" v-for="item in AllData.FXJCData"> <span class="tableBodyList_span1">{{ item.zb }}</span> <span class="tableBodyList_span2" >{{ item.sz }} <el-icon v-if="item.szzt" color="lime" size="14"><Top /> </el-icon> <el-icon v-else color="#f54444" size="14"> <Bottom /> </el-icon> </span> <span class="tableBodyList_span3" :class="item.zt == 0 ? 'YJClass' : ''">{{ item.zt == 0 ? '预警' : '正常' }}</span> <span class="tableBodyList_span4">派发</span> </div> </div> <div class="tableFoot">更新时间:2024-09-27 10:00</div> </div> </div> </div> <div class="ComBox LeftBox1_3"> <div class="Box_header">预警统计</div> <div class="Box_Body"> <div class="TableChange2"> <div class="TableChangeList2" :class="AllData.YJChangeIndex == item.id ? 'TableCheck2' : ''" v-for="item in AllData.YJChangeData" @click="AllData.YJChangeIndex = item.id" > {{ item.name }} </div> </div> <div id="YJEchartsBox"></div> </div> </div> </div> <div :class="['RightBox', 'animate__animated', showPanel ? 'animate__fadeOutRight' : 'animate__fadeInRight']"> <div class="ComBox RightBox1_1"> <div class="Box_header">辅助决策</div> <div class="Box_Body"> <div class="JCListBox" v-for="item in AllData.JCData"> <div class="JCListBox_List"> <span class="JCListBox_List_label">风险区域:</span> <span class="JCListBox_List_value">{{ item.qy }}</span> </div> <div class="JCListBox_List"> <span class="JCListBox_List_label">风险特征:</span> <span class="JCListBox_List_value">{{ item.tz }}</span> </div> <div class="JCListBox_List"> <span class="JCListBox_List_label">历史事件:</span> <span class="JCListBox_List_value">{{ item.sj }}</span> </div> <div class="JCListBox_List"> <span class="JCListBox_List_label">问题研判:</span> <span class="JCListBox_List_value color_red">{{ item.yp }}</span> </div> <div class="JCListBox_List JCListBox_List_BTN"> <el-button style="background: #03b6a0; color: white; border: none" size="small">工单派发</el-button> <el-button style="background: #03b6a0; color: white; border: none" size="small">现场联线</el-button> </div> </div> </div> </div> <div class="ComBox RightBox1_2"> <div class="Box_header">巡查反馈</div> <div class="Box_Body"> <div class="FK_headerBox"> <div class="FK_headerBox_list"><span class="FK_headerBox_list_colorBox1"></span> 未处理</div> <div class="FK_headerBox_list"><span class="FK_headerBox_list_colorBox2"></span> 已处理</div> </div> <div class="FK_bodyBox"> <div class="FK_bodyBox_list" v-for="item in AllData.XCFKData"> <span class="FK_bodyBox_list_label">{{ item.name }}</span> <div class="FK_BigBox"> <div class="FK_CenBox1" :style="getWidth(item, 1)">{{ item.num1 }}</div> <div class="FK_CenBox2" :style="getWidth(item, 2)">{{ item.num2 }}</div> </div> </div> </div> </div> </div> </div> <div :class="['TopBox', 'animate__animated', showPanel ? 'animate__fadeOutUp' : 'animate__fadeInDown']"> <div class="TopTableHeader"> <span class="TopTableListSpan TopTableListSpan1">时间</span> <span class="TopTableListSpan TopTableListSpan2">事件明细</span> <span class="TopTableListSpan TopTableListSpan3">地点</span> <span class="TopTableListSpan TopTableListSpan4">状态</span> <span class="TopTableListSpan TopTableListSpan5">责任单位</span> <span class="TopTableListSpan TopTableListSpan6">督办</span> </div> <div class="TopTableBody"> <div class="TopTableBody_list" v-for="item in AllData.TopTableData"> <span class="TopTableListSpan TopTableListSpan1">{{ item.sj }}</span> <span class="TopTableListSpan TopTableListSpan2">{{ item.mx }}</span> <span class="TopTableListSpan TopTableListSpan3">{{ item.dd }}</span> <span class="TopTableListSpan TopTableListSpan4">{{ item.zt }}</span> <span class="TopTableListSpan TopTableListSpan5">{{ item.dw }}</span> <span class="TopTableListSpan TopTableListSpan6"> <img class="TopTableListSpanImg2" src="@/assets/images/Sponge_screen/RQ/RQ_XX.png" alt="" /> <img class="TopTableListSpanImg" src="@/assets/images/Sponge_screen/RQ/RQ_SP.png" alt="" /> </span> </div> </div> </div> </div> </template> <script setup name="ZHRQ"> import { ref, reactive, toRefs, onMounted, onBeforeUnmount } from 'vue'; import * as echarts from 'echarts'; import bus from '@/bus'; const AllData = reactive({ ChangeData: [ { name: '枣园', id: 1, }, { name: '杨家湾', id: 2, }, { name: '丰富川', id: 3, }, ], TableChangeIndex: 1, // 风险监测 FXJCData: [ { zb: '甲烷浓度', sz: 10, szzt: true, zt: 0, //0预警 1 正常 }, { zb: '压力', sz: 10, szzt: false, zt: 1, //0预警 1 正常 }, { zb: '温度', sz: 10, szzt: true, zt: 1, //0预警 1 正常 }, ], YJChangeData: [ { name: '综合', id: 1, }, { name: '压力', id: 2, }, { name: '温度', id: 3, }, ], YJChangeIndex: 1, //辅助决策 JCData: [ { qy: '雅安街与南湖路交叉口', tz: '压力监测异常波动', sj: 5, yp: '设施故障', }, { qy: '雅安街与南湖路交叉口', tz: '燃气管道压力过大', sj: 5, yp: '燃气爆管风险', }, { qy: '雅安街与南湖路交叉口', tz: '高峰期流量持续降低', sj: 4, yp: '燃气泄漏风险', }, ], // 巡查反馈 XCFKData: [ { name: '堆放杂物', num1: 20, num2: 80, }, { name: '设备丢失', num1: 12, num2: 88, }, { name: '下陷', num1: 32, num2: 68, }, { name: '异变', num1: 30, num2: 70, }, { name: '其他', num1: 20, num2: 80, }, ], // 顶部表格数据 TopTableData: [ { sj: '2024-09-26 10:00:29', mx: '燃气常规检查发现泄漏', dd: '车城大道与车辆西路路口', zt: 0, //0未处理 1已处理 dw: '杨家湾输配站', }, { sj: '2024-09-27 16:10:248', mx: '燃气常规检查发现泄漏', dd: '车城大道与车辆西路路口', zt: 1, //0未处理 1已处理 dw: '杨家湾输配站', }, ], timer: null, }); // 预警统计echarts实例 const myChart = shallowRef(null); //面板展开收起 const showPanel = ref(true); // 面板内容展开收起控制 const props = defineProps({ showPanel: { type: Boolean, }, }); // 初始化预警统计的Echarts const initEcharts = () => { if (!!myChart.value) { myChart.value.dispose(); } myChart.value = echarts.init(document.getElementById('YJEchartsBox')); myChart.value.setOption({ color: ['#18A7F2', '#1AF7AA'], tooltip: { trigger: 'axis', }, grid: { top: '30%', left: '3%', right: '4%', bottom: '3%', containLabel: true, }, legend: { data: ['预警次数', '持续时长'], textStyle: { color: '#fffd', // 图例文字颜色 }, x: '40', y: '10', }, xAxis: [ { type: 'category', data: ['今日', '09/27', '09/26', '09/25', '09/24', '09/23', '09/22'], axisPointer: { type: 'shadow', }, textStyle: { color: '#EBFEFF', }, axisLine: { lineStyle: { color: '#EBFEFF', }, }, // boundaryGap: false, }, ], yAxis: [ { type: 'value', name: '预警次数', min: 0, max: 120, interval: 20, axisLabel: { formatter: '{value}', }, axisLine: { lineStyle: { color: '#AAC1CF', }, }, splitLine: { lineStyle: { // 使用深浅的间隔色 color: ['#184E5A'], }, }, }, { type: 'value', name: '持续时长', min: 0, max: 24, interval: 4, axisLabel: { formatter: '{value}', }, axisLine: { lineStyle: { color: '#AAC1CF', }, }, splitLine: { lineStyle: { // 使用深浅的间隔色 color: ['#184E5A'], }, }, }, ], series: [ { name: '预警次数', type: 'bar', barWidth: '10px', showBackground: true, tooltip: { valueFormatter: function (value) { return value + ' 次'; }, }, itemStyle: { // borderRadius: 10, // 统一设置四个角的圆角大小 borderRadius: [10, 10, 0, 0], //(顺时针左上,右上,右下,左下) }, data: [105, 50, 55, 70, 110, 90, 68], }, { name: '持续时长', type: 'line', yAxisIndex: 1, tooltip: { valueFormatter: function (value) { return value + 'min'; }, }, areaStyle: { opacity: 0.8, color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ { offset: 0, color: '#1AF7AA', }, { offset: 1, color: '#1AF7AA00', }, ]), }, data: [16, 7, 8, 12, 16, 13, 12], }, ], }); animateChart(); }; const animateChart = () => { let length = 7; let i = 0; AllData.timer = setInterval(() => { i++; if (i == length) i = 0; myChart.value.dispatchAction({ type: 'showTip', seriesIndex: 0, dataIndex: i, }); }, 2000); }; // 动态计算盒子的宽度 const getWidth = (item, num) => { let widthNum = 0; if (num == 1) { widthNum = (item.num1 / (item.num1 + item.num2)) * 100; } else { widthNum = (item.num2 / (item.num1 + item.num2)) * 100; } return `width:${widthNum}%`; }; watch( () => props.showPanel, () => { showPanel.value = props.showPanel; }, { immediate: true } ); onMounted(() => { let initeRQTimer = setInterval(() => { if (!newfiberMapbox) return; if (!newfiberMapbox.map.getLayer('rq_pipeline_info')) return; if (!newfiberMapbox.map.getLayer('sx_ya_smx_rq_point')) return; newfiberMapbox.map.setLayoutProperty('sx_ya_smx_rq_point', 'visibility', 'visible'); newfiberMapbox.map.setLayoutProperty('rq_pipeline_info', 'visibility', 'visible'); clearInterval(initeRQTimer); }, 100); initEcharts(); }); onBeforeUnmount(() => { newfiberMapbox.map.setLayoutProperty('rq_pipeline_info', 'visibility', 'none'); newfiberMapbox.map.setLayoutProperty('sx_ya_smx_rq_point', 'visibility', 'none'); bus.emit('closeCesiumPopup'); if (!!newfiberMapbox.getLayerByName('rqLine')) { newfiberMapbox.removeLayer(newfiberMapbox.getLayerByName('rqLine')); } }); </script> <style lang="scss" scoped> @import '@/assets/styles/transition_oneMap.scss'; #ZHRQ { .LeftBox { width: 450px; height: calc(100% - 98px); position: absolute; left: 10px; top: 70px; background: linear-gradient(0deg, rgba(0, 43, 67, 0.8) 0%, rgba(0, 69, 108, 0.8) 100%); border-radius: 6px; border: 1px solid #47eef3; box-sizing: border-box; padding: 10px; box-shadow: inset 0 0 5px 5px #47eef38a; .LeftBox1_1 { height: 365px; .TJListBox { height: 42px; margin-top: 10px; width: 100%; display: flex; flex-direction: row; flex-wrap: nowrap; justify-content: space-between; align-items: center; .TJList { height: 42px; width: calc(50% - 9px); display: flex; .TJListImg { width: 22px; height: 22px; margin: 9px; } .TJListName { font-family: Source Han Sans CN; font-weight: 400; font-size: 14px; color: #f4f9ff; width: 65px; height: 40px; line-height: 40px; } .TJListValue { font-family: Source Han Sans CN; font-weight: bold; font-size: 20px; width: calc(100% - 110px); height: 40px; line-height: 40px; text-align: right; } } .TJList_RQ { background: rgba(7, 54, 102, 0.3); border-radius: 4px; border: 1px solid #15d2fd; box-shadow: inset 0 0 10px #15d2fdb0; /* 水平偏移|垂直偏移|模糊半径|颜色 */ .TJListValue { color: #12f9ff; } } .TJList_GZ { background: rgba(164, 74, 8, 0.3); border-radius: 4px; border: 1px solid #ffd97f; box-shadow: inset 0 0 10px #ffd97fb0; /* 水平偏移|垂直偏移|模糊半径|颜色 */ .TJListValue { color: #ffd97f; } } } .RQ_EchartsBox { width: 100%; height: calc(100% - 72px); margin-top: 10px; background: url('@/assets/images/Sponge_screen/RQ/Ech.png') no-repeat center; background-size: cover; } } .LeftBox1_2 { height: calc(100% - 365px - 275px - 10px); margin-bottom: 10px; // 风险监测 .TJListBox { height: 42px; margin-top: 10px; width: 100%; display: flex; flex-direction: row; flex-wrap: nowrap; justify-content: space-between; align-items: center; .TJList2 { height: 42px; width: calc(50% - 9px); display: flex; background: url('@/assets/images/Sponge_screen/RQ/RQ_FX.png') no-repeat center; background-size: 100% 100%; .TJList2Name { width: 50%; font-family: Source Han Sans CN; font-weight: 400; font-size: 14px; color: #f4f9ff; height: 40px; line-height: 40px; text-align: left; box-sizing: border-box; padding-left: 20px; } .TJList2Value { width: 50%; font-family: Source Han Sans CN; font-weight: bold; font-size: 20px; color: #12f9ff; height: 40px; line-height: 40px; text-align: center; } } } .TableChange { height: 42px; width: 100%; box-sizing: border-box; padding: 10px 0px; display: flex; flex-direction: row; flex-wrap: nowrap; justify-content: flex-end; align-items: center; .TableChangeList { width: 60px; height: 22px; background: #00344f; border-radius: 2px; font-family: Source Han Sans CN; font-weight: 500; font-size: 14px; color: #c1d3d4; text-align: center; line-height: 20px; cursor: pointer; } .TableCheck { background: #00344f; border-radius: 2px; border: 1px solid #1cf5fc; font-family: Source Han Sans CN; font-weight: bold; font-size: 12px; color: #ebfeff; background: #1cf4fc22; } } .TableBox { width: 100%; height: calc(100% - 94px); .tableHeader { width: 100%; height: 34px; background: linear-gradient(0deg, #00fbffa3 0%, #00fbff00 100%); border-radius: 2px; border: 1px solid #74dde1; display: flex; .tableHeaderList { font-family: Source Han Sans CN; font-weight: 400; font-size: 14px; color: #ffffff; height: 34px; line-height: 34px; text-align: center; } .tableList1 { width: 20%; } .tableList2 { width: 30%; } .tableList3 { width: 30%; } .tableList4 { width: 20%; } } .tableBody { width: 100%; height: calc(100% - 68px); overflow: auto; .tableBodyList { height: 34px; line-height: 34px; width: 100%; display: flex; /* 选择偶数行 */ &:nth-child(even) { background: linear-gradient(0deg, #008599 0%, #08596d 100%); } .tableBodyList_span1 { font-family: Source Han Sans CN; font-weight: 400; font-size: 14px; color: #ffffff; height: 34px; line-height: 34px; text-align: center; width: 20%; } .tableBodyList_span2 { font-family: Source Han Sans CN; font-weight: 400; font-size: 14px; color: #ffffff; height: 34px; line-height: 34px; text-align: center; width: 30%; } .tableBodyList_span3 { font-family: Source Han Sans CN; font-weight: 400; font-size: 14px; color: #ffffff; height: 34px; line-height: 34px; text-align: center; width: 30%; } .YJClass { color: #ffe243; } .tableBodyList_span4 { font-family: Source Han Sans CN; font-weight: 400; font-size: 14px; color: #ffffff; height: 34px; line-height: 34px; text-align: center; width: 20%; cursor: pointer; } } } .tableFoot { width: 100%; height: 34px; background: linear-gradient(0deg, #008599b7 0%, #08596d91 100%); font-family: Source Han Sans CN; font-weight: 400; font-size: 14px; color: #ebfeff; line-height: 34px; text-align: center; } } } .LeftBox1_3 { height: 275px; .TableChange2 { height: 42px; width: 100%; box-sizing: border-box; padding: 10px 0px; display: flex; flex-direction: row; flex-wrap: nowrap; justify-content: flex-end; align-items: center; position: absolute; top: 0px; right: 0px; z-index: 999; .TableChangeList2 { width: 60px; height: 22px; background: #00344f; border-radius: 2px; font-family: Source Han Sans CN; font-weight: 500; font-size: 14px; color: #c1d3d4; text-align: center; line-height: 20px; cursor: pointer; } .TableCheck2 { background: #00344f; border-radius: 2px; border: 1px solid #1cf5fc; font-family: Source Han Sans CN; font-weight: bold; font-size: 12px; color: #ebfeff; background: #1cf4fc22; } } #YJEchartsBox { width: 100%; height: 100%; } } } .RightBox { width: 450px; height: calc(100% - 98px); position: absolute; right: 10px; top: 70px; background: linear-gradient(0deg, rgba(0, 43, 67, 0.8) 0%, rgba(0, 69, 108, 0.8) 100%); border-radius: 6px; border: 1px solid #47eef3; box-sizing: border-box; padding: 10px; box-shadow: inset 0 0 5px 5px #47eef38a; .RightBox1_1 { height: calc(100% - 298px); margin-bottom: 10px; box-sizing: border-box; // padding: 0 10px; .JCListBox { margin-top: 10px; width: 100%; height: 196px; background: linear-gradient(0deg, #008599 0%, #08596d 100%); border-radius: 4px; overflow: hidden; .JCListBox_List { width: 100%; height: 28px; margin-top: 10px; display: flex; flex-direction: row; flex-wrap: nowrap; justify-content: space-evenly; align-items: center; .JCListBox_List_label { display: inline-block; font-family: Source Han Sans CN; font-weight: 400; font-size: 14px; color: #c1d3d4; height: 28px; line-height: 28px; text-align: right; width: 70px; } .JCListBox_List_value { display: inline-block; border: 1px solid #1cf5fc; width: 290px; height: 28px; line-height: 28px; font-family: Source Han Sans CN; font-weight: 400; font-size: 14px; color: #ffffff; text-align: center; } } .JCListBox_List_BTN { justify-content: center; align-items: center; } } } .RightBox1_2 { height: 288px; .FK_headerBox { width: 100%; height: 45px; display: flex; flex-direction: row; flex-wrap: nowrap; justify-content: center; align-items: center; .FK_headerBox_list { font-family: Source Han Sans CN; font-weight: bold; font-size: 14px; color: #ebfeff; width: 100px; text-align: center; .FK_headerBox_list_colorBox1 { display: inline-block; width: 10px; height: 10px; background: #ee5777; } .FK_headerBox_list_colorBox2 { display: inline-block; width: 10px; height: 10px; background: #00ffbe; } } } .FK_bodyBox { width: 100%; height: 200px; overflow: auto; box-sizing: border-box; padding: 0 30px; .FK_bodyBox_list { width: 100%; height: 20px; margin-bottom: 20px; display: flex; .FK_bodyBox_list_label { display: block; font-family: Source Han Sans CN; font-weight: 500; font-size: 14px; color: #ffffff; width: 80px; } .FK_BigBox { display: block; width: calc(100% - 80px); height: 20px; .FK_CenBox1 { display: inline-block; height: 20px; background: linear-gradient(-90deg, #f35f7f 0%, #c21439 100%); font-family: Source Han Sans CN; font-weight: bold; font-size: 14px; color: #ffffff; text-align: right; line-height: 20px; box-sizing: border-box; padding: 0 10px; } .FK_CenBox2 { display: inline-block; height: 20px; background: linear-gradient(90deg, #20d9aa 0%, #0882a0 100%); font-weight: bold; font-size: 14px; color: #ffffff; text-align: right; line-height: 20px; box-sizing: border-box; padding: 0 10px; } } } } } } .TopBox { width: calc(100% - 1040px); height: 130px; position: absolute; left: 520px; top: 110px; background: linear-gradient(0deg, rgba(0, 43, 67, 0.8) 0%, rgba(0, 69, 108, 0.8) 100%); border-radius: 6px; border: 1px solid #47eef3; box-sizing: border-box; box-shadow: inset 0 0 5px 5px #47eef38a; padding: 10px; .TopTableHeader { width: 100%; height: 34px; background: linear-gradient(0deg, #00fbffa3 0%, #00fbff00 100%); border: 1px solid #74dde1; display: flex; } .TopTableBody { width: 100%; height: calc(100% - 34px); overflow: auto; display: flex; flex-direction: column; flex-wrap: nowrap; .TopTableBody_list { display: inline-block; width: 100%; height: 34px; /* 选择偶数行 */ &:nth-child(even) { background: linear-gradient(0deg, #008599 0%, #08596d 100%); } } } .TopTableListSpan { font-family: Source Han Sans CN; font-weight: 400; font-size: 14px; color: #ffffff; height: 34px; line-height: 34px; display: inline-block; box-sizing: border-box; overflow: hidden; text-overflow: ellipsis; /* 超出宽度后显示省略号 */ white-space: nowrap; /* 限制不允许换行 */ } .TopTableListSpan1 { width: 20%; text-align: left; padding-left: 10px; } .TopTableListSpan2 { width: 25%; text-align: center; } .TopTableListSpan3 { width: 20%; text-align: center; } .TopTableListSpan4 { width: 10%; text-align: center; } .TopTableListSpan5 { width: 15%; text-align: center; } .TopTableListSpan6 { width: 10%; text-align: right; padding-right: 10px; .TopTableListSpanImg { width: 15px; height: 19px; margin: 7px; } .TopTableListSpanImg2 { width: 19px; height: 19px; margin: 7px; } } } // 左右两侧展示板块公共样式 .ComBox { width: 100%; box-sizing: border-box; .Box_header { width: 100%; height: 43px; background: url('@/assets/images/Sponge_screen/Box_HeaderBackground.png') no-repeat center; background-size: cover; font-family: PangMenZhengDao; font-weight: 400; font-size: 23px; color: #ebfeff; line-height: 43px; box-sizing: border-box; padding-left: 35px; } .Box_Body { width: 100%; height: calc(100% - 43px); box-sizing: border-box; position: relative; overflow: auto; } } .color_red { color: #ff3f3f !important; } } </style>