From 4669fa5b9dfd28e9e006b99bdca54716b8f3b6a1 Mon Sep 17 00:00:00 2001 From: limengnan <420004014@qq.com> Date: Thu, 9 Jul 2026 18:13:31 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=B6=E9=97=B4=E6=AE=B5=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E9=9D=9E=E7=A9=BA=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/component/scenario/condition.vue | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/business-css/frontend/src/views/component/scenario/condition.vue b/business-css/frontend/src/views/component/scenario/condition.vue index f0a7b2e..b9b17e4 100644 --- a/business-css/frontend/src/views/component/scenario/condition.vue +++ b/business-css/frontend/src/views/component/scenario/condition.vue @@ -386,7 +386,26 @@ const errortitle:any = ref('') // 错误标题 // 遍历每个分段 segments.forEach((segment:any, index:any) => { const timeline = segment.timeline; + for(let i = 0; i < timeline.length; i++){ + if(timeline[i].t == null || timeline[i].t == ""){ + errors.push({ + type: '时间不能为空', + segmentId: segment.segmentId, + index: index, + message: `${segment.segmentId}第${i+1}行时间不能为空` + }); + } + if(timeline[i].value == null || timeline[i].value == ""){ + errors.push({ + type: '数值不能为空', + segmentId: segment.segmentId, + index: index, + message: `${segment.segmentId}第${i+1}行数值不能为空` + }); + } + } const tValues = timeline.map((item:any) => item.t); + // === 1. 检查同一分段内 t 值是否递增 === for (let i = 1; i < timeline.length; i++) { if (timeline[i].t <= timeline[i - 1].t) { @@ -399,6 +418,7 @@ const errortitle:any = ref('') // 错误标题 }); } } + // === 2. 检查是否有重复的 t 值 === const duplicateMap = new Map();