andon区域下拉

This commit is contained in:
quowingwang
2025-12-21 15:02:05 +08:00
parent 4c7ef6c741
commit c4a9c0ea3d
5 changed files with 44 additions and 28 deletions

View File

@@ -76,31 +76,36 @@ namespace ZR.Service.mes.andon
return Update(model, true);
}
public ApiResult GetPullDown()
public ApiResult GetPullDownP()
{
var response = Queryable()
.Where(a => a.ParentId == null || a.ParentId == 0)
.Select(a => new AlarmAreaPullDownDto
{
label = a.Area,
value = a.Id,
children = new List<AlarmAreaPullDown2Dto>()
})
.ToList();
foreach (var item in response)
{
item.children = Queryable()
.Where(a => a.ParentId == item.value)
.Select(a => new AlarmAreaPullDown2Dto
{
label = a.Area,
value = a.Id,
})
.ToList();
}
value = a.Id
}).ToList();
return ApiResult.Success("成功", response);
}
public ApiResult GetPullDownByPID(AlarmAreaPullDownDto parm)
{
if (parm != null)
{
var response = Queryable()
.Where(a => a.ParentId == parm.value)
.Select(a => new AlarmAreaPullDownDto
{
label = a.Area,
value = a.Id
}).ToList();
return ApiResult.Success("成功", response);
}
else
{
return ApiResult.Error("参数错误");
}
}
}
}

View File

@@ -19,6 +19,7 @@ namespace ZR.Service.mes.andon.Iservice {
AndonAlarmArea AddAndonAlarmArea(AndonAlarmArea parm);
int UpdateAndonAlarmArea(AndonAlarmArea parm);
ApiResult GetPullDown();
ApiResult GetPullDownP();
ApiResult GetPullDownByPID(AlarmAreaPullDownDto parm);
}
}