增加代码:整合BA后台的侧边栏代码

This commit is contained in:
Argo-MacBookPro 2018-09-23 14:08:13 +08:00
parent 4845b6f9b9
commit e53d603211
16 changed files with 3793 additions and 4049 deletions

View File

@ -1,10 +1,10 @@
@model NavigatorBarModel
<aside>
<!-- sidebar menu start-->
<ul class="sidebar">
<ul class="sidebar nav nav-pills flex-column flex-nowrap">
@foreach (var menu in Model.Navigations)
{
@await Html.PartialAsync("SubMenu", menu)
@await Html.PartialAsync("SubNavItem", menu)
}
</ul>
<!-- sidebar menu end-->

View File

@ -1,8 +0,0 @@
@model Bootstrap.Security.BootstrapMenu
<li>
<a href="@Url.Content(Model.Url)" class="@Model.Active" target="@Model.Target"><i class="@Model.Icon"></i>@Model.Name</a>
@if (Model.Menus.Count() > 0)
{
@await Html.PartialAsync("SubNavigation", Model.Menus)
}
</li>

View File

@ -0,0 +1,8 @@
@model Bootstrap.Security.BootstrapMenu
<li class="nav-item @Model.Active">
<a href="@Url.Content(Model.Url)" class="nav-link @Model.Active" target="@Model.Target"><i class="@Model.Icon"></i>@Model.Name</a>
@if (Model.Menus.Count() > 0)
{
@await Html.PartialAsync("SubNavigation", Model.Menus)
}
</li>

View File

@ -1,7 +1,7 @@
@model IEnumerable<Bootstrap.Security.BootstrapMenu>
<ul class="sub" style="display: none;">
<ul class="sub nav nav-pills flex-column flex-nowrap" style="display: none;">
@foreach (var menu in Model)
{
@await Html.PartialAsync("SubMenu", menu)
@await Html.PartialAsync("SubNavItem", menu)
}
</ul>

View File

@ -7,11 +7,13 @@
<link href="~/css/bootstrap.css" rel="stylesheet" asp-append-version="true" />
<link href="~/css/font-awesome.css" rel="stylesheet" asp-append-version="true" />
<link href="~/css/toastr.css" rel="stylesheet" asp-append-version="true" />
<link href="~/css/jquery.mCustomScrollbar.css" rel="stylesheet" />
</environment>
<environment exclude="Development">
<link href="~/css/bootstrap.min.css" rel="stylesheet" asp-append-version="true">
<link href="~/css/font-awesome.min.css" rel="stylesheet" asp-append-version="true" />
<link href="~/css/toastr.min.css" rel="stylesheet" asp-append-version="true" />
<link href="~/css/jquery.mCustomScrollbar.min.css" rel="stylesheet" />
</environment>
@RenderSection("css", false)
<link href="~/css/theme.css" rel="stylesheet" asp-append-version="true" />
@ -26,13 +28,11 @@
@section javascript {
<environment include="Development">
<script src="~/js/bootstrap.bundle.js" asp-append-version="true"></script>
<script src="~/js/jquery.scrollTo.js" asp-append-version="true"></script>
<script src="~/js/jquery.nicescroll.js" asp-append-version="true"></script>
<script src="~/js/jquery.mCustomScrollbar.js"></script>
</environment>
<environment exclude="Development">
<script src="~/js/bootstrap.bundle.min.js" asp-append-version="true"></script>
<script src="~/js/jquery.scrollTo.min.js" asp-append-version="true"></script>
<script src="~/js/jquery.nicescroll.min.js" asp-append-version="true"></script>
<script src="~/js/jquery.mCustomScrollbar.concat.min.js"></script>
</environment>
<script src="~/js/toastr.min.js" asp-append-version="true"></script>
<script src="~/js/longbow.common.js" asp-append-version="true"></script>

View File

@ -2,8 +2,6 @@
border-color: #5198cb;
}
.navbar-light .navbar-nav .show > .nav-link, .navbar-light .navbar-nav .active > .nav-link, .navbar-light .navbar-nav .nav-link.show, .navbar-light .navbar-nav .nav-link.active {
color: rgb(51, 122, 183);
}
@ -54,11 +52,11 @@
text-shadow: none;
}
.navbar {
.header .navbar {
padding-bottom: 0;
}
.nav-item.active {
.header .nav-item.active {
border-bottom: solid 1px #307eb6;
}

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -32,87 +32,63 @@ aside {
.sidebar {
padding: 20px 0;
margin-bottom: 0;
background: inherit;
}
.sidebar .dcjq-parent-li, .sidebar li a.active, .sidebar li a.active + .sub {
background: #35404D;
}
.sidebar .sub .dcjq-parent-li, .sidebar .sub li a.active, .sidebar .sub li a.active + .sub {
background: #3a4756;
}
.sidebar .dcjq-icon {
height: 17px;
width: 17px;
display: inline-block;
background: url(../images/nav-expand.png) no-repeat;
float: right;
margin-top: 3px;
}
.sidebar .active .dcjq-icon {
background-position: bottom;
}
.sidebar li {
.sidebar .nav-item {
margin: 5px 10px;
}
.sidebar li a {
color: #aeb2b7;
display: block;
padding: 15px 10px;
transition: all 0.3s ease;
border-radius: 4px;
.sidebar .nav-item .nav-link:hover, .sidebar .nav-item .nav-link:focus {
background: #35404d;
color: #fff;
}
.sidebar li a:hover, .sidebar li a:focus {
background: #35404d;
color: #fff;
}
.sidebar li a.active {
color: #FF6C60;
}
.sidebar li a i {
width: 22px;
}
.sidebar li .sub {
padding-left: 0;
.sidebar .nav-item.active > .nav-link {
color: #FF6C60;
}
.sidebar > li > .sub a:hover, .sidebar > li > .sub .active > a {
color: #FF6C60;
transition: all 0.3s ease;
display: block;
.sidebar .nav-link {
color: #aeb2b7;
padding: 15px 10px;
transition: all .3s linear;
display: flex;
align-items: center;
}
.sidebar > li > .sub a:hover, .sidebar > li > .sub a:focus {
background: none;
}
.sidebar li .sub li {
margin: 0;
padding: 0 10px 0 32px;
}
.sidebar li .sub li:last-child {
border-radius: 0 0 4px 4px;
padding-bottom: 10px;
.sidebar .nav-link .dcjq-icon {
height: 17px;
width: 17px;
background: url(../images/nav-expand.png) no-repeat;
margin-left: auto;
}
.sidebar li .sub li a {
padding: 12px 0;
.sidebar .nav-link i {
width: 22px;
}
ul li {
list-style: none;
}
.sidebar .nav-link.active, .sidebar .nav-link.active + .sub,
.sidebar .sub .sub .nav-item .nav-link:hover, .sidebar .sub .sub .nav-item .nav-link:focus {
background: #35404D;
}
.sidebar .nav-link.active .dcjq-icon {
background-position: bottom;
}
.sidebar .sub .nav-item.dcjq-parent-li {
margin-left: 0;
margin-right: 0;
}
.sidebar .sub .nav-item.dcjq-parent-li .nav-link {
padding-left: 20px;
}
.sidebar .sub .dcjq-parent-li .nav-link.active, .sidebar .sub .dcjq-parent-li .nav-link.active + .sub,
.sidebar .sub .nav-item .nav-link:hover, .sidebar .sub .nav-item .nav-link:focus {
background: #3a4756;
}
.modal-body .dd {
margin-bottom: 15px;
@ -124,7 +100,7 @@ a, a:hover, a:focus {
}
.dropdown-menu a {
transition: all .3s linear;
transition: all .25s linear;
padding: 6px 20px;
}

View File

@ -15,17 +15,12 @@
"hideMethod": "fadeOut"
};
var $sidebar = $('aside');
var $sideMenu = $(".sidebar");
var $breadNav = $('#breadNav');
$sideMenu.dcAccordion({
autoExpand: true
});
// custom scrollbar
if (!$.browser.versions.ios) $sidebar.niceScroll({ cursorcolor: "#e8403f", cursorwidth: '3px', background: '#2a3542', spacebarenabled: false, cursorborder: '' });
$("#gotoTop").on('click', function (e) {
e.preventDefault();
$('body').animate({
@ -34,29 +29,12 @@
});
// breadcrumb
var $breadNav = $('#breadNav');
var arch = $sideMenu.find('a.active').last();
if (arch.text() !== "") $breadNav.removeClass('d-none').text(arch.text());
// sidebar scroll animate
var top = (arch.offset() || { top: 0 }).top;
if (top > 0) {
var middle = $('header').outerHeight() + $sidebar.outerHeight() / 2;
if (top > middle) $sidebar.animate({ scrollTop: top + arch.outerHeight() / 2 - middle }, 500);
}
$sideMenu.on('click', 'a.dcjq-parent', function () {
var o = $(this).offset();
diff = 110 - o.top;
if (diff > 0)
$sidebar.scrollTo("-=" + Math.abs(diff), 500);
else
$sidebar.scrollTo("+=" + Math.abs(diff), 500);
// resize nicscroll
$sidebar.getNiceScroll().resize();
});
$('.sidebar-toggle-box').on('click', function () {
if ($(window).width() >= 768) return;
$('body').toggleClass('sidebar-open');
});

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -1,210 +0,0 @@
/*!
* jQuery.scrollTo
* Copyright (c) 2007-2015 Ariel Flesler - aflesler gmail com | http://flesler.blogspot.com
* Licensed under MIT
* http://flesler.blogspot.com/2007/10/jqueryscrollto.html
* @projectDescription Lightweight, cross-browser and highly customizable animated scrolling with jQuery
* @author Ariel Flesler
* @version 2.1.2
*/
; (function (factory) {
'use strict';
if (typeof define === 'function' && define.amd) {
// AMD
define(['jquery'], factory);
} else if (typeof module !== 'undefined' && module.exports) {
// CommonJS
module.exports = factory(require('jquery'));
} else {
// Global
factory(jQuery);
}
})(function ($) {
'use strict';
var $scrollTo = $.scrollTo = function (target, duration, settings) {
return $(window).scrollTo(target, duration, settings);
};
$scrollTo.defaults = {
axis: 'xy',
duration: 0,
limit: true
};
function isWin(elem) {
return !elem.nodeName ||
$.inArray(elem.nodeName.toLowerCase(), ['iframe', '#document', 'html', 'body']) !== -1;
}
$.fn.scrollTo = function (target, duration, settings) {
if (typeof duration === 'object') {
settings = duration;
duration = 0;
}
if (typeof settings === 'function') {
settings = { onAfter: settings };
}
if (target === 'max') {
target = 9e9;
}
settings = $.extend({}, $scrollTo.defaults, settings);
// Speed is still recognized for backwards compatibility
duration = duration || settings.duration;
// Make sure the settings are given right
var queue = settings.queue && settings.axis.length > 1;
if (queue) {
// Let's keep the overall duration
duration /= 2;
}
settings.offset = both(settings.offset);
settings.over = both(settings.over);
return this.each(function () {
// Null target yields nothing, just like jQuery does
if (target === null) return;
var win = isWin(this),
elem = win ? this.contentWindow || window : this,
$elem = $(elem),
targ = target,
attr = {},
toff;
switch (typeof targ) {
// A number will pass the regex
case 'number':
case 'string':
if (/^([+-]=?)?\d+(\.\d+)?(px|%)?$/.test(targ)) {
targ = both(targ);
// We are done
break;
}
// Relative/Absolute selector
targ = win ? $(targ) : $(targ, elem);
/* falls through */
case 'object':
if (targ.length === 0) return;
// DOMElement / jQuery
if (targ.is || targ.style) {
// Get the real position of the target
toff = (targ = $(targ)).offset();
}
}
var offset = $.isFunction(settings.offset) && settings.offset(elem, targ) || settings.offset;
$.each(settings.axis.split(''), function (i, axis) {
var Pos = axis === 'x' ? 'Left' : 'Top',
pos = Pos.toLowerCase(),
key = 'scroll' + Pos,
prev = $elem[key](),
max = $scrollTo.max(elem, axis);
if (toff) {// jQuery / DOMElement
attr[key] = toff[pos] + (win ? 0 : prev - $elem.offset()[pos]);
// If it's a dom element, reduce the margin
if (settings.margin) {
attr[key] -= parseInt(targ.css('margin' + Pos), 10) || 0;
attr[key] -= parseInt(targ.css('border' + Pos + 'Width'), 10) || 0;
}
attr[key] += offset[pos] || 0;
if (settings.over[pos]) {
// Scroll to a fraction of its width/height
attr[key] += targ[axis === 'x' ? 'width' : 'height']() * settings.over[pos];
}
} else {
var val = targ[pos];
// Handle percentage values
attr[key] = val.slice && val.slice(-1) === '%' ?
parseFloat(val) / 100 * max
: val;
}
// Number or 'number'
if (settings.limit && /^\d+$/.test(attr[key])) {
// Check the limits
attr[key] = attr[key] <= 0 ? 0 : Math.min(attr[key], max);
}
// Don't waste time animating, if there's no need.
if (!i && settings.axis.length > 1) {
if (prev === attr[key]) {
// No animation needed
attr = {};
} else if (queue) {
// Intermediate animation
animate(settings.onAfterFirst);
// Don't animate this axis again in the next iteration.
attr = {};
}
}
});
animate(settings.onAfter);
function animate(callback) {
var opts = $.extend({}, settings, {
// The queue setting conflicts with animate()
// Force it to always be true
queue: true,
duration: duration,
complete: callback && function () {
callback.call(elem, targ, settings);
}
});
$elem.animate(attr, opts);
}
});
};
// Max scrolling position, works on quirks mode
// It only fails (not too badly) on IE, quirks mode.
$scrollTo.max = function (elem, axis) {
var Dim = axis === 'x' ? 'Width' : 'Height',
scroll = 'scroll' + Dim;
if (!isWin(elem))
return elem[scroll] - $(elem)[Dim.toLowerCase()]();
var size = 'client' + Dim,
doc = elem.ownerDocument || elem.document,
html = doc.documentElement,
body = doc.body;
return Math.max(html[scroll], body[scroll]) - Math.min(html[size], body[size]);
};
function both(val) {
return $.isFunction(val) || $.isPlainObject(val) ? val : { top: val, left: val };
}
// Add special hooks so that window scroll properties can be animated
$.Tween.propHooks.scrollLeft =
$.Tween.propHooks.scrollTop = {
get: function (t) {
return $(t.elem)[t.prop]();
},
set: function (t) {
var curr = this.get(t);
// If interrupt is true and user scrolled, stop animating
if (t.options.interrupt && t._last && t._last !== curr) {
return $(t.elem).stop();
}
var next = Math.round(t.now);
// Don't waste CPU
// Browsers don't render floating point scroll
if (curr !== next) {
$(t.elem)[t.prop](next);
t._last = this.get(t);
}
}
};
// AMD requirement
return $scrollTo;
});

View File

@ -1,7 +0,0 @@
/**
* Copyright (c) 2007-2013 Ariel Flesler - aflesler<a>gmail<d>com | http://flesler.blogspot.com
* Dual licensed under MIT and GPL.
* @author Ariel Flesler
* @version 1.4.6
*/
;(function($){var h=$.scrollTo=function(a,b,c){$(window).scrollTo(a,b,c)};h.defaults={axis:'xy',duration:parseFloat($.fn.jquery)>=1.3?0:1,limit:true};h.window=function(a){return $(window)._scrollable()};$.fn._scrollable=function(){return this.map(function(){var a=this,isWin=!a.nodeName||$.inArray(a.nodeName.toLowerCase(),['iframe','#document','html','body'])!=-1;if(!isWin)return a;var b=(a.contentWindow||a).document||a.ownerDocument||a;return/webkit/i.test(navigator.userAgent)||b.compatMode=='BackCompat'?b.body:b.documentElement})};$.fn.scrollTo=function(e,f,g){if(typeof f=='object'){g=f;f=0}if(typeof g=='function')g={onAfter:g};if(e=='max')e=9e9;g=$.extend({},h.defaults,g);f=f||g.duration;g.queue=g.queue&&g.axis.length>1;if(g.queue)f/=2;g.offset=both(g.offset);g.over=both(g.over);return this._scrollable().each(function(){if(e==null)return;var d=this,$elem=$(d),targ=e,toff,attr={},win=$elem.is('html,body');switch(typeof targ){case'number':case'string':if(/^([+-]=?)?\d+(\.\d+)?(px|%)?$/.test(targ)){targ=both(targ);break}targ=$(targ,this);if(!targ.length)return;case'object':if(targ.is||targ.style)toff=(targ=$(targ)).offset()}$.each(g.axis.split(''),function(i,a){var b=a=='x'?'Left':'Top',pos=b.toLowerCase(),key='scroll'+b,old=d[key],max=h.max(d,a);if(toff){attr[key]=toff[pos]+(win?0:old-$elem.offset()[pos]);if(g.margin){attr[key]-=parseInt(targ.css('margin'+b))||0;attr[key]-=parseInt(targ.css('border'+b+'Width'))||0}attr[key]+=g.offset[pos]||0;if(g.over[pos])attr[key]+=targ[a=='x'?'width':'height']()*g.over[pos]}else{var c=targ[pos];attr[key]=c.slice&&c.slice(-1)=='%'?parseFloat(c)/100*max:c}if(g.limit&&/^\d+$/.test(attr[key]))attr[key]=attr[key]<=0?0:Math.min(attr[key],max);if(!i&&g.queue){if(old!=attr[key])animate(g.onAfterFirst);delete attr[key]}});animate(g.onAfter);function animate(a){$elem.animate(attr,f,g.easing,a&&function(){a.call(this,targ,g)})}}).end()};h.max=function(a,b){var c=b=='x'?'Width':'Height',scroll='scroll'+c;if(!$(a).is('html,body'))return a[scroll]-$(a)[c.toLowerCase()]();var d='client'+c,html=a.ownerDocument.documentElement,body=a.ownerDocument.body;return Math.max(html[scroll],body[scroll])-Math.min(html[d],body[d])};function both(a){return typeof a=='object'?a:{top:a,left:a}}})(jQuery);