合并最新
This commit is contained in:
@@ -37,31 +37,38 @@ namespace FineUIPro.Web.Video
|
||||
this.tvControlItem.Nodes.Add(rootNode);
|
||||
|
||||
string url = ConfigurationManager.AppSettings["Video_URL"];
|
||||
List<string> urls = new List<string>();
|
||||
string res = APIGetHttpService.Http(url + "api/v1/device/channeltree");
|
||||
|
||||
List<Dictionary<string, string>> jsonNvr = JsonConvert.DeserializeObject<List<Dictionary<string, string>>>(res);
|
||||
foreach (Dictionary<string, string> nvr in jsonNvr)
|
||||
if (!string.IsNullOrEmpty(url))
|
||||
{
|
||||
TreeNode newNode = new TreeNode();
|
||||
newNode.NodeID = nvr["id"];
|
||||
newNode.Text = nvr["customName"];
|
||||
newNode.ToolTip = "项目";
|
||||
newNode.Expanded = false;
|
||||
rootNode.Nodes.Add(newNode);
|
||||
string jsonCameras = APIGetHttpService.Http(url + "api/v1/device/channeltree?serial=" + nvr["serial"]);
|
||||
var data = JsonConvert.DeserializeObject<List<Dictionary<string, string>>>(jsonCameras);
|
||||
foreach (var video in data)
|
||||
{
|
||||
TreeNode tempNode = new TreeNode();
|
||||
tempNode.NodeID = video["id"];
|
||||
tempNode.Text = video["name"];
|
||||
tempNode.ToolTip = "设备";
|
||||
tempNode.EnableClickEvent = true;
|
||||
List<string> urls = new List<string>();
|
||||
string res = APIGetHttpService.Http(url + "api/v1/device/channeltree");
|
||||
|
||||
newNode.Nodes.Add(tempNode);
|
||||
List<Dictionary<string, string>> jsonNvr = JsonConvert.DeserializeObject<List<Dictionary<string, string>>>(res);
|
||||
foreach (Dictionary<string, string> nvr in jsonNvr)
|
||||
{
|
||||
TreeNode newNode = new TreeNode();
|
||||
newNode.NodeID = nvr["id"];
|
||||
newNode.Text = nvr["customName"];
|
||||
newNode.ToolTip = "项目";
|
||||
newNode.Expanded = false;
|
||||
rootNode.Nodes.Add(newNode);
|
||||
string jsonCameras = APIGetHttpService.Http(url + "api/v1/device/channeltree?serial=" + nvr["serial"]);
|
||||
var data = JsonConvert.DeserializeObject<List<Dictionary<string, string>>>(jsonCameras);
|
||||
foreach (var video in data)
|
||||
{
|
||||
TreeNode tempNode = new TreeNode();
|
||||
tempNode.NodeID = video["id"];
|
||||
tempNode.Text = video["name"];
|
||||
tempNode.ToolTip = "设备";
|
||||
tempNode.EnableClickEvent = true;
|
||||
|
||||
newNode.Nodes.Add(tempNode);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
Alert.ShowInParent("请配置视频服务器地址!", MessageBoxIcon.Warning);
|
||||
}
|
||||
}
|
||||
}
|
||||
#region 树展开事件
|
||||
|
||||
Reference in New Issue
Block a user