diff --git a/public/assets/css/backend.css b/public/assets/css/backend.css index 9019dab510d01f160a18fccacbeef70f5cc2bbd0..cab8d69b1142cc4954ce40f76c95589aa19119e1 100644 --- a/public/assets/css/backend.css +++ b/public/assets/css/backend.css @@ -1,756 +1,758 @@ -@import url("../css/bootstrap.min.css"); -@import url("../css/fastadmin.min.css"); -@import url("../css/skins/skin-green.css"); -@import url("../css/iconfont.css"); -@import url("../libs/font-awesome/css/font-awesome.min.css"); -@import url("../libs/toastr/toastr.min.css"); -@import url("../libs/layer/dist/theme/default/layer.css"); -@import url("../libs/bootstrap-table/dist/bootstrap-table.min.css"); -@import url("../libs/eonasdan-bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.min.css"); -@import url("../libs/bootstrap-daterangepicker/daterangepicker.css"); -@import url("../libs/nice-validator/dist/jquery.validator.css"); -@import url("../libs/selectpage/selectpage.css"); -body { - background: #f1f4f6; -} -body.is-dialog { - background: #fff; -} -.selection { - position: absolute; - border: 1px solid #8B9; - background-color: #BEC; -} -.main-header .logo, -.main-header .navbar { - -webkit-transition: none; - -moz-transition: none; - -o-transition: none; - transition: none; -} -.main-header .navbar { - position: relative; -} -.main-header .navbar .sidebar-toggle { - position: absolute; - width: 45px; - text-align: center; -} -.main-header .navbar #nav { - position: absolute; - left: 45px; -} -.main-header .navbar .navbar-custom-menu { - position: absolute; - right: 0; -} -.note-dialog .modal { - z-index: 1060; -} -.bootstrap-dialog .modal-dialog { - /*width: 70%;*/ - max-width: 885px; -} -/*iOS兼容*/ -html.ios-fix, -html.ios-fix body { - height: 100%; - overflow: auto; - -webkit-overflow-scrolling: touch; -} -.content { - min-height: 500px; -} -#header { - background: #fff; - box-shadow: 0 2px 2px rgba(0, 0, 0, 0.05), 0 1px 0 rgba(0, 0, 0, 0.05); -} -.content-wrapper { - position: relative; -} -.control-relative { - position: relative; -} -.tab-addtabs { - overflow: hidden; -} -.tab-addtabs .tab-pane { - height: 100%; - width: 100%; -} -.row-between .col-xs-6 + .col-xs-6:before { - content: "-"; - position: absolute; - left: -2%; - top: 6px; -} -@media only screen and (min-width: 481px) { - .row-flex { - display: flex; - flex-wrap: wrap; - } - .row-flex > [class*='col-'] { - display: flex; - flex-direction: column; - } - .row-flex.row:after, - .row-flex.row:before { - display: flex; - } -} -@media (max-width: 991px) { - .main-header .navbar-custom-menu a.btn-danger { - color: #fff; - background-color: #e74c3c; - } - .main-header .navbar-custom-menu a.btn-primary { - color: #fff; - background-color: #2c3e50; - } -} -.common-search-table { - min-height: 20px; - padding: 15px; - margin-bottom: 15px; - background-color: #f5f5f5; -} -.searchit { - border-bottom: 1px dashed #3c8dbc; -} -/* 固定的底部按钮 */ -.fixed-footer { - position: fixed; - bottom: 0; - background-color: #ecf0f1; - width: 100%; - margin-bottom: 0; - padding: 10px; -} -/* 包裹在layer外层 */ -.layer-footer { - display: none; -} -table.table-template { - overflow: hidden; -} -.sp_container .msg-box { - position: absolute; - right: 0; - top: 0; -} -.toast-top-right-index { - top: 62px; - right: 12px; -} -.bootstrap-select .status { - background: #f0f0f0; - clear: both; - color: #999; - font-size: 12px; - font-weight: 500; - line-height: 1; - margin-bottom: -5px; - padding: 10px 20px; -} -.img-center { - margin: 0 auto; - display: inline; - float: none; -} -/* - * RIBBON - */ -#ribbon { - overflow: hidden; - padding: 15px 15px 0 15px; - position: relative; -} -#ribbon a { - color: #777 !important; - text-decoration: none !important; -} -#ribbon .breadcrumb { - display: inline-block; - margin: 0; - padding: 0; - background: none; - vertical-align: top; -} -#ribbon .breadcrumb > .active, -#ribbon .breadcrumb li { - color: #aaa; -} -#ribbon .shortcut a { - margin-left: 10px; -} -.is-dialog #main { - background: #fff; -} -form.form-horizontal .control-label { - font-weight: normal; -} -.user-panel > .image img { - width: 45px; - height: 45px; -} -/*panel扩展描述样式*/ -.panel-intro { - margin-bottom: 0; - border: none; -} -.panel-intro > .panel-heading { - padding: 15px; - padding-bottom: 0; - background: #e8edf0; - border-color: #e8edf0; - position: relative; -} -.panel-intro > .panel-heading .panel-lead { - margin-bottom: 15px; -} -.panel-intro > .panel-heading .panel-lead em { - display: block; - font-weight: bold; - font-style: normal; -} -.panel-intro > .panel-heading .panel-title { - height: 25px; - font-weight: normal; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; -} -.panel-intro > .panel-heading .panel-control { - height: 42px; - position: absolute; - top: 8px; - right: 8px; -} -.panel-intro > .panel-heading .panel-control .fa { - font-size: 14px; -} -.panel-intro > .panel-heading .nav-tabs { - border-bottom: 0; - margin-bottom: 0; -} -.panel-intro > .panel-heading .nav-tabs > li > a { - margin-right: 4px; - color: #95a5a6; - background-color: #d8e0e6; - border: 1px solid #e8edf0; - border-bottom-color: transparent; -} -.panel-intro > .panel-heading .nav-tabs > li > a:hover, -.panel-intro > .panel-heading .nav-tabs > li > a:focus { - border: 1px solid #e8edf0; - color: #7b8a8b; - background-color: #c9d4dc; -} -.panel-intro > .panel-heading .nav-tabs > li.active > a, -.panel-intro > .panel-heading .nav-tabs > li.active > a:hover, -.panel-intro > .panel-heading .nav-tabs > li.active > a:focus { - color: #7b8a8b; - background-color: #ffffff; - border-bottom-color: transparent; - cursor: default; -} -/*单表格*/ -.panel-tabs .panel-heading { - padding: 12px 15px 12px 15px; -} -.panel-tabs .panel-heading .panel-lead { - margin-bottom: 0px; -} -/*选项卡*/ -.panel-nav .panel-heading { - padding: 0px; - padding-bottom: 0; - background: #f1f4f6; - border-color: #f1f4f6; -} -.panel-nav .nav-tabs > li > a { - padding: 12px 15px; - background-color: #e8edf0; - border: 1px solid #f1f4f6; -} -.panel-nav .nav-tabs > li > a:hover, -.panel-nav .nav-tabs > li > a:focus { - border: 1px solid #e8edf0; - background-color: #e8edf0; -} -.panel-nav .nav-tabs > li.active > a, -.panel-nav .nav-tabs > li.active > a:hover, -.panel-nav .nav-tabs > li.active > a:focus { - border-color: #f1f4f6; - border-bottom-color: transparent; -} -/*顶栏addtabs*/ -.nav-addtabs { - border: none; -} -.nav-addtabs.disable-top-badge > li > a > .pull-right-container { - display: none; -} -.nav-addtabs > li { - margin: 0; -} -.nav-addtabs > li > a { - height: 49px; - line-height: 49px; - padding: 0 15px; - border-radius: 0; - border: none; - border-right: 1px solid rgba(0, 0, 0, 0.05); - margin: 0; - color: #95a5a6; -} -.nav-addtabs > li > a:hover, -.nav-addtabs > li > a:focus { - border: none; - color: #2c3e50; - border-right: 1px solid rgba(0, 0, 0, 0.05); -} -.nav-addtabs > li > a i { - margin-right: 3px; -} -.nav-addtabs > li.active > a { - height: 49px; - line-height: 49px; - padding: 0 15px; - border-radius: 0; - border: none; - border-right: 1px solid rgba(0, 0, 0, 0.05); - background: #f1f4f6; - color: #2c3e50; - overflow: hidden; -} -.nav-addtabs > li.active > a:hover, -.nav-addtabs > li.active > a:focus { - border: none; - color: #2c3e50; - border-right: 1px solid rgba(0, 0, 0, 0.05); - background: #f1f4f6; -} -.nav-addtabs > li .close-tab { - font-size: 10px; - position: absolute; - right: 5px; - top: 50%; - margin-top: -7px; - z-index: 100; - cursor: hand; - cursor: pointer; - color: #fff; - display: none; -} -.nav-addtabs .open > a:hover, -.nav-addtabs .open > a:focus { - border-right: 1px solid rgba(0, 0, 0, 0.05); -} -.nav-addtabs ul li { - position: relative; -} -.nav-addtabs li:hover > .close-tab { - display: block; -} -.main-sidebar .sidebar-form { - overflow: visible; -} -.main-sidebar .sidebar-form .menuresult { - z-index: 999; - position: absolute; - top: 34px; - left: -1px; - width: 100%; - max-height: 250px; - overflow: auto; - margin: 0; - border-top: none; - border-top-left-radius: 0; - border-top-right-radius: 0; -} -.main-sidebar .sidebar-form .menuresult a { - border-top: 1px solid #eee; - background-color: #fff; - border-bottom: 1px solid #eee; - margin-bottom: -1px; - display: block; - padding: 10px 15px; - color: #222d32; -} -.main-sidebar .sidebar-form .menuresult a:hover { - background: #eee; -} -.input-group .sp_result_area { - width: 100%; -} -.sidebar-menu.show-submenu .treeview-menu { - display: block; -} -.sidebar-menu > li .badge { - margin-top: 0; -} -.sidebar-collapse .user-panel > .image img { - width: 25px; - height: 25px; -} -@media (min-width: 768px) { - .sidebar-mini.sidebar-collapse .sidebar-menu > li:hover > .treeview-menu { - top: 41px; - } - .sidebar-mini.sidebar-collapse .sidebar-menu > li:hover > a > .pull-right-container { - top: 7px!important; - height: 17px; - } -} -.fieldlist dd { - display: block; - margin: 5px 0; -} -.fieldlist dd input { - display: inline-block; - width: 300px; -} -.fieldlist dd input:first-child { - width: 110px; -} -.fieldlist dd ins { - width: 110px; - display: inline-block; - text-decoration: none; - font-weight: bold; -} -#treeview .jstree-container-ul .jstree-node { - display: block; - clear: both; -} -#treeview .jstree-leaf:not(:first-child) { - float: left; - background: none; - margin-left: 0; - width: 80px; - clear: none; -} -#treeview .jstree-leaf { - float: left; - margin-left: 0; - padding-left: 24px; - width: 80px; - clear: none; - color: #777; -} -#treeview .jstree-leaf > .jstree-icon, -#treeview .jstree-leaf .jstree-themeicon { - display: none; -} -#treeview .jstree-last { - background-image: url("../img/32px.png"); - background-position: -292px -4px; - background-repeat: repeat-y; -} -#treeview .jstree-children:before, -#treeview .jstree-children:after { - content: " "; - display: table; -} -#treeview .jstree-children:after { - clear: both; -} -#treeview .jstree-themeicon { - display: none; -} -/*去除bootstrap-table的边框*/ -.fixed-table-container { - border: none!important; -} -/*修复nice-validator新版下的一处BUG*/ -.nice-validator input, -.nice-validator select, -.nice-validator textarea, -.nice-validator [contenteditable] { - display: inline-block; - *display: inline; - *zoom: 1; -} -/*修复nice-validator和summernote的编辑框冲突*/ -.nice-validator .note-editor .note-editing-area .note-editable { - display: inherit; -} -/*预览区域*/ -.plupload-preview { - padding: 0 10px; - margin-bottom: 0; -} -.plupload-preview li { - margin-top: 15px; -} -.plupload-preview .thumbnail { - margin-bottom: 10px; -} -.plupload-preview a { - display: block; -} -.plupload-preview a:first-child { - height: 90px; -} -.plupload-preview a img { - height: 80px; - object-fit: cover; -} -.pjax-loader-bar .progress { - position: fixed; - top: 0; - left: 0; - height: 2px; - background: #77b6ff; - box-shadow: 0 0 10px rgba(119, 182, 255, 0.7); - -webkit-transition: width 0.4s ease; - transition: width 0.4s ease; -} -.dropdown-menu.text-left a, -.dropdown-menu.text-left li { - text-align: left!important; -} -.bootstrap-table .fixed-table-toolbar .dropdown-menu { - overflow: auto; -} -.toolbar { - margin-top: 10px; - margin-bottom: 10px; -} -.fixed-table-toolbar .bs-bars, -.fixed-table-toolbar .columns, -.fixed-table-toolbar .search { - line-height: inherit; -} -.fixed-table-toolbar .toolbar { - margin-top: 0; - margin-bottom: 0; -} -.bootstrap-table table tbody tr:first-child td .bs-checkbox { - vertical-align: middle; -} -.bootstrap-table td.bs-checkbox { - vertical-align: middle; -} -.dropdown-submenu { - position: relative; -} -.dropdown-submenu > .dropdown-menu { - overflow: auto; - top: 0; - left: 100%; - margin-top: -6px; - margin-left: -1px; - -webkit-border-radius: 0 6px 6px 6px; - -webkit-background-clip: padding-box; - -moz-border-radius: 0 6px 6px 6px; - -moz-background-clip: padding; - border-radius: 0 6px 6px 6px; - background-clip: padding-box; -} -.dropdown-submenu:hover > .dropdown-menu { - display: block; -} -.dropdown-submenu:hover > a:after { - border-left-color: #fff; -} -.dropdown-submenu > a:after { - display: block; - content: " "; - float: right; - width: 0; - height: 0; - border-color: transparent; - border-style: solid; - border-width: 5px 0 5px 5px; - border-left-color: #ccc; - margin-top: 5px; - margin-right: -10px; -} -.dropdown-submenu.pull-left { - float: none; -} -.dropdown-submenu.pull-left > .dropdown-menu { - left: -100%; - margin-left: 10px; - -webkit-border-radius: 6px 0 6px 6px; - -webkit-background-clip: padding-box; - -moz-border-radius: 6px 0 6px 6px; - -moz-background-clip: padding; - border-radius: 6px 0 6px 6px; - background-clip: padding-box; -} -/*重写toast的几个背景色*/ -.toast-primary { - background-color: #48c9b0!important; -} -.toast-success { - background-color: #18bc9c!important; -} -.toast-error { - background-color: #e74c3c!important; -} -.toast-info { - background-color: #5dade2!important; -} -.toast-warning { - background-color: #f1c40f!important; -} -.toast-inverse { - background-color: #34495e!important; -} -.toast-default { - background-color: #bdc3c7!important; -} -#toast-container > div, -#toast-container > div:hover { - -webkit-box-shadow: 0 0 3px #eee; - -moz-box-shadow: 0 0 3px #eee; - box-shadow: 0 0 3px #eee; -} -.layui-layer-fast { - /*自定义底部灰色操作区*/ -} -.layui-layer-fast .layui-layer-title { - background: #2c3e50!important; - color: #fff!important; - border-bottom: none; -} -.layui-layer-fast .layui-layer-title ~ .layui-layer-setwin { - top: 0px; - height: 42px; -} -.layui-layer-fast .layui-layer-title ~ .layui-layer-setwin > a { - height: 42px; - line-height: 42px; - display: inline-block; -} -.layui-layer-fast.layui-layer-border { - border: none!important; - box-shadow: 1px 1px 50px rgba(0, 0, 0, 0.3) !important; -} -.layui-layer-fast.layui-layer-iframe { - overflow: visible; -} -.layui-layer-fast .layui-layer-moves { - -webkit-box-sizing: content-box; - -moz-box-sizing: content-box; - box-sizing: content-box; -} -.layui-layer-fast .layui-layer-btn { - text-align: center!important; - padding: 10px!important; - background: #ecf0f1; - overflow: hidden; -} -.layui-layer-fast .layui-layer-btn a { - background-color: #95a5a6!important; - border-color: #95a5a6!important; - color: #fff!important; -} -.layui-layer-fast .layui-layer-btn .layui-layer-btn0 { - background-color: #18bc9c!important; - border-color: #18bc9c!important; -} -.layui-layer-fast .layui-layer-footer { - padding: 8px 20px; - background-color: #ecf0f1; - height: auto; - text-align: inherit!important; -} -.layui-layer-fast .layui-layer-setwin > a { - background: none!important; -} -.layui-layer-fast .layui-layer-setwin > a cite { - display: none; -} -.layui-layer-fast .layui-layer-setwin > a:after { - content: "\e625"; - font-family: iconfont; - font-style: normal; - font-weight: normal; - text-decoration: inherit; - position: absolute; - font-size: 18px; - color: #fff; - margin: 0; - z-index: 1; -} -.layui-layer-fast .layui-layer-setwin > a:hover { - text-decoration: none!important; - background: none!important; -} -.layui-layer-fast .layui-layer-setwin > a:focus { - text-decoration: none!important; -} -.layui-layer-fast .layui-layer-setwin .layui-layer-min { - display: none; -} -.layui-layer-fast .layui-layer-setwin .layui-layer-min:after { - content: "\e625"; -} -.layui-layer-fast .layui-layer-setwin .layui-layer-max { - display: none; -} -.layui-layer-fast .layui-layer-setwin .layui-layer-max:after { - content: "\e623"; -} -.layui-layer-fast .layui-layer-setwin .layui-layer-maxmin { - display: none; -} -.layui-layer-fast .layui-layer-setwin .layui-layer-maxmin:after { - content: "\e624"; -} -.layui-layer-fast .layui-layer-setwin .layui-layer-close1:after { - content: "\e626"; -} -.layui-layer-fast .layui-layer-setwin .layui-layer-close2, -.layui-layer-fast .layui-layer-setwin .layui-layer-close2:hover { - background: url('../libs/layer/dist/theme/default/icon.png') no-repeat -149px -31px !important; - top: -30px; - right: -30px; -} -.layui-layer-fast .layui-layer-setwin .layui-layer-close2:after, -.layui-layer-fast .layui-layer-setwin .layui-layer-close2:hover:after { - display: none; -} -.n-bootstrap .input-group > .n-right { - position: absolute; -} -/*手机版样式*/ -@media (max-width: 480px) { - .nav-addtabs { - display: none; - } - .fixed-table-toolbar .columns-right.btn-group { - display: none; - } -} -/*平板样式*/ -@media (max-width: 768px) { - .n-bootstrap .n-right { - margin-top: 0; - top: -20px; - position: absolute; - left: 0; - text-align: right; - width: 100%; - } - .n-bootstrap .n-right .msg-wrap { - position: relative; - } - .n-bootstrap .col-xs-12 > .n-right .msg-wrap { - margin-right: 15px; - } -} -/*修复radio和checkbox样式对齐*/ -.radio > label, -.checkbox > label { - margin-right: 10px; -} -.radio > label > input, -.checkbox > label > input { - margin: 2px 0 0; -} -/*# sourceMappingURL=backend.css.map */ \ No newline at end of file +@import url("../css/bootstrap.min.css"); +@import url("../css/fastadmin.min.css"); +@import url("../css/skins/skin-green.css"); +@import url("../css/iconfont.css"); +@import url("../libs/font-awesome/css/font-awesome.min.css"); +@import url("../libs/toastr/toastr.min.css"); +@import url("../libs/layer/dist/theme/default/layer.css"); +@import url("../libs/bootstrap-table/dist/bootstrap-table.min.css"); +@import url("../libs/eonasdan-bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.min.css"); +@import url("../libs/bootstrap-daterangepicker/daterangepicker.css"); +@import url("../libs/nice-validator/dist/jquery.validator.css"); +@import url("../libs/selectpage/selectpage.css"); +body { + background: #f1f4f6; +} +body.is-dialog { + background: #fff; +} +.selection { + position: absolute; + border: 1px solid #8B9; + background-color: #BEC; +} +.main-header .logo, +.main-header .navbar { + -webkit-transition: none; + -moz-transition: none; + -o-transition: none; + transition: none; +} +.main-header .navbar { + position: relative; +} +.main-header .navbar .sidebar-toggle { + position: absolute; + width: 45px; + text-align: center; +} +.main-header .navbar #nav { + position: absolute; + left: 45px; +} +.main-header .navbar .navbar-custom-menu { + position: absolute; + right: 0; +} +.note-dialog .modal { + z-index: 1060; +} +.bootstrap-dialog .modal-dialog { + /*width: 70%;*/ + max-width: 885px; +} +/*iOS兼容*/ +html.ios-fix, +html.ios-fix body { + height: 100%; + overflow: auto; + -webkit-overflow-scrolling: touch; +} +.content { + min-height: 500px; +} +#header { + background: #fff; + box-shadow: 0 2px 2px rgba(0, 0, 0, 0.05), 0 1px 0 rgba(0, 0, 0, 0.05); +} +.content-wrapper { + position: relative; +} +.control-relative { + position: relative; +} +.tab-addtabs { + overflow: hidden; +} +.tab-addtabs .tab-pane { + height: 100%; + width: 100%; +} +.row-between .col-xs-6 + .col-xs-6:before { + content: "-"; + position: absolute; + left: -2%; + top: 6px; +} +@media only screen and (min-width: 481px) { + .row-flex { + display: flex; + flex-wrap: wrap; + } + .row-flex > [class*='col-'] { + display: flex; + flex-direction: column; + } + .row-flex.row:after, + .row-flex.row:before { + display: flex; + } +} +@media (max-width: 991px) { + .main-header .navbar-custom-menu a.btn-danger { + color: #fff; + background-color: #e74c3c; + } + .main-header .navbar-custom-menu a.btn-primary { + color: #fff; + background-color: #2c3e50; + } +} +.common-search-table { + min-height: 20px; + padding: 15px; + margin-bottom: 15px; + background-color: #f5f5f5; +} +.searchit { + border-bottom: 1px dashed #3c8dbc; +} +/* 固定的底部按钮 */ +.fixed-footer { + position: fixed; + bottom: 0; + background-color: #ecf0f1; + width: 100%; + margin-bottom: 0; + padding: 10px; +} +/* 包裹在layer外层 */ +.layer-footer { + display: none; +} +table.table-template { + overflow: hidden; +} +.sp_container .msg-box { + position: absolute; + right: 0; + top: 0; +} +.toast-top-right-index { + top: 62px; + right: 12px; +} +.bootstrap-select .status { + background: #f0f0f0; + clear: both; + color: #999; + font-size: 12px; + font-weight: 500; + line-height: 1; + margin-bottom: -5px; + padding: 10px 20px; +} +.img-center { + margin: 0 auto; + display: inline; + float: none; +} +/* + * RIBBON + */ +#ribbon { + overflow: hidden; + padding: 15px 15px 0 15px; + position: relative; +} +#ribbon a { + color: #777 !important; + text-decoration: none !important; +} +#ribbon .breadcrumb { + display: inline-block; + margin: 0; + padding: 0; + background: none; + vertical-align: top; +} +#ribbon .breadcrumb > .active, +#ribbon .breadcrumb li { + color: #aaa; +} +#ribbon .shortcut a { + margin-left: 10px; +} +.is-dialog #main { + background: #fff; +} +form.form-horizontal .control-label { + font-weight: normal; +} +.user-panel > .image img { + width: 45px; + height: 45px; +} +/*panel扩展描述样式*/ +.panel-intro { + margin-bottom: 0; + border: none; +} +.panel-intro > .panel-heading { + padding: 15px; + padding-bottom: 0; + background: #e8edf0; + border-color: #e8edf0; + position: relative; +} +.panel-intro > .panel-heading .panel-lead { + margin-bottom: 15px; +} +.panel-intro > .panel-heading .panel-lead em { + display: block; + font-weight: bold; + font-style: normal; +} +.panel-intro > .panel-heading .panel-title { + height: 25px; + font-weight: normal; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} +.panel-intro > .panel-heading .panel-control { + height: 42px; + position: absolute; + top: 8px; + right: 8px; +} +.panel-intro > .panel-heading .panel-control .fa { + font-size: 14px; +} +.panel-intro > .panel-heading .nav-tabs { + border-bottom: 0; + margin-bottom: 0; +} +.panel-intro > .panel-heading .nav-tabs > li > a { + margin-right: 4px; + color: #95a5a6; + background-color: #d8e0e6; + border: 1px solid #e8edf0; + border-bottom-color: transparent; +} +.panel-intro > .panel-heading .nav-tabs > li > a:hover, +.panel-intro > .panel-heading .nav-tabs > li > a:focus { + border: 1px solid #e8edf0; + color: #7b8a8b; + background-color: #c9d4dc; +} +.panel-intro > .panel-heading .nav-tabs > li.active > a, +.panel-intro > .panel-heading .nav-tabs > li.active > a:hover, +.panel-intro > .panel-heading .nav-tabs > li.active > a:focus { + color: #7b8a8b; + background-color: #ffffff; + border-bottom-color: transparent; + cursor: default; +} +/*单表格*/ +.panel-tabs .panel-heading { + padding: 12px 15px 12px 15px; +} +.panel-tabs .panel-heading .panel-lead { + margin-bottom: 0px; +} +/*选项卡*/ +.panel-nav .panel-heading { + padding: 0px; + padding-bottom: 0; + background: #f1f4f6; + border-color: #f1f4f6; +} +.panel-nav .nav-tabs > li > a { + padding: 12px 15px; + background-color: #e8edf0; + border: 1px solid #f1f4f6; +} +.panel-nav .nav-tabs > li > a:hover, +.panel-nav .nav-tabs > li > a:focus { + border: 1px solid #e8edf0; + background-color: #e8edf0; +} +.panel-nav .nav-tabs > li.active > a, +.panel-nav .nav-tabs > li.active > a:hover, +.panel-nav .nav-tabs > li.active > a:focus { + border-color: #f1f4f6; + border-bottom-color: transparent; +} +/*顶栏addtabs*/ +.nav-addtabs { + border: none; +} +.nav-addtabs.disable-top-badge > li > a > .pull-right-container { + display: none; +} +.nav-addtabs > li { + margin: 0; +} +.nav-addtabs > li > a { + height: 49px; + line-height: 49px; + padding: 0 15px; + border-radius: 0; + border: none; + border-right: 1px solid rgba(0, 0, 0, 0.05); + margin: 0; + color: #95a5a6; +} +.nav-addtabs > li > a:hover, +.nav-addtabs > li > a:focus { + border: none; + color: #2c3e50; + border-right: 1px solid rgba(0, 0, 0, 0.05); +} +.nav-addtabs > li > a i { + margin-right: 3px; +} +.nav-addtabs > li.active > a { + height: 49px; + line-height: 49px; + padding: 0 15px; + border-radius: 0; + border: none; + border-right: 1px solid rgba(0, 0, 0, 0.05); + background: #f1f4f6; + color: #2c3e50; + overflow: hidden; +} +.nav-addtabs > li.active > a:hover, +.nav-addtabs > li.active > a:focus { + border: none; + color: #2c3e50; + border-right: 1px solid rgba(0, 0, 0, 0.05); + background: #f1f4f6; +} +.nav-addtabs > li .close-tab { + font-size: 10px; + position: absolute; + right: 5px; + top: 50%; + margin-top: -7px; + z-index: 100; + cursor: hand; + cursor: pointer; + color: #fff; + display: none; +} +.nav-addtabs .open > a:hover, +.nav-addtabs .open > a:focus { + border-right: 1px solid rgba(0, 0, 0, 0.05); +} +.nav-addtabs ul li { + position: relative; +} +.nav-addtabs li:hover > .close-tab { + display: block; +} +.main-sidebar .sidebar-form { + overflow: visible; +} +.main-sidebar .sidebar-form .menuresult { + z-index: 999; + position: absolute; + top: 34px; + left: -1px; + width: 100%; + max-height: 250px; + overflow: auto; + margin: 0; + border-top: none; + border-top-left-radius: 0; + border-top-right-radius: 0; +} +.main-sidebar .sidebar-form .menuresult a { + border-top: 1px solid #eee; + background-color: #fff; + border-bottom: 1px solid #eee; + margin-bottom: -1px; + display: block; + padding: 10px 15px; + color: #222d32; +} +.main-sidebar .sidebar-form .menuresult a:hover { + background: #eee; +} +.input-group .sp_result_area { + width: 100%; +} +.sidebar-menu.show-submenu .treeview-menu { + display: block; +} +.sidebar-menu > li .badge { + margin-top: 0; +} +.sidebar-collapse .user-panel > .image img { + width: 25px; + height: 25px; +} +@media (min-width: 768px) { + .sidebar-mini.sidebar-collapse .sidebar-menu > li:hover > .treeview-menu { + top: 41px; + } + .sidebar-mini.sidebar-collapse .sidebar-menu > li:hover > a > .pull-right-container { + top: 7px!important; + height: 17px; + } +} +.fieldlist dd { + display: block; + margin: 5px 0; +} +.fieldlist dd input { + display: inline-block; + width: 300px; +} +.fieldlist dd input:first-child { + width: 110px; +} +.fieldlist dd ins { + width: 110px; + display: inline-block; + text-decoration: none; + font-weight: bold; +} +#treeview .jstree-container-ul .jstree-node { + display: block; + clear: both; +} +#treeview .jstree-leaf:not(:first-child) { + float: left; + background: none; + margin-left: 0; + width: 80px; + clear: none; +} +#treeview .jstree-leaf { + float: left; + margin-left: 0; + padding-left: 24px; + width: 80px; + clear: none; + color: #777; +} +#treeview .jstree-leaf > .jstree-icon, +#treeview .jstree-leaf .jstree-themeicon { + display: none; +} +#treeview .jstree-last { + background-image: url("../img/32px.png"); + background-position: -292px -4px; + background-repeat: repeat-y; +} +#treeview .jstree-children:before, +#treeview .jstree-children:after { + content: " "; + display: table; +} +#treeview .jstree-children:after { + clear: both; +} +#treeview .jstree-themeicon { + display: none; +} +/*去除bootstrap-table的边框*/ +.fixed-table-container { + border: none!important; +} +/*修复nice-validator新版下的一处BUG*/ +.nice-validator input, +.nice-validator select, +.nice-validator textarea, +.nice-validator [contenteditable] { + display: inline-block; + *display: inline; + *zoom: 1; +} +/*修复nice-validator和summernote的编辑框冲突*/ +.nice-validator .note-editor .note-editing-area .note-editable { + display: inherit; +} +/*预览区域*/ +.plupload-preview { + padding: 0 10px; + margin-bottom: 0; +} +.plupload-preview li { + margin-top: 15px; +} +.plupload-preview .thumbnail { + margin-bottom: 10px; +} +.plupload-preview a { + display: block; +} +.plupload-preview a:first-child { + height: 90px; +} +.plupload-preview a img { + height: 80px; + object-fit: cover; +} +.pjax-loader-bar .progress { + position: fixed; + top: 0; + left: 0; + height: 2px; + background: #77b6ff; + box-shadow: 0 0 10px rgba(119, 182, 255, 0.7); + -webkit-transition: width 0.4s ease; + transition: width 0.4s ease; +} +.dropdown-menu.text-left a, +.dropdown-menu.text-left li { + text-align: left!important; +} +.bootstrap-table .fixed-table-toolbar .dropdown-menu { + overflow: auto; +} +.toolbar { + margin-top: 10px; + margin-bottom: 10px; +} +.fixed-table-toolbar .bs-bars, +.fixed-table-toolbar .columns, +.fixed-table-toolbar .search { + line-height: inherit; +} +.fixed-table-toolbar .toolbar { + margin-top: 0; + margin-bottom: 0; +} +.bootstrap-table table tbody tr:first-child td .bs-checkbox { + vertical-align: middle; +} +.bootstrap-table td.bs-checkbox { + vertical-align: middle; +} +.dropdown-submenu { + position: relative; +} +.dropdown-submenu > .dropdown-menu { + overflow: auto; + top: 0; + left: 100%; + margin-top: -6px; + margin-left: -1px; + -webkit-border-radius: 0 6px 6px 6px; + -webkit-background-clip: padding-box; + -moz-border-radius: 0 6px 6px 6px; + -moz-background-clip: padding; + border-radius: 0 6px 6px 6px; + background-clip: padding-box; +} +.dropdown-submenu:hover > .dropdown-menu { + display: block; +} +.dropdown-submenu:hover > a:after { + border-left-color: #fff; +} +.dropdown-submenu > a:after { + display: block; + content: " "; + float: right; + width: 0; + height: 0; + border-color: transparent; + border-style: solid; + border-width: 5px 0 5px 5px; + border-left-color: #ccc; + margin-top: 5px; + margin-right: -10px; +} +.dropdown-submenu.pull-left { + float: none; +} +.dropdown-submenu.pull-left > .dropdown-menu { + left: -100%; + margin-left: 10px; + -webkit-border-radius: 6px 0 6px 6px; + -webkit-background-clip: padding-box; + -moz-border-radius: 6px 0 6px 6px; + -moz-background-clip: padding; + border-radius: 6px 0 6px 6px; + background-clip: padding-box; +} +/*重写toast的几个背景色*/ +.toast-primary { + background-color: #48c9b0!important; +} +.toast-success { + background-color: #18bc9c!important; +} +.toast-error { + background-color: #e74c3c!important; +} +.toast-info { + background-color: #5dade2!important; +} +.toast-warning { + background-color: #f1c40f!important; +} +.toast-inverse { + background-color: #34495e!important; +} +.toast-default { + background-color: #bdc3c7!important; +} +#toast-container > div, +#toast-container > div:hover { + -webkit-box-shadow: 0 0 3px #eee; + -moz-box-shadow: 0 0 3px #eee; + box-shadow: 0 0 3px #eee; +} +.layui-layer-fast { + /*自定义底部灰色操作区*/ +} +.layui-layer-fast .layui-layer-title { + background: #2c3e50!important; + color: #fff!important; + border-bottom: none; +} +.layui-layer-fast .layui-layer-title ~ .layui-layer-setwin { + top: 0px; + height: 42px; +} +.layui-layer-fast .layui-layer-title ~ .layui-layer-setwin > a { + height: 42px; + line-height: 42px; + display: inline-block; +} +.layui-layer-fast.layui-layer-border { + border: none!important; + box-shadow: 1px 1px 50px rgba(0, 0, 0, 0.3) !important; +} +.layui-layer-fast.layui-layer-iframe { + overflow: visible; +} +.layui-layer-fast .layui-layer-moves { + -webkit-box-sizing: content-box; + -moz-box-sizing: content-box; + box-sizing: content-box; +} +.layui-layer-fast .layui-layer-btn { + text-align: center!important; + padding: 10px!important; + background: #ecf0f1; + overflow: hidden; +} +.layui-layer-fast .layui-layer-btn a { + background-color: #95a5a6!important; + border-color: #95a5a6!important; + color: #fff!important; +} +.layui-layer-fast .layui-layer-btn .layui-layer-btn0 { + background-color: #18bc9c!important; + border-color: #18bc9c!important; +} +.layui-layer-fast .layui-layer-footer { + padding: 8px 20px; + background-color: #ecf0f1; + height: auto; + text-align: inherit!important; +} +.layui-layer-fast .layui-layer-setwin > a { + background: none!important; +} +.layui-layer-fast .layui-layer-setwin > a cite { + display: none; +} +.layui-layer-fast .layui-layer-setwin > a:after { + content: "\e625"; + font-family: iconfont; + font-style: normal; + font-weight: normal; + text-decoration: inherit; + position: absolute; + font-size: 18px; + color: #fff; + margin: 0; + z-index: 1; +} +.layui-layer-fast .layui-layer-setwin > a:hover { + text-decoration: none!important; + background: none!important; +} +.layui-layer-fast .layui-layer-setwin > a:focus { + text-decoration: none!important; +} +.layui-layer-fast .layui-layer-setwin .layui-layer-min { + display: none; +} +.layui-layer-fast .layui-layer-setwin .layui-layer-min:after { + content: "\e625"; +} +.layui-layer-fast .layui-layer-setwin .layui-layer-max { + display: none; +} +.layui-layer-fast .layui-layer-setwin .layui-layer-max:after { + content: "\e623"; +} +.layui-layer-fast .layui-layer-setwin .layui-layer-maxmin { + display: none; +} +.layui-layer-fast .layui-layer-setwin .layui-layer-maxmin:after { + content: "\e624"; +} +.layui-layer-fast .layui-layer-setwin .layui-layer-close1:after { + content: "\e626"; +} +.layui-layer-fast .layui-layer-setwin .layui-layer-close2, +.layui-layer-fast .layui-layer-setwin .layui-layer-close2:hover { + background: url('../libs/layer/dist/theme/default/icon.png') no-repeat -149px -31px !important; + top: -30px; + right: -30px; +} +.layui-layer-fast .layui-layer-setwin .layui-layer-close2:after, +.layui-layer-fast .layui-layer-setwin .layui-layer-close2:hover:after { + display: none; +} +.n-bootstrap .input-group > .n-right { + position: absolute; +} +/*手机版样式*/ +@media (max-width: 480px) { + .nav-addtabs { + display: none; + } + .fixed-table-toolbar .columns-right.btn-group { + display: none; + } +} +/*平板样式*/ +@media (max-width: 768px) { + .n-bootstrap .n-right { + margin-top: 0; + top: -20px; + position: absolute; + left: 0; + text-align: right; + width: 100%; + } + .n-bootstrap .n-right .msg-wrap { + position: relative; + } + .n-bootstrap .col-xs-12 > .n-right .msg-wrap { + margin-right: 15px; + } +} +/*修复radio和checkbox样式对齐*/ +.radio > label, +.checkbox > label { + margin-right: 10px; +} +.radio > label > input, +.checkbox > label > input { + margin: 2px 0 0; +} +/*增加对包含data-tips-image的元素鼠标移入时显示放大镜样式*/ +[data-tips-image]{cursor:pointer!important;cursor:-webkit-zoom-in!important;cursor:-moz-zoom-in!important;cursor:zoom-in!important} +/*# sourceMappingURL=backend.css.map */ diff --git a/public/assets/js/backend.js b/public/assets/js/backend.js old mode 100755 new mode 100644 index 0d4bca895f01e0209cc0c6a7b9886e0b26df434e..2b7ecdc4563a21c647d225d61a0e4f9b4b47b371 --- a/public/assets/js/backend.js +++ b/public/assets/js/backend.js @@ -1,234 +1,252 @@ -define(['fast', 'moment'], function (Fast, Moment) { - var Backend = { - api: { - sidebar: function (params) { - colorArr = ['red', 'green', 'yellow', 'blue', 'teal', 'orange', 'purple']; - $colorNums = colorArr.length; - badgeList = {}; - $.each(params, function (k, v) { - $url = Fast.api.fixurl(k); - - if ($.isArray(v)) - { - $nums = typeof v[0] !== 'undefined' ? v[0] : 0; - $color = typeof v[1] !== 'undefined' ? v[1] : colorArr[(!isNaN($nums) ? $nums : $nums.length) % $colorNums]; - $class = typeof v[2] !== 'undefined' ? v[2] : 'label'; - } else - { - $nums = v; - $color = colorArr[(!isNaN($nums) ? $nums : $nums.length) % $colorNums]; - $class = 'label'; - } - //必须nums大于0才显示 - badgeList[$url] = $nums > 0 ? '' + $nums + '' : ''; - }); - $.each(badgeList, function (k, v) { - var anchor = top.window.$("li a[addtabs][url='" + k + "']"); - if (anchor) { - top.window.$(".pull-right-container", anchor).html(v); - top.window.$(".nav-addtabs li a[node-id='" + anchor.attr("addtabs") + "'] .pull-right-container").html(v); - } - }); - }, - addtabs: function (url, title, icon) { - var dom = "a[url='{url}']" - var leftlink = top.window.$(dom.replace(/\{url\}/, url)); - if (leftlink.size() > 0) { - leftlink.trigger("click"); - } else { - url = Fast.api.fixurl(url); - leftlink = top.window.$(dom.replace(/\{url\}/, url)); - if (leftlink.size() > 0) { - var event = leftlink.parent().hasClass("active") ? "dblclick" : "click"; - leftlink.trigger(event); - } else { - var baseurl = url.substr(0, url.indexOf("?") > -1 ? url.indexOf("?") : url.length); - leftlink = top.window.$(dom.replace(/\{url\}/, baseurl)); - //能找到相对地址 - if (leftlink.size() > 0) { - icon = typeof icon !== 'undefined' ? icon : leftlink.find("i").attr("class"); - title = typeof title !== 'undefined' ? title : leftlink.find("span:first").text(); - leftlink.trigger("fa.event.toggleitem"); - } - var navnode = top.window.$(".nav-tabs ul li a[node-url='" + url + "']"); - if (navnode.size() > 0) { - navnode.trigger("click"); - } else { - //追加新的tab - var id = Math.floor(new Date().valueOf() * Math.random()); - icon = typeof icon !== 'undefined' ? icon : 'fa fa-circle-o'; - title = typeof title !== 'undefined' ? title : ''; - top.window.$("").append(' ' + title + '').prop("href", url).attr({url: url, addtabs: id}).addClass("hide").appendTo(top.window.document.body).trigger("click"); - } - } - } - }, - closetabs: function (url) { - if (typeof url === 'undefined') { - top.window.$("ul.nav-addtabs li.active .close-tab").trigger("click"); - } else { - var dom = "a[url='{url}']" - var navlink = top.window.$(dom.replace(/\{url\}/, url)); - if (navlink.size() === 0) { - url = Fast.api.fixurl(url); - navlink = top.window.$(dom.replace(/\{url\}/, url)); - if (navlink.size() === 0) { - } else { - var baseurl = url.substr(0, url.indexOf("?") > -1 ? url.indexOf("?") : url.length); - navlink = top.window.$(dom.replace(/\{url\}/, baseurl)); - //能找到相对地址 - if (navlink.size() === 0) { - navlink = top.window.$(".nav-tabs ul li a[node-url='" + url + "']"); - } - } - } - if (navlink.size() > 0 && navlink.attr('addtabs')) { - top.window.$("ul.nav-addtabs li#tab_" + navlink.attr('addtabs') + " .close-tab").trigger("click"); - } - } - }, - replaceids: function (elem, url) { - //如果有需要替换ids的 - if (url.indexOf("{ids}") > -1) { - var ids = 0; - var tableId = $(elem).data("table-id"); - if (tableId && $(tableId).size() > 0 && $(tableId).data("bootstrap.table")) { - var Table = require("table"); - ids = Table.api.selectedids($(tableId)).join(","); - } - url = url.replace(/\{ids\}/g, ids); - } - return url; - } - }, - init: function () { - //公共代码 - //添加ios-fix兼容iOS下的iframe - if (/iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream) { - $("html").addClass("ios-fix"); - } - //配置Toastr的参数 - Toastr.options.positionClass = Config.controllername === 'index' ? "toast-top-right-index" : "toast-top-right"; - //点击包含.btn-dialog的元素时弹出dialog - $(document).on('click', '.btn-dialog,.dialogit', function (e) { - var that = this; - var options = $.extend({}, $(that).data() || {}); - if (typeof options.tableId !== 'undefined' && typeof options.fieldIndex !== 'undefined' && typeof options.buttonIndex !== 'undefined') { - var tableOptions = $("#" + options.tableId).bootstrapTable('getOptions'); - if (tableOptions) { - var columnObj = null; - $.each(tableOptions.columns, function (i, columns) { - $.each(columns, function (j, column) { - if (typeof column.fieldIndex !== 'undefined' && column.fieldIndex === options.fieldIndex) { - columnObj = column; - return false; - } - }); - if (columnObj) { - return false; - } - }); - if (columnObj) { - var button = columnObj['buttons'][options.buttonIndex]; - if (button && typeof button.callback === 'function') { - options.callback = button.callback; - } - } - } - } - if (typeof options.confirm !== 'undefined') { - Layer.confirm(options.confirm, function (index) { - Backend.api.open(Backend.api.replaceids(that, $(that).attr('href')), $(that).attr('title'), options); - Layer.close(index); - }); - } else { - Backend.api.open(Backend.api.replaceids(that, $(that).attr('href')), $(that).attr('title'), options); - } - return false; - }); - //点击包含.btn-addtabs的元素时新增选项卡 - $(document).on('click', '.btn-addtabs,.addtabsit', function (e) { - var that = this; - var options = $.extend({}, $(that).data() || {}); - if (typeof options.confirm !== 'undefined') { - Layer.confirm(options.confirm, function (index) { - Backend.api.addtabs(Backend.api.replaceids(that, $(that).attr('href')), $(that).attr("title")); - Layer.close(index); - }); - } else { - Backend.api.addtabs(Backend.api.replaceids(that, $(that).attr('href')), $(that).attr("title")); - } - - return false; - }); - //点击包含.btn-ajax的元素时发送Ajax请求 - $(document).on('click', '.btn-ajax,.ajaxit', function (e) { - var that = this; - var options = $.extend({}, $(that).data() || {}); - if (typeof options.url === 'undefined' && $(that).attr("href")) { - options.url = $(that).attr("href"); - } - options.url = Backend.api.replaceids(this, options.url); - var success = typeof options.success === 'function' ? options.success : null; - var error = typeof options.error === 'function' ? options.error : null; - delete options.success; - delete options.error; - if (typeof options.tableId !== 'undefined' && typeof options.fieldIndex !== 'undefined' && typeof options.buttonIndex !== 'undefined') { - var tableOptions = $("#" + options.tableId).bootstrapTable('getOptions'); - if (tableOptions) { - var columnObj = null; - $.each(tableOptions.columns, function (i, columns) { - $.each(columns, function (j, column) { - if (typeof column.fieldIndex !== 'undefined' && column.fieldIndex === options.fieldIndex) { - columnObj = column; - return false; - } - }); - if (columnObj) { - return false; - } - }); - if (columnObj) { - var button = columnObj['buttons'][options.buttonIndex]; - if (button && typeof button.success === 'function') { - success = button.success; - } - if (button && typeof button.error === 'function') { - error = button.error; - } - } - } - } - //如果未设备成功的回调,设定了自动刷新的情况下自动进行刷新 - if (!success && typeof options.tableId !== 'undefined' && typeof options.refresh !== 'undefined' && options.refresh) { - $("#" + options.tableId).bootstrapTable('refresh'); - } - if (typeof options.confirm !== 'undefined') { - Layer.confirm(options.confirm, function (index) { - Backend.api.ajax(options, success, error); - Layer.close(index); - }); - } else { - Backend.api.ajax(options, success, error); - } - return false; - }); - //修复含有fixed-footer类的body边距 - if ($(".fixed-footer").size() > 0) { - $(document.body).css("padding-bottom", $(".fixed-footer").outerHeight()); - } - //修复不在iframe时layer-footer隐藏的问题 - if ($(".layer-footer").size() > 0 && self === top) { - $(".layer-footer").show(); - } - } - }; - Backend.api = $.extend(Fast.api, Backend.api); - //将Moment渲染至全局,以便于在子框架中调用 - window.Moment = Moment; - //将Backend渲染至全局,以便于在子框架中调用 - window.Backend = Backend; - - Backend.init(); - return Backend; -}); \ No newline at end of file +define(['fast', 'moment'], function (Fast, Moment) { + var Backend = { + api: { + sidebar: function (params) { + colorArr = ['red', 'green', 'yellow', 'blue', 'teal', 'orange', 'purple']; + $colorNums = colorArr.length; + badgeList = {}; + $.each(params, function (k, v) { + $url = Fast.api.fixurl(k); + + if ($.isArray(v)) + { + $nums = typeof v[0] !== 'undefined' ? v[0] : 0; + $color = typeof v[1] !== 'undefined' ? v[1] : colorArr[(!isNaN($nums) ? $nums : $nums.length) % $colorNums]; + $class = typeof v[2] !== 'undefined' ? v[2] : 'label'; + } else + { + $nums = v; + $color = colorArr[(!isNaN($nums) ? $nums : $nums.length) % $colorNums]; + $class = 'label'; + } + //必须nums大于0才显示 + badgeList[$url] = $nums > 0 ? '' + $nums + '' : ''; + }); + $.each(badgeList, function (k, v) { + var anchor = top.window.$("li a[addtabs][url='" + k + "']"); + if (anchor) { + top.window.$(".pull-right-container", anchor).html(v); + top.window.$(".nav-addtabs li a[node-id='" + anchor.attr("addtabs") + "'] .pull-right-container").html(v); + } + }); + }, + addtabs: function (url, title, icon) { + var dom = "a[url='{url}']" + var leftlink = top.window.$(dom.replace(/\{url\}/, url)); + if (leftlink.size() > 0) { + leftlink.trigger("click"); + } else { + url = Fast.api.fixurl(url); + leftlink = top.window.$(dom.replace(/\{url\}/, url)); + if (leftlink.size() > 0) { + var event = leftlink.parent().hasClass("active") ? "dblclick" : "click"; + leftlink.trigger(event); + } else { + var baseurl = url.substr(0, url.indexOf("?") > -1 ? url.indexOf("?") : url.length); + leftlink = top.window.$(dom.replace(/\{url\}/, baseurl)); + //能找到相对地址 + if (leftlink.size() > 0) { + icon = typeof icon !== 'undefined' ? icon : leftlink.find("i").attr("class"); + title = typeof title !== 'undefined' ? title : leftlink.find("span:first").text(); + leftlink.trigger("fa.event.toggleitem"); + } + var navnode = top.window.$(".nav-tabs ul li a[node-url='" + url + "']"); + if (navnode.size() > 0) { + navnode.trigger("click"); + } else { + //追加新的tab + var id = Math.floor(new Date().valueOf() * Math.random()); + icon = typeof icon !== 'undefined' ? icon : 'fa fa-circle-o'; + title = typeof title !== 'undefined' ? title : ''; + top.window.$("").append(' ' + title + '').prop("href", url).attr({url: url, addtabs: id}).addClass("hide").appendTo(top.window.document.body).trigger("click"); + } + } + } + }, + closetabs: function (url) { + if (typeof url === 'undefined') { + top.window.$("ul.nav-addtabs li.active .close-tab").trigger("click"); + } else { + var dom = "a[url='{url}']" + var navlink = top.window.$(dom.replace(/\{url\}/, url)); + if (navlink.size() === 0) { + url = Fast.api.fixurl(url); + navlink = top.window.$(dom.replace(/\{url\}/, url)); + if (navlink.size() === 0) { + } else { + var baseurl = url.substr(0, url.indexOf("?") > -1 ? url.indexOf("?") : url.length); + navlink = top.window.$(dom.replace(/\{url\}/, baseurl)); + //能找到相对地址 + if (navlink.size() === 0) { + navlink = top.window.$(".nav-tabs ul li a[node-url='" + url + "']"); + } + } + } + if (navlink.size() > 0 && navlink.attr('addtabs')) { + top.window.$("ul.nav-addtabs li#tab_" + navlink.attr('addtabs') + " .close-tab").trigger("click"); + } + } + }, + replaceids: function (elem, url) { + //如果有需要替换ids的 + if (url.indexOf("{ids}") > -1) { + var ids = 0; + var tableId = $(elem).data("table-id"); + if (tableId && $(tableId).size() > 0 && $(tableId).data("bootstrap.table")) { + var Table = require("table"); + ids = Table.api.selectedids($(tableId)).join(","); + } + url = url.replace(/\{ids\}/g, ids); + } + return url; + } + }, + init: function () { + //公共代码 + //添加ios-fix兼容iOS下的iframe + if (/iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream) { + $("html").addClass("ios-fix"); + } + //配置Toastr的参数 + Toastr.options.positionClass = Config.controllername === 'index' ? "toast-top-right-index" : "toast-top-right"; + //点击包含.btn-dialog的元素时弹出dialog + $(document).on('click', '.btn-dialog,.dialogit', function (e) { + var that = this; + var options = $.extend({}, $(that).data() || {}); + if (typeof options.tableId !== 'undefined' && typeof options.fieldIndex !== 'undefined' && typeof options.buttonIndex !== 'undefined') { + var tableOptions = $("#" + options.tableId).bootstrapTable('getOptions'); + if (tableOptions) { + var columnObj = null; + $.each(tableOptions.columns, function (i, columns) { + $.each(columns, function (j, column) { + if (typeof column.fieldIndex !== 'undefined' && column.fieldIndex === options.fieldIndex) { + columnObj = column; + return false; + } + }); + if (columnObj) { + return false; + } + }); + if (columnObj) { + var button = columnObj['buttons'][options.buttonIndex]; + if (button && typeof button.callback === 'function') { + options.callback = button.callback; + } + } + } + } + if (typeof options.confirm !== 'undefined') { + Layer.confirm(options.confirm, function (index) { + Backend.api.open(Backend.api.replaceids(that, $(that).attr('href')), $(that).attr('title'), options); + Layer.close(index); + }); + } else { + Backend.api.open(Backend.api.replaceids(that, $(that).attr('href')), $(that).attr('title'), options); + } + return false; + }); + //点击包含.btn-addtabs的元素时新增选项卡 + $(document).on('click', '.btn-addtabs,.addtabsit', function (e) { + var that = this; + var options = $.extend({}, $(that).data() || {}); + if (typeof options.confirm !== 'undefined') { + Layer.confirm(options.confirm, function (index) { + Backend.api.addtabs(Backend.api.replaceids(that, $(that).attr('href')), $(that).attr("title")); + Layer.close(index); + }); + } else { + Backend.api.addtabs(Backend.api.replaceids(that, $(that).attr('href')), $(that).attr("title")); + } + + return false; + }); + //点击包含.btn-ajax的元素时发送Ajax请求 + $(document).on('click', '.btn-ajax,.ajaxit', function (e) { + var that = this; + var options = $.extend({}, $(that).data() || {}); + if (typeof options.url === 'undefined' && $(that).attr("href")) { + options.url = $(that).attr("href"); + } + options.url = Backend.api.replaceids(this, options.url); + var success = typeof options.success === 'function' ? options.success : null; + var error = typeof options.error === 'function' ? options.error : null; + delete options.success; + delete options.error; + if (typeof options.tableId !== 'undefined' && typeof options.fieldIndex !== 'undefined' && typeof options.buttonIndex !== 'undefined') { + var tableOptions = $("#" + options.tableId).bootstrapTable('getOptions'); + if (tableOptions) { + var columnObj = null; + $.each(tableOptions.columns, function (i, columns) { + $.each(columns, function (j, column) { + if (typeof column.fieldIndex !== 'undefined' && column.fieldIndex === options.fieldIndex) { + columnObj = column; + return false; + } + }); + if (columnObj) { + return false; + } + }); + if (columnObj) { + var button = columnObj['buttons'][options.buttonIndex]; + if (button && typeof button.success === 'function') { + success = button.success; + } + if (button && typeof button.error === 'function') { + error = button.error; + } + } + } + } + //如果未设备成功的回调,设定了自动刷新的情况下自动进行刷新 + if (!success && typeof options.tableId !== 'undefined' && typeof options.refresh !== 'undefined' && options.refresh) { + $("#" + options.tableId).bootstrapTable('refresh'); + } + if (typeof options.confirm !== 'undefined') { + Layer.confirm(options.confirm, function (index) { + Backend.api.ajax(options, success, error); + Layer.close(index); + }); + } else { + Backend.api.ajax(options, success, error); + } + return false; + }); + //修复含有fixed-footer类的body边距 + if ($(".fixed-footer").size() > 0) { + $(document.body).css("padding-bottom", $(".fixed-footer").outerHeight()); + } + //修复不在iframe时layer-footer隐藏的问题 + if ($(".layer-footer").size() > 0 && self === top) { + $(".layer-footer").show(); + } + //点击包含data-tips-image的元素弹出预览图片,在需要使用的img元素增加 data-tips-image="图片地址" 即可 + $(document).on('click', '[data-tips-image]', function () { + var img = new Image(), src = this.getAttribute('data-tips-image') || this.src; + var imgWidth = this.getAttribute('data-width') || '480px'; + img.onload = function () { + var $content = $(img).appendTo('body').css({background: '#fff', width: imgWidth, height: 'auto'}); + layer.open({type: 1, area: imgWidth, title: false, closeBtn: 1, skin: 'layui-layer-nobg', shadeClose: true, content: $content, end: function () { + $(img).remove(); + } + }); + }; + img.src = src; + }); + //鼠标移入包含data-tips-text的元素触发tips提示,在需要使用的元素增加 data-tips-text="提示文字" 即可 + $(document).on('mouseenter', '[data-tips-text]', function () { + var text = $(this).attr('data-tips-text'), placement = $(this).attr('data-tips-placement') || 'auto'; + $(this).tooltip({title: text, placement: placement}).tooltip('show'); + }); + } + }; + Backend.api = $.extend(Fast.api, Backend.api); + //将Moment渲染至全局,以便于在子框架中调用 + window.Moment = Moment; + //将Backend渲染至全局,以便于在子框架中调用 + window.Backend = Backend; + + Backend.init(); + return Backend; +}); diff --git a/public/assets/js/require-table.js b/public/assets/js/require-table.js index e740da56860f69d5a2a9d7199747bc406ca00cd6..feaf380aa62e8d36b290bce62e1638e0640c6a68 100644 --- a/public/assets/js/require-table.js +++ b/public/assets/js/require-table.js @@ -1,524 +1,524 @@ -define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table', 'bootstrap-table-lang', 'bootstrap-table-mobile', 'bootstrap-table-export', 'bootstrap-table-commonsearch', 'bootstrap-table-template'], function ($, undefined, Moment) { - var Table = { - list: {}, - // Bootstrap-table 基础配置 - defaults: { - url: '', - sidePagination: 'server', - method: 'get', //请求方法 - toolbar: ".toolbar", //工具栏 - search: true, //是否启用快速搜索 - cache: false, - commonSearch: true, //是否启用通用搜索 - searchFormVisible: false, //是否始终显示搜索表单 - titleForm: '', //为空则不显示标题,不定义默认显示:普通搜索 - idTable: 'commonTable', - showExport: true, - exportDataType: "all", - exportTypes: ['json', 'xml', 'csv', 'txt', 'doc', 'excel'], - pageSize: 10, - pageList: [10, 25, 50, 'All'], - pagination: true, - clickToSelect: true, //是否启用点击选中 - singleSelect: false, //是否启用单选 - showRefresh: false, - locale: 'zh-CN', - showToggle: true, - showColumns: true, - pk: 'id', - sortName: 'id', - sortOrder: 'desc', - paginationFirstText: __("First"), - paginationPreText: __("Previous"), - paginationNextText: __("Next"), - paginationLastText: __("Last"), - mobileResponsive: true, //是否自适应移动端 - cardView: false, //卡片视图 - checkOnInit: true, //是否在初始化时判断 - escape: true, //是否对内容进行转义 - extend: { - index_url: '', - add_url: '', - edit_url: '', - del_url: '', - import_url: '', - multi_url: '', - dragsort_url: 'ajax/weigh', - } - }, - // Bootstrap-table 列配置 - columnDefaults: { - align: 'center', - valign: 'middle', - }, - config: { - firsttd: 'tbody tr td:first-child:not(:has(div.card-views))', - toolbar: '.toolbar', - refreshbtn: '.btn-refresh', - addbtn: '.btn-add', - editbtn: '.btn-edit', - delbtn: '.btn-del', - importbtn: '.btn-import', - multibtn: '.btn-multi', - disabledbtn: '.btn-disabled', - editonebtn: '.btn-editone', - dragsortfield: 'weigh', - }, - api: { - init: function (defaults, columnDefaults, locales) { - defaults = defaults ? defaults : {}; - columnDefaults = columnDefaults ? columnDefaults : {}; - locales = locales ? locales : {}; - // 写入bootstrap-table默认配置 - $.extend(true, $.fn.bootstrapTable.defaults, Table.defaults, defaults); - // 写入bootstrap-table column配置 - $.extend($.fn.bootstrapTable.columnDefaults, Table.columnDefaults, columnDefaults); - // 写入bootstrap-table locale配置 - $.extend($.fn.bootstrapTable.locales[Table.defaults.locale], { - formatCommonSearch: function () { - return __('Common search'); - }, - formatCommonSubmitButton: function () { - return __('Submit'); - }, - formatCommonResetButton: function () { - return __('Reset'); - }, - formatCommonCloseButton: function () { - return __('Close'); - }, - formatCommonChoose: function () { - return __('Choose'); - } - }, locales); - }, - // 绑定事件 - bindevent: function (table) { - //Bootstrap-table的父元素,包含table,toolbar,pagnation - var parenttable = table.closest('.bootstrap-table'); - //Bootstrap-table配置 - var options = table.bootstrapTable('getOptions'); - //Bootstrap操作区 - var toolbar = $(options.toolbar, parenttable); - //当刷新表格时 - table.on('load-error.bs.table', function (status, res, e) { - if (e.status === 0) { - return; - } - Toastr.error(__('Unknown data format')); - }); - //当刷新表格时 - table.on('refresh.bs.table', function (e, settings, data) { - $(Table.config.refreshbtn, toolbar).find(".fa").addClass("fa-spin"); - }); - //当双击单元格时 - table.on('dbl-click-row.bs.table', function (e, row, element, field) { - $(Table.config.editonebtn, element).trigger("click"); - }); - //当内容渲染完成后 - table.on('post-body.bs.table', function (e, settings, json, xhr) { - $(Table.config.refreshbtn, toolbar).find(".fa").removeClass("fa-spin"); - $(Table.config.disabledbtn, toolbar).toggleClass('disabled', true); - if ($(Table.config.firsttd, table).find("input[type='checkbox'][data-index]").size() > 0) { - // 挺拽选择,需要重新绑定事件 - require(['drag', 'drop'], function () { - $(Table.config.firsttd, table).drag("start", function (ev, dd) { - return $('
').css('opacity', .65).appendTo(document.body); - }).drag(function (ev, dd) { - $(dd.proxy).css({ - top: Math.min(ev.pageY, dd.startY), - left: Math.min(ev.pageX, dd.startX), - height: Math.abs(ev.pageY - dd.startY), - width: Math.abs(ev.pageX - dd.startX) - }); - }).drag("end", function (ev, dd) { - $(dd.proxy).remove(); - }); - $(Table.config.firsttd, table).drop("start", function () { - Table.api.toggleattr(this); - }).drop(function () { - Table.api.toggleattr(this); - }).drop("end", function () { - Table.api.toggleattr(this); - }); - $.drop({ - multi: true - }); - }); - } - }); - // 处理选中筛选框后按钮的状态统一变更 - table.on('check.bs.table uncheck.bs.table check-all.bs.table uncheck-all.bs.table fa.event.check', function () { - var ids = Table.api.selectedids(table); - $(Table.config.disabledbtn, toolbar).toggleClass('disabled', !ids.length); - }); - // 刷新按钮事件 - $(toolbar).on('click', Table.config.refreshbtn, function () { - table.bootstrapTable('refresh'); - }); - // 添加按钮事件 - $(toolbar).on('click', Table.config.addbtn, function () { - var ids = Table.api.selectedids(table); - var url = options.extend.add_url; - if (url.indexOf("{ids}") !== -1) { - url = Table.api.replaceurl(url, {ids: ids.length > 0 ? ids.join(",") : 0}, table); - } - Fast.api.open(url, __('Add'), $(this).data() || {}); - }); - // 导入按钮事件 - if ($(Table.config.importbtn, toolbar).size() > 0) { - require(['upload'], function (Upload) { - Upload.api.plupload($(Table.config.importbtn, toolbar), function (data, ret) { - Fast.api.ajax({ - url: options.extend.import_url, - data: {file: data.url}, - }, function () { - table.bootstrapTable('refresh'); - }); - }); - }); - } - // 批量编辑按钮事件 - $(toolbar).on('click', Table.config.editbtn, function () { - var that = this; - //循环弹出多个编辑框 - $.each(table.bootstrapTable('getSelections'), function (index, row) { - var url = options.extend.edit_url; - row = $.extend({}, row ? row : {}, {ids: row[options.pk]}); - var url = Table.api.replaceurl(url, row, table); - Fast.api.open(url, __('Edit'), $(that).data() || {}); - }); - }); - // 批量操作按钮事件 - $(toolbar).on('click', Table.config.multibtn, function () { - var ids = Table.api.selectedids(table); - Table.api.multi($(this).data("action"), ids, table, this); - }); - // 批量删除按钮事件 - $(toolbar).on('click', Table.config.delbtn, function () { - var that = this; - var ids = Table.api.selectedids(table); - Layer.confirm( - __('Are you sure you want to delete the %s selected item?', ids.length), - {icon: 3, title: __('Warning'), offset: 0, shadeClose: true}, - function (index) { - Table.api.multi("del", ids, table, that); - Layer.close(index); - } - ); - }); - // 拖拽排序 - require(['dragsort'], function () { - //绑定拖动排序 - $("tbody", table).dragsort({ - itemSelector: 'tr:visible', - dragSelector: "a.btn-dragsort", - dragEnd: function () { - var data = table.bootstrapTable('getData'); - var current = data[parseInt($(this).data("index"))]; - var options = table.bootstrapTable('getOptions'); - //改变的值和改变的ID集合 - var ids = $.map($("tbody tr:visible", table), function (tr) { - return data[parseInt($(tr).data("index"))][options.pk]; - }); - var changeid = current[options.pk]; - var pid = typeof current.pid != 'undefined' ? current.pid : ''; - var params = { - url: table.bootstrapTable('getOptions').extend.dragsort_url, - data: { - ids: ids.join(','), - changeid: changeid, - pid: pid, - field: Table.config.dragsortfield, - orderway: options.sortOrder, - table: options.extend.table - } - }; - Fast.api.ajax(params, function (data) { - table.bootstrapTable('refresh'); - }); - }, - placeHolderTemplate: "" - }); - }); - $(table).on("click", "input[data-id][name='checkbox']", function (e) { - table.trigger('fa.event.check'); - }); - $(table).on("click", "[data-id].btn-change", function (e) { - e.preventDefault(); - Table.api.multi($(this).data("action") ? $(this).data("action") : '', [$(this).data("id")], table, this); - }); - $(table).on("click", "[data-id].btn-edit", function (e) { - e.preventDefault(); - var ids = $(this).data("id"); - var row = {}; - var options = table.bootstrapTable("getOptions"); - $.each(table.bootstrapTable('getData'), function (i, j) { - if (j[options.pk] == ids) { - row = j; - return false; - } - }); - row.ids = ids; - var url = Table.api.replaceurl(options.extend.edit_url, row, table); - Fast.api.open(url, __('Edit'), $(this).data() || {}); - }); - $(table).on("click", "[data-id].btn-del", function (e) { - e.preventDefault(); - var id = $(this).data("id"); - var that = this; - Layer.confirm( - __('Are you sure you want to delete this item?'), - {icon: 3, title: __('Warning'), shadeClose: true}, - function (index) { - Table.api.multi("del", id, table, that); - Layer.close(index); - } - ); - }); - var id = table.attr("id"); - Table.list[id] = table; - return table; - }, - // 批量操作请求 - multi: function (action, ids, table, element) { - var options = table.bootstrapTable('getOptions'); - var data = element ? $(element).data() : {}; - var ids = ($.isArray(ids) ? ids.join(",") : ids); - var url = typeof data.url !== "undefined" ? data.url : (action == "del" ? options.extend.del_url : options.extend.multi_url); - url = this.replaceurl(url, {ids: ids}, table); - var params = typeof data.params !== "undefined" ? (typeof data.params == 'object' ? $.param(data.params) : data.params) : ''; - var options = {url: url, data: {action: action, ids: ids, params: params}}; - Fast.api.ajax(options, function (data) { - table.bootstrapTable('refresh'); - }); - }, - // 单元格元素事件 - events: { - operate: { - 'click .btn-editone': function (e, value, row, index) { - e.stopPropagation(); - e.preventDefault(); - var table = $(this).closest('table'); - var options = table.bootstrapTable('getOptions'); - var ids = row[options.pk]; - row = $.extend({}, row ? row : {}, {ids: ids}); - var url = options.extend.edit_url; - Fast.api.open(Table.api.replaceurl(url, row, table), __('Edit'), $(this).data() || {}); - }, - 'click .btn-delone': function (e, value, row, index) { - e.stopPropagation(); - e.preventDefault(); - var that = this; - var top = $(that).offset().top - $(window).scrollTop(); - var left = $(that).offset().left - $(window).scrollLeft() - 260; - if (top + 154 > $(window).height()) { - top = top - 154; - } - if ($(window).width() < 480) { - top = left = undefined; - } - Layer.confirm( - __('Are you sure you want to delete this item?'), - {icon: 3, title: __('Warning'), offset: [top, left], shadeClose: true}, - function (index) { - var table = $(that).closest('table'); - var options = table.bootstrapTable('getOptions'); - Table.api.multi("del", row[options.pk], table, that); - Layer.close(index); - } - ); - } - } - }, - // 单元格数据格式化 - formatter: { - icon: function (value, row, index) { - if (!value) - return ''; - value = value.indexOf(" ") > -1 ? value : "fa fa-" + value; - //渲染fontawesome图标 - return ' ' + value; - }, - image: function (value, row, index) { - value = value ? value : '/assets/img/blank.gif'; - var classname = typeof this.classname !== 'undefined' ? this.classname : 'img-sm img-center'; - return '