ソースを参照

paragraphs setting

コミット
f0480c53fa
共有1 個のファイルを変更した11 個の追加39 個の削除を含む
  1. 11
    39
      app/Filament/Resources/EsgResource.php

+ 11
- 39
app/Filament/Resources/EsgResource.php ファイルの表示

88
                     ]),
88
                     ]),
89
                     Tab::make("段落設計")->schema([
89
                     Tab::make("段落設計")->schema([
90
                         //1: 純文字 2:區塊文字 3:表格 4:影片 or 圖片 5:左右圖文
90
                         //1: 純文字 2:區塊文字 3:表格 4:影片 or 圖片 5:左右圖文
91
-                        Repeater::make("paragraphs")->schema([
91
+                        Repeater::make("paragraphs")->label("")->schema([
92
                             TextInput::make('item_key')
92
                             TextInput::make('item_key')
93
                                 ->default(fn () => Str::random())
93
                                 ->default(fn () => Str::random())
94
                                 ->hidden()
94
                                 ->hidden()
120
                             ])->visible(fn (Get $get):bool => $get("type") == 1),
120
                             ])->visible(fn (Get $get):bool => $get("type") == 1),
121
                             Group::make()->schema([
121
                             Group::make()->schema([
122
                                 Section::make('區塊文字設定')->schema([
122
                                 Section::make('區塊文字設定')->schema([
123
-                                    // // 佈局設定
124
-                                    // Radio::make('layout_type')->label('佈局方式')->options([
125
-                                    //     'vertical' => '垂直排列',
126
-                                    //     'horizontal' => '水平排列',
127
-                                    //     'grid' => '網格排列',
128
-                                    // ])->default('vertical')->Live(),
129
                                     // 文字區塊重複器
123
                                     // 文字區塊重複器
130
                                     Repeater::make("content.text_blocks")->schema([
124
                                     Repeater::make("content.text_blocks")->schema([
131
                                         TextInput::make('block_item_key')
125
                                         TextInput::make('block_item_key')
138
                                             }),
132
                                             }),
139
                                         // 多語系內容
133
                                         // 多語系內容
140
                                         Translate::make()->schema(fn (string $locale) => [
134
                                         Translate::make()->schema(fn (string $locale) => [
141
-                                            // TextInput::make('block_title')
142
-                                            //     ->label("區塊標題")
143
-                                            //     ->maxLength(200)
144
-                                            //     ->visible(fn (Get $get) => in_array($get('block_type'), ['title', 'subtitle', 'highlight'])),
145
                                             RichEditor::make('block_content')
135
                                             RichEditor::make('block_content')
146
                                                 ->disableToolbarButtons(['attachFiles'])
136
                                                 ->disableToolbarButtons(['attachFiles'])
147
                                                 ->required($locale == "zh_TW")
137
                                                 ->required($locale == "zh_TW")
173
                                             ])
163
                                             ])
174
                                             ->default(2)
164
                                             ->default(2)
175
                                             ->inline(),
165
                                             ->inline(),
176
-                                    // 表格基本資訊
177
-                                    // Translate::make()->schema(fn (string $locale) => [
178
-                                    //     TextInput::make('content.table_title')
179
-                                    //         ->label("表格標題")
180
-                                    //         ->maxLength(200),
181
-
182
-                                    //     Textarea::make('content.table_description')
183
-                                    //         ->label("表格說明")
184
-                                    //         ->rows(3)
185
-                                    //         ->maxLength(500),
186
-                                    // ])->locales(["zh_TW", "en"])
187
-                                    // ->id(fn ($get) => "table_info_" . $get('item_key')),
188
                                     // 表格資料
166
                                     // 表格資料
189
-                                    Placeholder::make('table_builder_info')
190
-                                        ->content('請先設定表格欄數,然後填入表格資料'),
167
+                                    Placeholder::make('table_builder_info')->label("")->content('請先設定表格欄數,然後填入表格資料'),
191
                                     Grid::make(3)->schema([
168
                                     Grid::make(3)->schema([
192
                                         Radio::make('content.column_count')
169
                                         Radio::make('content.column_count')
193
                                             ->label('欄數')
170
                                             ->label('欄數')
200
                                             ->inline()
177
                                             ->inline()
201
                                             ->live()
178
                                             ->live()
202
                                             ->reactive(), // ✅ 添加 reactive()
179
                                             ->reactive(), // ✅ 添加 reactive()
203
-                                        // Radio::make('content.is_card')
204
-                                        //     ->label('是否卡片呈現')
205
-                                        //     ->options([
206
-                                        //         1 => '是',  // 改為數字鍵值
207
-                                        //         0 => '否',
208
-                                        //     ])
209
-                                        //     ->default(1)
210
-                                        //     ->inline()
211
-                                        //     ->required()
180
+                                        Radio::make('content.is_card')
181
+                                            ->label('是否卡片呈現')
182
+                                            ->options([
183
+                                                1 => '是',  // 改為數字鍵值
184
+                                                0 => '否',
185
+                                            ])
186
+                                            ->default(1)
187
+                                            ->inline()
188
+                                            ->required()
212
                                     ]),
189
                                     ]),
213
                                     Translate::make()->schema(fn (string $locale) => [
190
                                     Translate::make()->schema(fn (string $locale) => [
214
                                         Grid::make(2)  // 改用 Grid 來支援動態 columns
191
                                         Grid::make(2)  // 改用 Grid 來支援動態 columns
420
             ])
397
             ])
421
             ->actions([
398
             ->actions([
422
                 Tables\Actions\EditAction::make(),
399
                 Tables\Actions\EditAction::make(),
423
-            ])
424
-            ->bulkActions([
425
-                Tables\Actions\BulkActionGroup::make([
426
-                    Tables\Actions\DeleteBulkAction::make(),
427
-                ]),
428
             ]);
400
             ]);
429
     }
401
     }
430
 
402