修复异常不良管理设备类别空值报错
Some checks are pending
Release pipeline / Always run job (push) Waiting to run
Release pipeline / publish (push) Waiting to run

This commit is contained in:
sheng
2026-06-26 17:56:36 +08:00
parent bff5c09118
commit 81bed61caf

View File

@@ -316,11 +316,12 @@ export default {
return { list: [], total: 0 } return { list: [], total: 0 }
}, },
normalizeRow (row) { normalizeRow (row) {
const deviceCategory = typeof row.DeviceCategory === 'object' const isObject = value => value && typeof value === 'object'
const deviceCategory = isObject(row.DeviceCategory)
? row.DeviceCategory ? row.DeviceCategory
: (typeof row.device_category === 'object' : (isObject(row.device_category)
? row.device_category ? row.device_category
: (typeof row.category === 'object' ? row.category : {})) : (isObject(row.category) ? row.category : {}))
const option = this.deviceCategoryOptions.find(item => String(item.value) === String(row.device_category_id || deviceCategory.id || '')) const option = this.deviceCategoryOptions.find(item => String(item.value) === String(row.device_category_id || deviceCategory.id || ''))
return { return {
...row, ...row,