xiaogang 3 anos atrás
pai
commit
ee11c7ccf4

+ 84 - 0
app/Admin/Controllers/SystemConfigController.php

xqd
@@ -0,0 +1,84 @@
+<?php
+
+namespace App\Admin\Controllers;
+
+use App\Admin\Repositories\SystemConfig;
+use Dcat\Admin\Form;
+use Dcat\Admin\Grid;
+use Dcat\Admin\Show;
+use Dcat\Admin\Http\Controllers\AdminController;
+
+class SystemConfigController extends AdminController
+{
+    /**
+     * Make a grid builder.
+     *
+     * @return Grid
+     */
+    protected function grid()
+    {
+        return Grid::make(new SystemConfig(), function (Grid $grid) {
+            $grid->column('id')->sortable();
+            $grid->column('title');
+            $grid->column('key');
+            $grid->column('value');
+            $grid->column('info');
+            $grid->column('created_at');
+            $grid->column('updated_at')->sortable();
+
+            $grid->filter(function (Grid\Filter $filter) {
+                $filter->equal('id');
+
+            });
+
+            //操作管理
+            $grid->actions(function (Grid\Displayers\Actions $actions) {
+                $actions->disableDelete();
+            });
+
+            //批量操作
+            $grid->batchActions(function (Grid\Tools\BatchActions $batch) {
+                $batch->disableDelete();
+            });
+        });
+    }
+
+    /**
+     * Make a show builder.
+     *
+     * @param mixed $id
+     *
+     * @return Show
+     */
+    protected function detail($id)
+    {
+        return Show::make($id, new SystemConfig(), function (Show $show) {
+            $show->field('id');
+            $show->field('title');
+            $show->field('key');
+            $show->field('value');
+            $show->field('info');
+            $show->field('created_at');
+            $show->field('updated_at');
+        });
+    }
+
+    /**
+     * Make a form builder.
+     *
+     * @return Form
+     */
+    protected function form()
+    {
+        return Form::make(new SystemConfig(), function (Form $form) {
+            $form->display('id');
+            $form->text('title');
+            $form->text('key');
+            $form->text('value');
+            $form->text('info');
+
+            $form->display('created_at');
+            $form->display('updated_at');
+        });
+    }
+}

+ 3 - 1
app/Admin/Controllers/UsersInfoController.php

xqd
@@ -107,7 +107,9 @@ class UsersInfoController extends AdminController
                 $form->image('url', '图片')->disk("oss")->saveFullUrl()->uniqueName()->removable(false)->autoUpload();
                 $form->radio('state', '阅后即焚')->options([0 => "否", 1 => "是"])->default(0);
             })->saveAsJson();
-            $form->file('video')->saveAsJson();
+            $form->file('video')->saveFullUrl()->uniqueName()->saving(function ($value)use($form){
+
+            });
 
 
             $form->tools(function (Form\Tools $tools) {

+ 15 - 0
resources/lang/zh_CN/system-config.php

xqd
@@ -0,0 +1,15 @@
+<?php
+return [
+    'labels' => [
+        'SystemConfig' => '系统配置',
+        'system-config' => '系统配置',
+    ],
+    'fields' => [
+        'title' => '标题',
+        'key' => '键名',
+        'value' => '键值',
+        'info' => '介绍',
+    ],
+    'options' => [
+    ],
+];