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