Sayfa-Resim-Silme-Özelliği #10

Merged
burak.ovec merged 3 commits from Sayfa-Resim-Silme-Özelliği into main 2025-08-25 10:00:40 +00:00
Showing only changes of commit 97a77a2a37 - Show all commits

View File

@ -9,7 +9,15 @@
:data="file"
@click="ReplaceImage"
onlyPreview
:filePath="file.fileUrl" />
:filePath="file.fileUrl">
<template #actionButtons v-if="!usersStore.isPanelUser">
<i
class="ico-c ico-btn ico-section back-grad-alert"
@click="DeleteImagePop(file)">
<svg><use href="/src/assets/images/icons.svg#trash"></use></svg>
</i>
</template>
</file-list-item>
</template>
<template v-else>
<div class="form-item form-item-picture clickable" @click="picturePanel = true">
@ -43,17 +51,19 @@
import { useDataStore } from '@/stores/dataStore'
const dataStore = useDataStore()
import { useGlobalStore } from '@/stores/globalStore'
const globalStore = useGlobalStore()
import { useValidationStore } from '@/stores/validationStore'
const validationStore = useValidationStore()
import { useSiteManagementPageStore } from '../../stores/siteManagementPageStore'
const siteManagementPageStore = useSiteManagementPageStore()
const siteManagementPageStore = useSiteManagementPageStore()
import { useDialogStore } from '@/components/global/dialogStore'
const dialogStore = useDialogStore()
import { useUsersStore } from '@/stores/usersStore'
const usersStore = useUsersStore()
const picturePanel = ref<boolean>(false)
const isUpdate = ref<boolean>(false)
const file = reactive<Record<string,any>>({
const file = reactive<Record<string, any>>({
title: '',
fileUrl: ''
})
@ -108,6 +118,32 @@
}
}
}
const DeleteImagePop = (data: Record<string, any>) => {
dialogStore.CreateDialog({
title: 'Resim Sil',
id: 'deleteimage',
content: 'Resmi silmek istediğinize emin misiniz? Bu işlem geri alınamaz.',
closeText: 'Vazgeç',
buttons: [
{
label: 'Resmi Sil',
type: 'alert',
function: () => DeleteImage(data.id)
}
]
})
}
const DeleteImage = async (id: number | string) => {
var dt = await dataStore.dataDelete('Popup/' + id)
if (dt !== 'errorfalse') {
dialogStore.CloseDialog('deleteimage')
await GetData()
}
}
onBeforeMount(async () => {
await GetData()
})