From 8c440e75e86fa7e6dafdb428c45de904083a68c0 Mon Sep 17 00:00:00 2001 From: tensent Date: Tue, 7 Apr 2020 17:17:02 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8E=E5=8F=B0=E8=A1=A8=E5=8D=95=E6=8F=90?= =?UTF-8?q?=E4=BA=A4=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controller/admin/Config.php | 8 ++- public/static/admin/css/style.css | 19 ++++++- public/static/admin/js/backend.js | 70 +++++++++++-------------- public/static/common/js/require-form.js | 11 ++-- public/static/common/js/sent.js | 8 ++- view/admin/addons/add.html | 2 +- view/admin/category/edit.html | 2 +- view/admin/category/edit_channel.html | 2 +- view/admin/category/operate.html | 2 +- view/admin/channel/edit.html | 2 +- view/admin/channel/sort.html | 2 +- view/admin/client/add.html | 2 +- view/admin/config/edit.html | 2 +- view/admin/config/group.html | 6 +-- view/admin/group/access.html | 4 +- view/admin/group/auth.html | 7 ++- view/admin/group/index.html | 2 +- view/admin/menu/edit.html | 2 +- view/admin/menu/import.html | 2 +- view/admin/menu/sort.html | 2 +- view/admin/public/base.html | 4 +- view/admin/user/auth.html | 2 +- 22 files changed, 89 insertions(+), 74 deletions(-) diff --git a/app/controller/admin/Config.php b/app/controller/admin/Config.php index 7996e18d..ed192f21 100644 --- a/app/controller/admin/Config.php +++ b/app/controller/admin/Config.php @@ -211,15 +211,13 @@ class Config extends Base { */ public function themes(ConfigM $config) { $list = $config->getThemesList($this->request); - $pc = config('config.pc_themes'); - $mobile = config('config.mobile_themes'); + $config = Cache::get('system_config_data'); $this->data = array( - 'pc' => $pc, - 'mobile' => $mobile, + 'pc' => isset($config['pc_themes']) ? $config['pc_themes'] : '', + 'mobile' => isset($config['mobile_themes']) ? $config['mobile_themes'] : '', 'list' => $list, ); - return $this->fetch(); } diff --git a/public/static/admin/css/style.css b/public/static/admin/css/style.css index 5966e42a..0b023cf6 100644 --- a/public/static/admin/css/style.css +++ b/public/static/admin/css/style.css @@ -3,5 +3,22 @@ @import url(../../plugins/adminlte/css/adminlte.min.css); @import url(../../plugins/adminlte/css/skins/_all-skins.min.css); - +.user-list tbody td>img { + position:relative; + max-width:50px; + float:left; + margin-right:15px; + border-radius:18%; + background-clip:padding-box; +} +.user-list tbody td .user-link { + display:block; + font-size:1.25em; + padding-top:3px; + margin-left:60px; +} +.user-list tbody td .user-subhead { + font-size:0.875em; + font-style:italic; +} .tabs-wrapper .nav-tabs{margin-bottom: 15px;} \ No newline at end of file diff --git a/public/static/admin/js/backend.js b/public/static/admin/js/backend.js index ac6c390a..02558943 100644 --- a/public/static/admin/js/backend.js +++ b/public/static/admin/js/backend.js @@ -169,19 +169,24 @@ define(['jquery', 'sent', 'adminlte'], function($, sent, AdminLTE){ * @type Array */ mySkins: ['skin-blue', 'skin-black', 'skin-red', 'skin-yellow', 'skin-purple', 'skin-green', 'skin-blue-light', 'skin-black-light', 'skin-red-light', 'skin-yellow-light', 'skin-purple-light', 'skin-green-light'], - - change_layout: function(cls){ - $("body").toggleClass(cls); - AdminLTE.layout.fixSidebar(); - //Fix the problem with right sidebar and layout boxed - if (cls == "layout-boxed") - AdminLTE.controlSidebar._fix($(".control-sidebar-bg")); - if ($('body').hasClass('fixed') && cls == 'fixed') { - AdminLTE.pushMenu.expandOnHover(); - AdminLTE.layout.activate(); + + change_layout: function(){ + layout = sent.store.get({name: 'layout'}) || [{name: 'fixed', value: false}, {name: 'layout-boxed', value: false}, {name: 'sidebar-collapse', value: false}]; + if (typeof(layout) == 'string'){ return false; } + for (i in layout) { + var item = layout[i]; + if (item.value) { + $("[data-layout='"+item.name+"']").attr('checked', 'checked'); + $("body").hasClass(item.name) || $("body").addClass(item.name); + if ($('body').hasClass('fixed') && item.name == 'fixed') { + AdminLTE.pushMenu.expandOnHover(); + AdminLTE.layout.activate(); + } + }else{ + $("body").removeClass(item.name); + } } - AdminLTE.controlSidebar._fix($(".control-sidebar-bg")); - AdminLTE.controlSidebar._fix($(".control-sidebar")); + AdminLTE.layout.fixSidebar(); }, change_skin: function(cls){ $.each(backend.mySkins, function (i) { @@ -193,9 +198,9 @@ define(['jquery', 'sent', 'adminlte'], function($, sent, AdminLTE){ return false }, init: function(){ - var tmp = sent.store.get({name:'skin'}); - if (tmp && $.inArray(tmp, backend.my_skins)) - backend.change_skin(tmp); + var skin = sent.store.get({name:'skin'}); + if (skin && $.inArray(skin, backend.my_skins)) + backend.change_skin(skin); //Add the change skin listener $("[data-skin]").on('click', function (e) { @@ -205,17 +210,15 @@ define(['jquery', 'sent', 'adminlte'], function($, sent, AdminLTE){ backend.change_skin($(this).data('skin')); }); + backend.change_layout(); //Add the layout manager $("[data-layout]").on('click', function () { - backend.change_layout($(this).data('layout')); - }); - - $("[data-controlsidebar]").on('click', function () { - backend.change_layout($(this).data('controlsidebar')); - var slide = !AdminLTE.options.controlSidebarOptions.slide; - AdminLTE.options.controlSidebarOptions.slide = slide; - if (!slide) - $('.control-sidebar').removeClass('control-sidebar-open'); + var layout = []; + $("[data-layout]").each(function(i, item){ + layout.push({name:$(item).data('layout'), value: $(item).is(':checked')}) + }) + sent.store.set({name:'layout', content: layout}); + backend.change_layout(); }); $("[data-sidebarskin='toggle']").on('click', function () { @@ -230,22 +233,11 @@ define(['jquery', 'sent', 'adminlte'], function($, sent, AdminLTE){ }); $("[data-enable='expandOnHover']").on('click', function () { - $(this).attr('disabled', true); - AdminLTE.pushMenu.expandOnHover(); - if (!$('body').hasClass('sidebar-collapse')) - $("[data-layout='sidebar-collapse']").click(); + $(this).attr('disabled', true); + AdminLTE.pushMenu.expandOnHover(); + if (!$('body').hasClass('sidebar-collapse')) + $("[data-layout='sidebar-collapse']").click(); }); - - // Reset options - if ($('body').hasClass('fixed')) { - $("[data-layout='fixed']").attr('checked', 'checked'); - } - if ($('body').hasClass('layout-boxed')) { - $("[data-layout='layout-boxed']").attr('checked', 'checked'); - } - if ($('body').hasClass('sidebar-collapse')) { - $("[data-layout='sidebar-collapse']").attr('checked', 'checked'); - } if ($('.editable').size() > 0) { require(['bootstrap-editable'], function(){ diff --git a/public/static/common/js/require-form.js b/public/static/common/js/require-form.js index c5ce3587..4068c836 100644 --- a/public/static/common/js/require-form.js +++ b/public/static/common/js/require-form.js @@ -38,13 +38,13 @@ define(['jquery', 'bootstrap', 'validator'], function ($, undefined, Validator) return $msgbox; }, valid: function (ret) { - var that = this, submitBtn = $(".layer-footer [type=submit]", form); + var that = this, submitBtn = $("button.btn[type=submit]", form); that.holdSubmit(true); - submitBtn.addClass("disabled"); + submitBtn.addClass("disabled").attr('disabled', 'disabled'); //验证通过提交表单 var submitResult = Form.api.submit($(ret), function (data, ret) { that.holdSubmit(false); - submitBtn.removeClass("disabled"); + // submitBtn.removeClass("disabled"); if (false === $(this).triggerHandler("success.form", [data, ret])) { return false; } @@ -56,6 +56,11 @@ define(['jquery', 'bootstrap', 'validator'], function ($, undefined, Validator) //提示及关闭当前窗口 var msg = ret.hasOwnProperty("msg") && ret.msg !== "" ? ret.msg : __('Operation completed'); sent.msg(msg, 'success'); + if (ret.url !== '') { + setTimeout(function(){ + window.location.href = ret.url; + }, 3000); + } parent.$(".btn-refresh").trigger("click"); return false; }, function (data, ret) { diff --git a/public/static/common/js/sent.js b/public/static/common/js/sent.js index db3ad720..3b223c07 100644 --- a/public/static/common/js/sent.js +++ b/public/static/common/js/sent.js @@ -1,10 +1,14 @@ -define(['jquery', 'layer', 'form', 'message'], function($, layer, form) { +define(['jquery', 'layer', 'message'], function($, layer) { var sent = { config: { keyName: 'sent_' }, init: function(){ - form.api.bindevent($("form[role=form]")); + if ($("form[role=form]").length > 0) { + require(['form'], function(form){ + form.api.bindevent($("form[role=form]")); + }) + } }, msg: function(text, type){ if (typeof type != 'undefined') { diff --git a/view/admin/addons/add.html b/view/admin/addons/add.html index e3b61b06..a8476b6f 100644 --- a/view/admin/addons/add.html +++ b/view/admin/addons/add.html @@ -10,7 +10,7 @@
-
+
diff --git a/view/admin/category/edit.html b/view/admin/category/edit.html index 702914c5..a6c3dc15 100644 --- a/view/admin/category/edit.html +++ b/view/admin/category/edit.html @@ -5,7 +5,7 @@

{$meta_title}

- +
- +
diff --git a/view/admin/category/operate.html b/view/admin/category/operate.html index 57d2be7e..a842146a 100644 --- a/view/admin/category/operate.html +++ b/view/admin/category/operate.html @@ -8,7 +8,7 @@
- +
diff --git a/view/admin/channel/edit.html b/view/admin/channel/edit.html index 1d6d688e..3b9d72ce 100644 --- a/view/admin/channel/edit.html +++ b/view/admin/channel/edit.html @@ -9,7 +9,7 @@
- +
diff --git a/view/admin/channel/sort.html b/view/admin/channel/sort.html index ab54baa5..1d84fd52 100644 --- a/view/admin/channel/sort.html +++ b/view/admin/channel/sort.html @@ -8,7 +8,7 @@
- +
{/case} {case value="bool"} - - - + + + {/case} {case value="image"} diff --git a/view/admin/group/access.html b/view/admin/group/access.html index 60144e8c..73c1e1d4 100644 --- a/view/admin/group/access.html +++ b/view/admin/group/access.html @@ -4,11 +4,11 @@

{$meta_title}

- + 添加节点 - + 更新节点 diff --git a/view/admin/group/auth.html b/view/admin/group/auth.html index f05d7eea..1b3ec5b7 100644 --- a/view/admin/group/auth.html +++ b/view/admin/group/auth.html @@ -4,15 +4,14 @@
- + diff --git a/view/admin/group/index.html b/view/admin/group/index.html index f1e64a4a..bf5fcaba 100644 --- a/view/admin/group/index.html +++ b/view/admin/group/index.html @@ -7,7 +7,7 @@
diff --git a/view/admin/menu/edit.html b/view/admin/menu/edit.html index f2cb22a1..72ee4fb3 100644 --- a/view/admin/menu/edit.html +++ b/view/admin/menu/edit.html @@ -8,7 +8,7 @@
- +
diff --git a/view/admin/menu/import.html b/view/admin/menu/import.html index 6d5de35a..b5cfb153 100644 --- a/view/admin/menu/import.html +++ b/view/admin/menu/import.html @@ -7,7 +7,7 @@
- +
diff --git a/view/admin/menu/sort.html b/view/admin/menu/sort.html index be262ea0..8d299fc6 100644 --- a/view/admin/menu/sort.html +++ b/view/admin/menu/sort.html @@ -7,7 +7,7 @@
- +