perf: 优化资产列表控制台报错问题

This commit is contained in:
“huailei000”
2023-03-01 16:03:32 +08:00
committed by Jiangjie.Bai
parent acfdb04b09
commit 477fd5164e

View File

@@ -43,7 +43,8 @@ export default {
},
items() {
const cellValue = { ...this.cellValue }
cellValue['memory'] = (this.cellValue['memory'] / 1 || 0).toFixed(2)
const memory = this.cellValue?.memory
cellValue['memory'] = memory ? (memory / 1 || 0).toFixed(2) : '-'
return cellValue
},
viewText() {
@@ -65,8 +66,8 @@ export default {
async optionAndGenFields() {
const data = await this.$store.dispatch('common/getUrlMeta', { url: this.url })
const remoteMeta = data.actions['GET'] || {}
const fieldName = this.formatterArgs.fieldName
const remoteMetaFields = remoteMeta[fieldName].children
const fieldName = this.formatterArgs?.fieldName || ''
const remoteMetaFields = remoteMeta[fieldName]?.children || {}
const fields = Object.keys(remoteMetaFields)
const info = {}
for (const name of fields) {