diff options
| author | zhangyu <[email protected]> | 2023-11-01 11:36:29 +0800 |
|---|---|---|
| committer | zhangyu <[email protected]> | 2023-11-01 11:36:29 +0800 |
| commit | 37d2790627be89800356f33e807771bcb5a6e0e1 (patch) | |
| tree | c6c2eb30789576cee9a381bd47580cd760e56c98 | |
| parent | 483368e7d68b913a2ae6354ffbdb4fba6323655f (diff) | |
| parent | 9e0ef56d8dd3955c32abc5a37ce9d06d4397b852 (diff) | |
Merge branch 'dev-3.8' of https://git.mesalab.cn/nezha/nezha-fronted into dev-3.9
| -rw-r--r-- | nezha-fronted/src/components/chart/chart/chartTable.vue | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/nezha-fronted/src/components/chart/chart/chartTable.vue b/nezha-fronted/src/components/chart/chart/chartTable.vue index a6443d456..1269e103e 100644 --- a/nezha-fronted/src/components/chart/chart/chartTable.vue +++ b/nezha-fronted/src/components/chart/chart/chartTable.vue @@ -303,6 +303,7 @@ export default { oldValue: '' } const display = this.globalVariablesReplace(column.display) + console.log(column, display, /\{\{.+\}\}/.test(display), params) if (/\{\{.+\}\}/.test(display)) { const labelValue = display.replace(/(\{\{.+?\}\})/g, function (i) { const label = i.substr(i.indexOf('{{') + 2, i.indexOf('}}') - i.indexOf('{{') - 2) @@ -312,7 +313,8 @@ export default { if (label.indexOf('$value') !== -1) { value = chartDataFormat.getUnit(column.unit ? column.unit : 2).compute(value, null, -1, 2) } - if (!((typeof value) == 'string' && value.constructor == String)) { + console.log(value) + if (!((typeof value) == 'string' && value.constructor == String) && isNaN(value)) { let legend = '' if (value.__name__) { legend += `${value.__name__}{` @@ -339,7 +341,7 @@ export default { let value = null if (lodash.get(params, label)) { value = lodash.get(params, label) - if (!((typeof value) == 'string' && value.constructor == String)) { + if (!((typeof value) == 'string' && value.constructor == String) && isNaN(value)) { let legend = '' if (value.__name__) { legend += `${value.__name__}{` @@ -361,6 +363,7 @@ export default { } return value || '' }) + console.log(labelValue) obj[column.title + 'display'] = { display: labelValue, oldValue: oldLabelValue @@ -394,7 +397,7 @@ export default { if (label.indexOf('$value') !== -1) { value = chartDataFormat.getUnit(col.unit ? col.unit : 2).compute(value, null, -1, 2) } - if (!((typeof value) == 'string' && value.constructor == String)) { + if (!((typeof value) == 'string' && value.constructor == String) && isNaN(value)) { let legend = '' if (value.__name__) { legend += `${value.__name__}{` |
