diff --git a/app/Jobs/ExportSqliteSongJob.php b/app/Jobs/ExportSqliteSongJob.php index c694465..4c75dc5 100644 --- a/app/Jobs/ExportSqliteSongJob.php +++ b/app/Jobs/ExportSqliteSongJob.php @@ -111,7 +111,7 @@ class ExportSqliteSongJob implements ShouldQueue 'add_date' => $song->adddate, 'situation' => $song->situation?->value ?? '未定義', 'vocal' => $song->vocal, - 'db_change' => $song->db_change, + 'db_change' => $song->db_change ?? 0, 'song_counts' => $song->song_counts ?? 0, 'updated_at' => now(), ]; diff --git a/app/Livewire/Admin/SongForm.php b/app/Livewire/Admin/SongForm.php index 04a758a..83a7cc0 100644 --- a/app/Livewire/Admin/SongForm.php +++ b/app/Livewire/Admin/SongForm.php @@ -40,8 +40,7 @@ class SongForm extends Component 'filename' => '', 'language_type' => '', - 'db_change' => '', - 'vocal' => '', + 'vocal' => true, 'situation' => '', 'copyright01' => '', 'copyright02' => '', @@ -146,7 +145,13 @@ class SongForm extends Component public function resetFields() { foreach ($this->fields as $key => $value) { - $this->fields[$key] = is_bool($value) ? false : ''; + if($key == 'vocal' || $key == 'enable'){ + $this->fields[$key] = true ; + }else if($key == 'adddate'){ + $this->fields[$key] = now()->format('Y-m-d'); + }else{ + $this->fields[$key] = '' ; + } } $this->songId = null; } diff --git a/app/Livewire/Admin/SongTable.php b/app/Livewire/Admin/SongTable.php index 3b816e9..f0fd015 100644 --- a/app/Livewire/Admin/SongTable.php +++ b/app/Livewire/Admin/SongTable.php @@ -116,7 +116,6 @@ final class SongTable extends PowerGridComponent ]); } ) ->add('song_categories', fn(Song $model) => $model->str_categories()) - ->add('db_change') ->add('vocal') //->add('situation_str', fn (Song $model) => SongSituation::from($model->situation->value)->labels()) ->add('situation_str', function (Song $model){ @@ -156,8 +155,6 @@ final class SongTable extends PowerGridComponent $column[]=Column::make(__('songs.artists'), 'song_artists'); $column[]=Column::make(__('songs.language_type'),'language_type_str', 'songs.language_type')->searchable(); $column[]=Column::make(__('songs.categorys'), 'song_categories'); - $column[]=Column::make('Db change', 'db_change') - ->editOnClick(hasPermission: $this->canEdit, dataField: 'db_change', fallback: 'N/A', saveOnMouseOut: true); $column[]=Column::make(__('songs.vocal'), 'vocal')->toggleable(hasPermission: $this->canEdit, trueLabel: 'yes', falseLabel: 'no'); $column[]=Column::make(__('songs.situation'), 'situation_str','songs.situation')->searchable(); $column[]=Column::make(__('songs.copyright01'), 'copyright01')->sortable()->searchable() @@ -229,7 +226,7 @@ final class SongTable extends PowerGridComponent public function onUpdatedEditable($id, $field, $value): void { if (in_array($field,[ - 'name','filename','db_change', + 'name','filename', 'copyright01','copyright02','note01','note02','note03','note04' ]) && $this->canEdit) { $this->noUpdated($id,$field,$value); diff --git a/app/Models/Song.php b/app/Models/Song.php index 27f85c1..0346ce3 100644 --- a/app/Models/Song.php +++ b/app/Models/Song.php @@ -19,7 +19,6 @@ class Song extends Model 'adddate', 'filename', 'language_type', - 'db_change', 'vocal', 'situation', 'copyright01', diff --git a/resources/lang/zh-tw/songs.php b/resources/lang/zh-tw/songs.php index f1a48f6..c19433f 100644 --- a/resources/lang/zh-tw/songs.php +++ b/resources/lang/zh-tw/songs.php @@ -29,7 +29,6 @@ return [ 'note04' => '備註04', 'enable' => '狀態', 'name_length' => '歌名字數', - 'db_change'=>'分貝增減', 'vocal' => '人聲', 'situation' => '情境', 'simplified' => '歌名簡體', diff --git a/resources/views/livewire/admin/song-form.blade.php b/resources/views/livewire/admin/song-form.blade.php index 42e6061..d5495e5 100644 --- a/resources/views/livewire/admin/song-form.blade.php +++ b/resources/views/livewire/admin/song-form.blade.php @@ -1,5 +1,4 @@ -
@@ -44,13 +43,12 @@ option-label="name" option-value="value" /> -
- - + +