changes done
This commit is contained in:
1 parent
ddbf171881
commit
03fc1074b9
25 files changed
+471
-426
No files matched your search
+2
-2
@@ -54,8 +54,8 @@ class ProjektInhaltsverzeichnisRelationManager extends RelationManager
|
||||
->schema([
|
||||
Checkbox::make('neue_seite')
|
||||
->label('Start neuer Seite'),
|
||||
// Checkbox::make('ueberschrift_verbergen')
|
||||
// ->label('Überschrift verbergen'),
|
||||
Checkbox::make('ueberschrift_verbergen')
|
||||
->label('Überschrift im Gutachten verbergen'),
|
||||
TextInput::make('name')
|
||||
->prefixIcon('phosphor-article')
|
||||
->afterLabel([ShowHelpInhalt::show()])
|
||||
|
||||
+10
-3
@@ -15,6 +15,7 @@ use Filament\Forms\Components\Select;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
use Filament\Notifications\Notification;
|
||||
use Filament\Resources\RelationManagers\RelationManager;
|
||||
use Filament\Schemas\Components\Utilities\Get;
|
||||
use Filament\Schemas\Schema;
|
||||
use Filament\Tables\Columns\SelectColumn;
|
||||
use Filament\Tables\Columns\TextColumn;
|
||||
@@ -51,22 +52,28 @@ class ProjektMethodesRelationManager extends RelationManager
|
||||
$livewire->dispatch('refreshMethods');
|
||||
})->validationMessages([
|
||||
'required' => 'Die Eingabe einer Methode ist erforderlich.',
|
||||
]),
|
||||
])
|
||||
->live(),
|
||||
Select::make('aufstellung_id')
|
||||
->visible(fn (Get $get): bool => ! in_array($get('methode_id'), [1, 5]))
|
||||
->label('Aufstellung')
|
||||
->options(Aufstellung::pluck('name', 'id'))
|
||||
->afterStateUpdated(function (Component $livewire) {
|
||||
$livewire->dispatch('refreshMethods');
|
||||
}),
|
||||
TextInput::make('faktor')
|
||||
->visible(fn (Get $get): bool => $get('methode_id') != 1)
|
||||
->suffixIcon('phosphor-function')
|
||||
->numeric()
|
||||
->label('Fläche')
|
||||
->rules(['required'])
|
||||
->validationMessages([
|
||||
'required' => 'Die Eingabe einer Fläche ist erforderlich.',
|
||||
]),
|
||||
])->columns(3);
|
||||
])
|
||||
->afterStateUpdated(function (Component $livewire) {
|
||||
$livewire->dispatch('refreshMethods');
|
||||
}),
|
||||
])->columns(1);
|
||||
}
|
||||
|
||||
public function table(Table $table): Table
|
||||
|
||||
+2
-3
@@ -145,9 +145,8 @@ class ProjektObjekteImDetailRelationManager extends RelationManager
|
||||
])
|
||||
->recordActions([
|
||||
EditAction::make()->iconButton()
|
||||
->mutateDataUsing(function ($data): array {
|
||||
|
||||
$data['nutzwert'] = round($data['faktor'] * $data['flaeche']);
|
||||
->mutateDataUsing(function ($data, $record): array {
|
||||
$data['nutzwert'] = round($record->methode->faktor * $data['flaeche']);
|
||||
|
||||
return $data;
|
||||
})->after(function (Component $livewire) {
|
||||
|
||||
Reference in new issue
Block a user