Add row deletion functionality and enhance table filters in Piyango views. Implemented confirmation dialog for row deletion and updated filter options for various table columns to improve user experience.
This commit is contained in:
@ -8,7 +8,8 @@
|
||||
:apiList="'OnayDurumu/GetSonOnayDurumlariList/' + piyangoStore.selectedLottery"
|
||||
apiText="Piyango Onay Log Listesi"
|
||||
page="form"
|
||||
:refresh="piyangoOnayStore.refreshList" />
|
||||
:refresh="piyangoOnayStore.refreshList"
|
||||
:rowActions="rowActions" />
|
||||
<panel-wrapper
|
||||
v-if="piyangoOnayStore.onayFormPanel"
|
||||
v-model="piyangoOnayStore.onayFormPanel"
|
||||
@ -40,6 +41,10 @@
|
||||
const piyangoStore = usePiyangoStore()
|
||||
import { usePiyangoDataStore } from '../../stores/piyangoDataStore'
|
||||
const piyangoDataStore = usePiyangoDataStore()
|
||||
import { useDialogStore } from '@/components/global/dialogStore'
|
||||
const dialogStore = useDialogStore()
|
||||
import { useDataStore } from '@/stores/dataStore'
|
||||
const dataStore = useDataStore()
|
||||
|
||||
const loaded = ref<boolean>(false)
|
||||
|
||||
@ -132,6 +137,41 @@
|
||||
piyangoOnayStore.onayFormPanel = true
|
||||
}
|
||||
|
||||
const DeleteRowPop = (data: Record<string, any>, i: number) => {
|
||||
dialogStore.CreateDialog({
|
||||
title: 'Onay Durumu Sil',
|
||||
id: 'deleteonaydurumu',
|
||||
content: 'Onay durumunu silmek istediğinize emin misiniz?',
|
||||
closeText: 'Vazgeç',
|
||||
buttons: [
|
||||
{
|
||||
label: 'Sil',
|
||||
type: 'alert',
|
||||
function: () => DeleteRow(data.id)
|
||||
}
|
||||
]
|
||||
})
|
||||
}
|
||||
|
||||
const DeleteRow = async (id: number | string) => {
|
||||
var dt = await dataStore.dataDelete('OnayDurumu/' + id, {
|
||||
toast: { toast: 'Onay durumu başarıyla silindi', type: 'success' }
|
||||
})
|
||||
|
||||
if (dt !== 'errorfalse') {
|
||||
dialogStore.CloseDialog('deleteonaydurumu')
|
||||
piyangoOnayStore.refreshList = true
|
||||
}
|
||||
}
|
||||
|
||||
const rowActions = ref<Record<string, any>[]>([
|
||||
{
|
||||
text: 'Sil',
|
||||
class: 'alert',
|
||||
action: DeleteRowPop
|
||||
}
|
||||
])
|
||||
|
||||
onBeforeMount(async () => {
|
||||
loaded.value = true
|
||||
})
|
||||
|
||||
@ -84,6 +84,9 @@
|
||||
title: 'Müdürlük',
|
||||
compute: (v: Record<string, any>): string => {
|
||||
return v.mudurluk || ''
|
||||
},
|
||||
filter: {
|
||||
type: 'text'
|
||||
}
|
||||
})
|
||||
|
||||
@ -103,7 +106,13 @@
|
||||
|
||||
// 4. DÜZENLEYEN (koşullu)
|
||||
if (usersStore.isAraciFirma || usersStore.isPanelUser) {
|
||||
header.push({ name: 'duzenleyen', title: 'Düzenleyen' })
|
||||
header.push({
|
||||
name: 'duzenleyen',
|
||||
title: 'Düzenleyen',
|
||||
filter: {
|
||||
type: 'text'
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 5. ARACI FİRMA
|
||||
@ -112,6 +121,9 @@
|
||||
title: 'Araci Firma',
|
||||
compute: (v: Record<string, any>): string => {
|
||||
return v.araciFirma || ''
|
||||
},
|
||||
filter: {
|
||||
type: 'text'
|
||||
}
|
||||
})
|
||||
|
||||
@ -156,7 +168,11 @@
|
||||
compute: (v: Record<string, any>): string => {
|
||||
return v.izinSayisi || ''
|
||||
},
|
||||
sort: true
|
||||
sort: true,
|
||||
filter: {
|
||||
type: 'text',
|
||||
range: true
|
||||
}
|
||||
})
|
||||
|
||||
// 9. BAŞLANGIÇ TARİHİ
|
||||
@ -211,6 +227,9 @@
|
||||
title: 'Çekiliş Görevlisi',
|
||||
compute: (v: Record<string, any>): string => {
|
||||
return v.cekilisGorevlisi || ''
|
||||
},
|
||||
filter: {
|
||||
type: 'text'
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user