generated from liutk/owl-admin-base
admin admin::user()
parent
b7b00f34c3
commit
ade6f09899
|
|
@ -17,10 +17,11 @@ class EmployeeController extends AdminController
|
||||||
|
|
||||||
public function list(): Page
|
public function list(): Page
|
||||||
{
|
{
|
||||||
|
$user = Admin::user();
|
||||||
$crud = $this->baseCRUD()
|
$crud = $this->baseCRUD()
|
||||||
->tableLayout('fixed')
|
->tableLayout('fixed')
|
||||||
->headerToolbar([
|
->headerToolbar([
|
||||||
$this->createTypeButton('drawer', 'lg')->visible(Admin::user()->can('admin.hr.employees.create')),
|
$this->createTypeButton('drawer', 'lg')->visible($user->can('admin.hr.employees.create')),
|
||||||
...$this->baseHeaderToolBar(),
|
...$this->baseHeaderToolBar(),
|
||||||
$this->exportAction(true)->visible($user->can('admin.hr.employees.export')),
|
$this->exportAction(true)->visible($user->can('admin.hr.employees.export')),
|
||||||
])
|
])
|
||||||
|
|
@ -44,16 +45,16 @@ class EmployeeController extends AdminController
|
||||||
amisMake()->TableColumn()->name('remarks')->label(__('employee.remarks')),
|
amisMake()->TableColumn()->name('remarks')->label(__('employee.remarks')),
|
||||||
amis()->TableColumn()->name('is_sign')->label(__('employee.is_sign'))->type('switch'),
|
amis()->TableColumn()->name('is_sign')->label(__('employee.is_sign'))->type('switch'),
|
||||||
$this->rowActions([
|
$this->rowActions([
|
||||||
$this->rowShowButton()->visible(Admin::user()->can('admin.hr.employees.view')),
|
$this->rowShowButton()->visible($user->can('admin.hr.employees.view')),
|
||||||
$this->rowEditTypeButton('drawer', 'lg')->visible(Admin::user()->can('admin.hr.employees.update')),
|
$this->rowEditTypeButton('drawer', 'lg')->visible($user->can('admin.hr.employees.update')),
|
||||||
$this->rowDeleteButton()->visible(Admin::user()->can('admin.hr.employees.delete')),
|
$this->rowDeleteButton()->visible($user->can('admin.hr.employees.delete')),
|
||||||
amisMake()->AjaxAction()
|
amisMake()->AjaxAction()
|
||||||
->label(__('employee.leave'))
|
->label(__('employee.leave'))
|
||||||
->level('link')
|
->level('link')
|
||||||
->icon('fa fa-sign-out')
|
->icon('fa fa-sign-out')
|
||||||
->confirmText(__('employee.leave_confirm'))
|
->confirmText(__('employee.leave_confirm'))
|
||||||
->api('post:'.admin_url('hr/employees/${id}/leave'))
|
->api('post:'.admin_url('hr/employees/${id}/leave'))
|
||||||
->visible(Admin::user()->can('admin.hr.employees.leave'))
|
->visible($user->can('admin.hr.employees.leave'))
|
||||||
->visibleOn('${employee_status == '.EmployeeStatus::Online->value.'}'),
|
->visibleOn('${employee_status == '.EmployeeStatus::Online->value.'}'),
|
||||||
amisMake()->AjaxAction()
|
amisMake()->AjaxAction()
|
||||||
->label(__('employee.reback'))
|
->label(__('employee.reback'))
|
||||||
|
|
@ -61,7 +62,7 @@ class EmployeeController extends AdminController
|
||||||
->icon('fa fa-sign-out')
|
->icon('fa fa-sign-out')
|
||||||
->confirmText(__('employee.leave_confirm'))
|
->confirmText(__('employee.leave_confirm'))
|
||||||
->api('post:'.admin_url('hr/employees/${id}/leave'))
|
->api('post:'.admin_url('hr/employees/${id}/leave'))
|
||||||
->visible(Admin::user()->can('admin.hr.employees.leave'))
|
->visible($user->can('admin.hr.employees.leave'))
|
||||||
->visibleOn('${employee_status == '.EmployeeStatus::Offline->value.'}'),
|
->visibleOn('${employee_status == '.EmployeeStatus::Offline->value.'}'),
|
||||||
]),
|
]),
|
||||||
]);
|
]);
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,7 @@ class HolidayController extends AdminController
|
||||||
|
|
||||||
public function list(): Page
|
public function list(): Page
|
||||||
{
|
{
|
||||||
|
$user = Admin::user();
|
||||||
$crud = $this->baseCRUD()
|
$crud = $this->baseCRUD()
|
||||||
->tableLayout('fixed')
|
->tableLayout('fixed')
|
||||||
->headerToolbar([
|
->headerToolbar([
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,7 @@ class OfficalBusinessController extends AdminController
|
||||||
|
|
||||||
public function list(): Page
|
public function list(): Page
|
||||||
{
|
{
|
||||||
|
$user = Admin::user();
|
||||||
$crud = $this->baseCRUD()
|
$crud = $this->baseCRUD()
|
||||||
->tableLayout('fixed')
|
->tableLayout('fixed')
|
||||||
->headerToolbar([
|
->headerToolbar([
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,7 @@ class OvertimeController extends AdminController
|
||||||
|
|
||||||
public function list(): Page
|
public function list(): Page
|
||||||
{
|
{
|
||||||
|
$user = Admin::user();
|
||||||
$crud = $this->baseCRUD()
|
$crud = $this->baseCRUD()
|
||||||
->tableLayout('fixed')
|
->tableLayout('fixed')
|
||||||
->headerToolbar([
|
->headerToolbar([
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@ class PromotionController extends AdminController
|
||||||
|
|
||||||
public function list(): Page
|
public function list(): Page
|
||||||
{
|
{
|
||||||
|
$user = Admin::user();
|
||||||
$crud = $this->baseCRUD()
|
$crud = $this->baseCRUD()
|
||||||
->tableLayout('fixed')
|
->tableLayout('fixed')
|
||||||
->headerToolbar([
|
->headerToolbar([
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@ class SignController extends AdminController
|
||||||
|
|
||||||
public function list(): Page
|
public function list(): Page
|
||||||
{
|
{
|
||||||
|
$user = Admin::user();
|
||||||
$crud = $this->baseCRUD()
|
$crud = $this->baseCRUD()
|
||||||
->tableLayout('fixed')
|
->tableLayout('fixed')
|
||||||
->headerToolbar([
|
->headerToolbar([
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,7 @@ class SignRepairController extends AdminController
|
||||||
|
|
||||||
public function list(): Page
|
public function list(): Page
|
||||||
{
|
{
|
||||||
|
$user = Admin::user();
|
||||||
$crud = $this->baseCRUD()
|
$crud = $this->baseCRUD()
|
||||||
->tableLayout('fixed')
|
->tableLayout('fixed')
|
||||||
->headerToolbar([
|
->headerToolbar([
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue