Former-commit-id: 0052adf50a92a0b678976cd49070f887885683fe Former-commit-id: e6c3a10b3ccda4b902fc0ca92708310daab01ad81.0
parent
02152be538
commit
2055660f80
@ -0,0 +1,20 @@
|
|||||||
|
using System;
|
||||||
|
using IoT.Shared.Application.Models;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
|
namespace Platform.Application.Models.IoTCenter
|
||||||
|
{
|
||||||
|
[Display(Name = "网关")]
|
||||||
|
public class EditPlatformIoTGatewayModel : EditIoTGatewayModel
|
||||||
|
{
|
||||||
|
[Display(Name = "机构")]
|
||||||
|
[SelectList(nameof(BuildingId),"GetBuilding")]
|
||||||
|
[Required(ErrorMessage = nameof(RequiredAttribute))]
|
||||||
|
public Guid? OrganId { get; set; }
|
||||||
|
|
||||||
|
[Display(Name = "建筑")]
|
||||||
|
[SelectList]
|
||||||
|
[Required(ErrorMessage = nameof(RequiredAttribute))]
|
||||||
|
public Guid? BuildingId { get; set; }
|
||||||
|
}
|
||||||
|
}
|
@ -1,54 +0,0 @@
|
|||||||
@using System.Reflection
|
|
||||||
@using Microsoft.AspNetCore.Mvc.Controllers
|
|
||||||
@using Infrastructure.Web.Mvc
|
|
||||||
@{
|
|
||||||
var scope = (this.ViewContext.ActionDescriptor as ControllerActionDescriptor).ControllerTypeInfo.GetCustomAttribute<ControllerScopeAttribute>()?.Scope;
|
|
||||||
}
|
|
||||||
<script>
|
|
||||||
$(function () {
|
|
||||||
$('#OrganId').change(function () {
|
|
||||||
var id = $(this).find(':selected').val();
|
|
||||||
update('@Url.Action("GetOrganBuilding", "Ajax",new{area="IoTCenter",scope=scope})', id, "#ParentId");
|
|
||||||
update('@Url.Action("GetUser", "Ajax",new{area=""})', id, "#UserId");
|
|
||||||
});;
|
|
||||||
$('#Query_OrganId').change(function () {
|
|
||||||
var id = $(this).find(':selected').val();
|
|
||||||
update('@Url.Action("GetOrganBuilding", "Ajax",new{area=""})', id, "#Query_ParentId");
|
|
||||||
update('@Url.Action("GetUser", "Ajax",new{area=""})', id, "#Query_UserId");
|
|
||||||
});;
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
<script>
|
|
||||||
//
|
|
||||||
function VeLoad(node, resolve) {
|
|
||||||
var parentId = node.root ? null : node.value;
|
|
||||||
var url = this.url + parentId;
|
|
||||||
$.getJSON(url, function (data) {
|
|
||||||
console.log(data);
|
|
||||||
var parent = node;
|
|
||||||
var nodes = Enumerable.from(data)
|
|
||||||
.where(function (o) {
|
|
||||||
return !Enumerable.from(parent.children).any(function (o2) {
|
|
||||||
return o.value === o2.value;
|
|
||||||
});
|
|
||||||
}).toArray();
|
|
||||||
resolve(nodes);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
function VeChange(value, id) {
|
|
||||||
app.$refs[id].value = value;
|
|
||||||
var text = value[value.length - 1];
|
|
||||||
$('#' + id).val(text);
|
|
||||||
console.log($('#' + id).val());
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
<script>
|
|
||||||
var app = new Vue({
|
|
||||||
el: '#app',
|
|
||||||
data: function () {
|
|
||||||
return {
|
|
||||||
a: 1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in new issue