diff --git a/orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/service/impl/DataGroupRelServiceImpl.java b/orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/service/impl/DataGroupRelServiceImpl.java index 6e30e4f4..08956199 100644 --- a/orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/service/impl/DataGroupRelServiceImpl.java +++ b/orion-ops-module-infra/orion-ops-module-infra-service/src/main/java/com/orion/ops/module/infra/service/impl/DataGroupRelServiceImpl.java @@ -256,18 +256,27 @@ public class DataGroupRelServiceImpl implements DataGroupRelService { if (Strings.isBlank(type) || Lists.isEmpty(relIdList)) { return 0; } - // 查询 group - List groupIdList = dataGroupRelDAO.of() + // 查询需要删除的数据 + List rows = dataGroupRelDAO.of() .createWrapper() .eq(DataGroupRelDO::getType, type) .in(DataGroupRelDO::getRelId, relIdList) .then() - .stream() + .list(); + if (rows.isEmpty()) { + return 0; + } + // 需要删除的 id + List idList = rows.stream() + .map(DataGroupRelDO::getId) + .collect(Collectors.toList()); + // 需要删除的 groupId + List groupIdList = rows.stream() .map(DataGroupRelDO::getGroupId) .distinct() .collect(Collectors.toList()); // 删除数据库 - int effect = dataGroupRelDAO.deleteBatchIds(relIdList); + int effect = dataGroupRelDAO.deleteBatchIds(idList); // 删除缓存 this.deleteCache(type, groupIdList); return effect; diff --git a/orion-ops-ui/src/components/asset/host-group/host-group-tree-selector.vue b/orion-ops-ui/src/components/asset/host-group/host-group-tree-selector.vue new file mode 100644 index 00000000..62ad26f5 --- /dev/null +++ b/orion-ops-ui/src/components/asset/host-group/host-group-tree-selector.vue @@ -0,0 +1,62 @@ + + + + + + + diff --git a/orion-ops-ui/src/components/asset/host-identity/host-identity-selector.vue b/orion-ops-ui/src/components/asset/host-identity/host-identity-selector.vue index a8302287..bf0ce623 100644 --- a/orion-ops-ui/src/components/asset/host-identity/host-identity-selector.vue +++ b/orion-ops-ui/src/components/asset/host-identity/host-identity-selector.vue @@ -1,6 +1,6 @@ @@ -13,7 +13,7 @@