使用新的datetimepicker控件

This commit is contained in:
Argo-Lenovo 2016-11-29 12:59:37 +08:00
parent bb47d57f87
commit 35ece506f0
15 changed files with 2391 additions and 11879 deletions

View File

@ -103,11 +103,15 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Content Include="App_Data\ErrorLog\Readme.txt" /> <Content Include="App_Data\ErrorLog\Readme.txt" />
<Content Include="Content\css\bootstrap-datetimepicker.css" />
<Content Include="Content\css\bootstrap-datetimepicker.min.css" />
<Content Include="Content\js\bootstrap-datetimepicker.js" />
<Content Include="Content\js\bootstrap-datetimepicker.min.js" />
<Content Include="Content\js\bootstrap-datetimepicker.zh-CN.js" />
<Content Include="favicon.ico" /> <Content Include="favicon.ico" />
<Content Include="Content\css\admin-responsive.css" /> <Content Include="Content\css\admin-responsive.css" />
<Content Include="Content\css\admin.css" /> <Content Include="Content\css\admin.css" />
<Content Include="Content\css\blue.css" /> <Content Include="Content\css\blue.css" />
<Content Include="Content\css\bootstrap-datetimepicker.css" />
<Content Include="Content\css\fa.css" /> <Content Include="Content\css\fa.css" />
<Content Include="Content\css\fileinput.css" /> <Content Include="Content\css\fileinput.css" />
<Content Include="Content\css\fileinput.min.css" /> <Content Include="Content\css\fileinput.min.css" />
@ -141,7 +145,6 @@
<Content Include="Content\images\uploader\Admin.jpg" /> <Content Include="Content\images\uploader\Admin.jpg" />
<Content Include="Content\images\uploader\default.jpg" /> <Content Include="Content\images\uploader\default.jpg" />
<Content Include="Content\images\uploader\readme.txt" /> <Content Include="Content\images\uploader\readme.txt" />
<Content Include="Content\js\bootstrap-datetimepicker.js" />
<Content Include="Content\js\bootstrap3-typeahead.js" /> <Content Include="Content\js\bootstrap3-typeahead.js" />
<Content Include="Content\js\bootstrap3-typeahead.min.js" /> <Content Include="Content\js\bootstrap3-typeahead.min.js" />
<Content Include="Content\js\fileinput.js" /> <Content Include="Content\js\fileinput.js" />
@ -168,7 +171,6 @@
<Content Include="Content\js\jquery.scrollTo.min.js" /> <Content Include="Content\js\jquery.scrollTo.min.js" />
<Content Include="Content\js\log.js" /> <Content Include="Content\js\log.js" />
<Content Include="Content\js\longbow.dataentity.js" /> <Content Include="Content\js\longbow.dataentity.js" />
<Content Include="Content\js\moment-with-locales.js" />
<Content Include="Content\js\fileinput.zh.js" /> <Content Include="Content\js\fileinput.zh.js" />
<Content Include="Content\js\tipso.js" /> <Content Include="Content\js\tipso.js" />
<Content Include="Content\js\tipso.min.js" /> <Content Include="Content\js\tipso.min.js" />

View File

@ -1,341 +1,418 @@
/*! /*!
* Datetimepicker for Bootstrap 3 * Datetimepicker for Bootstrap
//! version : 4.0.0-beta *
* https://github.com/Eonasdan/bootstrap-datetimepicker/ * Copyright 2012 Stefan Petre
* Improvements by Andrew Rowls
* Licensed under the Apache License v2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
*/ */
.bootstrap-datetimepicker-widget.dropdown-menu { .datetimepicker {
margin: 2px 0;
padding: 4px; padding: 4px;
width: 19em; margin-top: 1px;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
direction: ltr;
} }
@media (min-width: 768px) {
.bootstrap-datetimepicker-widget.dropdown-menu.timepicker-sbs { .datetimepicker-inline {
width: 38em; width: 220px;
}
} }
@media (min-width: 992px) {
.bootstrap-datetimepicker-widget.dropdown-menu.timepicker-sbs { .datetimepicker.datetimepicker-rtl {
width: 38em; direction: rtl;
}
} }
@media (min-width: 1200px) {
.bootstrap-datetimepicker-widget.dropdown-menu.timepicker-sbs { .datetimepicker.datetimepicker-rtl table tr td span {
width: 38em; float: right;
}
} }
.bootstrap-datetimepicker-widget.dropdown-menu:before,
.bootstrap-datetimepicker-widget.dropdown-menu:after { .datetimepicker-dropdown, .datetimepicker-dropdown-left {
top: 0;
left: 0;
}
[class*=" datetimepicker-dropdown"]:before {
content: ''; content: '';
display: inline-block; display: inline-block;
border-left: 7px solid transparent;
border-right: 7px solid transparent;
border-bottom: 7px solid #cccccc;
border-bottom-color: rgba(0, 0, 0, 0.2);
position: absolute; position: absolute;
} }
.bootstrap-datetimepicker-widget.dropdown-menu.bottom:before {
border-left: 7px solid transparent; [class*=" datetimepicker-dropdown"]:after {
border-right: 7px solid transparent; content: '';
border-bottom: 7px solid #ccc; display: inline-block;
border-bottom-color: rgba(0, 0, 0, 0.2);
top: -7px;
left: 7px;
}
.bootstrap-datetimepicker-widget.dropdown-menu.bottom:after {
border-left: 6px solid transparent; border-left: 6px solid transparent;
border-right: 6px solid transparent; border-right: 6px solid transparent;
border-bottom: 6px solid white; border-bottom: 6px solid #ffffff;
top: -6px; position: absolute;
left: 8px;
} }
.bootstrap-datetimepicker-widget.dropdown-menu.top:before {
[class*=" datetimepicker-dropdown-top"]:before {
content: '';
display: inline-block;
border-left: 7px solid transparent; border-left: 7px solid transparent;
border-right: 7px solid transparent; border-right: 7px solid transparent;
border-top: 7px solid #ccc; border-top: 7px solid #cccccc;
border-top-color: rgba(0, 0, 0, 0.2); border-top-color: rgba(0, 0, 0, 0.2);
border-bottom: 0;
}
[class*=" datetimepicker-dropdown-top"]:after {
content: '';
display: inline-block;
border-left: 6px solid transparent;
border-right: 6px solid transparent;
border-top: 6px solid #ffffff;
border-bottom: 0;
}
.datetimepicker-dropdown-bottom-left:before {
top: -7px;
right: 6px;
}
.datetimepicker-dropdown-bottom-left:after {
top: -6px;
right: 7px;
}
.datetimepicker-dropdown-bottom-right:before {
top: -7px;
left: 6px;
}
.datetimepicker-dropdown-bottom-right:after {
top: -6px;
left: 7px;
}
.datetimepicker-dropdown-top-left:before {
bottom: -7px;
right: 6px;
}
.datetimepicker-dropdown-top-left:after {
bottom: -6px;
right: 7px;
}
.datetimepicker-dropdown-top-right:before {
bottom: -7px; bottom: -7px;
left: 6px; left: 6px;
} }
.bootstrap-datetimepicker-widget.dropdown-menu.top:after {
border-left: 6px solid transparent; .datetimepicker-dropdown-top-right:after {
border-right: 6px solid transparent;
border-top: 6px solid white;
bottom: -6px; bottom: -6px;
left: 7px; left: 7px;
} }
.bootstrap-datetimepicker-widget.dropdown-menu.pull-right:before {
left: auto; .datetimepicker > div {
right: 6px; display: none;
} }
.bootstrap-datetimepicker-widget.dropdown-menu.pull-right:after {
left: auto; .datetimepicker.minutes div.datetimepicker-minutes {
right: 7px; display: block;
} }
.bootstrap-datetimepicker-widget .list-unstyled {
.datetimepicker.hours div.datetimepicker-hours {
display: block;
}
.datetimepicker.days div.datetimepicker-days {
display: block;
}
.datetimepicker.months div.datetimepicker-months {
display: block;
}
.datetimepicker.years div.datetimepicker-years {
display: block;
}
.datetimepicker table {
margin: 0; margin: 0;
} }
.bootstrap-datetimepicker-widget a[data-action] {
padding: 6px 0; .datetimepicker td,
} .datetimepicker th {
.bootstrap-datetimepicker-widget a[data-action]:active {
box-shadow: none;
}
.bootstrap-datetimepicker-widget .timepicker-hour,
.bootstrap-datetimepicker-widget .timepicker-minute,
.bootstrap-datetimepicker-widget .timepicker-second {
width: 54px;
font-weight: bold;
font-size: 1.2em;
margin: 0;
}
.bootstrap-datetimepicker-widget button[data-action] {
padding: 6px;
}
.bootstrap-datetimepicker-widget .btn[data-action="incrementHours"]::after {
position: absolute;
width: 1px;
height: 1px;
margin: -1px;
padding: 0;
overflow: hidden;
clip: rect(0, 0, 0, 0);
border: 0;
content: "Increment Hours";
}
.bootstrap-datetimepicker-widget .btn[data-action="incrementMinutes"]::after {
position: absolute;
width: 1px;
height: 1px;
margin: -1px;
padding: 0;
overflow: hidden;
clip: rect(0, 0, 0, 0);
border: 0;
content: "Increment Minutes";
}
.bootstrap-datetimepicker-widget .btn[data-action="decrementHours"]::after {
position: absolute;
width: 1px;
height: 1px;
margin: -1px;
padding: 0;
overflow: hidden;
clip: rect(0, 0, 0, 0);
border: 0;
content: "Decrement Hours";
}
.bootstrap-datetimepicker-widget .btn[data-action="decrementMinutes"]::after {
position: absolute;
width: 1px;
height: 1px;
margin: -1px;
padding: 0;
overflow: hidden;
clip: rect(0, 0, 0, 0);
border: 0;
content: "Decrement Minutes";
}
.bootstrap-datetimepicker-widget .btn[data-action="showHours"]::after {
position: absolute;
width: 1px;
height: 1px;
margin: -1px;
padding: 0;
overflow: hidden;
clip: rect(0, 0, 0, 0);
border: 0;
content: "Show Hours";
}
.bootstrap-datetimepicker-widget .btn[data-action="showMinutes"]::after {
position: absolute;
width: 1px;
height: 1px;
margin: -1px;
padding: 0;
overflow: hidden;
clip: rect(0, 0, 0, 0);
border: 0;
content: "Show Minutes";
}
.bootstrap-datetimepicker-widget .btn[data-action="togglePeriod"]::after {
position: absolute;
width: 1px;
height: 1px;
margin: -1px;
padding: 0;
overflow: hidden;
clip: rect(0, 0, 0, 0);
border: 0;
content: "Toggle AM/PM";
}
.bootstrap-datetimepicker-widget .picker-switch {
text-align: center; text-align: center;
width: 20px;
height: 20px;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
border: none;
} }
.bootstrap-datetimepicker-widget .picker-switch::after {
position: absolute; .table-striped .datetimepicker table tr td,
width: 1px; .table-striped .datetimepicker table tr th {
height: 1px; background-color: transparent;
margin: -1px;
padding: 0;
overflow: hidden;
clip: rect(0, 0, 0, 0);
border: 0;
content: "Toggle Date and Time Screens";
} }
.bootstrap-datetimepicker-widget .picker-switch td {
padding: 0; .datetimepicker table tr td.minute:hover {
margin: 0; background: #eeeeee;
height: auto; cursor: pointer;
width: auto;
line-height: inherit;
} }
.bootstrap-datetimepicker-widget .picker-switch td span {
line-height: 2.5; .datetimepicker table tr td.hour:hover {
height: 2.5em; background: #eeeeee;
width: 100%; cursor: pointer;
} }
.bootstrap-datetimepicker-widget table {
width: 100%; .datetimepicker table tr td.day:hover {
margin: 0; background: #eeeeee;
cursor: pointer;
} }
.bootstrap-datetimepicker-widget td,
.bootstrap-datetimepicker-widget th { .datetimepicker table tr td.old,
text-align: center; .datetimepicker table tr td.new {
color: #999999;
}
.datetimepicker table tr td.disabled,
.datetimepicker table tr td.disabled:hover {
background: none;
color: #999999;
cursor: default;
}
.datetimepicker table tr td.today,
.datetimepicker table tr td.today:hover,
.datetimepicker table tr td.today.disabled,
.datetimepicker table tr td.today.disabled:hover {
background-color: #fde19a;
background-image: -moz-linear-gradient(top, #fdd49a, #fdf59a);
background-image: -ms-linear-gradient(top, #fdd49a, #fdf59a);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#fdd49a), to(#fdf59a));
background-image: -webkit-linear-gradient(top, #fdd49a, #fdf59a);
background-image: -o-linear-gradient(top, #fdd49a, #fdf59a);
background-image: linear-gradient(top, #fdd49a, #fdf59a);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fdd49a', endColorstr='#fdf59a', GradientType=0);
border-color: #fdf59a #fdf59a #fbed50;
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
}
.datetimepicker table tr td.today:hover,
.datetimepicker table tr td.today:hover:hover,
.datetimepicker table tr td.today.disabled:hover,
.datetimepicker table tr td.today.disabled:hover:hover,
.datetimepicker table tr td.today:active,
.datetimepicker table tr td.today:hover:active,
.datetimepicker table tr td.today.disabled:active,
.datetimepicker table tr td.today.disabled:hover:active,
.datetimepicker table tr td.today.active,
.datetimepicker table tr td.today:hover.active,
.datetimepicker table tr td.today.disabled.active,
.datetimepicker table tr td.today.disabled:hover.active,
.datetimepicker table tr td.today.disabled,
.datetimepicker table tr td.today:hover.disabled,
.datetimepicker table tr td.today.disabled.disabled,
.datetimepicker table tr td.today.disabled:hover.disabled,
.datetimepicker table tr td.today[disabled],
.datetimepicker table tr td.today:hover[disabled],
.datetimepicker table tr td.today.disabled[disabled],
.datetimepicker table tr td.today.disabled:hover[disabled] {
background-color: #fdf59a;
}
.datetimepicker table tr td.today:active,
.datetimepicker table tr td.today:hover:active,
.datetimepicker table tr td.today.disabled:active,
.datetimepicker table tr td.today.disabled:hover:active,
.datetimepicker table tr td.today.active,
.datetimepicker table tr td.today:hover.active,
.datetimepicker table tr td.today.disabled.active,
.datetimepicker table tr td.today.disabled:hover.active {
background-color: #fbf069;
}
.datetimepicker table tr td.active,
.datetimepicker table tr td.active:hover,
.datetimepicker table tr td.active.disabled,
.datetimepicker table tr td.active.disabled:hover {
background-color: #006dcc;
background-image: -moz-linear-gradient(top, #0088cc, #0044cc);
background-image: -ms-linear-gradient(top, #0088cc, #0044cc);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc));
background-image: -webkit-linear-gradient(top, #0088cc, #0044cc);
background-image: -o-linear-gradient(top, #0088cc, #0044cc);
background-image: linear-gradient(top, #0088cc, #0044cc);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0088cc', endColorstr='#0044cc', GradientType=0);
border-color: #0044cc #0044cc #002a80;
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
color: #ffffff;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
}
.datetimepicker table tr td.active:hover,
.datetimepicker table tr td.active:hover:hover,
.datetimepicker table tr td.active.disabled:hover,
.datetimepicker table tr td.active.disabled:hover:hover,
.datetimepicker table tr td.active:active,
.datetimepicker table tr td.active:hover:active,
.datetimepicker table tr td.active.disabled:active,
.datetimepicker table tr td.active.disabled:hover:active,
.datetimepicker table tr td.active.active,
.datetimepicker table tr td.active:hover.active,
.datetimepicker table tr td.active.disabled.active,
.datetimepicker table tr td.active.disabled:hover.active,
.datetimepicker table tr td.active.disabled,
.datetimepicker table tr td.active:hover.disabled,
.datetimepicker table tr td.active.disabled.disabled,
.datetimepicker table tr td.active.disabled:hover.disabled,
.datetimepicker table tr td.active[disabled],
.datetimepicker table tr td.active:hover[disabled],
.datetimepicker table tr td.active.disabled[disabled],
.datetimepicker table tr td.active.disabled:hover[disabled] {
background-color: #0044cc;
}
.datetimepicker table tr td.active:active,
.datetimepicker table tr td.active:hover:active,
.datetimepicker table tr td.active.disabled:active,
.datetimepicker table tr td.active.disabled:hover:active,
.datetimepicker table tr td.active.active,
.datetimepicker table tr td.active:hover.active,
.datetimepicker table tr td.active.disabled.active,
.datetimepicker table tr td.active.disabled:hover.active {
background-color: #003399;
}
.datetimepicker table tr td span {
display: block;
width: 23%;
height: 54px;
line-height: 54px;
float: left;
margin: 1%;
cursor: pointer;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px; border-radius: 4px;
} }
.bootstrap-datetimepicker-widget th {
height: 20px; .datetimepicker .datetimepicker-hours span {
line-height: 20px; height: 26px;
width: 20px; line-height: 26px;
} }
.bootstrap-datetimepicker-widget th.picker-switch {
.datetimepicker .datetimepicker-hours table tr td span.hour_am,
.datetimepicker .datetimepicker-hours table tr td span.hour_pm {
width: 14.6%;
}
.datetimepicker .datetimepicker-hours fieldset legend,
.datetimepicker .datetimepicker-minutes fieldset legend {
margin-bottom: inherit;
line-height: 30px;
}
.datetimepicker .datetimepicker-minutes span {
height: 26px;
line-height: 26px;
}
.datetimepicker table tr td span:hover {
background: #eeeeee;
}
.datetimepicker table tr td span.disabled,
.datetimepicker table tr td span.disabled:hover {
background: none;
color: #999999;
cursor: default;
}
.datetimepicker table tr td span.active,
.datetimepicker table tr td span.active:hover,
.datetimepicker table tr td span.active.disabled,
.datetimepicker table tr td span.active.disabled:hover {
background-color: #006dcc;
background-image: -moz-linear-gradient(top, #0088cc, #0044cc);
background-image: -ms-linear-gradient(top, #0088cc, #0044cc);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc));
background-image: -webkit-linear-gradient(top, #0088cc, #0044cc);
background-image: -o-linear-gradient(top, #0088cc, #0044cc);
background-image: linear-gradient(top, #0088cc, #0044cc);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0088cc', endColorstr='#0044cc', GradientType=0);
border-color: #0044cc #0044cc #002a80;
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
color: #ffffff;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
}
.datetimepicker table tr td span.active:hover,
.datetimepicker table tr td span.active:hover:hover,
.datetimepicker table tr td span.active.disabled:hover,
.datetimepicker table tr td span.active.disabled:hover:hover,
.datetimepicker table tr td span.active:active,
.datetimepicker table tr td span.active:hover:active,
.datetimepicker table tr td span.active.disabled:active,
.datetimepicker table tr td span.active.disabled:hover:active,
.datetimepicker table tr td span.active.active,
.datetimepicker table tr td span.active:hover.active,
.datetimepicker table tr td span.active.disabled.active,
.datetimepicker table tr td span.active.disabled:hover.active,
.datetimepicker table tr td span.active.disabled,
.datetimepicker table tr td span.active:hover.disabled,
.datetimepicker table tr td span.active.disabled.disabled,
.datetimepicker table tr td span.active.disabled:hover.disabled,
.datetimepicker table tr td span.active[disabled],
.datetimepicker table tr td span.active:hover[disabled],
.datetimepicker table tr td span.active.disabled[disabled],
.datetimepicker table tr td span.active.disabled:hover[disabled] {
background-color: #0044cc;
}
.datetimepicker table tr td span.active:active,
.datetimepicker table tr td span.active:hover:active,
.datetimepicker table tr td span.active.disabled:active,
.datetimepicker table tr td span.active.disabled:hover:active,
.datetimepicker table tr td span.active.active,
.datetimepicker table tr td span.active:hover.active,
.datetimepicker table tr td span.active.disabled.active,
.datetimepicker table tr td span.active.disabled:hover.active {
background-color: #003399;
}
.datetimepicker table tr td span.old {
color: #999999;
}
.datetimepicker th.switch {
width: 145px; width: 145px;
} }
.bootstrap-datetimepicker-widget th.disabled,
.bootstrap-datetimepicker-widget th.disabled:hover { .datetimepicker th span.glyphicon {
background: none; pointer-events: none;
color: #777777;
cursor: not-allowed;
} }
.bootstrap-datetimepicker-widget th.prev::after {
position: absolute; .datetimepicker thead tr:first-child th,
width: 1px; .datetimepicker tfoot th {
height: 1px;
margin: -1px;
padding: 0;
overflow: hidden;
clip: rect(0, 0, 0, 0);
border: 0;
content: "Previous Month";
}
.bootstrap-datetimepicker-widget th.next::after {
position: absolute;
width: 1px;
height: 1px;
margin: -1px;
padding: 0;
overflow: hidden;
clip: rect(0, 0, 0, 0);
border: 0;
content: "Next Month";
}
.bootstrap-datetimepicker-widget thead tr:first-child th {
cursor: pointer; cursor: pointer;
} }
.bootstrap-datetimepicker-widget thead tr:first-child th:hover {
.datetimepicker thead tr:first-child th:hover,
.datetimepicker tfoot th:hover {
background: #eeeeee; background: #eeeeee;
} }
.bootstrap-datetimepicker-widget td {
height: 54px; .input-append.date .add-on i,
line-height: 54px; .input-prepend.date .add-on i,
width: 54px; .input-group.date .input-group-addon span {
}
.bootstrap-datetimepicker-widget td.cw {
font-size: .8em;
height: 20px;
line-height: 20px;
color: #777777;
}
.bootstrap-datetimepicker-widget td.day {
height: 20px;
line-height: 20px;
width: 20px;
}
.bootstrap-datetimepicker-widget td.day:hover,
.bootstrap-datetimepicker-widget td.hour:hover,
.bootstrap-datetimepicker-widget td.minute:hover,
.bootstrap-datetimepicker-widget td.second:hover {
background: #eeeeee;
cursor: pointer; cursor: pointer;
} width: 14px;
.bootstrap-datetimepicker-widget td.old, height: 14px;
.bootstrap-datetimepicker-widget td.new {
color: #777777;
}
.bootstrap-datetimepicker-widget td.today {
position: relative;
}
.bootstrap-datetimepicker-widget td.today:before {
content: '';
display: inline-block;
border-left: 7px solid transparent;
border-bottom: 7px solid #428bca;
border-top-color: rgba(0, 0, 0, 0.2);
position: absolute;
bottom: 4px;
right: 4px;
}
.bootstrap-datetimepicker-widget td.active,
.bootstrap-datetimepicker-widget td.active:hover {
background-color: #428bca;
color: #ffffff;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
}
.bootstrap-datetimepicker-widget td.active.today:before {
border-bottom-color: #fff;
}
.bootstrap-datetimepicker-widget td.disabled,
.bootstrap-datetimepicker-widget td.disabled:hover {
background: none;
color: #777777;
cursor: not-allowed;
}
.bootstrap-datetimepicker-widget td span {
display: inline-block;
width: 54px;
height: 54px;
line-height: 54px;
margin: 2px 1.5px;
cursor: pointer;
border-radius: 4px;
}
.bootstrap-datetimepicker-widget td span:hover {
background: #eeeeee;
}
.bootstrap-datetimepicker-widget td span.active {
background-color: #428bca;
color: #ffffff;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
}
.bootstrap-datetimepicker-widget td span.old {
color: #777777;
}
.bootstrap-datetimepicker-widget td span.disabled,
.bootstrap-datetimepicker-widget td span.disabled:hover {
background: none;
color: #777777;
cursor: not-allowed;
}
.bootstrap-datetimepicker-widget.usetwentyfour td.hour {
height: 27px;
line-height: 27px;
}
.input-group.date .input-group-addon {
cursor: pointer;
}
.sr-only {
position: absolute;
width: 1px;
height: 1px;
margin: -1px;
padding: 0;
overflow: hidden;
clip: rect(0, 0, 0, 0);
border: 0;
} }

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 one or more lines are too long

View File

@ -0,0 +1,16 @@
/**
* Simplified Chinese translation for bootstrap-datetimepicker
* Yuan Cheung <advanimal@gmail.com>
*/
;(function($){
$.fn.datetimepicker.dates['zh-CN'] = {
days: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六", "星期日"],
daysShort: ["周日", "周一", "周二", "周三", "周四", "周五", "周六", "周日"],
daysMin: ["日", "一", "二", "三", "四", "五", "六", "日"],
months: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
monthsShort: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
today: "今天",
suffix: [],
meridiem: ["上午", "下午"]
};
}(jQuery));

View File

@ -4,11 +4,7 @@
options = options || {}; options = options || {};
options.click = $.extend({}, BootstrapAdmin.settings.click, options.click); options.click = $.extend({}, BootstrapAdmin.settings.click, options.click);
this.options = $.extend({}, BootstrapAdmin.settings, options); this.options = $.extend({}, BootstrapAdmin.settings, options);
this.dataEntity = options.dataEntity; this.dataEntity = options.dataEntity;
if (!(this.dataEntity instanceof DataEntity) && window.console) {
window.console.log('初始化参数中没有DataEntity实例');
}
// handler click event // handler click event
for (name in this.options.click) { for (name in this.options.click) {

File diff suppressed because it is too large Load Diff

View File

@ -29,7 +29,7 @@ namespace Bootstrap.Admin.Models
} }
if (EndTime > DateTime.MinValue) if (EndTime > DateTime.MinValue)
{ {
data = data.Where(t => t.LogTime < EndTime); data = data.Where(t => t.LogTime < EndTime.AddDays(1));
} }
var ret = new QueryData<Exceptions>(); var ret = new QueryData<Exceptions>();
ret.total = data.Count(); ret.total = data.Count();

View File

@ -15,11 +15,11 @@ namespace Bootstrap.Admin.Models
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
public string OperateTimeStart { get; set; } public DateTime OperateTimeStart { get; set; }
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
public string OperateTimeEnd { get; set; } public DateTime OperateTimeEnd { get; set; }
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
@ -32,44 +32,40 @@ namespace Bootstrap.Admin.Models
data = data.Where(t => t.CRUD.ToString().Contains(OperateType)); data = data.Where(t => t.CRUD.ToString().Contains(OperateType));
} }
if (!string.IsNullOrEmpty(OperateTimeStart)) if (OperateTimeStart > DateTime.MinValue)
{ {
DateTime opTimeStart = StringToDateTime(OperateTimeStart); data = data.Where(t => t.LogTime > OperateTimeStart);
if (opTimeStart != null)
data = data.Where(t => IsSmallThen(opTimeStart, t.LogTime));
} }
if (!string.IsNullOrEmpty(OperateTimeEnd)) if (OperateTimeEnd > DateTime.MinValue)
{ {
DateTime opTimeEnd = StringToDateTime(OperateTimeEnd); data = data.Where(t => t.LogTime < OperateTimeEnd.AddDays(1));
if (opTimeEnd != null)
data = data.Where(t => IsSmallThen(t.LogTime, opTimeEnd));
} }
var ret = new QueryData<Log>(); var ret = new QueryData<Log>();
ret.total = data.Count(); ret.total = data.Count();
switch (Sort)
{
case "CRUD":
data = Order == "asc" ? data.OrderBy(t => t.CRUD) : data.OrderByDescending(t => t.CRUD);
break;
case "UserName":
data = Order == "asc" ? data.OrderBy(t => t.UserName) : data.OrderByDescending(t => t.UserName);
break;
case "LogTime":
data = Order == "asc" ? data.OrderBy(t => t.LogTime) : data.OrderByDescending(t => t.LogTime);
break;
case "ClientIp":
data = Order == "asc" ? data.OrderBy(t => t.ClientIp) : data.OrderByDescending(t => t.ClientIp);
break;
case "RequestUrl":
data = Order == "asc" ? data.OrderBy(t => t.RequestUrl) : data.OrderByDescending(t => t.RequestUrl);
break;
default:
break;
}
data = Order == "asc" ? data.OrderBy(t => t.CRUD) : data.OrderByDescending(t => t.CRUD); data = Order == "asc" ? data.OrderBy(t => t.CRUD) : data.OrderByDescending(t => t.CRUD);
ret.rows = data.Skip(Offset).Take(Limit); ret.rows = data.Skip(Offset).Take(Limit);
return ret; return ret;
} }
private static DateTime StringToDateTime(string dt_str)
{
DateTime dt;
DateTimeFormatInfo dtFormat = new DateTimeFormatInfo();
dtFormat.ShortDatePattern = "yyyy-MM-dd HH:mm:ss";
dt = Convert.ToDateTime(dt_str, dtFormat);
return dt;
}
/// <summary>
/// 比较两个DateTime
/// (去掉了毫秒)
/// </summary>
/// <param name="d1"></param>
/// <param name="d2"></param>
/// <returns></returns>
private static bool IsSmallThen(DateTime d1, DateTime d2)
{
return new DateTime(d1.Year, d1.Month, d1.Day, d1.Hour, d1.Minute, d1.Second) <=
new DateTime(d2.Year, d2.Month, d2.Day, d2.Hour, d2.Minute, d2.Second);
}
} }
} }

View File

@ -9,7 +9,6 @@
var bsa = new BootstrapAdmin({ var bsa = new BootstrapAdmin({
url: url, url: url,
bootstrapTable: null,
validateForm: null validateForm: null
}); });
@ -17,7 +16,7 @@
url: url, url: url,
sortName: 'LogTime', sortName: 'LogTime',
queryParams: function (params) { return $.extend(params, { StartTime: $("#txt_operate_start").val(), EndTime: $("#txt_operate_end").val() }); }, queryParams: function (params) { return $.extend(params, { StartTime: $("#txt_operate_start").val(), EndTime: $("#txt_operate_end").val() }); },
columns: [{ checkbox: true }, columns: [
{ title: "请求网址", field: "ErrorPage", sortable: true }, { title: "请求网址", field: "ErrorPage", sortable: true },
{ title: "用户名", field: "UserID", sortable: true }, { title: "用户名", field: "UserID", sortable: true },
{ title: "IP", field: "UserIp", sortable: true }, { title: "IP", field: "UserIp", sortable: true },
@ -26,9 +25,17 @@
] ]
}); });
$('input[type="datetime"]').parent().datetimepicker({ $('.form_date').datetimepicker({
locale: "zh-cn", language: 'zh-CN',
format: "YYYY-MM-DD" weekStart: 1,
todayBtn: 1,
autoclose: 1,
todayHighlight: 1,
startView: 2,
minView: 2,
forceParse: 0,
format: 'yyyy-mm-dd',
pickerPosition: 'bottom-left'
}); });
$('#btn_view').on('click', function (row) { $('#btn_view').on('click', function (row) {

View File

@ -1,20 +1,34 @@
$(function () { $(function () {
var url = '../api/Logs/';
var bsa = new BootstrapAdmin({
url: url,
validateForm: null
});
$('table').smartTable({ $('table').smartTable({
url: '../api/Logs', url: url,
sortName: 'OperationType', sortName: 'LogTime',
queryParams: function (params) { return $.extend(params, { operateType: $("#txt_operate_type").val(), OperateTimeStart: $("#txt_operate_start").val(), OperateTimeEnd: $("#txt_operate_end").val() }); }, queryParams: function (params) { return $.extend(params, { operateType: $("#txt_operate_type").val(), OperateTimeStart: $("#txt_operate_start").val(), OperateTimeEnd: $("#txt_operate_end").val() }); },
columns: [{ checkbox: true }, columns: [
{ title: "操作类型", field: "CRUD", sortable: true }, { title: "操作类型", field: "CRUD", sortable: true },
{ title: "用户名称", field: "UserName", sortable: false }, { title: "用户名称", field: "UserName", sortable: true },
{ title: "操作时间", field: "LogTime", sortable: false }, { title: "操作时间", field: "LogTime", sortable: true },
{ title: "操作IP", field: "ClientIp", sortable: false }, { title: "操作IP", field: "ClientIp", sortable: true },
{ title: "Url", field: "RequestUrl", sortable: false }, { title: "Url", field: "RequestUrl", sortable: true },
{ title: "备注", field: "ClientAgent", sortable: false } { title: "备注", field: "ClientAgent", sortable: false }
] ]
}); });
$('input[type="datetime"]').parent().datetimepicker({ $('.form_date').datetimepicker({
locale: "zh-cn", language: 'zh-CN',
format: "YYYY-MM-DD" weekStart: 1,
todayBtn: 1,
autoclose: 1,
todayHighlight: 1,
startView: 2,
minView: 2,
forceParse: 0,
format: 'yyyy-mm-dd',
pickerPosition: 'bottom-left'
}); });
}); });

View File

@ -11,9 +11,9 @@
@section Javascript { @section Javascript {
<script src="~/content/js/bootstrap-table.js"></script> <script src="~/content/js/bootstrap-table.js"></script>
<script src="~/content/js/bootstrap-table-zh-CN.js"></script> <script src="~/content/js/bootstrap-table-zh-CN.js"></script>
<script src="~/Content/js/moment-with-locales.js"></script>
<script src="~/Content/js/bootstrap-datetimepicker.js"></script>
<script src="~/content/js/longbow.dataentity.js"></script> <script src="~/content/js/longbow.dataentity.js"></script>
<script src="~/Content/js/bootstrap-datetimepicker.js"></script>
<script src="~/Content/js/bootstrap-datetimepicker.zh-CN.js"></script>
<script src="~/scripts/Exceptions.js"></script> <script src="~/scripts/Exceptions.js"></script>
} }
@section header { @section header {
@ -29,20 +29,18 @@
<div class="row"> <div class="row">
<div class="form-group col-xs-12 col-sm-6 col-md-5 col-lg-5"> <div class="form-group col-xs-12 col-sm-6 col-md-5 col-lg-5">
<label class="control-label" for="txt_operate_start">起始时间</label> <label class="control-label" for="txt_operate_start">起始时间</label>
<div class="input-group date"> <div class="input-group date form_date">
<input type="datetime" class="form-control" id="txt_operate_start" /> <input id="txt_operate_start" class="form-control" size="16" type="text" value="" readonly>
<span class="input-group-btn"> <span class="input-group-addon"><span class="glyphicon glyphicon-remove"></span></span>
<button class="btn btn-default" type="button"><i class="fa fa-calendar" aria-hidden="true"></i></button> <span class="input-group-addon"><span class="glyphicon glyphicon-th"></span></span>
</span>
</div> </div>
</div> </div>
<div class="form-group col-xs-12 col-sm-6 col-md-5 col-lg-5"> <div class="form-group col-xs-12 col-sm-6 col-md-5 col-lg-5">
<label class="control-label" for="txt_operate_end">终止时间</label> <label class="control-label" for="txt_operate_end">终止时间</label>
<div class="input-group input-append date form_datetime"> <div class="input-group date form_date">
<input type="datetime" class="form-control" id="txt_operate_end" /> <input id="txt_operate_end" class="form-control" size="16" type="text" value="" readonly>
<span class="input-group-btn"> <span class="input-group-addon"><span class="glyphicon glyphicon-remove"></span></span>
<button class="btn btn-default" type="button"><i class="fa fa-calendar" aria-hidden="true"></i></button> <span class="input-group-addon"><span class="glyphicon glyphicon-th"></span></span>
</span>
</div> </div>
</div> </div>
<div class="form-group col-xs-12 col-sm-12 col-md-2 col-lg-2"> <div class="form-group col-xs-12 col-sm-12 col-md-2 col-lg-2">

View File

@ -10,8 +10,9 @@
@section Javascript { @section Javascript {
<script src="~/content/js/bootstrap-table.js"></script> <script src="~/content/js/bootstrap-table.js"></script>
<script src="~/content/js/bootstrap-table-zh-CN.js"></script> <script src="~/content/js/bootstrap-table-zh-CN.js"></script>
<script src="~/Content/js/moment-with-locales.js"></script> <script src="~/content/js/longbow.dataentity.js"></script>
<script src="~/Content/js/bootstrap-datetimepicker.js"></script> <script src="~/Content/js/bootstrap-datetimepicker.js"></script>
<script src="~/Content/js/bootstrap-datetimepicker.zh-CN.js"></script>
<script src="~/scripts/Logs.js"></script> <script src="~/scripts/Logs.js"></script>
} }
@section header { @section header {
@ -33,20 +34,18 @@
<div class="row"> <div class="row">
<div class="form-group col-xs-12 col-sm-6 col-md-5 col-lg-5"> <div class="form-group col-xs-12 col-sm-6 col-md-5 col-lg-5">
<label class="control-label" for="txt_operate_start">起始时间</label> <label class="control-label" for="txt_operate_start">起始时间</label>
<div class="input-group date"> <div class="input-group date form_date">
<input type="datetime" class="form-control" id="txt_operate_start" /> <input id="txt_operate_start" class="form-control" size="16" type="text" value="" readonly>
<span class="input-group-btn"> <span class="input-group-addon"><span class="glyphicon glyphicon-remove"></span></span>
<button class="btn btn-default" type="button"><i class="fa fa-calendar" aria-hidden="true"></i></button> <span class="input-group-addon"><span class="glyphicon glyphicon-th"></span></span>
</span>
</div> </div>
</div> </div>
<div class="form-group col-xs-12 col-sm-6 col-md-5 col-lg-5"> <div class="form-group col-xs-12 col-sm-6 col-md-5 col-lg-5">
<label class="control-label" for="txt_operate_end">终止时间</label> <label class="control-label" for="txt_operate_end">终止时间</label>
<div class="input-group input-append date form_datetime"> <div class="input-group date form_date">
<input type="datetime" class="form-control" id="txt_operate_start" /> <input id="txt_operate_end" class="form-control" size="16" type="text" value="" readonly>
<span class="input-group-btn"> <span class="input-group-addon"><span class="glyphicon glyphicon-remove"></span></span>
<button class="btn btn-default" type="button"><i class="fa fa-calendar" aria-hidden="true"></i></button> <span class="input-group-addon"><span class="glyphicon glyphicon-th"></span></span>
</span>
</div> </div>
</div> </div>
<div class="form-group col-xs-12 col-sm-12 col-md-2 col-lg-2"> <div class="form-group col-xs-12 col-sm-12 col-md-2 col-lg-2">