feat: 添加table类型

This commit is contained in:
zhangyu
2021-12-15 17:55:56 +08:00
parent 32398c5bc4
commit 5c540b767c
10 changed files with 189 additions and 23 deletions

View File

@@ -830,6 +830,16 @@ export function getMetricTypeValue (queryItem, type) {
const total = eval(copy.join('+'))
return total
}
case 'range': {
const min = copy.sort((x, y) => { return parseFloat(x[1]) - parseFloat(y[1]) })[0][1]
const max = copy.sort((x, y) => { return parseFloat(y[1]) - parseFloat(x[1]) })[0][1]
return max - min
}
case 'different': {
const last = copy.sort((x, y) => { return parseFloat(y[0]) - parseFloat(x[0]) })[0][1]
const first = copy.sort((x, y) => { return parseFloat(y[0]) - parseFloat(x[0]) })[copy.length - 1][1]
return last - first
}
}
}