加入新增 20250502
This commit is contained in:
parent
3a609e495f
commit
077d418357
@ -13,8 +13,8 @@ enum UserGender: string
|
|||||||
public function labels(): string
|
public function labels(): string
|
||||||
{
|
{
|
||||||
return match($this) {
|
return match($this) {
|
||||||
self::Male => __('enums.user.gender.Male'),
|
self::Male => __('enums.Male'),
|
||||||
self::Female => __('enums.user.gender.Female'),
|
self::Female => __('enums.Female'),
|
||||||
self::Other => __('enums.Other'),
|
self::Other => __('enums.Other'),
|
||||||
self::Unset => __('enums.Unset'),
|
self::Unset => __('enums.Unset'),
|
||||||
};
|
};
|
||||||
|
@ -45,6 +45,7 @@ final class ArtistTable extends PowerGridComponent
|
|||||||
->showToggleColumns()
|
->showToggleColumns()
|
||||||
//->showSoftDeletes()
|
//->showSoftDeletes()
|
||||||
//->showSearchInput()
|
//->showSearchInput()
|
||||||
|
->includeViewOnTop('livewire.admin.artist-header')
|
||||||
,
|
,
|
||||||
PowerGrid::footer()
|
PowerGrid::footer()
|
||||||
->showPerPage()
|
->showPerPage()
|
||||||
|
@ -59,6 +59,7 @@ class RoleForm extends Component
|
|||||||
|
|
||||||
$this->resetFields();
|
$this->resetFields();
|
||||||
$this->showCreateModal = false;
|
$this->showCreateModal = false;
|
||||||
|
$this->dispatch('pg:eventRefresh-role-table');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function deleteRole($id)
|
public function deleteRole($id)
|
||||||
|
@ -27,8 +27,9 @@ final class RoleTable extends PowerGridComponent
|
|||||||
//$this->showCheckBox();
|
//$this->showCheckBox();
|
||||||
|
|
||||||
return [
|
return [
|
||||||
//PowerGrid::header()
|
PowerGrid::header()
|
||||||
// ->showSearchInput(),
|
// ->showSearchInput(),
|
||||||
|
->includeViewOnTop('livewire.admin.role-header'),
|
||||||
//PowerGrid::footer()
|
//PowerGrid::footer()
|
||||||
// ->showPerPage()
|
// ->showPerPage()
|
||||||
// ->showRecordCount(),
|
// ->showRecordCount(),
|
||||||
@ -61,7 +62,7 @@ final class RoleTable extends PowerGridComponent
|
|||||||
|
|
||||||
return $rolePermissions->implode(', ');
|
return $rolePermissions->implode(', ');
|
||||||
})
|
})
|
||||||
->add('created_at_formatted', fn (Role $model) => Carbon::parse($model->created_at)->format('d/m/Y H:i:s'));
|
->add('created_at_formatted', fn (Role $model) => Carbon::parse($model->created_at)->format('Y-m-d H:i:s'));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function columns(): array
|
public function columns(): array
|
||||||
|
@ -90,6 +90,7 @@ class SongForm extends Component
|
|||||||
|
|
||||||
$this->resetFields();
|
$this->resetFields();
|
||||||
$this->showCreateModal = false;
|
$this->showCreateModal = false;
|
||||||
|
$this->dispatch('pg:eventRefresh-song-table');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function deleteSong($id)
|
public function deleteSong($id)
|
||||||
|
@ -46,6 +46,7 @@ final class SongTable extends PowerGridComponent
|
|||||||
->showSoftDeletes()
|
->showSoftDeletes()
|
||||||
->showToggleColumns()
|
->showToggleColumns()
|
||||||
//->showSearchInput()
|
//->showSearchInput()
|
||||||
|
->includeViewOnTop('livewire.admin.song-header')
|
||||||
,
|
,
|
||||||
PowerGrid::footer()
|
PowerGrid::footer()
|
||||||
->showPerPage()
|
->showPerPage()
|
||||||
|
@ -43,6 +43,7 @@ final class UserTable extends PowerGridComponent
|
|||||||
//->showSoftDeletes()
|
//->showSoftDeletes()
|
||||||
->showToggleColumns()
|
->showToggleColumns()
|
||||||
//->showSearchInput()
|
//->showSearchInput()
|
||||||
|
->includeViewOnTop('livewire.admin.user-header')
|
||||||
,
|
,
|
||||||
PowerGrid::footer()->showPerPage()->showRecordCount(),
|
PowerGrid::footer()->showPerPage()->showRecordCount(),
|
||||||
];
|
];
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
return [
|
return [
|
||||||
'management' => '歌手管理',
|
'management' => '歌手管理',
|
||||||
'list' => '歌手列表',
|
'list' => '歌手列表',
|
||||||
'CreateNewArtist' => '新增歌手',
|
'CreateNew' => '新增歌手',
|
||||||
'create_edit' => '新增 / 編輯',
|
'create_edit' => '新增 / 編輯',
|
||||||
'create' => '新增',
|
'create' => '新增',
|
||||||
'edit' => '編輯',
|
'edit' => '編輯',
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
return [
|
return [
|
||||||
'list' => '角色列表',
|
'list' => '角色列表',
|
||||||
'CreateNewRole' => '新增角色',
|
'CreateNew' => '新增角色',
|
||||||
'edit' => '編輯',
|
'edit' => '編輯',
|
||||||
'delete' => '刪除',
|
'delete' => '刪除',
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
return [
|
return [
|
||||||
'management' => '歌曲管理',
|
'management' => '歌曲管理',
|
||||||
'list' => '歌曲列表',
|
'list' => '歌曲列表',
|
||||||
'CreateNewArtist' => '新增歌曲',
|
'CreateNew' => '新增歌曲',
|
||||||
'create_edit' => '新增 / 編輯',
|
'create_edit' => '新增 / 編輯',
|
||||||
'create' => '新增',
|
'create' => '新增',
|
||||||
'edit' => '編輯',
|
'edit' => '編輯',
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
return [
|
return [
|
||||||
'list' => '使用者列表',
|
'list' => '使用者列表',
|
||||||
'CreateNewRole' => '新增使用者',
|
'CreateNew' => '新增使用者',
|
||||||
'edit' => '編輯',
|
'edit' => '編輯',
|
||||||
'delete' => '刪除',
|
'delete' => '刪除',
|
||||||
|
|
||||||
|
@ -12,9 +12,9 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<x-slot name="footer">
|
<x-slot name="footer">
|
||||||
<div class="flex justify-center gap-2">
|
<div class="flex justify-between w-full">
|
||||||
<x-wireui:button primary label="{{__('artists.cancel')}}" x-on:click="$dispatch('close')" />
|
<x-wireui:button flat label="{{__('atrists.cancel')}}" @click="$wire.showCreateModal = false" />
|
||||||
<x-wireui:button primary label="{{__('artists.submit')}}" wire:click="save" />
|
<x-wireui:button primary type="submit" label="儲存" />
|
||||||
</div>
|
</div>
|
||||||
</x-slot>
|
</x-slot>
|
||||||
</x-wireui:modal-card>
|
</x-wireui:modal-card>
|
||||||
|
8
resources/views/livewire/admin/artist-header.blade.php
Normal file
8
resources/views/livewire/admin/artist-header.blade.php
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
<div class="flex justify-end mb-2">
|
||||||
|
<x-wireui:button
|
||||||
|
wire:click="$dispatchTo('admin.artist-form', 'openCreateArtistModal')"
|
||||||
|
icon="plus"
|
||||||
|
label="{{ __('artists.CreateNew') }}"
|
||||||
|
class="bg-blue-600 text-white"
|
||||||
|
/>
|
||||||
|
</div>
|
@ -1,9 +1,5 @@
|
|||||||
|
|
||||||
<x-layouts.admin>
|
<x-layouts.admin>
|
||||||
<x-slot name="header">
|
|
||||||
歌手管理
|
|
||||||
</x-slot>
|
|
||||||
|
|
||||||
@if (session()->has('message'))
|
@if (session()->has('message'))
|
||||||
<x-wireui:notifications />
|
<x-wireui:notifications />
|
||||||
<script>
|
<script>
|
||||||
@ -16,6 +12,8 @@
|
|||||||
@endif
|
@endif
|
||||||
|
|
||||||
{{-- 單一 Livewire 元件,內含資料表與 Modal --}}
|
{{-- 單一 Livewire 元件,內含資料表與 Modal --}}
|
||||||
|
|
||||||
|
|
||||||
<livewire:admin.artist-table />
|
<livewire:admin.artist-table />
|
||||||
<livewire:admin.artist-form />
|
<livewire:admin.artist-form />
|
||||||
</x-layouts.admin>
|
</x-layouts.admin>
|
@ -15,8 +15,8 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<x-slot name="footer">
|
<x-slot name="footer">
|
||||||
<div class="flex justify-center gap-2">
|
<div class="flex justify-between w-full">
|
||||||
<x-wireui:button primary label="{{__('roles.cancel')}}" x-on:click="$dispatch('close')" />
|
<x-wireui:button flat label="{{__('roles.cancel')}}" @click="$wire.showCreateModal = false" />
|
||||||
<x-wireui:button primary label="{{__('roles.submit')}}" wire:click="save" />
|
<x-wireui:button primary label="{{__('roles.submit')}}" wire:click="save" />
|
||||||
</div>
|
</div>
|
||||||
</x-slot>
|
</x-slot>
|
||||||
|
8
resources/views/livewire/admin/role-header.blade.php
Normal file
8
resources/views/livewire/admin/role-header.blade.php
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
<div class="flex justify-end mb-2">
|
||||||
|
<x-wireui:button
|
||||||
|
wire:click="$dispatchTo('admin.role-form', 'openCreateRoleModal')"
|
||||||
|
icon="plus"
|
||||||
|
label="{{ __('roles.CreateNew') }}"
|
||||||
|
class="bg-blue-600 text-white"
|
||||||
|
/>
|
||||||
|
</div>
|
@ -1,9 +1,5 @@
|
|||||||
|
|
||||||
<x-layouts.admin>
|
<x-layouts.admin>
|
||||||
<x-slot name="header">
|
|
||||||
角色管理
|
|
||||||
</x-slot>
|
|
||||||
|
|
||||||
@if (session()->has('message'))
|
@if (session()->has('message'))
|
||||||
<x-wireui:notifications />
|
<x-wireui:notifications />
|
||||||
<script>
|
<script>
|
||||||
|
@ -64,10 +64,10 @@
|
|||||||
<x-wireui:textarea label="備註3" wire:model.defer="fields.note03" />
|
<x-wireui:textarea label="備註3" wire:model.defer="fields.note03" />
|
||||||
<x-wireui:textarea label="備註4" wire:model.defer="fields.note04" />
|
<x-wireui:textarea label="備註4" wire:model.defer="fields.note04" />
|
||||||
</div>
|
</div>
|
||||||
{{-- Footer --}}
|
|
||||||
<x-slot name="footer">
|
<x-slot name="footer">
|
||||||
<div class="flex justify-between w-full">
|
<div class="flex justify-between w-full">
|
||||||
<x-wireui:button flat label="取消" @click="$wire.showCreateModal = false" />
|
<x-wireui:button flat label="{{__('songs.cancel')}}" @click="$wire.showCreateModal = false" />
|
||||||
<x-wireui:button primary type="submit" label="儲存" />
|
<x-wireui:button primary type="submit" label="儲存" />
|
||||||
</div>
|
</div>
|
||||||
</x-slot>
|
</x-slot>
|
||||||
|
8
resources/views/livewire/admin/song-header.blade.php
Normal file
8
resources/views/livewire/admin/song-header.blade.php
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
<div class="flex justify-end mb-2">
|
||||||
|
<x-wireui:button
|
||||||
|
wire:click="$dispatchTo('admin.song-form', 'openCreateSongModal')"
|
||||||
|
icon="plus"
|
||||||
|
label="{{ __('songs.CreateNew') }}"
|
||||||
|
class="bg-blue-600 text-white"
|
||||||
|
/>
|
||||||
|
</div>
|
@ -1,9 +1,5 @@
|
|||||||
|
|
||||||
<x-layouts.admin>
|
<x-layouts.admin>
|
||||||
<x-slot name="header">
|
|
||||||
歌曲列表
|
|
||||||
</x-slot>
|
|
||||||
|
|
||||||
@if (session()->has('message'))
|
@if (session()->has('message'))
|
||||||
<x-wireui:notifications />
|
<x-wireui:notifications />
|
||||||
<script>
|
<script>
|
||||||
|
@ -32,8 +32,8 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<x-slot name="footer">
|
<x-slot name="footer">
|
||||||
<div class="flex justify-center gap-2">
|
<div class="flex justify-between w-full">
|
||||||
<x-wireui:button primary label="{{__('users.cancel')}}" x-on:click="$dispatch('close')" />
|
<x-wireui:button flat label="{{__('users.cancel')}}" @click="$wire.showCreateModal = false" />
|
||||||
<x-wireui:button primary label="{{__('users.submit')}}" wire:click="save" />
|
<x-wireui:button primary label="{{__('users.submit')}}" wire:click="save" />
|
||||||
</div>
|
</div>
|
||||||
</x-slot>
|
</x-slot>
|
||||||
|
8
resources/views/livewire/admin/user-header.blade.php
Normal file
8
resources/views/livewire/admin/user-header.blade.php
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
<div class="flex justify-end mb-2">
|
||||||
|
<x-wireui:button
|
||||||
|
wire:click="$dispatchTo('admin.user-form', 'openCreateUserModal')"
|
||||||
|
icon="plus"
|
||||||
|
label="{{ __('users.CreateNew') }}"
|
||||||
|
class="bg-blue-600 text-white"
|
||||||
|
/>
|
||||||
|
</div>
|
@ -1,9 +1,5 @@
|
|||||||
|
|
||||||
<x-layouts.admin>
|
<x-layouts.admin>
|
||||||
<x-slot name="header">
|
|
||||||
使用者管理
|
|
||||||
</x-slot>
|
|
||||||
|
|
||||||
@if (session()->has('message'))
|
@if (session()->has('message'))
|
||||||
<x-wireui:notifications />
|
<x-wireui:notifications />
|
||||||
<script>
|
<script>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user