feat: 侧边栏收缩配置项生效

This commit is contained in:
Argo Zhang 2019-08-17 17:37:37 +08:00
parent 5a91330bf6
commit c21e3d06c0
No known key found for this signature in database
GPG Key ID: 152E398953DDF19F
6 changed files with 27 additions and 4 deletions

View File

@ -17,6 +17,7 @@ namespace Bootstrap.Admin.Models
Theme = DictHelper.RetrieveActiveTheme();
IsDemo = DictHelper.RetrieveSystemModel();
ShowCardTitle = DictHelper.RetrieveCardTitleStatus() ? "" : "no-card-header";
ShowSideBar = DictHelper.RetrieveSidebarStatus() ? "" : "sidebar-open";
}
/// <summary>
@ -43,5 +44,10 @@ namespace Bootstrap.Admin.Models
/// 是否显示卡片标题
/// </summary>
public string ShowCardTitle { get; protected set; }
/// <summary>
/// 是否收缩侧边栏
/// </summary>
public string ShowSideBar { get; protected set; }
}
}

View File

@ -87,7 +87,7 @@
<div class="row">
<div class="form-group col-sm-6">
<label class="control-label" for="sider">侧边栏设置</label>
<input id="sider" hidden type="checkbox" data-toggle="toggle" data-width="120" data-onstyle="success" data-on="展开" data-off="收缩" />
<input id="sider" hidden type="checkbox" data-default-val="@Model.ShowSideBar" data-toggle="toggle" data-width="120" data-onstyle="success" data-on="展开" data-off="收缩" />
</div>
<div class="form-group col-sm-6">
<label class="control-label" for="cardTitle">标题设置</label>

View File

@ -28,6 +28,10 @@
.breadcrumb {
border-top: solid 1px #ddd !important;
}
.sidebar-open .sidebar-toggle-box .fa-bars {
transform: rotate(0);
}
</style>
}
<div class="content-body welcome-bg">

View File

@ -1,4 +1,5 @@
<!DOCTYPE html>
@model ModelBase
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta charset="utf-8">
@ -13,7 +14,7 @@
<link href="../css/IE8.css" rel="stylesheet" />
<![endif]-->
</head>
<body>
<body class="@Model.ShowSideBar">
<!--[if lt IE 10 ]>
<div id="ieAlert" class="alert alert-danger alert-dismissible">
<div>当前浏览器版本太低不支持本系统请升级到至少IE10 <a href="../browser/IE10.exe" target="_blank">本地下载</a> <a href="https://support.microsoft.com/zh-cn/help/17621/internet-explorer-downloads" target="_blank">微软下载</a>或者使用Chrome浏览器 <a href="../browser/ChromeSetup.exe" target="_blank">本地下载</a></div>

View File

@ -191,6 +191,12 @@ namespace Bootstrap.DataAccess
/// 获得 数据库标题是否显示
/// </summary>
/// <returns></returns>
public bool RetrieveCardTitleStatus() => (DictHelper.RetrieveDicts().FirstOrDefault(d => d.Category == "网站设置" && d.Name == "卡片标题状态" && d.Define == 0)?.Code ?? "") == "1";
public bool RetrieveCardTitleStatus() => (DictHelper.RetrieveDicts().FirstOrDefault(d => d.Category == "网站设置" && d.Name == "卡片标题状态" && d.Define == 0)?.Code ?? "1") == "1";
/// <summary>
/// 获得 是否显示侧边栏 为真时显示
/// </summary>
/// <returns></returns>
public bool RetrieveSidebarStatus() => (DictHelper.RetrieveDicts().FirstOrDefault(d => d.Category == "网站设置" && d.Name == "侧边栏状态" && d.Define == 0)?.Code ?? "1") == "1";
}
}

View File

@ -208,5 +208,11 @@ namespace Bootstrap.DataAccess
/// </summary>
/// <returns></returns>
public static bool RetrieveCardTitleStatus() => DbContextManager.Create<Dict>().RetrieveCardTitleStatus();
/// <summary>
/// 获得侧边栏状态 未真时显示
/// </summary>
/// <returns></returns>
public static bool RetrieveSidebarStatus() => DbContextManager.Create<Dict>().RetrieveSidebarStatus();
}
}