You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
84 lines
3.0 KiB
84 lines
3.0 KiB
using Infrastructure.Application;
|
|
using Application.Domain.Entities;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using Platform.Areas.IoTCenter.Controllers;
|
|
using System;
|
|
using System.ComponentModel.DataAnnotations;
|
|
|
|
namespace Platform.Application.Models
|
|
{
|
|
[Display(Name = "平台触发器")]
|
|
public class EditIoTTiggerModel : EditModel
|
|
{
|
|
public EditIoTTiggerModel()
|
|
{
|
|
this.Start = DateTime.Now.Date;
|
|
this.End = DateTime.Now.Date;
|
|
}
|
|
|
|
[Display(Name = "机构")]
|
|
[SelectList(nameof(IoTSceneBuildingId), nameof(AjaxController.GetBuilding))]
|
|
[ReadOnlyForEdit]
|
|
public Guid? OrganId { get; set; }
|
|
|
|
[Display(Name = "场景建筑")]
|
|
[SelectList(nameof(IoTSceneId), nameof(AjaxController.GetIoTScene))]
|
|
[ReadOnlyForEdit]
|
|
public Guid? IoTSceneBuildingId { get; set; }
|
|
|
|
[Display(Name = "机构场景")]
|
|
[SelectList(nameof(IoTDeviceBuildingId), nameof(AjaxController.GetBuildingByScene))]
|
|
[Required(ErrorMessage = nameof(RequiredAttribute))]
|
|
public Guid? IoTSceneId { get; set; }
|
|
|
|
[Display(Name = "触发器名称")]
|
|
[MaxLength(24, ErrorMessage = "{0}最大长度为{1}")]
|
|
public string Name { get; set; }
|
|
|
|
[Display(Name = "设备建筑")]
|
|
[SelectList(nameof(IoTGatewayId), nameof(AjaxController.GetIoTGatewayByBuilding))]
|
|
[ReadOnlyForEdit]
|
|
public Guid? IoTDeviceBuildingId { get; set; }
|
|
|
|
[SelectList(nameof(IoTDeviceId), nameof(AjaxController.GetIoTDevice))]
|
|
[Display(Name = "网关")]
|
|
[Required(ErrorMessage = nameof(RequiredAttribute))]
|
|
public Guid? IoTGatewayId { get; set; }
|
|
|
|
[SelectList(nameof(IoTDataId), nameof(AjaxController.GetIoTData))]
|
|
[Display(Name = "设备")]
|
|
[Required(ErrorMessage = nameof(RequiredAttribute))]
|
|
public Guid? IoTDeviceId { get; set; }
|
|
|
|
[SelectList]
|
|
[Display(Name = "数据")]
|
|
[Required(ErrorMessage = nameof(RequiredAttribute))]
|
|
public Guid? IoTDataId { get; set; }
|
|
|
|
[ConvertType(typeof(IoTOperationType))]
|
|
[SelectList]
|
|
[Display(Name = "运算")]
|
|
[Required(ErrorMessage = nameof(RequiredAttribute))]
|
|
public IoTOperationType? Type { get; set; }
|
|
|
|
[SkipSearch]
|
|
[Display(Name = "触发规则")]
|
|
[Remote(nameof(AjaxController.ConditionValid), "Ajax", "", AdditionalFields = "IoTDataId,Type")]
|
|
[Required(ErrorMessage = nameof(RequiredAttribute))]
|
|
public string Condition { get; set; }
|
|
|
|
[Display(Name = "开始时间")]
|
|
[Required(ErrorMessage = nameof(RequiredAttribute))]
|
|
[DataType(DataType.Time)]
|
|
public DateTime Start { get; set; }
|
|
|
|
[Display(Name = "结束时间")]
|
|
[Required(ErrorMessage = nameof(RequiredAttribute))]
|
|
[DataType(DataType.Time)]
|
|
public DateTime End { get; set; }
|
|
|
|
[Display(Name = "禁用")]
|
|
public bool? Disabled { get; set; }
|
|
}
|
|
}
|