perf: 同步游离资源

This commit is contained in:
fit2cloud-chenyw 2024-01-18 12:13:11 +08:00
parent 2b18180dd9
commit 7c117335ff
3 changed files with 18 additions and 12 deletions

View File

@ -44,7 +44,7 @@ public class ResourceMonitorManage {
if (CollectionUtils.isNotEmpty(dsFreeResources)) { if (CollectionUtils.isNotEmpty(dsFreeResources)) {
List<PerMonitorNodeBO> dsBos = dsFreeResources.stream().map(node -> { List<PerMonitorNodeBO> dsBos = dsFreeResources.stream().map(node -> {
PerMonitorNodeBO bo = BeanUtils.copyBean(new PerMonitorNodeBO(), node); PerMonitorNodeBO bo = BeanUtils.copyBean(new PerMonitorNodeBO(), node);
bo.setLeaf(StringUtils.equals("folder", node.getType())); bo.setLeaf(!StringUtils.equals("folder", node.getType()));
return bo; return bo;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
List<PerMonitorNodeBO> dsTree = TreeUtils.mergeTree(dsBos, PerMonitorNodeBO.class, false); List<PerMonitorNodeBO> dsTree = TreeUtils.mergeTree(dsBos, PerMonitorNodeBO.class, false);
@ -55,7 +55,7 @@ public class ResourceMonitorManage {
if (CollectionUtils.isNotEmpty(datasetFreeResources)) { if (CollectionUtils.isNotEmpty(datasetFreeResources)) {
List<PerMonitorNodeBO> datasetBos = datasetFreeResources.stream().map(node -> { List<PerMonitorNodeBO> datasetBos = datasetFreeResources.stream().map(node -> {
PerMonitorNodeBO bo = BeanUtils.copyBean(new PerMonitorNodeBO(), node); PerMonitorNodeBO bo = BeanUtils.copyBean(new PerMonitorNodeBO(), node);
bo.setLeaf(StringUtils.equals("folder", node.getNodeType())); bo.setLeaf(!StringUtils.equals("folder", node.getNodeType()));
return bo; return bo;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
List<PerMonitorNodeBO> datasetTree = TreeUtils.mergeTree(datasetBos, PerMonitorNodeBO.class, false); List<PerMonitorNodeBO> datasetTree = TreeUtils.mergeTree(datasetBos, PerMonitorNodeBO.class, false);
@ -69,7 +69,7 @@ public class ResourceMonitorManage {
List<VisualFreeResource> freeResource = entry.getValue(); List<VisualFreeResource> freeResource = entry.getValue();
List<PerMonitorNodeBO> visualBos = freeResource.stream().map(node -> { List<PerMonitorNodeBO> visualBos = freeResource.stream().map(node -> {
PerMonitorNodeBO bo = BeanUtils.copyBean(new PerMonitorNodeBO(), node); PerMonitorNodeBO bo = BeanUtils.copyBean(new PerMonitorNodeBO(), node);
bo.setLeaf(StringUtils.equals("folder", node.getNodeType())); bo.setLeaf(!StringUtils.equals("folder", node.getNodeType()));
return bo; return bo;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
result.put(convertBusiFlag(entry.getKey()), TreeUtils.mergeTree(visualBos, PerMonitorNodeBO.class, false)); result.put(convertBusiFlag(entry.getKey()), TreeUtils.mergeTree(visualBos, PerMonitorNodeBO.class, false));

View File

@ -11,7 +11,7 @@ import {
syncFreeApi, syncFreeApi,
delFreeApi delFreeApi
} from '@/api/about' } from '@/api/about'
import { ElMessage, ElMessageBox } from 'element-plus-secondary' import { ElMessage, ElMessageBox, Action } from 'element-plus-secondary'
import { useI18n } from '@/hooks/web/useI18n' import { useI18n } from '@/hooks/web/useI18n'
import { useEmitt } from '@/hooks/web/useEmitt' import { useEmitt } from '@/hooks/web/useEmitt'
const dialogVisible = ref(false) const dialogVisible = ref(false)
@ -141,14 +141,20 @@ const checkFree = () => {
message: h('div', { class: 'free-sync-tip-box' }, childrenDomList), message: h('div', { class: 'free-sync-tip-box' }, childrenDomList),
showClose: false, showClose: false,
cancelButtonText: '删除', cancelButtonText: '删除',
confirmButtonText: '同步' cancelButtonClass: 'free-cancel-bt',
showCancelButton: false,
preButtonType: 'danger',
preButtonText: '删除',
showPreButton: true,
confirmButtonText: '同步',
callback: (action: Action) => {
if (action === 'confirm') {
syncFree()
} else {
delFree
}
}
}) })
.then(() => {
syncFree()
})
.catch(() => {
delFree()
})
} }
}) })
} }

@ -1 +1 @@
Subproject commit e71e6152874ed49933d3befeee6ea2c9310a94f4 Subproject commit 2012e4fb3c3169330cc70b09e4e77d144b22031b