mirror of
https://github.com/dataease/dataease.git
synced 2025-02-24 11:32:57 +08:00
refactor(图表): 富文本支持同环比,优化富文本返回数据性能
This commit is contained in:
parent
d7ad7ac873
commit
5571fae31b
@ -535,13 +535,25 @@ const updateEmptyValue = view => {
|
||||
: '-'
|
||||
}
|
||||
|
||||
const checkCompareCalc = view => {
|
||||
let compareCount = 0
|
||||
view.yAxis?.forEach(item => {
|
||||
if (item?.compareCalc?.type !== 'none') {
|
||||
compareCount++
|
||||
}
|
||||
})
|
||||
return compareCount > 0
|
||||
}
|
||||
|
||||
const calcData = (view: Chart, callback) => {
|
||||
isError.value = false
|
||||
updateEmptyValue(view)
|
||||
if (view.tableId || view['dataFrom'] === 'template') {
|
||||
const v = JSON.parse(JSON.stringify(view))
|
||||
if (!checkCompareCalc(view)) {
|
||||
v.resultCount = 1
|
||||
v.resultMode = 'custom'
|
||||
}
|
||||
getData(v)
|
||||
.then(res => {
|
||||
if (res.code && res.code !== 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user