main
panliang 2024-04-22 17:14:50 +08:00
parent cb9259c163
commit 35f8525261
16 changed files with 37 additions and 33 deletions

View File

@ -28,7 +28,7 @@ class AgreementController extends AdminController
$crud = $this->baseCRUD()
->tableLayout('fixed')
->headerToolbar([
$this->createTypeButton('drawer', 'xl')->visible($user->can('admin.agreement.create')),
$this->createTypeButton('drawer', 'lg')->visible($user->can('admin.agreement.create')),
...$this->baseHeaderToolBar(),
])
->bulkActions([])
@ -58,9 +58,9 @@ class AgreementController extends AdminController
amisMake()->TableColumn()->name('workflow.check_status')->label(__('workflow_log.check_status'))->set('type', 'mapping')->map(CheckStatus::options()),
amisMake()->TableColumn()->name('created_at')->label(__('agreement.created_at')),
amisMake()->Operation()->label(__('admin.actions'))->buttons([
$this->rowShowTypeButton('drawer', 'xl')
$this->rowShowTypeButton('drawer', 'lg')
->visible($user->can('admin.agreement.view')),
$this->rowEditTypeButton('drawer', 'xl')
$this->rowEditTypeButton('drawer', 'lg')
->visible($user->can('admin.agreement.update'))
->visibleOn('${OR(workflow.check_status == '.CheckStatus::None->value.', workflow.check_status == '.CheckStatus::Cancel->value.', workflow.check_status == '.CheckStatus::Fail->value.')}'),
$this->rowDeleteButton()

View File

@ -21,7 +21,7 @@ class ArticleController extends AdminController
{
$crud = $this->baseCRUD()->tableLayout('fixed')
->headerToolbar([
$this->createTypeButton('drawer', 'xl'),
$this->createTypeButton('drawer', 'lg'),
...$this->baseHeaderToolBar(),
])
->filter($this->baseFilter()->body([
@ -71,7 +71,7 @@ class ArticleController extends AdminController
amis()->TableColumn('is_recommend', __('admin.articles.is_recommend'))->type('switch'),
amis()->TableColumn('created_at', __('admin.created_at'))->type('datetime')->sortable(true),
amis()->Operation()->label(__('admin.actions'))->buttons([
$this->rowEditTypeButton('drawer', 'xl'),
$this->rowEditTypeButton('drawer', 'lg'),
$this->rowDeleteButton(),
]),
]);

View File

@ -16,7 +16,7 @@ class BaseKeywordController extends AdminController
->loadDataOnce(true)
->footerToolbar([])
->headerToolbar([
$this->createTypeButton('drawer', 'xl'),
$this->createTypeButton('drawer', 'lg'),
amis('reload')->align('right'),
])
->columns([
@ -26,7 +26,7 @@ class BaseKeywordController extends AdminController
amisMake()->TableColumn()->name('value')->label(__('keyword.value')),
amisMake()->TableColumn()->name('sort')->label(__('keyword.sort')),
amisMake()->Operation()->label(__('admin.actions'))->buttons([
$this->rowEditTypeButton('drawer', 'xl'),
$this->rowEditTypeButton('drawer', 'lg'),
$this->rowDeleteButton(),
]),
]);

View File

@ -20,7 +20,7 @@ class EmployeeController extends AdminController
$crud = $this->baseCRUD()
->tableLayout('fixed')
->headerToolbar([
$this->createTypeButton('drawer', 'xl')->visible(Admin::user()->can('admin.hr.employees.create')),
$this->createTypeButton('drawer', 'lg')->visible(Admin::user()->can('admin.hr.employees.create')),
...$this->baseHeaderToolBar(),
])
->bulkActions([])
@ -42,7 +42,7 @@ class EmployeeController extends AdminController
amisMake()->TableColumn()->name('remarks')->label(__('employee.remarks')),
$this->rowActions([
$this->rowShowButton()->visible(Admin::user()->can('admin.hr.employees.view')),
$this->rowEditTypeButton('drawer', 'xl')->visible(Admin::user()->can('admin.hr.employees.update')),
$this->rowEditTypeButton('drawer', 'lg')->visible(Admin::user()->can('admin.hr.employees.update')),
$this->rowDeleteButton()->visible(Admin::user()->can('admin.hr.employees.delete')),
amisMake()->AjaxAction()
->label(__('employee.leave'))

View File

@ -25,7 +25,7 @@ class HolidayController extends AdminController
$crud = $this->baseCRUD()
->tableLayout('fixed')
->headerToolbar([
// $this->createTypeButton('drawer', 'xl')->visible(Admin::user()->can('admin.hr.holiday.create')),
// $this->createTypeButton('drawer', 'lg')->visible(Admin::user()->can('admin.hr.holiday.create')),
...$this->baseHeaderToolBar(),
])
->bulkActions([])
@ -66,7 +66,7 @@ class HolidayController extends AdminController
amisMake()->TableColumn()->name('created_at')->label(__('holiday_apply.created_at')),
$this->rowActions([
$this->rowShowButton()->visible(Admin::user()->can('admin.hr.holiday.view')),
// $this->rowEditTypeButton('drawer', 'xl')
// $this->rowEditTypeButton('drawer', 'lg')
// ->visible(Admin::user()->can('admin.hr.holiday.update'))
// ->visibleOn('${OR(workflow.check_status == '.CheckStatus::None->value.', workflow.check_status == '.CheckStatus::Cancel->value.', workflow.check_status == '.CheckStatus::Fail->value.')}'),
$this->rowDeleteButton()

View File

@ -25,7 +25,7 @@ class OfficalBusinessController extends AdminController
$crud = $this->baseCRUD()
->tableLayout('fixed')
->headerToolbar([
// $this->createTypeButton('drawer', 'xl')->visible(Admin::user()->can('admin.hr.business.create')),
// $this->createTypeButton('drawer', 'lg')->visible(Admin::user()->can('admin.hr.business.create')),
...$this->baseHeaderToolBar(),
])
->bulkActions([])
@ -59,7 +59,7 @@ class OfficalBusinessController extends AdminController
amisMake()->TableColumn()->name('created_at')->label(__('offical_business.created_at')),
$this->rowActions([
$this->rowShowButton()->visible(Admin::user()->can('admin.hr.business.view')),
// $this->rowEditTypeButton('drawer', 'xl')
// $this->rowEditTypeButton('drawer', 'lg')
// ->visible(Admin::user()->can('admin.hr.business.update'))
// ->visibleOn('${OR(workflow.check_status == '.CheckStatus::None->value.', workflow.check_status == '.CheckStatus::Cancel->value.', workflow.check_status == '.CheckStatus::Fail->value.')}'),
$this->rowDeleteButton()

View File

@ -25,7 +25,7 @@ class OvertimeController extends AdminController
$crud = $this->baseCRUD()
->tableLayout('fixed')
->headerToolbar([
// $this->createTypeButton('drawer', 'xl')->visible(Admin::user()->can('admin.hr.overtime.create')),
// $this->createTypeButton('drawer', 'lg')->visible(Admin::user()->can('admin.hr.overtime.create')),
...$this->baseHeaderToolBar(),
])
->bulkActions([])
@ -60,7 +60,7 @@ class OvertimeController extends AdminController
amisMake()->TableColumn()->name('created_at')->label(__('overtime_apply.created_at')),
$this->rowActions([
$this->rowShowButton()->visible(Admin::user()->can('admin.hr.overtime.view')),
// $this->rowEditTypeButton('drawer', 'xl')
// $this->rowEditTypeButton('drawer', 'lg')
// ->visible(Admin::user()->can('admin.hr.overtime.update'))
// ->visibleOn('${OR(workflow.check_status == '.CheckStatus::None->value.', workflow.check_status == '.CheckStatus::Cancel->value.', workflow.check_status == '.CheckStatus::Fail->value.')}'),
$this->rowDeleteButton()

View File

@ -25,7 +25,7 @@ class PromotionController extends AdminController
$crud = $this->baseCRUD()
->tableLayout('fixed')
->headerToolbar([
$this->createTypeButton('drawer', 'xl')->visible(Admin::user()->can('admin.hr.promotion.create')),
$this->createTypeButton('drawer', 'lg')->visible(Admin::user()->can('admin.hr.promotion.create')),
...$this->baseHeaderToolBar(),
])
->bulkActions([])
@ -70,7 +70,7 @@ class PromotionController extends AdminController
amisMake()->TableColumn()->name('created_at')->label(__('employee_promotion.created_at')),
$this->rowActions([
$this->rowShowButton()->visible(Admin::user()->can('admin.hr.promotion.view')),
$this->rowEditTypeButton('drawer', 'xl')
$this->rowEditTypeButton('drawer', 'lg')
->visible(Admin::user()->can('admin.hr.promotion.update'))
->visibleOn('${can_update}'),
$this->rowDeleteButton()

View File

@ -21,7 +21,7 @@ class RestController extends AdminController
$crud = $this->baseCRUD()
->tableLayout('fixed')
->headerToolbar([
$this->createTypeButton('drawer', 'xl')->visible(Admin::user()->can('admin.hr.rests.create')),
$this->createTypeButton('drawer', 'lg')->visible(Admin::user()->can('admin.hr.rests.create')),
...$this->baseHeaderToolBar(),
])
->filter($this->baseFilter()->body([

View File

@ -26,7 +26,7 @@ class SignRepairController extends AdminController
$crud = $this->baseCRUD()
->tableLayout('fixed')
->headerToolbar([
// $this->createTypeButton('drawer', 'xl')->visible(Admin::user()->can('admin.hr.repairs.create')),
// $this->createTypeButton('drawer', 'lg')->visible(Admin::user()->can('admin.hr.repairs.create')),
...$this->baseHeaderToolBar(),
])
->bulkActions([])
@ -65,7 +65,7 @@ class SignRepairController extends AdminController
->map(CheckStatus::options()),
$this->rowActions([
$this->rowShowButton()->visible(Admin::user()->can('admin.hr.repairs.view')),
// $this->rowEditTypeButton('drawer', 'xl')
// $this->rowEditTypeButton('drawer', 'lg')
// ->visible(Admin::user()->can('admin.hr.repairs.update'))
// ->visibleOn('${OR(workflow.check_status == '.CheckStatus::None->value.', workflow.check_status == '.CheckStatus::Cancel->value.', workflow.check_status == '.CheckStatus::Fail->value.')}'),
$this->rowDeleteButton()

View File

@ -20,7 +20,7 @@ class DeviceController extends AdminController
$crud = $this->baseCRUD()
->tableLayout('fixed')
->headerToolbar([
$this->createTypeButton('drawer', 'xl')->visible(Admin::user()->can('admin.store.devices.create')),
$this->createTypeButton('drawer', 'lg')->visible(Admin::user()->can('admin.store.devices.create')),
...$this->baseHeaderToolBar(),
])
->bulkActions([])
@ -43,7 +43,7 @@ class DeviceController extends AdminController
amisMake()->TableColumn()->name('remarks')->label(__('store_device.remarks')),
amisMake()->TableColumn()->name('created_at')->label(__('store_device.created_at')),
$this->rowActions([
$this->rowEditTypeButton('drawer', 'xl')->visible(Admin::user()->can('admin.store.devices.update')),
$this->rowEditTypeButton('drawer', 'lg')->visible(Admin::user()->can('admin.store.devices.update')),
$this->rowDeleteButton()->visible(Admin::user()->can('admin.store.devices.delete')),
]),
]);

View File

@ -21,7 +21,7 @@ class EmployeeController extends AdminController
$crud = $this->baseCRUD()
->tableLayout('fixed')
->headerToolbar([
$this->createTypeButton('drawer', 'xl')->visible($user->can('admin.store.employees.create')),
$this->createTypeButton('drawer', 'lg')->visible($user->can('admin.store.employees.create')),
...$this->baseHeaderToolBar(),
])
->bulkActions([])

View File

@ -24,7 +24,7 @@ class StoreController extends AdminController
$crud = $this->baseCRUD()
->tableLayout('fixed')
->headerToolbar([
$this->createTypeButton('drawer', 'xl')->visible($user->can('admin.store.stores.create')),
$this->createTypeButton('drawer', 'lg')->visible($user->can('admin.store.stores.create')),
...$this->baseHeaderToolBar(),
])
->bulkActions([])
@ -68,7 +68,7 @@ class StoreController extends AdminController
amisMake()->TableColumn()->name('created_at')->label(__('store.created_at')),
$this->rowActions([
$this->rowShowButton()->visible($user->can('admin.store.stores.view')),
$this->rowEditTypeButton('drawer', 'xl')->visible($user->can('admin.store.stores.update')),
$this->rowEditTypeButton('drawer', 'lg')->visible($user->can('admin.store.stores.update')),
$this->rowDeleteButton()->visible($user->can('admin.store.stores.delete')),
]),
]);

View File

@ -22,7 +22,7 @@ class BookController extends AdminController
$crud = $this->baseCRUD()
->tableLayout('fixed')
->headerToolbar([
$this->createTypeButton('drawer', 'xl')->visible(Admin::user()->can('admin.train.books.create')),
$this->createTypeButton('drawer', 'lg')->visible(Admin::user()->can('admin.train.books.create')),
...$this->baseHeaderToolBar(),
])
->bulkActions([])
@ -69,8 +69,10 @@ class BookController extends AdminController
amisMake()->TextControl()->name('description')->label(__('train_book.description')),
amisMake()->RadiosControl()->options(BookType::options())->name('type')->label(__('train_book.type')),
Components::make()->fuEditorControl('content', __('train_book.content'))->visibleOn('${type == '.BookType::Text->value.'}'),
amisMake()->FileControl()->name('video')->label(__('train_book.video'))->visibleOn('${type == '.BookType::Video->value.'}'),
amisMake()->FileControl()->multiple()->joinValues(false)->name('files')->label(__('train_book.files'))->visibleOn('${type == '.BookType::File->value.'}'),
Components::make()->chunkFileControl('video', __('train_book.video'))->visibleOn('${type == '.BookType::Video->value.'}'),
// amisMake()->FileControl()->name('video')->label(__('train_book.video'))->visibleOn('${type == '.BookType::Video->value.'}'),
// amisMake()->FileControl()->multiple()->joinValues(false)->name('files')->label(__('train_book.files'))->visibleOn('${type == '.BookType::File->value.'}'),
Components::make()->chunkFileControl('files', __('train_book.files'))->multiple()->joinValues(false)->visibleOn('${type == '.BookType::File->value.'}'),
]);
}

View File

@ -35,10 +35,10 @@ class QuestionController extends AdminController
amisMake()->TableColumn()->name('id')->label(__('train_question.id')),
amisMake()->TableColumn()->name('title')->label(__('train_question.title')),
amisMake()->TableColumn()->name('cate')->label(__('train_question.cate'))->set('type', 'mapping')->set('map', QuestionCate::options()),
amisMake()->TableColumn()->name('options')->label(__('train_question.options'))->set('type', 'list')->source('${options}')->listItem([
'titleClassName' => 'text-${IF(is_true, "success", "danger")}',
'title' => '${text}',
]),
// amisMake()->TableColumn()->name('options')->label(__('train_question.options'))->set('type', 'list')->source('${options}')->listItem([
// 'titleClassName' => 'text-${IF(is_true, "success", "danger")}',
// 'title' => '${text}',
// ]),
amisMake()->TableColumn()->name('created_at')->label(__('train_book.created_at')),
$this->rowActions([
$this->rowShowButton()->visible(Admin::user()->can('admin.train.questions.view')),
@ -59,6 +59,8 @@ class QuestionController extends AdminController
->addable()
->editable()
->removable()
->minLength(1)
->maxLength(4)
->needConfirm(false)
->columns([
amisMake()->TextControl()->name('text')->label(__('train_question.text'))->required(),

View File

@ -23,7 +23,7 @@ class BookService extends BaseService
$data['cover_image'] = $this->formatUrl($image);
}
if (isset($data['video']) && $data['video']) {
$video = $data['video'];
$video = is_array($data['video']) ? data_get($data, 'video.value') : $data['video'];
$data['video'] = $this->formatUrl($video);
}
if (isset($data['files']) && $data['files']) {