From 418692d1bd00631e02888ec3194e115dcabda857 Mon Sep 17 00:00:00 2001 From: fyf Date: Fri, 13 May 2022 18:07:07 +0800 Subject: [PATCH] 34343 --- DataVAPI/UpAndDown/ProcessServer.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/DataVAPI/UpAndDown/ProcessServer.cs b/DataVAPI/UpAndDown/ProcessServer.cs index 2ca95aa..4a2a8a8 100644 --- a/DataVAPI/UpAndDown/ProcessServer.cs +++ b/DataVAPI/UpAndDown/ProcessServer.cs @@ -266,20 +266,20 @@ namespace DataVAPI.UpAndDown if (receiveModel.status.value == "离线") { //离线移除并添加到最后一位 - devModel.operatingDeviceStatus.data.Remove(dev); - devModel.operatingDeviceStatus.data.Add(dev); + index = devModel.operatingDeviceStatus.data.FindLastIndex(0, ar => ar.DeviceZT.Contains("在线")); + } else { //在线 往上一点 index = devModel.operatingDeviceStatus.data.FindIndex(0, ar => ar.DeviceZT.Contains("离线")); if (index > devModel.operatingDeviceStatus.data.Count - 1) index = devModel.operatingDeviceStatus.data.Count - 1; - int now = devModel.operatingDeviceStatus.data.IndexOf(dev); - Swap(devModel.operatingDeviceStatus.data, index, now); + } - + int now = devModel.operatingDeviceStatus.data.IndexOf(dev); + Swap(devModel.operatingDeviceStatus.data, index, now); + - } else {