- 创建 SopTemplateResource 资源类 - 实现模板列表、创建、编辑、查看页面 - 添加步骤编辑器(Repeater 组件) - 支持富文本编辑步骤内容 - 支持拖拽排序步骤 - 添加状态筛选和分类筛选 - 显示步骤数统计
24 lines
583 B
PHP
24 lines
583 B
PHP
<?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()]);
|
|
}
|
|
}
|