diff --git a/packages/screen/src/assets/RiskWarning_img/弹窗背景@2x.png b/packages/screen/src/assets/RiskWarning_img/弹窗背景@2x.png new file mode 100644 index 0000000..75cd57c Binary files /dev/null and b/packages/screen/src/assets/RiskWarning_img/弹窗背景@2x.png differ 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 @@ + + + + + {{ title }} + + + + + + + + + + + diff --git a/packages/screen/src/component/FileUpload/FileUpload.vue b/packages/screen/src/component/FileUpload/FileUpload.vue new file mode 100644 index 0000000..6916ee0 --- /dev/null +++ b/packages/screen/src/component/FileUpload/FileUpload.vue @@ -0,0 +1,58 @@ + + + + + + + + + + + diff --git a/packages/screen/src/component/FileUpload/PreviewBlock.vue b/packages/screen/src/component/FileUpload/PreviewBlock.vue new file mode 100644 index 0000000..a9ab090 --- /dev/null +++ b/packages/screen/src/component/FileUpload/PreviewBlock.vue @@ -0,0 +1,237 @@ + + + + + + + + + + + + + + + + + + + + + + + + {{ file.fileName }} + {{ formatFileSize(file.fileSize) }} + + + + + + + + + + + + + + \ No newline at end of file diff --git a/packages/screen/src/component/FileUpload/UploadBlock.vue b/packages/screen/src/component/FileUpload/UploadBlock.vue new file mode 100644 index 0000000..3050491 --- /dev/null +++ b/packages/screen/src/component/FileUpload/UploadBlock.vue @@ -0,0 +1,141 @@ + + + + + 选择文件 + + + + + + + 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..e5837d5 100644 --- a/packages/screen/src/views/DisasterManagement/DisasterReport/WaterDisasterReport.vue +++ b/packages/screen/src/views/DisasterManagement/DisasterReport/WaterDisasterReport.vue @@ -9,405 +9,345 @@ - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 处 + + + + + + + + + + + + 公里 + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + K + + + + + + + + K + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - 处 - - - - - - - - 公里 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + - - - - - 位置信息 - - + + + + + + + + + 人 + + + + - - - - - - - + + + + + + 人 + + + + - - - - - - + + + + + + 人 + + + + - - - - - - + + + + + + 辆 + + + + - - - - - - + + + + + + 辆 + + + + + + + + - - - - - - + + + + + + + 台/班 + + + + - - - - - - + + + + + + 人次 + + + + - - - - - - + + + + + + 万元 + + + + - - - - - - - - + + + + + + + + + + + + + + + + + + + - - - - - 处置情况 - - - - - - - - - 半幅封闭 - 全副封闭 - 便道通行 - 正常通行 - - - - - - - - - - - - - - - - - - - - - - - - - 人员车辆 - - - - - - - - - 人 - - - - - - - - 人 - - - - - - - - 人 - - - - - - - - 辆 - - - - - - - - 辆 - - - - - - - - - - 灾毁损失 - - - - - - - - - - - - - - - - - - - - - 万元 - - - - - - - - - - 投入资源 - - - - - - - - - 台/班 - - - - - - - - 人次 - - - - - - - - 万元 - - - - - - - - - - - - - - - - - 附件上传 - - - - - - - - - - 只能上传jpg/png格式,且不超过500kb - - - - - - 选择文件 - - 仅支持20s内的视频,不超过20MB - - - - - - - - - - - - - 恢复重建 - - - - - - - - - - - - - - - - - - - 万元 - - - + + + + + + 万元 + + + + + + @@ -431,7 +371,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 FileUpload from '@/component/FileUpload/FileUpload.vue' const router = useRouter() const route = useRoute() @@ -448,52 +390,53 @@ const disposalMeasuresArray = ref([]) const imageFileList = ref([]) const videoFileList = ref([]) -// 表单数据 - 按 H5 Request 接口结构定义 +const eventType = ref('水毁事件') + 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 +450,7 @@ const formData = reactive({ watch( disposalMeasuresArray, (newVal) => { - formData.report.disposalMeasures = newVal.join(',') + formData.report.disposalMeasures = newVal.length ? newVal.join(',') : null }, { deep: true } ) @@ -515,7 +458,7 @@ watch( // 监听图片附件变化,同步到 fileList watch( imageFileList, - (newVal) => { + () => { syncFileList() }, { deep: true } @@ -524,7 +467,7 @@ watch( // 监听视频附件变化,同步到 fileList watch( videoFileList, - (newVal) => { + () => { syncFileList() }, { deep: true } @@ -554,6 +497,8 @@ watch( (newVal) => { if (newVal && typeof newVal === 'string') { disposalMeasuresArray.value = newVal.split(',').filter(Boolean) + } else { + disposalMeasuresArray.value = [] } }, { immediate: true } @@ -640,7 +585,7 @@ const validate = async () => { // 提交表单 const handleSubmit = async () => { // 验证表单 - if (!validate()) { + if (!(await validate())) { return } @@ -680,7 +625,12 @@ const handleSubmit = async () => { // 加载编辑数据 const loadEditData = async () => { - initFormData(mockData) + + if(route.query.mock) { + initFormData(mockData) + } else { + initFormData({}) + } } onMounted(() => { @@ -697,7 +647,6 @@ defineExpose({