From 1c4e6621d5e7c71f2b9aec06d5a7abd8f5a82340 Mon Sep 17 00:00:00 2001
From: niedongsheng <605973111@qq.com>
Date: Thu, 9 Apr 2026 14:14:00 +0800
Subject: [PATCH] =?UTF-8?q?refactor:=20=E6=B0=B4=E6=AF=81=E8=A1=A8?=
=?UTF-8?q?=E5=8D=95=E9=87=8D=E6=9E=84?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
packages/screen/src/component/BlockItem.vue | 47 +
.../DisasterDetail/ContinueReport.vue | 6 +-
.../DisasterManagement/DisasterManagement.vue | 16 +-
.../DisasterReport/LossList.vue | 148 ++++
.../DisasterReport/WaterDisasterReport.vue | 825 +++++++++---------
5 files changed, 594 insertions(+), 448 deletions(-)
create mode 100644 packages/screen/src/component/BlockItem.vue
create mode 100644 packages/screen/src/views/DisasterManagement/DisasterReport/LossList.vue
diff --git a/packages/screen/src/component/BlockItem.vue b/packages/screen/src/component/BlockItem.vue
new file mode 100644
index 0000000..33bb90d
--- /dev/null
+++ b/packages/screen/src/component/BlockItem.vue
@@ -0,0 +1,47 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/screen/src/views/DisasterManagement/DisasterDetail/ContinueReport.vue b/packages/screen/src/views/DisasterManagement/DisasterDetail/ContinueReport.vue
index 77eb5bd..7158c2b 100644
--- a/packages/screen/src/views/DisasterManagement/DisasterDetail/ContinueReport.vue
+++ b/packages/screen/src/views/DisasterManagement/DisasterDetail/ContinueReport.vue
@@ -78,9 +78,7 @@
-
-
-
+
@@ -140,7 +138,7 @@
import { ref, reactive, watch, computed } from 'vue'
import { ElMessage } from 'element-plus'
import { request } from '@shared/utils/request'
-// import LossList from './LossList.vue'
+import LossList from '../DisasterReport/LossList.vue'
// Props 定义
const props = defineProps({
diff --git a/packages/screen/src/views/DisasterManagement/DisasterManagement.vue b/packages/screen/src/views/DisasterManagement/DisasterManagement.vue
index e9d0185..68edc96 100644
--- a/packages/screen/src/views/DisasterManagement/DisasterManagement.vue
+++ b/packages/screen/src/views/DisasterManagement/DisasterManagement.vue
@@ -90,9 +90,9 @@
-
-
-
+
+
+
@@ -100,8 +100,8 @@
-
-
+
+
@@ -109,8 +109,8 @@
-
-
+
+
@@ -400,4 +400,4 @@ onMounted(() => {
border-top: 1px solid #ebeef5;
}
}
-
+
\ No newline at end of file
diff --git a/packages/screen/src/views/DisasterManagement/DisasterReport/LossList.vue b/packages/screen/src/views/DisasterManagement/DisasterReport/LossList.vue
new file mode 100644
index 0000000..cf01934
--- /dev/null
+++ b/packages/screen/src/views/DisasterManagement/DisasterReport/LossList.vue
@@ -0,0 +1,148 @@
+
+
+
+
+ changeValue(item, event)">
+
+ {{ item.unit }}
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/screen/src/views/DisasterManagement/DisasterReport/WaterDisasterReport.vue b/packages/screen/src/views/DisasterManagement/DisasterReport/WaterDisasterReport.vue
index c0ac06a..f494c67 100644
--- a/packages/screen/src/views/DisasterManagement/DisasterReport/WaterDisasterReport.vue
+++ b/packages/screen/src/views/DisasterManagement/DisasterReport/WaterDisasterReport.vue
@@ -9,405 +9,357 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 处
+
+
+
+
+
+
+
+
+
+
+
+ 公里
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ K
+
+
+
+
+
+
+
+ K
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
- 处
-
-
-
-
-
-
-
- 公里
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 半幅封闭
- 全副封闭
- 便道通行
- 正常通行
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 人
-
-
-
-
-
-
-
- 人
-
-
-
-
-
-
-
- 人
-
-
-
-
-
-
-
- 辆
-
-
-
-
-
-
-
- 辆
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 万元
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 台/班
-
-
-
-
-
-
-
- 人次
-
-
-
-
-
-
-
- 万元
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 只能上传jpg/png格式,且不超过500kb
-
-
-
-
-
- 选择文件
+
+
+
+
+
+
+
+
+
+
-
- 仅支持20s内的视频,不超过20MB
-
-
-
-
-
-
+
+
+ 只能上传jpg/png格式,且不超过500kb
+
+
+
+
+
+ 选择文件
+
+ 仅支持20s内的视频,不超过20MB
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+ 人
+
+
+
+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+ 人
+
+
+
+
-
-
-
-
- 万元
-
-
-
+
+
+
+
+
+ 人
+
+
+
+
+
+
+
+
+
+
+ 辆
+
+
+
+
+
+
+
+
+
+
+ 辆
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 台/班
+
+
+
+
+
+
+
+ 人次
+
+
+
+
+
+
+
+ 万元
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 万元
+
+
+
+
+
+
@@ -431,7 +383,9 @@ import { ElMessage } from 'element-plus'
import { Plus, Upload } from '@element-plus/icons-vue'
import mockData from './waterMockJson.json'
import { request } from '@/utils/request'
-// import LossList from './LossList.vue'
+import LossList from './LossList.vue'
+import BlockItem from '@/component/BlockItem.vue'
+import { el } from 'element-plus/es/locale/index.mjs'
const router = useRouter()
const route = useRoute()
@@ -448,52 +402,51 @@ const disposalMeasuresArray = ref([])
const imageFileList = ref([])
const videoFileList = ref([])
-// 表单数据 - 按 H5 Request 接口结构定义
const formData = reactive({
// 顶层字段
- occurLocation: '', // 发生地点/路况位置
- occurTime: '', // 发生时间
- roadConditionType: '', // 路况类别
- routeNo: '', // 线路编号
+ occurLocation: null, // 发生地点/路况位置
+ occurTime: null, // 发生时间
+ roadConditionType: null, // 路况类别
+ routeNo: null, // 线路编号
// event 对象
event: {
- blockedMileage: '', // 阻断里程
- blockedPointName: '', // 阻断点小地名
- contactPerson: '', // 联系人
- contactPhone: '', // 联系电话
- damageCount: '', // 水毁处数
- district: '', // 上报区县
- endStakeLat: '', // 止点纬度
- endStakeLng: '', // 止点经度
- endStakeNo: '', // 止点桩号
- estimatedRecoveryCost: '', // 恢复重建预估费用
- inspectionMileage: '', // 巡查里程
- isBlocked: '', // 是否阻断
- needsRecovery: '', // 是否需要恢复重建
- repairProgress: '', // 抢修进度
- reporterUnit: '', // 填报单位
- startStakeLat: '', // 起点纬度
- startStakeLng: '', // 起点经度
- startStakeNo: '' // 起点桩号
+ blockedMileage: null, // 阻断里程
+ blockedPointName: null, // 阻断点小地名
+ contactPerson: null, // 联系人
+ contactPhone: null, // 联系电话
+ damageCount: null, // 水毁处数
+ district: null, // 上报区县
+ endStakeLat: null, // 止点纬度
+ endStakeLng: null, // 止点经度
+ endStakeNo: null, // 止点桩号
+ estimatedRecoveryCost: null, // 恢复重建预估费用
+ inspectionMileage: null, // 巡查里程
+ isBlocked: null, // 是否阻断
+ needsRecovery: null, // 是否需要恢复重建
+ repairProgress: null, // 抢修进度
+ reporterUnit: null, // 填报单位
+ startStakeLat: null, // 起点纬度
+ startStakeLng: null, // 起点经度
+ startStakeNo: null // 起点桩号
},
// report 对象
report: {
- actualRecoverTime: '', // 实际恢复时间
- damagedVehicleCount: '', // 损坏车辆
- deadCount: '', // 死亡人员
- disposalMeasures: '', // 处置措施(逗号分隔)
- expectRecoverTime: '', // 预计恢复时间
- injuredCount: '', // 受伤人员
- investedFunds: '', // 已投资金
- investedMachinery: '', // 已投机械
- investedManpower: '', // 已投人力
- remark: '', // 处理情况/备注
- siteDescription: '', // 现场描述
- strandedPersonCount: '', // 滞留人员
- strandedVehicleCount: '', // 滞留车辆
- totalLossAmount: '' // 损失总金额
+ actualRecoverTime: null, // 实际恢复时间
+ damagedVehicleCount: null, // 损坏车辆
+ deadCount: null, // 死亡人员
+ disposalMeasures: null, // 处置措施(逗号分隔)
+ expectRecoverTime: null, // 预计恢复时间
+ injuredCount: null, // 受伤人员
+ investedFunds: null, // 已投资金
+ investedMachinery: null, // 已投机械
+ investedManpower: null, // 已投人力
+ remark: null, // 处理情况/备注
+ siteDescription: null, // 现场描述
+ strandedPersonCount: null, // 滞留人员
+ strandedVehicleCount: null, // 滞留车辆
+ totalLossAmount: null // 损失总金额
},
// lossList 数组
@@ -507,7 +460,7 @@ const formData = reactive({
watch(
disposalMeasuresArray,
(newVal) => {
- formData.report.disposalMeasures = newVal.join(',')
+ formData.report.disposalMeasures = newVal.length ? newVal.join(',') : null
},
{ deep: true }
)
@@ -515,7 +468,7 @@ watch(
// 监听图片附件变化,同步到 fileList
watch(
imageFileList,
- (newVal) => {
+ () => {
syncFileList()
},
{ deep: true }
@@ -524,7 +477,7 @@ watch(
// 监听视频附件变化,同步到 fileList
watch(
videoFileList,
- (newVal) => {
+ () => {
syncFileList()
},
{ deep: true }
@@ -554,6 +507,8 @@ watch(
(newVal) => {
if (newVal && typeof newVal === 'string') {
disposalMeasuresArray.value = newVal.split(',').filter(Boolean)
+ } else {
+ disposalMeasuresArray.value = []
}
},
{ immediate: true }
@@ -640,7 +595,7 @@ const validate = async () => {
// 提交表单
const handleSubmit = async () => {
// 验证表单
- if (!validate()) {
+ if (!(await validate())) {
return
}
@@ -697,7 +652,6 @@ defineExpose({