diff --git a/app/AdminController.php b/app/AdminController.php index 62304bd..ed36d99 100644 --- a/app/AdminController.php +++ b/app/AdminController.php @@ -65,13 +65,6 @@ class AdminController extends BaseController */ public $status = false; - /** - * 管理员信息 - * @var array - */ - //public $admin = [];使用以下替代 - //request()->adminInfo['id'] - /** * 获取模板 * @access protected @@ -156,8 +149,8 @@ class AdminController extends BaseController public function index() { if (request()->isAjax()) { - $page = (int)input('page') ?? 1; - $limit = (int)input('limit') ?? 18; + $page = (int)input('page', 1); + $limit = (int)input('limit',18); $where = $this->buildSelectParams(); $count = $this->model->where($where)->count(); $limit = is_empty($limit) ? 10 : $limit; diff --git a/app/BaseController.php b/app/BaseController.php index 22ae487..f0064ab 100644 --- a/app/BaseController.php +++ b/app/BaseController.php @@ -246,8 +246,8 @@ class BaseController */ protected function getTableFields($model = null) { - $this->model = $model ?: $this->model; - $tableFields = $this->model->getTableFields(); + $model = $model ?: $this->model; + $tableFields = $model->getTableFields(); if (!empty($tableFields) && is_array($tableFields)) { foreach ($tableFields as $key => $value) { $filter = ['update_time', 'create_time', 'delete_time']; diff --git a/app/admin/library/Auth.php b/app/admin/library/Auth.php index afaf449..df9b5cf 100644 --- a/app/admin/library/Auth.php +++ b/app/admin/library/Auth.php @@ -293,24 +293,17 @@ class Auth } } else { - if (!Event::hasListener('cmscategoryPermissions')) { - throw new \Exception('请安装CMS插件'); - } else { - - if (!$this->superAdmin()) { - if (!empty($auth_nodes[$class])) { - $list = Event::emit('cmscategoryPermissions', [ - 'field' => $this->authFields, - 'nodes' => $auth_nodes[$class] - ], true); - } - } - - if (empty($list)) { + if (!$this->superAdmin()) { + if (!empty($auth_nodes[$class])) { $list = Event::emit('cmscategoryPermissions', [ - 'field' => $this->authFields + 'field' => $this->authFields, + 'nodes' => $auth_nodes[$class] ], true); } + } else { + $list = Event::emit('cmscategoryPermissions', [ + 'field' => $this->authFields + ], true); } } diff --git a/app/admin/view/public/static.html b/app/admin/view/public/static.html index 04dc612..647ebd2 100644 --- a/app/admin/view/public/static.html +++ b/app/admin/view/public/static.html @@ -1,6 +1,6 @@ - + diff --git a/app/admin/view/system/user/index.html b/app/admin/view/system/user/index.html index b6ffe42..6b16f11 100644 --- a/app/admin/view/system/user/index.html +++ b/app/admin/view/system/user/index.html @@ -1,11 +1,4 @@ -
@@ -40,7 +33,7 @@ -
@@ -54,7 +47,7 @@
- diff --git a/app/common/model/system/Dictionary.php b/app/common/model/system/Dictionary.php index 26fca54..8532823 100644 --- a/app/common/model/system/Dictionary.php +++ b/app/common/model/system/Dictionary.php @@ -39,13 +39,10 @@ class Dictionary extends Model * @throws DbException * @throws ModelNotFoundException */ - public static function getValueList(string $value = ''): array + public static function getValueList(string $value = '') { $list = []; - $data = self::where([ - 'pid' => 0, - 'value' => $value - ])->find(); + $data = self::where(['pid' => 0,'value' => $value])->find(); if (!empty($data)) { $list = self::where('pid', $data['id'])->select(); } diff --git a/app/functions.php b/app/functions.php index 33451ac..cf41d07 100644 --- a/app/functions.php +++ b/app/functions.php @@ -339,7 +339,7 @@ if (!function_exists('release')) { */ function release() { - return getenv('APP_DEBUG') ? \system\Random::alphaNum() : config('app.version'); + return config('app.version'); } } @@ -1322,9 +1322,12 @@ if (!function_exists('plugin_refresh_hooks')) { $events[$hook][] = [$namespace, $hook]; } - $taglibPath = plugin_path($name) . 'taglib.php'; - if (is_file($taglibPath)) { - $taglib[] = 'plugin\\' . $name . '\\taglib.php'; + $taglibPath = plugin_path($name . DIRECTORY_SEPARATOR . 'taglib'); + + $tagList = glob($taglibPath . '*.php'); + foreach ($tagList as $index => $tag) { + $tag = pathinfo($tag, PATHINFO_FILENAME); + $taglib[] = 'plugin\\' . $name . '\\taglib\\' . $tag; } } diff --git a/public/static/system/css/style.css b/public/static/system/css/style.css index c5df3eb..fe693d3 100644 --- a/public/static/system/css/style.css +++ b/public/static/system/css/style.css @@ -74,24 +74,6 @@ a { display: none; margin-left: -15px; } -/*.layui-layer-iframe .layui-layer-setwin {*/ -/* right: 25px!important;*/ -/*}*/ - -/*.layui-layer-iframe .layui-layer-setwin .layui-layer-close2 {*/ -/* position: relative;*/ -/* right: unset;*/ -/* top: unset;*/ -/* width: 15px;*/ -/* height: 15px;*/ -/* margin-left: 8px;*/ -/* background-position: 1px -40px;*/ -/* _display: none;*/ -/*}*/ - -/*.layui-layer-iframe .layui-layer-setwin .layui-layer-close2:hover {*/ -/* background-position: 1px -40px;*/ -/*}*/ .layui-table td, .layui-table th, .layui-table-col-set, .layui-table-fixed-r, .layui-table-grid-down, .layui-table-header, .layui-table-page, .layui-table-tips-main, .layui-table-tool, .layui-table-total, .layui-table-view, .layui-table[lay-skin=line], .layui-table[lay-skin=row] { border: 1px #e6e6e6; @@ -256,16 +238,16 @@ a { } .layui-layout-admin .layui-header .layui-nav-third { - display: none; + display: none; position: absolute; - min-width: 100%; - line-height: 36px; - padding: 5px 0; - box-shadow: 0 2px 4px rgba(0,0,0,.12); - border: 1px solid #d2d2d2; - background-color: #fff; - z-index: 100; - border-radius: 2px; + min-width: 100%; + line-height: 36px; + padding: 5px 0; + box-shadow: 0 2px 4px rgba(0,0,0,.12); + border: 1px solid #d2d2d2; + background-color: #fff; + z-index: 100; + border-radius: 2px; white-space: nowrap; } @@ -700,7 +682,7 @@ a { -moz-transform: rotate(-180deg); -webkit-transform: rotate(-180deg); -o-transform: rotate(-180deg); - transform: rotate(-180deg) + transform: rotate(-180deg) } @@ -957,7 +939,7 @@ a { } .layui-layout-admin #layui-footer-btn { - left: 0; + left: 0; padding: 10px 0; text-align: center; } @@ -1465,7 +1447,7 @@ a { } .layui-anim-scaleSpring { - -webkit-animation-name: none; + -webkit-animation-name: none; animation-name: none; } @@ -1510,18 +1492,18 @@ a { .lay-images-show { position:absolute; - text-align:center; - line-height:150%; - border-radius:3px; + text-align:center; + line-height:150%; + border-radius:3px; border:1px solid #f2f2f2; padding:5px; - background:#FFFFFF; + background:#FFFFFF; z-index:99999; } .layui-authtree { overflow:auto; - height: 500px; + height: 500px; padding-left: 15px; max-height: 650px; } @@ -1570,14 +1552,14 @@ a { .layui-admin-workplace .workplace-header i.notice { border: 1px solid #94d65c; color: #52c424; - background: #f6ffed; + background: #f6ffed; } .layui-admin-workplace .workplace-header i.date{ border: 1px solid #fdc277; color: #fb992f; - background: #fff7e6; + background: #fff7e6; } .layui-admin-workplace .workplace-content { @@ -1606,7 +1588,7 @@ a { position: relative; z-index: 1; -webkit-box-shadow: 0 2px 8px rgba(0,0,0,.15); - box-shadow: 0 2px 8px rgba(0,0,0,.15); + box-shadow: 0 2px 8px rgba(0,0,0,.15); } .layui-small-block { @@ -2204,7 +2186,7 @@ a { /*input标签*/ .layui-form-label { padding: 6px 15px; - white-space: nowrap; + /*white-space: nowrap;*/ } .layui-form-pane .layui-form-label { @@ -2361,7 +2343,7 @@ a { #laytable-search .layui-slider { margin-top: 15px; -} +} #laytable-search .layui-inline { margin-bottom: 10px; @@ -2425,7 +2407,7 @@ a { /*按钮*/ .layui-btn { - background-color: #1890ff; + background-color: #1890ff; text-shadow: 0 -1px 0 rgba(0,0,0,.12); box-shadow: 0 2px 0 rgba(0,0,0,.045); } @@ -2440,7 +2422,7 @@ a { .layui-btn-primary:hover { /*color: #1890ff;*/ border-color: #1890ff; - background-color: #fff; + background-color: #fff; } /*时间线*/ @@ -2501,7 +2483,7 @@ xm-select > .xm-body .xm-tree-icon:hover { .layui-table-col-special .layui-table-cell a:hover[lay-event="del"],.layui-table-col-special .layui-table-cell a[lay-event="del"] i:hover { color: #FE232D; - + } .layui-table-col-special .layui-table-cell a[lay-event="del"] i { @@ -2548,8 +2530,7 @@ xm-select > .xm-body .xm-tree-icon:hover { #console .layui-table[lay-skin="nob"] th, .layui-table[lay-skin="nob"] td { white-space: nowrap; - max-width: 50px; - overflow: hidden; + min-width: 50px; } #console ul.layui-timeline { @@ -2674,14 +2655,14 @@ xm-select > .xm-body .xm-tree-icon:hover { color: #FE232D; } -#firered .layui-nav-tree .layui-nav-child dd.layui-this, -#firered .layui-nav-tree .layui-nav-child dd.layui-this a, +#firered .layui-nav-tree .layui-nav-child dd.layui-this, +#firered .layui-nav-tree .layui-nav-child dd.layui-this a, #firered .layui-nav-tree .layui-this, .layui-nav-tree .layui-this>a { background: #FE232D; } -#firered .layui-tab-brief>.layui-tab-more li.layui-this:after, +#firered .layui-tab-brief>.layui-tab-more li.layui-this:after, #firered .layui-tab-brief>.layui-tab-title .layui-this:after { border-bottom-color: #FE232D; } @@ -2887,7 +2868,7 @@ xm-select > .xm-body .xm-tree-icon:hover { } -#firered .layui-form-item .layui-input:hover, +#firered .layui-form-item .layui-input:hover, #firered .layui-select:hover, #firered .layui-form-select:hover, #firered .layui-textarea:hover, @@ -2906,14 +2887,14 @@ xm-select > .xm-body .xm-tree-icon:hover { color: #FAAD14; } -#orange .layui-nav-tree .layui-nav-child dd.layui-this, -#orange .layui-nav-tree .layui-nav-child dd.layui-this a, +#orange .layui-nav-tree .layui-nav-child dd.layui-this, +#orange .layui-nav-tree .layui-nav-child dd.layui-this a, #orange .layui-nav-tree .layui-this, .layui-nav-tree .layui-this>a { background: #FAAD14; } -#orange .layui-tab-brief>.layui-tab-more li.layui-this:after, +#orange .layui-tab-brief>.layui-tab-more li.layui-this:after, #orange .layui-tab-brief>.layui-tab-title .layui-this:after { border-bottom-color: #FAAD14; } @@ -3114,7 +3095,7 @@ xm-select > .xm-body .xm-tree-icon:hover { color: #FAAD14; } -#orange .layui-form-item .layui-input:hover, +#orange .layui-form-item .layui-input:hover, #orange .layui-select:hover, #orange .layui-form-select:hover, #orange .layui-textarea:hover, @@ -3136,14 +3117,14 @@ xm-select > .xm-body .xm-tree-icon:hover { color: #52C41A; } -#green .layui-nav-tree .layui-nav-child dd.layui-this, -#green .layui-nav-tree .layui-nav-child dd.layui-this a, +#green .layui-nav-tree .layui-nav-child dd.layui-this, +#green .layui-nav-tree .layui-nav-child dd.layui-this a, #green .layui-nav-tree .layui-this, .layui-nav-tree .layui-this>a { background: #52C41A; } -#green .layui-tab-brief>.layui-tab-more li.layui-this:after, +#green .layui-tab-brief>.layui-tab-more li.layui-this:after, #green .layui-tab-brief>.layui-tab-title .layui-this:after { border-bottom-color: #52C41A; } @@ -3344,7 +3325,7 @@ xm-select > .xm-body .xm-tree-icon:hover { color: #52C41A; } -#green .layui-form-item .layui-input:hover, +#green .layui-form-item .layui-input:hover, #green .layui-select:hover, #green .layui-form-select:hover, #green .layui-textarea:hover, @@ -3366,14 +3347,14 @@ xm-select > .xm-body .xm-tree-icon:hover { color: #2F4056; } -#cyan .layui-nav-tree .layui-nav-child dd.layui-this, -#cyan .layui-nav-tree .layui-nav-child dd.layui-this a, +#cyan .layui-nav-tree .layui-nav-child dd.layui-this, +#cyan .layui-nav-tree .layui-nav-child dd.layui-this a, #cyan .layui-nav-tree .layui-this, .layui-nav-tree .layui-this>a { background: #2F4056; } -#cyan .layui-tab-brief>.layui-tab-more li.layui-this:after, +#cyan .layui-tab-brief>.layui-tab-more li.layui-this:after, #cyan .layui-tab-brief>.layui-tab-title .layui-this:after { border-bottom-color: #2F4056; } @@ -3574,7 +3555,7 @@ xm-select > .xm-body .xm-tree-icon:hover { color: #2F4056; } -#cyan .layui-form-item .layui-input:hover, +#cyan .layui-form-item .layui-input:hover, #cyan .layui-select:hover, #cyan .layui-form-select:hover, #cyan .layui-textarea:hover, @@ -3596,14 +3577,14 @@ xm-select > .xm-body .xm-tree-icon:hover { color: #32A2D4; } -#geek .layui-nav-tree .layui-nav-child dd.layui-this, -#geek .layui-nav-tree .layui-nav-child dd.layui-this a, +#geek .layui-nav-tree .layui-nav-child dd.layui-this, +#geek .layui-nav-tree .layui-nav-child dd.layui-this a, #geek .layui-nav-tree .layui-this, .layui-nav-tree .layui-this>a { background: #32A2D4; } -#geek .layui-tab-brief>.layui-tab-more li.layui-this:after, +#geek .layui-tab-brief>.layui-tab-more li.layui-this:after, #geek .layui-tab-brief>.layui-tab-title .layui-this:after { border-bottom-color: #32A2D4; } @@ -3804,7 +3785,7 @@ xm-select > .xm-body .xm-tree-icon:hover { color: #32A2D4; } -#geek .layui-form-item .layui-input:hover, +#geek .layui-form-item .layui-input:hover, #geek .layui-select:hover, #geek .layui-form-select:hover, #geek .layui-textarea:hover, @@ -3817,9 +3798,9 @@ xm-select > .xm-body .xm-tree-icon:hover { color: #32A2D4; } -.layui-nav-tree .layui-nav-child dd.layui-this, -.layui-nav-tree .layui-nav-child dd.layui-this a, -.layui-nav-tree .layui-this, +.layui-nav-tree .layui-nav-child dd.layui-this, +.layui-nav-tree .layui-nav-child dd.layui-this a, +.layui-nav-tree .layui-this, .layui-nav-tree .layui-this>a { background-color: #1890ff; } diff --git a/public/static/system/module/admin.js b/public/static/system/module/admin.js index 2762c39..2d49be8 100644 --- a/public/static/system/module/admin.js +++ b/public/static/system/module/admin.js @@ -692,7 +692,8 @@ layui.define(['jquery', 'i18n', 'element', 'layer', 'form', 'rate', 'table', 'sl options.iframeAuto && layer.iframeAuto(index); if (options.type <= 1) { - + // 禁止滚动条 + $(layero).children('.layui-layer-content').css('overflow', 'visible'); if (typeof tableThis !== 'undefined' && !options.disableform) { form.val(options.id, tableThis.data); } @@ -1414,12 +1415,11 @@ layui.define(['jquery', 'i18n', 'element', 'layer', 'form', 'rate', 'table', 'sl layui.each($('.layui-tags'), function (i, e) { $(e).remove(); }) - layui.each($('*[lay-tags]'), function (index, elem) { - - var isTags = layui.tags.render({ + let url = $(elem).data('url') || ''; + let isTags = layui.tags.render({ elem: elem, - url: '/Ajax/getTags', + url: url, done: function (key, all) { } }); diff --git a/public/static/system/module/tags/tags.js b/public/static/system/module/tags/tags.js index 8c73fd4..41736e7 100644 --- a/public/static/system/module/tags/tags.js +++ b/public/static/system/module/tags/tags.js @@ -138,7 +138,7 @@ layui.define(function(exports){ $('#'+ this.config.id + ' .layui-tags-input').before(html); // 限定隐藏元素 - if (this.getData().length == this.config.limit) { + if (this.getData().length === this.config.limit) { $('#'+this.config.id + ' .layui-tags-input').hide(); } @@ -195,11 +195,10 @@ layui.define(function(exports){ // 监听输入框键盘事件 $('body').on('keyup',input,function(e) { - var elem = $(this),keyCode = e.keyCode; - if (options.url !== undefined && keyCode != 13) { + if (options.url !== undefined && keyCode !== 13) { - if (elem.val() != that.TAG_NAME) { + if (elem.val() !== that.TAG_NAME && options.url) { $.ajax({ type: "get", url: options.url, @@ -208,7 +207,7 @@ layui.define(function(exports){ }, // 获取TAGS关键词 success: function(res) { - if (res.code == 200) { + if (res.code === 200) { that.drawHtml(res.data,elem); } } @@ -219,16 +218,16 @@ layui.define(function(exports){ var self = $('.'+LAY_TAG_THIS); // 上键 - if (keyCode == 38) { + if (keyCode === 38) { var prev = self.prev(); - if (prev.length != 0) { + if (prev.length !== 0) { self.removeClass(LAY_TAG_THIS); prev.addClass(LAY_TAG_THIS); } } // 下键 - else if (keyCode == 40) { + else if (keyCode === 40) { var next = self.next(); - if (next.length != 0) { + if (next.length !== 0) { self.removeClass(LAY_TAG_THIS); next.addClass(LAY_TAG_THIS); }