diff --git a/app/Livewire/Forms/SongForm.php b/app/Livewire/Forms/SongForm.php
index c6276d4..13b06ec 100644
--- a/app/Livewire/Forms/SongForm.php
+++ b/app/Livewire/Forms/SongForm.php
@@ -40,7 +40,7 @@ class SongForm extends Component
'adddate' => '',
'filename' => '',
'language_type' => '',
-
+ 'db_change' => 0,
'vocal' => true,
'situation' => '',
'copyright01' => '',
@@ -170,6 +170,8 @@ class SongForm extends Component
$this->fields[$key] = true ;
}else if($key == 'adddate'){
$this->fields[$key] = now()->format('Y-m-d');
+ }else if($key == 'db_change'){
+ $this->fields[$key]=0;
}else{
$this->fields[$key] = '' ;
}
diff --git a/app/Livewire/Tables/SongTable.php b/app/Livewire/Tables/SongTable.php
index 77e92d4..f129798 100644
--- a/app/Livewire/Tables/SongTable.php
+++ b/app/Livewire/Tables/SongTable.php
@@ -114,6 +114,7 @@ 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){
@@ -153,6 +154,8 @@ 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()
@@ -230,7 +233,7 @@ final class SongTable extends PowerGridComponent
public function onUpdatedEditable($id, $field, $value): void
{
if (in_array($field,[
- 'name','filename',
+ 'name','filename','db_change',
'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 ba70219..61a0391 100644
--- a/app/Models/Song.php
+++ b/app/Models/Song.php
@@ -19,6 +19,7 @@ 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 c19433f..f1a48f6 100644
--- a/resources/lang/zh-tw/songs.php
+++ b/resources/lang/zh-tw/songs.php
@@ -29,6 +29,7 @@ return [
'note04' => '備註04',
'enable' => '狀態',
'name_length' => '歌名字數',
+ 'db_change'=>'分貝增減',
'vocal' => '人聲',
'situation' => '情境',
'simplified' => '歌名簡體',
diff --git a/resources/views/livewire/forms/song-form.blade.php b/resources/views/livewire/forms/song-form.blade.php
index d5495e5..f80b732 100644
--- a/resources/views/livewire/forms/song-form.blade.php
+++ b/resources/views/livewire/forms/song-form.blade.php
@@ -43,6 +43,7 @@
option-label="name"
option-value="value"
/>
+