区域下拉

This commit is contained in:
quowingwang
2025-12-20 14:30:04 +08:00
parent b87ee906c7
commit 0a24cca79b
13 changed files with 160 additions and 63 deletions

View File

@@ -1,4 +1,5 @@
using Infrastructure.Attribute;
using Infrastructure.Model;
using SqlSugar;
using ZR.Model;
using ZR.Model.MES.andon;
@@ -75,5 +76,31 @@ namespace ZR.Service.mes.andon
return Update(model, true);
}
public ApiResult GetPullDown()
{
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();
}
return ApiResult.Success("成功", response);
}
}
}