From 13fc3a68c64b184fceb5996b5aca92f8c9f301cf Mon Sep 17 00:00:00 2001 From: niedongsheng <605973111@qq.com> Date: Thu, 9 Apr 2026 09:35:05 +0800 Subject: [PATCH 1/5] =?UTF-8?q?feat:=20=E7=81=BE=E6=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DisasterManagement/DisasterDetail.vue | 109 +- .../WaterDisaster/WaterDisaster.vue | 47 +- packages/screen/src/router/index.js | 11 +- .../DisasterDetail/ContinueReport.vue | 475 +++++++++ .../DisasterDetail/WaterDisasterDetail.vue | 618 ++++++++++++ .../DisasterManagement/DisasterManagement.vue | 4 +- .../DisasterReport/WaterDisasterReport.vue | 948 +++++++++--------- .../DisasterReport/waterMockJson.json | 45 + 8 files changed, 1684 insertions(+), 573 deletions(-) create mode 100644 packages/screen/src/views/DisasterManagement/DisasterDetail/ContinueReport.vue create mode 100644 packages/screen/src/views/DisasterManagement/DisasterDetail/WaterDisasterDetail.vue create mode 100644 packages/screen/src/views/DisasterManagement/DisasterReport/waterMockJson.json diff --git a/packages/mobile/src/views/DisasterManagement/DisasterDetail.vue b/packages/mobile/src/views/DisasterManagement/DisasterDetail.vue index f4fd7d3..a164499 100644 --- a/packages/mobile/src/views/DisasterManagement/DisasterDetail.vue +++ b/packages/mobile/src/views/DisasterManagement/DisasterDetail.vue @@ -6,7 +6,6 @@ @@ -292,8 +237,7 @@ const route = useRoute() // 详情数据(对应 Data 接口) const detailData = ref({ event: null, // Event 对象 - report: null, // Report 对象(首报) - reportList: [], // 续报列表(可选,如果接口返回) + reportList: [], // 填报列表(包含首报和续报) fileList: [], // 附件列表 lossList: [], // 损失列表 occurLocation: '', @@ -302,42 +246,28 @@ const detailData = ref({ routeNo: '' }) -// 首报(优先使用 report,如果没有则从 reportList 中找 reportType === 1) -const firstReport = computed(() => { - if (detailData.value.report) { - return detailData.value.report - } - return detailData.value.reportList?.find(r => r.reportType === 1) -}) - -// 续报列表(reportType === 2) -const continueReports = computed(() => { - return detailData.value.reportList?.filter(r => r.reportType === 2) || [] +const allReports = computed(() => { + const reports = detailData.value.reportList?.map((item, index)=>{ + item.title = index == 0 ? '首报' : ('续报' + index) + return item + }) || [] + return reports.reverse() }) // 是否有填报数据 const hasReportData = computed(() => { - return firstReport.value || continueReports.value.length > 0 + return allReports.value.length > 0 }) -// 判断事件是否已解除(根据实际恢复时间或续报状态判断) -const isEventResolved = computed(() => { - // 如果首报有实际恢复时间且不为空,则认为已解除 - // if (firstReport.value?.actualRecoverTime) { - // return true - // } - // // 检查续报中是否有实际恢复时间 - // return continueReports.value.some(r => r.actualRecoverTime) -}) // 获取事件状态文本 const getEventStatusText = () => { - return isEventResolved.value ? '已解除' : '未解除' + return detailData.eventStatus === 1 ? '已解除' : '未解除' } // 获取事件状态类型 const getEventStatusType = () => { - return isEventResolved.value ? 'success' : 'danger' + return detailData.eventStatus === 1 ? 'success' : 'danger' } // 格式化处置措施(逗号分隔转中文) @@ -396,8 +326,7 @@ const getDisasterDetail = async () => { const data = result.data detailData.value = { event: data.event || null, - report: data.report || null, - reportList: data.reportList || [], + reportList: data.report || [], // 直接使用 reportList,包含首报和续报 fileList: data.fileList || [], lossList: data.lossList || [], occurLocation: data.occurLocation || '', diff --git a/packages/mobile/src/views/DisasterManagement/WaterDisaster/WaterDisaster.vue b/packages/mobile/src/views/DisasterManagement/WaterDisaster/WaterDisaster.vue index 8f51399..cf3e45c 100644 --- a/packages/mobile/src/views/DisasterManagement/WaterDisaster/WaterDisaster.vue +++ b/packages/mobile/src/views/DisasterManagement/WaterDisaster/WaterDisaster.vue @@ -58,7 +58,7 @@ 校准经纬度 - + @@ -71,12 +71,13 @@
处置措施
- - 半幅封闭 - 全副封闭 - 便道通行 - 正常通行 - + + + 半幅封闭 + 全副封闭 + 便道通行 + 正常通行 +
@@ -198,8 +199,8 @@ const route = useRoute() // 是否为续报 const isContinue = computed(() => route.query.isContinue) -// 处置措施数组(用于多选框组,需要转换为逗号分隔的字符串) -const disposalMeasuresArray = ref([]) +// 处置措施单选值(用于单选组件) +const disposalMeasureValue = ref('') // 附件列表 const imageFileList = ref([]) @@ -240,7 +241,7 @@ const formData = reactive({ actualRecoverTime: '', // 实际恢复时间 damagedVehicleCount: '', // 损坏车辆 deadCount: '', // 死亡人员 - disposalMeasures: '', // 处置措施(逗号分隔) + disposalMeasures: '', // 处置措施(单个值,不再用逗号分隔) expectRecoverTime: '', // 预计恢复时间 injuredCount: '', // 受伤人员 investedFunds: '', // 已投资金 @@ -260,14 +261,10 @@ const formData = reactive({ fileList: [] }) -// 监听处置措施数组变化,转换为逗号分隔的字符串存到 report.disposalMeasures -watch( - disposalMeasuresArray, - (newVal) => { - formData.report.disposalMeasures = newVal.join(',') - }, - { deep: true } -) +// 监听处置措施单选值变化,直接赋值给 report.disposalMeasures +watch(disposalMeasureValue, (newVal) => { + formData.report.disposalMeasures = newVal +}) // 监听附件变化,同步到 fileList watch( @@ -313,12 +310,12 @@ watch( { deep: true } ) -// 从 report.disposalMeasures 初始化处置措施数组 +// 从 report.disposalMeasures 初始化处置措施单选值 watch( () => formData.report.disposalMeasures, (newVal) => { if (newVal && typeof newVal === 'string') { - disposalMeasuresArray.value = newVal.split(',').filter(Boolean) + disposalMeasureValue.value = newVal } }, { immediate: true } @@ -368,9 +365,9 @@ const initFormData = (newVal) => { fileList: newVal.fileList || [] }) - // 初始化处置措施数组 + // 初始化处置措施单选值(直接赋值,不再需要 split) if (newVal.report?.disposalMeasures) { - disposalMeasuresArray.value = newVal.report.disposalMeasures.split(',').filter(Boolean) + disposalMeasureValue.value = newVal.report.disposalMeasures } } } @@ -480,12 +477,12 @@ defineExpose({ margin-bottom: 8px; } .measures-options { - :deep(.van-checkbox-group) { + :deep(.van-radio-group) { display: flex; flex-wrap: wrap; gap: 16px; } - :deep(.van-checkbox) { + :deep(.van-radio) { margin-right: 0; } } @@ -526,4 +523,4 @@ defineExpose({ width: 110px; } } - + \ No newline at end of file diff --git a/packages/screen/src/router/index.js b/packages/screen/src/router/index.js index c471ae7..6207d7e 100644 --- a/packages/screen/src/router/index.js +++ b/packages/screen/src/router/index.js @@ -163,7 +163,16 @@ const routes = [ name: 'DisasterReport', component: () => import('../views/DisasterManagement/DisasterReport/DisasterReport.vue'), meta: { - title: '水毁事件填报', + title: '灾毁事件填报', + breadcrumb: true + } + }, + { + path: '/waterDisasterDetail', + name: 'WaterDisasterDetail', + component: () => import('../views/DisasterManagement/DisasterDetail/WaterDisasterDetail.vue'), + meta: { + title: '水毁事件详情', breadcrumb: true } } diff --git a/packages/screen/src/views/DisasterManagement/DisasterDetail/ContinueReport.vue b/packages/screen/src/views/DisasterManagement/DisasterDetail/ContinueReport.vue new file mode 100644 index 0000000..77eb5bd --- /dev/null +++ b/packages/screen/src/views/DisasterManagement/DisasterDetail/ContinueReport.vue @@ -0,0 +1,475 @@ + + + + + diff --git a/packages/screen/src/views/DisasterManagement/DisasterDetail/WaterDisasterDetail.vue b/packages/screen/src/views/DisasterManagement/DisasterDetail/WaterDisasterDetail.vue new file mode 100644 index 0000000..3bb01cd --- /dev/null +++ b/packages/screen/src/views/DisasterManagement/DisasterDetail/WaterDisasterDetail.vue @@ -0,0 +1,618 @@ + + + + + diff --git a/packages/screen/src/views/DisasterManagement/DisasterManagement.vue b/packages/screen/src/views/DisasterManagement/DisasterManagement.vue index c42d1e0..e9d0185 100644 --- a/packages/screen/src/views/DisasterManagement/DisasterManagement.vue +++ b/packages/screen/src/views/DisasterManagement/DisasterManagement.vue @@ -298,12 +298,12 @@ const resetFilters = () => { // 查看详情 const handleDetail = (row) => { - router.push({ path: '/disasterDetail', query: { id: row.id } }) + router.push({ path: '/waterDisasterDetail', query: { id: row.id } }) } // 编辑 const handleEdit = (row) => { - router.push({ path: '/disasterReport', query: { id: row.id, mode: 'edit' } }) + router.push({ path: '/waterDisasterDetail', query: { id: row.id, mode: 'edit' } }) } // 新增跳转 diff --git a/packages/screen/src/views/DisasterManagement/DisasterReport/WaterDisasterReport.vue b/packages/screen/src/views/DisasterManagement/DisasterReport/WaterDisasterReport.vue index 32eab0c..c0ac06a 100644 --- a/packages/screen/src/views/DisasterManagement/DisasterReport/WaterDisasterReport.vue +++ b/packages/screen/src/views/DisasterManagement/DisasterReport/WaterDisasterReport.vue @@ -1,116 +1,112 @@ + - - - - - - + + + + - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + + + 半幅封闭 + 全副封闭 + 便道通行 + 正常通行 + + - - + + + + - - - - - - - - - - - - + + + + + + + + - - + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 万元 + + + + + + + + + + + + + + + 台/班 + + + + + + + + 人次 + + + + + + + + 万元 + + + + + + + @@ -197,9 +348,9 @@ - + - - + + 选择文件 -
仅支持3M以内的视频
+
仅支持20s内的视频,不超过20MB
+
+ +
- + - -
路况事件信息
-
+ - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + - -
道路损失及其他
-
- - - - 立方米 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 公里 - - - - - - - - - - - - - 万元 - - - - - - - - - - -
已投入机械
-
- - - - 台/班 - - - - - - - - - - - - 万元 - - -
-
- - - - - - - - - - - - - - - - - + + + + 万元 @@ -401,118 +425,150 @@ \ No newline at end of file diff --git a/packages/screen/src/views/ProjectManagement_Rebuild/examineDialog.vue b/packages/screen/src/views/ProjectManagement_Rebuild/examineDialog.vue new file mode 100644 index 0000000..16207f9 --- /dev/null +++ b/packages/screen/src/views/ProjectManagement_Rebuild/examineDialog.vue @@ -0,0 +1,289 @@ + + + + + \ No newline at end of file diff --git a/packages/screen/src/views/ProjectManagement_Rebuild/index.js b/packages/screen/src/views/ProjectManagement_Rebuild/index.js index 768ce99..c07a8c8 100644 --- a/packages/screen/src/views/ProjectManagement_Rebuild/index.js +++ b/packages/screen/src/views/ProjectManagement_Rebuild/index.js @@ -1,7 +1,7 @@ import { h, ref, onMounted, reactive, watch, toRaw, nextTick } from "vue"; import { request } from "@/utils/request"; import { useRoute, useRouter } from 'vue-router' -import AddDialog from "./addDialog.vue"; +import ExamineDialog from "./examineDialog.vue"; const tableData = ref([]); // 表格数据 const modelVisible = ref(false); // 弹窗状态 @@ -42,59 +42,63 @@ const drawerRef = ref(null); // 抽屉实例 const columns = [ { - prop: "xxx", + prop: "districtName", label: "区县", }, { - prop: "xxx", + prop: "routeNo", label: "路线编码", }, { - prop: "xxx", + prop: "disasterType", label: "灾害类型", }, { - prop: "xxx", + prop: "startStakeNo", label: "起点桩号", }, { - prop: "xxx", + prop: "endStakeNo", label: "止点桩号", }, { - prop: "xxx", + prop: "implementMileage", label: "实施里程(公里)", }, { - prop: "xxx", + prop: "technicalGrade", label: "技术等级", }, { - prop: "xxx", + prop: "totalInvestment", label: "总投资金额(万元)", }, { - prop: "xxx", + prop: "estimatedCost", label: "投资估算(万元)", }, { - prop: "xxx", + prop: "startTime", label: "开工或预计开工时间", }, { - prop: "xxx", + prop: "endTime", label: "完工或预计完工时间", }, { - prop: "xxx", - label: "申报状态", - }, - { - prop: "xxx", + prop: "approvalStatus", label: "审批状态", + formatter: (row) => { + const statusMap = { + 0: '待审批', + 1: '审批通过', + 2: '审批驳回' + }; + return statusMap[row.approvalStatus] || '未知状态'; + } }, { - prop: "xxx", + prop: "updateTime", label: "更新日期", }, { @@ -130,8 +134,8 @@ const columns = [ // 过滤条件 const filterData = reactive({ - year: "", - code: "", + submitTimeStart: "", + routeNo: "", }) // 分页 const pagination = reactive({ @@ -147,30 +151,33 @@ const pagination = reactive({ }, }); -// 获取预警列表 +// 获取项目列表 const getTableData = async (filterData) => { try { const res = await request({ - url: '', + url: '/snow-ops-platform/recovery/list', method: "GET", params: { - + ...filterData, + submitTimeStart: filterData.submitTimeStart ? filterData.submitTimeStart+`-01-01 00:00:00` : null, + pageNum: pagination.current, + pageSize: pagination.pageSize, } }) } catch (error) { - + console.error('获取项目列表失败:', error); } } -// 打开填报项目弹窗 -const openAddDialog = () => { - model.title = ''; +// 打开审批弹窗 +const openExamineDialog = async () => { + model.title = '项目审批'; Object.assign(form, INIT_FORM); model.props = { form: form, }; - model.content = AddDialog; + model.content = ExamineDialog; model.onCancel = () => { modelVisible.value = false; }; @@ -184,8 +191,10 @@ const openAddDialog = () => { }); }; model.width = "50%" - // model.footerPosition = 'center' - // model.onCancelType = 'null' + model.footerPosition = 'flex-end' + model.onCancelType = 'danger' + model.onConfirmName = '审批通过' + model.onCancelName = '审批驳回' // model.tagType = 'warning' // model.tagContent = '测试' modelVisible.value = true; @@ -193,10 +202,20 @@ const openAddDialog = () => { + + export default () => { const router = useRouter(); + onMounted(() => { + getTableData(); + }) + + + watch(filterData, (val) => { + getTableData(filterData); + }, { deep: true }) return { @@ -211,6 +230,6 @@ export default () => { drawer, dialogRef, drawerRef, - openAddDialog, + openExamineDialog, } } \ No newline at end of file diff --git a/packages/screen/src/views/ProjectManagement_Rebuild/index.vue b/packages/screen/src/views/ProjectManagement_Rebuild/index.vue index 47a1db2..66bc244 100644 --- a/packages/screen/src/views/ProjectManagement_Rebuild/index.vue +++ b/packages/screen/src/views/ProjectManagement_Rebuild/index.vue @@ -1,13 +1,12 @@ + + + + \ No newline at end of file diff --git a/packages/screen/vite.config.js b/packages/screen/vite.config.js index 8962074..b8b414c 100644 --- a/packages/screen/vite.config.js +++ b/packages/screen/vite.config.js @@ -93,8 +93,8 @@ export default defineConfig(({ command, mode }) => { cors: true, proxy: { '/snow-ops-platform': { - target: 'http://192.168.110.16:8661/', - // target: 'http://8.137.54.85:8661/', //测试环境 + // target: 'http://192.168.110.16:8661/', + target: 'http://8.137.54.85:8661/', //测试环境 // target: 'http://192.168.110.36:8661/', //张启生本地环境 changeOrigin: true, }, From 71a66f34b10574943766e79fa3add7d1e9e85d7e Mon Sep 17 00:00:00 2001 From: huangchenhao <123673748@qq.com> Date: Thu, 9 Apr 2026 11:35:50 +0800 Subject: [PATCH 3/5] =?UTF-8?q?feat:=20=E6=81=A2=E5=A4=8D=E9=87=8D?= =?UTF-8?q?=E5=BB=BAapp=20=E9=A1=B9=E7=9B=AE=E5=A1=AB=E6=8A=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/mobile/src/views/Rebuild/Rebuild.vue | 70 +++++----- .../mobile/src/views/Rebuild/RebuildAdd.vue | 126 +++++++++++++----- 2 files changed, 124 insertions(+), 72 deletions(-) diff --git a/packages/mobile/src/views/Rebuild/Rebuild.vue b/packages/mobile/src/views/Rebuild/Rebuild.vue index ce40740..8b2b6f3 100644 --- a/packages/mobile/src/views/Rebuild/Rebuild.vue +++ b/packages/mobile/src/views/Rebuild/Rebuild.vue @@ -5,20 +5,21 @@
-
-
起止桩号:{{ item.stationNumber }}
-
路况位置:{{ item.position }}
-
提交日期:{{ item.publishTime }}
+
起止桩号:{{ `${item.startStakeNo} - + ${item.endStakeNo}`}} +
+
路况位置:{{ item.roadLocation }}
+
提交日期:{{ item.submitTime }}
@@ -44,6 +45,7 @@ import SearchInput from '@/components/SearchInput.vue' import CurrentSite from '@/components/CurrentSite.vue' import CardItem from '@/components/CardItem.vue' import EmptyBox from '@/components/EmptyBox.vue' +import { request } from "../../../../shared/utils/request"; const router = useRouter() @@ -52,44 +54,28 @@ onMounted(() => { }) const getData = async () => { + const params = { + pageNum: 1, + pageSize: 999, + } + if (searchValue.value) { + params.districtName = searchValue.value + } + const res = await request({ + url: '/snow-ops-platform/recovery/list', + method: 'GET', + params + }) + if (res.code === '00000') { + list.value = res.data.records + } } // 搜索关键词 const searchValue = ref('') // 预警列表数据 -const list = ref([ - { - id: 1, - area: '彭水', - rNumber: 'G211', - type: '发生水毁道路崩塌恢复重建', - stationNumber: 'K1674.16-1678.84', - position: '徐家镇村口南分叉路口', - publishTime: '2025-05-20', - status: '审批通过' - }, - { - id: 2, - area: '巴南', - rNumber: 'S303', - type: '道路发生边坡坍塌', - stationNumber: 'K1674.16-1678.84', - position: '徐家镇村口南分叉路口', - publishTime: '2025-05-20', - status: '审批驳回' - }, - { - id: 3, - area: '彭水', - rNumber: 'G211', - type: '道路崩塌改造工程', - stationNumber: 'K1674.16-1678.84', - position: '徐家镇村口南分叉路口', - publishTime: '2025-05-20', - status: '审批通过' - }, -]) +const list = ref([]) const handleClickBack = () => { @@ -115,6 +101,10 @@ const handleAddDevice = () => { // }); } +watch(() => searchValue.value, () => { + getData() +}) + diff --git a/packages/mobile/src/views/Rebuild/RebuildAdd.vue b/packages/mobile/src/views/Rebuild/RebuildAdd.vue index cc0295e..09b0923 100644 --- a/packages/mobile/src/views/Rebuild/RebuildAdd.vue +++ b/packages/mobile/src/views/Rebuild/RebuildAdd.vue @@ -2,34 +2,32 @@
- - + - - - - - + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - 公里 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 半幅封闭 - 全副封闭 - 便道通行 - 正常通行 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 万元 - - - - - - - - - - - - - - - 台/班 - - - - - - - - 人次 - - - - - - - - 万元 - - - - - - - - - - - - - - - - - - - - - - -
只能上传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({