michealwoo 2 years ago
parent
commit
db94d57f8a

+ 92 - 0
app/Admin/Controllers/DailyCareReportController.php

xqd
@@ -0,0 +1,92 @@
+<?php
+
+namespace App\Admin\Controllers;
+
+use App\Models\DailyCareReport;
+use Dcat\Admin\Form;
+use Dcat\Admin\Grid;
+use Dcat\Admin\Show;
+use Dcat\Admin\Http\Controllers\AdminController;
+
+class DailyCareReportController extends AdminController
+{
+    /**
+     * Make a grid builder.
+     *
+     * @return Grid
+     */
+    protected function grid()
+    {
+        return Grid::make(new DailyCareReport(), function (Grid $grid) {
+            $grid->column('student_id');
+            $grid->column('log_type')->using(config('map.log_type'));
+            $grid->column('situation');
+            $grid->column('log_user_id');
+            $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 DailyCareReport(), function (Show $show) {
+            $show->field('id');
+            $show->field('student_id');
+            $show->field('log_type');
+            $show->field('situation');
+            $show->field('log_user_id');
+            $show->field('diet_json');
+            $show->field('drink_json');
+            $show->field('nurse_json');
+            $show->field('defecation_json');
+            $show->field('change_clothes_json');
+            $show->field('emotion_json');
+            $show->field('sleep_json');
+            $show->field('clean_json');
+            $show->field('health_json');
+            $show->field('medication_json');
+            $show->field('temperature_json');
+            $show->field('created_at');
+            $show->field('updated_at');
+        });
+    }
+
+    /**
+     * Make a form builder.
+     *
+     * @return Form
+     */
+    protected function form()
+    {
+        return Form::make(new DailyCareReport(), function (Form $form) {
+            $form->display('id');
+            $form->text('student_id');
+            $form->text('log_type');
+            $form->text('situation');
+            $form->text('log_user_id');
+            $form->text('diet_json');
+            $form->text('drink_json');
+            $form->text('nurse_json');
+            $form->text('defecation_json');
+            $form->text('change_clothes_json');
+            $form->text('emotion_json');
+            $form->text('sleep_json');
+            $form->text('clean_json');
+            $form->text('health_json');
+            $form->text('medication_json');
+            $form->text('temperature_json');
+        
+            $form->display('created_at');
+            $form->display('updated_at');
+        });
+    }
+}

+ 1 - 0
app/Admin/routes.php

xqd
@@ -15,5 +15,6 @@ Route::group([
     $router->get('/', 'HomeController@index');
     $router->resource('/student', 'StudentController');//学生管理
     $router->resource('/babysitting', 'BabysittingController');//观察日志
+    $router->resource('/daily_care_report', 'DailyCareReportController');//观察日志
     
 });

+ 16 - 0
app/Models/DailyCareReport.php

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

+ 3 - 0
config/map.php

xqd
@@ -27,6 +27,9 @@ return [
     1=>'芳芳',
     2=>'小爱',
     3=>'小李'
+  ],
+  'log_type'=>[
+    1=>'日常观察'
   ]
 
 ];

+ 64 - 4
dcat_admin_ide_helper.php

xqd xqd xqd xqd xqd xqd xqd xqd
@@ -39,10 +39,11 @@ namespace Dcat\Admin {
      * @property Grid\Column|Collection look_time
      * @property Grid\Column|Collection is_share_to_parents
      * @property Grid\Column|Collection looker
-     * @property Grid\Column|Collection student_ids
+     * @property Grid\Column|Collection student_id
      * @property Grid\Column|Collection desc
      * @property Grid\Column|Collection photos
      * @property Grid\Column|Collection videos
+     * @property Grid\Column|Collection is_publish
      * @property Grid\Column|Collection choose_ability
      * @property Grid\Column|Collection effective_learn_characteristics
      * @property Grid\Column|Collection next_teach_activity_plan
@@ -79,6 +80,20 @@ namespace Dcat\Admin {
      * @property Grid\Column|Collection failed_at
      * @property Grid\Column|Collection migration
      * @property Grid\Column|Collection batch
+     * @property Grid\Column|Collection log_type
+     * @property Grid\Column|Collection situation
+     * @property Grid\Column|Collection log_user_id
+     * @property Grid\Column|Collection diet_json
+     * @property Grid\Column|Collection drink_json
+     * @property Grid\Column|Collection nurse_json
+     * @property Grid\Column|Collection defecation_json
+     * @property Grid\Column|Collection change_clothes_json
+     * @property Grid\Column|Collection emotion_json
+     * @property Grid\Column|Collection sleep_json
+     * @property Grid\Column|Collection clean_json
+     * @property Grid\Column|Collection health_json
+     * @property Grid\Column|Collection medication_json
+     * @property Grid\Column|Collection temperature_json
      * @property Grid\Column|Collection en_title
      * @property Grid\Column|Collection content
      * @property Grid\Column|Collection en_content
@@ -164,10 +179,11 @@ namespace Dcat\Admin {
      * @method Grid\Column|Collection look_time(string $label = null)
      * @method Grid\Column|Collection is_share_to_parents(string $label = null)
      * @method Grid\Column|Collection looker(string $label = null)
-     * @method Grid\Column|Collection student_ids(string $label = null)
+     * @method Grid\Column|Collection student_id(string $label = null)
      * @method Grid\Column|Collection desc(string $label = null)
      * @method Grid\Column|Collection photos(string $label = null)
      * @method Grid\Column|Collection videos(string $label = null)
+     * @method Grid\Column|Collection is_publish(string $label = null)
      * @method Grid\Column|Collection choose_ability(string $label = null)
      * @method Grid\Column|Collection effective_learn_characteristics(string $label = null)
      * @method Grid\Column|Collection next_teach_activity_plan(string $label = null)
@@ -204,6 +220,20 @@ namespace Dcat\Admin {
      * @method Grid\Column|Collection failed_at(string $label = null)
      * @method Grid\Column|Collection migration(string $label = null)
      * @method Grid\Column|Collection batch(string $label = null)
+     * @method Grid\Column|Collection log_type(string $label = null)
+     * @method Grid\Column|Collection situation(string $label = null)
+     * @method Grid\Column|Collection log_user_id(string $label = null)
+     * @method Grid\Column|Collection diet_json(string $label = null)
+     * @method Grid\Column|Collection drink_json(string $label = null)
+     * @method Grid\Column|Collection nurse_json(string $label = null)
+     * @method Grid\Column|Collection defecation_json(string $label = null)
+     * @method Grid\Column|Collection change_clothes_json(string $label = null)
+     * @method Grid\Column|Collection emotion_json(string $label = null)
+     * @method Grid\Column|Collection sleep_json(string $label = null)
+     * @method Grid\Column|Collection clean_json(string $label = null)
+     * @method Grid\Column|Collection health_json(string $label = null)
+     * @method Grid\Column|Collection medication_json(string $label = null)
+     * @method Grid\Column|Collection temperature_json(string $label = null)
      * @method Grid\Column|Collection en_title(string $label = null)
      * @method Grid\Column|Collection content(string $label = null)
      * @method Grid\Column|Collection en_content(string $label = null)
@@ -294,10 +324,11 @@ namespace Dcat\Admin {
      * @property Show\Field|Collection look_time
      * @property Show\Field|Collection is_share_to_parents
      * @property Show\Field|Collection looker
-     * @property Show\Field|Collection student_ids
+     * @property Show\Field|Collection student_id
      * @property Show\Field|Collection desc
      * @property Show\Field|Collection photos
      * @property Show\Field|Collection videos
+     * @property Show\Field|Collection is_publish
      * @property Show\Field|Collection choose_ability
      * @property Show\Field|Collection effective_learn_characteristics
      * @property Show\Field|Collection next_teach_activity_plan
@@ -334,6 +365,20 @@ namespace Dcat\Admin {
      * @property Show\Field|Collection failed_at
      * @property Show\Field|Collection migration
      * @property Show\Field|Collection batch
+     * @property Show\Field|Collection log_type
+     * @property Show\Field|Collection situation
+     * @property Show\Field|Collection log_user_id
+     * @property Show\Field|Collection diet_json
+     * @property Show\Field|Collection drink_json
+     * @property Show\Field|Collection nurse_json
+     * @property Show\Field|Collection defecation_json
+     * @property Show\Field|Collection change_clothes_json
+     * @property Show\Field|Collection emotion_json
+     * @property Show\Field|Collection sleep_json
+     * @property Show\Field|Collection clean_json
+     * @property Show\Field|Collection health_json
+     * @property Show\Field|Collection medication_json
+     * @property Show\Field|Collection temperature_json
      * @property Show\Field|Collection en_title
      * @property Show\Field|Collection content
      * @property Show\Field|Collection en_content
@@ -419,10 +464,11 @@ namespace Dcat\Admin {
      * @method Show\Field|Collection look_time(string $label = null)
      * @method Show\Field|Collection is_share_to_parents(string $label = null)
      * @method Show\Field|Collection looker(string $label = null)
-     * @method Show\Field|Collection student_ids(string $label = null)
+     * @method Show\Field|Collection student_id(string $label = null)
      * @method Show\Field|Collection desc(string $label = null)
      * @method Show\Field|Collection photos(string $label = null)
      * @method Show\Field|Collection videos(string $label = null)
+     * @method Show\Field|Collection is_publish(string $label = null)
      * @method Show\Field|Collection choose_ability(string $label = null)
      * @method Show\Field|Collection effective_learn_characteristics(string $label = null)
      * @method Show\Field|Collection next_teach_activity_plan(string $label = null)
@@ -459,6 +505,20 @@ namespace Dcat\Admin {
      * @method Show\Field|Collection failed_at(string $label = null)
      * @method Show\Field|Collection migration(string $label = null)
      * @method Show\Field|Collection batch(string $label = null)
+     * @method Show\Field|Collection log_type(string $label = null)
+     * @method Show\Field|Collection situation(string $label = null)
+     * @method Show\Field|Collection log_user_id(string $label = null)
+     * @method Show\Field|Collection diet_json(string $label = null)
+     * @method Show\Field|Collection drink_json(string $label = null)
+     * @method Show\Field|Collection nurse_json(string $label = null)
+     * @method Show\Field|Collection defecation_json(string $label = null)
+     * @method Show\Field|Collection change_clothes_json(string $label = null)
+     * @method Show\Field|Collection emotion_json(string $label = null)
+     * @method Show\Field|Collection sleep_json(string $label = null)
+     * @method Show\Field|Collection clean_json(string $label = null)
+     * @method Show\Field|Collection health_json(string $label = null)
+     * @method Show\Field|Collection medication_json(string $label = null)
+     * @method Show\Field|Collection temperature_json(string $label = null)
      * @method Show\Field|Collection en_title(string $label = null)
      * @method Show\Field|Collection content(string $label = null)
      * @method Show\Field|Collection en_content(string $label = null)

+ 27 - 0
resources/lang/zh-CN/daily-care-report.php

xqd
@@ -0,0 +1,27 @@
+<?php 
+return [
+    'labels' => [
+        'DailyCareReport' => '照护日报',
+        'daily-care-report' => '照护日报',
+        'daily_care_report' => '照护日报',
+    ],
+    'fields' => [
+        'student_id' => '学生姓名',
+        'log_type' => '记录类型',
+        'situation' => '记录情况',
+        'log_user_id' => '记录人',
+        'diet_json' => '饮食',
+        'drink_json' => '饮水',
+        'nurse_json' => '喂奶',
+        'defecation_json' => '排便',
+        'change_clothes_json' => '更换衣物',
+        'emotion_json' => '情绪',
+        'sleep_json' => '睡眠',
+        'clean_json' => '清洁',
+        'health_json' => '健康',
+        'medication_json' => '用药',
+        'temperature_json' => '体温',
+    ],
+    'options' => [
+    ],
+];