forked from github/dataease
Merge pull request #11683 from dataease/pr@dev-v2@perf_threshold
perf(X-Pack): 阈值告警跟随视图删除
This commit is contained in:
commit
af9aca15ac
@ -754,16 +754,22 @@ public class ChartDataManage {
|
||||
|
||||
public void saveChartViewFromVisualization(String checkData, Long sceneId, Map<Long, ChartViewDTO> chartViewsInfo) {
|
||||
if (!MapUtils.isEmpty(chartViewsInfo)) {
|
||||
List<Long> disuseChartIdList = new ArrayList<>();
|
||||
chartViewsInfo.forEach((key, chartViewDTO) -> {
|
||||
if (checkData.indexOf(chartViewDTO.getId() + "") > -1) {
|
||||
if (checkData.contains(chartViewDTO.getId() + "")) {
|
||||
try {
|
||||
chartViewDTO.setSceneId(sceneId);
|
||||
chartViewManege.save(chartViewDTO);
|
||||
} catch (Exception e) {
|
||||
DEException.throwException(e);
|
||||
}
|
||||
} else {
|
||||
disuseChartIdList.add(chartViewDTO.getId());
|
||||
}
|
||||
});
|
||||
if (CollectionUtils.isNotEmpty(disuseChartIdList)) {
|
||||
chartViewManege.disuse(disuseChartIdList);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -26,6 +26,7 @@ import io.dataease.extensions.datasource.model.SQLObj;
|
||||
import io.dataease.extensions.view.dto.*;
|
||||
import io.dataease.extensions.view.filter.FilterTreeObj;
|
||||
import io.dataease.i18n.Translator;
|
||||
import io.dataease.license.config.XpackInteract;
|
||||
import io.dataease.utils.BeanUtils;
|
||||
import io.dataease.utils.IDUtils;
|
||||
import io.dataease.utils.JsonUtil;
|
||||
@ -98,6 +99,9 @@ public class ChartViewManege {
|
||||
coreChartViewMapper.deleteById(id);
|
||||
}
|
||||
|
||||
@XpackInteract(value = "chartViewManage")
|
||||
public void disuse(List<Long> chartIdList) {}
|
||||
|
||||
@Transactional
|
||||
public void deleteBySceneId(Long sceneId, List<Long> chartIds) {
|
||||
QueryWrapper<CoreChartView> wrapper = new QueryWrapper<>();
|
||||
|
@ -2788,6 +2788,8 @@ export default {
|
||||
name: '告警名称',
|
||||
grid_title: '告警管理',
|
||||
grid: '告警列表',
|
||||
record: '告警记录'
|
||||
record: '告警记录',
|
||||
module_name: '阈值告警',
|
||||
setting: '阈值告警设置'
|
||||
}
|
||||
}
|
||||
|
@ -20,6 +20,7 @@ import { storeToRefs } from 'pinia'
|
||||
import { BASE_VIEW_CONFIG } from '../util/chart'
|
||||
import { cloneDeep, defaultsDeep } from 'lodash-es'
|
||||
import BubbleAnimateCfg from '@/views/chart/components/editor/editor-senior/components/BubbleAnimateCfg.vue'
|
||||
import { XpackComponent } from '@/components/plugin'
|
||||
const dvMainStore = dvMainStoreWithOut()
|
||||
|
||||
const { nowPanelTrackInfo, nowPanelJumpInfo, dvInfo, componentData } = storeToRefs(dvMainStore)
|
||||
@ -282,6 +283,13 @@ const isDataEaseBi = computed(() => appStore.getIsDataEaseBi)
|
||||
/>
|
||||
</collapse-switch-item>
|
||||
|
||||
<xpack-component
|
||||
v-if="chart.id"
|
||||
:chart="chart"
|
||||
:themes="themes"
|
||||
jsname="L2NvbXBvbmVudC90aHJlc2hvbGQtd2FybmluZy9TZW5pb3JIYW5kbGVy"
|
||||
/>
|
||||
|
||||
<collapse-switch-item
|
||||
v-if="showProperties('linkage')"
|
||||
:themes="themes"
|
||||
|
2
de-xpack
2
de-xpack
@ -1 +1 @@
|
||||
Subproject commit 43b6ff1f0d11c1920e79ce082f35182a73fa17c2
|
||||
Subproject commit 902de4d87eb7e93ab0e3fc6263f4007fb888e9fb
|
@ -66,4 +66,8 @@ public interface ThresholdApi {
|
||||
@Operation(summary = "预览信息")
|
||||
@PostMapping("/preview")
|
||||
String preview(@RequestBody ThresholdPreviewRequest request);
|
||||
|
||||
@Operation(summary = "视图是否设置了阈值告警")
|
||||
@GetMapping("/anyThreshold/{chartId}")
|
||||
boolean anyThreshold(@PathVariable("chartId") Long chartId);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user