diff --git a/app/Admin/Controllers/ManageController.php b/app/Admin/Controllers/ManageController.php index 504db6e..d60cbf1 100644 --- a/app/Admin/Controllers/ManageController.php +++ b/app/Admin/Controllers/ManageController.php @@ -26,6 +26,21 @@ class ManageController extends AdminController amis()->LinkAction()->link(admin_url('/manages/create'))->label('新增')->icon('fa fa-add')->level('primary'), ...$this->baseHeaderToolBar(), ]) + ->filter($this->baseFilter()->labelWidth('80px')->body([ + amis()->GroupControl()->mode('horizontal')->body([ + amis()->TextControl('name', '姓名')->columnRatio(3), + amis()->SelectControl('gender', '性别')->options([ + '1'=>'男', '2'=>'女' + ])->columnRatio(3)->clearable(true), + amis()->TextControl('technical_position', '专业技术职务')->columnRatio(3), + amis()->TextControl('subject', '学科门类')->columnRatio(3), + ]), + amis()->GroupControl()->mode('horizontal')->body([ + amis()->TextControl('research_direction', '研究方向')->columnRatio(3), + amis()->TextControl('company', '工作单位')->columnRatio(3), + amis()->TextControl('mobile_phone', '移动电话')->columnRatio(3), + ]), + ])) ->columns([ amis()->TableColumn('id', 'ID')->sortable(), amis()->TableColumn('name', '姓名'), @@ -45,7 +60,7 @@ class ManageController extends AdminController amis()->TableColumn('subject', '学科门类'), amis()->TableColumn('research_direction', '研究方向'), amis()->TableColumn('address', '通讯地址(邮编)'), - amis()->TableColumn('work_phone', '电话'), + amis()->TableColumn('work_phone', '办公电话'), amis()->TableColumn('mobile_phone', '移动电话'), amis()->TableColumn('email', '邮箱'), diff --git a/app/Models/Filters/ManageFilter.php b/app/Models/Filters/ManageFilter.php index 3b4f48f..fe5807f 100644 --- a/app/Models/Filters/ManageFilter.php +++ b/app/Models/Filters/ManageFilter.php @@ -6,5 +6,66 @@ use EloquentFilter\ModelFilter; class ManageFilter extends ModelFilter { + /** + * 主键 + */ + public function id($id) + { + return $this->where('id', $id); + } + /** + * 姓名 + */ + public function name($name) + { + return $this->where('name','like', '%'.$name.'%'); + } + + /** + * 性别 + */ + public function gender($gender) + { + return $this->where('gender', $gender); + } + /** + * 专业技术职务 + */ + public function technicalPosition($technicalPosition) + { + return $this->where('technical_position','like', '%'.$technicalPosition.'%'); + } + + /** + * 学科门类 + */ + public function subject($subject) + { + return $this->where('subject','like', '%'.$subject.'%'); + } + + /** + * 研究方向 + */ + public function researchDirection($researchDirection) + { + return $this->where('research_direction','like', '%'.$researchDirection.'%'); + } + + /** + * 工作单位 + */ + public function company($company) + { + return $this->where('company','like', '%'.$company.'%'); + } + + /** + * 移动电话 + */ + public function mobilePhone($mobilePhone) + { + return $this->where('mobile_phone','like', '%'.$mobilePhone.'%'); + } } \ No newline at end of file diff --git a/config/admin.php b/config/admin.php index 2aac928..330e76d 100644 --- a/config/admin.php +++ b/config/admin.php @@ -84,7 +84,7 @@ return [ 'layout' => [ // 浏览器标题, 功能名称使用 %title% 代替 - 'title' => '%title% | OwlAdmin', + 'title' => '%title% | 专家管理', 'header' => [ // 是否显示 [刷新] 按钮 'refresh' => true,