数据大屏优化

This commit is contained in:
2026-09-23 17:55:18 +08:00
parent 147121cdb2
commit 4bb579d661
39 changed files with 2012 additions and 320 deletions
+79 -76
View File
@@ -28,13 +28,16 @@ namespace FineUIPro.Web
{
string account = string.Empty;
string password = string.Empty;
if (Request.Cookies["u"] != null)
if (HttpContext.Current != null && HttpContext.Current.Request != null)
{
account = HttpUtility.UrlDecode(Request.Cookies["u"].Value);
}
if (Request.Cookies["p"] != null)
{
password = Request.Cookies["p"].Value;
if (Request.Cookies["u"] != null)
{
account = HttpUtility.UrlDecode(Request.Cookies["u"].Value);
}
if (Request.Cookies["p"] != null)
{
password = Request.Cookies["p"].Value;
}
}
Session["CurrUser"] = BLL.Funs.DB.Sys_User.FirstOrDefault(x => x.Account == account && x.Password == Funs.EncryptionPassword(password));
}
@@ -58,66 +61,66 @@ namespace FineUIPro.Web
#region OnInit
protected override void OnInit(EventArgs e)
{
if (Session["CurrUser"] == null && !Request.Path.Contains("/Login.aspx") && !Request.Path.Contains("DataShow"))
{
//string ticket = Request.Params["ticket"];
//if (!string.IsNullOrEmpty(ticket))
//{
// string jsonCameras = APIGetHttpService.Http("https://=" + ticket);
{
if (Session["CurrUser"] == null && !Request.Path.Contains("/Login.aspx") && !Request.Path.Contains("DataShow"))
{
//string ticket = Request.Params["ticket"];
//if (!string.IsNullOrEmpty(ticket))
//{
// string jsonCameras = APIGetHttpService.Http("https://=" + ticket);
// XmlDocument xml = new XmlDocument();
// xml.LoadXml(jsonCameras);
// XmlElement root = xml.DocumentElement;
// XmlNode node = root.ChildNodes[0];//遍历输出.
// if (node.LocalName == "authenticationSuccess")
// {
// string user = node.ChildNodes[0].InnerText;//InnerText节点包合的所有文本内容
// //if ("zyk" == user)
// //{
// // user = "hfnbd";
// //}
// Model.Sys_User sysUser = (from y in Funs.DB.Sys_User
// where (y.DomainAccount == user || y.Account ==user) && y.IsPost == true
// select y).FirstOrDefault();
// if (user != null)
// {
// string accValue = HttpUtility.UrlEncode(user);
// FormsAuthentication.SetAuthCookie(accValue, false);
// Page.Session[SessionName.CurrUser] = sysUser;
// string url = "";
// this.CurrUser.RoleType = RoleService.GetRoleTypeByRoleId(this.CurrUser.RoleId);
// if (!this.CurrUser.LastIsOffice.HasValue)
// {
// this.CurrUser.LastIsOffice = this.CurrUser.IsOffice;
// }
// if (this.CurrUser.LastIsOffice == true)
// {
// this.CurrUser.LoginProjectId = null;
// ////本部菜单
// url = "index.aspx";
// }
// else
// {
// this.CurrUser.LoginProjectId = this.CurrUser.LastProjectId;
// //// 项目菜单
// url = "indexProject.aspx?projectId=" + this.CurrUser.LastProjectId;
// }
// this.SysType = "GONGCHENG";
// Response.Redirect(url);
// }
// else
// {
// Response.Redirect("Login.aspx");
// }
// }
//}
//else
//{
// Response.Redirect("https://sggl/indexProject.aspx");
//}
}
var pm = PageManager.Instance;
// XmlDocument xml = new XmlDocument();
// xml.LoadXml(jsonCameras);
// XmlElement root = xml.DocumentElement;
// XmlNode node = root.ChildNodes[0];//遍历输出.
// if (node.LocalName == "authenticationSuccess")
// {
// string user = node.ChildNodes[0].InnerText;//InnerText节点包合的所有文本内容
// //if ("zyk" == user)
// //{
// // user = "hfnbd";
// //}
// Model.Sys_User sysUser = (from y in Funs.DB.Sys_User
// where (y.DomainAccount == user || y.Account ==user) && y.IsPost == true
// select y).FirstOrDefault();
// if (user != null)
// {
// string accValue = HttpUtility.UrlEncode(user);
// FormsAuthentication.SetAuthCookie(accValue, false);
// Page.Session[SessionName.CurrUser] = sysUser;
// string url = "";
// this.CurrUser.RoleType = RoleService.GetRoleTypeByRoleId(this.CurrUser.RoleId);
// if (!this.CurrUser.LastIsOffice.HasValue)
// {
// this.CurrUser.LastIsOffice = this.CurrUser.IsOffice;
// }
// if (this.CurrUser.LastIsOffice == true)
// {
// this.CurrUser.LoginProjectId = null;
// ////本部菜单
// url = "index.aspx";
// }
// else
// {
// this.CurrUser.LoginProjectId = this.CurrUser.LastProjectId;
// //// 项目菜单
// url = "indexProject.aspx?projectId=" + this.CurrUser.LastProjectId;
// }
// this.SysType = "GONGCHENG";
// Response.Redirect(url);
// }
// else
// {
// Response.Redirect("Login.aspx");
// }
// }
//}
//else
//{
// Response.Redirect("https://sggl/indexProject.aspx");
//}
}
var pm = PageManager.Instance;
if (pm != null)
{
HttpCookie themeCookie = Request.Cookies["Theme"];
@@ -248,15 +251,15 @@ namespace FineUIPro.Web
/// <param name="e"></param>
protected void PageBase_Load(object sender, EventArgs e)
{
//这是后置式的权限管理策略.
//页面装载完成以后才检查是否有权限打开此页....
//anyway,its ok.
//这是后置式的权限管理策略.
//页面装载完成以后才检查是否有权限打开此页....
//anyway,its ok.
this.Title = BLL.Funs.SystemName;
this.Title = BLL.Funs.SystemName;
//if (CurrUser == null)
//{
// if (this.Page.Request.AppRelativeCurrentExecutionFilePath != "~/Login.aspx")
@@ -557,12 +560,12 @@ namespace FineUIPro.Web
/// <returns>数据表</returns>
protected DataTable GetPagedDataTable(FineUIPro.Grid Grid1, DataTable tb)
{
int pageIndex = Grid1.PageIndex;
int pageIndex = Grid1.PageIndex;
int pageSize = Grid1.PageSize;
string sortField = Grid1.SortField;
string sortDirection = Grid1.SortDirection;
//DataTable table2 = DataSourceUtil.GetDataTable2();
DataView view = tb.DefaultView;
// view.Sort = String.Format("{0} {1}", sortField, sortDirection);
@@ -957,7 +960,7 @@ namespace FineUIPro.Web
sb.Append("<meta http-equiv=\"content-type\" content=\"application/excel; charset=UTF-8\"/>");
sb.Append("<table cellspacing=\"0\" rules=\"all\" border=\"1\" style=\"border-collapse:collapse;\">");
sb.Append("<tr>");
foreach (GridColumn column in grid.Columns)
{
sb.AppendFormat("<td x:str>{0}</td>", column.HeaderText);
@@ -968,8 +971,8 @@ namespace FineUIPro.Web
sb.Append("<tr>");
foreach (GridColumn column in grid.Columns)
{
string html = row.Values[column.ColumnIndex].ToString();
string html = row.Values[column.ColumnIndex].ToString();
if (column.ColumnID == "tfNumber" && (row.FindControl("lblNumber") as AspNet.Label) != null)
{
html = (row.FindControl("lblNumber") as AspNet.Label).Text;
@@ -995,7 +998,7 @@ namespace FineUIPro.Web
}
}
sb.AppendFormat("<td style='vnd.ms-excel.numberformat:@;width:140px;'>{0}</td>", html);
// sb.AppendFormat("<td>{0}</td>", html);
// sb.AppendFormat("<td>{0}</td>", html);
}
sb.Append("</tr>");