mirror of
https://gitee.com/ThingsGateway/ThingsGateway.git
synced 2025-10-21 03:01:28 +08:00
Compare commits
124 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
cf794569ed | ||
![]() |
51e5bbab0d | ||
![]() |
2c197ed2b2 | ||
![]() |
d8fc6665b3 | ||
![]() |
c671a79822 | ||
![]() |
9d93ce4c41 | ||
![]() |
a6d99fe227 | ||
![]() |
923b8bca31 | ||
![]() |
e2c30d1c88 | ||
![]() |
b6d9f2a04e | ||
![]() |
57306ea664 | ||
![]() |
cd7f3fd02f | ||
![]() |
0482e077a8 | ||
![]() |
5f986a45ca | ||
![]() |
ca7b49c0d5 | ||
![]() |
52dd555e6c | ||
![]() |
579b1a59f9 | ||
![]() |
5299c5c4be | ||
![]() |
f7756bccef | ||
![]() |
a6b874d160 | ||
![]() |
3e5fb3ddcf | ||
![]() |
5e6bcb12d3 | ||
![]() |
14303f1429 | ||
![]() |
96711ba022 | ||
![]() |
cbfc0fdbdc | ||
![]() |
6e81886c0e | ||
![]() |
2d976bc132 | ||
![]() |
57f6a476af | ||
![]() |
8491ed296e | ||
![]() |
cd1288afdc | ||
![]() |
ec6c830cb0 | ||
![]() |
2f86ccc4bf | ||
![]() |
8ca445aec0 | ||
![]() |
1e1f27c8a5 | ||
![]() |
2b84bde367 | ||
![]() |
b52e58551d | ||
![]() |
9aceed00bf | ||
![]() |
58814f7f74 | ||
![]() |
6a70ef9f31 | ||
![]() |
82cc4ca500 | ||
![]() |
4567fa04ed | ||
![]() |
8b98b5d818 | ||
![]() |
176d0351af | ||
![]() |
d63dc3384b | ||
![]() |
1ccd704e30 | ||
![]() |
f5d23dbe79 | ||
![]() |
75bfe53ac3 | ||
![]() |
3308f916dd | ||
![]() |
e7140279ca | ||
![]() |
1034719f5e | ||
![]() |
2c00043a7f | ||
![]() |
65c695d9ce | ||
![]() |
57253fe46a | ||
![]() |
4e5c443440 | ||
![]() |
0b3b73d8ec | ||
![]() |
921eabc134 | ||
![]() |
0faa428751 | ||
![]() |
f71a2fdd63 | ||
![]() |
4eb9ed8aba | ||
![]() |
d7b549abb8 | ||
![]() |
95d723c578 | ||
![]() |
2fcd853e86 | ||
![]() |
07eef7c812 | ||
![]() |
b01e0757fa | ||
![]() |
32844a20c6 | ||
![]() |
5b6532c601 | ||
![]() |
2c5b4b4027 | ||
![]() |
72d7ecf195 | ||
![]() |
2cfa6b4306 | ||
![]() |
6f6ffde0ab | ||
![]() |
1694739a16 | ||
![]() |
95d1e8bfca | ||
![]() |
60dec08e3c | ||
![]() |
a99d71be93 | ||
![]() |
f1331b6a0c | ||
![]() |
10d66b642b | ||
![]() |
cd2310e4a8 | ||
![]() |
1b399cf6b0 | ||
![]() |
877445bc0a | ||
![]() |
9a5b345bde | ||
![]() |
fc9e8ea7b3 | ||
![]() |
32be6fcfc1 | ||
![]() |
49847236c2 | ||
![]() |
d8424443e6 | ||
![]() |
f3b571ec3f | ||
![]() |
99318bb5d7 | ||
![]() |
1aa154c9aa | ||
![]() |
c65d8a445b | ||
![]() |
80f4f85570 | ||
![]() |
5beee43a6b | ||
![]() |
8d6ae203a0 | ||
![]() |
4353479a5c | ||
![]() |
34d7687f9e | ||
![]() |
b1dc3cf4af | ||
![]() |
6a58b95933 | ||
![]() |
d3badfd02b | ||
![]() |
0098be057b | ||
![]() |
6f972aa515 | ||
![]() |
7407ba6313 | ||
![]() |
1c79de207b | ||
![]() |
257c79db92 | ||
![]() |
9d1934a308 | ||
![]() |
d70f959902 | ||
![]() |
e4d810222f | ||
![]() |
bc1af4ae07 | ||
![]() |
6e688ef43f | ||
![]() |
f0fe1b23dc | ||
![]() |
aaf2006401 | ||
![]() |
b821e26935 | ||
![]() |
7ae4287157 | ||
![]() |
c6fcc38a65 | ||
![]() |
ab2d5c8853 | ||
![]() |
5e557ff0bc | ||
![]() |
918ca449a1 | ||
![]() |
8e73368008 | ||
![]() |
f3c1faf672 | ||
![]() |
d6df04dd6a | ||
![]() |
b1b9e51ab6 | ||
![]() |
e49d4770ac | ||
![]() |
8fa1075511 | ||
![]() |
9a70169b94 | ||
![]() |
fefb928237 | ||
![]() |
ad7e700d0d | ||
![]() |
1699c69147 |
5
.gitignore
vendored
5
.gitignore
vendored
@@ -360,4 +360,7 @@ MigrationBackup/
|
||||
.ionide/
|
||||
|
||||
# Fody - auto-generated XML schema
|
||||
FodyWeavers.xsd
|
||||
FodyWeavers.xsd
|
||||
|
||||
|
||||
/framework/*Pro*
|
||||
|
@@ -5,12 +5,11 @@
|
||||
|
||||
**NetCore** 跨平台边缘采集网关(工业设备采集)
|
||||
|
||||
**ThingsGateway** 存储库同时提供 [**设备采集驱动**](https://www.nuget.org/profiles/KimDiego)
|
||||
**ThingsGateway** 存储库同时提供 [**设备采集驱动**](https://www.nuget.org/packages?q=Tags%3A%22ThingsGateway%22)
|
||||
|
||||
**ThingsGateway** 存储库同时提供 **基于Blazor的权限框架** 查看 [**ThingsGateway.Admin**](https://gitee.com/dotnetchina/ThingsGateway/blob/master/framework/ThingsGateway.Admin.sln)
|
||||
|
||||
|
||||
|
||||
## 文档
|
||||
|
||||
[ThingsGateway](https://diego2098.gitee.io/thingsgateway-docs/) 文档。
|
||||
@@ -23,7 +22,9 @@
|
||||
|
||||
[ThingsGateway演示地址](http://120.24.62.140:5000/)
|
||||
|
||||
账户 : **superAdmin** 密码 : **111111**
|
||||
账户 : **superAdmin**
|
||||
|
||||
密码 : **111111**
|
||||
|
||||
## 赞助
|
||||
|
||||
|
@@ -81,6 +81,15 @@ dotnet_diagnostic.CA2208.severity = none
|
||||
# IDE0057: 使用范围运算符
|
||||
dotnet_diagnostic.IDE0057.severity = none
|
||||
|
||||
# IDE0056: 使用索引运算符
|
||||
dotnet_diagnostic.IDE0056.severity = none
|
||||
|
||||
# CA1830: 最好使用 StringBuilder 的强类型 Append 和 Insert 方法重载
|
||||
dotnet_diagnostic.CA1830.severity = none
|
||||
|
||||
# CA1847: 将字符型文本用于单个字符查找
|
||||
dotnet_diagnostic.CA1847.severity = none
|
||||
|
||||
[*.vb]
|
||||
#### 命名样式 ####
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<Project>
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
|
||||
<Version>2.0.0.0</Version>
|
||||
<Version>2.1.0.8</Version>
|
||||
<Authors>Diego</Authors>
|
||||
<Product>ThingsGateway</Product>
|
||||
<Copyright>© 2023-present Diego</Copyright>
|
||||
|
@@ -19,7 +19,7 @@ using ThingsGateway.Admin.Core;
|
||||
namespace ThingsGateway.Admin.Application;
|
||||
|
||||
/// <summary>
|
||||
/// 后台登录控制器
|
||||
/// 文件下载
|
||||
/// </summary>
|
||||
[ApiDescriptionSettings(CateGoryConst.ThingsGatewayAdmin, Order = 200)]
|
||||
[Route("file")]
|
||||
|
@@ -46,7 +46,7 @@ namespace ThingsGateway.Admin.Application
|
||||
[AllowAnonymous, NonUnify]
|
||||
public async Task<int> SwaggerCheckUrlAsync()
|
||||
{
|
||||
var enable = (await _configService.GetByConfigKeyAsync(ConfigConst.SYS_CONFIGBASEDEFAULT, ConfigConst.CONFIG_SWAGGERLOGIN_OPEN)).ConfigValue.ToBool();
|
||||
var enable = (await _configService.GetByConfigKeyAsync(ConfigConst.SYS_CONFIGBASEDEFAULT, ConfigConst.CONFIG_SWAGGERLOGIN_OPEN)).ConfigValue.ToBoolean();
|
||||
return enable ? 401 : 200;
|
||||
}
|
||||
|
||||
|
@@ -30,7 +30,7 @@
|
||||
</member>
|
||||
<member name="T:ThingsGateway.Admin.Application.FileController">
|
||||
<summary>
|
||||
后台登录控制器
|
||||
文件下载
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:ThingsGateway.Admin.Application.FileController.#ctor(ThingsGateway.Admin.Application.IFileService,ThingsGateway.Admin.Application.IOperateLogService,ThingsGateway.Admin.Application.IVisitLogService)">
|
||||
|
@@ -18,6 +18,7 @@ using System.Reflection;
|
||||
using System.Text;
|
||||
|
||||
using ThingsGateway.Admin.Core;
|
||||
using ThingsGateway.Admin.Core.JsonExtensions;
|
||||
|
||||
using UAParser;
|
||||
|
||||
|
@@ -20,6 +20,7 @@ using System.Globalization;
|
||||
using System.Reflection;
|
||||
|
||||
using ThingsGateway.Admin.Core;
|
||||
using ThingsGateway.Admin.Core.JsonExtensions;
|
||||
|
||||
using Yitter.IdGenerator;
|
||||
|
||||
|
@@ -13,6 +13,8 @@
|
||||
using System.Text;
|
||||
|
||||
using ThingsGateway.Admin.Core;
|
||||
using ThingsGateway.Admin.Core.JsonExtensions;
|
||||
|
||||
namespace ThingsGateway.Admin.Application;
|
||||
|
||||
/// <summary>
|
||||
|
@@ -22,7 +22,7 @@ public class LoginOpenApiEvent
|
||||
/// <summary>
|
||||
/// 时间
|
||||
/// </summary>
|
||||
public DateTimeOffset DateTimeOffset = SysDateTimeExtensions.CurrentDateTime;
|
||||
public DateTime DateTime = SysDateTimeExtensions.CurrentDateTime;
|
||||
|
||||
/// <summary>
|
||||
/// 登录设备
|
||||
|
@@ -41,7 +41,7 @@ public class OpenApiAuthEventSubscriber : IEventSubscriber, ISingleton
|
||||
openApiUser.LastLoginTime = openApiUser.LatestLoginTime;
|
||||
openApiUser.LatestLoginDevice = loginEvent.Device.ToString();
|
||||
openApiUser.LatestLoginIp = loginEvent.Ip;
|
||||
openApiUser.LatestLoginTime = loginEvent.DateTimeOffset;
|
||||
openApiUser.LatestLoginTime = loginEvent.DateTime;
|
||||
|
||||
#endregion 重新赋值属性,设置本次登录信息为最新的信息
|
||||
|
||||
|
@@ -135,7 +135,7 @@ public class OpenApiAuthService : IOpenApiAuthService, ITransient
|
||||
{
|
||||
//获取verificat列表
|
||||
List<VerificatInfo> verificatInfos = await GetVerificatInfos(loginEvent.OpenApiUser.Id);
|
||||
var verificatTimeout = loginEvent.DateTimeOffset.AddMinutes(loginEvent.Expire);
|
||||
var verificatTimeout = loginEvent.DateTime.AddMinutes(loginEvent.Expire);
|
||||
//生成verificat信息
|
||||
var verificatInfo = new VerificatInfo
|
||||
{
|
||||
@@ -149,7 +149,7 @@ public class OpenApiAuthService : IOpenApiAuthService, ITransient
|
||||
{
|
||||
bool isSingle = false;//默认不开启单用户登录
|
||||
var singleConfig = await _configService.GetByConfigKeyAsync(ConfigConst.SYS_CONFIGBASEDEFAULT, ConfigConst.CONFIG_SINGLE_OPEN);//获取系统单用户登录选项
|
||||
if (singleConfig != null) isSingle = singleConfig.ConfigValue.ToBool();//如果配置不为空则设置单用户登录选项为系统配置的值
|
||||
if (singleConfig != null) isSingle = singleConfig.ConfigValue.ToBoolean();//如果配置不为空则设置单用户登录选项为系统配置的值
|
||||
|
||||
//判断是否单用户登录
|
||||
if (isSingle)
|
||||
|
@@ -40,7 +40,7 @@ public class OpenApiSessionOutput : PrimaryKeyEntity
|
||||
///</summary>
|
||||
[Description("最新登录时间")]
|
||||
[DataTable(Order = 3, IsShow = true, Sortable = true)]
|
||||
public DateTimeOffset? LatestLoginTime { get; set; }
|
||||
public DateTime? LatestLoginTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 令牌数量
|
||||
|
@@ -52,8 +52,8 @@ public class OpenApiSessionService : DbRepository<OpenApiUser>, IOpenApiSessionS
|
||||
//获取该用户的verificat信息
|
||||
List<VerificatInfo> verificatInfos = await _verificatService.GetOpenApiVerificatIdAsync(input.Id);
|
||||
//当前需要踢掉用户的verificat
|
||||
var deleteVerificats = verificatInfos.Where(it => input.VerificatIds.Contains(it.Id)).ToList();
|
||||
await _verificatService.SetOpenApiVerificatIdAsync(input.Id, deleteVerificats);//如果还有verificat则更新verificat
|
||||
var setVerificats = verificatInfos.Where(it => !input.VerificatIds.Contains(it.Id)).ToList();
|
||||
await _verificatService.SetOpenApiVerificatIdAsync(input.Id, setVerificats);//如果还有verificat则更新verificat
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@@ -77,7 +77,7 @@
|
||||
"Id": "22222222222232",
|
||||
"Category": "SYS_CONFIGBASEDEFAULT",
|
||||
"ConfigKey": "CONFIG_SINGLE_OPEN",
|
||||
"ConfigValue": "true",
|
||||
"ConfigValue": "false",
|
||||
"Remark": "单用户登录开关",
|
||||
"SortCode": "10",
|
||||
"IsDelete": "false"
|
||||
|
@@ -42,7 +42,7 @@ public class AuthEventSubscriber : IEventSubscriber, ISingleton
|
||||
sysUser.LastLoginTime = sysUser.LatestLoginTime;
|
||||
sysUser.LatestLoginDevice = loginEvent.Device.ToString();
|
||||
sysUser.LatestLoginIp = loginEvent.Ip;
|
||||
sysUser.LatestLoginTime = loginEvent.DateTimeOffset;
|
||||
sysUser.LatestLoginTime = loginEvent.DateTime;
|
||||
|
||||
#endregion 重新赋值属性,设置本次登录信息为最新的信息
|
||||
|
||||
|
@@ -79,7 +79,7 @@ public class AuthService : IAuthService
|
||||
|
||||
if (sysBase != null)//如果有这个配置项
|
||||
{
|
||||
if (sysBase.ConfigValue.ToBool())//如果需要验证码
|
||||
if (sysBase.ConfigValue.ToBoolean())//如果需要验证码
|
||||
{
|
||||
//如果没填验证码,提示验证码不能为空
|
||||
if (input.ValidCode.IsNullOrEmpty() || input.ValidCodeReqNo == 0) throw Oops.Bah("验证码不能为空").StatusCode(410);
|
||||
@@ -202,7 +202,7 @@ public class AuthService : IAuthService
|
||||
{
|
||||
//获取verificat列表
|
||||
List<VerificatInfo> verificatInfos = await _verificatService.GetVerificatIdAsync(loginEvent.SysUser.Id);
|
||||
var verificatTimeout = loginEvent.DateTimeOffset.AddMinutes(loginEvent.Expire);
|
||||
var verificatTimeout = loginEvent.DateTime.AddMinutes(loginEvent.Expire);
|
||||
//生成verificat信息
|
||||
var verificatInfo = new VerificatInfo
|
||||
{
|
||||
@@ -217,7 +217,7 @@ public class AuthService : IAuthService
|
||||
bool isSingle = false;//默认不开启单用户登录
|
||||
|
||||
var singleConfig = await _configService.GetByConfigKeyAsync(ConfigConst.SYS_CONFIGBASEDEFAULT, ConfigConst.CONFIG_SINGLE_OPEN);//获取系统单用户登录选项
|
||||
if (singleConfig != null) isSingle = singleConfig.ConfigValue.ToBool();//如果配置不为空则设置单用户登录选项为系统配置的值
|
||||
if (singleConfig != null) isSingle = singleConfig.ConfigValue.ToBoolean();//如果配置不为空则设置单用户登录选项为系统配置的值
|
||||
if (isSingle)//判断是否单用户登录
|
||||
{
|
||||
await _noticeService.LogoutAsync(loginEvent.SysUser.Id, verificatInfos.Where(it => it.Device == loginEvent.Device.ToString()).ToList(), "该账号已在别处登录!");//通知其他用户下线
|
||||
|
@@ -22,7 +22,7 @@ public class LoginEvent
|
||||
/// <summary>
|
||||
/// 时间
|
||||
/// </summary>
|
||||
public DateTimeOffset DateTimeOffset = SysDateTimeExtensions.CurrentDateTime;
|
||||
public DateTime DateTime = SysDateTimeExtensions.CurrentDateTime;
|
||||
|
||||
/// <summary>
|
||||
/// 登录设备
|
||||
|
@@ -16,6 +16,7 @@ using Furion.FriendlyException;
|
||||
using Mapster;
|
||||
|
||||
using ThingsGateway.Admin.Core;
|
||||
using ThingsGateway.Admin.Core.JsonExtensions;
|
||||
|
||||
namespace ThingsGateway.Admin.Application;
|
||||
|
||||
|
@@ -17,6 +17,7 @@ using Furion.FriendlyException;
|
||||
using Mapster;
|
||||
|
||||
using ThingsGateway.Admin.Core;
|
||||
using ThingsGateway.Admin.Core.JsonExtensions;
|
||||
|
||||
using Yitter.IdGenerator;
|
||||
|
||||
|
@@ -40,7 +40,7 @@ public class SessionOutput : PrimaryKeyEntity
|
||||
///</summary>
|
||||
[Description("最新登录时间")]
|
||||
[DataTable(Order = 4, IsShow = true, Sortable = true)]
|
||||
public DateTimeOffset? LatestLoginTime { get; set; }
|
||||
public DateTime? LatestLoginTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 在线状态
|
||||
|
@@ -52,12 +52,11 @@ public class SessionService : DbRepository<SysUser>, ISessionService
|
||||
{
|
||||
//获取该用户的verificat信息
|
||||
List<VerificatInfo> verificatInfos = await _verificatService.GetVerificatIdAsync(input.Id);
|
||||
//当前需要踢掉用户的verificat
|
||||
List<VerificatInfo> deleteVerificats = new();
|
||||
|
||||
//踢掉包含verificat列表的verificat信息
|
||||
deleteVerificats = verificatInfos.Where(it => input.VerificatIds.Contains(it.Id)).ToList();
|
||||
await _verificatService.SetVerificatIdAsync(input.Id, deleteVerificats);//如果还有verificat则更新verificat
|
||||
var setVerificats = verificatInfos.Where(it => !input.VerificatIds.Contains(it.Id)).ToList();
|
||||
var deleteVerificats = verificatInfos.Where(it => input.VerificatIds.Contains(it.Id)).ToList();
|
||||
await _verificatService.SetVerificatIdAsync(input.Id, setVerificats);//如果还有verificat则更新verificat
|
||||
|
||||
var message = "您已被强制下线!";
|
||||
await _noticeService.LogoutAsync(input.Id, deleteVerificats, message);//通知下线
|
||||
|
@@ -19,6 +19,7 @@ using Mapster;
|
||||
using SqlSugar;
|
||||
|
||||
using ThingsGateway.Admin.Core;
|
||||
using ThingsGateway.Admin.Core.JsonExtensions;
|
||||
|
||||
namespace ThingsGateway.Admin.Application;
|
||||
|
||||
|
@@ -17,6 +17,7 @@ using Furion.FriendlyException;
|
||||
using Mapster;
|
||||
|
||||
using ThingsGateway.Admin.Core;
|
||||
using ThingsGateway.Admin.Core.JsonExtensions;
|
||||
|
||||
namespace ThingsGateway.Admin.Application;
|
||||
|
||||
|
@@ -479,7 +479,7 @@
|
||||
登录事件参数
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:ThingsGateway.Admin.Application.LoginOpenApiEvent.DateTimeOffset">
|
||||
<member name="F:ThingsGateway.Admin.Application.LoginOpenApiEvent.DateTime">
|
||||
<summary>
|
||||
时间
|
||||
</summary>
|
||||
@@ -1192,7 +1192,7 @@
|
||||
登录事件参数
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:ThingsGateway.Admin.Application.LoginEvent.DateTimeOffset">
|
||||
<member name="F:ThingsGateway.Admin.Application.LoginEvent.DateTime">
|
||||
<summary>
|
||||
时间
|
||||
</summary>
|
||||
|
@@ -30,7 +30,9 @@ public class BaseComponentBase : ComponentBase, IDisposable
|
||||
/// </summary>
|
||||
public virtual void Dispose()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// InvokeAsync(StateHasChanged)
|
||||
/// </summary>
|
||||
|
@@ -1,12 +1,12 @@
|
||||
#region copyright
|
||||
#region copyright
|
||||
//------------------------------------------------------------------------------
|
||||
// <EFBFBD>˴<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊȫ<EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ԭ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ر<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>·<EFBFBD><EFBFBD>ֶ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// <EFBFBD>˴<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ر<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĵ<EFBFBD><EFBFBD>룩<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>߱<EFBFBD><EFBFBD><EFBFBD>Diego<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// Դ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD><EFBFBD>Э<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѭ<EFBFBD><EFBFBD><EFBFBD>ֿ<EFBFBD><EFBFBD>Ŀ<EFBFBD>ԴЭ<EFBFBD>鼰<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Э<EFBFBD><EFBFBD>
|
||||
// GiteeԴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֿ⣺https://gitee.com/diego2098/ThingsGateway
|
||||
// GithubԴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֿ⣺https://github.com/kimdiego2098/ThingsGateway
|
||||
// ʹ<EFBFBD><EFBFBD><EFBFBD>ĵ<EFBFBD><EFBFBD><EFBFBD>https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQȺ<EFBFBD><EFBFBD>605534569
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
// 源代码使用协议遵循本仓库的开源协议及附加协议
|
||||
// Gitee源代码仓库:https://gitee.com/diego2098/ThingsGateway
|
||||
// Github源代码仓库:https://github.com/kimdiego2098/ThingsGateway
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
#endregion
|
||||
|
||||
@@ -20,19 +20,19 @@ namespace ThingsGateway.Admin.Blazor.Core;
|
||||
public partial class AppBarItems
|
||||
{
|
||||
/// <summary>
|
||||
/// <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
/// 链接
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public string CONFIG_COPYRIGHT_URL { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// <EFBFBD><EFBFBD>Ȩ
|
||||
/// 版权
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public string CONFIG_COPYRIGHT { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
/// 标题
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public string CONFIG_TITLE { get; set; }
|
||||
|
@@ -294,7 +294,7 @@ public partial class AppDateTimePicker
|
||||
Value = dateTime;
|
||||
if (ValueChanged.HasDelegate)
|
||||
{
|
||||
await ValueChanged.InvokeAsync(dateTime);
|
||||
await ValueChanged.InvokeAsync(DateTime.SpecifyKind(dateTime.Value, DateTimeKind.Utc));
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -1,12 +1,12 @@
|
||||
#region copyright
|
||||
#region copyright
|
||||
//------------------------------------------------------------------------------
|
||||
// <EFBFBD>˴<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊȫ<EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ԭ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ر<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>·<EFBFBD><EFBFBD>ֶ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// <EFBFBD>˴<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ر<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĵ<EFBFBD><EFBFBD>룩<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>߱<EFBFBD><EFBFBD><EFBFBD>Diego<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// Դ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD><EFBFBD>Э<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѭ<EFBFBD><EFBFBD><EFBFBD>ֿ<EFBFBD><EFBFBD>Ŀ<EFBFBD>ԴЭ<EFBFBD>鼰<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Э<EFBFBD><EFBFBD>
|
||||
// GiteeԴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֿ⣺https://gitee.com/diego2098/ThingsGateway
|
||||
// GithubԴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֿ⣺https://github.com/kimdiego2098/ThingsGateway
|
||||
// ʹ<EFBFBD><EFBFBD><EFBFBD>ĵ<EFBFBD><EFBFBD><EFBFBD>https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQȺ<EFBFBD><EFBFBD>605534569
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
// 源代码使用协议遵循本仓库的开源协议及附加协议
|
||||
// Gitee源代码仓库:https://gitee.com/diego2098/ThingsGateway
|
||||
// Github源代码仓库:https://github.com/kimdiego2098/ThingsGateway
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
#endregion
|
||||
|
||||
|
@@ -1,12 +1,12 @@
|
||||
#region copyright
|
||||
#region copyright
|
||||
//------------------------------------------------------------------------------
|
||||
// <EFBFBD>˴<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊȫ<EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ԭ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ر<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>·<EFBFBD><EFBFBD>ֶ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// <EFBFBD>˴<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ر<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĵ<EFBFBD><EFBFBD>룩<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>߱<EFBFBD><EFBFBD><EFBFBD>Diego<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// Դ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD><EFBFBD>Э<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѭ<EFBFBD><EFBFBD><EFBFBD>ֿ<EFBFBD><EFBFBD>Ŀ<EFBFBD>ԴЭ<EFBFBD>鼰<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Э<EFBFBD><EFBFBD>
|
||||
// GiteeԴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֿ⣺https://gitee.com/diego2098/ThingsGateway
|
||||
// GithubԴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֿ⣺https://github.com/kimdiego2098/ThingsGateway
|
||||
// ʹ<EFBFBD><EFBFBD><EFBFBD>ĵ<EFBFBD><EFBFBD><EFBFBD>https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQȺ<EFBFBD><EFBFBD>605534569
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
// 源代码使用协议遵循本仓库的开源协议及附加协议
|
||||
// Gitee源代码仓库:https://gitee.com/diego2098/ThingsGateway
|
||||
// Github源代码仓库:https://github.com/kimdiego2098/ThingsGateway
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
#endregion
|
||||
|
||||
|
@@ -1,12 +1,12 @@
|
||||
#region copyright
|
||||
#region copyright
|
||||
//------------------------------------------------------------------------------
|
||||
// <EFBFBD>˴<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊȫ<EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ԭ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ر<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>·<EFBFBD><EFBFBD>ֶ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// <EFBFBD>˴<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ر<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĵ<EFBFBD><EFBFBD>룩<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>߱<EFBFBD><EFBFBD><EFBFBD>Diego<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// Դ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD><EFBFBD>Э<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѭ<EFBFBD><EFBFBD><EFBFBD>ֿ<EFBFBD><EFBFBD>Ŀ<EFBFBD>ԴЭ<EFBFBD>鼰<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Э<EFBFBD><EFBFBD>
|
||||
// GiteeԴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֿ⣺https://gitee.com/diego2098/ThingsGateway
|
||||
// GithubԴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֿ⣺https://github.com/kimdiego2098/ThingsGateway
|
||||
// ʹ<EFBFBD><EFBFBD><EFBFBD>ĵ<EFBFBD><EFBFBD><EFBFBD>https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQȺ<EFBFBD><EFBFBD>605534569
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
// 源代码使用协议遵循本仓库的开源协议及附加协议
|
||||
// Gitee源代码仓库:https://gitee.com/diego2098/ThingsGateway
|
||||
// Github源代码仓库:https://github.com/kimdiego2098/ThingsGateway
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
#endregion
|
||||
|
||||
@@ -14,7 +14,7 @@ using Microsoft.AspNetCore.Components;
|
||||
|
||||
namespace ThingsGateway.Admin.Blazor.Core;
|
||||
/// <summary>
|
||||
/// <EFBFBD><EFBFBD><EFBFBD><EFBFBD>/ͣ<><CDA3> <20>ı<EFBFBD><C4B1><EFBFBD>ʾ
|
||||
/// 启用/停用 文本提示
|
||||
/// </summary>
|
||||
public partial class EnableChip
|
||||
{
|
||||
@@ -46,5 +46,5 @@ public partial class EnableChip
|
||||
|
||||
private string TextColor => Value ? "green" : "error";
|
||||
private string Color => Value ? "green-lighten" : "warning-lighten";
|
||||
private string Label => Value ? EnabledLabel ?? "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>" : DisabledLabel ?? "ͣ<EFBFBD><EFBFBD>";
|
||||
private string Label => Value ? EnabledLabel ?? "启用" : DisabledLabel ?? "停用";
|
||||
}
|
@@ -1,18 +1,18 @@
|
||||
#region copyright
|
||||
#region copyright
|
||||
//------------------------------------------------------------------------------
|
||||
// <EFBFBD>˴<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊȫ<EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ԭ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ر<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>·<EFBFBD><EFBFBD>ֶ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// <EFBFBD>˴<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ر<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĵ<EFBFBD><EFBFBD>룩<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>߱<EFBFBD><EFBFBD><EFBFBD>Diego<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// Դ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD><EFBFBD>Э<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѭ<EFBFBD><EFBFBD><EFBFBD>ֿ<EFBFBD><EFBFBD>Ŀ<EFBFBD>ԴЭ<EFBFBD>鼰<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Э<EFBFBD><EFBFBD>
|
||||
// GiteeԴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֿ⣺https://gitee.com/diego2098/ThingsGateway
|
||||
// GithubԴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֿ⣺https://github.com/kimdiego2098/ThingsGateway
|
||||
// ʹ<EFBFBD><EFBFBD><EFBFBD>ĵ<EFBFBD><EFBFBD><EFBFBD>https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQȺ<EFBFBD><EFBFBD>605534569
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
// 源代码使用协议遵循本仓库的开源协议及附加协议
|
||||
// Gitee源代码仓库:https://gitee.com/diego2098/ThingsGateway
|
||||
// Github源代码仓库:https://github.com/kimdiego2098/ThingsGateway
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
#endregion
|
||||
|
||||
namespace ThingsGateway.Admin.Blazor.Core;
|
||||
/// <summary>
|
||||
/// <EFBFBD>ղ<EFBFBD>/<2F><><EFBFBD>ݷ<EFBFBD>ʽ
|
||||
/// 收藏/快捷方式
|
||||
/// </summary>
|
||||
public partial class Favorite
|
||||
{
|
||||
|
@@ -19,7 +19,7 @@
|
||||
<MSheet>
|
||||
<MCard Flat Href=@CONFIG_COPYRIGHT_URL Target="_blank">
|
||||
<MLabel Style="background-color:inherit;" Class="text-subtltie-2">@CONFIG_COPYRIGHT</MLabel>
|
||||
<MLabel Style="background-color:inherit;" Class="text-subtltie-2 ml-4">@Version</MLabel>
|
||||
<MLabel Style="background-color:inherit;white-space: pre;" Class="text-subtltie-2 ml-4">@Version</MLabel>
|
||||
</MCard>
|
||||
</MSheet>
|
||||
|
||||
|
@@ -1,12 +1,12 @@
|
||||
#region copyright
|
||||
#region copyright
|
||||
//------------------------------------------------------------------------------
|
||||
// <EFBFBD>˴<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊȫ<EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ԭ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ر<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>·<EFBFBD><EFBFBD>ֶ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// <EFBFBD>˴<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ر<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĵ<EFBFBD><EFBFBD>룩<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>߱<EFBFBD><EFBFBD><EFBFBD>Diego<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// Դ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD><EFBFBD>Э<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѭ<EFBFBD><EFBFBD><EFBFBD>ֿ<EFBFBD><EFBFBD>Ŀ<EFBFBD>ԴЭ<EFBFBD>鼰<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Э<EFBFBD><EFBFBD>
|
||||
// GiteeԴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֿ⣺https://gitee.com/diego2098/ThingsGateway
|
||||
// GithubԴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֿ⣺https://github.com/kimdiego2098/ThingsGateway
|
||||
// ʹ<EFBFBD><EFBFBD><EFBFBD>ĵ<EFBFBD><EFBFBD><EFBFBD>https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQȺ<EFBFBD><EFBFBD>605534569
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
// 源代码使用协议遵循本仓库的开源协议及附加协议
|
||||
// Gitee源代码仓库:https://gitee.com/diego2098/ThingsGateway
|
||||
// Github源代码仓库:https://github.com/kimdiego2098/ThingsGateway
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
#endregion
|
||||
|
||||
@@ -14,6 +14,8 @@ using Microsoft.AspNetCore.Components;
|
||||
|
||||
using System.Reflection;
|
||||
|
||||
using ThingsGateway.Admin.Core;
|
||||
|
||||
namespace ThingsGateway.Admin.Blazor.Core;
|
||||
/// <summary>
|
||||
/// Foter
|
||||
@@ -22,17 +24,17 @@ public partial class Foter
|
||||
{
|
||||
private string Version = "";
|
||||
/// <summary>
|
||||
/// <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
/// 链接
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public string CONFIG_COPYRIGHT_URL { get; set; }
|
||||
/// <summary>
|
||||
/// <EFBFBD><EFBFBD>Ȩ
|
||||
/// 版权
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public string CONFIG_COPYRIGHT { get; set; }
|
||||
/// <summary>
|
||||
/// <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
/// 标题
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public string CONFIG_TITLE { get; set; }
|
||||
@@ -40,7 +42,12 @@ public partial class Foter
|
||||
/// <inheritdoc/>
|
||||
protected override async Task OnParametersSetAsync()
|
||||
{
|
||||
Version = "v" + Assembly.GetExecutingAssembly().GetName().Version.ToString();
|
||||
var assembly = Assembly.GetEntryAssembly();
|
||||
if (assembly != null)
|
||||
{
|
||||
Version = $"v{assembly.GetName().Version}";
|
||||
}
|
||||
|
||||
await base.OnParametersSetAsync();
|
||||
}
|
||||
|
||||
|
@@ -1,12 +1,12 @@
|
||||
#region copyright
|
||||
#region copyright
|
||||
//------------------------------------------------------------------------------
|
||||
// <EFBFBD>˴<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊȫ<EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ԭ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ر<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>·<EFBFBD><EFBFBD>ֶ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// <EFBFBD>˴<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ر<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĵ<EFBFBD><EFBFBD>룩<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>߱<EFBFBD><EFBFBD><EFBFBD>Diego<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// Դ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD><EFBFBD>Э<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѭ<EFBFBD><EFBFBD><EFBFBD>ֿ<EFBFBD><EFBFBD>Ŀ<EFBFBD>ԴЭ<EFBFBD>鼰<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Э<EFBFBD><EFBFBD>
|
||||
// GiteeԴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֿ⣺https://gitee.com/diego2098/ThingsGateway
|
||||
// GithubԴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֿ⣺https://github.com/kimdiego2098/ThingsGateway
|
||||
// ʹ<EFBFBD><EFBFBD><EFBFBD>ĵ<EFBFBD><EFBFBD><EFBFBD>https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQȺ<EFBFBD><EFBFBD>605534569
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
// 源代码使用协议遵循本仓库的开源协议及附加协议
|
||||
// Gitee源代码仓库:https://gitee.com/diego2098/ThingsGateway
|
||||
// Github源代码仓库:https://github.com/kimdiego2098/ThingsGateway
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
#endregion
|
||||
|
||||
@@ -20,23 +20,23 @@ namespace ThingsGateway.Admin.Blazor.Core;
|
||||
public partial class Logo
|
||||
{
|
||||
/// <summary>
|
||||
/// Logo<EFBFBD>߶<EFBFBD>
|
||||
/// Logo高度
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public int HeightInt { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
/// 链接
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public string CONFIG_COPYRIGHT_URL { get; set; }
|
||||
/// <summary>
|
||||
/// <EFBFBD><EFBFBD>Ȩ
|
||||
/// 版权
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public string CONFIG_COPYRIGHT { get; set; }
|
||||
/// <summary>
|
||||
/// <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
/// 标题
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public string CONFIG_TITLE { get; set; }
|
||||
|
@@ -1,12 +1,12 @@
|
||||
#region copyright
|
||||
#region copyright
|
||||
//------------------------------------------------------------------------------
|
||||
// <EFBFBD>˴<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊȫ<EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ԭ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ر<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>·<EFBFBD><EFBFBD>ֶ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// <EFBFBD>˴<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ر<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĵ<EFBFBD><EFBFBD>룩<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>߱<EFBFBD><EFBFBD><EFBFBD>Diego<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// Դ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD><EFBFBD>Э<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѭ<EFBFBD><EFBFBD><EFBFBD>ֿ<EFBFBD><EFBFBD>Ŀ<EFBFBD>ԴЭ<EFBFBD>鼰<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Э<EFBFBD><EFBFBD>
|
||||
// GiteeԴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֿ⣺https://gitee.com/diego2098/ThingsGateway
|
||||
// GithubԴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֿ⣺https://github.com/kimdiego2098/ThingsGateway
|
||||
// ʹ<EFBFBD><EFBFBD><EFBFBD>ĵ<EFBFBD><EFBFBD><EFBFBD>https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQȺ<EFBFBD><EFBFBD>605534569
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
// 源代码使用协议遵循本仓库的开源协议及附加协议
|
||||
// Gitee源代码仓库:https://gitee.com/diego2098/ThingsGateway
|
||||
// Github源代码仓库:https://github.com/kimdiego2098/ThingsGateway
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
#endregion
|
||||
|
||||
@@ -34,7 +34,7 @@ public partial class PageTabs
|
||||
return op;
|
||||
}
|
||||
/// <summary>
|
||||
/// Tabsʵ<EFBFBD><EFBFBD>
|
||||
/// Tabs实例
|
||||
/// </summary>
|
||||
public PPageTabs PPageTabs { get; private set; }
|
||||
|
||||
@@ -46,7 +46,7 @@ public partial class PageTabs
|
||||
[Parameter]
|
||||
public IEnumerable<string> SelfPatterns { get; set; }
|
||||
/// <summary>
|
||||
/// <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
/// 子组件
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public RenderFragment ChildContent { get; set; }
|
||||
|
@@ -1,12 +1,12 @@
|
||||
#region copyright
|
||||
#region copyright
|
||||
//------------------------------------------------------------------------------
|
||||
// <EFBFBD>˴<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊȫ<EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ԭ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ر<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>·<EFBFBD><EFBFBD>ֶ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// <EFBFBD>˴<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ر<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĵ<EFBFBD><EFBFBD>룩<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>߱<EFBFBD><EFBFBD><EFBFBD>Diego<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// Դ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD><EFBFBD>Э<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѭ<EFBFBD><EFBFBD><EFBFBD>ֿ<EFBFBD><EFBFBD>Ŀ<EFBFBD>ԴЭ<EFBFBD>鼰<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Э<EFBFBD><EFBFBD>
|
||||
// GiteeԴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֿ⣺https://gitee.com/diego2098/ThingsGateway
|
||||
// GithubԴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֿ⣺https://github.com/kimdiego2098/ThingsGateway
|
||||
// ʹ<EFBFBD><EFBFBD><EFBFBD>ĵ<EFBFBD><EFBFBD><EFBFBD>https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQȺ<EFBFBD><EFBFBD>605534569
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
// 源代码使用协议遵循本仓库的开源协议及附加协议
|
||||
// Gitee源代码仓库:https://gitee.com/diego2098/ThingsGateway
|
||||
// Github源代码仓库:https://github.com/kimdiego2098/ThingsGateway
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
#endregion
|
||||
|
||||
|
@@ -1,12 +1,12 @@
|
||||
#region copyright
|
||||
#region copyright
|
||||
//------------------------------------------------------------------------------
|
||||
// <EFBFBD>˴<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊȫ<EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ԭ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ر<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>·<EFBFBD><EFBFBD>ֶ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// <EFBFBD>˴<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ر<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĵ<EFBFBD><EFBFBD>룩<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>߱<EFBFBD><EFBFBD><EFBFBD>Diego<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// Դ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD><EFBFBD>Э<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѭ<EFBFBD><EFBFBD><EFBFBD>ֿ<EFBFBD><EFBFBD>Ŀ<EFBFBD>ԴЭ<EFBFBD>鼰<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Э<EFBFBD><EFBFBD>
|
||||
// GiteeԴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֿ⣺https://gitee.com/diego2098/ThingsGateway
|
||||
// GithubԴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֿ⣺https://github.com/kimdiego2098/ThingsGateway
|
||||
// ʹ<EFBFBD><EFBFBD><EFBFBD>ĵ<EFBFBD><EFBFBD><EFBFBD>https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQȺ<EFBFBD><EFBFBD>605534569
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
// 源代码使用协议遵循本仓库的开源协议及附加协议
|
||||
// Gitee源代码仓库:https://gitee.com/diego2098/ThingsGateway
|
||||
// Github源代码仓库:https://github.com/kimdiego2098/ThingsGateway
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
#endregion
|
||||
|
||||
@@ -17,6 +17,7 @@ using Masa.Blazor;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
|
||||
using ThingsGateway.Admin.Core;
|
||||
using ThingsGateway.Admin.Core.JsonExtensions;
|
||||
|
||||
namespace ThingsGateway.Admin.Blazor.Core;
|
||||
/// <summary>
|
||||
@@ -49,11 +50,11 @@ public partial class UserMenu
|
||||
var ret = str?.ToJsonWithT<UnifyResult<string>>();
|
||||
if (ret?.Code != 200)
|
||||
{
|
||||
await PopupService.EnqueueSnackbarAsync("ע<EFBFBD><EFBFBD>ʧ<EFBFBD><EFBFBD>", AlertTypes.Error);
|
||||
await PopupService.EnqueueSnackbarAsync("注销失败", AlertTypes.Error);
|
||||
}
|
||||
else
|
||||
{
|
||||
await PopupService.EnqueueSnackbarAsync("ע<EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD>", AlertTypes.Success);
|
||||
await PopupService.EnqueueSnackbarAsync("注销成功", AlertTypes.Success);
|
||||
await Task.Delay(500);
|
||||
NavigationManager.NavigateTo(NavigationManager.Uri);
|
||||
}
|
||||
|
@@ -0,0 +1,68 @@
|
||||
#region copyright
|
||||
//------------------------------------------------------------------------------
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
// 源代码使用协议遵循本仓库的开源协议及附加协议
|
||||
// Gitee源代码仓库:https://gitee.com/diego2098/ThingsGateway
|
||||
// Github源代码仓库:https://github.com/kimdiego2098/ThingsGateway
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
#endregion
|
||||
|
||||
using Furion.DependencyInjection;
|
||||
|
||||
namespace BlazorComponent.I18n;
|
||||
/// <summary>
|
||||
/// CookieStorage
|
||||
/// </summary>
|
||||
public class CookieStorage : IScoped
|
||||
{
|
||||
private readonly IJSRuntime _jsRuntime;
|
||||
/// <summary>
|
||||
/// CookieStorage
|
||||
/// </summary>
|
||||
/// <param name="jsRuntime"></param>
|
||||
public CookieStorage(IJSRuntime jsRuntime)
|
||||
{
|
||||
_jsRuntime = jsRuntime;
|
||||
}
|
||||
/// <summary>
|
||||
/// GetCookieAsync
|
||||
/// </summary>
|
||||
/// <param name="key"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<string> GetCookieAsync(string key)
|
||||
{
|
||||
return await _jsRuntime.InvokeAsync<string>(JsInteropConstants.GetCookie, key);
|
||||
}
|
||||
/// <summary>
|
||||
/// GetCookie
|
||||
/// </summary>
|
||||
/// <param name="key"></param>
|
||||
/// <returns></returns>
|
||||
public string GetCookie(string key)
|
||||
{
|
||||
if (_jsRuntime is IJSInProcessRuntime jsInProcess)
|
||||
{
|
||||
return jsInProcess.Invoke<string>(JsInteropConstants.GetCookie, key);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
/// <summary>
|
||||
/// SetItemAsync
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <param name="key"></param>
|
||||
/// <param name="value"></param>
|
||||
public async void SetItemAsync<T>(string key, T value)
|
||||
{
|
||||
try
|
||||
{
|
||||
await _jsRuntime.InvokeVoidAsync(JsInteropConstants.SetCookie, key, value?.ToString());
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
@@ -10,6 +10,8 @@
|
||||
//------------------------------------------------------------------------------
|
||||
#endregion
|
||||
|
||||
using BlazorComponent;
|
||||
|
||||
using Furion;
|
||||
|
||||
using Masa.Blazor;
|
||||
@@ -61,6 +63,8 @@ public class Startup : AppStartup
|
||||
|
||||
|
||||
});
|
||||
options.Locale = new Locale("zh-CN", "en-US");
|
||||
|
||||
});
|
||||
|
||||
services.AddScoped<InitTimezone>();
|
||||
|
@@ -14,8 +14,8 @@
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
<PackageReference Include="Masa.Blazor" Version="1.0.1" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.SignalR.Client" Version="7.0.9" />
|
||||
<PackageReference Include="Masa.Blazor" Version="1.0.3" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.SignalR.Client" Version="7.0.10" />
|
||||
|
||||
</ItemGroup>
|
||||
|
||||
|
@@ -857,5 +857,38 @@
|
||||
设置深浅主题统一由这个方法为入口
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:BlazorComponent.I18n.CookieStorage">
|
||||
<summary>
|
||||
CookieStorage
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:BlazorComponent.I18n.CookieStorage.#ctor(Microsoft.JSInterop.IJSRuntime)">
|
||||
<summary>
|
||||
CookieStorage
|
||||
</summary>
|
||||
<param name="jsRuntime"></param>
|
||||
</member>
|
||||
<member name="M:BlazorComponent.I18n.CookieStorage.GetCookieAsync(System.String)">
|
||||
<summary>
|
||||
GetCookieAsync
|
||||
</summary>
|
||||
<param name="key"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:BlazorComponent.I18n.CookieStorage.GetCookie(System.String)">
|
||||
<summary>
|
||||
GetCookie
|
||||
</summary>
|
||||
<param name="key"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:BlazorComponent.I18n.CookieStorage.SetItemAsync``1(System.String,``0)">
|
||||
<summary>
|
||||
SetItemAsync
|
||||
</summary>
|
||||
<typeparam name="T"></typeparam>
|
||||
<param name="key"></param>
|
||||
<param name="value"></param>
|
||||
</member>
|
||||
</members>
|
||||
</doc>
|
||||
|
@@ -20,6 +20,7 @@ using Microsoft.AspNetCore.Http;
|
||||
|
||||
using ThingsGateway.Admin.Application;
|
||||
using ThingsGateway.Admin.Core;
|
||||
using ThingsGateway.Admin.Core.JsonExtensions;
|
||||
|
||||
namespace ThingsGateway.Admin.Blazor.Core;
|
||||
|
||||
@@ -153,7 +154,7 @@ public class UserResoures : IDisposable
|
||||
{
|
||||
if (MasaBlazor.Theme.Dark != isDark || isDark == null)
|
||||
MasaBlazor.ToggleTheme();
|
||||
_cookieStorage?.SetItemAsync(BlazorResourceConst.ThemeCookieKey, isDark.ToJsonString());
|
||||
_cookieStorage?.SetItemAsync(BlazorResourceConst.ThemeCookieKey, MasaBlazor.Theme.Dark.ToJsonString());
|
||||
}
|
||||
|
||||
private void InitCookie(IRequestCookieCollection cookies)
|
||||
|
@@ -48,8 +48,7 @@
|
||||
var controllerTypes = App.EffectiveTypes.
|
||||
Where(u => !u.IsInterface && !u.IsAbstract && u.IsClass
|
||||
&& u.IsDefined(typeof(Microsoft.AspNetCore.Components.RouteAttribute), false))
|
||||
.Where(it => it.Assembly != typeof(BlazorApp).Assembly)
|
||||
;
|
||||
.Where(it => it.Assembly != typeof(BlazorApp).Assembly);
|
||||
var assemblys = controllerTypes?.Select(it => it.Assembly)?.Distinct();
|
||||
return assemblys;
|
||||
}
|
||||
|
@@ -189,38 +189,39 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
if (context?.Value?.GetType() == typeof(DateTimeOffset))
|
||||
if (ItemColWithDTTemplate != null)
|
||||
{
|
||||
<span>
|
||||
@(((DateTimeOffset)context.Value).ToOffset(InitTimezone.TimezoneOffset).ToDefaultDateTimeFormat())
|
||||
</span>
|
||||
}
|
||||
else if (context?.Value?.GetType() == typeof(DateTime))
|
||||
{
|
||||
<span>
|
||||
@(((DateTime)context.Value).Add(InitTimezone.TimezoneOffset).ToDefaultDateTimeFormat())
|
||||
</span>
|
||||
}
|
||||
else if (ItemColTemplate != null)
|
||||
{
|
||||
@ItemColTemplate(context)
|
||||
@ItemColWithDTTemplate(context)
|
||||
}
|
||||
else
|
||||
{
|
||||
@if (context.Header.CellClass?.Contains("text-truncate") == true)
|
||||
if (context?.Value?.GetType() == typeof(DateTime))
|
||||
{
|
||||
<span title=@context.Value>
|
||||
@context.Value
|
||||
<span>
|
||||
@(((DateTime)context.Value).ToDefaultDateTimeFormat(InitTimezone.TimezoneOffset))
|
||||
</span>
|
||||
}
|
||||
else if (ItemColTemplate != null)
|
||||
{
|
||||
@ItemColTemplate(context)
|
||||
}
|
||||
else
|
||||
{
|
||||
@context.Value
|
||||
}
|
||||
@if (context.Header.CellClass?.Contains("text-truncate") == true)
|
||||
{
|
||||
<span title=@context.Value>
|
||||
@context.Value
|
||||
</span>
|
||||
}
|
||||
else
|
||||
{
|
||||
@context.Value
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
</ItemColContent>
|
||||
</MDataTable>
|
||||
@@ -309,16 +310,24 @@
|
||||
{
|
||||
string value = DetailModelPairs[item.Value];
|
||||
{
|
||||
<tr @key="item.Text">
|
||||
<td class="text-start table-minwidth">
|
||||
@item.Text
|
||||
</td>
|
||||
<td class="text-start ">
|
||||
<div style="word-break:break-all; white-space:pre-wrap;">
|
||||
@value
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@if (Detailemplate != null)
|
||||
{
|
||||
@Detailemplate((item,value))
|
||||
}
|
||||
else
|
||||
{
|
||||
<tr @key="item.Text">
|
||||
<td class="text-start table-minwidth">
|
||||
@item.Text
|
||||
</td>
|
||||
<td class="text-start ">
|
||||
<div style="word-break:break-all; white-space:pre-wrap;">
|
||||
@value
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -72,12 +72,6 @@ public partial class AppDataTable<TItem, SearchItem, AddItem, EditItem> : IAppDa
|
||||
[Parameter]
|
||||
public bool Dense { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获得/设置 明细行模板
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public RenderFragment<TItem> DetailRowTemplate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 编辑项委托
|
||||
/// </summary>
|
||||
@@ -89,6 +83,11 @@ public partial class AppDataTable<TItem, SearchItem, AddItem, EditItem> : IAppDa
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public RenderFragment<EditItem> EditTemplate { get; set; }
|
||||
/// <summary>
|
||||
/// 获得/设置 详情模板
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public RenderFragment<(DataTableHeader<TItem>, string)> Detailemplate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 表头过滤,返回DataTableHeader列表,传输参数已包含全部初始表头与表头标题
|
||||
@@ -193,6 +192,13 @@ public partial class AppDataTable<TItem, SearchItem, AddItem, EditItem> : IAppDa
|
||||
[Parameter]
|
||||
public RenderFragment<ItemColProps<TItem>> ItemColTemplate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 独立设置 Table Cols 模板,需自行实现DateTime类型的时区转换
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public RenderFragment<ItemColProps<TItem>> ItemColWithDTTemplate { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 当前显示项目
|
||||
/// </summary>
|
||||
@@ -276,6 +282,7 @@ public partial class AppDataTable<TItem, SearchItem, AddItem, EditItem> : IAppDa
|
||||
{
|
||||
SearchModel.Size = PageItems.Total;
|
||||
}
|
||||
selectedItem = new List<TItem>();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -457,13 +464,9 @@ public partial class AppDataTable<TItem, SearchItem, AddItem, EditItem> : IAppDa
|
||||
if (item != BlazorResourceConst.DataTableActions)
|
||||
{
|
||||
var value = typeof(TItem).GetMemberInfoValue(DetailModel, item);
|
||||
if (value is DateTimeOffset dt)
|
||||
if (value is DateTime dt2)
|
||||
{
|
||||
value = dt.ToOffset(InitTimezone.TimezoneOffset).ToDefaultDateTimeFormat();
|
||||
}
|
||||
else if (value is DateTime dt2)
|
||||
{
|
||||
value = dt2.Add(InitTimezone.TimezoneOffset).ToDefaultDateTimeFormat();
|
||||
value = dt2.ToDefaultDateTimeFormat(InitTimezone.TimezoneOffset);
|
||||
}
|
||||
keyValuePairs.Add(item, value?.ToString());
|
||||
}
|
||||
|
@@ -1,12 +1,12 @@
|
||||
#region copyright
|
||||
#region copyright
|
||||
//------------------------------------------------------------------------------
|
||||
// <EFBFBD>˴<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊȫ<EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ԭ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ر<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>·<EFBFBD><EFBFBD>ֶ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// <EFBFBD>˴<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ر<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĵ<EFBFBD><EFBFBD>룩<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>߱<EFBFBD><EFBFBD><EFBFBD>Diego<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// Դ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD><EFBFBD>Э<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѭ<EFBFBD><EFBFBD><EFBFBD>ֿ<EFBFBD><EFBFBD>Ŀ<EFBFBD>ԴЭ<EFBFBD>鼰<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Э<EFBFBD><EFBFBD>
|
||||
// GiteeԴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֿ⣺https://gitee.com/diego2098/ThingsGateway
|
||||
// GithubԴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֿ⣺https://github.com/kimdiego2098/ThingsGateway
|
||||
// ʹ<EFBFBD><EFBFBD><EFBFBD>ĵ<EFBFBD><EFBFBD><EFBFBD>https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQȺ<EFBFBD><EFBFBD>605534569
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
// 源代码使用协议遵循本仓库的开源协议及附加协议
|
||||
// Gitee源代码仓库:https://gitee.com/diego2098/ThingsGateway
|
||||
// Github源代码仓库:https://github.com/kimdiego2098/ThingsGateway
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
#endregion
|
||||
|
||||
|
@@ -14,8 +14,7 @@
|
||||
@using System.Linq.Expressions;
|
||||
@using Microsoft.AspNetCore.Authorization;
|
||||
@using ThingsGateway.Admin.Application;
|
||||
|
||||
@inject IConfigService ConfigService
|
||||
|
||||
@namespace ThingsGateway.Admin.Blazor
|
||||
@attribute [Authorize]
|
||||
@inject UserResoures UserResoures
|
||||
|
@@ -41,26 +41,26 @@ public partial class Config
|
||||
MainLayout MainLayout { get; set; }
|
||||
private Task AddCallAsync(ConfigAddInput input)
|
||||
{
|
||||
return ConfigService.AddAsync(input);
|
||||
return App.GetService<ConfigService>().AddAsync(input);
|
||||
}
|
||||
|
||||
private Task DeleteCallAsync(IEnumerable<SysConfig> sysConfigs)
|
||||
{
|
||||
return ConfigService.DeleteAsync(sysConfigs.Select(a => a.Id).ToArray());
|
||||
return App.GetService<ConfigService>().DeleteAsync(sysConfigs.Select(a => a.Id).ToArray());
|
||||
}
|
||||
private Task EditCallAsync(ConfigEditInput sysConfigs)
|
||||
{
|
||||
return ConfigService.EditAsync(sysConfigs);
|
||||
return App.GetService<ConfigService>().EditAsync(sysConfigs);
|
||||
}
|
||||
|
||||
private async Task OnSaveAsync()
|
||||
{
|
||||
await ConfigService.EditBatchAsync(_sysConfig);
|
||||
await App.GetService<ConfigService>().EditBatchAsync(_sysConfig);
|
||||
await MainLayout.StateHasChangedAsync();
|
||||
await PopupService.EnqueueSnackbarAsync("成功", AlertTypes.Success);
|
||||
}
|
||||
private Task<SqlSugarPagedList<SysConfig>> QueryCallAsync(ConfigPageInput input)
|
||||
{
|
||||
return ConfigService.PageAsync(input);
|
||||
return App.GetService<ConfigService>().PageAsync(input);
|
||||
}
|
||||
}
|
@@ -66,7 +66,7 @@
|
||||
Small>
|
||||
<MRow Class="pt-1">
|
||||
<MCol Cols="4">
|
||||
<span class="text-caption">@item.OpTime.ToDefaultDateTimeFormat()</span>
|
||||
<span class="text-caption">@item.OpTime.ToDefaultDateTimeFormat(InitTimezone.TimezoneOffset)</span>
|
||||
</MCol>
|
||||
<MCol>
|
||||
<div class="text-body-1">@item.Name</div>
|
||||
@@ -93,7 +93,7 @@
|
||||
Small>
|
||||
<MRow Class="pt-1">
|
||||
<MCol Cols="4">
|
||||
<span class="text-caption">@item.OpTime.ToDefaultDateTimeFormat()</span>
|
||||
<span class="text-caption">@item.OpTime.ToDefaultDateTimeFormat(InitTimezone.TimezoneOffset)</span>
|
||||
</MCol>
|
||||
<MCol>
|
||||
<div class="text-body-1">@item.Name</div>
|
||||
|
@@ -1,12 +1,12 @@
|
||||
#region copyright
|
||||
#region copyright
|
||||
//------------------------------------------------------------------------------
|
||||
// <EFBFBD>˴<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊȫ<EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ԭ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ر<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>·<EFBFBD><EFBFBD>ֶ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// <EFBFBD>˴<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ر<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĵ<EFBFBD><EFBFBD>룩<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>߱<EFBFBD><EFBFBD><EFBFBD>Diego<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// Դ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD><EFBFBD>Э<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѭ<EFBFBD><EFBFBD><EFBFBD>ֿ<EFBFBD><EFBFBD>Ŀ<EFBFBD>ԴЭ<EFBFBD>鼰<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Э<EFBFBD><EFBFBD>
|
||||
// GiteeԴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֿ⣺https://gitee.com/diego2098/ThingsGateway
|
||||
// GithubԴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֿ⣺https://github.com/kimdiego2098/ThingsGateway
|
||||
// ʹ<EFBFBD><EFBFBD><EFBFBD>ĵ<EFBFBD><EFBFBD><EFBFBD>https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQȺ<EFBFBD><EFBFBD>605534569
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
// 源代码使用协议遵循本仓库的开源协议及附加协议
|
||||
// Gitee源代码仓库:https://gitee.com/diego2098/ThingsGateway
|
||||
// Github源代码仓库:https://github.com/kimdiego2098/ThingsGateway
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
#endregion
|
||||
|
||||
@@ -18,7 +18,7 @@ using ThingsGateway.Admin.Core;
|
||||
|
||||
namespace ThingsGateway.Admin.Blazor;
|
||||
/// <summary>
|
||||
/// <EFBFBD><EFBFBD>ҳ
|
||||
/// 首页
|
||||
/// </summary>
|
||||
public partial class Index
|
||||
{
|
||||
|
@@ -16,7 +16,7 @@
|
||||
@using Masa.Blazor.Presets;
|
||||
@using Microsoft.AspNetCore.Authorization;
|
||||
@using ThingsGateway.Admin.Application;
|
||||
@inject IMenuService MenuService
|
||||
|
||||
@namespace ThingsGateway.Admin.Blazor
|
||||
@attribute [Authorize]
|
||||
@inherits BaseComponentBase
|
||||
|
@@ -29,14 +29,11 @@ public partial class Menu
|
||||
long buttonParentId;
|
||||
bool IsShowButtonList;
|
||||
List<SysResource> MenuCatalog = new();
|
||||
[Inject]
|
||||
IButtonService ButtonService { get; set; }
|
||||
|
||||
|
||||
[CascadingParameter]
|
||||
MainLayout MainLayout { get; set; }
|
||||
|
||||
[Inject]
|
||||
IResourceService ResourceService { get; set; }
|
||||
/// <summary>
|
||||
/// <inheritdoc/>
|
||||
/// </summary>
|
||||
@@ -52,23 +49,23 @@ public partial class Menu
|
||||
private async Task AddCallAsync(MenuAddInput input)
|
||||
{
|
||||
input.ParentId = search.ParentId;
|
||||
await MenuService.AddAsync(input);
|
||||
await App.GetService<MenuService>().AddAsync(input);
|
||||
await NavChangeAsync();
|
||||
}
|
||||
private async Task ButtonAddCallAsync(ButtonAddInput input)
|
||||
{
|
||||
input.ParentId = buttonParentId;
|
||||
await ButtonService.AddAsync(input);
|
||||
await App.GetService<ButtonService>().AddAsync(input);
|
||||
}
|
||||
|
||||
private Task ButtonDeleteCallAsync(IEnumerable<SysResource> input)
|
||||
{
|
||||
return ButtonService.DeleteAsync(input.Select(a => a.Id).ToArray());
|
||||
return App.GetService<ButtonService>().DeleteAsync(input.Select(a => a.Id).ToArray());
|
||||
}
|
||||
|
||||
private Task ButtonEditCallAsync(ButtonEditInput input)
|
||||
{
|
||||
return ButtonService.EditAsync(input);
|
||||
return App.GetService<ButtonService>().EditAsync(input);
|
||||
|
||||
}
|
||||
|
||||
@@ -92,7 +89,7 @@ public partial class Menu
|
||||
private async Task<SqlSugarPagedList<SysResource>> ButtonQueryCallAsync(ButtonPageInput input)
|
||||
{
|
||||
input.ParentId = buttonParentId;
|
||||
var data = await ButtonService.PageAsync(input);
|
||||
var data = await App.GetService<ButtonService>().PageAsync(input);
|
||||
return data;
|
||||
}
|
||||
|
||||
@@ -103,13 +100,13 @@ public partial class Menu
|
||||
|
||||
private async Task DeleteCallAsync(IEnumerable<SysResource> input)
|
||||
{
|
||||
await MenuService.DeleteAsync(input.Select(a => a.Id).ToArray());
|
||||
await App.GetService<MenuService>().DeleteAsync(input.Select(a => a.Id).ToArray());
|
||||
await NavChangeAsync();
|
||||
|
||||
}
|
||||
private async Task EditCallAsync(MenuEditInput input)
|
||||
{
|
||||
await MenuService.EditAsync(input);
|
||||
await App.GetService<MenuService>().EditAsync(input);
|
||||
await NavChangeAsync();
|
||||
|
||||
}
|
||||
@@ -117,9 +114,9 @@ public partial class Menu
|
||||
private async Task<List<SysResource>> GetMenuCatalogAsync()
|
||||
{
|
||||
//获取所有菜单
|
||||
List<SysResource> sysResources = await ResourceService.GetListByCategoryAsync(ResourceCategoryEnum.MENU);
|
||||
List<SysResource> sysResources = await App.GetService<ResourceService>().GetListByCategoryAsync(ResourceCategoryEnum.MENU);
|
||||
sysResources = sysResources.Where(it => it.TargetType == TargetTypeEnum.None).ToList();
|
||||
MenuCatalog = ResourceService.ResourceListToTree(sysResources);
|
||||
MenuCatalog = App.GetService<ResourceService>().ResourceListToTree(sysResources);
|
||||
return MenuCatalog;
|
||||
}
|
||||
|
||||
@@ -130,7 +127,7 @@ public partial class Menu
|
||||
}
|
||||
private async Task<SqlSugarPagedList<SysResource>> QueryCallAsync(MenuPageInput input)
|
||||
{
|
||||
var data = await MenuService.TreeAsync(input);
|
||||
var data = await App.GetService<MenuService>().TreeAsync(input);
|
||||
return data.ToPagedList(input);
|
||||
}
|
||||
|
||||
|
@@ -15,7 +15,7 @@
|
||||
@using Masa.Blazor.Presets;
|
||||
@using Microsoft.AspNetCore.Authorization;
|
||||
@using ThingsGateway.Admin.Application;
|
||||
@inject IOpenApiSessionService SessionService
|
||||
|
||||
@namespace ThingsGateway.Admin.Blazor
|
||||
@attribute [Authorize]
|
||||
@inject UserResoures UserResoures
|
||||
|
@@ -33,13 +33,13 @@ public partial class OpenApiSession
|
||||
var confirm = await PopupService.OpenConfirmDialogAsync("警告", "确定 ?");
|
||||
if (confirm)
|
||||
{
|
||||
await SessionService.ExitSessionAsync(id);
|
||||
await App.GetService<OpenApiSessionService>().ExitSessionAsync(id);
|
||||
}
|
||||
}
|
||||
|
||||
private Task<SqlSugarPagedList<OpenApiSessionOutput>> SessionQueryCallAsync(OpenApiSessionPageInput input)
|
||||
{
|
||||
return SessionService.PageAsync(input);
|
||||
return App.GetService<OpenApiSessionService>().PageAsync(input);
|
||||
}
|
||||
|
||||
private async Task ShowVerificatListAsync(List<VerificatInfo> verificatInfos)
|
||||
@@ -57,7 +57,7 @@ public partial class OpenApiSession
|
||||
VerificatIds = verificats.Select(it => it.Id).ToList(),
|
||||
Id = verificats.First().UserId
|
||||
};
|
||||
await SessionService.ExitVerificatAsync(send);
|
||||
await App.GetService<OpenApiSessionService>().ExitVerificatAsync(send);
|
||||
_verificatInfos.RemoveWhere(it => send.VerificatIds.Contains(it.Id));
|
||||
}
|
||||
|
||||
|
@@ -15,7 +15,7 @@
|
||||
@using Microsoft.AspNetCore.Authorization;
|
||||
@using ThingsGateway.Admin.Application;
|
||||
@using Masa.Blazor.Presets;
|
||||
@inject IOpenApiUserService OpenApiUserService
|
||||
|
||||
@namespace ThingsGateway.Admin.Blazor
|
||||
@attribute [Authorize]
|
||||
@inject UserResoures UserResoures
|
||||
|
@@ -31,21 +31,20 @@ public partial class OpenApiUserR
|
||||
bool IsShowRoles;
|
||||
List<OpenApiPermissionTreeSelector> RolesChoice = new();
|
||||
string SearchName;
|
||||
[Inject]
|
||||
IRoleService SysRoleService { get; set; }
|
||||
|
||||
private Task AddCallAsync(OpenApiUserAddInput input)
|
||||
{
|
||||
return OpenApiUserService.AddAsync(input);
|
||||
return App.GetService<OpenApiUserService>().AddAsync(input);
|
||||
}
|
||||
|
||||
private async Task DeleteCallAsync(IEnumerable<OpenApiUser> users)
|
||||
{
|
||||
await OpenApiUserService.DeleteAsync(users.Select(a => a.Id).ToArray());
|
||||
await App.GetService<OpenApiUserService>().DeleteAsync(users.Select(a => a.Id).ToArray());
|
||||
}
|
||||
|
||||
private Task EditCallAsync(OpenApiUserEditInput users)
|
||||
{
|
||||
return OpenApiUserService.EditAsync(users);
|
||||
return App.GetService<OpenApiUserService>().EditAsync(users);
|
||||
}
|
||||
|
||||
private List<OpenApiPermissionTreeSelector> GetRouters()
|
||||
@@ -61,7 +60,7 @@ public partial class OpenApiUserR
|
||||
OpenApiUserGrantPermissionInput userGrantRoleInput = new();
|
||||
userGrantRoleInput.Id = ChoiceUserId;
|
||||
userGrantRoleInput.PermissionList = RolesChoice.Select(it => it.ApiRoute).ToList();
|
||||
await OpenApiUserService.GrantRoleAsync(userGrantRoleInput);
|
||||
await App.GetService<OpenApiUserService>().GrantRoleAsync(userGrantRoleInput);
|
||||
IsShowRoles = false;
|
||||
await _datatable?.QueryClickAsync();
|
||||
}
|
||||
@@ -73,7 +72,7 @@ public partial class OpenApiUserR
|
||||
}
|
||||
private Task<SqlSugarPagedList<OpenApiUser>> QueryCallAsync(OpenApiUserPageInput input)
|
||||
{
|
||||
return OpenApiUserService.PageAsync(input);
|
||||
return App.GetService<OpenApiUserService>().PageAsync(input);
|
||||
}
|
||||
|
||||
private async Task UserStatusChangeAsync(OpenApiUser context, bool enable)
|
||||
@@ -81,9 +80,9 @@ public partial class OpenApiUserR
|
||||
try
|
||||
{
|
||||
if (enable)
|
||||
await OpenApiUserService.EnableUserAsync(context.Id);
|
||||
await App.GetService<OpenApiUserService>().EnableUserAsync(context.Id);
|
||||
else
|
||||
await OpenApiUserService.DisableUserAsync(context.Id);
|
||||
await App.GetService<OpenApiUserService>().DisableUserAsync(context.Id);
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
@@ -14,7 +14,7 @@
|
||||
@using System.Linq.Expressions;
|
||||
@using Microsoft.AspNetCore.Authorization;
|
||||
@using ThingsGateway.Admin.Application;
|
||||
@inject IOperateLogService OperateLogService
|
||||
|
||||
@namespace ThingsGateway.Admin.Blazor
|
||||
@attribute [Authorize]
|
||||
@inject UserResoures UserResoures
|
||||
|
@@ -44,7 +44,7 @@ public partial class Oplog
|
||||
var confirm = await PopupService.OpenConfirmDialogAsync("删除", "确定 ?");
|
||||
if (confirm)
|
||||
{
|
||||
await OperateLogService.DeleteAsync(CategoryFilters.Select(it => it.Value).ToArray());
|
||||
await App.GetService<OperateLogService>().DeleteAsync(CategoryFilters.Select(it => it.Value).ToArray());
|
||||
await _datatable?.QueryClickAsync();
|
||||
}
|
||||
}
|
||||
@@ -54,7 +54,7 @@ public partial class Oplog
|
||||
input.Account = search.Account;
|
||||
input.Category = search.Category;
|
||||
input.ExeStatus = search.ExeStatus;
|
||||
return OperateLogService.PageAsync(input);
|
||||
return App.GetService<OperateLogService>().PageAsync(input);
|
||||
}
|
||||
[Inject]
|
||||
AjaxService AjaxService { get; set; }
|
||||
|
@@ -16,7 +16,7 @@
|
||||
@using Masa.Blazor.Presets;
|
||||
@using Microsoft.AspNetCore.Authorization;
|
||||
@using ThingsGateway.Admin.Application;
|
||||
@inject IRoleService SysRoleService
|
||||
|
||||
@namespace ThingsGateway.Admin.Blazor
|
||||
@attribute [Authorize]
|
||||
@inject UserResoures UserResoures
|
||||
|
@@ -38,27 +38,23 @@ public partial class Role
|
||||
[CascadingParameter]
|
||||
MainLayout MainLayout { get; set; }
|
||||
|
||||
[Inject]
|
||||
IResourceService ResourceService { get; set; }
|
||||
|
||||
|
||||
private string SearchKey { get; set; }
|
||||
|
||||
[Inject]
|
||||
ISysUserService SysUserService { get; set; }
|
||||
|
||||
private Task AddCallAsync(RoleAddInput input)
|
||||
{
|
||||
return SysRoleService.AddAsync(input);
|
||||
return App.GetService<RoleService>().AddAsync(input);
|
||||
}
|
||||
private async Task DeleteCallAsync(IEnumerable<SysRole> sysRoles)
|
||||
{
|
||||
await SysRoleService.DeleteAsync(sysRoles.Select(a => a.Id).ToArray());
|
||||
await App.GetService<RoleService>().DeleteAsync(sysRoles.Select(a => a.Id).ToArray());
|
||||
await MainLayout.StateHasChangedAsync();
|
||||
}
|
||||
|
||||
private async Task EditCallAsync(RoleEditInput input)
|
||||
{
|
||||
await SysRoleService.EditAsync(input);
|
||||
await App.GetService<RoleService>().EditAsync(input);
|
||||
await MainLayout.StateHasChangedAsync();
|
||||
}
|
||||
private async Task OnRoleHasResuorcesSaveAsync(ModalActionEventArgs args)
|
||||
@@ -69,7 +65,7 @@ public partial class Role
|
||||
var data = new List<SysResource>();
|
||||
userGrantRoleInput.Id = ChoiceRoleId;
|
||||
userGrantRoleInput.GrantInfoList = RoleHasResuorces;
|
||||
await SysRoleService.GrantResourceAsync(userGrantRoleInput);
|
||||
await App.GetService<RoleService>().GrantResourceAsync(userGrantRoleInput);
|
||||
IsShowResuorces = false;
|
||||
}
|
||||
catch (Exception ex)
|
||||
@@ -86,7 +82,7 @@ public partial class Role
|
||||
GrantUserInput userGrantRoleInput = new();
|
||||
userGrantRoleInput.Id = ChoiceRoleId;
|
||||
userGrantRoleInput.GrantInfoList = UsersChoice.Select(it => it.Id).ToList();
|
||||
await SysRoleService.GrantUserAsync(userGrantRoleInput);
|
||||
await App.GetService<RoleService>().GrantUserAsync(userGrantRoleInput);
|
||||
IsShowUsers = false;
|
||||
}
|
||||
catch (Exception ex)
|
||||
@@ -99,19 +95,19 @@ public partial class Role
|
||||
|
||||
private Task<SqlSugarPagedList<SysRole>> QueryCallAsync(RolePageInput input)
|
||||
{
|
||||
return SysRoleService.PageAsync(input);
|
||||
return App.GetService<RoleService>().PageAsync(input);
|
||||
}
|
||||
|
||||
private async Task ResuorceInitAsync()
|
||||
{
|
||||
ResTreeSelectors = (await ResourceService.GetRoleGrantResourceMenusAsync());
|
||||
RoleHasResuorces = (await SysRoleService.OwnResourceAsync(ChoiceRoleId))?.GrantInfoList;
|
||||
ResTreeSelectors = (await App.GetService<ResourceService>().GetRoleGrantResourceMenusAsync());
|
||||
RoleHasResuorces = (await App.GetService<RoleService>().OwnResourceAsync(ChoiceRoleId))?.GrantInfoList;
|
||||
}
|
||||
|
||||
private async Task<List<UserSelectorOutput>> UserInitAsync()
|
||||
{
|
||||
AllUsers = await SysUserService.UserSelectorAsync(SearchKey);
|
||||
var data = await SysRoleService.OwnUserAsync(ChoiceRoleId);
|
||||
AllUsers = await App.GetService<SysUserService>().UserSelectorAsync(SearchKey);
|
||||
var data = await App.GetService<RoleService>().OwnUserAsync(ChoiceRoleId);
|
||||
UsersChoice = AllUsers.Where(a => data.Contains(a.Id)).ToList();
|
||||
return AllUsers;
|
||||
}
|
||||
|
@@ -15,8 +15,7 @@
|
||||
@using Masa.Blazor.Presets;
|
||||
@using Microsoft.AspNetCore.Authorization;
|
||||
@using ThingsGateway.Admin.Application;
|
||||
|
||||
@inject ISessionService SessionService
|
||||
|
||||
@namespace ThingsGateway.Admin.Blazor
|
||||
@attribute [Authorize]
|
||||
@inject UserResoures UserResoures
|
||||
|
@@ -33,14 +33,14 @@ public partial class Session
|
||||
var confirm = await PopupService.OpenConfirmDialogAsync("警告", "确定 ?");
|
||||
if (confirm)
|
||||
{
|
||||
await SessionService.ExitSessionAsync(id);
|
||||
await App.GetService<SessionService>().ExitSessionAsync(id);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private Task<SqlSugarPagedList<SessionOutput>> SessionQueryCallAsync(SessionPageInput input)
|
||||
{
|
||||
return SessionService.PageAsync(input);
|
||||
return App.GetService<SessionService>().PageAsync(input);
|
||||
}
|
||||
|
||||
private async Task ShowVerificatListAsync(List<VerificatInfo> verificatInfos)
|
||||
@@ -58,7 +58,7 @@ public partial class Session
|
||||
VerificatIds = verificats.Select(it => it.Id).ToList(),
|
||||
Id = verificats.First().UserId
|
||||
};
|
||||
await SessionService.ExitVerificatAsync(send);
|
||||
await App.GetService<SessionService>().ExitVerificatAsync(send);
|
||||
_verificatInfos.RemoveWhere(it => send.VerificatIds.Contains(it.Id));
|
||||
}
|
||||
|
||||
|
@@ -16,7 +16,7 @@
|
||||
@using Masa.Blazor.Presets;
|
||||
@using Microsoft.AspNetCore.Authorization;
|
||||
@using ThingsGateway.Admin.Application;
|
||||
@inject ISpaService SpaService
|
||||
|
||||
@namespace ThingsGateway.Admin.Blazor
|
||||
@attribute [Authorize]
|
||||
@inherits BaseComponentBase
|
||||
|
@@ -27,23 +27,23 @@ public partial class Spa
|
||||
|
||||
private async Task AddCallAsync(SpaAddInput input)
|
||||
{
|
||||
await SpaService.AddAsync(input);
|
||||
await App.GetService<SpaService>().AddAsync(input);
|
||||
await MainLayout.StateHasChangedAsync();
|
||||
}
|
||||
private async Task DeleteCallAsync(IEnumerable<SysResource> input)
|
||||
{
|
||||
await SpaService.DeleteAsync(input.Select(a => a.Id).ToArray());
|
||||
await App.GetService<SpaService>().DeleteAsync(input.Select(a => a.Id).ToArray());
|
||||
await MainLayout.StateHasChangedAsync();
|
||||
}
|
||||
|
||||
private async Task EditCallAsync(SpaEditInput input)
|
||||
{
|
||||
await SpaService.EditAsync(input);
|
||||
await App.GetService<SpaService>().EditAsync(input);
|
||||
await MainLayout.StateHasChangedAsync();
|
||||
}
|
||||
|
||||
private Task<SqlSugarPagedList<SysResource>> QueryCallAsync(SpaPageInput input)
|
||||
{
|
||||
return SpaService.PageAsync(input);
|
||||
return App.GetService<SpaService>().PageAsync(input);
|
||||
}
|
||||
}
|
@@ -11,7 +11,7 @@
|
||||
*@
|
||||
|
||||
@page "/admin/user"
|
||||
@inject ISysUserService SysUserService
|
||||
|
||||
@namespace ThingsGateway.Admin.Blazor
|
||||
@using Masa.Blazor.Presets;
|
||||
@using Microsoft.AspNetCore.Authorization;
|
||||
|
@@ -34,21 +34,20 @@ public partial class User
|
||||
[CascadingParameter]
|
||||
MainLayout MainLayout { get; set; }
|
||||
|
||||
[Inject]
|
||||
IRoleService SysRoleService { get; set; }
|
||||
|
||||
private Task AddCallAsync(UserAddInput input)
|
||||
{
|
||||
return SysUserService.AddAsync(input);
|
||||
return App.GetService<SysUserService>().AddAsync(input);
|
||||
}
|
||||
private async Task DeleteCallAsync(IEnumerable<SysUser> users)
|
||||
{
|
||||
await SysUserService.DeleteAsync(users.Select(a => a.Id).ToArray());
|
||||
await App.GetService<SysUserService>().DeleteAsync(users.Select(a => a.Id).ToArray());
|
||||
await MainLayout.StateHasChangedAsync();
|
||||
}
|
||||
|
||||
private async Task EditCallAsync(UserEditInput users)
|
||||
{
|
||||
await SysUserService.EditAsync(users);
|
||||
await App.GetService<SysUserService>().EditAsync(users);
|
||||
await MainLayout.StateHasChangedAsync();
|
||||
}
|
||||
|
||||
@@ -59,7 +58,7 @@ public partial class User
|
||||
UserGrantRoleInput userGrantRoleInput = new();
|
||||
userGrantRoleInput.Id = ChoiceUserId;
|
||||
userGrantRoleInput.RoleIdList = RolesChoice.Select(it => it.Id).ToList();
|
||||
await SysUserService.GrantRoleAsync(userGrantRoleInput);
|
||||
await App.GetService<SysUserService>().GrantRoleAsync(userGrantRoleInput);
|
||||
IsShowRoles = false;
|
||||
}
|
||||
catch (Exception ex)
|
||||
@@ -71,20 +70,20 @@ public partial class User
|
||||
}
|
||||
private Task<SqlSugarPagedList<SysUser>> QueryCallAsync(UserPageInput input)
|
||||
{
|
||||
return SysUserService.PageAsync(input);
|
||||
return App.GetService<SysUserService>().PageAsync(input);
|
||||
}
|
||||
|
||||
private async Task ResetPasswordAsync(SysUser sysUser)
|
||||
{
|
||||
await SysUserService.ResetPasswordAsync(sysUser.Id);
|
||||
await App.GetService<SysUserService>().ResetPasswordAsync(sysUser.Id);
|
||||
await PopupService.EnqueueSnackbarAsync(new("成功", AlertTypes.Success));
|
||||
await MainLayout.StateHasChangedAsync();
|
||||
}
|
||||
|
||||
private async Task RoleInitAsync()
|
||||
{
|
||||
AllRoles = await SysRoleService.RoleSelectorAsync();
|
||||
var data = await SysRoleService.GetRoleIdListByUserIdAsync(ChoiceUserId);
|
||||
AllRoles = await App.GetService<RoleService>().RoleSelectorAsync();
|
||||
var data = await App.GetService<RoleService>().GetRoleIdListByUserIdAsync(ChoiceUserId);
|
||||
RolesChoice = AllRoles.Where(a => data.Contains(a.Id)).ToList();
|
||||
}
|
||||
private async Task UserStatusChangeAsync(SysUser context, bool enable)
|
||||
@@ -92,9 +91,9 @@ public partial class User
|
||||
try
|
||||
{
|
||||
if (enable)
|
||||
await SysUserService.EnableUserAsync(context.Id);
|
||||
await App.GetService<SysUserService>().EnableUserAsync(context.Id);
|
||||
else
|
||||
await SysUserService.DisableUserAsync(context.Id);
|
||||
await App.GetService<SysUserService>().DisableUserAsync(context.Id);
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
@@ -1,12 +1,12 @@
|
||||
#region copyright
|
||||
#region copyright
|
||||
//------------------------------------------------------------------------------
|
||||
// <EFBFBD>˴<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊȫ<EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ԭ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ر<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>·<EFBFBD><EFBFBD>ֶ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// <EFBFBD>˴<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ر<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĵ<EFBFBD><EFBFBD>룩<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>߱<EFBFBD><EFBFBD><EFBFBD>Diego<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// Դ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD><EFBFBD>Э<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѭ<EFBFBD><EFBFBD><EFBFBD>ֿ<EFBFBD><EFBFBD>Ŀ<EFBFBD>ԴЭ<EFBFBD>鼰<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Э<EFBFBD><EFBFBD>
|
||||
// GiteeԴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֿ⣺https://gitee.com/diego2098/ThingsGateway
|
||||
// GithubԴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֿ⣺https://github.com/kimdiego2098/ThingsGateway
|
||||
// ʹ<EFBFBD><EFBFBD><EFBFBD>ĵ<EFBFBD><EFBFBD><EFBFBD>https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQȺ<EFBFBD><EFBFBD>605534569
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
// 源代码使用协议遵循本仓库的开源协议及附加协议
|
||||
// Gitee源代码仓库:https://gitee.com/diego2098/ThingsGateway
|
||||
// Github源代码仓库:https://github.com/kimdiego2098/ThingsGateway
|
||||
// 使用文档:https://diego2098.gitee.io/thingsgateway-docs/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
#endregion
|
||||
|
||||
@@ -18,7 +18,7 @@ using ThingsGateway.Admin.Core;
|
||||
|
||||
namespace ThingsGateway.Admin.Blazor;
|
||||
/// <summary>
|
||||
/// <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
/// 个人设置
|
||||
/// </summary>
|
||||
public partial class UserCenter
|
||||
{
|
||||
@@ -33,8 +33,7 @@ public partial class UserCenter
|
||||
[Inject]
|
||||
NavigationManager NavigationManager { get; set; }
|
||||
|
||||
[Inject]
|
||||
IUserCenterService UserCenterService { get; set; }
|
||||
|
||||
|
||||
/// <inheritdoc/>
|
||||
protected override async Task OnParametersSetAsync()
|
||||
@@ -48,27 +47,27 @@ public partial class UserCenter
|
||||
|
||||
async Task OnDefaultRazorSaveAsync()
|
||||
{
|
||||
await UserCenterService.UpdateUserDefaultRazorAsync(UserManager.UserId, DefaultMenuId);
|
||||
await App.GetService<UserCenterService>().UpdateUserDefaultRazorAsync(UserManager.UserId, DefaultMenuId);
|
||||
await MainLayout.StateHasChangedAsync();
|
||||
await PopupService.EnqueueSnackbarAsync("<EFBFBD>ɹ<EFBFBD>", AlertTypes.Success);
|
||||
await PopupService.EnqueueSnackbarAsync("成功", AlertTypes.Success);
|
||||
}
|
||||
|
||||
async Task OnShortcutSaveAsync()
|
||||
{
|
||||
await UserCenterService.UpdateWorkbenchAsync(_menusChoice);
|
||||
await App.GetService<UserCenterService>().UpdateWorkbenchAsync(_menusChoice);
|
||||
await MainLayout.StateHasChangedAsync();
|
||||
await PopupService.EnqueueSnackbarAsync("<EFBFBD>ɹ<EFBFBD>", AlertTypes.Success);
|
||||
await PopupService.EnqueueSnackbarAsync("成功", AlertTypes.Success);
|
||||
}
|
||||
async Task OnUpdatePasswordInfoAsync(FormContext context)
|
||||
{
|
||||
var success = context.Validate();
|
||||
if (success)
|
||||
{
|
||||
//<EFBFBD><EFBFBD>֤<EFBFBD>ɹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><EFBFBD>
|
||||
//验证成功,操作业务
|
||||
_passwordInfoInput.Id = UserResoures.CurrentUser.Id;
|
||||
await UserCenterService.EditPasswordAsync(_passwordInfoInput);
|
||||
await App.GetService<UserCenterService>().EditPasswordAsync(_passwordInfoInput);
|
||||
await MainLayout.StateHasChangedAsync();
|
||||
await PopupService.EnqueueSnackbarAsync("<EFBFBD>ɹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>µ<EFBFBD>¼", AlertTypes.Success);
|
||||
await PopupService.EnqueueSnackbarAsync("成功,将重新登录", AlertTypes.Success);
|
||||
await Task.Delay(2000);
|
||||
NavigationManager.NavigateTo(NavigationManager.Uri);
|
||||
}
|
||||
@@ -76,8 +75,8 @@ public partial class UserCenter
|
||||
|
||||
async Task OnUpdateUserInfoAsync()
|
||||
{
|
||||
await UserCenterService.UpdateUserInfoAsync(_updateInfoInput);
|
||||
await App.GetService<UserCenterService>().UpdateUserInfoAsync(_updateInfoInput);
|
||||
await MainLayout.StateHasChangedAsync();
|
||||
await PopupService.EnqueueSnackbarAsync("<EFBFBD>ɹ<EFBFBD>", AlertTypes.Success);
|
||||
await PopupService.EnqueueSnackbarAsync("成功", AlertTypes.Success);
|
||||
}
|
||||
}
|
@@ -14,8 +14,7 @@
|
||||
@using System.Linq.Expressions;
|
||||
@using Microsoft.AspNetCore.Authorization;
|
||||
@using ThingsGateway.Admin.Application;
|
||||
|
||||
@inject IVisitLogService VisitLogService
|
||||
|
||||
@namespace ThingsGateway.Admin.Blazor
|
||||
@attribute [Authorize]
|
||||
@inject UserResoures UserResoures
|
||||
|
@@ -51,14 +51,14 @@ public partial class Vislog
|
||||
var confirm = await PopupService.OpenConfirmDialogAsync("删除", "确定 ?");
|
||||
if (confirm)
|
||||
{
|
||||
await VisitLogService.DeleteAsync(CategoryFilters.Select(it => it.Value).ToArray());
|
||||
await App.GetService<VisitLogService>().DeleteAsync(CategoryFilters.Select(it => it.Value).ToArray());
|
||||
await _datatable?.QueryClickAsync();
|
||||
}
|
||||
}
|
||||
|
||||
private async Task<SqlSugarPagedList<SysVisitLog>> QueryCallAsync(VisitLogPageInput input)
|
||||
{
|
||||
var data = await VisitLogService.PageAsync(input);
|
||||
var data = await App.GetService<VisitLogService>().PageAsync(input);
|
||||
return data;
|
||||
}
|
||||
[Inject]
|
||||
|
@@ -21,6 +21,7 @@ using Microsoft.Extensions.Hosting;
|
||||
using ThingsGateway.Admin.Application;
|
||||
using ThingsGateway.Admin.Blazor.Core;
|
||||
using ThingsGateway.Admin.Core;
|
||||
using ThingsGateway.Admin.Core.JsonExtensions;
|
||||
|
||||
namespace ThingsGateway.Admin.Blazor;
|
||||
|
||||
@@ -39,10 +40,6 @@ public partial class Login
|
||||
AjaxService AjaxService { get; set; }
|
||||
|
||||
|
||||
[Inject]
|
||||
IAuthService AuthService { get; set; }
|
||||
|
||||
|
||||
|
||||
string UserLogoUrl { get; set; } = BlazorResourceConst.ResourceUrl + "images/defaultUser.svg";
|
||||
|
||||
@@ -64,12 +61,7 @@ public partial class Login
|
||||
}
|
||||
}
|
||||
private PImageCaptcha captcha;
|
||||
[Inject]
|
||||
IUserCenterService UserCenterService { get; set; }
|
||||
[Inject]
|
||||
IResourceService ResourceService { get; set; }
|
||||
[Inject]
|
||||
ISysUserService SysUserService { get; set; }
|
||||
|
||||
private async Task LoginAsync()
|
||||
{
|
||||
loginModel.ValidCodeReqNo = CaptchaInfo.ValidCodeReqNo;
|
||||
@@ -101,9 +93,9 @@ public partial class Login
|
||||
{
|
||||
await PopupService.EnqueueSnackbarAsync(new("登录成功", AlertTypes.Success));
|
||||
await Task.Delay(500);
|
||||
var userId = await SysUserService.GetIdByAccountAsync(loginModel.Account);
|
||||
var data = await UserCenterService.GetLoginDefaultRazorAsync(userId);
|
||||
var sameLevelMenus = await ResourceService.GetaMenuAndSpaListAsync();
|
||||
var userId = await App.GetService<SysUserService>().GetIdByAccountAsync(loginModel.Account);
|
||||
var data = await App.GetService<UserCenterService>().GetLoginDefaultRazorAsync(userId);
|
||||
var sameLevelMenus = await App.GetService<ResourceService>().GetaMenuAndSpaListAsync();
|
||||
if (NavigationManager.ToAbsoluteUri(NavigationManager.Uri).AbsolutePath == "/Login" || NavigationManager.ToAbsoluteUri(NavigationManager.Uri).AbsolutePath == "/")
|
||||
await AjaxService.GotoAsync(sameLevelMenus.FirstOrDefault(a => a.Id == data)?.Component ?? "index");
|
||||
else
|
||||
@@ -133,19 +125,19 @@ public partial class Login
|
||||
GetCaptchaInfo();
|
||||
CONFIG_TITLE = (await App.GetService<IConfigService>().GetByConfigKeyAsync(ConfigConst.SYS_CONFIGBASEDEFAULT, ConfigConst.CONFIG_TITLE))?.ConfigValue;
|
||||
CONFIG_REMARK = (await App.GetService<IConfigService>().GetByConfigKeyAsync(ConfigConst.SYS_CONFIGBASEDEFAULT, ConfigConst.CONFIG_REMARK))?.ConfigValue;
|
||||
_showCaptcha = (await App.GetService<IConfigService>().GetByConfigKeyAsync(ConfigConst.SYS_CONFIGBASEDEFAULT, ConfigConst.CONFIG_CAPTCHA_OPEN))?.ConfigValue?.ToBool() == true;
|
||||
_showCaptcha = (await App.GetService<IConfigService>().GetByConfigKeyAsync(ConfigConst.SYS_CONFIGBASEDEFAULT, ConfigConst.CONFIG_CAPTCHA_OPEN))?.ConfigValue?.ToBoolean() == true;
|
||||
Welcome = "欢迎使用" + CONFIG_TITLE + "!";
|
||||
await base.OnParametersSetAsync();
|
||||
}
|
||||
|
||||
private void GetCaptchaInfo()
|
||||
{
|
||||
CaptchaInfo = AuthService.GetCaptchaInfo();
|
||||
CaptchaInfo = App.GetService<AuthService>().GetCaptchaInfo();
|
||||
}
|
||||
|
||||
private Task<string> RefreshCode()
|
||||
{
|
||||
CaptchaInfo = AuthService.GetCaptchaInfo();
|
||||
CaptchaInfo = App.GetService<AuthService>().GetCaptchaInfo();
|
||||
return Task.FromResult(CaptchaInfo.CodeValue);
|
||||
}
|
||||
}
|
@@ -43,11 +43,6 @@
|
||||
表格紧凑
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:ThingsGateway.Admin.Blazor.Core.AppDataTable`4.DetailRowTemplate">
|
||||
<summary>
|
||||
获得/设置 明细行模板
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:ThingsGateway.Admin.Blazor.Core.AppDataTable`4.EditCallAsync">
|
||||
<summary>
|
||||
编辑项委托
|
||||
@@ -58,6 +53,11 @@
|
||||
获得/设置 编辑模板
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:ThingsGateway.Admin.Blazor.Core.AppDataTable`4.Detailemplate">
|
||||
<summary>
|
||||
获得/设置 详情模板
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:ThingsGateway.Admin.Blazor.Core.AppDataTable`4.FilterHeaders">
|
||||
<summary>
|
||||
表头过滤,返回DataTableHeader列表,传输参数已包含全部初始表头与表头标题
|
||||
@@ -148,6 +148,11 @@
|
||||
获得/设置 Table Cols 模板
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:ThingsGateway.Admin.Blazor.Core.AppDataTable`4.ItemColWithDTTemplate">
|
||||
<summary>
|
||||
独立设置 Table Cols 模板,需自行实现DateTime类型的时区转换
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:ThingsGateway.Admin.Blazor.Core.AppDataTable`4.Items">
|
||||
<summary>
|
||||
当前显示项目
|
||||
|
@@ -22,7 +22,7 @@ public class UserManager
|
||||
/// <summary>
|
||||
/// 是否超级管理员
|
||||
/// </summary>
|
||||
public static bool IsSuperAdmin => (App.User?.FindFirst(ClaimConst.IsSuperAdmin)?.Value).ToBool();
|
||||
public static bool IsSuperAdmin => (App.User?.FindFirst(ClaimConst.IsSuperAdmin)?.Value).ToBoolean();
|
||||
|
||||
/// <summary>
|
||||
/// 当前用户账号
|
||||
|
@@ -50,7 +50,7 @@ public abstract class BaseEntity : PrimaryKeyEntity
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "创建时间", IsOnlyIgnoreUpdate = true, IsNullable = true)]
|
||||
[IgnoreExcel]
|
||||
public virtual DateTimeOffset? CreateTime { get; set; }
|
||||
public virtual DateTime? CreateTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建人
|
||||
@@ -78,7 +78,7 @@ public abstract class BaseEntity : PrimaryKeyEntity
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "更新时间", IsOnlyIgnoreInsert = true, IsNullable = true)]
|
||||
[IgnoreExcel]
|
||||
public virtual DateTimeOffset? UpdateTime { get; set; }
|
||||
public virtual DateTime? UpdateTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 更新人
|
||||
|
@@ -54,7 +54,7 @@ public class OpenApiUser : BaseEntity
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "LastLoginTime", ColumnDescription = "上次登录时间", IsNullable = true)]
|
||||
[DataTable(Order = 10, IsShow = true, Sortable = true, DefaultFilter = true)]
|
||||
public DateTimeOffset? LastLoginTime { get; set; }
|
||||
public DateTime? LastLoginTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 最新登录设备
|
||||
@@ -75,7 +75,7 @@ public class OpenApiUser : BaseEntity
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "LatestLoginTime", ColumnDescription = "最新登录时间", IsNullable = true)]
|
||||
[DataTable(Order = 7, IsShow = true, Sortable = true)]
|
||||
public DateTimeOffset? LatestLoginTime { get; set; }
|
||||
public DateTime? LatestLoginTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 密码
|
||||
@@ -86,7 +86,7 @@ public class OpenApiUser : BaseEntity
|
||||
/// <summary>
|
||||
/// 权限码集合
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "PermissionCodeList", ColumnDescription = "权限json", IsJson = true, IsNullable = true)]
|
||||
[SugarColumn(ColumnName = "PermissionCodeList", ColumnDescription = "权限json", ColumnDataType = StaticConfig.CodeFirst_BigString, IsJson = true, IsNullable = true)]
|
||||
public List<string> PermissionCodeList { get; set; }
|
||||
|
||||
/// <summary>
|
||||
|
@@ -60,7 +60,7 @@ public class SysUser : BaseEntity
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "LastLoginTime", ColumnDescription = "上次登录时间", IsNullable = true)]
|
||||
[DataTable(Order = 5, IsShow = true, Sortable = true, DefaultFilter = true)]
|
||||
public DateTimeOffset? LastLoginTime { get; set; }
|
||||
public DateTime? LastLoginTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 最新登录设备
|
||||
@@ -81,7 +81,7 @@ public class SysUser : BaseEntity
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "LatestLoginTime", ColumnDescription = "最新登录时间", IsNullable = true)]
|
||||
[DataTable(Order = 8, IsShow = true, Sortable = true, DefaultFilter = false)]
|
||||
public DateTimeOffset? LatestLoginTime { get; set; }
|
||||
public DateTime? LatestLoginTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 密码
|
||||
|
@@ -31,7 +31,7 @@ public class SysVerificat : PrimaryIdEntity
|
||||
/// <summary>
|
||||
/// 会话信息列表
|
||||
/// </summary>
|
||||
[SugarColumn(IsJson = true)]
|
||||
[SugarColumn(ColumnName = "VerificatInfos", ColumnDescription = "会话信息列表", ColumnDataType = StaticConfig.CodeFirst_BigString, IsJson = true, IsNullable = true)]
|
||||
public List<VerificatInfo> VerificatInfos { get; set; }
|
||||
}
|
||||
|
||||
@@ -100,5 +100,5 @@ public class VerificatInfo : PrimaryIdEntity
|
||||
/// </summary>
|
||||
[Description("超时时间")]
|
||||
[DataTable(Order = 5, IsShow = true, Sortable = true)]
|
||||
public DateTimeOffset VerificatTimeout { get; set; }
|
||||
public DateTime VerificatTimeout { get; set; }
|
||||
}
|
@@ -75,7 +75,7 @@ public class SysVisitLog : BaseEntity
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "OpTime", ColumnDescription = "操作时间")]
|
||||
[DataTable(Order = 8, IsShow = true, Sortable = true, DefaultFilter = false)]
|
||||
public DateTimeOffset OpTime { get; set; }
|
||||
public DateTime OpTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 验证Id
|
||||
|
@@ -12,7 +12,7 @@
|
||||
|
||||
using Furion.DependencyInjection;
|
||||
|
||||
namespace ThingsGateway.Admin.Core;
|
||||
namespace ThingsGateway.Admin.Core.JsonExtensions;
|
||||
|
||||
/// <summary>
|
||||
/// 对象拓展
|
||||
|
@@ -18,6 +18,8 @@ using System.Collections;
|
||||
using System.Data;
|
||||
using System.Reflection;
|
||||
|
||||
using ThingsGateway.Admin.Core.JsonExtensions;
|
||||
|
||||
namespace ThingsGateway.Admin.Core;
|
||||
|
||||
/// <summary>
|
||||
|
@@ -330,22 +330,53 @@ public static class ObjectExtensions
|
||||
/// 转换布尔值
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static bool ToBool(this object value, bool defaultValue = false) => value?.ToString().ToUpper() switch
|
||||
public static bool ToBoolean(this object value, bool defaultValue = false) => value?.ToString().ToUpper() switch
|
||||
{
|
||||
"0" or "FALSE" => false,
|
||||
"1" or "TRUE" => true,
|
||||
_ => defaultValue,
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// ToLong
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static long ToLong(this object value, long defaultValue = 0) => value == null || value.ToString().IsNullOrEmpty() ? defaultValue : Int64.TryParse(value.ToString(), out var n) ? n : defaultValue;
|
||||
public static long ToLong(this object value, long defaultValue = 0)
|
||||
{
|
||||
if (value == null || value.ToString().IsNullOrEmpty())
|
||||
{
|
||||
return defaultValue;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (value is bool boolValue)
|
||||
{
|
||||
return boolValue ? 1 : 0;
|
||||
}
|
||||
return Int64.TryParse(value.ToString(), out var n) ? n : defaultValue;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ToInt
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int ToInt(this object value, int defaultValue = 0) => value == null || value.ToString().IsNullOrEmpty() ? defaultValue : Int32.TryParse(value.ToString(), out var n) ? n : defaultValue;
|
||||
public static int ToInt(this object value, int defaultValue = 0)
|
||||
{
|
||||
if (value == null || value.ToString().IsNullOrEmpty())
|
||||
{
|
||||
return defaultValue;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (value is bool boolValue)
|
||||
{
|
||||
return boolValue ? 1 : 0;
|
||||
}
|
||||
return int.TryParse(value.ToString(), out int n) ? n : defaultValue;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ToDecimal
|
||||
/// </summary>
|
||||
@@ -356,10 +387,44 @@ public static class ObjectExtensions
|
||||
{
|
||||
return Double.IsNaN(d) ? defaultValue : (Decimal)d;
|
||||
}
|
||||
var str = value.ToString();
|
||||
return str.IsNullOrEmpty() ? defaultValue : Decimal.TryParse(str, out var n) ? n : defaultValue;
|
||||
var str = value?.ToString();
|
||||
if (str.IsNullOrEmpty())
|
||||
{
|
||||
return defaultValue;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (value is bool boolValue)
|
||||
{
|
||||
return boolValue ? 1 : 0;
|
||||
}
|
||||
return Decimal.TryParse(str, out var n) ? n : defaultValue;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// ToDecimal
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static double ToDouble(this object value, double defaultValue = 0)
|
||||
{
|
||||
if (value is Double d)
|
||||
{
|
||||
return Double.IsNaN(d) ? defaultValue : (Double)d;
|
||||
}
|
||||
var str = value?.ToString();
|
||||
if (str.IsNullOrEmpty())
|
||||
{
|
||||
return (double)defaultValue;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (value is bool boolValue)
|
||||
{
|
||||
return boolValue ? 1 : 0;
|
||||
}
|
||||
return (double)(double.TryParse(str, out var n) ? n : defaultValue);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// JsonElement 转 Object
|
||||
|
@@ -97,7 +97,7 @@ public static class StringExtensions
|
||||
/// 转换布尔值
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static bool ToBool(this string value, bool defaultValue = false) => value?.ToUpper() switch
|
||||
public static bool ToBoolean(this string value, bool defaultValue = false) => value?.ToUpper() switch
|
||||
{
|
||||
"1" or "TRUE" => true,
|
||||
_ => defaultValue,
|
||||
|
@@ -21,26 +21,39 @@ namespace ThingsGateway.Admin.Core;
|
||||
public static class SysDateTimeExtensions
|
||||
{
|
||||
private static readonly DateTime _dt1970 = new(1970, 1, 1);
|
||||
private static readonly DateTimeOffset _dto1970 = new(new DateTime(1970, 1, 1));
|
||||
|
||||
/// <summary>
|
||||
/// 系统默认使用的当前时间
|
||||
/// </summary>
|
||||
public static DateTimeOffset CurrentDateTime => DateTimeOffset.Now;
|
||||
public static DateTime CurrentDateTime => DateTime.Now;
|
||||
/// <summary>
|
||||
/// 返回yyyy-MM-dd HH:mm:ss:fff zz时间格式字符串
|
||||
/// </summary>
|
||||
public static string ToDefaultDateTimeFormat(this in DateTime dt) => dt.ToString("yyyy-MM-dd HH:mm:ss:fff zz");
|
||||
|
||||
public static string ToDefaultDateTimeFormat(this in DateTime dt, TimeSpan offset)
|
||||
{
|
||||
if (dt.Kind == DateTimeKind.Utc)
|
||||
return new DateTimeOffset(dt.ToLocalTime(), offset).ToString("yyyy-MM-dd HH:mm:ss:fff zz");
|
||||
else if (dt == DateTime.MinValue || dt == DateTime.MaxValue)
|
||||
return dt.ToString("yyyy-MM-dd HH:mm:ss:fff zz");
|
||||
else
|
||||
return new DateTimeOffset(dt, offset).ToString("yyyy-MM-dd HH:mm:ss:fff zz");
|
||||
}
|
||||
/// <summary>
|
||||
/// 返回yyyy-MM-dd HH:mm:ss:fff zz时间格式字符串
|
||||
/// </summary>
|
||||
public static string ToDefaultDateTimeFormat(this in DateTimeOffset dt) => dt.ToString("yyyy-MM-dd HH:mm:ss:fff zz");
|
||||
|
||||
public static string ToDefaultDateTimeFormat(this in DateTime dt)
|
||||
{
|
||||
return dt.ToString("yyyy-MM-dd HH:mm:ss:fff zz");
|
||||
}
|
||||
/// <summary>
|
||||
/// 返回yyyy-MM-dd HH-mm-ss-fff zz时间格式字符串
|
||||
/// 返回yyyy-MM-dd HH:mm:ss:fff zz时间格式字符串
|
||||
/// </summary>
|
||||
public static string ToFileDateTimeFormat(this in DateTimeOffset dt) => dt.ToString("yyyy-MM-dd HH-mm-ss-fff zz");
|
||||
public static string ToFileDateTimeFormat(this in DateTime dt)
|
||||
{
|
||||
return dt.ToString("yyyy-MM-dd HH-mm-ss-fff zz");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
@@ -166,15 +179,5 @@ public static class SysDateTimeExtensions
|
||||
return (Int64)(value - _dt1970).TotalMilliseconds;
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// ToLong
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static long ToLong(this DateTimeOffset value, long defaultValue = 0)
|
||||
{
|
||||
// 特殊处理时间,转Unix毫秒
|
||||
return value == DateTimeOffset.MinValue ? 0 : (Int64)(value - _dto1970).TotalMilliseconds;
|
||||
|
||||
}
|
||||
|
||||
}
|
@@ -12,6 +12,8 @@
|
||||
|
||||
using SqlSugar;
|
||||
|
||||
using System.Linq.Expressions;
|
||||
|
||||
namespace ThingsGateway.Admin.Core;
|
||||
|
||||
/// <summary>
|
||||
@@ -55,12 +57,14 @@ public static class SqlSugarPageExtension
|
||||
/// <param name="whereExpression"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<SqlSugarPagedList<TEntity>> ToPagedListAsync<TEntity>(this ISugarQueryable<TEntity> queryable,
|
||||
int pageIndex, int pageSize, Func<TEntity, bool> whereExpression = null)
|
||||
int pageIndex, int pageSize, Expression<Func<TEntity, bool>> whereExpression = null)
|
||||
{
|
||||
|
||||
RefAsync<int> totalCount = 0;
|
||||
if (whereExpression != null)
|
||||
queryable = queryable.Where(whereExpression);
|
||||
var records = await queryable.ToPageListAsync(pageIndex, pageSize, totalCount);
|
||||
records = whereExpression != null ? records.Where(whereExpression).ToList() : records;
|
||||
//records = whereExpression != null ? records.Where(whereExpression).ToList() : records;
|
||||
var totalPages = (int)Math.Ceiling(totalCount / (double)pageSize);
|
||||
return new SqlSugarPagedList<TEntity>
|
||||
{
|
||||
|
@@ -9,13 +9,13 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Furion.Extras.Authentication.JwtBearer" Version="4.8.8.40" />
|
||||
<PackageReference Include="Furion.Extras.ObjectMapper.Mapster" Version="4.8.8.40" />
|
||||
<PackageReference Include="Furion.Pure" Version="4.8.8.40" />
|
||||
<PackageReference Include="SqlSugarCore" Version="5.1.4.94" />
|
||||
<PackageReference Include="Furion.Extras.Authentication.JwtBearer" Version="4.8.8.42" />
|
||||
<PackageReference Include="Furion.Extras.ObjectMapper.Mapster" Version="4.8.8.42" />
|
||||
<PackageReference Include="Furion.Pure" Version="4.8.8.42" />
|
||||
<PackageReference Include="SqlSugarCore" Version="5.1.4.104" />
|
||||
<PackageReference Include="UAParser" Version="3.1.47" />
|
||||
<PackageReference Include="Yitter.IdGenerator" Version="1.0.14" />
|
||||
<PackageReference Include="MiniExcel" Version="1.31.0" />
|
||||
<PackageReference Include="MiniExcel" Version="1.31.2" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
@@ -850,19 +850,19 @@
|
||||
<param name="this"></param>
|
||||
<param name="values"></param>
|
||||
</member>
|
||||
<member name="T:ThingsGateway.Admin.Core.JsonExtensions">
|
||||
<member name="T:ThingsGateway.Admin.Core.JsonExtensions.JsonExtensions">
|
||||
<summary>
|
||||
对象拓展
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:ThingsGateway.Admin.Core.JsonExtensions.ToJsonString(System.Object)">
|
||||
<member name="M:ThingsGateway.Admin.Core.JsonExtensions.JsonExtensions.ToJsonString(System.Object)">
|
||||
<summary>
|
||||
转换为Json
|
||||
</summary>
|
||||
<param name="item"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:ThingsGateway.Admin.Core.JsonExtensions.ToJsonWithT``1(System.String)">
|
||||
<member name="M:ThingsGateway.Admin.Core.JsonExtensions.JsonExtensions.ToJsonWithT``1(System.String)">
|
||||
<summary>
|
||||
从字符串到json
|
||||
</summary>
|
||||
@@ -1026,7 +1026,7 @@
|
||||
<param name="str"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:ThingsGateway.Admin.Core.ObjectExtensions.ToBool(System.Object,System.Boolean)">
|
||||
<member name="M:ThingsGateway.Admin.Core.ObjectExtensions.ToBoolean(System.Object,System.Boolean)">
|
||||
<summary>
|
||||
转换布尔值
|
||||
</summary>
|
||||
@@ -1050,6 +1050,12 @@
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:ThingsGateway.Admin.Core.ObjectExtensions.ToDouble(System.Object,System.Double)">
|
||||
<summary>
|
||||
ToDecimal
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:ThingsGateway.Admin.Core.ObjectExtensions.ToObject(System.Text.Json.JsonElement)">
|
||||
<summary>
|
||||
JsonElement 转 Object
|
||||
@@ -1142,7 +1148,7 @@
|
||||
<param name="input"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:ThingsGateway.Admin.Core.StringExtensions.ToBool(System.String,System.Boolean)">
|
||||
<member name="M:ThingsGateway.Admin.Core.StringExtensions.ToBoolean(System.String,System.Boolean)">
|
||||
<summary>
|
||||
转换布尔值
|
||||
</summary>
|
||||
@@ -1196,21 +1202,21 @@
|
||||
系统默认使用的当前时间
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:ThingsGateway.Admin.Core.SysDateTimeExtensions.ToDefaultDateTimeFormat(System.DateTime@,System.TimeSpan)">
|
||||
<summary>
|
||||
返回yyyy-MM-dd HH:mm:ss:fff zz时间格式字符串
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:ThingsGateway.Admin.Core.SysDateTimeExtensions.ToDefaultDateTimeFormat(System.DateTime@)">
|
||||
<summary>
|
||||
返回yyyy-MM-dd HH:mm:ss:fff zz时间格式字符串
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:ThingsGateway.Admin.Core.SysDateTimeExtensions.ToDefaultDateTimeFormat(System.DateTimeOffset@)">
|
||||
<member name="M:ThingsGateway.Admin.Core.SysDateTimeExtensions.ToFileDateTimeFormat(System.DateTime@)">
|
||||
<summary>
|
||||
返回yyyy-MM-dd HH:mm:ss:fff zz时间格式字符串
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:ThingsGateway.Admin.Core.SysDateTimeExtensions.ToFileDateTimeFormat(System.DateTimeOffset@)">
|
||||
<summary>
|
||||
返回yyyy-MM-dd HH-mm-ss-fff zz时间格式字符串
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:ThingsGateway.Admin.Core.SysDateTimeExtensions.GetDiffTime(System.DateTime@,System.DateTime@)">
|
||||
<summary>
|
||||
计算2个时间差,返回文字描述
|
||||
@@ -1233,12 +1239,6 @@
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:ThingsGateway.Admin.Core.SysDateTimeExtensions.ToLong(System.DateTimeOffset,System.Int64)">
|
||||
<summary>
|
||||
ToLong
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="T:ThingsGateway.Admin.Core.TextWriterExtensions">
|
||||
<summary>
|
||||
TextWriter扩展
|
||||
@@ -1495,7 +1495,7 @@
|
||||
<param name="size"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:ThingsGateway.Admin.Core.SqlSugarPageExtension.ToPagedListAsync``1(SqlSugar.ISugarQueryable{``0},System.Int32,System.Int32,System.Func{``0,System.Boolean})">
|
||||
<member name="M:ThingsGateway.Admin.Core.SqlSugarPageExtension.ToPagedListAsync``1(SqlSugar.ISugarQueryable{``0},System.Int32,System.Int32,System.Linq.Expressions.Expression{System.Func{``0,System.Boolean}})">
|
||||
<summary>
|
||||
SqlSugar分页扩展
|
||||
</summary>
|
||||
|
@@ -41,5 +41,5 @@ public class UnifyResult<T>
|
||||
/// <summary>
|
||||
/// 时间
|
||||
/// </summary>
|
||||
public DateTimeOffset Time { get; set; }
|
||||
public DateTime Time { get; set; }
|
||||
}
|
@@ -21,7 +21,7 @@ using ThingsGateway.Application;
|
||||
namespace ThingsGateway.ApiController;
|
||||
|
||||
/// <summary>
|
||||
/// 后台登录控制器
|
||||
/// 文件下载
|
||||
/// </summary>
|
||||
[ApiDescriptionSettings(CateGoryConst.ThingsGatewayAdmin, Order = 200)]
|
||||
[Route("gatewayFile")]
|
||||
|
@@ -89,13 +89,8 @@ public class RpcControler : IDynamicApiController
|
||||
[Description("写入变量")]
|
||||
public async Task<Dictionary<string, OperResult>> WriteDeviceMethods(Dictionary<string, string> objs)
|
||||
{
|
||||
Dictionary<string, OperResult> operResultDict = new();
|
||||
foreach (KeyValuePair<string, string> obj in objs)
|
||||
{
|
||||
var result = await RpcCore.InvokeDeviceMethodAsync($"WebApi-{UserManager.UserAccount}-{App.HttpContext.Connection.RemoteIpAddress.MapToIPv4()}", obj);
|
||||
operResultDict.Add(obj.Key, result);
|
||||
}
|
||||
return operResultDict;
|
||||
var result = await RpcCore.InvokeDeviceMethodAsync($"WebApi-{UserManager.UserAccount}-{App.HttpContext.Connection.RemoteIpAddress.MapToIPv4()}", objs);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -26,7 +26,7 @@
|
||||
</member>
|
||||
<member name="T:ThingsGateway.ApiController.FileController">
|
||||
<summary>
|
||||
后台登录控制器
|
||||
文件下载
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:ThingsGateway.ApiController.FileController.#ctor(ThingsGateway.Application.IRpcLogService,ThingsGateway.Application.IBackendLogService,ThingsGateway.Application.ICollectDeviceService,ThingsGateway.Application.IUploadDeviceService,ThingsGateway.Application.IVariableService)">
|
||||
|
@@ -34,13 +34,13 @@ public class TimerTick
|
||||
/// <summary>
|
||||
/// 上次操作时间
|
||||
/// </summary>
|
||||
public DateTimeOffset LastTime { get; private set; }
|
||||
public DateTime LastTime { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否触发时间刻度
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public bool IsTickHappen(DateTimeOffset currentTime)
|
||||
public bool IsTickHappen(DateTime currentTime)
|
||||
{
|
||||
var dateTime = LastTime.AddMilliseconds(milliSeconds);
|
||||
if (currentTime < dateTime)
|
||||
|
@@ -80,7 +80,7 @@ public class StringToEncodingConverter : IConverter<string>
|
||||
{
|
||||
try
|
||||
{
|
||||
source = target.ToJson();
|
||||
source = target.ToJsonString();
|
||||
return true;
|
||||
}
|
||||
catch (Exception)
|
||||
|
@@ -28,7 +28,7 @@ public class BackendLog : PrimaryIdEntity
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "LogTime", ColumnDescription = "日志时间", IsNullable = false)]
|
||||
[DataTable(Order = 1, IsShow = true, Sortable = true)]
|
||||
public DateTimeOffset LogTime { get; set; }
|
||||
public DateTime LogTime { get; set; }
|
||||
/// <summary>
|
||||
/// 日志级别
|
||||
/// </summary>
|
||||
|
@@ -31,7 +31,7 @@ public class DeviceVariable : MemoryVariable
|
||||
public virtual long DeviceId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 写入表达式
|
||||
/// 单位
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "Unit", ColumnDescription = "单位", Length = 200, IsNullable = true)]
|
||||
[DataTable(Order = 3, IsShow = true, Sortable = true)]
|
||||
@@ -59,12 +59,7 @@ public class DeviceVariable : MemoryVariable
|
||||
[DataTable(Order = 3, IsShow = true, Sortable = true)]
|
||||
public string VariableAddress { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 写入表达式
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "WriteExpressions", ColumnDescription = "写入表达式", Length = 200, IsNullable = true)]
|
||||
[DataTable(Order = 7, IsShow = true, Sortable = true)]
|
||||
public string WriteExpressions { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 是否中间变量
|
||||
|
@@ -71,13 +71,13 @@ public class HistoryAlarm : PrimaryIdEntity
|
||||
/// <inheritdoc cref="DeviceVariableRunTime.AlarmTime"/>
|
||||
[SugarColumn(ColumnName = "AlarmTime", ColumnDescription = "报警时间", IsNullable = false)]
|
||||
[DataTable(Order = 8, IsShow = true, Sortable = true, CellClass = " table-text-truncate ")]
|
||||
public DateTimeOffset AlarmTime { get; set; }
|
||||
public DateTime AlarmTime { get; set; }
|
||||
|
||||
|
||||
/// <inheritdoc cref="DeviceVariableRunTime.EventTime"/>
|
||||
[SugarColumn(ColumnName = "EventTime", ColumnDescription = "事件时间", IsNullable = false)]
|
||||
[DataTable(Order = 8, IsShow = true, Sortable = true, CellClass = " table-text-truncate ")]
|
||||
public DateTimeOffset EventTime { get; set; }
|
||||
public DateTime EventTime { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
|
@@ -51,7 +51,12 @@ public class MemoryVariable : BaseEntity
|
||||
[SugarColumn(ColumnName = "ReadExpressions", ColumnDescription = "读取表达式", Length = 200, IsNullable = true)]
|
||||
[DataTable(Order = 7, IsShow = true, Sortable = true, CellClass = " table-text-truncate ")]
|
||||
public string ReadExpressions { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 写入表达式
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "WriteExpressions", ColumnDescription = "写入表达式", Length = 200, IsNullable = true)]
|
||||
[DataTable(Order = 7, IsShow = true, Sortable = true)]
|
||||
public string WriteExpressions { get; set; }
|
||||
/// <summary>
|
||||
/// 是否中间变量
|
||||
/// </summary>
|
||||
@@ -67,7 +72,7 @@ public class MemoryVariable : BaseEntity
|
||||
/// <summary>
|
||||
/// 变量额外属性Json,通常使用为上传设备,List属性
|
||||
/// </summary>
|
||||
[SugarColumn(IsJson = true, ColumnName = "VariablePropertys", ColumnDescription = "变量属性Json", IsNullable = true)]
|
||||
[SugarColumn(IsJson = true, ColumnName = "VariablePropertys", ColumnDataType = StaticConfig.CodeFirst_BigString, ColumnDescription = "变量属性Json", IsNullable = true)]
|
||||
[IgnoreExcel]
|
||||
public ConcurrentDictionary<long, List<DependencyProperty>> VariablePropertys { get; set; } = new();
|
||||
/// <summary>
|
||||
|
@@ -24,7 +24,7 @@ public class RpcLog : PrimaryIdEntity
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "LogTime", ColumnDescription = "日志时间", IsNullable = false)]
|
||||
[DataTable(Order = 1, IsShow = true, Sortable = true, CellClass = " table-text-truncate ")]
|
||||
public DateTimeOffset LogTime { get; set; }
|
||||
public DateTime LogTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 操作源
|
||||
|
@@ -65,7 +65,7 @@ public class UploadDevice : BaseEntity
|
||||
/// <summary>
|
||||
/// 设备属性Json
|
||||
/// </summary>
|
||||
[SugarColumn(IsJson = true, ColumnName = "DevicePropertys", ColumnDescription = "设备属性Json", IsNullable = true)]
|
||||
[SugarColumn(IsJson = true, ColumnName = "DevicePropertys", ColumnDataType = StaticConfig.CodeFirst_BigString, ColumnDescription = "设备属性Json", IsNullable = true)]
|
||||
[IgnoreExcel]
|
||||
public List<DependencyProperty> DevicePropertys { get; set; }
|
||||
|
||||
|
@@ -21,7 +21,7 @@ using Newtonsoft.Json.Converters;
|
||||
using System.Dynamic;
|
||||
using System.Text;
|
||||
|
||||
using TouchSocket.Core;
|
||||
using ThingsGateway.Admin.Core.JsonExtensions;
|
||||
|
||||
namespace ThingsGateway.Application;
|
||||
/// <summary>
|
||||
@@ -76,7 +76,7 @@ public class CSharpScriptEngine : ISingleton
|
||||
var expConverter = new ExpandoObjectConverter();
|
||||
dynamic obj = JsonConvert.DeserializeObject<List<ExpandoObject>>(input, expConverter);
|
||||
object result = runscript(obj);
|
||||
var json = result.ToJson();
|
||||
var json = result.ToJsonString();
|
||||
return json;
|
||||
}
|
||||
|
||||
@@ -116,7 +116,7 @@ public class CSharpScriptEngine : ISingleton
|
||||
var expConverter = new ExpandoObjectConverter();
|
||||
dynamic obj = JsonConvert.DeserializeObject<ExpandoObject>(input, expConverter);
|
||||
object result = runscript(obj);
|
||||
var json = result.ToJson();
|
||||
var json = result.ToJsonString();
|
||||
return json;
|
||||
}
|
||||
|
||||
@@ -136,7 +136,7 @@ public static class CSharpScriptEngineExtension
|
||||
/// </summary>
|
||||
public static string GetSciptListValue<T>(this T datas, string script) where T : class
|
||||
{
|
||||
var inPut = datas.ToJson();
|
||||
var inPut = datas.ToJsonString();
|
||||
if (!string.IsNullOrEmpty(script))
|
||||
{
|
||||
//执行脚本,获取新实体
|
||||
@@ -154,7 +154,7 @@ public static class CSharpScriptEngineExtension
|
||||
/// </summary>
|
||||
public static string GetSciptValue<T>(this T datas, string script) where T : class
|
||||
{
|
||||
var inPut = datas.ToJson();
|
||||
var inPut = datas.ToJsonString();
|
||||
if (!string.IsNullOrEmpty(script))
|
||||
{
|
||||
//执行脚本,获取新实体
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user