refactor: Client css 精简与同步

This commit is contained in:
Argo Zhang 2019-06-18 17:17:33 +08:00
parent a0f6bd9d60
commit 8a7b587e03
No known key found for this signature in database
GPG Key ID: 152E398953DDF19F
18 changed files with 3569 additions and 4850 deletions

View File

@ -47,7 +47,7 @@
},
{
"provider": "cdnjs",
"library": "bootstrap-table@1.12.1",
"library": "bootstrap-table@1.14.2",
"destination": "wwwroot/lib/bootstrap-table/",
"files": [
"bootstrap-table.min.js",
@ -89,18 +89,6 @@
"fonts/FontAwesome.otf"
]
},
{
"provider": "cdnjs",
"library": "bootstrap-sweetalert@1.0.1",
"destination": "wwwroot/lib/bootstrap-sweetalert/",
"files": [
"sweetalert.min.js",
"sweetalert.css",
"sweetalert.js",
"sweetalert.min.css",
"sweetalert.min.css.map"
]
},
{
"library": "malihu-custom-scrollbar-plugin@3.1.5",
"destination": "wwwroot/lib/scrollbar/",

View File

@ -16,7 +16,8 @@
color: rgba(0, 0, 0, 0.9);
}
.dropdown-item:hover, .nav .dropdown-item:nth-of-type(odd):hover, .dropdown-item:active, .dropdown-item.active {
.dropdown-item:hover, .nav .dropdown-item:nth-of-type(odd):hover, .dropdown-item:active, .dropdown-item.active,
.bootstrap-table .export .dropdown-menu li:hover {
background-color: #77afd5;
}

View File

@ -1,686 +0,0 @@
@keyframes showSweetAlert {
0% {
transform: scale(0.7);
}
45% {
transform: scale(1.05);
}
80% {
transform: scale(0.95);
}
100% {
transform: scale(1);
}
}
@keyframes hideSweetAlert {
0% {
transform: scale(1);
}
100% {
transform: scale(0.5);
}
}
@keyframes slideFromTop {
0% {
top: 0%;
}
100% {
top: 50%;
}
}
@keyframes slideToTop {
0% {
top: 50%;
}
100% {
top: 0%;
}
}
@keyframes slideFromBottom {
0% {
top: 70%;
}
100% {
top: 50%;
}
}
@keyframes slideToBottom {
0% {
top: 50%;
}
100% {
top: 70%;
}
}
.showSweetAlert {
animation: showSweetAlert 0.3s;
}
.showSweetAlert[data-animation=none] {
animation: none;
}
.showSweetAlert[data-animation=slide-from-top] {
animation: slideFromTop 0.3s;
}
.showSweetAlert[data-animation=slide-from-bottom] {
animation: slideFromBottom 0.3s;
}
.hideSweetAlert {
animation: hideSweetAlert 0.3s;
}
.hideSweetAlert[data-animation=none] {
animation: none;
}
.hideSweetAlert[data-animation=slide-from-top] {
animation: slideToTop 0.3s;
}
.hideSweetAlert[data-animation=slide-from-bottom] {
animation: slideToBottom 0.3s;
}
@keyframes animateSuccessTip {
0% {
width: 0;
left: 1px;
top: 19px;
}
54% {
width: 0;
left: 1px;
top: 19px;
}
70% {
width: 50px;
left: -8px;
top: 37px;
}
84% {
width: 17px;
left: 21px;
top: 48px;
}
100% {
width: 25px;
left: 14px;
top: 45px;
}
}
@keyframes animateSuccessLong {
0% {
width: 0;
right: 46px;
top: 54px;
}
65% {
width: 0;
right: 46px;
top: 54px;
}
84% {
width: 55px;
right: 0px;
top: 35px;
}
100% {
width: 47px;
right: 8px;
top: 38px;
}
}
@keyframes rotatePlaceholder {
0% {
transform: rotate(-45deg);
}
5% {
transform: rotate(-45deg);
}
12% {
transform: rotate(-405deg);
}
100% {
transform: rotate(-405deg);
}
}
.animateSuccessTip {
animation: animateSuccessTip 0.75s;
}
.animateSuccessLong {
animation: animateSuccessLong 0.75s;
}
.sa-icon.sa-success.animate::after {
animation: rotatePlaceholder 4.25s ease-in;
}
@keyframes animateErrorIcon {
0% {
transform: rotateX(100deg);
opacity: 0;
}
100% {
transform: rotateX(0deg);
opacity: 1;
}
}
.animateErrorIcon {
animation: animateErrorIcon 0.5s;
}
@keyframes animateXMark {
0% {
transform: scale(0.4);
margin-top: 26px;
opacity: 0;
}
50% {
transform: scale(0.4);
margin-top: 26px;
opacity: 0;
}
80% {
transform: scale(1.15);
margin-top: -6px;
}
100% {
transform: scale(1);
margin-top: 0;
opacity: 1;
}
}
.animateXMark {
animation: animateXMark 0.5s;
}
@keyframes pulseWarning {
0% {
border-color: #F8D486;
}
100% {
border-color: #F8BB86;
}
}
.pulseWarning {
animation: pulseWarning 0.75s infinite alternate;
}
@keyframes pulseWarningIns {
0% {
background-color: #F8D486;
}
100% {
background-color: #F8BB86;
}
}
.pulseWarningIns {
animation: pulseWarningIns 0.75s infinite alternate;
}
@keyframes rotate-loading {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
body.stop-scrolling {
height: 100%;
overflow: hidden;
}
.sweet-overlay {
background-color: rgba(0, 0, 0, 0.4);
position: fixed;
left: 0;
right: 0;
top: 0;
bottom: 0;
display: none;
z-index: 1040;
}
.sweet-alert {
background-color: #ffffff;
width: 478px;
padding: 17px;
border-radius: 5px;
text-align: center;
position: fixed;
left: 50%;
top: 50%;
margin-left: -256px;
margin-top: -200px;
overflow: hidden;
display: none;
z-index: 2000;
}
@media all and (max-width: 767px) {
.sweet-alert {
width: auto;
margin-left: 0;
margin-right: 0;
left: 15px;
right: 15px;
}
}
.sweet-alert .form-group {
display: none;
}
.sweet-alert .form-group .sa-input-error {
display: none;
}
.sweet-alert.show-input .form-group {
display: block;
}
.sweet-alert .sa-confirm-button-container {
display: inline-block;
position: relative;
}
.sweet-alert .la-ball-fall {
position: absolute;
left: 50%;
top: 50%;
margin-left: -27px;
margin-top: -9px;
opacity: 0;
visibility: hidden;
}
.sweet-alert button[disabled] {
opacity: .6;
cursor: default;
}
.sweet-alert button.confirm[disabled] {
color: transparent;
}
.sweet-alert button.confirm[disabled] ~ .la-ball-fall {
opacity: 1;
visibility: visible;
transition-delay: 0s;
}
.sweet-alert .sa-icon {
width: 80px;
height: 80px;
border: 4px solid gray;
border-radius: 50%;
margin: 20px auto;
position: relative;
box-sizing: content-box;
}
.sweet-alert .sa-icon.sa-error {
border-color: #d43f3a;
}
.sweet-alert .sa-icon.sa-error .sa-x-mark {
position: relative;
display: block;
}
.sweet-alert .sa-icon.sa-error .sa-line {
position: absolute;
height: 5px;
width: 47px;
background-color: #d9534f;
display: block;
top: 37px;
border-radius: 2px;
}
.sweet-alert .sa-icon.sa-error .sa-line.sa-left {
transform: rotate(45deg);
left: 17px;
}
.sweet-alert .sa-icon.sa-error .sa-line.sa-right {
transform: rotate(-45deg);
right: 16px;
}
.sweet-alert .sa-icon.sa-warning {
border-color: #eea236;
}
.sweet-alert .sa-icon.sa-warning .sa-body {
position: absolute;
width: 5px;
height: 47px;
left: 50%;
top: 10px;
border-radius: 2px;
margin-left: -2px;
background-color: #f0ad4e;
}
.sweet-alert .sa-icon.sa-warning .sa-dot {
position: absolute;
width: 7px;
height: 7px;
border-radius: 50%;
margin-left: -3px;
left: 50%;
bottom: 10px;
background-color: #f0ad4e;
}
.sweet-alert .sa-icon.sa-info {
border-color: #46b8da;
}
.sweet-alert .sa-icon.sa-info::before {
content: "";
position: absolute;
width: 5px;
height: 29px;
left: 50%;
bottom: 17px;
border-radius: 2px;
margin-left: -2px;
background-color: #5bc0de;
}
.sweet-alert .sa-icon.sa-info::after {
content: "";
position: absolute;
width: 7px;
height: 7px;
border-radius: 50%;
margin-left: -3px;
top: 19px;
background-color: #5bc0de;
}
.sweet-alert .sa-icon.sa-success {
border-color: #4cae4c;
}
.sweet-alert .sa-icon.sa-success::before,
.sweet-alert .sa-icon.sa-success::after {
content: '';
border-radius: 50%;
position: absolute;
width: 60px;
height: 120px;
background: #ffffff;
transform: rotate(45deg);
}
.sweet-alert .sa-icon.sa-success::before {
border-radius: 120px 0 0 120px;
top: -7px;
left: -33px;
transform: rotate(-45deg);
transform-origin: 60px 60px;
}
.sweet-alert .sa-icon.sa-success::after {
border-radius: 0 120px 120px 0;
top: -11px;
left: 30px;
transform: rotate(-45deg);
transform-origin: 0px 60px;
}
.sweet-alert .sa-icon.sa-success .sa-placeholder {
width: 80px;
height: 80px;
border: 4px solid rgba(92, 184, 92, 0.2);
border-radius: 50%;
box-sizing: content-box;
position: absolute;
left: -4px;
top: -4px;
z-index: 2;
}
.sweet-alert .sa-icon.sa-success .sa-fix {
width: 5px;
height: 90px;
background-color: #ffffff;
position: absolute;
left: 28px;
top: 8px;
z-index: 1;
transform: rotate(-45deg);
}
.sweet-alert .sa-icon.sa-success .sa-line {
height: 5px;
background-color: #5cb85c;
display: block;
border-radius: 2px;
position: absolute;
z-index: 2;
}
.sweet-alert .sa-icon.sa-success .sa-line.sa-tip {
width: 25px;
left: 14px;
top: 46px;
transform: rotate(45deg);
}
.sweet-alert .sa-icon.sa-success .sa-line.sa-long {
width: 47px;
right: 8px;
top: 38px;
transform: rotate(-45deg);
}
.sweet-alert .sa-icon.sa-custom {
background-size: contain;
border-radius: 0;
border: none;
background-position: center center;
background-repeat: no-repeat;
}
.sweet-alert .btn-default:focus {
border-color: #cccccc;
outline: 0;
-webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(204, 204, 204, 0.6);
box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(204, 204, 204, 0.6);
}
.sweet-alert .btn-success:focus {
border-color: #4cae4c;
outline: 0;
-webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(76, 174, 76, 0.6);
box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(76, 174, 76, 0.6);
}
.sweet-alert .btn-info:focus {
border-color: #46b8da;
outline: 0;
-webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(70, 184, 218, 0.6);
box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(70, 184, 218, 0.6);
}
.sweet-alert .btn-danger:focus {
border-color: #d43f3a;
outline: 0;
-webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(212, 63, 58, 0.6);
box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(212, 63, 58, 0.6);
}
.sweet-alert .btn-warning:focus {
border-color: #eea236;
outline: 0;
-webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(238, 162, 54, 0.6);
box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(238, 162, 54, 0.6);
}
.sweet-alert button::-moz-focus-inner {
border: 0;
}
/*!
* Load Awesome v1.1.0 (http://github.danielcardoso.net/load-awesome/)
* Copyright 2015 Daniel Cardoso <@DanielCardoso>
* Licensed under MIT
*/
.la-ball-fall,
.la-ball-fall > div {
position: relative;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.la-ball-fall {
display: block;
font-size: 0;
color: #fff;
}
.la-ball-fall.la-dark {
color: #333;
}
.la-ball-fall > div {
display: inline-block;
float: none;
background-color: currentColor;
border: 0 solid currentColor;
}
.la-ball-fall {
width: 54px;
height: 18px;
}
.la-ball-fall > div {
width: 10px;
height: 10px;
margin: 4px;
border-radius: 100%;
opacity: 0;
-webkit-animation: ball-fall 1s ease-in-out infinite;
-moz-animation: ball-fall 1s ease-in-out infinite;
-o-animation: ball-fall 1s ease-in-out infinite;
animation: ball-fall 1s ease-in-out infinite;
}
.la-ball-fall > div:nth-child(1) {
-webkit-animation-delay: -200ms;
-moz-animation-delay: -200ms;
-o-animation-delay: -200ms;
animation-delay: -200ms;
}
.la-ball-fall > div:nth-child(2) {
-webkit-animation-delay: -100ms;
-moz-animation-delay: -100ms;
-o-animation-delay: -100ms;
animation-delay: -100ms;
}
.la-ball-fall > div:nth-child(3) {
-webkit-animation-delay: 0ms;
-moz-animation-delay: 0ms;
-o-animation-delay: 0ms;
animation-delay: 0ms;
}
.la-ball-fall.la-sm {
width: 26px;
height: 8px;
}
.la-ball-fall.la-sm > div {
width: 4px;
height: 4px;
margin: 2px;
}
.la-ball-fall.la-2x {
width: 108px;
height: 36px;
}
.la-ball-fall.la-2x > div {
width: 20px;
height: 20px;
margin: 8px;
}
.la-ball-fall.la-3x {
width: 162px;
height: 54px;
}
.la-ball-fall.la-3x > div {
width: 30px;
height: 30px;
margin: 12px;
}
/*
* Animation
*/
@-webkit-keyframes ball-fall {
0% {
opacity: 0;
-webkit-transform: translateY(-145%);
transform: translateY(-145%);
}
10% {
opacity: .5;
}
20% {
opacity: 1;
-webkit-transform: translateY(0);
transform: translateY(0);
}
80% {
opacity: 1;
-webkit-transform: translateY(0);
transform: translateY(0);
}
90% {
opacity: .5;
}
100% {
opacity: 0;
-webkit-transform: translateY(145%);
transform: translateY(145%);
}
}
@-moz-keyframes ball-fall {
0% {
opacity: 0;
-moz-transform: translateY(-145%);
transform: translateY(-145%);
}
10% {
opacity: .5;
}
20% {
opacity: 1;
-moz-transform: translateY(0);
transform: translateY(0);
}
80% {
opacity: 1;
-moz-transform: translateY(0);
transform: translateY(0);
}
90% {
opacity: .5;
}
100% {
opacity: 0;
-moz-transform: translateY(145%);
transform: translateY(145%);
}
}
@-o-keyframes ball-fall {
0% {
opacity: 0;
-o-transform: translateY(-145%);
transform: translateY(-145%);
}
10% {
opacity: .5;
}
20% {
opacity: 1;
-o-transform: translateY(0);
transform: translateY(0);
}
80% {
opacity: 1;
-o-transform: translateY(0);
transform: translateY(0);
}
90% {
opacity: .5;
}
100% {
opacity: 0;
-o-transform: translateY(145%);
transform: translateY(145%);
}
}
@keyframes ball-fall {
0% {
opacity: 0;
-webkit-transform: translateY(-145%);
-moz-transform: translateY(-145%);
-o-transform: translateY(-145%);
transform: translateY(-145%);
}
10% {
opacity: .5;
}
20% {
opacity: 1;
-webkit-transform: translateY(0);
-moz-transform: translateY(0);
-o-transform: translateY(0);
transform: translateY(0);
}
80% {
opacity: 1;
-webkit-transform: translateY(0);
-moz-transform: translateY(0);
-o-transform: translateY(0);
transform: translateY(0);
}
90% {
opacity: .5;
}
100% {
opacity: 0;
-webkit-transform: translateY(145%);
-moz-transform: translateY(145%);
-o-transform: translateY(145%);
transform: translateY(145%);
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,318 +1,282 @@
@charset "UTF-8";
/**
* @author zhixin wen <wenzhixin2010@gmail.com>
* version: 1.12.1
* version: 1.14.2
* https://github.com/wenzhixin/bootstrap-table/
*/
.bootstrap-table .table {
margin-bottom: 0 !important;
border-bottom: 1px solid #dddddd;
border-collapse: collapse !important;
border-radius: 1px;
.bootstrap-table .fixed-table-toolbar:after {
content: "";
display: block;
clear: both;
}
.bootstrap-table .table:not(.table-condensed),
.bootstrap-table .table:not(.table-condensed) > tbody > tr > th,
.bootstrap-table .table:not(.table-condensed) > tfoot > tr > th,
.bootstrap-table .table:not(.table-condensed) > thead > tr > td,
.bootstrap-table .table:not(.table-condensed) > tbody > tr > td,
.bootstrap-table .table:not(.table-condensed) > tfoot > tr > td {
padding: 8px;
.bootstrap-table .fixed-table-toolbar .bs-bars,
.bootstrap-table .fixed-table-toolbar .search,
.bootstrap-table .fixed-table-toolbar .columns {
position: relative;
margin-top: 10px;
margin-bottom: 10px;
}
.bootstrap-table .table.table-no-bordered > thead > tr > th,
.bootstrap-table .table.table-no-bordered > tbody > tr > td {
border-right: 2px solid transparent;
.bootstrap-table .fixed-table-toolbar .columns .btn-group > .btn-group {
display: inline-block;
margin-left: -1px !important;
}
.bootstrap-table .table.table-no-bordered > tbody > tr > td:last-child {
border-right: none;
.bootstrap-table .fixed-table-toolbar .columns .btn-group > .btn-group:first-child > .btn {
border-top-left-radius: 4px;
border-bottom-left-radius: 4px;
}
.fixed-table-container {
position: relative;
clear: both;
border: 1px solid #dddddd;
border-radius: 4px;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
.bootstrap-table .fixed-table-toolbar .columns .btn-group > .btn-group:last-child > .btn {
border-top-right-radius: 4px;
border-bottom-right-radius: 4px;
}
.fixed-table-container.table-no-bordered {
border: 1px solid transparent;
.bootstrap-table .fixed-table-toolbar .columns .btn-group > .btn-group > .btn {
border-radius: 0;
}
.fixed-table-footer,
.fixed-table-header {
overflow: hidden;
.bootstrap-table .fixed-table-toolbar .columns .dropdown-menu {
text-align: left;
max-height: 300px;
overflow: auto;
}
.fixed-table-footer {
border-top: 1px solid #dddddd;
.bootstrap-table .fixed-table-toolbar .columns label {
display: block;
padding: 3px 20px;
clear: both;
font-weight: normal;
line-height: 1.428571429;
}
.fixed-table-body {
overflow-x: auto;
overflow-y: auto;
height: 100%;
.bootstrap-table .fixed-table-toolbar .columns-left {
margin-right: 5px;
}
.fixed-table-container table {
width: 100%;
.bootstrap-table .fixed-table-toolbar .columns-right {
margin-left: 5px;
}
.fixed-table-container thead th {
height: 0;
padding: 0;
margin: 0;
border-left: 1px solid #dddddd;
.bootstrap-table .fixed-table-toolbar .pull-right .dropdown-menu {
right: 0;
left: auto;
}
.fixed-table-container thead th:focus {
outline: 0 solid transparent;
.bootstrap-table .fixed-table-container {
position: relative;
clear: both;
}
.fixed-table-container thead th:first-child:not([data-not-first-th]) {
border-left: none;
border-top-left-radius: 4px;
-webkit-border-top-left-radius: 4px;
-moz-border-radius-topleft: 4px;
.bootstrap-table .fixed-table-container.fixed-height:not(.has-footer) {
border-bottom: 1px solid #dee2e6;
}
.fixed-table-container thead th .th-inner,
.fixed-table-container tbody td .th-inner {
padding: 8px;
line-height: 24px;
vertical-align: top;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
.bootstrap-table .fixed-table-container.fixed-height .fixed-table-border {
border-left: 1px solid #dee2e6;
border-right: 1px solid #dee2e6;
}
.fixed-table-container thead th .sortable {
cursor: pointer;
background-position: right;
background-repeat: no-repeat;
padding-right: 30px;
.bootstrap-table .fixed-table-container.fixed-height .table thead th {
border-bottom: 1px solid #dee2e6;
}
.fixed-table-container thead th .both {
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAATCAQAAADYWf5HAAAAkElEQVQoz7X QMQ5AQBCF4dWQSJxC5wwax1Cq1e7BAdxD5SL+Tq/QCM1oNiJidwox0355mXnG/DrEtIQ6azioNZQxI0ykPhTQIwhCR+BmBYtlK7kLJYwWCcJA9M4qdrZrd8pPjZWPtOqdRQy320YSV17OatFC4euts6z39GYMKRPCTKY9UnPQ6P+GtMRfGtPnBCiqhAeJPmkqAAAAAElFTkSuQmCC');
.bootstrap-table .fixed-table-container.fixed-height .table-dark thead th {
border-bottom: 1px solid #32383e;
}
.fixed-table-container thead th .asc {
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAATCAYAAAByUDbMAAAAZ0lEQVQ4y2NgGLKgquEuFxBPAGI2ahhWCsS/gDibUoO0gPgxEP8H4ttArEyuQYxAPBdqEAxPBImTY5gjEL9DM+wTENuQahAvEO9DMwiGdwAxOymGJQLxTyD+jgWDxCMZRsEoGAVoAADeemwtPcZI2wAAAABJRU5ErkJggg==');
.bootstrap-table .fixed-table-container .fixed-table-header {
overflow: hidden;
}
.fixed-table-container thead th .desc {
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAATCAYAAAByUDbMAAAAZUlEQVQ4y2NgGAWjYBSggaqGu5FA/BOIv2PBIPFEUgxjB+IdQPwfC94HxLykus4GiD+hGfQOiB3J8SojEE9EM2wuSJzcsFMG4ttQgx4DsRalkZENxL+AuJQaMcsGxBOAmGvopk8AVz1sLZgg0bsAAAAASUVORK5CYII= ');
.bootstrap-table .fixed-table-container .fixed-table-body {
overflow-x: auto;
overflow-y: auto;
height: 100%;
}
.fixed-table-container th.detail {
width: 30px;
.bootstrap-table .fixed-table-container .fixed-table-body .fixed-table-loading {
align-items: center;
background: #fff;
display: none;
justify-content: center;
position: absolute;
bottom: 0;
width: 100%;
z-index: 1000;
}
.fixed-table-container tbody td {
border-left: 1px solid #dddddd;
.bootstrap-table .fixed-table-container .fixed-table-body .fixed-table-loading .loading-wrap {
align-items: baseline;
display: flex;
justify-content: center;
}
.fixed-table-container tbody tr:first-child td {
border-top: none;
.bootstrap-table .fixed-table-container .fixed-table-body .fixed-table-loading .loading-wrap .loading-text {
font-size: 2rem;
margin-right: 6px;
}
.fixed-table-container tbody td:first-child {
border-left: none;
.bootstrap-table .fixed-table-container .fixed-table-body .fixed-table-loading .loading-wrap .animation-wrap {
align-items: center;
display: flex;
justify-content: center;
}
/* the same color with .active */
.fixed-table-container tbody .selected td {
background-color: #f5f5f5;
.bootstrap-table .fixed-table-container .fixed-table-body .fixed-table-loading .loading-wrap .animation-dot,
.bootstrap-table .fixed-table-container .fixed-table-body .fixed-table-loading .loading-wrap .animation-wrap:after,
.bootstrap-table .fixed-table-container .fixed-table-body .fixed-table-loading .loading-wrap .animation-wrap:before {
content: "";
animation-duration: 1.5s;
animation-iteration-count: infinite;
animation-name: LOADING;
background: #212529;
border-radius: 50%;
display: block;
height: 5px;
margin: 0 4px;
opacity: 0;
width: 5px;
}
.fixed-table-container .bs-checkbox {
text-align: center;
.bootstrap-table .fixed-table-container .fixed-table-body .fixed-table-loading .loading-wrap .animation-dot {
animation-delay: 0.3s;
}
.fixed-table-container input[type="radio"],
.fixed-table-container input[type="checkbox"] {
margin: 0 auto !important;
.bootstrap-table .fixed-table-container .fixed-table-body .fixed-table-loading .loading-wrap .animation-wrap:after {
animation-delay: 0.6s;
}
.fixed-table-container .no-records-found {
text-align: center;
.bootstrap-table .fixed-table-container .fixed-table-body .fixed-table-loading.table-dark {
background: #212529;
}
.fixed-table-pagination div.pagination,
.fixed-table-pagination .pagination-detail {
margin-top: 10px;
margin-bottom: 10px;
.bootstrap-table .fixed-table-container .fixed-table-body .fixed-table-loading.table-dark .animation-dot,
.bootstrap-table .fixed-table-container .fixed-table-body .fixed-table-loading.table-dark .animation-wrap:after,
.bootstrap-table .fixed-table-container .fixed-table-body .fixed-table-loading.table-dark .animation-wrap:before {
background: #fff;
}
.fixed-table-pagination div.pagination .pagination {
margin: 0;
.bootstrap-table .fixed-table-container .table {
width: 100%;
margin-bottom: 0 !important;
}
.fixed-table-pagination .pagination a {
padding: 6px 12px;
line-height: 1.428571429;
.bootstrap-table .fixed-table-container .table th,
.bootstrap-table .fixed-table-container .table td {
vertical-align: middle;
box-sizing: border-box;
}
.fixed-table-pagination .pagination-info {
line-height: 34px;
margin-right: 5px;
.bootstrap-table .fixed-table-container .table thead th {
vertical-align: bottom;
padding: 0;
margin: 0;
}
.fixed-table-pagination .btn-group {
position: relative;
display: inline-block;
vertical-align: middle;
.bootstrap-table .fixed-table-container .table thead th:focus {
outline: 0 solid transparent;
}
.fixed-table-pagination .dropup .dropdown-menu {
margin-bottom: 0;
.bootstrap-table .fixed-table-container .table thead th.detail {
width: 30px;
}
.fixed-table-pagination .page-list {
display: inline-block;
.bootstrap-table .fixed-table-container .table thead th .th-inner {
padding: 0.75rem;
vertical-align: bottom;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.fixed-table-toolbar .columns-left {
margin-right: 5px;
.bootstrap-table .fixed-table-container .table thead th .sortable {
cursor: pointer;
background-position: right;
background-repeat: no-repeat;
padding-right: 30px;
}
.fixed-table-toolbar .columns-right {
margin-left: 5px;
.bootstrap-table .fixed-table-container .table thead th .both {
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAATCAQAAADYWf5HAAAAkElEQVQoz7X QMQ5AQBCF4dWQSJxC5wwax1Cq1e7BAdxD5SL+Tq/QCM1oNiJidwox0355mXnG/DrEtIQ6azioNZQxI0ykPhTQIwhCR+BmBYtlK7kLJYwWCcJA9M4qdrZrd8pPjZWPtOqdRQy320YSV17OatFC4euts6z39GYMKRPCTKY9UnPQ6P+GtMRfGtPnBCiqhAeJPmkqAAAAAElFTkSuQmCC");
}
.fixed-table-toolbar .columns label {
display: block;
padding: 3px 20px;
clear: both;
font-weight: normal;
line-height: 1.428571429;
.bootstrap-table .fixed-table-container .table thead th .asc {
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAATCAYAAAByUDbMAAAAZ0lEQVQ4y2NgGLKgquEuFxBPAGI2ahhWCsS/gDibUoO0gPgxEP8H4ttArEyuQYxAPBdqEAxPBImTY5gjEL9DM+wTENuQahAvEO9DMwiGdwAxOymGJQLxTyD+jgWDxCMZRsEoGAVoAADeemwtPcZI2wAAAABJRU5ErkJggg==");
}
.fixed-table-toolbar .bs-bars,
.fixed-table-toolbar .search,
.fixed-table-toolbar .columns {
position: relative;
margin-top: 10px;
margin-bottom: 10px;
line-height: 34px;
.bootstrap-table .fixed-table-container .table thead th .desc {
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAATCAYAAAByUDbMAAAAZUlEQVQ4y2NgGAWjYBSggaqGu5FA/BOIv2PBIPFEUgxjB+IdQPwfC94HxLykus4GiD+hGfQOiB3J8SojEE9EM2wuSJzcsFMG4ttQgx4DsRalkZENxL+AuJQaMcsGxBOAmGvopk8AVz1sLZgg0bsAAAAASUVORK5CYII= ");
}
.fixed-table-pagination li.disabled a {
pointer-events: none;
cursor: default;
.bootstrap-table .fixed-table-container .table tbody tr.selected td {
background-color: rgba(0, 0, 0, 0.075);
}
.fixed-table-loading {
display: none;
position: absolute;
top: 42px;
right: 0;
bottom: 0;
left: 0;
z-index: 99;
background-color: #fff;
text-align: center;
.bootstrap-table .fixed-table-container .table tbody tr.no-records-found {
text-align: center;
}
.fixed-table-body .card-view .title {
font-weight: bold;
display: inline-block;
min-width: 30%;
text-align: left !important;
.bootstrap-table .fixed-table-container .table tbody tr .card-view .card-view-title {
font-weight: bold;
display: inline-block;
min-width: 30%;
text-align: left !important;
}
/* support bootstrap 2 */
.fixed-table-body thead th .th-inner {
box-sizing: border-box;
.bootstrap-table .fixed-table-container .table .bs-checkbox {
text-align: center;
}
.table th, .table td {
vertical-align: middle;
box-sizing: border-box;
.bootstrap-table .fixed-table-container .table input[type=radio],
.bootstrap-table .fixed-table-container .table input[type=checkbox] {
margin: 0 auto !important;
}
.fixed-table-toolbar .dropdown-menu {
text-align: left;
max-height: 300px;
overflow: auto;
.bootstrap-table .fixed-table-container .table.table-sm .th-inner {
padding: 0.3rem;
}
.fixed-table-toolbar .btn-group > .btn-group {
display: inline-block;
margin-left: -1px !important;
.bootstrap-table .fixed-table-container .fixed-table-footer {
overflow: hidden;
}
.fixed-table-toolbar .btn-group > .btn-group > .btn {
border-radius: 0;
.bootstrap-table .fixed-table-pagination:after {
content: "";
display: block;
clear: both;
}
.fixed-table-toolbar .btn-group > .btn-group:first-child > .btn {
border-top-left-radius: 4px;
border-bottom-left-radius: 4px;
.bootstrap-table .fixed-table-pagination > .pagination-detail,
.bootstrap-table .fixed-table-pagination > .pagination {
margin-top: 10px;
margin-bottom: 10px;
}
.fixed-table-toolbar .btn-group > .btn-group:last-child > .btn {
border-top-right-radius: 4px;
border-bottom-right-radius: 4px;
.bootstrap-table .fixed-table-pagination > .pagination-detail .pagination-info {
line-height: 34px;
margin-right: 5px;
}
.bootstrap-table .table > thead > tr > th {
vertical-align: bottom;
border-bottom: 1px solid #ddd;
.bootstrap-table .fixed-table-pagination > .pagination-detail .page-list {
display: inline-block;
}
/* support bootstrap 3 */
.bootstrap-table .table thead > tr > th {
padding: 0;
margin: 0;
.bootstrap-table .fixed-table-pagination > .pagination-detail .page-list .btn-group {
position: relative;
display: inline-block;
vertical-align: middle;
}
.bootstrap-table .fixed-table-footer tbody > tr > td {
padding: 0 !important;
.bootstrap-table .fixed-table-pagination > .pagination-detail .page-list .btn-group .dropdown-menu {
margin-bottom: 0;
}
.bootstrap-table .fixed-table-footer .table {
border-bottom: none;
border-radius: 0;
padding: 0 !important;
.bootstrap-table .fixed-table-pagination > .pagination ul.pagination {
margin: 0;
}
.bootstrap-table .pull-right .dropdown-menu {
right: 0;
left: auto;
.bootstrap-table .fixed-table-pagination > .pagination ul.pagination a {
padding: 6px 12px;
line-height: 1.428571429;
}
.bootstrap-table .fixed-table-pagination > .pagination ul.pagination li.page-intermediate a {
color: #c8c8c8;
}
.bootstrap-table .fixed-table-pagination > .pagination ul.pagination li.page-intermediate a:before {
content: "⬅";
}
.bootstrap-table .fixed-table-pagination > .pagination ul.pagination li.page-intermediate a:after {
content: "➡";
}
.bootstrap-table .fixed-table-pagination > .pagination ul.pagination li.disabled a {
pointer-events: none;
cursor: default;
}
.bootstrap-table.fullscreen {
position: fixed;
top: 0;
left: 0;
z-index: 1050;
width: 100% !important;
background: #FFF;
}
/* calculate scrollbar width */
p.fixed-table-scroll-inner {
width: 100%;
height: 200px;
div.fixed-table-scroll-inner {
width: 100%;
height: 200px;
}
div.fixed-table-scroll-outer {
top: 0;
left: 0;
visibility: hidden;
width: 200px;
height: 150px;
overflow: hidden;
top: 0;
left: 0;
visibility: hidden;
width: 200px;
height: 150px;
overflow: hidden;
}
/* for get correct heights */
.fixed-table-toolbar:after, .fixed-table-pagination:after {
content: "";
display: block;
clear: both;
@keyframes LOADING {
0% {
opacity: 0;
}
50% {
opacity: 1;
}
to {
opacity: 0;
}
}
.fullscreen {
position: fixed;
top: 0;
left: 0;
z-index: 1050;
width: 100%!important;
background: #FFF;
}
/*# sourceMappingURL=bootstrap-table.css.map */

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,46 +1,80 @@
/**
* Bootstrap Table Chinese translation
* Author: Zhixin Wen<wenzhixin2010@gmail.com>
*/
(function ($) {
'use strict';
(function (global, factory) {
if (typeof define === "function" && define.amd) {
define([], factory);
} else if (typeof exports !== "undefined") {
factory();
} else {
var mod = {
exports: {}
};
factory();
global.bootstrapTableZhCN = mod.exports;
}
})(this, function () {
'use strict';
/**
* Bootstrap Table Chinese translation
* Author: Zhixin Wen<wenzhixin2010@gmail.com>
*/
(function ($) {
$.fn.bootstrapTable.locales['zh-CN'] = {
formatLoadingMessage: function () {
return '正在努力地加载数据中,请稍候……';
},
formatRecordsPerPage: function (pageNumber) {
return '每页显示 ' + pageNumber + ' 条记录';
},
formatShowingRows: function (pageFrom, pageTo, totalRows) {
return '显示第 ' + pageFrom + ' 到第 ' + pageTo + ' 条记录,总共 ' + totalRows + ' 条记录';
},
formatSearch: function () {
return '搜索';
},
formatNoMatches: function () {
return '没有找到匹配的记录';
},
formatPaginationSwitch: function () {
return '隐藏/显示分页';
},
formatRefresh: function () {
return '刷新';
},
formatToggle: function () {
return '切换';
},
formatColumns: function () {
return '列';
},
formatExport: function () {
return '导出数据';
},
formatClearFilters: function () {
return '清空过滤';
}
formatLoadingMessage: function formatLoadingMessage() {
return '正在努力地加载数据中,请稍候';
},
formatRecordsPerPage: function formatRecordsPerPage(pageNumber) {
return '\u6BCF\u9875\u663E\u793A ' + pageNumber + ' \u6761\u8BB0\u5F55';
},
formatShowingRows: function formatShowingRows(pageFrom, pageTo, totalRows) {
return '\u663E\u793A\u7B2C ' + pageFrom + ' \u5230\u7B2C ' + pageTo + ' \u6761\u8BB0\u5F55\uFF0C\u603B\u5171 ' + totalRows + ' \u6761\u8BB0\u5F55';
},
formatDetailPagination: function formatDetailPagination(totalRows) {
return '\u603B\u5171 ' + totalRows + ' \u6761\u8BB0\u5F55';
},
formatSearch: function formatSearch() {
return '搜索';
},
formatNoMatches: function formatNoMatches() {
return '没有找到匹配的记录';
},
formatPaginationSwitch: function formatPaginationSwitch() {
return '隐藏/显示分页';
},
formatRefresh: function formatRefresh() {
return '刷新';
},
formatToggle: function formatToggle() {
return '切换';
},
formatColumns: function formatColumns() {
return '列';
},
formatFullscreen: function formatFullscreen() {
return '全屏';
},
formatAllRows: function formatAllRows() {
return '所有';
},
formatAutoRefresh: function formatAutoRefresh() {
return '自动刷新';
},
formatExport: function formatExport() {
return '导出数据';
},
formatClearFilters: function formatClearFilters() {
return '清空过滤';
},
formatJumpto: function formatJumpto() {
return '跳转';
},
formatAdvancedSearch: function formatAdvancedSearch() {
return '高级搜索';
},
formatAdvancedCloseButton: function formatAdvancedCloseButton() {
return '关闭';
}
};
$.extend($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales['zh-CN']);
})(jQuery);
})(jQuery);
});

View File

@ -1,7 +1,10 @@
/*
* bootstrap-table - v1.12.1 - 2018-03-12
* https://github.com/wenzhixin/bootstrap-table
* Copyright (c) 2018 zhixin wen
* Licensed MIT License
*/
!function(a){"use strict";a.fn.bootstrapTable.locales["zh-CN"]={formatLoadingMessage:function(){return"正在努力地加载数据中,请稍候……"},formatRecordsPerPage:function(a){return"每页显示 "+a+" 条记录"},formatShowingRows:function(a,b,c){return"显示第 "+a+" 到第 "+b+" 条记录,总共 "+c+" 条记录"},formatSearch:function(){return"搜索"},formatNoMatches:function(){return"没有找到匹配的记录"},formatPaginationSwitch:function(){return"隐藏/显示分页"},formatRefresh:function(){return"刷新"},formatToggle:function(){return"切换"},formatColumns:function(){return"列"},formatExport:function(){return"导出数据"},formatClearFilters:function(){return"清空过滤"}},a.extend(a.fn.bootstrapTable.defaults,a.fn.bootstrapTable.locales["zh-CN"])}(jQuery);
/**
* bootstrap-table - An extended Bootstrap table with radio, checkbox, sort, pagination, and other added features. (supports twitter bootstrap v2 and v3).
*
* @version v1.14.2
* @homepage https://bootstrap-table.com
* @author wenzhixin <wenzhixin2010@gmail.com> (http://wenzhixin.net.cn/)
* @license MIT
*/
(function(a,b){if('function'==typeof define&&define.amd)define([],b);else if('undefined'!=typeof exports)b();else{b(),a.bootstrapTableZhCN={exports:{}}.exports}})(this,function(){'use strict';(function(a){a.fn.bootstrapTable.locales['zh-CN']={formatLoadingMessage:function(){return'\u6B63\u5728\u52AA\u529B\u5730\u52A0\u8F7D\u6570\u636E\u4E2D\uFF0C\u8BF7\u7A0D\u5019'},formatRecordsPerPage:function(a){return'\u6BCF\u9875\u663E\u793A '+a+' \u6761\u8BB0\u5F55'},formatShowingRows:function(a,b,c){return'\u663E\u793A\u7B2C '+a+' \u5230\u7B2C '+b+' \u6761\u8BB0\u5F55\uFF0C\u603B\u5171 '+c+' \u6761\u8BB0\u5F55'},formatDetailPagination:function(a){return'\u603B\u5171 '+a+' \u6761\u8BB0\u5F55'},formatSearch:function(){return'\u641C\u7D22'},formatNoMatches:function(){return'\u6CA1\u6709\u627E\u5230\u5339\u914D\u7684\u8BB0\u5F55'},formatPaginationSwitch:function(){return'\u9690\u85CF/\u663E\u793A\u5206\u9875'},formatRefresh:function(){return'\u5237\u65B0'},formatToggle:function(){return'\u5207\u6362'},formatColumns:function(){return'\u5217'},formatFullscreen:function(){return'\u5168\u5C4F'},formatAllRows:function(){return'\u6240\u6709'},formatAutoRefresh:function(){return'\u81EA\u52A8\u5237\u65B0'},formatExport:function(){return'\u5BFC\u51FA\u6570\u636E'},formatClearFilters:function(){return'\u6E05\u7A7A\u8FC7\u6EE4'},formatJumpto:function(){return'\u8DF3\u8F6C'},formatAdvancedSearch:function(){return'\u9AD8\u7EA7\u641C\u7D22'},formatAdvancedCloseButton:function(){return'\u5173\u95ED'}},a.extend(a.fn.bootstrapTable.defaults,a.fn.bootstrapTable.locales['zh-CN'])})(jQuery)});

View File

@ -33,7 +33,7 @@
var data = $this.data('lgb.SliderCaptcha');
var options = typeof option === 'object' && option;
if (!data && /init|reset|verify/.test(option)) return;
if (data && !/reset/.test(option)) return;
if (!data) $this.data('lgb.SliderCaptcha', data = new SliderCaptcha(this, options));
if (typeof option === 'string') data[option]();
});
@ -63,8 +63,8 @@
return canvas;
};
var canvas = createCanvas(this.options.width - 2, this.options.height) // 画布
var block = canvas.cloneNode(true) // 滑块
var canvas = createCanvas(this.options.width - 2, this.options.height); // 画布
var block = canvas.cloneNode(true); // 滑块
var sliderContainer = createElement('div', 'sliderContainer');
var refreshIcon = createElement('i', 'refreshIcon ' + this.options.repeatIcon);
var sliderMask = createElement('div', 'sliderMask');
@ -73,7 +73,7 @@
var sliderIcon = createElement('i', 'fa fa-arrow-right sliderIcon');
var text = createElement('span', 'sliderText');
block.className = 'block'
block.className = 'block';
text.innerHTML = this.options.barText;
var el = this.$element;
@ -87,18 +87,25 @@
sliderContainer.appendChild(text);
el.append($(sliderContainer));
Object.assign(this, {
canvas,
block,
var _canvas = {
canvas: canvas,
block: block,
sliderContainer: $(sliderContainer),
refreshIcon,
slider,
sliderMask,
sliderIcon,
refreshIcon: refreshIcon,
slider: slider,
sliderMask: sliderMask,
sliderIcon: sliderIcon,
text: $(text),
canvasCtx: canvas.getContext('2d'),
blockCtx: block.getContext('2d')
})
};
if ($.isFunction(Object.assign)) {
Object.assign(this, _canvas);
}
else {
$.extend(this, _canvas);
}
};
_proto.initImg = function () {
@ -111,22 +118,22 @@
var PI = that.options.PI;
var x = that.x;
var y = that.y;
ctx.beginPath()
ctx.moveTo(x, y)
ctx.arc(x + l / 2, y - r + 2, r, 0.72 * PI, 2.26 * PI)
ctx.lineTo(x + l, y)
ctx.arc(x + l + r - 2, y + l / 2, r, 1.21 * PI, 2.78 * PI)
ctx.lineTo(x + l, y + l)
ctx.lineTo(x, y + l)
ctx.arc(x + r - 2, y + l / 2, r + 0.4, 2.76 * PI, 1.24 * PI, true)
ctx.lineTo(x, y)
ctx.lineWidth = 2
ctx.fillStyle = 'rgba(255, 255, 255, 0.7)'
ctx.strokeStyle = 'rgba(255, 255, 255, 0.7)'
ctx.stroke()
ctx[operation]()
ctx.globalCompositeOperation = isIE ? 'xor' : 'overlay'
}
ctx.beginPath();
ctx.moveTo(x, y);
ctx.arc(x + l / 2, y - r + 2, r, 0.72 * PI, 2.26 * PI);
ctx.lineTo(x + l, y);
ctx.arc(x + l + r - 2, y + l / 2, r, 1.21 * PI, 2.78 * PI);
ctx.lineTo(x + l, y + l);
ctx.lineTo(x, y + l);
ctx.arc(x + r - 2, y + l / 2, r + 0.4, 2.76 * PI, 1.24 * PI, true);
ctx.lineTo(x, y);
ctx.lineWidth = 2;
ctx.fillStyle = 'rgba(255, 255, 255, 0.7)';
ctx.strokeStyle = 'rgba(255, 255, 255, 0.7)';
ctx.stroke();
ctx[operation]();
ctx.globalCompositeOperation = isIE ? 'xor' : 'destination-over';
};
var getRandomNumberByRange = function (start, end) {
return Math.round(Math.random() * (end - start) + start);
@ -168,14 +175,14 @@
if ($.isFunction(that.options.setSrc)) src = that.options.setSrc();
if (!src || src === '') src = 'https://picsum.photos/' + that.options.width + '/' + that.options.height + '/?image=' + Math.round(Math.random() * 20);
if (isIE) { // IE浏览器无法通过img.crossOrigin跨域使用ajax获取图片blob然后转为dataURL显示
var xhr = new XMLHttpRequest()
var xhr = new XMLHttpRequest();
xhr.onloadend = function (e) {
var file = new FileReader(); // FileReader仅支持IE10+
file.readAsDataURL(e.target.response);
file.onloadend = function (e) {
img.src = e.target.result;
}
}
};
};
xhr.open('GET', src);
xhr.responseType = 'blob';
xhr.send();
@ -184,7 +191,7 @@
img.setSrc();
this.text.attr('data-text', this.options.barText);
this.text.text(this.options.loadingText);
this.img = img
this.img = img;
};
_proto.clean = function () {
@ -206,7 +213,7 @@
});
var originX, originY, trail = [],
isMouseDown = false
isMouseDown = false;
var handleDragStart = function (e) {
if (that.text.hasClass('text-danger')) return;
@ -216,6 +223,7 @@
};
var handleDragMove = function (e) {
e.preventDefault();
if (!isMouseDown) return false;
var eventX = e.clientX || e.touches[0].clientX;
var eventY = e.clientY || e.touches[0].clientY;
@ -232,23 +240,20 @@
};
var handleDragEnd = function (e) {
if (!isMouseDown) return false
isMouseDown = false
var eventX = e.clientX || e.changedTouches[0].clientX
if (eventX == originX) return false
if (!isMouseDown) return false;
isMouseDown = false;
var eventX = e.clientX || e.changedTouches[0].clientX;
if (eventX === originX) return false;
that.sliderContainer.removeClass('sliderContainer_active');
that.trail = trail
var {
spliced,
verified
} = that.verify()
if (spliced && verified) {
that.trail = trail;
var data = that.verify();
if (data.spliced && data.verified) {
that.sliderContainer.addClass('sliderContainer_success');
if ($.isFunction(that.options.onSuccess)) that.options.onSuccess.call(that.$element);
} else {
that.sliderContainer.addClass('sliderContainer_fail');
if ($.isFunction(that.options.onFail)) that.options.onFail.call(that.$element);
setTimeout(() => {
setTimeout(function () {
that.text.text(that.options.failedText);
that.reset();
}, 1000);
@ -264,28 +269,29 @@
document.addEventListener('mousedown', function () { return false; });
document.addEventListener('touchstart', function () { return false; });
document.addEventListener('swipe', function () { return false; });
};
_proto.verify = function () {
var sum = function (x, y) { return x + y; };
var square = function (x) { return x * x; };
var arr = this.trail // 拖动时y轴的移动距离
var arr = this.trail; // 拖动时y轴的移动距离
var average = arr.reduce(sum) / arr.length;
var deviations = arr.map(function (x) { return x - average; });
var stddev = Math.sqrt(deviations.map(square).reduce(sum) / arr.length);
var left = parseInt(this.block.style.left);
return {
spliced: Math.abs(left - this.x) < this.options.offset,
verified: stddev !== 0, // 简单验证下拖动轨迹为零时表示Y轴上下没有波动可能非人为操作
}
verified: stddev !== 0 // 简单验证下拖动轨迹为零时表示Y轴上下没有波动可能非人为操作
};
};
_proto.reset = function () {
this.sliderContainer.removeClass('sliderContainer_fail sliderContainer_success');
this.slider.style.left = 0
this.block.style.left = 0
this.sliderMask.style.width = 0
this.clean()
this.slider.style.left = 0;
this.block.style.left = 0;
this.sliderMask.style.width = 0;
this.clean();
this.text.attr('data-text', this.text.text());
this.text.text(this.options.loadingText);
this.img.setSrc();

View File

@ -1,4 +1,4 @@
body {
body {
overflow-x: hidden;
}

View File

@ -1,4 +1,4 @@
(function ($) {
(function ($) {
// 增加Array扩展
if (!$.isFunction(Array.prototype.filter)) {
Array.prototype.filter = function (callback, thisObject) {
@ -123,6 +123,7 @@
id: "",
url: "",
data: {},
htmlTemplate: '<div class="form-group col-md-3 col-sm-4 col-6"><div class="form-check"><label class="form-check-label" title="{3}" data-toggle="tooltip"><input type="checkbox" class="form-check-input" value="{0}" {2}/><span>{1}</span></label></div></div>',
title: "",
modal: false,
loading: false,
@ -140,7 +141,7 @@
return;
}
var doneFlag = "done";
var loadFlag = "loading";
var loadingHandler = null;
if (options.loading && options.modal) {
var $modal = $(options.modal);
@ -150,13 +151,13 @@
window.clearTimeout(loadingHandler);
loadingHandler = null;
}
if ($this.hasClass(doneFlag)) {
$this.removeClass(doneFlag).modal('hide');
}
if ($this.hasClass(loadFlag)) return;
$this.modal('hide');
});
loadingHandler = window.setTimeout(function () { $modal.modal('show'); }, 500);
setTimeout(function () {
loadingHandler = window.setTimeout(function () { $(options.modal).addClass(loadFlag).modal('show'); }, 300);
var loadTimeoutHandler = setTimeout(function () {
$(options.modal).find('.close').removeClass('d-none');
clearTimeout(loadTimeoutHandler);
}, options.loadingTimeout);
}
@ -172,13 +173,12 @@
function success(result) {
if (options.modal && (result || options.loading)) {
$(options.modal).addClass(doneFlag);
if (loadingHandler !== null) {
// cancel show modal event
window.clearTimeout(loadingHandler);
loadingHandler = null;
}
else $(options.modal).removeClass(doneFlag).modal('hide');
else $(options.modal).removeClass(loadFlag).modal('hide');
}
if (options.title) toastr[result ? 'success' : 'error'](options.title + (result ? "成功" : "失败"));
if ($.isFunction(options.callback)) {
@ -208,11 +208,13 @@
xhrFields: { withCredentials: true },
crossDomain: true
});
if ($.isArray($.logData) && !$.isEmptyObject(options.data)) $.logData.push({ url: url, data: options.method === 'delete' ? options.logData : options.data });
if (options.method === 'delete') $.logData.log();
$.ajax(ajaxSettings);
},
lgbSwal: function (options) {
if ($.isFunction(swal)) {
swal($.extend({ html: true, showConfirmButton: false, showCancelButton: false, timer: 1000, title: '未设置', type: "success" }, options));
swal($.extend({ showConfirmButton: false, showCancelButton: false, timer: 1000, title: '未设置', type: "success" }, options));
}
},
getUID: function (prefix) {
@ -222,7 +224,7 @@
return prefix;
},
footer: function (options) {
var op = $.extend({ header: "header", content: ".container-fluid", ele: 'footer' }, options);
var op = $.extend({ header: "header", content: ".main-content", ele: 'footer' }, options);
var $ele = $(op.ele);
return $(op.header).outerHeight() + $(op.content).outerHeight() + $ele.outerHeight() > $(window).height() ? $ele.removeClass('position-fixed') : $ele.addClass('position-fixed');
},
@ -231,6 +233,33 @@
if (url.substr(0, 4) === "http") return url;
var base = $('#pathBase').attr('href');
return base + url;
},
safeHtml: function (text) {
return $('<div>').text(text).html();
},
syntaxHighlight: function (json) {
if (typeof (json) === 'string') {
json = JSON.parse(json);
}
json = JSON.stringify(json, undefined, 2);
json = json.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>');
return json.replace(/("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)/g,
function (match) {
var cls = 'number';
if (/^"/.test(match)) {
if (/:$/.test(match)) {
cls = 'key';
} else {
cls = 'string';
}
} else if (/true|false/.test(match)) {
cls = 'boolean';
} else if (/null/.test(match)) {
cls = 'null';
}
return '<span class="' + cls + '">' + match + '</span>';
}
);
}
});
@ -253,20 +282,29 @@
lgbTable: function (options) {
var bsa = new DataTable($.extend(options.dataBinder, { url: options.url }));
var settings = $.extend({
var settings = $.extend(true, {
url: options.url,
checkbox: true,
edit: true,
editTitle: "编辑",
editButtons: {
id: "#tableButtons",
events: {},
formatter: false
},
editTitle: "操作",
editField: "Id",
queryButton: false
}, options.smartTable);
if (settings.edit) settings.columns.unshift({
var $editButtons = $(settings.editButtons.id);
if ($editButtons.find('button').length > 0) settings.columns.push({
title: settings.editTitle,
field: settings.editField,
events: bsa.idEvents(),
events: $.extend({}, bsa.idEvents(), settings.editButtons.events),
formatter: function (value, row, index) {
return "<a class='edit' title='" + value + "' href='javascript:void(0)'>" + this.title + "</a>";
if ($.isFunction(settings.editButtons.formatter)) {
return settings.editButtons.formatter.call($editButtons, value, row, index);
}
return $editButtons.html();
}
});
if (settings.checkbox) settings.columns.unshift({ checkbox: true });
@ -275,7 +313,6 @@
smartTable: function (options) {
var settings = $.extend({
toolbar: '#toolbar', //工具按钮用哪个容器
striped: true, //是否显示行间隔色
cache: false, //是否使用缓存默认为true所以一般情况下需要设置一下这个属性*
pagination: true, //是否显示分页(*
sortOrder: "asc", //排序方式
@ -283,6 +320,8 @@
pageNumber: 1, //初始化加载第一页,默认第一页
pageSize: 20, //每页的记录行数(*
pageList: [20, 40, 80, 120], //可供选择的每页的行数(*
showExport: true,
exportTypes: ['csv', 'txt', 'excel'],
showColumns: true, //是否显示所有的列
showRefresh: true, //是否显示刷新按钮
showToggle: true, //是否显示详细视图和列表视图的切换按钮
@ -299,11 +338,28 @@
}
}, options);
settings.url = $.formatUrl(settings.url);
$.each(settings.columns, function (index, value) {
if (value.checkbox) return;
if (!$.isFunction(value.formatter)) {
value.formatter = function (value, row, index, field) {
return $.safeHtml(value);
}
}
else {
var formatter = value.formatter;
value.formatter = function (value, row, index, field) {
return formatter.call(this, $.safeHtml(value), row, index, field);
}
}
});
this.bootstrapTable(settings);
$(settings.toolbar).removeClass('d-none').find('.toolbar').on('click', 'a', function (e) {
$('.bootstrap-table .fixed-table-toolbar .columns .export .dropdown-menu').addClass("dropdown-menu-right");
var $gear = $(settings.toolbar).removeClass('d-none').find('.gear');
if ($gear.find('.dropdown-menu > a').length === 0) $gear.addClass('d-none');
$gear.on('click', 'a', function (e) {
e.preventDefault();
$('#' + $(this).attr('id').replace('tb_', 'btn_')).trigger("click");
}).insertBefore(this.parents('.bootstrap-table').find('.fixed-table-toolbar > .bs-bars'));
});
if (settings.queryButton) {
$(settings.queryButton).on('click', this, function (e) {
e.data.bootstrapTable('refresh');
@ -322,7 +378,7 @@
$ele.popover(options);
}
});
return this.on('click', function (e) { e.preventDefault(); });
return this;
},
lgbTooltip: function (options) {
this.each(function (index, ele) {
@ -352,7 +408,6 @@
pickerPosition: 'bottom-left',
fontAwesome: true
}, options);
this.on('show hide', function (e) { e.stopPropagation(); });
this.datetimepicker(option);
return this;
},
@ -414,7 +469,11 @@
$(function () {
// fix bug bootstrap-table 1.12.1 showToggle
if ($.fn.bootstrapTable) $.fn.bootstrapTable.Constructor.DEFAULTS.icons.toggle = $.fn.bootstrapTable.Constructor.DEFAULTS.icons.toggleOff;
if ($.fn.bootstrapTable) {
$.extend($.fn.bootstrapTable.defaults.icons, {
refresh: 'fa-refresh'
});
}
if (window.NProgress) {
$(document).ajaxStart(function () {
@ -442,15 +501,13 @@
"hideMethod": "fadeOut"
};
$('[data-toggle="dropdown"].dropdown-select').dropdown('select');
$('[data-toggle="tooltip"]').tooltip();
$('[data-toggle="popover"]').popover();
$('[data-toggle="lgbinfo"]').lgbInfo();
$('.date').lgbDatePicker();
$('.collapse').on('shown.bs.collapse hidden.bs.collapse', function () {
$('.collapse').on('shown.bs.collapse', function () {
$.footer().removeClass('d-none');
}).on('hide.bs.collapse show.bs.collapse', function () {
}).on('hidden.bs.collapse', function () {
$.footer().removeClass('d-none');
}).on('hide.bs.collapse', function () {
$('footer').addClass('d-none');
}).on('show.bs.collapse', function () {
$('footer').addClass('d-none');
});
@ -460,9 +517,15 @@
$("#gotoTop").on('click', function (e) {
e.preventDefault();
$('html, body').animate({
$('html, body, .main-content').animate({
scrollTop: 0
}, 200);
});
$('[data-toggle="dropdown"].dropdown-select').dropdown('select');
$('[data-toggle="tooltip"]').tooltip();
$('[data-toggle="popover"]').popover();
$('[data-toggle="lgbinfo"]').lgbInfo();
$('.date').lgbDatePicker();
});
})(jQuery);

View File

@ -1,4 +1,29 @@
(function ($) {
var formatData = function (data) {
delete data._nodes;
delete data._parent;
delete data._level;
delete data._last;
return data;
};
var findIdField = function (tableName) {
var idField = $(tableName).bootstrapTable("getOptions").idField;
if (idField === undefined) idField = "Id";
return idField;
};
var swalDeleteOptions = {
title: "删除数据",
html: '您确定要删除选中的所有数据吗',
type: "warning",
showCancelButton: true,
confirmButtonColor: '#dc3545',
cancelButtonColor: '#6c757d',
confirmButtonText: "我要删除",
cancelButtonText: "取消"
};
DataEntity = function (options) {
this.options = options;
};
@ -13,7 +38,12 @@
else if (ctl.attr('data-toggle') === 'toggle') {
ctl.bootstrapToggle(value[name] ? 'on' : 'off');
}
else ctl.val(value[name]);
else if (ctl.attr('data-toggle') === 'lgbSelect') {
ctl.lgbSelect('val', value[name]);
}
else {
ctl.val(value[name]);
}
}
},
reset: function () {
@ -27,7 +57,12 @@
else if (ctl.attr('data-toggle') === 'toggle') {
ctl.bootstrapToggle(dv === "true" ? 'on' : 'off');
}
else ctl.val(dv);
else if (ctl.attr('data-toggle') === 'lgbSelect') {
ctl.lgbSelect('val', dv);
}
else {
ctl.val(dv);
}
}
},
get: function () {
@ -50,7 +85,7 @@
DataTable = function (options) {
var that = this;
this.options = $.extend(true, {}, DataTable.settings, options);
this.options = $.extend(true, { delTitle: "删除数据", saveTitle: "保存数据" }, DataTable.settings, options);
this.dataEntity = new DataEntity(options.map);
// handler click event
@ -131,26 +166,21 @@
return;
}
else {
swal({
title: "删除数据",
text: "您确定要删除选中的所有数据吗",
type: "warning",
showCancelButton: true,
cancelButtonClass: 'btn-secondary',
confirmButtonText: "我要删除",
confirmButtonClass: "btn-danger ml-2",
cancelButtonText: "取消"
}, function () {
setTimeout(function () {
var iDs = arrselections.map(function (element, index) { return element.Id; });
swal($.extend({}, swalDeleteOptions)).then(function (result) {
if (result.value) {
var logData = arrselections.map(function (element, index) {
return formatData($.extend({}, element));
});
var idField = findIdField(options.bootstrapTable);
var iDs = arrselections.map(function (element, index) { return element[idField]; });
$.bc({
url: options.url, data: iDs, method: 'delete', title: '删除数据',
url: options.url, data: iDs, method: 'delete', title: options.delTitle, logData: logData,
callback: function (result) {
if (result) $(options.bootstrapTable).bootstrapTable('refresh');
handlerCallback.call(that, null, element, { oper: 'del', success: result });
}
});
}, 100);
}
});
}
}
@ -159,7 +189,7 @@
var that = this;
var options = $.extend(true, {}, this.options, { data: this.dataEntity.get() });
$.bc({
url: options.url, data: options.data, title: "保存数据", modal: options.modal, method: "post",
url: options.url, data: options.data, title: options.saveTitle, modal: options.modal, method: "post",
callback: function (result) {
if (result) {
$(options.bootstrapTable).bootstrapTable('refresh');
@ -178,7 +208,8 @@
dataEntity: this.dataEntity,
table: this.options.bootstrapTable,
modal: this.options.modal,
src: this
src: this,
url: this.options.url
};
return {
'click .edit': function (e, value, row, index) {
@ -187,6 +218,35 @@
$(op.table).bootstrapTable('check', index);
handlerCallback.call(op.src, null, e, { oper: 'edit', data: row });
$(op.modal).modal("show");
},
'click .del': function (e, value, row, index) {
var displayName = "本项目";
if (row.Name) displayName = " <span class='text-danger font-weight-bold'>" + row.Name + "</span> ";
var text = "您确定要删除" + displayName + "吗?";
var data = $.extend({}, row);
formatData(data);
data = [data];
if ($.isArray(row._nodes) && row._nodes.length > 0) {
$.each(row._nodes, function (index, element) {
data.push(formatData($.extend({}, element)));
});
text = "本删除项含有级联子项目</br>您确定要删除 <span class='text-danger font-weight-bold'>" + row.Name + "</span> 以及子项目吗?";
}
swal($.extend({}, swalDeleteOptions, { html: text })).then(function (result) {
if (result.value) {
var idField = findIdField(op.table);
var iDs = data.map(function (element, index) {
return element[idField];
});
$.bc({
url: op.url, data: iDs, method: 'delete', title: '删除数据', logData: data,
callback: function (result) {
if (result) $(op.table).bootstrapTable('refresh');
handlerCallback.call(op.src, null, e, { oper: 'del', success: result });
}
});
}
});
}
};
}

View File

@ -176,28 +176,28 @@
var $this = $(element);
if ($this.is(':hidden')) return result;
var methods = this.rules(element);
for (var rule in methods) {
var proxy = function(rule) {
if ($.isFunction($.validator.methods[rule])) {
result = $.validator.methods[rule].call(this.options, $this.val(), element, methods[rule]);
if (!result) {
$this.attr('data-original-title', this.defaultMessage(element, { method: rule, parameters: methods[rule] }));
}
// checkGroup rule
if (rule === 'checkGroup') {
var $checkers = this.$element.find(this.options.childClass).filter(function () {
var $this = $(this);
return $this.hasClass(rule) || $this.attr(rule);
});
$checkers.removeClass(this.options.errorClass).removeClass(this.options.validClass);
if (result) $checkers.tooltip('dispose');
else $checkers.addClass(this.options.errorClass).tooltip();
return result;
}
}
else {
console.log('没有匹配的方法 ' + rule);
}
return true;
}
var remote = null;
for (var rule in methods) {
if(rule !== 'remote') {
result = proxy.call(this, rule);
if(!result) return false;
}
else remote = rule;
}
if(remote !== null) result = proxy.call(this, remote);
return result;
};
@ -212,21 +212,26 @@
return message;
};
Validate.prototype.attributeRules = function (element, rules) {
var $element = $(element), value;
Validate.prototype.attributeRules = function (element) {
var rules = {}, $element = $(element), value;
$.each(["remote"], function () {
var para = $element.attr(this);
if (para) {
if (element.name === "") element.name = element.id;
rules[this] = $.formatUrl(para);
$.each(["radioGroup"], function () {
value = element.getAttribute(this);
if (value === "") value = true;
value = !!value;
rules[this] = value;
if (value) {
rules["required"] = false;
$(element).on('change', ':radio', function () {
$(this).trigger('input.lgb.validate');
});
}
});
$.each(["radioGroup", "checkGroup"], function () {
if (rules[this]) {
delete rules.required;
return false;
$.each(["remote"], function () {
if (element.getAttribute(this)) {
if (element.name === "") element.name = element.id;
var para = $(element).attr(this);
rules[this] = $.formatUrl(para);
}
});
return rules;
@ -235,11 +240,7 @@
Validate.prototype.rules = function (element) {
var $this = $(element);
var rules = $this.data('lgb.Validate.Rules');
if (!rules) $this.data('lgb.Validate.Rules', rules = this.attributeRules(element, $.validator.normalizeRules($.extend(
{ required: true },
$.validator.classRules(element),
$.validator.attributeRules(element)
))));
if (!rules) $this.data('lgb.Validate.Rules', rules = $.validator.normalizeRules($.extend({ required: true }, $.validator.classRules(element), $.validator.attributeRules(element), this.attributeRules(element))));
return rules;
};
@ -274,10 +275,9 @@
$.validator.addMethod("radioGroup", function (value, element) {
return $(element).find(':checked').length === 1;
}, "请选择一个选项");
$.validator.addMethod("checkGroup", function (value, element) {
return $(element).parents('[data-toggle="LgbValidate"]').find(':checked').length >= 1;
}, "请选择一个选项");
$.validator.addMethod("userName", function (value, element) {
return this.optional(element) || /^[a-zA-Z0-9_@.]*$/.test(value);
}, "登录名称不可以包含非法字符");
}
$('[data-toggle="LgbValidate"]').lgbValidate();
});