|
|
@@ -20,7 +20,6 @@ use Filament\Forms\Components\Tabs\Tab;
|
|
20
|
20
|
use Filament\Forms\Components\Textarea;
|
|
21
|
21
|
use Filament\Forms\Components\TextInput;
|
|
22
|
22
|
use Filament\Forms\Form;
|
|
23
|
|
-use Filament\Forms\Get;
|
|
24
|
23
|
use Filament\Resources\Resource;
|
|
25
|
24
|
use Filament\Tables;
|
|
26
|
25
|
use Filament\Tables\Columns\ImageColumn;
|
|
|
@@ -108,7 +107,10 @@ class ProjectResource extends Resource
|
|
108
|
107
|
->searchable()
|
|
109
|
108
|
->label('')
|
|
110
|
109
|
->required(),
|
|
111
|
|
- ])->reorderable(false),
|
|
|
110
|
+ ])
|
|
|
111
|
+ ->relationship('targetBadges')
|
|
|
112
|
+ ->reorderableWithButtons()
|
|
|
113
|
+ ->orderColumn('sort_order'),
|
|
112
|
114
|
Repeater::make('badgesAward')->label('取得標章')->schema([
|
|
113
|
115
|
Hidden::make('award_type')->default(2),
|
|
114
|
116
|
Select::make('badge_id')
|
|
|
@@ -133,7 +135,10 @@ class ProjectResource extends Resource
|
|
133
|
135
|
->displayFormat('Y年m月')
|
|
134
|
136
|
->native(false)
|
|
135
|
137
|
->closeOnDateSelection(),
|
|
136
|
|
- ])->reorderable(false),
|
|
|
138
|
+ ])
|
|
|
139
|
+ ->relationship('awardBadges')
|
|
|
140
|
+ ->reorderableWithButtons()
|
|
|
141
|
+ ->orderColumn('sort_order'),
|
|
137
|
142
|
]),
|
|
138
|
143
|
Tab::make('開發歷程')->schema([
|
|
139
|
144
|
Repeater::make('histories')->label('')->schema([
|
|
|
@@ -155,16 +160,16 @@ class ProjectResource extends Resource
|
|
155
|
160
|
])->columnSpanFull()
|
|
156
|
161
|
->id(fn ($get) => 'histories_'.$get('histories_item_key')),
|
|
157
|
162
|
])
|
|
158
|
|
- ->relationship('histories', function ($query, Get $get, $livewire) {
|
|
159
|
|
- return $query->orderby('operate_date', 'desc');
|
|
160
|
|
- })
|
|
|
163
|
+ ->relationship('histories')
|
|
|
164
|
+ ->reorderableWithButtons()
|
|
|
165
|
+ ->orderColumn('order')
|
|
161
|
166
|
->collapsible()
|
|
162
|
167
|
->cloneable(),
|
|
163
|
168
|
]),
|
|
164
|
169
|
Tab::make('空間資訊')->schema([
|
|
165
|
170
|
Group::make()->schema([
|
|
166
|
171
|
Translate::make()->schema(fn (string $locale) => [
|
|
167
|
|
-// TextInput::make('contact_unit')->label('物管單位'),
|
|
|
172
|
+ // TextInput::make('contact_unit')->label('物管單位'),
|
|
168
|
173
|
TextInput::make('contact_phone')->label('物管電話'),
|
|
169
|
174
|
TextInput::make('inversment_phone')->label('招商電話'),
|
|
170
|
175
|
])
|