From 6e408fb2d13d22d8fc76d14dafaa0974fe2d7788 Mon Sep 17 00:00:00 2001 From: Karson Date: Sun, 13 May 2018 15:46:11 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E4=BA=8C=E7=BA=A7=E8=8F=9C?= =?UTF-8?q?=E5=8D=95,=E5=8F=AF=E5=9C=A8config.php=E4=B8=AD=E5=BC=80?= =?UTF-8?q?=E5=90=AF=E6=88=96=E5=85=B3=E9=97=AD=20=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E6=B8=B2=E6=9F=93=E7=8A=B6=E6=80=81=E6=97=B6=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E5=8C=B9=E9=85=8D=20=E4=BC=98=E5=8C=96=E6=B8=B2=E6=9F=93?= =?UTF-8?q?=E5=9B=BE=E7=89=87=E6=97=B6=E7=82=B9=E5=87=BB=E6=89=93=E5=BC=80?= =?UTF-8?q?=20=E4=BF=AE=E5=A4=8D=E6=B8=B2=E6=9F=93=E6=97=A5=E6=9C=9F?= =?UTF-8?q?=E6=97=B6=E9=9D=9E=E6=95=B4=E5=9E=8B=E5=AD=97=E6=AE=B5=E7=9A=84?= =?UTF-8?q?BUG=20=E4=BC=98=E5=8C=96=E9=80=9A=E7=94=A8=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=20=E4=BC=98=E5=8C=96=E5=90=8E=E5=8F=B0?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E5=9F=BA=E7=A1=80=E5=A4=A7=E5=B0=8F=E4=B8=BA?= =?UTF-8?q?13px?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/controller/Index.php | 37 +- application/admin/library/Auth.php | 172 +- application/admin/view/common/header.html | 250 +-- application/admin/view/common/menu.html | 24 +- application/admin/view/index/index.html | 22 +- application/admin/view/layout/default.html | 2 +- application/config.php | 2 + bower.json | 3 - public/assets/css/backend.css | 265 ++- public/assets/css/backend.min.css | 2 +- public/assets/js/adminlte.js | 2 +- public/assets/js/backend/index.js | 90 +- .../assets/js/bootstrap-table-commonsearch.js | 15 +- public/assets/js/require-backend.js | 12 +- public/assets/js/require-backend.min.js | 591 ++++--- public/assets/js/require-frontend.js | 4 +- public/assets/js/require-frontend.min.js | 4 +- public/assets/js/require-table.js | 18 +- public/assets/less/backend.less | 1570 ++++++++++------- 19 files changed, 1821 insertions(+), 1264 deletions(-) diff --git a/application/admin/controller/Index.php b/application/admin/controller/Index.php index cd05cf64..da62b6c7 100644 --- a/application/admin/controller/Index.php +++ b/application/admin/controller/Index.php @@ -30,21 +30,20 @@ class Index extends Backend public function index() { //左侧菜单 - $menulist = $this->auth->getSidebar([ + list($menulist, $navlist) = $this->auth->getSidebar([ 'dashboard' => 'hot', 'addon' => ['new', 'red', 'badge'], 'auth/rule' => __('Menu'), 'general' => ['new', 'purple'], - ], $this->view->site['fixedpage']); + ], $this->view->site['fixedpage']); $action = $this->request->request('action'); - if ($this->request->isPost()) - { - if ($action == 'refreshmenu') - { - $this->success('', null, ['menulist' => $menulist]); + if ($this->request->isPost()) { + if ($action == 'refreshmenu') { + $this->success('', null, ['menulist' => $menulist, 'navlist' => $navlist]); } } $this->view->assign('menulist', $menulist); + $this->view->assign('navlist', $navlist); $this->view->assign('title', __('Home')); return $this->view->fetch(); } @@ -55,12 +54,10 @@ class Index extends Backend public function login() { $url = $this->request->get('url', 'index/index'); - if ($this->auth->isLogin()) - { + if ($this->auth->isLogin()) { $this->success(__("You've logged in, do not login again"), $url); } - if ($this->request->isPost()) - { + if ($this->request->isPost()) { $username = $this->request->post('username'); $password = $this->request->post('password'); $keeplogin = $this->request->post('keeplogin'); @@ -75,26 +72,21 @@ class Index extends Backend 'password' => $password, '__token__' => $token, ]; - if (Config::get('fastadmin.login_captcha')) - { + if (Config::get('fastadmin.login_captcha')) { $rule['captcha'] = 'require|captcha'; $data['captcha'] = $this->request->post('captcha'); } $validate = new Validate($rule, [], ['username' => __('Username'), 'password' => __('Password'), 'captcha' => __('Captcha')]); $result = $validate->check($data); - if (!$result) - { + if (!$result) { $this->error($validate->getError(), $url, ['token' => $this->request->token()]); } AdminLog::setTitle(__('Login')); $result = $this->auth->login($username, $password, $keeplogin ? 86400 : 0); - if ($result === true) - { + if ($result === true) { Hook::listen("admin_login_after", $this->request); $this->success(__('Login successful'), $url, ['url' => $url, 'id' => $this->auth->id, 'username' => $username, 'avatar' => $this->auth->avatar]); - } - else - { + } else { $msg = $this->auth->getError(); $msg = $msg ? $msg : __('Username or password is incorrect'); $this->error($msg, $url, ['token' => $this->request->token()]); @@ -102,12 +94,11 @@ class Index extends Backend } // 根据客户端的cookie,判断是否可以自动登录 - if ($this->auth->autologin()) - { + if ($this->auth->autologin()) { $this->redirect($url); } $background = Config::get('fastadmin.login_background'); - $background = stripos($background, 'http')===0 ? $background : config('site.cdnurl') . $background; + $background = stripos($background, 'http') === 0 ? $background : config('site.cdnurl') . $background; $this->view->assign('background', $background); $this->view->assign('title', __('Login')); Hook::listen("admin_login_init", $this->request); diff --git a/application/admin/library/Auth.php b/application/admin/library/Auth.php index c0836adb..997afcef 100644 --- a/application/admin/library/Auth.php +++ b/application/admin/library/Auth.php @@ -31,26 +31,23 @@ class Auth extends \fast\Auth /** * 管理员登录 * - * @param string $username 用户名 - * @param string $password 密码 - * @param int $keeptime 有效时长 + * @param string $username 用户名 + * @param string $password 密码 + * @param int $keeptime 有效时长 * @return boolean */ public function login($username, $password, $keeptime = 0) { $admin = Admin::get(['username' => $username]); - if (!$admin) - { + if (!$admin) { $this->setError('Username is incorrect'); return false; } - if (Config::get('fastadmin.login_failure_retry') && $admin->loginfailure >= 10 && time() - $admin->updatetime < 86400) - { + if (Config::get('fastadmin.login_failure_retry') && $admin->loginfailure >= 10 && time() - $admin->updatetime < 86400) { $this->setError('Please try again after 1 day'); return false; } - if ($admin->password != md5(md5($password) . $admin->salt)) - { + if ($admin->password != md5(md5($password) . $admin->salt)) { $admin->loginfailure++; $admin->save(); $this->setError('Password is incorrect'); @@ -71,8 +68,7 @@ class Auth extends \fast\Auth public function logout() { $admin = Admin::get(intval($this->id)); - if (!$admin) - { + if (!$admin) { return true; } $admin->token = ''; @@ -89,30 +85,24 @@ class Auth extends \fast\Auth public function autologin() { $keeplogin = Cookie::get('keeplogin'); - if (!$keeplogin) - { + if (!$keeplogin) { return false; } list($id, $keeptime, $expiretime, $key) = explode('|', $keeplogin); - if ($id && $keeptime && $expiretime && $key && $expiretime > time()) - { + if ($id && $keeptime && $expiretime && $key && $expiretime > time()) { $admin = Admin::get($id); - if (!$admin || !$admin->token) - { + if (!$admin || !$admin->token) { return false; } //token有变更 - if ($key != md5(md5($id) . md5($keeptime) . md5($expiretime) . $admin->token)) - { + if ($key != md5(md5($id) . md5($keeptime) . md5($expiretime) . $admin->token)) { return false; } Session::set("admin", $admin->toArray()); //刷新自动登录的时效 $this->keeplogin($keeptime); return true; - } - else - { + } else { return false; } } @@ -120,13 +110,12 @@ class Auth extends \fast\Auth /** * 刷新保持登录的Cookie * - * @param int $keeptime + * @param int $keeptime * @return boolean */ protected function keeplogin($keeptime = 0) { - if ($keeptime) - { + if ($keeptime) { $expiretime = time() + $keeptime; $key = md5(md5($this->id) . md5($keeptime) . md5($expiretime) . $this->token); $data = [$this->id, $keeptime, $expiretime, $key]; @@ -150,15 +139,13 @@ class Auth extends \fast\Auth { $request = Request::instance(); $arr = is_array($arr) ? $arr : explode(',', $arr); - if (!$arr) - { + if (!$arr) { return FALSE; } $arr = array_map('strtolower', $arr); // 是否存在 - if (in_array(strtolower($request->action()), $arr) || in_array('*', $arr)) - { + if (in_array(strtolower($request->action()), $arr) || in_array('*', $arr)) { return TRUE; } @@ -173,21 +160,17 @@ class Auth extends \fast\Auth */ public function isLogin() { - if ($this->logined) - { + if ($this->logined) { return true; } $admin = Session::get('admin'); - if (!$admin) - { + if (!$admin) { return false; } //判断是否同一时间同一账号只能在一个地方登录 - if (Config::get('fastadmin.login_unique')) - { + if (Config::get('fastadmin.login_unique')) { $my = Admin::get($admin['id']); - if (!$my || $my['token'] != $admin['token']) - { + if (!$my || $my['token'] != $admin['token']) { return false; } } @@ -252,9 +235,8 @@ class Auth extends \fast\Auth { $groups = $this->getGroups($uid); $groupIds = []; - foreach ($groups as $K => $v) - { - $groupIds[] = (int) $v['group_id']; + foreach ($groups as $K => $v) { + $groupIds[] = (int)$v['group_id']; } return $groupIds; } @@ -269,17 +251,14 @@ class Auth extends \fast\Auth //取出当前管理员所有的分组 $groups = $this->getGroups(); $groupIds = []; - foreach ($groups as $k => $v) - { + foreach ($groups as $k => $v) { $groupIds[] = $v['id']; } // 取出所有分组 $groupList = \app\admin\model\AuthGroup::where(['status' => 'normal'])->select(); $objList = []; - foreach ($groups as $K => $v) - { - if ($v['rules'] === '*') - { + foreach ($groups as $K => $v) { + if ($v['rules'] === '*') { $objList = $groupList; break; } @@ -289,12 +268,10 @@ class Auth extends \fast\Auth $objList = array_merge($objList, Tree::instance()->getTreeList($obj)); } $childrenGroupIds = []; - foreach ($objList as $k => $v) - { + foreach ($objList as $k => $v) { $childrenGroupIds[] = $v['id']; } - if (!$withself) - { + if (!$withself) { $childrenGroupIds = array_diff($childrenGroupIds, $groupIds); } return $childrenGroupIds; @@ -308,33 +285,25 @@ class Auth extends \fast\Auth public function getChildrenAdminIds($withself = false) { $childrenAdminIds = []; - if (!$this->isSuperAdmin()) - { + if (!$this->isSuperAdmin()) { $groupIds = $this->getChildrenGroupIds(false); $authGroupList = \app\admin\model\AuthGroupAccess:: - field('uid,group_id') - ->where('group_id', 'in', $groupIds) - ->select(); + field('uid,group_id') + ->where('group_id', 'in', $groupIds) + ->select(); - foreach ($authGroupList as $k => $v) - { + foreach ($authGroupList as $k => $v) { $childrenAdminIds[] = $v['uid']; } - } - else - { + } else { //超级管理员拥有所有人的权限 $childrenAdminIds = Admin::column('id'); } - if ($withself) - { - if (!in_array($this->id, $childrenAdminIds)) - { + if ($withself) { + if (!in_array($this->id, $childrenAdminIds)) { $childrenAdminIds[] = $this->id; } - } - else - { + } else { $childrenAdminIds = array_diff($childrenAdminIds, [$this->id]); } return $childrenAdminIds; @@ -350,15 +319,12 @@ class Auth extends \fast\Auth if ($this->breadcrumb || !$path) return $this->breadcrumb; $path_rule_id = 0; - foreach ($this->rules as $rule) - { + foreach ($this->rules as $rule) { $path_rule_id = $rule['name'] == $path ? $rule['id'] : $path_rule_id; } - if ($path_rule_id) - { + if ($path_rule_id) { $this->breadcrumb = Tree::instance()->init($this->rules)->getParents($path_rule_id, true); - foreach ($this->breadcrumb as $k => &$v) - { + foreach ($this->breadcrumb as $k => &$v) { $v['url'] = url($v['name']); $v['title'] = __($v['title']); } @@ -367,10 +333,11 @@ class Auth extends \fast\Auth } /** - * 获取左侧菜单栏 + * 获取左侧和顶部菜单栏 * * @param array $params URL对应的badge数据 - * @return string + * @param string $fixedPage 默认页 + * @return array */ public function getSidebar($params = [], $fixedPage = 'dashboard') { @@ -379,26 +346,21 @@ class Auth extends \fast\Auth $badgeList = []; $module = request()->module(); // 生成菜单的badge - foreach ($params as $k => $v) - { + foreach ($params as $k => $v) { $url = $k; - if (is_array($v)) - { + if (is_array($v)) { $nums = isset($v[0]) ? $v[0] : 0; $color = isset($v[1]) ? $v[1] : $colorArr[(is_numeric($nums) ? $nums : strlen($nums)) % $colorNums]; $class = isset($v[2]) ? $v[2] : 'label'; - } - else - { + } else { $nums = $v; $color = $colorArr[(is_numeric($nums) ? $nums : strlen($nums)) % $colorNums]; $class = 'label'; } //必须nums大于0才显示 - if ($nums) - { + if ($nums) { $badgeList[$url] = '' . $nums . ''; } } @@ -409,10 +371,8 @@ class Auth extends \fast\Auth $pinyin = new \Overtrue\Pinyin\Pinyin('Overtrue\Pinyin\MemoryFileDictLoader'); // 必须将结果集转换为数组 $ruleList = collection(\app\admin\model\AuthRule::where('status', 'normal')->where('ismenu', 1)->order('weigh', 'desc')->cache("__menu__")->select())->toArray(); - foreach ($ruleList as $k => &$v) - { - if (!in_array($v['name'], $userRule)) - { + foreach ($ruleList as $k => &$v) { + if (!in_array($v['name'], $userRule)) { unset($ruleList[$k]); continue; } @@ -423,16 +383,44 @@ class Auth extends \fast\Auth $v['pinyin'] = $pinyin->permalink($v['title'], ''); $v['title'] = __($v['title']); } - // 构造菜单数据 - Tree::instance()->init($ruleList); - $menu = Tree::instance()->getTreeMenu(0, '
  • @title @caret @badge @childlist
  • ', $select_id, '', 'ul', 'class="treeview-menu"'); - return $menu; + + $menu = $nav = ''; + if (Config::get('fastadmin.multiplenav')) { + $topList = []; + foreach ($ruleList as $index => $item) { + if (!$item['pid']) { + $topList[] = $item; + } + } + $selectParentIds = []; + $tree = Tree::instance(); + $tree->init($ruleList); + if ($select_id) { + $selectParentIds = $tree->getParentsIds($select_id, true); + } + foreach ($topList as $index => $item) { + $childList = Tree::instance()->getTreeMenu($item['id'], '
  • @title @caret @badge @childlist
  • ', $select_id, '', 'ul', 'class="treeview-menu"'); + $current = in_array($item['id'], $selectParentIds); + $url = $childList ? 'javascript:;' : $item['url']; + $childList = str_replace('" pid="' . $item['id'] . '"', ' treeview ' . ($current ? '' : 'hidden') . '" pid="' . $item['id'] . '"', $childList); + $nav .= '
  • ' . $item['title'] . '
  • '; + $menu .= $childList; + } + } else { + // 构造菜单数据 + Tree::instance()->init($ruleList); + $menu = Tree::instance()->getTreeMenu(0, '
  • @title @caret @badge @childlist
  • ', $select_id, '', 'ul', 'class="treeview-menu"'); + } + + + return [$menu, $nav]; } /** * 设置错误信息 * * @param $error 错误信息 + * @return Auth */ public function setError($error) { diff --git a/application/admin/view/common/header.html b/application/admin/view/common/header.html index 912da7c3..ff645b1e 100755 --- a/application/admin/view/common/header.html +++ b/application/admin/view/common/header.html @@ -1,131 +1,147 @@ - + \ No newline at end of file diff --git a/application/admin/view/common/menu.html b/application/admin/view/common/menu.html index 8dcec7ac..d1924d37 100644 --- a/application/admin/view/common/menu.html +++ b/application/admin/view/common/menu.html @@ -1,6 +1,6 @@ - + - \ No newline at end of file + \ No newline at end of file diff --git a/application/admin/view/index/index.html b/application/admin/view/index/index.html index 6f9a394a..815ad6c1 100644 --- a/application/admin/view/index/index.html +++ b/application/admin/view/index/index.html @@ -1,38 +1,40 @@ + {include file="common/meta" /} - +
    + - + + - +
    - + +
    - Copyright © 2017-2018 Fastadmin. All rights - reserved. + Copyright © 2017-2018 Fastadmin. All rights reserved.
    - +
    {include file="common/control" /}
    - - + + {include file="common/script" /} \ No newline at end of file diff --git a/application/admin/view/layout/default.html b/application/admin/view/layout/default.html index 6bc28ab7..0541a26a 100644 --- a/application/admin/view/layout/default.html +++ b/application/admin/view/layout/default.html @@ -16,7 +16,7 @@ {:__('Control panel')} - {if !IS_DIALOG} + {if !IS_DIALOG && !$config.fastadmin.multiplenav}
    '); - } else { - $.get(url, function (data) { - content.append(data); - }); - } - //加入TABS - if ($('.tabdrop li').size() > 0) { - $('.tabdrop ul').append(title); - } else { - navobj.append(title); - } - tabobj.append(content); - } else { - //强制刷新iframe - if (options.iframeForceRefresh) { - $("#" + conid + " iframe").attr('src', function (i, val) { - return val; - }); - } - } - localStorage.setItem("addtabs", $(this).prop('outerHTML')); - //激活TAB - $("#" + tabid).addClass('active'); - $("#" + conid).addClass("active"); - _drop(); + var _drop = function () { + navobj.refreshAddtabs(); + }; }; - - _close = function (id) { - var tabid = 'tab_' + id; - var conid = 'con_' + id; - //如果关闭的是当前激活的TAB,激活他的前一个TAB - if (obj.find("li.active").not('.tabdrop').attr('id') == tabid) { - if ($("#" + tabid).prev().not(".tabdrop").size() > 0) { - $("#" + tabid).prev().not(".tabdrop").find("a").trigger("click"); - } else if ($("#" + tabid).next().size() > 0) { - $("#" + tabid).next().trigger("click"); - } else { - $(">li:last > a", navobj).trigger('click'); - } - } - //关闭TAB - $("#" + tabid).remove(); - $("#" + conid).remove(); - _drop(); - options.callback(); - }; - - _drop = function () { - //创建下拉标签 - var dropdown = $(''); - //检测是否已增加 - if (!$('.tabdrop').html()) { - dropdown.prependTo(navobj); - } else { - dropdown = navobj.find('.tabdrop'); + dropdown.appendTo(navobj); } + //检测是否有下拉样式 if (navobj.parent().is('.tabs-below')) { dropdown.addClass('dropup'); } - var collection = 0; - var maxwidth = navobj.width() - 60; + var collection = 0; + var maxwidth = navobj.width() - 65; var liwidth = 0; //检查超过一行的标签页 var litabs = navobj.append(dropdown.find('li')).find('>li').not('.tabdrop'); - var lisize = litabs.size(); + var totalwidth = 0; litabs.each(function (i, j) { - liwidth += $(this).width(); - if (collection == 0 && i == lisize - 1 && liwidth <= navobj.width()) { - return true; - } - if (liwidth > maxwidth) { - dropdown.find('ul').append($(this)); - collection++; - } + totalwidth += $(this).outerWidth(true); }); - //如果有超出的,显示下拉标签 - if (collection > 0) { - dropdown.removeClass('hide'); - if (dropdown.find('.active').length == 1) { - dropdown.addClass('active'); - } else { - dropdown.removeClass('active'); + if (navobj.width() < totalwidth) { + litabs.each(function (i, j) { + liwidth += $(this).outerWidth(true); + if (liwidth > maxwidth) { + dropdown.find('ul').append($(this)); + collection++; + } + }); + if (collection > 0) { + dropdown.removeClass('hide'); + if (dropdown.find('.active').length == 1) { + dropdown.addClass('active'); + } else { + dropdown.removeClass('active'); + } } } else { dropdown.addClass('hide'); } + }; -}; +})(jQuery); + define("addtabs", function(){}); diff --git a/public/assets/js/require-frontend.js b/public/assets/js/require-frontend.js index 2bc1fb5e..ad9e737d 100644 --- a/public/assets/js/require-frontend.js +++ b/public/assets/js/require-frontend.js @@ -49,7 +49,7 @@ require.config({ 'template': '../libs/art-template/dist/template-native', 'selectpage': '../libs/fastadmin-selectpage/selectpage', 'citypicker': '../libs/city-picker/dist/js/city-picker.min', - 'citypicker-data': '../libs/city-picker/dist/js/city-picker.data', + 'citypicker-data': '../libs/city-picker/dist/js/city-picker.data' }, // shim依赖配置 shim: { @@ -102,7 +102,7 @@ require.config({ 'moment/locale/zh-cn', // 'css!../libs/eonasdan-bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.min.css', ], - 'bootstrap-select': ['css!../libs/bootstrap-select/dist/css/bootstrap-select.min.css', ], +// 'bootstrap-select': ['css!../libs/bootstrap-select/dist/css/bootstrap-select.min.css', ], 'bootstrap-select-lang': ['bootstrap-select'], // 'toastr': ['css!../libs/toastr/toastr.min.css'], 'jstree': ['css!../libs/jstree/dist/themes/default/style.css', ], diff --git a/public/assets/js/require-frontend.min.js b/public/assets/js/require-frontend.min.js index 90fab47d..99ce57d3 100644 --- a/public/assets/js/require-frontend.min.js +++ b/public/assets/js/require-frontend.min.js @@ -63,7 +63,7 @@ require.config({ 'template': '../libs/art-template/dist/template-native', 'selectpage': '../libs/fastadmin-selectpage/selectpage', 'citypicker': '../libs/city-picker/dist/js/city-picker.min', - 'citypicker-data': '../libs/city-picker/dist/js/city-picker.data', + 'citypicker-data': '../libs/city-picker/dist/js/city-picker.data' }, // shim依赖配置 shim: { @@ -116,7 +116,7 @@ require.config({ 'moment/locale/zh-cn', // 'css!../libs/eonasdan-bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.min.css', ], - 'bootstrap-select': ['css!../libs/bootstrap-select/dist/css/bootstrap-select.min.css', ], +// 'bootstrap-select': ['css!../libs/bootstrap-select/dist/css/bootstrap-select.min.css', ], 'bootstrap-select-lang': ['bootstrap-select'], // 'toastr': ['css!../libs/toastr/toastr.min.css'], 'jstree': ['css!../libs/jstree/dist/themes/default/style.css', ], diff --git a/public/assets/js/require-table.js b/public/assets/js/require-table.js index fa46b86c..75738e2a 100644 --- a/public/assets/js/require-table.js +++ b/public/assets/js/require-table.js @@ -372,7 +372,7 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table 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 ''; + return ''; }, images: function (value, row, index) { value = value === null ? '' : value.toString(); @@ -381,7 +381,7 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table var html = []; $.each(arr, function (i, value) { value = value ? value : '/assets/img/blank.gif'; - html.push(''); + html.push(''); }); return html.join(' '); }, @@ -394,9 +394,12 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table } value = value === null ? '' : value.toString(); var color = value && typeof colorArr[value] !== 'undefined' ? colorArr[value] : 'primary'; - value = value.charAt(0).toUpperCase() + value.slice(1); + var newValue = value.charAt(0).toUpperCase() + value.slice(1); //渲染状态 - var html = ' ' + __(value) + ''; + var html = ' ' + __(newValue) + ''; + if (this.operate != false) { + html = '' + html + ''; + } return html; }, url: function (value, row, index) { @@ -442,7 +445,12 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table return Table.api.formatter.flag.call(this, value, row, index); }, datetime: function (value, row, index) { - return value ? Moment(parseInt(value) * 1000).format("YYYY-MM-DD HH:mm:ss") : __('None'); + var datetimeFormat = typeof this.datetimeFormat === 'undefined' ? 'YYYY-MM-DD HH:mm:ss' : this.datetimeFormat; + if (isNaN(value)) { + return value ? Moment(value).format(datetimeFormat) : __('None'); + } else { + return value ? Moment(parseInt(value) * 1000).format(datetimeFormat) : __('None'); + } }, operate: function (value, row, index) { var table = this.table; diff --git a/public/assets/less/backend.less b/public/assets/less/backend.less index 1936ddef..707c3a1b 100644 --- a/public/assets/less/backend.less +++ b/public/assets/less/backend.less @@ -3,7 +3,6 @@ @import (reference) "fastadmin/mixins.less"; @import (reference) "fastadmin/variables.less"; @import "lesshat.less"; - @import url("../css/bootstrap.min.css"); @import url("../css/fastadmin.min.css"); @import url("../css/skins/skin-green.css"); @@ -15,843 +14,1096 @@ @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/bootstrap-select/dist/css/bootstrap-select.min.css"); @import url("../libs/fastadmin-selectpage/selectpage.css"); -@main-bg: #f1f4f6; -@panel-intro-bg: darken(@main-bg,3%); -@panel-nav-bg: #fff; +@main-bg: #f1f4f6; +@panel-intro-bg: darken(@main-bg, 3%); +@panel-nav-bg: #fff; body { - background:#f1f4f6; + background: #f1f4f6; + font-size: 13px; } + body.is-dialog { - background:#fff; + background: #fff; } .selection { - position: absolute; - border: 1px solid #8B9; - background-color: #BEC; + position: absolute; + border: 1px solid #8B9; + background-color: #BEC; } + .main-header { - .logo,.navbar { - .transition(none); - } - .navbar{ - position:relative; - .sidebar-toggle{ - position:absolute; - width:45px; - text-align: center; - } - #nav{ - position:absolute; - left:45px; - } - .navbar-custom-menu { - position:absolute; - right:0; - } - } + .logo, .navbar { + .transition(none); + } + .navbar { + position: relative; + } } .bootstrap-dialog .modal-dialog { - /*width: 70%;*/ - max-width:885px; + /*width: 70%;*/ + max-width: 885px; } + /*iOS兼容*/ -html.ios-fix,html.ios-fix body { - height: 100%; - overflow: auto; - -webkit-overflow-scrolling: touch; +html.ios-fix, html.ios-fix body { + height: 100%; + overflow: auto; + -webkit-overflow-scrolling: touch; } + .content { - min-height:500px; + min-height: 500px; } + #header { - background: #fff; - box-shadow: 0 2px 2px rgba(0,0,0,.05),0 1px 0 rgba(0,0,0,.05); + background: #fff; + //box-shadow: 0 2px 2px rgba(0,0,0,.05),0 1px 0 rgba(0,0,0,.05); } + .content-wrapper { - position:relative; + position: relative; } -.control-relative{ - position:relative; + +.control-relative { + position: relative; } + .tab-addtabs { - overflow: hidden; - .tab-pane { - height: 100%; - width: 100%; - } + overflow: hidden; + .tab-pane { + height: 100%; + width: 100%; + } } -.row-between{ - .col-xs-6 + .col-xs-6:before { - content: "-"; - position: absolute; - left: -2%; - top: 6px; - } +.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 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: @brand-danger; - } - &.btn-primary { - color:#fff; - background-color: @brand-primary; - } + +@media (max-width: 991px) { + .main-header .navbar-custom-menu a { + &.btn-danger { + color: #fff; + background-color: @brand-danger; } + &.btn-primary { + color: #fff; + background-color: @brand-primary; + } + } } + .common-search-table { - min-height: 20px; - padding: 15px; - margin-bottom: 15px; - background-color: #f5f5f5; -} -.searchit{ - border-bottom:1px dashed @link-color; + min-height: 20px; + padding: 15px; + margin-bottom: 15px; + background-color: #f5f5f5; } + /* 固定的底部按钮 */ .fixed-footer { - position: fixed; - bottom:0; - background-color: #ecf0f1; - width:100%; - margin-bottom:0; - padding:10px; -} -/* 包裹在layer外层 */ -.layer-footer { - display:none; + position: fixed; + bottom: 0; + background-color: #ecf0f1; + width: 100%; + margin-bottom: 0; + padding: 10px; } -table.table-template{ - overflow:hidden; +/* 包裹在layer外层 */ +.layer-footer { + display: none; } -.sp_container .msg-box{ - position: absolute; - right: 0; - top: 0; + +table.table-template { + overflow: hidden; } -.toast-top-right-index{ - top:62px; - right:12px; + +.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; + 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; + margin: 0 auto; + display: inline; + float: none; } /* * RIBBON */ #ribbon { - overflow:hidden; - padding: 15px 15px 0 15px; - position: relative; + overflow: hidden; + padding: 15px 15px 0 15px; + position: relative; + a { + color: #777 !important; + text-decoration: none !important; + } + .breadcrumb { + display: inline-block; + margin: 0; + padding: 0; + background: none; + vertical-align: top; + } + + .breadcrumb > .active, + .breadcrumb li { + color: #aaa; + } + .shortcut { a { - color: #777 !important; - text-decoration: none !important; - } - .breadcrumb { - display: inline-block; - margin: 0; - padding: 0; - background: none; - vertical-align: top; - } - - .breadcrumb > .active, - .breadcrumb li { - color: #aaa; - } - .shortcut { - a{ - margin-left:10px; - } + margin-left: 10px; } + } } .is-dialog { - #main { - background:#fff; - } -} -form.form-horizontal .control-label { - font-weight: normal; + #main { + background: #fff; + } } -.user-panel > .image img{ - width:45px; - height:45px; +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-heading { - padding:15px; - padding-bottom:0; - background:@panel-intro-bg; - border-color:@panel-intro-bg; - position:relative; - .panel-lead { - margin-bottom:15px; - em { - display: block; - font-weight: bold; - font-style:normal; - } - } - - .panel-title { - height:25px; - font-weight: normal; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - } - - .panel-control { - height: 42px; - position:absolute; - top:8px; - right:8px; - .fa { - font-size:14px; - } - } - .nav-tabs { - border-bottom:0; - margin-bottom:0; - } - - - .nav-tabs > li > a{ - margin-right:4px; - color: #95a5a6; - background-color: darken(@panel-intro-bg, 5%); - border: 1px solid @panel-intro-bg; - border-bottom-color: transparent; - } - .nav-tabs > li > a:hover, .nav-tabs > li > a:focus{ - border: 1px solid @panel-intro-bg; - color: #7b8a8b; - background-color: darken(@panel-intro-bg, 10%); - } - .nav-tabs > li.active > a, .nav-tabs > li.active > a:hover, .nav-tabs > li.active > a:focus { - color: #7b8a8b; - background-color: #ffffff; - border-bottom-color: transparent; - cursor: default; - } + margin-bottom: 0; + border: none; + > .panel-heading { + padding: 15px; + padding-bottom: 0; + background: @panel-intro-bg; + border-color: @panel-intro-bg; + position: relative; + .panel-lead { + margin-bottom: 15px; + em { + display: block; + font-weight: bold; + font-style: normal; + } } + + .panel-title { + height: 25px; + font-weight: normal; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + } + + .panel-control { + height: 42px; + position: absolute; + top: 8px; + right: 8px; + .fa { + font-size: 14px; + } + } + .nav-tabs { + border-bottom: 0; + margin-bottom: 0; + } + + .nav-tabs > li > a { + margin-right: 4px; + color: #95a5a6; + background-color: darken(@panel-intro-bg, 5%); + border: 1px solid @panel-intro-bg; + border-bottom-color: transparent; + } + .nav-tabs > li > a:hover, .nav-tabs > li > a:focus { + border: 1px solid @panel-intro-bg; + color: #7b8a8b; + background-color: darken(@panel-intro-bg, 10%); + } + .nav-tabs > li.active > a, .nav-tabs > li.active > a:hover, .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-lead { - margin-bottom:0px; - } - .panel-title { - - } + .panel-heading { + padding: 12px 15px 12px 15px; + .panel-lead { + margin-bottom: 0px; } + .panel-title { + + } + } } + /*选项卡*/ .panel-nav { - .panel-heading { - padding:0px; - padding-bottom:0; - background:@main-bg; - border-color:@main-bg; - } - .nav-tabs > li > a{ - padding: 12px 15px; - background-color: @panel-intro-bg; - border: 1px solid @main-bg; - } - .nav-tabs > li > a:hover, .nav-tabs > li > a:focus{ - border: 1px solid @panel-intro-bg; - background-color: @panel-intro-bg; - } - .nav-tabs > li.active > a, .nav-tabs > li.active > a:hover, .nav-tabs > li.active > a:focus { - border-color: @main-bg; - border-bottom-color: transparent; - } -} -/*顶栏addtabs*/ -.nav-addtabs{ - &.disable-top-badge { - > li > a > .pull-right-container{ - display:none; - } - } - border:none; - > li{ - margin:0; - > 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; - &:hover, &:focus{ - border:none; - color:#2c3e50; - border-right:1px solid rgba(0, 0, 0, 0.05); - } - i{ - margin-right:3px; - } - } - &.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; - &:hover, &:focus{ - border:none; - color:#2c3e50; - border-right:1px solid rgba(0, 0, 0, 0.05); - background:#f1f4f6; - } - } - .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; - } - } - .open > a{ - &:hover,&:focus{ - border-right:1px solid rgba(0, 0, 0, 0.05); - } - } - ul li { - position:relative; - } - li:hover > .close-tab { - display:block; - } -} -.main-sidebar .sidebar-form { - overflow:visible; - .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; - a { - border-top:1px solid #eee; - display: block; - background-color: #fff; - border-bottom:1px solid #eee; - margin-bottom:-1px; - display:block; - padding: 10px 15px; - color:#222d32; - &:hover{ - background:#eee; - } - } - } -} -.input-group .sp_result_area { - width:100%; -} -.sidebar-menu{ - &.show-submenu { - .treeview-menu { - display: block; - } - } - > li .badge { - margin-top:0; - } -} -.sidebar-collapse { - .user-panel > .image img{ - width:25px; - height:25px; - } + .panel-heading { + padding: 0px; + padding-bottom: 0; + background: @main-bg; + border-color: @main-bg; + } + .nav-tabs > li > a { + padding: 12px 15px; + background-color: @panel-intro-bg; + border: 1px solid @main-bg; + } + .nav-tabs > li > a:hover, .nav-tabs > li > a:focus { + border: 1px solid @panel-intro-bg; + background-color: @panel-intro-bg; + } + .nav-tabs > li.active > a, .nav-tabs > li.active > a:hover, .nav-tabs > li.active > a:focus { + border-color: @main-bg; + border-bottom-color: transparent; + } } -@media (min-width: 768px){ - .sidebar-mini.sidebar-collapse .sidebar-menu > li:hover > .treeview-menu { - top: 41px; +/*顶栏addtabs*/ +.nav-addtabs { + height: 100%; + &.disable-top-badge { + > li > a > .pull-right-container { + display: none; } - .sidebar-mini.sidebar-collapse .sidebar-menu > li:hover > a > .pull-right-container { - top: 7px!important; - height: 17px; + } + border: none; + > li { + margin: 0; + > a { + height: 50px; + line-height: 50px; + padding: 0 15px; + border-radius: 0; + border: none; + border-right: 1px solid rgba(0, 0, 0, 0.05); + margin: 0; + color: #95a5a6; + &:hover, &:focus { + border: none; + color: #2c3e50; + border-right: 1px solid rgba(0, 0, 0, 0.05); + } + i { + margin-right: 3px; + } } + &.active > a { + height: 50px; + line-height: 50px; + padding: 0 15px; + border-radius: 0; + border: none; + border-right: 1px solid rgba(0, 0, 0, 0.05); + background: #f1f4f6; + color: #2c3e50; + overflow: hidden; + &:hover, &:focus { + border: none; + color: #2c3e50; + background: #f1f4f6; + border-right: 1px solid rgba(0, 0, 0, 0.05); + } + } + .close-tab { + font-size: 10px; + position: absolute; + right: 0px; + top: 50%; + margin-top: -8px; + z-index: 100; + cursor: pointer; + color: #eee; + + &:before { + content: "\e626"; + font-family: iconfont; + font-style: normal; + font-weight: normal; + text-decoration: inherit; + font-size: 18px; + } + display: none; + } + } + .open > a { + &:hover, &:focus { + border-right: 1px solid rgba(0, 0, 0, 0.05); + } + } + ul li { + position: relative; + } + li:hover > .close-tab { + display: block; + } +} + +.multiplenav { + .content-wrapper, .right-side { + padding-top: 94px; + } + + #firstnav .nav-addtabs { + padding-right: 450px; + } +} + +#firstnav { + height: 50px; + border-bottom: 1px solid transparent; + box-shadow: 0 1px 4px rgba(0, 21, 41, .08); + position: relative; + .sidebar-toggle { + position: absolute; + width: 45px; + text-align: center; + height: 50px; + line-height: 50px; + padding: 0; + } + .nav-addtabs { + position: absolute; + left: 45px; + z-index: 98; + } + .navbar-custom-menu { + position: absolute; + top: 0; + right: 0; + z-index: 99; + background: transparent; + } +} + +/*次栏菜单栏*/ +#secondnav { + height: 44px; + position: absolute; + top: 50px; + left: 0; + background: #fff; + width: 100%; + box-shadow: 0 1px 4px rgba(0, 21, 41, .08); + padding: 5px 10px; + -webkit-user-select: none; + -moz-user-select: none; + user-select: none; + .nav-addtabs { + height: 100%; + &.disable-top-badge { + > li > a > .pull-right-container { + display: none; + } + } + border: none; + > li { + border: 1px solid #eee; + border-radius: 3px; + padding: 0 15px; + height: 30px; + line-height: 30px; + margin: 2px 5px 2px 0; + background: #fff; + > a { + display: block; + color: #495060 !important; + height: 100%; + padding: 0; + line-height: 28px; + font-size: 12px; + vertical-align: middle; + opacity: 1; + overflow: hidden; + background: none; + border: none; + i { + margin-right: 3px; + } + } + &.active { + border-color: #bdbebd; + background-color: #f7f7f7; + } + .close-tab { + font-size: 10px; + position: absolute; + right: 0px; + top: 50%; + margin-top: -8px; + z-index: 100; + cursor: pointer; + color: #eee; + + &:before { + content: "\e626"; + font-family: iconfont; + font-style: normal; + font-weight: normal; + text-decoration: inherit; + font-size: 18px; + } + } + &:hover, &:focus { + border-color: #bdbebd; + } + } + ul li { + position: relative; + } + li:hover > .close-tab { + display: block; + border-color: #222e32; + color: #222e32 + } + } + +} + +.main-sidebar .sidebar-form { + overflow: visible; + .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; + a { + border-top: 1px solid #eee; + display: block; + background-color: #fff; + border-bottom: 1px solid #eee; + margin-bottom: -1px; + display: block; + padding: 10px 15px; + color: #222d32; + &:hover { + background: #eee; + } + } + } +} + +.input-group .sp_result_area { + width: 100%; +} + +.sidebar-menu { + &.show-submenu { + .treeview-menu { + display: block; + } + } + > 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; - input{display: inline-block;width:300px;} - input:first-child{width:110px;} - ins{width:110px;display: inline-block;text-decoration:none;font-weight: bold;} + display: block; + margin: 5px 0; + input { + display: inline-block; + width: 300px; + } + input:first-child { + width: 110px; + } + ins { + width: 110px; + display: inline-block; + text-decoration: none; + font-weight: bold; + } } /* 弹窗中的表单 */ .form-layer { - height:100%;min-height:150px;min-width:300px; - .form-body { - width:100%; - overflow:auto; - top:0; - position:absolute; - z-index:10; - bottom:50px; - padding:15px; - } - .form-footer { - height:50px; - line-height:50px; - background-color: #ecf0f1; - width:100%; - position:absolute; - z-index:200; - bottom:0; - margin:0; - } - .form-footer .form-group{ - margin-left:0; - margin-right:0; - } + height: 100%; + min-height: 150px; + min-width: 300px; + .form-body { + width: 100%; + overflow: auto; + top: 0; + position: absolute; + z-index: 10; + bottom: 50px; + padding: 15px; + } + .form-footer { + height: 50px; + line-height: 50px; + background-color: #ecf0f1; + width: 100%; + position: absolute; + z-index: 200; + bottom: 0; + margin: 0; + } + .form-footer .form-group { + margin-left: 0; + margin-right: 0; + } } #treeview { - .jstree-container-ul .jstree-node{ - display:block;clear:both; - } - .jstree-leaf:not(:first-child) { - float:left; - background:none; - margin-left:0; - width:80px; - clear:none; - } - .jstree-leaf { - float:left; - margin-left:0;padding-left:24px; - width:80px; - clear:none; - color:#777; - } - .jstree-leaf > .jstree-icon,.jstree-leaf .jstree-themeicon{ - display:none; - } - .jstree-last{ - background-image: url("../img/32px.png"); - background-position: -292px -4px; - background-repeat: repeat-y; - } - .jstree-children { - .clearfix(); - } - .jstree-themeicon { - display: none; - } + .jstree-container-ul .jstree-node { + display: block; + clear: both; + } + .jstree-leaf:not(:first-child) { + float: left; + background: none; + margin-left: 0; + width: 80px; + clear: none; + } + .jstree-leaf { + float: left; + margin-left: 0; + padding-left: 24px; + width: 80px; + clear: none; + color: #777; + } + .jstree-leaf > .jstree-icon, .jstree-leaf .jstree-themeicon { + display: none; + } + .jstree-last { + background-image: url("../img/32px.png"); + background-position: -292px -4px; + background-repeat: repeat-y; + } + .jstree-children { + .clearfix(); + } + .jstree-themeicon { + display: none; + } } /*去除bootstrap-table的边框*/ .fixed-table-container { - border:none!important; + border: none !important; } /*修复nice-validator新版下的一处BUG*/ .nice-validator { - input, select, textarea, [contenteditable]{ - display: inline-block; - *display: inline; - *zoom: 1; - } + input, select, textarea, [contenteditable] { + display: inline-block; + *display: inline; + *zoom: 1; + } } /*修复nice-validator和summernote的编辑框冲突*/ -.nice-validator .note-editor .note-editing-area .note-editable{ - display:inherit; +.nice-validator .note-editor .note-editing-area .note-editable { + display: inherit; } /*预览区域*/ .plupload-preview { - padding:0 10px; - margin-bottom:0; - li { - margin-top:15px; + padding: 0 10px; + margin-bottom: 0; + li { + margin-top: 15px; + } + .thumbnail { + margin-bottom: 10px; + } + a { + display: block; + &:first-child { + height: 90px; } - .thumbnail { - margin-bottom:10px; - } - a{ - display:block; - &:first-child{ - height:90px; - } - img{ - height:80px; - object-fit: cover; - } + 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; + 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,li{ - text-align: left!important; - } + a, li { + text-align: left !important; + } } -.bootstrap-table .fixed-table-toolbar .dropdown-menu{ - overflow:auto; + +.bootstrap-table .fixed-table-toolbar .dropdown-menu { + overflow: auto; } -.toolbar{ - margin-top:10px; - margin-bottom:10px; + +.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 .bs-bars, .fixed-table-toolbar .columns, .fixed-table-toolbar .search { + line-height: inherit; } -.fixed-table-toolbar .toolbar{ - margin-top:0; - margin-bottom:0; + +.fixed-table-toolbar .toolbar { + margin-top: 0; + margin-bottom: 0; } .bootstrap-table table tbody tr:first-child td .bs-checkbox { - vertical-align: middle; + vertical-align: middle; } + .bootstrap-table td.bs-checkbox { - vertical-align: middle; + vertical-align: middle; } -.fixed-table-container thead th .sortable{ - padding-right:0; + +.fixed-table-container thead th .sortable { + padding-right: 0; } + .dropdown-submenu { - position: relative; - >.dropdown-menu { - overflow:auto; - top: 0; - left: 100%; - margin-top: -6px; - margin-left: -1px; - .border-radius(0 6px 6px 6px); + position: relative; + > .dropdown-menu { + overflow: auto; + top: 0; + left: 100%; + margin-top: -6px; + margin-left: -1px; + .border-radius(0 6px 6px 6px); + } + &:hover { + > .dropdown-menu { + display: block; } - &:hover { - >.dropdown-menu { - display: block; - } - >a:after { - border-left-color: #fff; - } + > a:after { + border-left-color: #fff; } - >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; - } - &.pull-left { - float: none; - >.dropdown-menu { - left: -100%; - margin-left: 10px; - .border-radius(6px 0 6px 6px); - } + } + > 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; + } + &.pull-left { + float: none; + > .dropdown-menu { + left: -100%; + margin-left: 10px; + .border-radius(6px 0 6px 6px); } + } } /*重写toast的几个背景色*/ .toast-primary { - background-color: #48c9b0!important; + background-color: #48c9b0 !important; } + .toast-success { - background-color: #18bc9c!important; + background-color: #18bc9c !important; } + .toast-error { - background-color: #e74c3c!important; + background-color: #e74c3c !important; } + .toast-info { - background-color: #5dade2!important; + background-color: #5dade2 !important; } + .toast-warning { - background-color: #f1c40f!important; + background-color: #f1c40f !important; } + .toast-inverse { - background-color: #34495e!important; + background-color: #34495e !important; } + .toast-default { - background-color: #bdc3c7!important; + background-color: #bdc3c7 !important; } -#toast-container{ - >div, >div:hover{ - .box-shadow(0 0 3px #eee); - } + +#toast-container { + > div, > div:hover { + .box-shadow(0 0 3px #eee); + } } + .layui-layer-fast { - .layui-layer-title { - background:#2c3e50!important; - color:#fff!important; - border-bottom:none; - //只有当包含layui-layer-title标题时才显示按钮 - ~.layui-layer-setwin{ - top: 0px; - height:42px; - > a{ - height:42px; - line-height:42px; - display:inline-block; - } - } + .layui-layer-title { + background: #2c3e50 !important; + color: #fff !important; + border-bottom: none; + //只有当包含layui-layer-title标题时才显示按钮 + ~ .layui-layer-setwin { + top: 0px; + height: 42px; + > a { + height: 42px; + line-height: 42px; + display: inline-block; + } } + } - &.layui-layer-border { - border:none!important; - box-shadow: 1px 1px 50px rgba(0,0,0,.3)!important; + &.layui-layer-border { + border: none !important; + box-shadow: 1px 1px 50px rgba(0, 0, 0, .3) !important; + } + &.layui-layer-iframe { + //overflow:hidden!important; + overflow: visible; + } + .layui-layer-moves { + .box-sizing(content-box); + } + /*自定义底部灰色操作区*/ + .layui-layer-btn { + text-align: center !important; + padding: 10px !important; + background: #ecf0f1; + overflow: hidden; + a { + background-color: #95a5a6; + border-color: #95a5a6; + color: #fff !important; + height: 31px; + margin-top: 0; + border: 1px solid transparent; } - &.layui-layer-iframe { - //overflow:hidden!important; - overflow:visible; - } - .layui-layer-moves{ - .box-sizing(content-box); - } - /*自定义底部灰色操作区*/ - .layui-layer-btn { - text-align: center!important; - padding: 10px!important; - background: #ecf0f1; - overflow:hidden; - a { - background-color: #95a5a6; - border-color: #95a5a6; - color:#fff!important; - height:31px; - margin-top:0; - border: 1px solid transparent; - } - .layui-layer-btn0{ - background-color: #18bc9c; - border-color: #18bc9c; - } - } - .layui-layer-footer { - padding:8px 20px; - background-color:#ecf0f1; - height:auto; - text-align:inherit!important; + .layui-layer-btn0 { + background-color: #18bc9c; + border-color: #18bc9c; } + } + .layui-layer-footer { + padding: 8px 20px; + background-color: #ecf0f1; + height: auto; + text-align: inherit !important; + } - .layui-layer-setwin { - > a { - background:none!important; - cite { - display:none; - } - &: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; - } - &:hover { - text-decoration: none!important; - background:none!important; - } - &:focus { - text-decoration: none!important; - } - } - .layui-layer-min{ - display:none; - &:after { - content: "\e625"; - } - } - .layui-layer-max{ - display:none; - &:after { - content: "\e623"; - } - } - .layui-layer-maxmin{ - display:none; - &:after { - content: "\e624"; - } - } - .layui-layer-close1{ - &:after { - content: "\e626"; - } - } - //样式二关闭按钮 - .layui-layer-close2,.layui-layer-close2:hover{ - background:url('../libs/layer/dist/theme/default/icon.png') no-repeat -149px -31px !important; - top:-30px; - right:-30px; - &:after { - display:none; - } - } + .layui-layer-setwin { + > a { + background: none !important; + cite { + display: none; + } + &: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; + } + &:hover { + text-decoration: none !important; + background: none !important; + } + &:focus { + text-decoration: none !important; + } } + .layui-layer-min { + display: none; + &:after { + content: "\e625"; + } + } + .layui-layer-max { + display: none; + &:after { + content: "\e623"; + } + } + .layui-layer-maxmin { + display: none; + &:after { + content: "\e624"; + } + } + .layui-layer-close1 { + &:after { + content: "\e626"; + } + } + //样式二关闭按钮 + .layui-layer-close2, .layui-layer-close2:hover { + background: url('../libs/layer/dist/theme/default/icon.png') no-repeat -149px -31px !important; + top: -30px; + right: -30px; + &:after { + display: none; + } + } + } } + .layui-layer-content { - clear: both; + clear: both; } + .layui-layer-fast-msg { - min-width: 100px; - border-radius: 2px; - background-color: rgba(0,0,0,.6); - color: #fff; - .layui-layer-content { - padding: 12px 25px; - text-align: center; - } + min-width: 100px; + border-radius: 2px; + background-color: rgba(0, 0, 0, .6); + color: #fff; + .layui-layer-content { + padding: 12px 25px; + text-align: center; + } } .n-bootstrap { - .input-group > .n-right { - position:absolute; - } + .input-group > .n-right { + position: absolute; + } } -@media (min-width: 564px){ - body.is-dialog .daterangepicker { - min-width: 130px; - } - body.is-dialog .daterangepicker .ranges ul { - width: 130px; - } + +@media (min-width: 564px) { + body.is-dialog .daterangepicker { + min-width: 130px; + } + + body.is-dialog .daterangepicker .ranges ul { + width: 130px; + } } /*手机版样式*/ @media (max-width: @screen-phone) { + #firstnav { .nav-addtabs { - display:none; + //display: none; } - .fixed-table-toolbar { - .columns-right.btn-group{ - display:none; - } + .navbar-custom-menu { + ul li a { + padding-left: 10px; + padding-right: 10px; + } } + .navbar-nav > .user-menu .user-image { + margin-top: -3px; + } + } + + .fixed-table-toolbar { + .columns-right.btn-group { + display: none; + } + } + + .fixed .content-wrapper, .fixed .right-side { + padding-top: 50px; + } + + .multiplenav { .fixed .content-wrapper, .fixed .right-side { - padding-top: 50px; + padding-top: 94px; } + + .content-wrapper, .right-side { + padding-top: 94px; + } + } + + .main-sidebar, .left-side { + padding-top: 144px; + } + } + /*平板样式*/ @media (max-width: @screen-tablet) { - .n-bootstrap { - .n-right { - margin-top:0; - top:-20px; - position:absolute; - left:0; - text-align:right; - width:100%; - .msg-wrap { - position:relative; - } - } - .col-xs-12 > .n-right { - .msg-wrap { - margin-right:15px; - } - } + body .wrapper .main-header .logo { + background: none; + color: #fff; + border-bottom: 0 solid transparent; + position: absolute; + top: 0; + z-index: 1200; + width: 130px; + left: 50%; + margin-left: -65px; + } + + body .sidebar .mobilenav a.btn-app { + color: #444; + width: 100px; + height: 70px; + font-size: 13px; + i.fa { + font-size: 24px; } + span { + margin-top: 5px; + display: block; + } + &.active { + color: #222d32; + } + } + + body .wrapper .main-header .navbar .dropdown-menu li { + > a { + color: #333; + &:hover { + background: #eee; + } + } + &.active > a { + color: #fff; + &:hover { + background: #222d32 + } + } + } + + .main-sidebar, .left-side { + padding-top: 94px; + } + + .n-bootstrap { + .n-right { + margin-top: 0; + top: -20px; + position: absolute; + left: 0; + text-align: right; + width: 100%; + .msg-wrap { + position: relative; + } + } + .col-xs-12 > .n-right { + .msg-wrap { + margin-right: 15px; + } + } + } } /*修复radio和checkbox样式对齐*/ .radio, .checkbox { - > label { - margin-right: 10px; - > input { - margin: 2px 0 0; - } + > label { + margin-right: 10px; + > input { + margin: 2px 0 0; } + } } .wipecache li a { - color:#444444!important; + color: #444444 !important; } \ No newline at end of file