feat(阶段四): 创建 SOP 模板资源和页面
- 创建 SopTemplateResource 资源类 - 实现模板列表、创建、编辑、查看页面 - 添加步骤编辑器(Repeater 组件) - 支持富文本编辑步骤内容 - 支持拖拽排序步骤 - 添加状态筛选和分类筛选 - 显示步骤数统计
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\SopTemplateResource\Pages;
|
||||
|
||||
use App\Filament\Resources\SopTemplateResource;
|
||||
use Filament\Resources\Pages\CreateRecord;
|
||||
|
||||
class CreateSopTemplate extends CreateRecord
|
||||
{
|
||||
protected static string $resource = SopTemplateResource::class;
|
||||
|
||||
protected function mutateFormDataBeforeCreate(array $data): array
|
||||
{
|
||||
$data['created_by'] = auth()->id();
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
protected function getRedirectUrl(): string
|
||||
{
|
||||
return $this->getResource()::getUrl('edit', ['record' => $this->getRecord()]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user