@* //------------------------------------------------------------------------------ // 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充 // 此代码版权(除特别声明外的代码)归作者本人Diego所有 // 源代码使用协议遵循本仓库的开源协议及附加协议 // Gitee源代码仓库:https://gitee.com/diego2098/ThingsGateway // Github源代码仓库:https://github.com/kimdiego2098/ThingsGateway // 使用文档:https://diego2098.gitee.io/thingsgateway-docs/ // QQ群:605534569 //------------------------------------------------------------------------------ *@ @page "/gatewayconfig/uploaddevice" @namespace ThingsGateway.Blazor @using System.Linq.Expressions; @using BlazorComponent; @using Furion; @using Mapster; @using Masa.Blazor.Presets; @using System.IO; @using Masa.Blazor; @using Microsoft.AspNetCore.Authorization; @using ThingsGateway.Admin.Blazor.Core; @using ThingsGateway.Admin.Blazor; @using ThingsGateway.Admin.Core; @using ThingsGateway.Application; @attribute [Authorize] @inherits BaseComponentBase @inject UserResoures UserResoures @layout MainLayout @if (IsMobile) { @GetAppDataTable() } else { { if(search.DeviceGroup!=a.FirstOrDefault()) { search.DeviceGroup=a.FirstOrDefault(); await DatatableQuery(); } } ) Items="_deviceGroups" ItemText="r=>r" ItemChildren="r=>null" Search="@_searchName" Activatable ItemKey=@(r=>r)> @context.Item @GetAppDataTable( ) } @code { RenderFragment GetAppDataTable() { RenderFragment renderFragment = @ x.Name) /> x.PluginName) /> 复制 复制设备 导出 导出全部 导出搜索项 导入 @GetRenderFragment(context) @GetRenderFragment(context) @switch (context.Header.Value) { case nameof(context.Item.Enable): break; case nameof(context.Item.PluginId): @( App.GetService().GetNameById(context.Item.PluginId) ) break; default: @if (context.Header.CellClass?.Contains("text-truncate") == true) { @context.Value } else { @context.Value } break; } ; return renderFragment; } RenderFragment GetRenderFragment(UploadDeviceEditInput context) { RenderFragment renderFragment = null; renderFragment += @
基本信息 扩展属性 @(context.Description(x => x.Name)) @(context.Description(x => x.Description)) @(context.Description(x => x.DeviceGroup)) @(typeof(UploadDeviceRunTime).GetDescription(nameof(UploadDeviceRunTime.PluginName))) DriverValueChangedAsync(context,a)) Items="DriverPlugins" ItemText="u => u.Name" ItemValue="u => u.Id" ItemChildren="u => u.Children" MenuProps="@(props => { props.Auto = true; props.OffsetY = true; })" ShowAllLevels="false" HideDetails="@("auto")" Height="30" Dense> @(context.Description(x => x.Enable)) @(context.Description(x => x.IsLogOut)) { if(context.PluginId>0) { context.DevicePropertys= GetDriverProperties(context.PluginId,context.Id); } else { await PopupService.EnqueueSnackbarAsync("需选择驱动",AlertTypes.Error); } } ) Color="primary"> 刷新设备属性 @if (context.DevicePropertys != null) { @foreach (var item in context.DevicePropertys) { @item.Description @if (item.PropertyName.Contains("BigText")) { } else { } @item.Remark } }
; return renderFragment; } }