添加项目文件。

This commit is contained in:
dell
2023-03-03 16:07:50 +08:00
parent 2c462551b6
commit 011039960e
585 changed files with 362460 additions and 0 deletions

View File

@ -0,0 +1,60 @@
/*******************************************************************************
* Copyright © 2016 HT.Cloud.Framework 版权所有
* Author: HT.Cloud
* Description: WaterCloud快速开发平台
* Website
*********************************************************************************/
using System.Collections.Generic;
using System.Text;
namespace HT.Cloud.Code
{
public static class TreeView
{
public static string TreeViewJson(this List<TreeViewModel> data, string parentId = "0")
{
StringBuilder strJson = new StringBuilder();
List<TreeViewModel> item = data.FindAll(t => t.parentId == parentId);
strJson.Append("[");
if (item.Count > 0)
{
foreach (TreeViewModel entity in item)
{
strJson.Append("{");
strJson.Append("\"id\":\"" + entity.id + "\",");
strJson.Append("\"text\":\"" + entity.text.Replace("&nbsp;", "") + "\",");
strJson.Append("\"value\":\"" + entity.value + "\",");
if (entity.title != null && !string.IsNullOrEmpty(entity.title.Replace("&nbsp;", "")))
{
strJson.Append("\"title\":\"" + entity.title.Replace("&nbsp;", "") + "\",");
}
if (entity.img != null && !string.IsNullOrEmpty(entity.img.Replace("&nbsp;", "")))
{
strJson.Append("\"img\":\"" + entity.img.Replace("&nbsp;", "") + "\",");
}
if (entity.checkstate != null)
{
strJson.Append("\"checkstate\":" + entity.checkstate + ",");
}
if (entity.parentId != null)
{
strJson.Append("\"parentnodes\":\"" + entity.parentId + "\",");
}
strJson.Append("\"showcheck\":" + entity.showcheck.ToString().ToLower() + ",");
strJson.Append("\"isexpand\":" + entity.isexpand.ToString().ToLower() + ",");
if (entity.complete == true)
{
strJson.Append("\"complete\":" + entity.complete.ToString().ToLower() + ",");
}
strJson.Append("\"hasChildren\":" + entity.hasChildren.ToString().ToLower() + ",");
strJson.Append("\"ChildNodes\":" + TreeViewJson(data, entity.id) + "");
strJson.Append("},");
}
strJson = strJson.Remove(strJson.Length - 1, 1);
}
strJson.Append("]");
return strJson.ToString();
}
}
}

View File

@ -0,0 +1,24 @@
/*******************************************************************************
* Copyright © 2016 HT.Cloud.Framework 版权所有
* Author: HT.Cloud
* Description: WaterCloud快速开发平台
* Website
*********************************************************************************/
namespace HT.Cloud.Code
{
public class TreeViewModel
{
public string parentId { get; set; }
public string id { get; set; }
public string text { get; set; }
public string value { get; set; }
public int? checkstate { get; set; }
public bool showcheck { get; set; }
public bool complete { get; set; }
public bool isexpand { get; set; }
public bool hasChildren { get; set; }
public string img { get; set; }
public string title { get; set; }
}
}