Merge pull request 'Üye/Profil-Resim-Silme-Özelliği' (#6) from Üye/Profil-Resim-Silme-Özelliği into main
Reviewed-on: #6
This commit is contained in:
@ -1,49 +1,64 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class='form-part'>
|
<div class="form-part">
|
||||||
<div class='form-part-title'>
|
<div class="form-part-title">
|
||||||
<h4>Profil Resmi</h4>
|
<h4>Profil Resmi</h4>
|
||||||
</div>
|
</div>
|
||||||
<div class='form-part-content'>
|
<div class="form-part-content">
|
||||||
<template v-if="file.filePath !== '' && file.filePath !== null">
|
<template v-if="file.filePath !== '' && file.filePath !== null">
|
||||||
<file-list-item
|
<file-list-item
|
||||||
:data='file'
|
:data="file"
|
||||||
@click='ReplaceImage'
|
@click="ReplaceImage"
|
||||||
onlyPreview
|
onlyPreview
|
||||||
:filePath='file.filePath' />
|
:filePath="file.filePath">
|
||||||
|
<template
|
||||||
|
#actionButtons
|
||||||
|
v-if="
|
||||||
|
route.name === 'Profil' ||
|
||||||
|
(route.name === 'Profil' && !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>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<template v-if="route.name === 'Profil' || (route.name === 'Profil' && !usersStore.isPanelUser)">
|
<template
|
||||||
<div class='form-item form-item-picture clickable' @click='picturePanel = true'>
|
v-if="
|
||||||
<div class='image-c'>
|
route.name === 'Profil' ||
|
||||||
<i class='ico-c'>
|
(route.name === 'Profil' && !usersStore.isPanelUser)
|
||||||
|
">
|
||||||
|
<div class="form-item form-item-picture clickable" @click="picturePanel = true">
|
||||||
|
<div class="image-c">
|
||||||
|
<i class="ico-c">
|
||||||
<svg>
|
<svg>
|
||||||
<use href='@/assets/images/icons.svg#plus'></use>
|
<use href="@/assets/images/icons.svg#plus"></use>
|
||||||
</svg>
|
</svg>
|
||||||
</i>
|
</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<div class='form-inner-comment'>
|
<div class="form-inner-comment">Eklenmiş resim bulunamadı.</div>
|
||||||
Eklenmiş resim bulunamadı.
|
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<panel-wrapper
|
<panel-wrapper
|
||||||
v-if='picturePanel'
|
v-if="picturePanel"
|
||||||
v-model='picturePanel'
|
v-model="picturePanel"
|
||||||
panel-title='Profil Resmi Ekle'>
|
panel-title="Profil Resmi Ekle">
|
||||||
<template #panelContent>
|
<template #panelContent>
|
||||||
<panel-user-picture />
|
<panel-user-picture />
|
||||||
</template>
|
</template>
|
||||||
<template #footerButton>
|
<template #footerButton>
|
||||||
<div class='button-c button-save' @click='FileUpload'>Ekle</div>
|
<div class="button-c button-save" @click="FileUpload">Ekle</div>
|
||||||
</template>
|
</template>
|
||||||
</panel-wrapper>
|
</panel-wrapper>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang='ts'>
|
<script setup lang="ts">
|
||||||
import { ref, reactive, onBeforeMount } from 'vue'
|
import { ref, reactive, onBeforeMount } from 'vue'
|
||||||
import PanelUserPicture from '../panel/PanelUserPicture.vue'
|
import PanelUserPicture from '../panel/PanelUserPicture.vue'
|
||||||
import PanelWrapper from '@/components/PanelWrapper.vue'
|
import PanelWrapper from '@/components/PanelWrapper.vue'
|
||||||
@ -52,20 +67,13 @@
|
|||||||
|
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
import { useDataStore } from '@/stores/dataStore'
|
import { useDataStore } from '@/stores/dataStore'
|
||||||
|
|
||||||
const dataStore = useDataStore()
|
const dataStore = useDataStore()
|
||||||
import { useGlobalStore } from '@/stores/globalStore'
|
|
||||||
|
|
||||||
const globalStore = useGlobalStore()
|
|
||||||
import { useValidationStore } from '@/stores/validationStore'
|
import { useValidationStore } from '@/stores/validationStore'
|
||||||
|
|
||||||
const validationStore = useValidationStore()
|
const validationStore = useValidationStore()
|
||||||
import { useUsersStore } from '@/stores/usersStore'
|
import { useUsersStore } from '@/stores/usersStore'
|
||||||
|
|
||||||
const usersStore = useUsersStore()
|
const usersStore = useUsersStore()
|
||||||
import { useCustomerStore } from '@/module/uyeler/stores/customerStore'
|
import { useDialogStore } from '@/components/global/dialogStore'
|
||||||
|
const dialogStore = useDialogStore()
|
||||||
const customerStore = useCustomerStore()
|
|
||||||
|
|
||||||
const picturePanel = ref<boolean>(false)
|
const picturePanel = ref<boolean>(false)
|
||||||
const isUpdate = ref<boolean>(false)
|
const isUpdate = ref<boolean>(false)
|
||||||
@ -82,7 +90,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
const GetData = async () => {
|
const GetData = async () => {
|
||||||
let dt = await dataStore.dataGet('AppUserResim/AppUserId/' + usersStore.selectedUserId())
|
let dt = await dataStore.dataGet(
|
||||||
|
'AppUserResim/AppUserId/' + usersStore.selectedUserId()
|
||||||
|
)
|
||||||
if (dt !== 'errorfalse') {
|
if (dt !== 'errorfalse') {
|
||||||
Object.assign(file, dt)
|
Object.assign(file, dt)
|
||||||
if (usersStore.selectedUserId() === usersStore.userId)
|
if (usersStore.selectedUserId() === usersStore.userId)
|
||||||
@ -126,6 +136,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: 'Resim Sil',
|
||||||
|
type: 'alert',
|
||||||
|
function: () => DeleteImage(data.id)
|
||||||
|
}
|
||||||
|
]
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
const DeleteImage = async (id: number | string) => {
|
||||||
|
var dt = await dataStore.dataDelete('AppUserResim/' + id)
|
||||||
|
|
||||||
|
if (dt !== 'errorfalse') {
|
||||||
|
dialogStore.CloseDialog('deleteimage')
|
||||||
|
await GetData()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
onBeforeMount(async () => {
|
onBeforeMount(async () => {
|
||||||
await GetData()
|
await GetData()
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user