优化多变量同时下发功能
This commit is contained in:
parent
feb09b14ae
commit
30bd58b4aa
@ -22,8 +22,18 @@ namespace IoTGateway.ViewModel.BasicData.DeviceVariableVMs
|
||||
{
|
||||
try
|
||||
{
|
||||
var ids = (StringValues)FC["setValue.ID[]"];
|
||||
var values= (StringValues)FC["setValue.SetRawValue[]"];
|
||||
StringValues ids , values;
|
||||
if (FC.ContainsKey("setValue.ID[]"))
|
||||
{
|
||||
ids = (StringValues)FC["setValue.ID[]"];
|
||||
values = (StringValues)FC["setValue.SetRawValue[]"];
|
||||
}
|
||||
else
|
||||
{
|
||||
ids = (StringValues)FC["setValue.ID"];
|
||||
values = (StringValues)FC["setValue.SetRawValue"];
|
||||
}
|
||||
|
||||
Dictionary<string, string> kv = new(0);
|
||||
for (int i = 0; i < ids.Count; i++)
|
||||
{
|
||||
@ -87,6 +97,8 @@ namespace IoTGateway.ViewModel.BasicData.DeviceVariableVMs
|
||||
StringValues ids;
|
||||
if (FC.ContainsKey("setValue.ID[]"))
|
||||
ids = (StringValues)FC["setValue.ID[]"];
|
||||
else if (FC.ContainsKey("setValue.ID"))
|
||||
ids = (StringValues)FC["setValue.ID"];
|
||||
else
|
||||
ids = (StringValues)FC["Ids[]"];
|
||||
|
||||
|
@ -216,7 +216,7 @@ namespace IoTGateway.Controllers
|
||||
return vm.GetExportData();
|
||||
}
|
||||
#region 下发写入
|
||||
[ActionDescription("下发写入")]
|
||||
[ActionDescription("下发页面")]
|
||||
[HttpPost]
|
||||
public ActionResult SetValue(string[] IDs)
|
||||
{
|
||||
@ -225,11 +225,16 @@ namespace IoTGateway.Controllers
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
[ActionDescription("下发写入")]
|
||||
[ActionDescription("下发确认按钮")]
|
||||
public ActionResult DoSetValue()
|
||||
{
|
||||
var ids = Request.Form["setValue.ID[]"].ToArray();
|
||||
var values = Request.Form["setValue.SetRawValue[]"].ToArray();
|
||||
if (ids.Length == 0)
|
||||
{
|
||||
ids = Request.Form["setValue.ID"].ToArray();
|
||||
values = Request.Form["setValue.SetRawValue"].ToArray();
|
||||
}
|
||||
|
||||
var vm = Wtm.CreateVM<SetValueVM>(Ids: ids);
|
||||
if (!ModelState.IsValid)
|
||||
|
Loading…
Reference in New Issue
Block a user