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

View File

@ -11,7 +11,7 @@ import {
syncFreeApi,
delFreeApi
} 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 { useEmitt } from '@/hooks/web/useEmitt'
const dialogVisible = ref(false)
@ -141,13 +141,19 @@ const checkFree = () => {
message: h('div', { class: 'free-sync-tip-box' }, childrenDomList),
showClose: false,
cancelButtonText: '删除',
confirmButtonText: '同步'
})
.then(() => {
cancelButtonClass: 'free-cancel-bt',
showCancelButton: false,
preButtonType: 'danger',
preButtonText: '删除',
showPreButton: true,
confirmButtonText: '同步',
callback: (action: Action) => {
if (action === 'confirm') {
syncFree()
})
.catch(() => {
delFree()
} else {
delFree
}
}
})
}
})

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