初始化提交
This commit is contained in:
58
电子展板/Utility/ResponseModels/AjaxResult.cs
Normal file
58
电子展板/Utility/ResponseModels/AjaxResult.cs
Normal file
@@ -0,0 +1,58 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
|
||||
namespace 电子展板.Utility.ResponseModels
|
||||
{
|
||||
/// <summary>
|
||||
/// 通用AJAX请求响应数据格式模型。
|
||||
/// </summary>
|
||||
public class AjaxResult
|
||||
{
|
||||
public AjaxResult(ResultType state, string message, object data = null)
|
||||
{
|
||||
this.state = state;
|
||||
this.message = message;
|
||||
this.data = data;
|
||||
}
|
||||
/// <summary>
|
||||
/// 结果类型。
|
||||
/// </summary>
|
||||
public ResultType state { get; set; }
|
||||
/// <summary>
|
||||
/// 消息内容。
|
||||
/// </summary>
|
||||
public string message { get; set; }
|
||||
/// <summary>
|
||||
/// 返回数据。
|
||||
/// </summary>
|
||||
public object data { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 结果类型枚举。
|
||||
/// </summary>
|
||||
public enum ResultType
|
||||
{
|
||||
/// <summary>
|
||||
/// 警告。
|
||||
/// </summary>
|
||||
Warning = 0,
|
||||
|
||||
/// <summary>
|
||||
/// 成功。
|
||||
/// </summary>
|
||||
Success = 1,
|
||||
|
||||
/// <summary>
|
||||
/// 异常。
|
||||
/// </summary>
|
||||
Error = 2,
|
||||
|
||||
/// <summary>
|
||||
/// 消息。
|
||||
/// </summary>
|
||||
Info = 6
|
||||
}
|
||||
}
|
||||
51
电子展板/Utility/ResponseModels/LayNavbar.cs
Normal file
51
电子展板/Utility/ResponseModels/LayNavbar.cs
Normal file
@@ -0,0 +1,51 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace 电子展板.Utility.ResponseModels
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 菜单视图模型。
|
||||
/// </summary>
|
||||
public class LayNavbar
|
||||
{
|
||||
/// <summary>
|
||||
/// 标题
|
||||
/// </summary>
|
||||
public string title { get; set; }
|
||||
/// <summary>
|
||||
/// 图标
|
||||
/// </summary>
|
||||
public string icon { get; set; }
|
||||
/// <summary>
|
||||
/// 是否展开
|
||||
/// </summary>
|
||||
public bool spread { get; set; }
|
||||
/// <summary>
|
||||
/// 子级菜单集合
|
||||
/// </summary>
|
||||
public List<LayChildNavbar> children { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 子级菜单模型。
|
||||
/// </summary>
|
||||
public class LayChildNavbar
|
||||
{
|
||||
/// <summary>
|
||||
/// 标题
|
||||
/// </summary>
|
||||
public string title { get; set; }
|
||||
/// <summary>
|
||||
/// 图标
|
||||
/// </summary>
|
||||
public string icon { get; set; }
|
||||
/// <summary>
|
||||
/// 链接
|
||||
/// </summary>
|
||||
public string href { get; set; }
|
||||
}
|
||||
}
|
||||
37
电子展板/Utility/ResponseModels/LayPadding.cs
Normal file
37
电子展板/Utility/ResponseModels/LayPadding.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
|
||||
namespace 电子展板.Utility.ResponseModels
|
||||
{
|
||||
/// <summary>
|
||||
/// Laytpl + Laypage 分页模型。
|
||||
/// </summary>
|
||||
/// <typeparam name="TEntity"></typeparam>
|
||||
public class LayPadding<TEntity> where TEntity : class
|
||||
{
|
||||
public int code { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取结果。
|
||||
/// </summary>
|
||||
public bool result { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 备注信息。
|
||||
/// </summary>
|
||||
public string msg { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 数据列表。
|
||||
/// </summary>
|
||||
public List<TEntity> list { get; set; }
|
||||
|
||||
public string backgroundImage { get; set; }
|
||||
/// <summary>
|
||||
/// 记录条数。
|
||||
/// </summary>
|
||||
public long count { get; set; }
|
||||
}
|
||||
}
|
||||
35
电子展板/Utility/ResponseModels/LayPaddingDataTable.cs
Normal file
35
电子展板/Utility/ResponseModels/LayPaddingDataTable.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace 电子展板.Utility.ResponseModels
|
||||
{
|
||||
public class LayPaddingDataTable
|
||||
{
|
||||
public int code { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取结果。
|
||||
/// </summary>
|
||||
public bool result { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 备注信息。
|
||||
/// </summary>
|
||||
public string msg { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 数据列表。
|
||||
/// </summary>
|
||||
public DataTable list { get; set; }
|
||||
|
||||
public string backgroundImage { get; set; }
|
||||
/// <summary>
|
||||
/// 记录条数。
|
||||
/// </summary>
|
||||
public long count { get; set; }
|
||||
}
|
||||
}
|
||||
11
电子展板/Utility/ResponseModels/RetStr.cs
Normal file
11
电子展板/Utility/ResponseModels/RetStr.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace 电子展板.Utility.ResponseModels
|
||||
{
|
||||
public class RetStr
|
||||
{
|
||||
public string Data { get; set; }
|
||||
}
|
||||
}
|
||||
55
电子展板/Utility/ResponseModels/TreeSelect.cs
Normal file
55
电子展板/Utility/ResponseModels/TreeSelect.cs
Normal file
@@ -0,0 +1,55 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Web;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace 电子展板.Utility.ResponseModels
|
||||
{
|
||||
/// <summary>
|
||||
/// Select2树形下拉列表模型。
|
||||
/// </summary>
|
||||
public class TreeSelect
|
||||
{
|
||||
public string id { get; set; }
|
||||
public string text { get; set; }
|
||||
public string parentId { get; set; }
|
||||
public object data { get; set; }
|
||||
}
|
||||
|
||||
public static class TreeSelectHelper
|
||||
{
|
||||
public static string ToTreeSelectJson(this List<TreeSelect> data)
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.Append("[");
|
||||
sb.Append(ToTreeSelectJson(data, "0", ""));
|
||||
sb.Append("]");
|
||||
return sb.ToString();
|
||||
}
|
||||
private static string ToTreeSelectJson(List<TreeSelect> data, string parentId, string blank)
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
var childList = data.FindAll(t => t.parentId == parentId);
|
||||
|
||||
var tabline = "";
|
||||
if (parentId != "0")
|
||||
{
|
||||
tabline = " ";
|
||||
}
|
||||
if (childList.Count > 0)
|
||||
{
|
||||
tabline = tabline + blank;
|
||||
}
|
||||
foreach (TreeSelect entity in childList)
|
||||
{
|
||||
entity.text = tabline + entity.text;
|
||||
string strJson = JsonConvert.SerializeObject(entity);
|
||||
sb.Append(strJson);
|
||||
sb.Append(ToTreeSelectJson(data, entity.id, tabline));
|
||||
}
|
||||
return sb.ToString().Replace("}{", "},{");
|
||||
}
|
||||
}
|
||||
}
|
||||
34
电子展板/Utility/ResponseModels/ZTreeNode.cs
Normal file
34
电子展板/Utility/ResponseModels/ZTreeNode.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
|
||||
namespace 电子展板.Utility.ResponseModels
|
||||
{
|
||||
/// <summary>
|
||||
/// zTree单层节点数据模型。
|
||||
/// </summary>
|
||||
public class ZTreeNode
|
||||
{
|
||||
/// <summary>
|
||||
/// 节点ID。
|
||||
/// </summary>
|
||||
public string id { get; set; }
|
||||
/// <summary>
|
||||
/// 父节点ID。
|
||||
/// </summary>
|
||||
public string pId { get; set; }
|
||||
/// <summary>
|
||||
/// 节点名称。
|
||||
/// </summary>
|
||||
public string name { get; set; }
|
||||
/// <summary>
|
||||
/// 是否展开。
|
||||
/// </summary>
|
||||
public bool open { get; set; }
|
||||
/// <summary>
|
||||
/// 是否选中。
|
||||
/// </summary>
|
||||
public bool @checked { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user