|
|
|
@ -525,18 +525,29 @@ Page({ |
|
|
|
if (!field) continue; |
|
|
|
|
|
|
|
if (typeof field === 'string') { |
|
|
|
console.log('检查字符串字段:', field, '是否包含', weightNum); |
|
|
|
if (field.includes(weightNum)) { |
|
|
|
hasMatchingSpec = true; |
|
|
|
break; |
|
|
|
} |
|
|
|
} else if (Array.isArray(field)) { |
|
|
|
console.log('检查数组字段:', field); |
|
|
|
if (field.some(spec => { |
|
|
|
const specStr = typeof spec === 'string' ? spec : (spec.weightSpec || spec.display || ''); |
|
|
|
const specStr = typeof spec === 'string' ? spec : (spec.weightSpec || spec.display || spec.spec || ''); |
|
|
|
console.log('检查数组元素:', specStr, '是否包含', weightNum); |
|
|
|
return specStr.includes(weightNum); |
|
|
|
})) { |
|
|
|
hasMatchingSpec = true; |
|
|
|
break; |
|
|
|
} |
|
|
|
} else if (typeof field === 'object') { |
|
|
|
console.log('检查对象字段:', field); |
|
|
|
const specStr = field.weightSpec || field.display || field.spec || ''; |
|
|
|
console.log('检查对象字段值:', specStr, '是否包含', weightNum); |
|
|
|
if (specStr.includes(weightNum)) { |
|
|
|
hasMatchingSpec = true; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|