Compare commits

...

2 Commits

Author SHA1 Message Date
1260d288a2 点检方案树的删除闲置功能 2024-11-11 15:59:39 +08:00
30f9e6aa85 设备详情标题修改 2024-11-11 14:25:54 +08:00
6 changed files with 43 additions and 4 deletions

View File

@ -119,4 +119,9 @@ public class InspectionPlanController {
BeanUtils.toBean(list, InspectionPlanRespVO.class)); BeanUtils.toBean(list, InspectionPlanRespVO.class));
} }
@GetMapping("/hasChild")
@Operation(summary = "是否有子节点")
public CommonResult<Boolean> hasInspectionPlan(@RequestParam("id") Long id) {
return success(inspectionPlanService.hasChildInspectionPlan(id));
}
} }

View File

@ -77,4 +77,9 @@ public interface InspectionPlanService {
* @return java.util.List<com.inspur.module.system.dal.dataobject.inspection.InspectionPlanDO> * @return java.util.List<com.inspur.module.system.dal.dataobject.inspection.InspectionPlanDO>
*/ */
List<InspectionPlanDO> getInspectionPlanHaveFeedbackList(InspectionPlanListReqVO reqVO); List<InspectionPlanDO> getInspectionPlanHaveFeedbackList(InspectionPlanListReqVO reqVO);
/**
* 是否有子节点
*/
Boolean hasChildInspectionPlan(Long id);
} }

View File

@ -127,4 +127,15 @@ public class InspectionPlanServiceImpl implements InspectionPlanService {
} }
return inspectionPlanDOS; return inspectionPlanDOS;
} }
@Override
/**
* 是否有子节点
*/
public Boolean hasChildInspectionPlan(Long id){
QueryWrapper<InspectionPlanDO> queryWrapper = new QueryWrapper<>();
queryWrapper.apply("find_in_set("+id+",ancestors)")
.eq("deleted",0);
return inspectionPlanMapper.selectCount(queryWrapper) > 0;
}
} }

View File

@ -77,3 +77,11 @@ export function getInspectionPlanListHaveFeedback(params) {
params, params,
}); });
} }
//是否有子节点
export function hasInspectionPlanChild(id) {
return request({
url: "/imt/inspection-plan/hasChild?id=" + id,
method: "get",
});
}

View File

@ -109,7 +109,7 @@
</div> </div>
<div> <div>
<div class="item-title"> <div class="item-title">
<div class="title"><span style="margin-left:3%">设备运行情况</span> <div class="title"><span style="margin-left:3%">设备报警</span>
</div> </div>
<div class="underline"></div> <div class="underline"></div>
</div> </div>

View File

@ -257,9 +257,19 @@ export default {
'是否确认删除点检方案编号为"' + inspectionPlanId + '"的数据项?' '是否确认删除点检方案编号为"' + inspectionPlanId + '"的数据项?'
); );
try { try {
await InspectionPlanApi.deleteInspectionPlan(inspectionPlanId); const hasChildRes = await InspectionPlanApi.hasInspectionPlanChild(
await this.getList(); inspectionPlanId
this.$modal.msgSuccess("删除成功"); );
if (hasChildRes.data) {
this.$message({
message: "该节点存在子节点,请先删除子节点!",
type: "warning",
});
} else {
await InspectionPlanApi.deleteInspectionPlan(inspectionPlanId);
await this.getList();
this.$modal.msgSuccess("删除成功");
}
} catch {} } catch {}
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */