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) => {
|
const calcData = (view: Chart, callback) => {
|
||||||
isError.value = false
|
isError.value = false
|
||||||
updateEmptyValue(view)
|
updateEmptyValue(view)
|
||||||
if (view.tableId || view['dataFrom'] === 'template') {
|
if (view.tableId || view['dataFrom'] === 'template') {
|
||||||
const v = JSON.parse(JSON.stringify(view))
|
const v = JSON.parse(JSON.stringify(view))
|
||||||
v.resultCount = 1
|
if (!checkCompareCalc(view)) {
|
||||||
v.resultMode = 'custom'
|
v.resultCount = 1
|
||||||
|
v.resultMode = 'custom'
|
||||||
|
}
|
||||||
getData(v)
|
getData(v)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
if (res.code && res.code !== 0) {
|
if (res.code && res.code !== 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user