From 4e7d16f67fa6874bd922e55b218542d054fc0f18 Mon Sep 17 00:00:00 2001
From: fanjia <3278303149@qq.com>
Date: Fri, 17 Apr 2026 17:23:51 +0800
Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=8E=A5=E5=8F=A3=E5=A4=A7?=
=?UTF-8?q?=E5=B1=8F=E7=AE=A1=E6=8E=A7?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Dialog/responseStatusDialog.vue | 45 +---
.../Dialog/warningSituationDialog.vue | 197 ++++++++----------
.../screen/src/views/RiskWarning/bottom.vue | 2 +
.../RiskWarning/component/ChongqingMap.vue | 4 +-
.../component/WeatherWarningTable.vue | 3 +-
.../screen/src/views/RiskWarning/index.vue | 7 +
.../screen/src/views/RiskWarning/left.vue | 18 +-
.../screen/src/views/RiskWarning/right.vue | 34 ++-
packages/screen/src/views/RiskWarning/top.vue | 28 +--
9 files changed, 167 insertions(+), 171 deletions(-)
diff --git a/packages/screen/src/views/RiskWarning/Dialog/responseStatusDialog.vue b/packages/screen/src/views/RiskWarning/Dialog/responseStatusDialog.vue
index 7a80771..a8b2e81 100644
--- a/packages/screen/src/views/RiskWarning/Dialog/responseStatusDialog.vue
+++ b/packages/screen/src/views/RiskWarning/Dialog/responseStatusDialog.vue
@@ -203,38 +203,17 @@ const statsCardsData = ref([
// 表格列配置
const tableColumns = ref([
- { prop: 'id', label: '序号', width: '50px' },
- { prop: 'pointType', label: '影响点类型', width: '80px' },
- { prop: 'pointLocation', label: '影响点位置', width: '150px' },
- {
- prop: 'pointLevel',
- label: '影响点等级',
- width: '90px',
- slot: 'pointLevel',
- },
- { prop: 'checkCount', label: '查次数', width: '60px' },
- {
- prop: 'trafficDept',
- label: '交通主管部门负责人',
- width: '120px',
- slot: 'trafficDept',
- },
- { prop: 'roadOrg', label: '公路机构责任人', width: '110px', slot: 'roadOrg' },
- {
- prop: 'maintenance',
- label: '养护站负责人',
- width: '110px',
- slot: 'maintenance',
- },
- { prop: 'roadKeeper', label: '护路员', width: '80px', slot: 'roadKeeper' },
- // {
- // prop: "responseStatus",
- // label: "回应状态",
- // width: "70px",
- // slot: "responseStatus",
- // },
- { prop: 'urgeTime', label: '最新催告时间', width: '110px', slot: 'urgeTime' },
- { prop: 'operation', label: '操作', width: '50px', slot: 'operation' },
+ { prop: 'id', label: '序号', width: '' },
+ { prop: 'pointType', label: '影响点类型', width: '' },
+ { prop: 'pointLocation', label: '影响点位置', width: '' },
+ { prop: 'pointLevel', label: '影响点等级', width: '', slot: 'pointLevel' },
+ { prop: 'checkCount', label: '查次数', width: '' },
+ { prop: 'trafficDept', label: '交通主管部门负责人', width: '', slot: 'trafficDept' },
+ { prop: 'roadOrg', label: '公路机构责任人', width: '', slot: 'roadOrg' },
+ { prop: 'maintenance', label: '养护站负责人', width: '', slot: 'maintenance' },
+ { prop: 'roadKeeper', label: '护路员', width: '', slot: 'roadKeeper' },
+ { prop: 'urgeTime', label: '最新催告时间', width: '', slot: 'urgeTime' },
+ { prop: 'operation', label: '操作', width: '', slot: 'operation' },
]);
// 表格数据
@@ -290,8 +269,6 @@ const tableData = ref([
urgeTime: { date: '2026-03-28', time: '12:30:00' },
},
]);
-tableData.value.push(...tableData.value);
-tableData.value.push(...tableData.value);
// 分页
const currentPage = ref(1);
diff --git a/packages/screen/src/views/RiskWarning/Dialog/warningSituationDialog.vue b/packages/screen/src/views/RiskWarning/Dialog/warningSituationDialog.vue
index db692af..807df0a 100644
--- a/packages/screen/src/views/RiskWarning/Dialog/warningSituationDialog.vue
+++ b/packages/screen/src/views/RiskWarning/Dialog/warningSituationDialog.vue
@@ -90,33 +90,25 @@
- {{
- row.riskLeve
- }}
+ {{ row.riskLeve }}
- {{
- row.impactCount
- }}
+ {{ row.impactCount }}
diff --git a/packages/screen/src/views/RiskWarning/bottom.vue b/packages/screen/src/views/RiskWarning/bottom.vue
index 06850d4..080b133 100644
--- a/packages/screen/src/views/RiskWarning/bottom.vue
+++ b/packages/screen/src/views/RiskWarning/bottom.vue
@@ -226,6 +226,8 @@ const handleClick = (item, index) => {
showHazardPopup.value = false;
showRoadPopup.value = false;
emit('showHazardPopupfn', false);
+ // 点击非路段,隐藏路段统计
+ emit('hideRoadStats');
}
activeIndex.value = index;
diff --git a/packages/screen/src/views/RiskWarning/component/ChongqingMap.vue b/packages/screen/src/views/RiskWarning/component/ChongqingMap.vue
index c8f396e..e5f3ee3 100644
--- a/packages/screen/src/views/RiskWarning/component/ChongqingMap.vue
+++ b/packages/screen/src/views/RiskWarning/component/ChongqingMap.vue
@@ -9,13 +9,13 @@
{{ error }}
-
+ > -->
{
showRoadStats.value = true;
};
+// 处理隐藏路段统计
+const handleHideRoadStats = () => {
+ console.log('隐藏路段统计');
+ showRoadStats.value = false;
+};
+
// 处理隐患点点击
const handleHazardItemClick = item => {
console.log('点击隐患点:', item);
diff --git a/packages/screen/src/views/RiskWarning/left.vue b/packages/screen/src/views/RiskWarning/left.vue
index 924e2ef..28c6bde 100644
--- a/packages/screen/src/views/RiskWarning/left.vue
+++ b/packages/screen/src/views/RiskWarning/left.vue
@@ -404,8 +404,24 @@ const districtLoadLoad = async () => {
if (res.code == "00000") {
const data = res.data;
if (data) {
+ // 简化区县名称
+ const simplifyDistrictName = (name) => {
+ if (!name) return name;
+ return name
+ .replace("彭水苗族土家族自治县", "彭水县")
+ .replace("石柱土家族自治县", "石柱县")
+ .replace("秀山土家族苗族自治县", "秀山县")
+ .replace("酉阳土家族苗族自治县", "酉阳县");
+ };
+
+ // 处理数据,简化区县名称
+ const processedData = data.map((item) => ({
+ ...item,
+ name: simplifyDistrictName(item.name),
+ }));
+
// 根据路段、桥梁、隧道、边坡、项目的总数进行排序(数值越大越靠前)
- const sortedData = data.sort((a, b) => {
+ const sortedData = processedData.sort((a, b) => {
const totalA =
(a.roadSectionCount || 0) +
(a.bridgeCount || 0) +
diff --git a/packages/screen/src/views/RiskWarning/right.vue b/packages/screen/src/views/RiskWarning/right.vue
index 46c10d2..33eaf3b 100644
--- a/packages/screen/src/views/RiskWarning/right.vue
+++ b/packages/screen/src/views/RiskWarning/right.vue
@@ -548,11 +548,34 @@ const controlData1 = ref([
{ label: '限速(限车型)数', value: '24' },
{ label: '告警阻拦处数', value: '32' },
]);
-const controlData2 = [
- { label: '停工项目数', value: '30' },
- { label: '关闭驻地数', value: '42' },
- { label: '转移撤离人员数', value: '58' },
-];
+const controlData2 = ref([
+ { label: '停工项目数', value: '0', key: 'stoped_project_count' },
+ { label: '关闭驻地数', value: '0', key: 'closed_site_count' },
+ { label: '转移撤离人员数', value: '0', key: 'displaced_population' },
+]);
+
+// 获取气象预警受影响统计(按项目)
+const getAffectedCountByProject = async () => {
+ try {
+ const res = await request({
+ url: '/snow-ops-platform/weather-warning/affected-count/_by_project',
+ method: 'GET',
+ });
+ console.log('气象预警受影响统计:', res);
+ if (res.code === '00000' && res.data) {
+ const data = res.data;
+ // 更新 controlData2 数组的值
+ controlData2.value.forEach(item => {
+ const matchedData = data.find(d => d.name === item.key);
+ if (matchedData) {
+ item.value = String(matchedData.count);
+ }
+ });
+ }
+ } catch (error) {
+ console.error('获取气象预警受影响统计失败:', error);
+ }
+};
// 巡查数据
const patrolData = [
@@ -618,6 +641,7 @@ const init = () => {
getControlStats();
getRescueInputStats();
getDisasterStats();
+ getAffectedCountByProject();
};
// 组件挂载时获取数据并注册刷新函数
diff --git a/packages/screen/src/views/RiskWarning/top.vue b/packages/screen/src/views/RiskWarning/top.vue
index f01dee2..49fb4e8 100644
--- a/packages/screen/src/views/RiskWarning/top.vue
+++ b/packages/screen/src/views/RiskWarning/top.vue
@@ -39,7 +39,6 @@
-
@@ -70,14 +69,6 @@ const props = defineProps({
default: false,
},
});
-
-watch(
- () => props.roadItem,
- newVal => {
- console.log('top.vue 收到路段信息:', newVal);
- // roadvalArr.value = newVal;
- }
-);
watch(
() => props.showHazardPopup,
newShow => {
@@ -198,19 +189,22 @@ const fetchRiskLevelCount = async () => {
});
console.log('风险等级统计数据:', res);
if (res.code === '00000' && res.data) {
- // 更新隐患点统计数据
+ // 更新路段统计数据
const data = res.data;
let roadTotal = 0;
roadStats.value.forEach(item => {
- data.forEach(d => {
- if (item.label.includes(d.level)) {
- roadTotal += Number(d.count);
- item.value = Number(d.count);
- }
- });
+ // 重置值为0
+ item.value = 0;
+ // 查找匹配的数据
+ const matchedData = data.find(d => item.label.includes(d.level));
+ if (matchedData) {
+ item.value = Number(matchedData.count);
+ roadTotal += Number(matchedData.count);
+ }
});
+ // 更新风险点总数
roadStats.value[4].value = roadTotal;
- console.log(roadStats.value);
+ console.log('更新后的roadStats:', roadStats.value);
}
} catch (error) {
console.error('获取风险等级统计数据失败:', error);