韩盟盟 2 ngày trước cách đây
mục cha
commit
b3669ceea9

+ 6 - 0
.idea/vcs.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="VcsDirectoryMappings">
+    <mapping directory="$PROJECT_DIR$" vcs="Git" />
+  </component>
+</project>

+ 81 - 0
app/Admin/Controllers/SymptomKeywordsController.php

@@ -0,0 +1,81 @@
+<?php
+namespace App\Admin\Controllers;
+
+use App\Http\Controllers\Controller;
+use App\Model\SymptomKeywords;
+use App\Model\ZskWords;
+use Encore\Admin\Form;
+use Encore\Admin\Grid;
+use Encore\Admin\Facades\Admin;
+use Encore\Admin\Layout\Content;
+use Encore\Admin\Controllers\ModelForm;
+use function Clue\StreamFilter\fun;
+
+class SymptomKeywordsController extends Controller
+{
+    use ModelForm;
+    public function index()
+    {
+        return Admin::content(function (Content $content) {
+            $content->header('匹配症状关键词');
+            $content->description('列表');
+            $content->body($this->grid());
+        });
+    }
+
+    public function create()
+    {
+        return Admin::content(function (Content $content) {
+            $content->header('匹配症状关键词');
+            $content->description('新增');
+            $content->body($this->form());
+        });
+    }
+
+    public function edit($id)
+    {
+        return Admin::content(function (Content $content) use ($id) {
+            $content->header('匹配症状关键词');
+            $content->description('列表');
+            $content->body($this->form($id)->edit($id));
+        });
+    }
+
+    protected function form($id = '')
+    {
+        return Admin::form(SymptomKeywords::class, function (Form $form) {
+            $form->display('id'       , '序号');
+            $form->text('keyword'       , '症状名称')->required();
+            $form->saving(function (Form $form) {
+                if(is_null($form->parent_id)) {
+                    $form->parent_id = 0;
+                }
+            });
+        });
+    }
+
+    // Grid
+    protected function grid()
+    {
+        return Admin::grid(SymptomKeywords::class, function (Grid $grid) {
+            $grid->id('编号')->sortable();
+            $grid->keyword('症状名称');
+            $grid->created_at('创建时间');
+            $grid->updated_at('更新时间');
+
+            // 禁用导出数据按钮
+            $grid->actions(function ($actions) {
+                $actions->disableView();
+                //$actions->disableEdit();
+            });
+
+            $grid->filter(function($filter){
+
+                // 去掉默认的id过滤器
+                $filter->disableIdFilter();
+            });
+
+
+        });
+    }
+}

+ 11 - 0
app/Model/SymptomKeywords.php

@@ -0,0 +1,11 @@
+<?php
+namespace App\Model;
+
+use Illuminate\Database\Eloquent\Model;
+
+class SymptomKeywords extends Model
+{
+    public $table = "jm_cdss_symptom_keywords";
+
+    public $timestamps = false;
+}