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:
burakovec
2025-12-09 14:01:25 +03:00
parent f6c1b242b2
commit b0386d53e5
2 changed files with 62 additions and 3 deletions

View File

@ -8,7 +8,8 @@
:apiList="'OnayDurumu/GetSonOnayDurumlariList/' + piyangoStore.selectedLottery" :apiList="'OnayDurumu/GetSonOnayDurumlariList/' + piyangoStore.selectedLottery"
apiText="Piyango Onay Log Listesi" apiText="Piyango Onay Log Listesi"
page="form" page="form"
:refresh="piyangoOnayStore.refreshList" /> :refresh="piyangoOnayStore.refreshList"
:rowActions="rowActions" />
<panel-wrapper <panel-wrapper
v-if="piyangoOnayStore.onayFormPanel" v-if="piyangoOnayStore.onayFormPanel"
v-model="piyangoOnayStore.onayFormPanel" v-model="piyangoOnayStore.onayFormPanel"
@ -40,6 +41,10 @@
const piyangoStore = usePiyangoStore() const piyangoStore = usePiyangoStore()
import { usePiyangoDataStore } from '../../stores/piyangoDataStore' import { usePiyangoDataStore } from '../../stores/piyangoDataStore'
const piyangoDataStore = usePiyangoDataStore() 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) const loaded = ref<boolean>(false)
@ -132,6 +137,41 @@
piyangoOnayStore.onayFormPanel = true 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 () => { onBeforeMount(async () => {
loaded.value = true loaded.value = true
}) })

View File

@ -84,6 +84,9 @@
title: 'Müdürlük', title: 'Müdürlük',
compute: (v: Record<string, any>): string => { compute: (v: Record<string, any>): string => {
return v.mudurluk || '' return v.mudurluk || ''
},
filter: {
type: 'text'
} }
}) })
@ -103,7 +106,13 @@
// 4. DÜZENLEYEN (koşullu) // 4. DÜZENLEYEN (koşullu)
if (usersStore.isAraciFirma || usersStore.isPanelUser) { 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 // 5. ARACI FİRMA
@ -112,6 +121,9 @@
title: 'Araci Firma', title: 'Araci Firma',
compute: (v: Record<string, any>): string => { compute: (v: Record<string, any>): string => {
return v.araciFirma || '' return v.araciFirma || ''
},
filter: {
type: 'text'
} }
}) })
@ -156,7 +168,11 @@
compute: (v: Record<string, any>): string => { compute: (v: Record<string, any>): string => {
return v.izinSayisi || '' return v.izinSayisi || ''
}, },
sort: true sort: true,
filter: {
type: 'text',
range: true
}
}) })
// 9. BAŞLANGIÇ TARİHİ // 9. BAŞLANGIÇ TARİHİ
@ -211,6 +227,9 @@
title: 'Çekiliş Görevlisi', title: 'Çekiliş Görevlisi',
compute: (v: Record<string, any>): string => { compute: (v: Record<string, any>): string => {
return v.cekilisGorevlisi || '' return v.cekilisGorevlisi || ''
},
filter: {
type: 'text'
} }
}) })