mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-05 07:20:58 +08:00
replace filament custom views
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Filament\Resources\System\SettingResource\Pages;
|
||||
|
||||
use Filament\Actions\Action;
|
||||
use Filament\Forms\Contracts\HasForms;
|
||||
use Filament\Forms\Concerns\InteractsWithForms;
|
||||
use Filament\Schemas\Schema;
|
||||
@@ -41,8 +42,6 @@ class EditSetting extends Page implements HasForms
|
||||
|
||||
protected static string $resource = SettingResource::class;
|
||||
|
||||
protected string $view = 'filament.resources.system.setting-resource.pages.edit-hit-and-run';
|
||||
|
||||
public ?array $data = [];
|
||||
|
||||
public function getTitle(): string
|
||||
@@ -56,7 +55,7 @@ class EditSetting extends Page implements HasForms
|
||||
$this->fillForm();
|
||||
}
|
||||
|
||||
public function form(Schema $schema): Schema
|
||||
public function content(Schema $schema): Schema
|
||||
{
|
||||
return $schema
|
||||
->components($this->getFormSchema())
|
||||
@@ -76,7 +75,7 @@ class EditSetting extends Page implements HasForms
|
||||
}
|
||||
Arr::set($settings, 'captcha.attendance.enabled', $normalized);
|
||||
|
||||
$this->form->fill($settings);
|
||||
$this->content->fill($settings);
|
||||
}
|
||||
|
||||
|
||||
@@ -85,7 +84,10 @@ class EditSetting extends Page implements HasForms
|
||||
{
|
||||
return [
|
||||
Tabs::make('Heading')
|
||||
->tabs($this->getTabs())
|
||||
->tabs($this->getTabs()),
|
||||
Action::make('submit')
|
||||
->label(__('label.save'))
|
||||
->action(fn() => $this->submit()),
|
||||
];
|
||||
}
|
||||
|
||||
@@ -93,7 +95,7 @@ class EditSetting extends Page implements HasForms
|
||||
{
|
||||
static::authorizeResourceAccess();
|
||||
|
||||
$formData = $this->form->getState();
|
||||
$formData = $this->content->getState();
|
||||
$notAutoloadNames = ['donation_custom'];
|
||||
$data = [];
|
||||
foreach ($formData as $prefix => $parts) {
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
namespace App\Filament\Resources\User;
|
||||
|
||||
use Filament\Infolists\Components\RepeatableEntry;
|
||||
use Filament\Infolists\Components\RepeatableEntry\TableColumn;
|
||||
use Filament\Schemas\Schema;
|
||||
use Filament\Tables\Columns\TextColumn;
|
||||
use Filament\Tables\Columns\BooleanColumn;
|
||||
@@ -193,10 +195,21 @@ class ExamUserResource extends Resource
|
||||
->columns(2)
|
||||
,
|
||||
Group::make([
|
||||
ViewEntry::make('progressFormatted')
|
||||
->label('进度')
|
||||
->view('filament.resources.user.exam-user-resource.pages.detail-v3')
|
||||
])->columnSpan(1),
|
||||
RepeatableEntry::make('progressFormatted')
|
||||
->hiddenLabel()
|
||||
->table([
|
||||
TableColumn::make(__('label.exam.index_required_label')),
|
||||
TableColumn::make(__('label.exam.index_required_value')),
|
||||
TableColumn::make(__('label.exam.index_current_value')),
|
||||
TableColumn::make(__('label.exam.index_result')),
|
||||
])
|
||||
->schema([
|
||||
TextEntry::make('index_formatted'),
|
||||
TextEntry::make('require_value_formatted'),
|
||||
TextEntry::make('current_value_formatted'),
|
||||
TextEntry::make('index_result')->html(),
|
||||
])
|
||||
])->columnSpan(1),
|
||||
]),
|
||||
]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user