Просмотр исходного кода

新增后台管理面包屑开关配置
优化插件卸载删除表
优化固定列初始化样式

Karson 4 лет назад
Родитель
Сommit
07679a3fe3

+ 13 - 0
application/admin/controller/Addon.php

@@ -161,8 +161,13 @@ class Addon extends Backend
         try {
             Service::uninstall($name, $force);
             if ($tables) {
+                $prefix = Config::get('database.prefix');
                 //删除插件关联表
                 foreach ($tables as $index => $table) {
+                    //忽略非插件标识的表名
+                    if (!preg_match("/^{$prefix}{$name}/", $table)) {
+                        continue;
+                    }
                     Db::execute("DROP TABLE IF EXISTS `{$table}`");
                 }
             }
@@ -389,6 +394,14 @@ class Addon extends Backend
     {
         $name = $this->request->post("name");
         $tables = get_addon_tables($name);
+        $prefix = Config::get('database.prefix');
+        foreach ($tables as $index => $table) {
+            //忽略非插件标识的表名
+            if (!preg_match("/^{$prefix}{$name}/", $table)) {
+                unset($tables[$index]);
+            }
+        }
+        $tables = array_values($tables);
         $this->success('', null, ['tables' => $tables]);
     }
 }

+ 2 - 2
application/admin/view/layout/default.html

@@ -16,7 +16,7 @@
                                     <small>{:__('Control panel')}</small>
                                 </h1>
                             </section>
-                            {if !IS_DIALOG && !$Think.config.fastadmin.multiplenav}
+                            {if !IS_DIALOG && !$Think.config.fastadmin.multiplenav && $Think.config.fastadmin.breadcrumb}
                             <!-- RIBBON -->
                             <div id="ribbon">
                                 <ol class="breadcrumb pull-left">
@@ -42,4 +42,4 @@
         </div>
         {include file="common/script" /}
     </body>
-</html>
+</html>

+ 5 - 2
application/common/controller/Backend.php

@@ -173,8 +173,11 @@ class Backend extends Controller
         }
 
         // 设置面包屑导航数据
-        $breadcrumb = $this->auth->getBreadCrumb($path);
-        array_pop($breadcrumb);
+        $breadcrumb = [];
+        if (!IS_DIALOG && !config('fastadmin.multiplenav') && config('fastadmin.breadcrumb')) {
+            $breadcrumb = $this->auth->getBreadCrumb($path);
+            array_pop($breadcrumb);
+        }
         $this->view->breadcrumb = $breadcrumb;
 
         // 如果有使用模板布局

+ 2 - 0
application/config.php

@@ -277,6 +277,8 @@ return [
         'multipletab'           => true,
         //后台皮肤,为空时表示使用skin-green
         'adminskin'             => '',
+        //后台是否启用面包屑
+        'breadcrumb'            => false,
         //允许跨域的域名,多个以,分隔
         'cors_request_domain'   => 'localhost,127.0.0.1',
         //版本号

+ 6 - 6
public/assets/css/backend.css

@@ -1064,24 +1064,24 @@ table.table-nowrap thead > tr > th {
   position: absolute;
   top: 0;
   height: 100%;
+  min-height: 41px;
   background-color: #fff;
   box-sizing: border-box;
   z-index: 1;
   box-shadow: 0 -1px 8px rgba(0, 0, 0, 0.08);
 }
+.fixed-columns .fixed-table-body,
+.fixed-columns-right .fixed-table-body {
+  min-height: 41px;
+  overflow-x: hidden !important;
+}
 .fixed-columns {
   left: 0;
 }
-.fixed-columns .fixed-table-body {
-  overflow: hidden !important;
-}
 .fixed-columns-right {
   right: 0;
   box-shadow: -1px 0 8px rgba(0, 0, 0, 0.08);
 }
-.fixed-columns-right .fixed-table-body {
-  overflow-x: hidden !important;
-}
 .fix-sticky {
   position: fixed;
   z-index: 100;

Разница между файлами не показана из-за своего большого размера
+ 1 - 1
public/assets/css/backend.min.css


+ 1 - 1
public/assets/js/backend/addon.js

@@ -487,7 +487,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'template'], function
                     return false;
                 }
                 Template.helper("__", __);
-                Layer.confirm(Template("uninstalltpl", {addon: Config['addons'][name]}), function (index, layero) {
+                Layer.confirm(Template("uninstalltpl", {addon: Config['addons'][name]}), {focusBtn: false}, function (index, layero) {
                     uninstall(name, false, $("input[name='droptables']", layero).prop("checked"));
                 });
             });

Разница между файлами не показана из-за своего большого размера
+ 2 - 2
public/assets/js/require-backend.min.js


Разница между файлами не показана из-за своего большого размера
+ 2 - 2
public/assets/js/require-frontend.min.js


+ 7 - 8
public/assets/less/backend.less

@@ -1321,27 +1321,26 @@ table.table-nowrap {
     position: absolute;
     top: 0;
     height: 100%;
+    min-height: 41px;
     background-color: #fff;
     box-sizing: border-box;
     z-index: 1;
     box-shadow: 0 -1px 8px rgba(0, 0, 0, .08);
+
+    .fixed-table-body {
+        min-height: 41px;
+        overflow-x: hidden !important
+    }
+
 }
 
 .fixed-columns {
     left: 0;
-
-    .fixed-table-body {
-        overflow: hidden !important
-    }
 }
 
 .fixed-columns-right {
     right: 0;
     box-shadow: -1px 0 8px rgba(0, 0, 0, .08);
-
-    .fixed-table-body {
-        overflow-x: hidden !important
-    }
 }
 
 .fix-sticky {