|
|
@ -16,9 +16,10 @@ using System.Linq;
|
|
|
|
namespace IoT.Shared.Areas.IoTCenter.Controlls
|
|
|
|
namespace IoT.Shared.Areas.IoTCenter.Controlls
|
|
|
|
{
|
|
|
|
{
|
|
|
|
[Area("IoTCenter")]
|
|
|
|
[Area("IoTCenter")]
|
|
|
|
public class AjaxController
|
|
|
|
public class AjaxBaseController
|
|
|
|
{
|
|
|
|
{
|
|
|
|
protected readonly ILogger<AjaxController> _logger;
|
|
|
|
protected readonly IServiceProvider _services;
|
|
|
|
|
|
|
|
protected readonly ILogger _logger;
|
|
|
|
protected readonly IHttpContextAccessor _httpContext;
|
|
|
|
protected readonly IHttpContextAccessor _httpContext;
|
|
|
|
protected readonly IRepository<IoTProductCategory> _categoryRepo;
|
|
|
|
protected readonly IRepository<IoTProductCategory> _categoryRepo;
|
|
|
|
protected readonly IRepository<Organ> _organRepo;
|
|
|
|
protected readonly IRepository<Organ> _organRepo;
|
|
|
@ -33,7 +34,8 @@ namespace IoT.Shared.Areas.IoTCenter.Controlls
|
|
|
|
protected readonly IRepository<IoTScene> _sceneRepo;
|
|
|
|
protected readonly IRepository<IoTScene> _sceneRepo;
|
|
|
|
protected readonly IRepository<IoTSceneTigger> _sceneTiggerRepo;
|
|
|
|
protected readonly IRepository<IoTSceneTigger> _sceneTiggerRepo;
|
|
|
|
|
|
|
|
|
|
|
|
public AjaxController(ILogger<AjaxController> logger,
|
|
|
|
public AjaxBaseController(IServiceProvider services,
|
|
|
|
|
|
|
|
ILogger logger,
|
|
|
|
IHttpContextAccessor httpContxt,
|
|
|
|
IHttpContextAccessor httpContxt,
|
|
|
|
IRepository<IoTProductCategory> categoryRepo,
|
|
|
|
IRepository<IoTProductCategory> categoryRepo,
|
|
|
|
IRepository<IoTProduct> productRepo,
|
|
|
|
IRepository<IoTProduct> productRepo,
|
|
|
@ -48,6 +50,7 @@ namespace IoT.Shared.Areas.IoTCenter.Controlls
|
|
|
|
IRepository<IoTApi> apiRepo,
|
|
|
|
IRepository<IoTApi> apiRepo,
|
|
|
|
IRepository<IoTSceneTigger> sceneTiggerRepo)
|
|
|
|
IRepository<IoTSceneTigger> sceneTiggerRepo)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
this._services = services;
|
|
|
|
this._logger = logger;
|
|
|
|
this._logger = logger;
|
|
|
|
this._httpContext = httpContxt;
|
|
|
|
this._httpContext = httpContxt;
|
|
|
|
this._categoryRepo = categoryRepo;
|
|
|
|
this._categoryRepo = categoryRepo;
|
|
|
@ -96,6 +99,7 @@ namespace IoT.Shared.Areas.IoTCenter.Controlls
|
|
|
|
.OrderBy(o => o.Parent)
|
|
|
|
.OrderBy(o => o.Parent)
|
|
|
|
.ThenBy(o => o.DisplayOrder)
|
|
|
|
.ThenBy(o => o.DisplayOrder)
|
|
|
|
.Select(o => new { o.Id, Name = $"{o.Name}({o.Number})" })
|
|
|
|
.Select(o => new { o.Id, Name = $"{o.Name}({o.Number})" })
|
|
|
|
|
|
|
|
.Take(20)
|
|
|
|
.ToList();
|
|
|
|
.ToList();
|
|
|
|
return new JsonResult(new SelectList(list, "Id", "Name", selected));
|
|
|
|
return new JsonResult(new SelectList(list, "Id", "Name", selected));
|
|
|
|
}
|
|
|
|
}
|