|
@@ -1347,6 +1347,24 @@ const validateTableData = (): boolean => {
|
|
|
if (shouldBreak) return;
|
|
|
const rowNumber = index + 1 // 用户可见的行号从1开始
|
|
|
const deviceIdentifier = `${row.deviceCode}-${row.name}` // 设备标识
|
|
|
+
|
|
|
+ // 累计参数校验逻辑
|
|
|
+ if (row.mileageRule === 0 &&
|
|
|
+ row.mileageAccumulatedAttrs?.length &&
|
|
|
+ !row.totalMileage &&
|
|
|
+ !row.type) {
|
|
|
+ errorMessages.push(`第 ${rowNumber} 行(${deviceIdentifier}):请选择累计运行公里数参数`)
|
|
|
+ isValid = false
|
|
|
+ }
|
|
|
+
|
|
|
+ if (row.runningTimeRule === 0 &&
|
|
|
+ row.timeAccumulatedAttrs?.length &&
|
|
|
+ !row.totalRunTime &&
|
|
|
+ !row.code) {
|
|
|
+ errorMessages.push(`第 ${rowNumber} 行(${deviceIdentifier}):请选择累计运行时长参数`)
|
|
|
+ isValid = false
|
|
|
+ }
|
|
|
+
|
|
|
// 校验逻辑
|
|
|
const checkConfig = (ruleName: string, ruleValue: number, configField: keyof typeof row) => {
|
|
|
if (ruleValue === 0) { // 规则开启
|