perf: 优化公共接口更新数据的逻辑

This commit is contained in:
奔跑的面条 2023-12-16 21:43:45 +08:00
parent 3e641e4bab
commit 78c63298d7

View File

@ -119,7 +119,10 @@ export const useChartDataFetch = (
if (isPreview()) {
targetComponent.request.requestDataType === RequestDataTypeEnum.Pond
? addGlobalDataInterface(targetComponent, useChartEditStore, updateCallback || echartsUpdateHandle)
? addGlobalDataInterface(targetComponent, useChartEditStore, (newData: any) => {
echartsUpdateHandle(newData)
if (updateCallback) updateCallback(newData)
})
: requestIntervalFn()
} else {
requestIntervalFn()