From f19c9aa2d35fb31a3a8df4b5c47004444396c89f Mon Sep 17 00:00:00 2001
From: iioter <535915157@qq.com>
Date: Thu, 25 Aug 2022 08:59:49 +0800
Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=8F=98=E9=87=8F=E6=8E=92?=
=?UTF-8?q?=E5=BA=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../20220825004835_variableindex.Designer.cs | 859 ++++++++++++++++++
.../20220825004835_variableindex.cs | 26 +
.../Migrations/DataContextModelSnapshot.cs | 5 +-
IoTGateway.Model/DeviceVariable.cs | 3 +
.../DeviceVariableImportVM.cs | 2 +
.../DeviceVariableVMs/DeviceVariableListVM.cs | 3 +-
.../Views/DeviceVariable/Create.cshtml | 1 +
.../Views/DeviceVariable/Edit.cshtml | 1 +
IoTGateway/iotgateway.db | Bin 311296 -> 311296 bytes
Plugins/Plugin/DeviceThread.cs | 2 +-
10 files changed, 899 insertions(+), 3 deletions(-)
create mode 100644 IoTGateway.DataAccess/Migrations/20220825004835_variableindex.Designer.cs
create mode 100644 IoTGateway.DataAccess/Migrations/20220825004835_variableindex.cs
diff --git a/IoTGateway.DataAccess/Migrations/20220825004835_variableindex.Designer.cs b/IoTGateway.DataAccess/Migrations/20220825004835_variableindex.Designer.cs
new file mode 100644
index 0000000..8cce579
--- /dev/null
+++ b/IoTGateway.DataAccess/Migrations/20220825004835_variableindex.Designer.cs
@@ -0,0 +1,859 @@
+//
+using System;
+using IoTGateway.DataAccess;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+
+#nullable disable
+
+namespace IoTGateway.DataAccess.Migrations
+{
+ [DbContext(typeof(DataContext))]
+ [Migration("20220825004835_variableindex")]
+ partial class variableindex
+ {
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder.HasAnnotation("ProductVersion", "6.0.0");
+
+ modelBuilder.Entity("IoTGateway.Model.Device", b =>
+ {
+ b.Property("ID")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("TEXT");
+
+ b.Property("AutoStart")
+ .HasColumnType("INTEGER");
+
+ b.Property("CgUpload")
+ .HasColumnType("INTEGER");
+
+ b.Property("CreateBy")
+ .HasColumnType("TEXT");
+
+ b.Property("CreateTime")
+ .HasColumnType("TEXT");
+
+ b.Property("Description")
+ .HasColumnType("TEXT");
+
+ b.Property("DeviceName")
+ .HasColumnType("TEXT");
+
+ b.Property("DeviceTypeEnum")
+ .HasColumnType("INTEGER");
+
+ b.Property("DriverId")
+ .HasColumnType("TEXT");
+
+ b.Property("EnforcePeriod")
+ .HasColumnType("INTEGER");
+
+ b.Property("Index")
+ .HasColumnType("INTEGER");
+
+ b.Property("ParentId")
+ .HasColumnType("TEXT");
+
+ b.Property("UpdateBy")
+ .HasColumnType("TEXT");
+
+ b.Property("UpdateTime")
+ .HasColumnType("TEXT");
+
+ b.HasKey("ID");
+
+ b.HasIndex("DriverId");
+
+ b.HasIndex("ParentId");
+
+ b.ToTable("Devices");
+ });
+
+ modelBuilder.Entity("IoTGateway.Model.DeviceConfig", b =>
+ {
+ b.Property("ID")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("TEXT");
+
+ b.Property("CreateBy")
+ .HasMaxLength(50)
+ .HasColumnType("TEXT");
+
+ b.Property("CreateTime")
+ .HasColumnType("TEXT");
+
+ b.Property("DataSide")
+ .HasColumnType("INTEGER");
+
+ b.Property("Description")
+ .HasColumnType("TEXT");
+
+ b.Property("DeviceConfigName")
+ .HasColumnType("TEXT");
+
+ b.Property("DeviceId")
+ .HasColumnType("TEXT");
+
+ b.Property("EnumInfo")
+ .HasColumnType("TEXT");
+
+ b.Property("UpdateBy")
+ .HasMaxLength(50)
+ .HasColumnType("TEXT");
+
+ b.Property("UpdateTime")
+ .HasColumnType("TEXT");
+
+ b.Property("Value")
+ .HasColumnType("TEXT");
+
+ b.HasKey("ID");
+
+ b.HasIndex("DeviceId");
+
+ b.ToTable("DeviceConfigs");
+ });
+
+ modelBuilder.Entity("IoTGateway.Model.DeviceVariable", b =>
+ {
+ b.Property("ID")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("TEXT");
+
+ b.Property("DataType")
+ .HasColumnType("INTEGER");
+
+ b.Property("Description")
+ .HasColumnType("TEXT");
+
+ b.Property("DeviceAddress")
+ .HasColumnType("TEXT");
+
+ b.Property("DeviceId")
+ .HasColumnType("TEXT");
+
+ b.Property("Expressions")
+ .HasColumnType("TEXT");
+
+ b.Property("Index")
+ .HasColumnType("INTEGER");
+
+ b.Property("Method")
+ .HasColumnType("TEXT");
+
+ b.Property("Name")
+ .HasColumnType("TEXT");
+
+ b.Property("ProtectType")
+ .HasColumnType("INTEGER");
+
+ b.HasKey("ID");
+
+ b.HasIndex("DeviceId");
+
+ b.ToTable("DeviceVariables");
+ });
+
+ modelBuilder.Entity("IoTGateway.Model.Driver", b =>
+ {
+ b.Property("ID")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("TEXT");
+
+ b.Property("AssembleName")
+ .HasColumnType("TEXT");
+
+ b.Property("AuthorizesNum")
+ .HasColumnType("INTEGER");
+
+ b.Property("CreateBy")
+ .HasMaxLength(50)
+ .HasColumnType("TEXT");
+
+ b.Property("CreateTime")
+ .HasColumnType("TEXT");
+
+ b.Property("DriverName")
+ .HasColumnType("TEXT");
+
+ b.Property("FileName")
+ .HasColumnType("TEXT");
+
+ b.Property("UpdateBy")
+ .HasMaxLength(50)
+ .HasColumnType("TEXT");
+
+ b.Property("UpdateTime")
+ .HasColumnType("TEXT");
+
+ b.HasKey("ID");
+
+ b.ToTable("Drivers");
+ });
+
+ modelBuilder.Entity("IoTGateway.Model.RpcLog", b =>
+ {
+ b.Property("ID")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("TEXT");
+
+ b.Property("Description")
+ .HasColumnType("TEXT");
+
+ b.Property("DeviceId")
+ .HasColumnType("TEXT");
+
+ b.Property("EndTime")
+ .HasColumnType("TEXT");
+
+ b.Property("IsSuccess")
+ .HasColumnType("INTEGER");
+
+ b.Property("Method")
+ .HasColumnType("TEXT");
+
+ b.Property("Params")
+ .HasColumnType("TEXT");
+
+ b.Property("RpcSide")
+ .HasColumnType("INTEGER");
+
+ b.Property("StartTime")
+ .HasColumnType("TEXT");
+
+ b.HasKey("ID");
+
+ b.HasIndex("DeviceId");
+
+ b.ToTable("RpcLogs");
+ });
+
+ modelBuilder.Entity("IoTGateway.Model.SystemConfig", b =>
+ {
+ b.Property("ID")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("TEXT");
+
+ b.Property("ClientId")
+ .HasColumnType("TEXT");
+
+ b.Property("CreateBy")
+ .HasMaxLength(50)
+ .HasColumnType("TEXT");
+
+ b.Property("CreateTime")
+ .HasColumnType("TEXT");
+
+ b.Property("GatewayName")
+ .HasColumnType("TEXT");
+
+ b.Property("IoTPlatformType")
+ .HasColumnType("INTEGER");
+
+ b.Property("MqttIp")
+ .HasColumnType("TEXT");
+
+ b.Property("MqttPort")
+ .HasColumnType("INTEGER");
+
+ b.Property("MqttUName")
+ .HasColumnType("TEXT");
+
+ b.Property("MqttUPwd")
+ .HasColumnType("TEXT");
+
+ b.Property("UpdateBy")
+ .HasMaxLength(50)
+ .HasColumnType("TEXT");
+
+ b.Property("UpdateTime")
+ .HasColumnType("TEXT");
+
+ b.HasKey("ID");
+
+ b.ToTable("SystemConfig");
+ });
+
+ modelBuilder.Entity("WalkingTec.Mvvm.Core.ActionLog", b =>
+ {
+ b.Property("ID")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("TEXT");
+
+ b.Property("ActionName")
+ .HasMaxLength(255)
+ .HasColumnType("TEXT");
+
+ b.Property("ActionTime")
+ .HasColumnType("TEXT");
+
+ b.Property("ActionUrl")
+ .HasMaxLength(250)
+ .HasColumnType("TEXT");
+
+ b.Property("CreateBy")
+ .HasMaxLength(50)
+ .HasColumnType("TEXT");
+
+ b.Property("CreateTime")
+ .HasColumnType("TEXT");
+
+ b.Property("Duration")
+ .HasColumnType("REAL");
+
+ b.Property("IP")
+ .HasMaxLength(50)
+ .HasColumnType("TEXT");
+
+ b.Property("ITCode")
+ .HasMaxLength(50)
+ .HasColumnType("TEXT");
+
+ b.Property("LogType")
+ .HasColumnType("INTEGER");
+
+ b.Property("ModuleName")
+ .HasMaxLength(255)
+ .HasColumnType("TEXT");
+
+ b.Property("Remark")
+ .HasColumnType("TEXT");
+
+ b.Property("UpdateBy")
+ .HasMaxLength(50)
+ .HasColumnType("TEXT");
+
+ b.Property("UpdateTime")
+ .HasColumnType("TEXT");
+
+ b.HasKey("ID");
+
+ b.ToTable("ActionLogs");
+ });
+
+ modelBuilder.Entity("WalkingTec.Mvvm.Core.DataPrivilege", b =>
+ {
+ b.Property("ID")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("TEXT");
+
+ b.Property("CreateBy")
+ .HasMaxLength(50)
+ .HasColumnType("TEXT");
+
+ b.Property("CreateTime")
+ .HasColumnType("TEXT");
+
+ b.Property("Domain")
+ .HasColumnType("TEXT");
+
+ b.Property("GroupCode")
+ .HasColumnType("TEXT");
+
+ b.Property("RelateId")
+ .HasColumnType("TEXT");
+
+ b.Property("TableName")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("TEXT");
+
+ b.Property("UpdateBy")
+ .HasMaxLength(50)
+ .HasColumnType("TEXT");
+
+ b.Property("UpdateTime")
+ .HasColumnType("TEXT");
+
+ b.Property("UserCode")
+ .HasColumnType("TEXT");
+
+ b.HasKey("ID");
+
+ b.ToTable("DataPrivileges");
+ });
+
+ modelBuilder.Entity("WalkingTec.Mvvm.Core.FileAttachment", b =>
+ {
+ b.Property("ID")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("TEXT");
+
+ b.Property("ExtraInfo")
+ .HasColumnType("TEXT");
+
+ b.Property("FileData")
+ .HasColumnType("BLOB");
+
+ b.Property("FileExt")
+ .IsRequired()
+ .HasMaxLength(10)
+ .HasColumnType("TEXT");
+
+ b.Property("FileName")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property("HandlerInfo")
+ .HasColumnType("TEXT");
+
+ b.Property("Length")
+ .HasColumnType("INTEGER");
+
+ b.Property("Path")
+ .HasColumnType("TEXT");
+
+ b.Property("SaveMode")
+ .HasColumnType("TEXT");
+
+ b.Property("UploadTime")
+ .HasColumnType("TEXT");
+
+ b.HasKey("ID");
+
+ b.ToTable("FileAttachments");
+ });
+
+ modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkGroup", b =>
+ {
+ b.Property("ID")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("TEXT");
+
+ b.Property("CreateBy")
+ .HasMaxLength(50)
+ .HasColumnType("TEXT");
+
+ b.Property("CreateTime")
+ .HasColumnType("TEXT");
+
+ b.Property("GroupCode")
+ .IsRequired()
+ .HasMaxLength(100)
+ .HasColumnType("TEXT");
+
+ b.Property("GroupName")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("TEXT");
+
+ b.Property("GroupRemark")
+ .HasColumnType("TEXT");
+
+ b.Property("TenantCode")
+ .HasColumnType("TEXT");
+
+ b.Property("UpdateBy")
+ .HasMaxLength(50)
+ .HasColumnType("TEXT");
+
+ b.Property("UpdateTime")
+ .HasColumnType("TEXT");
+
+ b.HasKey("ID");
+
+ b.ToTable("FrameworkGroups");
+ });
+
+ modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkMenu", b =>
+ {
+ b.Property("ID")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("TEXT");
+
+ b.Property("ActionName")
+ .HasColumnType("TEXT");
+
+ b.Property("ClassName")
+ .HasColumnType("TEXT");
+
+ b.Property("DisplayOrder")
+ .IsRequired()
+ .HasColumnType("INTEGER");
+
+ b.Property("Domain")
+ .HasColumnType("TEXT");
+
+ b.Property("FolderOnly")
+ .HasColumnType("INTEGER");
+
+ b.Property("Icon")
+ .HasMaxLength(50)
+ .HasColumnType("TEXT");
+
+ b.Property("IsInherit")
+ .HasColumnType("INTEGER");
+
+ b.Property("IsInside")
+ .IsRequired()
+ .HasColumnType("INTEGER");
+
+ b.Property("IsPublic")
+ .HasColumnType("INTEGER");
+
+ b.Property("MethodName")
+ .HasColumnType("TEXT");
+
+ b.Property("ModuleName")
+ .HasColumnType("TEXT");
+
+ b.Property("PageName")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("TEXT");
+
+ b.Property("ParentId")
+ .HasColumnType("TEXT");
+
+ b.Property("ShowOnMenu")
+ .HasColumnType("INTEGER");
+
+ b.Property("Url")
+ .HasColumnType("TEXT");
+
+ b.HasKey("ID");
+
+ b.HasIndex("ParentId");
+
+ b.ToTable("FrameworkMenus");
+ });
+
+ modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkRole", b =>
+ {
+ b.Property("ID")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("TEXT");
+
+ b.Property("CreateBy")
+ .HasMaxLength(50)
+ .HasColumnType("TEXT");
+
+ b.Property("CreateTime")
+ .HasColumnType("TEXT");
+
+ b.Property("RoleCode")
+ .IsRequired()
+ .HasMaxLength(100)
+ .HasColumnType("TEXT");
+
+ b.Property("RoleName")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("TEXT");
+
+ b.Property("RoleRemark")
+ .HasColumnType("TEXT");
+
+ b.Property("TenantCode")
+ .HasColumnType("TEXT");
+
+ b.Property("UpdateBy")
+ .HasMaxLength(50)
+ .HasColumnType("TEXT");
+
+ b.Property("UpdateTime")
+ .HasColumnType("TEXT");
+
+ b.HasKey("ID");
+
+ b.ToTable("FrameworkRoles");
+ });
+
+ modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkUser", b =>
+ {
+ b.Property("ID")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("TEXT");
+
+ b.Property("Address")
+ .HasMaxLength(200)
+ .HasColumnType("TEXT");
+
+ b.Property("CellPhone")
+ .HasColumnType("TEXT");
+
+ b.Property("CreateBy")
+ .HasMaxLength(50)
+ .HasColumnType("TEXT");
+
+ b.Property("CreateTime")
+ .HasColumnType("TEXT");
+
+ b.Property("Email")
+ .HasMaxLength(50)
+ .HasColumnType("TEXT");
+
+ b.Property("Gender")
+ .HasColumnType("INTEGER");
+
+ b.Property("HomePhone")
+ .HasMaxLength(30)
+ .HasColumnType("TEXT");
+
+ b.Property("ITCode")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("TEXT");
+
+ b.Property("IsValid")
+ .HasColumnType("INTEGER");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("TEXT");
+
+ b.Property("Password")
+ .IsRequired()
+ .HasMaxLength(32)
+ .HasColumnType("TEXT");
+
+ b.Property("PhotoId")
+ .HasColumnType("TEXT");
+
+ b.Property("TenantCode")
+ .HasColumnType("TEXT");
+
+ b.Property("UpdateBy")
+ .HasMaxLength(50)
+ .HasColumnType("TEXT");
+
+ b.Property("UpdateTime")
+ .HasColumnType("TEXT");
+
+ b.Property("ZipCode")
+ .HasColumnType("TEXT");
+
+ b.HasKey("ID");
+
+ b.HasIndex("PhotoId");
+
+ b.ToTable("FrameworkUsers");
+ });
+
+ modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkUserGroup", b =>
+ {
+ b.Property("ID")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("TEXT");
+
+ b.Property("CreateBy")
+ .HasMaxLength(50)
+ .HasColumnType("TEXT");
+
+ b.Property("CreateTime")
+ .HasColumnType("TEXT");
+
+ b.Property("GroupCode")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property("UpdateBy")
+ .HasMaxLength(50)
+ .HasColumnType("TEXT");
+
+ b.Property("UpdateTime")
+ .HasColumnType("TEXT");
+
+ b.Property("UserCode")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.HasKey("ID");
+
+ b.ToTable("FrameworkUserGroups");
+ });
+
+ modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkUserRole", b =>
+ {
+ b.Property("ID")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("TEXT");
+
+ b.Property("CreateBy")
+ .HasMaxLength(50)
+ .HasColumnType("TEXT");
+
+ b.Property("CreateTime")
+ .HasColumnType("TEXT");
+
+ b.Property("RoleCode")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property("UpdateBy")
+ .HasMaxLength(50)
+ .HasColumnType("TEXT");
+
+ b.Property("UpdateTime")
+ .HasColumnType("TEXT");
+
+ b.Property("UserCode")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.HasKey("ID");
+
+ b.ToTable("FrameworkUserRoles");
+ });
+
+ modelBuilder.Entity("WalkingTec.Mvvm.Core.FunctionPrivilege", b =>
+ {
+ b.Property("ID")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("TEXT");
+
+ b.Property("Allowed")
+ .IsRequired()
+ .HasColumnType("INTEGER");
+
+ b.Property("CreateBy")
+ .HasMaxLength(50)
+ .HasColumnType("TEXT");
+
+ b.Property("CreateTime")
+ .HasColumnType("TEXT");
+
+ b.Property("MenuItemId")
+ .HasColumnType("TEXT");
+
+ b.Property("RoleCode")
+ .HasColumnType("TEXT");
+
+ b.Property("UpdateBy")
+ .HasMaxLength(50)
+ .HasColumnType("TEXT");
+
+ b.Property("UpdateTime")
+ .HasColumnType("TEXT");
+
+ b.HasKey("ID");
+
+ b.HasIndex("MenuItemId");
+
+ b.ToTable("FunctionPrivileges");
+ });
+
+ modelBuilder.Entity("WalkingTec.Mvvm.Core.PersistedGrant", b =>
+ {
+ b.Property("ID")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("TEXT");
+
+ b.Property("CreationTime")
+ .HasColumnType("TEXT");
+
+ b.Property("Expiration")
+ .HasColumnType("TEXT");
+
+ b.Property("RefreshToken")
+ .HasMaxLength(50)
+ .HasColumnType("TEXT");
+
+ b.Property("Type")
+ .HasMaxLength(50)
+ .HasColumnType("TEXT");
+
+ b.Property("UserCode")
+ .HasColumnType("TEXT");
+
+ b.HasKey("ID");
+
+ b.ToTable("PersistedGrants");
+ });
+
+ modelBuilder.Entity("IoTGateway.Model.Device", b =>
+ {
+ b.HasOne("IoTGateway.Model.Driver", "Driver")
+ .WithMany()
+ .HasForeignKey("DriverId");
+
+ b.HasOne("IoTGateway.Model.Device", "Parent")
+ .WithMany("Children")
+ .HasForeignKey("ParentId");
+
+ b.Navigation("Driver");
+
+ b.Navigation("Parent");
+ });
+
+ modelBuilder.Entity("IoTGateway.Model.DeviceConfig", b =>
+ {
+ b.HasOne("IoTGateway.Model.Device", "Device")
+ .WithMany("DeviceConfigs")
+ .HasForeignKey("DeviceId");
+
+ b.Navigation("Device");
+ });
+
+ modelBuilder.Entity("IoTGateway.Model.DeviceVariable", b =>
+ {
+ b.HasOne("IoTGateway.Model.Device", "Device")
+ .WithMany("DeviceVariables")
+ .HasForeignKey("DeviceId");
+
+ b.Navigation("Device");
+ });
+
+ modelBuilder.Entity("IoTGateway.Model.RpcLog", b =>
+ {
+ b.HasOne("IoTGateway.Model.Device", "Device")
+ .WithMany()
+ .HasForeignKey("DeviceId");
+
+ b.Navigation("Device");
+ });
+
+ modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkMenu", b =>
+ {
+ b.HasOne("WalkingTec.Mvvm.Core.FrameworkMenu", "Parent")
+ .WithMany("Children")
+ .HasForeignKey("ParentId");
+
+ b.Navigation("Parent");
+ });
+
+ modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkUser", b =>
+ {
+ b.HasOne("WalkingTec.Mvvm.Core.FileAttachment", "Photo")
+ .WithMany()
+ .HasForeignKey("PhotoId")
+ .OnDelete(DeleteBehavior.Restrict);
+
+ b.Navigation("Photo");
+ });
+
+ modelBuilder.Entity("WalkingTec.Mvvm.Core.FunctionPrivilege", b =>
+ {
+ b.HasOne("WalkingTec.Mvvm.Core.FrameworkMenu", "MenuItem")
+ .WithMany("Privileges")
+ .HasForeignKey("MenuItemId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("MenuItem");
+ });
+
+ modelBuilder.Entity("IoTGateway.Model.Device", b =>
+ {
+ b.Navigation("Children");
+
+ b.Navigation("DeviceConfigs");
+
+ b.Navigation("DeviceVariables");
+ });
+
+ modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkMenu", b =>
+ {
+ b.Navigation("Children");
+
+ b.Navigation("Privileges");
+ });
+#pragma warning restore 612, 618
+ }
+ }
+}
diff --git a/IoTGateway.DataAccess/Migrations/20220825004835_variableindex.cs b/IoTGateway.DataAccess/Migrations/20220825004835_variableindex.cs
new file mode 100644
index 0000000..eda47bc
--- /dev/null
+++ b/IoTGateway.DataAccess/Migrations/20220825004835_variableindex.cs
@@ -0,0 +1,26 @@
+using Microsoft.EntityFrameworkCore.Migrations;
+
+#nullable disable
+
+namespace IoTGateway.DataAccess.Migrations
+{
+ public partial class variableindex : Migration
+ {
+ protected override void Up(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.AddColumn(
+ name: "Index",
+ table: "DeviceVariables",
+ type: "INTEGER",
+ nullable: false,
+ defaultValue: 0u);
+ }
+
+ protected override void Down(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.DropColumn(
+ name: "Index",
+ table: "DeviceVariables");
+ }
+ }
+}
diff --git a/IoTGateway.DataAccess/Migrations/DataContextModelSnapshot.cs b/IoTGateway.DataAccess/Migrations/DataContextModelSnapshot.cs
index b1a73d3..d98b429 100644
--- a/IoTGateway.DataAccess/Migrations/DataContextModelSnapshot.cs
+++ b/IoTGateway.DataAccess/Migrations/DataContextModelSnapshot.cs
@@ -15,7 +15,7 @@ namespace IoTGateway.DataAccess.Migrations
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
- modelBuilder.HasAnnotation("ProductVersion", "6.0.1");
+ modelBuilder.HasAnnotation("ProductVersion", "6.0.0");
modelBuilder.Entity("IoTGateway.Model.Device", b =>
{
@@ -137,6 +137,9 @@ namespace IoTGateway.DataAccess.Migrations
b.Property("Expressions")
.HasColumnType("TEXT");
+ b.Property("Index")
+ .HasColumnType("INTEGER");
+
b.Property("Method")
.HasColumnType("TEXT");
diff --git a/IoTGateway.Model/DeviceVariable.cs b/IoTGateway.Model/DeviceVariable.cs
index 350621c..4f8b449 100644
--- a/IoTGateway.Model/DeviceVariable.cs
+++ b/IoTGateway.Model/DeviceVariable.cs
@@ -28,6 +28,9 @@ namespace IoTGateway.Model
[Display(Name = "权限")]
public ProtectTypeEnum ProtectType { get; set; }
+ [Display(Name = "排序")]
+ public uint Index { get; set; }
+
[Newtonsoft.Json.JsonIgnore]
public Device Device { get; set; }
[Display(Name = "设备")]
diff --git a/IoTGateway.ViewModel/BasicData/DeviceVariableVMs/DeviceVariableImportVM.cs b/IoTGateway.ViewModel/BasicData/DeviceVariableVMs/DeviceVariableImportVM.cs
index 4460fd6..04fe596 100644
--- a/IoTGateway.ViewModel/BasicData/DeviceVariableVMs/DeviceVariableImportVM.cs
+++ b/IoTGateway.ViewModel/BasicData/DeviceVariableVMs/DeviceVariableImportVM.cs
@@ -15,6 +15,8 @@ namespace IoTGateway.ViewModel.BasicData.DeviceVariableVMs
{
[Display(Name = "变量名")]
public ExcelPropety Name_Excel = ExcelPropety.CreateProperty(x => x.Name);
+ [Display(Name = "排序")]
+ public ExcelPropety Index_Excel = ExcelPropety.CreateProperty(x => x.Index);
[Display(Name = "描述")]
public ExcelPropety Description_Excel = ExcelPropety.CreateProperty(x => x.Description);
[Display(Name = "方法")]
diff --git a/IoTGateway.ViewModel/BasicData/DeviceVariableVMs/DeviceVariableListVM.cs b/IoTGateway.ViewModel/BasicData/DeviceVariableVMs/DeviceVariableListVM.cs
index d15e0d0..8f8fa10 100644
--- a/IoTGateway.ViewModel/BasicData/DeviceVariableVMs/DeviceVariableListVM.cs
+++ b/IoTGateway.ViewModel/BasicData/DeviceVariableVMs/DeviceVariableListVM.cs
@@ -121,6 +121,7 @@ namespace IoTGateway.ViewModel.BasicData.DeviceVariableVMs
ID = x.ID,
DeviceId = x.DeviceId,
Name = x.Name,
+ Index = x.Index,
Description = x.Description,
Method = x.Method,
DeviceAddress = x.DeviceAddress,
@@ -130,7 +131,7 @@ namespace IoTGateway.ViewModel.BasicData.DeviceVariableVMs
DeviceName_view = x.Device.DeviceName,
Device = x.Device
})
- .OrderBy(x => x.DeviceName_view).ThenBy(x => x.DeviceAddress);
+ .OrderBy(x => x.DeviceName_view).ThenBy(x => x.Index);
return query;
}
diff --git a/IoTGateway/Areas/BasicData/Views/DeviceVariable/Create.cshtml b/IoTGateway/Areas/BasicData/Views/DeviceVariable/Create.cshtml
index 7c6eba3..528140f 100644
--- a/IoTGateway/Areas/BasicData/Views/DeviceVariable/Create.cshtml
+++ b/IoTGateway/Areas/BasicData/Views/DeviceVariable/Create.cshtml
@@ -5,6 +5,7 @@
+
diff --git a/IoTGateway/Areas/BasicData/Views/DeviceVariable/Edit.cshtml b/IoTGateway/Areas/BasicData/Views/DeviceVariable/Edit.cshtml
index d41a4d7..82f3c63 100644
--- a/IoTGateway/Areas/BasicData/Views/DeviceVariable/Edit.cshtml
+++ b/IoTGateway/Areas/BasicData/Views/DeviceVariable/Edit.cshtml
@@ -5,6 +5,7 @@
+
diff --git a/IoTGateway/iotgateway.db b/IoTGateway/iotgateway.db
index c43349b8b9caaf6193d290ca18f833180a71f964..23bc712fa0c5d39aabaaa74264e90f2f60599e68 100644
GIT binary patch
delta 7107
zcmeI1Pi)&%7{KEsTmPWd8x?fZD)BbZnzF=ooTN#!HYH0^6xMD`?YhG>1;>6}tR;44
zyUijft_0FCJ>WALL6Wlljs%hY~r}`nH4
z_9B~L5BB}hckk{Ibhq#LYdxOKfWQj^9}^-xAC840xg}9o#C#Des*JCWay-Ys+U-dV
ztf7&^YyGeM4)z|q*k9Nm*xT$HTLFvX>|ozxu=lX<2=Zi@=b7tS8ytDmw+9?#*vD{p
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