Browse Source

站点菜单

moshaorui 5 months ago
parent
commit
4d9b3ef8c6
30 changed files with 705 additions and 59 deletions
  1. 2 1
      app/Admin/Controllers/BaseProductCategoryController.php
  2. 3 3
      app/Admin/Controllers/BaseProductController.php
  3. 2 1
      app/Admin/Controllers/BaseProductParameterController.php
  4. 2 2
      app/Admin/Controllers/BaseVideoCategoryController.php
  5. 3 3
      app/Admin/Controllers/BaseVideoController.php
  6. 1 1
      app/Admin/Controllers/DistAdminDistributorController.php
  7. 2 2
      app/Admin/Controllers/DistAdminUserController.php
  8. 1 1
      app/Admin/Controllers/DistAppearanceController.php
  9. 2 2
      app/Admin/Controllers/DistInquiryController.php
  10. 76 0
      app/Distributor/Controllers/ApiController.php
  11. 1 1
      app/Distributor/Controllers/SettingsController.php
  12. 208 0
      app/Distributor/Controllers/SiteMenuController.php
  13. 94 0
      app/Distributor/Controllers/SitePostController.php
  14. 17 0
      app/Distributor/Repositories/DistProduct.php
  15. 8 0
      app/Distributor/Repositories/DistProductCategory.php
  16. 32 0
      app/Distributor/Repositories/SiteMenu.php
  17. 33 0
      app/Distributor/Repositories/SitePages.php
  18. 32 0
      app/Distributor/Repositories/SitePagesTag.php
  19. 16 0
      app/Distributor/Repositories/SitePagesTagRelationship.php
  20. 12 8
      app/Distributor/routes.php
  21. 30 0
      app/Models/SiteMenu.php
  22. 14 0
      app/Models/SitePages.php
  23. 15 0
      app/Models/SitePagesTag.php
  24. 15 0
      app/Models/SitePagesTagRelationship.php
  25. 12 0
      config/dictionary.php
  26. 8 0
      lang/en/admin.php
  27. 46 33
      lang/en/global.php
  28. 4 0
      lang/zh_CN/admin.php
  29. 11 0
      lang/zh_CN/global.php
  30. 3 1
      lang/zh_CN/menu.php

+ 2 - 1
app/Admin/Controllers/BaseProductCategoryController.php

@@ -15,8 +15,9 @@ class BaseProductCategoryController extends AdminController
     public function index(Content $content)
     {
         return $content
-            ->header('Product Category')
+            ->header(admin_trans( 'admin.proudct_category'))
             ->description('')
+            ->breadcrumb(['text'=>'list','url'=>''])
             ->body($this->grid());
     }
 

+ 3 - 3
app/Admin/Controllers/BaseProductController.php

@@ -19,9 +19,9 @@ class BaseProductController extends AdminController
     public function index(Content $content)
     {
         return $content
-            ->header(' Product Management')
-            ->description('all')
-            ->breadcrumb(['text'=>'Product Management','url'=>''])
+            ->header(admin_trans( 'admin.products_list'))
+            ->description('')
+            ->breadcrumb(['text'=>'list','url'=>''])
             ->body($this->grid());
     }
 

+ 2 - 1
app/Admin/Controllers/BaseProductParameterController.php

@@ -15,8 +15,9 @@ class BaseProductParameterController extends AdminController
     public function index(Content $content)
     {
         return $content
-            ->header('Product Parameter')
+            ->header(admin_trans( 'admin.product_parameter'))
             ->description('')
+            ->breadcrumb(['text'=>'list','url'=>''])
             ->body($this->grid());
     }
 

+ 2 - 2
app/Admin/Controllers/BaseVideoCategoryController.php

@@ -19,9 +19,9 @@ class BaseVideoCategoryController extends AdminController
     public function index(Content $content)
     {
         return $content
-            ->header('Video Category')
+            ->header(admin_trans( 'admin.video_category'))
             ->description('')
-            ->breadcrumb(['text'=>'Video Category','url'=>''])
+            ->breadcrumb(['text'=>'list','url'=>''])
             ->body($this->grid());
     }
 

+ 3 - 3
app/Admin/Controllers/BaseVideoController.php

@@ -20,9 +20,9 @@ class BaseVideoController extends AdminController
     public function index(Content $content)
     {
         return $content
-            ->header('Video Management')
-            ->description('all')
-            ->breadcrumb(['text'=>'Video Management','url'=>''])
+            ->header(admin_trans( 'admin.video_list'))
+            ->description('')
+            ->breadcrumb(['text'=>'list','url'=>''])
             ->body($this->grid());
     }
 

+ 1 - 1
app/Admin/Controllers/DistAdminDistributorController.php

@@ -20,7 +20,7 @@ class DistAdminDistributorController extends AdminController
     public function index(Content $content)
     {
         return $content
-            ->header('Distro Management')
+            ->header(admin_trans( 'admin.distro_management'))
             ->description('')
             ->breadcrumb(['text'=>'list','url'=>''])
             ->body($this->grid());

+ 2 - 2
app/Admin/Controllers/DistAdminUserController.php

@@ -18,8 +18,8 @@ class DistAdminUserController extends AdminController
     public function index(Content $content)
     {
         return $content
-            ->header('Users Management')
-            ->description('Users Management')
+            ->header(admin_trans( 'admin.users_management'))
+            ->description('')
             ->breadcrumb(['text'=>'list','url'=>''])
             ->body($this->grid());
     }

+ 1 - 1
app/Admin/Controllers/DistAppearanceController.php

@@ -20,7 +20,7 @@ class DistAppearanceController extends AdminController
     public function index(Content $content)
     {
         return $content
-            ->header('Appearance')
+            ->header(admin_trans( 'admin.appearance'))
             ->description('')
             ->breadcrumb(['text'=>'list','url'=>''])
             ->body($this->grid());

+ 2 - 2
app/Admin/Controllers/DistInquiryController.php

@@ -19,8 +19,8 @@ class DistInquiryController extends AdminController
     public function index(Content $content)
     {
         return $content
-            ->header('Inquiry Management')
-            ->description('all')
+            ->header(admin_trans( 'admin.inquiry_management'))
+            ->description('')
             ->breadcrumb(['text'=>'list','url'=>''])
             ->body($this->grid());
     }

+ 76 - 0
app/Distributor/Controllers/ApiController.php

@@ -0,0 +1,76 @@
+<?php
+
+namespace App\Distributor\Controllers;
+
+
+
+
+
+use App\Distributor\Repositories\DistProduct;
+use App\Distributor\Repositories\SitePages;
+use App\Distributor\Repositories\SitePagesTag;
+use Illuminate\Http\Request;
+use Illuminate\Routing\Controller;
+
+class ApiController extends Controller
+{
+    /**
+     * 产品下接API,默认返回50个最新的产品
+     */
+    public function products(Request $request)
+    {
+        $q = $request->get('q');
+        if ($q != null) {
+            // 模糊搜索
+            $obj = new DistProduct();
+            return $obj->model()->where('title', 'like', "%$q%")->paginate(null, ['id', 'title as text']);
+        } else {
+            // 获取最新的50个
+            $selectOptionsNew =  DistProduct::selectOptionsNew();
+            return $this->changeOptions($selectOptionsNew);
+        }
+    }
+
+    public function pages(Request $request)
+    {
+        $q = $request->get('q');
+        if ($q != null) {
+            // 模糊搜索
+            $obj = new SitePages();
+            return $obj->model()->where('title', 'like', "%$q%")->paginate(null, ['id', 'title as text']);
+        } else {
+            // 获取最新的50个
+            $selectOptionsNew =  SitePages::selectOptionsNew();
+            return $this->changeOptions($selectOptionsNew);
+        }
+    }
+
+    public function tag(Request $request)
+    {
+        $q = $request->get('q');
+        if ($q != null) {
+            // 模糊搜索
+            $obj = new SitePagesTag();
+            return $obj->model()->where('name', 'like', "%$q%")->paginate(null, ['id', 'name as text']);
+        } else {
+            // 获取最新的50个
+            $selectOptionsNew =  SitePagesTag::selectOptionsNew();
+            return $this->changeOptions($selectOptionsNew);
+        }
+    }
+
+
+    private function changeOptions($data) {
+// 初始化结果数组
+        $result = [];
+// 遍历原始数据并转换格式
+        foreach ($data as $id => $text) {
+            $result[] = [
+                'id' => (int)$id,  // 将字符串转换为整数
+                'text' => $text
+            ];
+        }
+        return $result;
+    }
+
+}

+ 1 - 1
app/Distributor/Controllers/SettingsController.php

@@ -15,7 +15,7 @@ class SettingsController extends Controller
 
     public function index(Content $content)
     {
-        return $content->title(admin_trans( 'admin.settings'))
+        return $content->title(admin_trans( 'admin.domain'))
             ->body(
 <<<HTML
 <div class="card">{$this->form()->render()}</div>

+ 208 - 0
app/Distributor/Controllers/SiteMenuController.php

@@ -0,0 +1,208 @@
+<?php
+
+namespace App\Distributor\Controllers;
+
+
+
+
+use App\Distributor\Repositories\DistProduct;
+use App\Distributor\Repositories\DistProductCategory;
+use App\Distributor\Repositories\SiteMenu;
+use App\Distributor\Repositories\SitePages;
+use App\Distributor\Repositories\SitePagesTag;
+use Dcat\Admin\Form;
+use Dcat\Admin\Grid;
+use Dcat\Admin\Show;
+use Dcat\Admin\Http\Controllers\AdminController;
+use Dcat\Admin\Layout\Content;
+use Dcat\Admin\Admin;
+use Dcat\Admin\Tree;
+use Dcat\Admin\Layout\Row;
+use function Symfony\Component\String\u;
+
+class SiteMenuController extends AdminController
+{
+    /**
+     * page index
+     */
+    public function index(Content $content)
+    {
+        return $content
+            ->header(admin_trans( 'admin.top_menu') )
+            ->description('')
+            ->body($this->tree());
+    }
+
+    private function tree()
+    {
+        return function (Row $row) {
+            $tree = new Tree(new SiteMenu);
+
+            $tree->branch(function ($branch) {
+                $arr[] = $branch['title'];
+                if ($branch['uri']) {
+                    $arr[] = $branch['uri'];
+                }
+                return implode(' - ', $arr);
+            });
+
+            //按钮
+            $tree->disableEditButton();
+            $tree->disableCreateButton();
+            $tree->showQuickCreateButton();
+            $tree->showQuickEditButton();
+            $row->column(6, $tree);
+        };
+    }
+
+    /**
+     * Make a grid builder.
+     *
+     * @return Grid
+     */
+//    protected function grid()
+//    {
+//        return Grid::make(new SiteMenu(), function (Grid $grid) {
+//            $grid->column('id')->sortable();
+//            $grid->column('parent_id');
+//            $grid->column('order');
+//            $grid->column('title');
+//            $grid->column('uri');
+//            $grid->column('show');
+//            $grid->column('menu_type');
+//            $grid->column('menu_config');
+//            $grid->column('created_at');
+//            $grid->column('updated_at')->sortable();
+//
+//            $grid->filter(function (Grid\Filter $filter) {
+//                $filter->equal('id');
+//
+//            });
+//        });
+//    }
+
+    /**
+     * Make a show builder.
+     *
+     * @param mixed $id
+     *
+     * @return Show
+     */
+//    protected function detail($id)
+//    {
+//        return Show::make($id, new SiteMenu(), function (Show $show) {
+//            $show->field('id');
+//            $show->field('parent_id');
+//            $show->field('order');
+//            $show->field('title');
+//            $show->field('uri');
+//            $show->field('show');
+//            $show->field('menu_type');
+//            $show->field('menu_config');
+//            $show->field('created_at');
+//            $show->field('updated_at');
+//        });
+//    }
+
+    /**
+     * Make a form builder.
+     *
+     * @return Form
+     */
+    protected function form()
+    {
+        $thisObject = $this;
+        return Form::make(new SiteMenu(), function (Form $form) use ($thisObject) {
+            $menuConfig = $form->model()->menu_config;
+            $form->select('parent_id', admin_trans_label('parent_id'))
+                ->options(SiteMenu::selectOptions())
+                ->required();
+            $form->text('title')->required();
+            $form->select('menu_type')->options(config('dictionary.menu_type'))->required()
+                ->when(1, function (Form $form) use ($menuConfig,$thisObject) {
+                    //选择产品
+                    $form->select('collections_type')->options(config('dictionary.collections_type'))
+                        ->value($thisObject->getArrayValue('collections_type',$menuConfig))
+                        ->when(0, function (Form $form) use ($menuConfig,$thisObject) {
+                            $form->select('product_category')->options(DistProductCategory::selectOptions())->value($thisObject->getArrayValue('product_category',$menuConfig));
+                        })->when(1, function (Form $form) use ($menuConfig,$thisObject) {
+                            $form->select('pages_tag')->options('api/tag')->value($thisObject->getArrayValue('posts_tag',$menuConfig));
+                        });
+                })
+                ->when(2, function (Form $form) use ($menuConfig,$thisObject) {
+                    //选择产品
+                    $form->select('product',admin_trans_label('select_product'))->options('api/products')
+                        ->value($thisObject->getArrayValue('product',$menuConfig))
+                        ->help('The latest 30 products are displayed by default, and you can also use the search function to find all products.');
+                })
+                ->when(3, function (Form $form) use ($menuConfig,$thisObject) {
+                    //选择页面
+                    $form->select('posts',admin_trans_label('select_pages'))->options('api/pages')
+                        ->value($thisObject->getArrayValue('posts',$menuConfig))
+                        ->help('The latest 30 published posts are displayed by default, and you can also use the search function to find all posts.');
+                })
+                ->when(4, function (Form $form) use ($menuConfig,$thisObject) {
+                    //url
+                    $form->url('url')->value($thisObject->getArrayValue('url',$menuConfig));
+                });
+
+            $form->switch('show')->default(1);
+            $form->hidden('uri');
+            $form->textarea('menu_config')->hideInDialog();
+            $form->ignore(['collections_type','product_category','pages_tag','product','posts','url']);
+            //保存事件
+            $form->submitted(function (Form $form) use ($thisObject) {
+                $result = $thisObject->convertMenuConfig($form);
+                $form->uri = $result['uri'];
+                $form->menu_config = $result['menuConfig'];
+            });
+        });
+    }
+
+    protected function convertMenuConfig(Form $form) {
+        $uri = "";
+        $menuConfig = [
+            'collections_type' => $form->input('collections_type'),
+            'product_category' => $form->input('product_category'),
+            'posts_tag' => $form->input('posts_tag'),
+            'product' => $form->input('product'),
+            'posts' => $form->input('posts'),
+            'url' => $form->input('url'),
+        ];
+        $menuType = $form->input('menu_type');
+        switch ($menuType) {
+            case 0: //选择产品
+                $uri ="/";
+                break;
+            case 1: //集合
+                if ($form->input('collections_type') == 0) {
+                    //产品分类
+                    $row = DistProductCategory::getOneById($form->input('product_category'));
+                    $uri = $row ? "/product-category/".$row->slug : "/";
+                } else {
+                    //文章标签
+                    $row = SitePagesTag::getOneById($form->input('posts_tag'));
+                    $uri = $row ? "/collections/".$row->slug : "/";
+                }
+                break;
+            case 2: //选择产品
+                $row = DistProduct::getOneById($form->input('product'));
+                $uri = $row ? "/products/".$row->slug : "/";
+                break;
+            case 3: //选择页面
+                $row = SitePages::getOneById($form->input('posts'));
+                $uri = $row ? "/pages/".$row->slug : "/";
+                break;
+            case 4: //url
+                $uri = $form->input('url');
+                break;
+        }
+        return ['uri'=>$uri,'menuConfig'=>$menuConfig];
+    }
+    protected function getArrayValue($key,$arr) {
+        if (isset($arr[$key])) {
+            return $arr[$key];
+        }
+        return "";
+    }
+}

+ 94 - 0
app/Distributor/Controllers/SitePostController.php

@@ -0,0 +1,94 @@
+<?php
+
+namespace App\Distributor\Controllers;
+
+use App\Distributor\Repositories\SitePost;
+use Dcat\Admin\Form;
+use Dcat\Admin\Grid;
+use Dcat\Admin\Show;
+use Dcat\Admin\Http\Controllers\AdminController;
+use Dcat\Admin\Layout\Content;
+use Dcat\Admin\Admin;
+
+class SitePostController extends AdminController
+{
+    /**
+     * page index
+     */
+    public function index(Content $content)
+    {
+        return $content
+            ->header('列表')
+            ->description('全部')
+            ->breadcrumb(['text'=>'列表','url'=>''])
+            ->body($this->grid());
+    }
+
+    /**
+     * Make a grid builder.
+     *
+     * @return Grid
+     */
+    protected function grid()
+    {
+        return Grid::make(new SitePost(), function (Grid $grid) {
+            $grid->column('id')->sortable();
+            $grid->column('title');
+            $grid->column('content');
+            $grid->column('slug');
+            $grid->column('status');
+            $grid->column('author');
+            $grid->column('post_date');
+            $grid->column('created_at');
+            $grid->column('updated_at')->sortable();
+        
+            $grid->filter(function (Grid\Filter $filter) {
+                $filter->equal('id');
+        
+            });
+        });
+    }
+
+    /**
+     * Make a show builder.
+     *
+     * @param mixed $id
+     *
+     * @return Show
+     */
+    protected function detail($id)
+    {
+        return Show::make($id, new SitePost(), function (Show $show) {
+            $show->field('id');
+            $show->field('title');
+            $show->field('content');
+            $show->field('slug');
+            $show->field('status');
+            $show->field('author');
+            $show->field('post_date');
+            $show->field('created_at');
+            $show->field('updated_at');
+        });
+    }
+
+    /**
+     * Make a form builder.
+     *
+     * @return Form
+     */
+    protected function form()
+    {
+        return Form::make(new SitePost(), function (Form $form) {
+            $form->display('id');
+            $form->text('title');
+            $form->text('content');
+            $form->text('slug');
+            $form->text('status');
+            $form->text('author');
+            $form->text('post_date');
+        
+            $form->display('created_at');
+            $form->display('updated_at');
+        });
+    }
+}

+ 17 - 0
app/Distributor/Repositories/DistProduct.php

@@ -38,4 +38,21 @@ class DistProduct extends EloquentRepository
         return Model::find($id); // 查找并返回相应的记录
     }
 
+
+    /*
+     * 查找最新的N个产品
+     */
+    public static function selectOptionsNew($limit=30)
+    {
+        return Model::where('dist_id', getDistributorId())->where('enabled', 1)->orderBy('created_at', 'desc')->limit($limit)->pluck('title', 'id');
+    }
+
+
+    /*
+     * 获取一个标签
+     */
+    public static function getOneById($id)
+    {
+        return Model::where('id', $id)->where('dist_id', getDistributorId())->first();
+    }
 }

+ 8 - 0
app/Distributor/Repositories/DistProductCategory.php

@@ -115,4 +115,12 @@ class DistProductCategory extends EloquentRepository
     }
 
 
+
+    /*
+     * 获取一个分类
+     */
+    public static function getOneById($id)
+    {
+        return Model::where('id', $id)->where('dist_id', getDistributorId())->first();
+    }
 }

+ 32 - 0
app/Distributor/Repositories/SiteMenu.php

@@ -0,0 +1,32 @@
+<?php
+
+namespace App\Distributor\Repositories;
+
+use Dcat\Admin\Traits\ModelTree;
+use App\Models\SiteMenu as Model;
+use Dcat\Admin\Repositories\EloquentRepository;
+
+class SiteMenu extends EloquentRepository
+{
+
+    /**
+     * Model.
+     *
+     * @var string
+     */
+    protected $eloquentClass = Model::class;
+
+    public static function selectOptions(\Closure $closure = null)
+    {
+        if (!$closure) {
+            $closure = function ($query) {
+                $query =  $query->orderBy('order', 'asc');
+                return $query;
+            };
+        }
+
+        $selectOptions =  Model::class::selectOptions($closure);
+        return $selectOptions;
+    }
+
+}

+ 33 - 0
app/Distributor/Repositories/SitePages.php

@@ -0,0 +1,33 @@
+<?php
+
+namespace App\Distributor\Repositories;
+
+use App\Models\SitePages as Model;
+use Dcat\Admin\Repositories\EloquentRepository;
+
+class SitePages extends EloquentRepository
+{
+    /**
+     * Model.
+     *
+     * @var string
+     */
+    protected $eloquentClass = Model::class;
+
+    /*
+     * 查找最新的N个文章
+     */
+    public static function selectOptionsNew($limit=30)
+    {
+        return Model::where('dist_id', getDistributorId())->where('status', 1)->orderBy('created_at', 'desc')->limit($limit)->pluck('title', 'id');
+    }
+
+    /*
+ * 获取一个标签
+ */
+    public static function getOneById($id)
+    {
+        return Model::where('id', $id)->where('dist_id', getDistributorId())->first();
+    }
+
+}

+ 32 - 0
app/Distributor/Repositories/SitePagesTag.php

@@ -0,0 +1,32 @@
+<?php
+
+namespace App\Distributor\Repositories;
+
+use App\Models\SitePagesTag as Model;
+use Dcat\Admin\Repositories\EloquentRepository;
+
+class SitePagesTag extends EloquentRepository
+{
+    /**
+     * Model.
+     *
+     * @var string
+     */
+    protected $eloquentClass = Model::class;
+
+    /*
+     * 查找最新的N个标签
+     */
+    public static function selectOptionsNew($limit=30)
+    {
+        return Model::where('dist_id', getDistributorId())->orderBy('created_at', 'desc')->limit($limit)->pluck('name', 'id');
+    }
+
+    /*
+     * 获取一个标签
+     */
+    public static function getOneById($id)
+    {
+        return Model::where('id', $id)->where('dist_id', getDistributorId())->first();
+    }
+}

+ 16 - 0
app/Distributor/Repositories/SitePagesTagRelationship.php

@@ -0,0 +1,16 @@
+<?php
+
+namespace App\Distributor\Repositories;
+
+use App\Models\SitePagesTagRelationship as Model;
+use Dcat\Admin\Repositories\EloquentRepository;
+
+class SitePagesTagRelationship extends EloquentRepository
+{
+    /**
+     * Model.
+     *
+     * @var string
+     */
+    protected $eloquentClass = Model::class;
+}

+ 12 - 8
app/Distributor/routes.php

@@ -1,5 +1,6 @@
 <?php
 
+use App\Distributor\Controllers\ApiController;
 use App\Distributor\Controllers\DistAppearanceController;
 use App\Distributor\Controllers\DistInquiryController;
 use App\Distributor\Controllers\SettingsController;
@@ -32,19 +33,22 @@ Route::group([
     $router->resource('video-category', 'DistVideoCategoryController');
     //视频管理
     $router->resource('dist-video', 'DistVideoController');
-
     //产品导入
     $router->resource('import-product', 'importProductController');
-
     //询价管理
-    $router->get('/dist-inquiry', [DistInquiryController::class, 'index']);
-    $router->get('/dist-inquiry/{id}', [DistInquiryController::class, 'show']);
+    $router->get('dist-inquiry', [DistInquiryController::class, 'index']);
+    $router->get('dist-inquiry/{id}', [DistInquiryController::class, 'show']);
     //配置
-    $router->get('/dist-settings', [SettingsController::class, 'index']);
-    $router->post('/dist-settings', [SettingsController::class, 'store']);
+    $router->get('dist-settings', [SettingsController::class, 'index']);
+    $router->post('dist-settings', [SettingsController::class, 'store']);
     //外观选择
-    $router->get('/dist-appearance', [DistAppearanceController::class, 'index']);
-
+    $router->get('dist-appearance', [DistAppearanceController::class, 'index']);
+    //菜单管理
+    $router->resource('site-menu', 'SiteMenuController');
+    //API相关
+    $router->get('api/products', [ApiController::class, 'products']);
+    $router->get('api/pages', [ApiController::class, 'pages']);
+    $router->get('api/tag', [ApiController::class, 'tag']);
 });
 
 

+ 30 - 0
app/Models/SiteMenu.php

@@ -0,0 +1,30 @@
+<?php
+
+namespace App\Models;
+
+use Dcat\Admin\Traits\HasDateTimeFormatter;
+
+use Illuminate\Database\Eloquent\Model;
+use Dcat\Admin\Traits\ModelTree;
+
+class SiteMenu extends Model
+{
+	use HasDateTimeFormatter;
+    use ModelTree;
+
+    protected $table = 'site_menu';
+
+    protected $parentColumn = 'parent_id';
+
+    // 排序字段名称,默认值为 order
+    protected $orderColumn = 'order';
+
+    // 标题字段名称,默认值为 title
+    protected $titleColumn = 'title';
+
+    protected $casts = [
+        'created_at' => 'datetime:Y-m-d H:i:s',
+        'updated_at' => 'datetime:Y-m-d H:i:s',
+        'menu_config' => 'json', // 将 menu_config 字段转换为数组
+    ];
+}

+ 14 - 0
app/Models/SitePages.php

@@ -0,0 +1,14 @@
+<?php
+
+namespace App\Models;
+
+use Dcat\Admin\Traits\HasDateTimeFormatter;
+
+use Illuminate\Database\Eloquent\Model;
+
+class SitePages extends Model
+{
+	use HasDateTimeFormatter;
+    protected $table = 'site_pages';
+
+}

+ 15 - 0
app/Models/SitePagesTag.php

@@ -0,0 +1,15 @@
+<?php
+
+namespace App\Models;
+
+use Dcat\Admin\Traits\HasDateTimeFormatter;
+
+use Illuminate\Database\Eloquent\Model;
+
+class SitePagesTag extends Model
+{
+	use HasDateTimeFormatter;
+    protected $table = 'site_pages_tag';
+    public $timestamps = false;
+
+}

+ 15 - 0
app/Models/SitePagesTagRelationship.php

@@ -0,0 +1,15 @@
+<?php
+
+namespace App\Models;
+
+use Dcat\Admin\Traits\HasDateTimeFormatter;
+
+use Illuminate\Database\Eloquent\Model;
+
+class SitePagesTagRelationship extends Model
+{
+	use HasDateTimeFormatter;
+    protected $table = 'site_pages_tag_relationship';
+    public $timestamps = false;
+
+}

+ 12 - 0
config/dictionary.php

@@ -35,5 +35,17 @@ return [
         '1' => 'processing',
         '2' => 'processed',
     ],
+    //菜单类型
+    'menu_type' => [
+        '0' => 'Home page',
+        '1' => 'Collections',
+        '2' => 'Products',
+        '3' => 'Pages',
+        '4' => 'Url',
+    ],
+    'collections_type' => [
+        '0' => 'Product Category',
+        '1' => 'Posts Tag',
+    ],
 
 ];

+ 8 - 0
lang/en/admin.php

@@ -232,4 +232,12 @@ return [
     'video_category'=>'Video Category',
     'video_list'=>'Video List',
     'import'=>'Import Products',
+    'product'  => 'Product',
+    'video'  => 'Video',
+    'dist_product_import'=>'Dist Product Import',
+    'settings'              => 'Settings',
+    'inquiry_management'     => 'Inquiry Management',
+    'appearance' => 'Appearance',
+    'distro_management' => 'Distro Management',
+    'users_management'  => 'Users Management',
 ];

+ 46 - 33
lang/en/global.php

@@ -1,15 +1,16 @@
 <?php
+
 return [
     'fields' => [
-        'id'                    => 'ID',
+        'id'                    => 'Id',
         'name'                  => 'Name',
         'username'              => 'Username',
         'email'                 => 'Email',
         'http_path'             => 'Http Path',
         'password'              => 'Password',
-        'password_confirmation' => 'Password Confirmation',
-        'created_at'            => 'Creation Time',
-        'updated_at'            => 'Update Time',
+        'password_confirmation' => 'Confirm Password',
+        'created_at'            => 'Created At',
+        'updated_at'            => 'Updated At',
         'permissions'           => 'Permissions',
         'slug'                  => 'Slug',
         'user'                  => 'User',
@@ -25,16 +26,16 @@ return [
         'title'                 => 'Product Title',
         'keywords'              => 'Keywords',
         'description'           => 'Description',
-        'sku'                   => 'Product SKU',
+        'sku'                   => 'SKU',
         'category_id'           => 'Category ID',
-        'issuance_date'         => 'Release Date',
+        'issuance_date'         => 'Issuance Date',
         'enabled'               => 'Enabled',
         'content'               => 'Content',
         'parameters'            => 'Product Parameters',
         'is_pinned'             => 'Pinned',
         'parent_id'             => 'Parent ID',
         'remark'                => 'Remark',
-        'parameter_id'          => 'Parameter ID',
+        'parameter_id'          => 'Parameter',
         'products_list'         => 'Product List',
         'images'                => 'Images',
         'parent'                => 'Parent',
@@ -49,7 +50,7 @@ return [
         'site_name'             => 'Site Name',
         'language'              => 'Language',
         'company_name'          => 'Company Name',
-        'level_domain'          => 'Domain',
+        'domain'                => 'Domain',
         'country'               => 'Country',
         'appearance'            => 'Appearance',
         'company_address'       => 'Company Address',
@@ -57,40 +58,52 @@ return [
         'customer_name'         => 'Customer Name',
         'consulting_products'   => 'Consulting Products',
         'status'                => 'Status',
-        'allocate_time'         => 'Allocation Time',
+        'allocate_time'         => 'Allocate Time',
         'freight_forwarder'     => 'Freight Forwarder',
         'business_model'        => 'Business Model',
         'ip_address'            => 'IP Address',
         'folder'                => 'Folder Name',
         'imported'              => 'Imported',
         'describe'              => 'Description',
+        'domain_type'           => 'Domain Type',
+        'secondary_domain'      => 'Secondary Domain',
+        'custom_domain'         => 'Custom Domain',
+        'isEnabled'             => 'Enabled',
     ],
     'labels' => [
-        'list'         => 'List',
-        'edit'         => 'Edit',
-        'detail'       => 'Detail',
-        'create'       => 'Create',
-        'root'         => 'Root',
-        'scaffold'     => 'Scaffold',
-        'category'     => 'Category',
-        'enabled'      => 'Enabled',
-        'Yes'          => 'Yes',
-        'No'           => 'No',
-        'order_tips'   => 'Please enter a number, the larger the number, the higher the rank in the frontend display',
-        'cover_image'  => 'Cover Image',
-        'video_url'    => 'Video URL',
-        'site_name'    => 'Site Name',
-        'company_name' => 'Company Name',
-        'level_domain' => 'Domain',
-        'distributor'  => 'Distributor',
-        'country'      => 'Country',
-        'contact_number' => 'Contact Number',
-        'service_hotline' => 'Service Hotline',
-        'remark'       => 'Remark',
+        'list'                  => 'List',
+        'edit'                  => 'Edit',
+        'detail'                => 'Detail',
+        'create'                => 'Create',
+        'root'                  => 'Root',
+        'scaffold'              => 'Scaffold',
+        'category'              => 'Category',
+        'enabled'               => 'Enabled',
+        'Yes'                   => 'Yes',
+        'No'                    => 'No',
+        'order_tips'            => 'Please enter a number; the smaller the number, the higher the rank on the front page',
+        'cover_image'           => 'Cover Image',
+        'video_url'             => 'Video URL',
+        'site_name'             => 'Site Name',
+        'company_name'          => 'Company Name',
+        'domain'                => 'Domain',
+        'distributor'           => 'Distributor',
+        'country'               => 'Country',
+        'contact_number'        => 'Contact Number',
+        'service_hotline'       => 'Service Hotline',
+        'remark'                => 'Remark',
         'distributor_company_name' => 'Distributor Company Name',
-        'select_products_to_import' => 'Select products and click the import button.',
-        'company_address' => 'Company Address',
-        'import_tmpl'  => 'Import Template'
+        'select_products_to_import' => 'Select products and click Import button.',
+        'company_address'       => 'Company Address',
+        'import_tmpl'           => 'Import Template',
+        'category_name'         => 'Category Name',
+        'parameter_name'        => 'Parameter Name',
+        'assignment'            => 'Assignment',
+        'images'                => 'Images',
+        'process'               => 'Process',
+        'settings'              => 'Settings',
+        'inquiry_management'    => 'Inquiry Management',
+        'enable'                => 'Enable',
     ],
     'options' => [
         //

+ 4 - 0
lang/zh_CN/admin.php

@@ -240,4 +240,8 @@ return [
     'settings'              => '设置',
     'inquiry_management'     => '询价管理',
     'appearance' => '外观',
+    'distro_management' => '分销商管理',
+    'users_management'  => '用户管理',
+    'domain'  => '域名',
+    'top_menu'  => '顶部菜单',
 ];

+ 11 - 0
lang/zh_CN/global.php

@@ -69,6 +69,13 @@ return [
         'secondary_domain'      => '二级域名',
         'custom_domain'         => '自定义域名',
         'isEnabled'             => '是否启用',
+        'show'                  => '是否显示',
+        'menu_type'             => '菜单类型',
+        'menu_config'           => '菜单配置',
+        'Url'                   => 'URL',
+        'collections_type'      => '集合类型',
+        'product_category'      => '产品分类',
+        'pages_tag'             => '文章标签',
     ],
     'labels' => [
         'list'         => '列表',
@@ -104,6 +111,10 @@ return [
         'settings'              => '设置',
         'inquiry_management'    => '询价管理',
         'enable'                => '启用',
+        'parent_id'             => '上级ID',
+        'select_product'        => '选择产品',
+        'select_pages'          => '选择页面',
+        'select_category'       => '选择分类',
     ],
     'options' => [
         //

+ 3 - 1
lang/zh_CN/menu.php

@@ -28,7 +28,9 @@ return [
         'distro_management'    => '分销商管理',
         'users_management'    => '用户管理',
         'inquiry_management'    => '询价管理',
-        'appearance'    => '外观管理',
+        'appearance'    => '外观',
         'settings'    => '设置',
+        'domain'    => '域名',
+        'top_menu'  => '顶部菜单',
     ],
 ];