123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127 |
- <?php
- namespace App\Admin\Controllers;
- use App\Http\Controllers\Controller;
- use App\Model\XyZskInspection;
- use Encore\Admin\Form;
- use Encore\Admin\Grid;
- use Encore\Admin\Facades\Admin;
- use Encore\Admin\Layout\Content;
- use Encore\Admin\Controllers\ModelForm;
- use Encore\Admin\Show;
- class XyZskInspectionController 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 show($id)
- {
- $show = new Show(XyZskInspection::findOrFail($id));
- $show->field('name' , '名称');
- $show->field('department' , '科室分类');
- $show->field('overview' , '概述');
- $show->field('principle' , '原理');
- $show->field('reagent' , '试剂');
- $show->field('operation' , '操作方法');
- $show->field('clinicalSignificance' , '临床意义');
- $show->field('normalValue' , '正常值');
- $show->field('annotation' , '附注');
- $show->field('precautions' , '注意事项');
- $show->field('donghua_name' , '东华name');
- $show->field('zhonglian_name' , '中联name');
- $show->field('process' , '检查过程');
- $show->field('related_symptoms' , '相关症状');
- $show->field('related_diseases' , '相关疾病');
- $show->field('haoze_name' , '昊泽name');
- $show->field('sex' , '性别');
- return $show;
- }
- protected function form($id='')
- {
- return Admin::form(XyZskInspection::class, function (Form $form) {
- $form->text('name' , '名称');
- $form->text('department' , '科室分类');
- $form->textarea('overview' , '概述');
- $form->textarea('principle' , '原理');
- $form->textarea('reagent' , '试剂');
- $form->textarea('operation' , '操作方法');
- $form->textarea('clinicalSignificance' , '临床意义');
- $form->textarea('normalValue' , '正常值');
- $form->textarea('annotation' , '附注');
- $form->textarea('precautions' , '注意事项');
- $form->textarea('donghua_name' , '东华name');
- $form->textarea('zhonglian_name' , '中联name');
- $form->textarea('process' , '检查过程');
- $form->textarea('related_symptoms' , '相关症状');
- $form->textarea('related_diseases' , '相关疾病');
- $form->textarea('haoze_name' , '昊泽name');
- $form->text('sex' , '性别');
- });
- }
- protected function grid()
- {
- return Admin::grid(XyZskInspection::class, function (Grid $grid) {
- $grid->id('序号')->sortable();
- //$grid->model()->orderBy('id','desc');
- $grid->name('检查名称');
- $grid->department('科室分类');
- $grid->operation('操作方法');
- $grid->normalValue('正常值');
- $grid->annotation('附注');
- // $grid->created_at('创建时间');
- // $grid->updated_at('更新时间');
- $grid->paginate(20);
- //$grid->disableCreateButton();
- $grid->disableExport();
- // 禁用导出数据按钮
- $grid->actions(function ($actions) {
- $actions->disableView();
- //$actions->disableEdit();
- });
- // 条件过滤
- $grid->filter(function ($filter) {
- $filter->disableIdFilter();
- $filter->like('name' , '输入检查名称搜索');
- });
- });
- }
- }
|