| xqd
@@ -18,18 +18,18 @@ class StudentController extends AdminController
|
|
|
protected function grid()
|
|
|
{
|
|
|
return Grid::make(new Student(), function (Grid $grid) {
|
|
|
- $grid->column('id')->sortable();
|
|
|
+ //$grid->column('id')->sortable();
|
|
|
$grid->column('name');
|
|
|
- $grid->column('sex');
|
|
|
+ $grid->column('sex')->using(config('map.sex'));
|
|
|
$grid->column('month_old');
|
|
|
$grid->column('join_garden_time');
|
|
|
$grid->column('parent_name');
|
|
|
- $grid->column('class_id');
|
|
|
-
|
|
|
+ $grid->column('class_id')->using(config('map.class'));
|
|
|
+ $grid->disableCreateButton();
|
|
|
+ $grid->disableViewButton();
|
|
|
$grid->filter(function (Grid\Filter $filter) {
|
|
|
- $filter->equal('id');
|
|
|
$filter->panel();
|
|
|
-
|
|
|
+ $filter->like('name')->width(4);
|
|
|
});
|
|
|
});
|
|
|
}
|
| xqd
@@ -77,27 +77,55 @@ class StudentController extends AdminController
|
|
|
{
|
|
|
return Form::make(new Student(), function (Form $form) {
|
|
|
$form->display('id');
|
|
|
- $form->text('name');
|
|
|
- $form->text('sex');
|
|
|
- $form->text('month_old');
|
|
|
- $form->text('join_garden_time');
|
|
|
- $form->text('parent_name');
|
|
|
- $form->text('class_id');
|
|
|
- $form->text('name_en');
|
|
|
- $form->text('blood_type');
|
|
|
- $form->text('hypersensitive_source');
|
|
|
- $form->text('past_medical_history');
|
|
|
- $form->text('birthday');
|
|
|
- $form->text('exclusive_consultant_name');
|
|
|
- $form->text('exclusive_consultant_phone');
|
|
|
- $form->text('home_address');
|
|
|
- $form->text('hobby');
|
|
|
- $form->text('family_lang');
|
|
|
- $form->text('sleep_habits_and_others');
|
|
|
- $form->text('first_communication_of_parents');
|
|
|
-
|
|
|
- $form->display('created_at');
|
|
|
- $form->display('updated_at');
|
|
|
+ // $form->column(6, function (Form $form) {
|
|
|
+ // $form->text('name');
|
|
|
+ // $form->text('sex');
|
|
|
+
|
|
|
+ // });
|
|
|
+ $form->row(function (Form\Row $row) {
|
|
|
+ $row->width(6)->text('name')->required()->placeholder('请输入中文名');
|
|
|
+ $row->width(6)->text('name_en')->placeholder('请输入英文名');
|
|
|
+ });
|
|
|
+ $form->row(function (Form\Row $row) {
|
|
|
+ $row->width(6)->select('sex')->options(config('map.sex'));
|
|
|
+ $row->width(6)->select('blood_type')->options(config('map.blood_type'));
|
|
|
+ });
|
|
|
+ $form->row(function (Form\Row $row) {
|
|
|
+ $row->width(12)->text('hypersensitive_source');
|
|
|
+ });
|
|
|
+ $form->row(function (Form\Row $row) {
|
|
|
+ $row->textarea('past_medical_history')->required();
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
+ $form->row(function (Form\Row $row) {
|
|
|
+ $row->width(6)->text('birthday')->required();
|
|
|
+ $row->width(6)->text('join_garden_time');
|
|
|
+ });
|
|
|
+ $form->row(function (Form\Row $row) {
|
|
|
+ $row->width(6)->text('exclusive_consultant_name')->placeholder('请输入专属顾问名');
|
|
|
+ $row->width(6)->text('exclusive_consultant_phone')->placeholder('请输入专属顾问联系方式');
|
|
|
+ });
|
|
|
+
|
|
|
+ $form->row(function (Form\Row $row) {
|
|
|
+ $row->width(6)->text('parent_name')->placeholder('请输入家长名');
|
|
|
+ });
|
|
|
+ $form->row(function (Form\Row $row) {
|
|
|
+ $row->text('home_address');
|
|
|
+ });
|
|
|
+ $form->row(function (Form\Row $row) {
|
|
|
+ $row->width(6)->text('hobby')->placeholder('请输入喜好');
|
|
|
+ $row->width(6)->text('family_lang')->placeholder('请输入家庭语言');
|
|
|
+ });
|
|
|
+ $form->row(function (Form\Row $row) {
|
|
|
+ $row->text('sleep_habits_and_others');
|
|
|
+ });
|
|
|
+
|
|
|
+ $form->row(function (Form\Row $row) {
|
|
|
+ $row->textarea('first_communication_of_parents');
|
|
|
+ });
|
|
|
+ // $form->text('month_old');
|
|
|
+ // $form->text('class_id');
|
|
|
});
|
|
|
}
|
|
|
}
|