6 Commits

9 changed files with 129 additions and 62 deletions

View File

@ -1 +1,2 @@
VITE_API_URL=https://panelapi.cekilisevitest.gov.tr/
VITE_API_URL=http://panelapi.cekilisevitest.gov.tr/
VITE_SOCKET_URL=https://panelapi.cekilisevitest.gov.tr/uploadHub

View File

@ -1 +1,2 @@
VITE_API_URL=https://localhost:7241/
VITE_API_URL=https://localhost:7241/
VITE_SOCKET_URL=https://localhost:7241/uploadHub

View File

@ -1 +1,2 @@
VITE_API_URL=https://panelapi.cekilisevi.gov.tr/
VITE_API_URL=https://panelapi.cekilisevi.gov.tr/
VITE_SOCKET_URL=https://panelapi.cekilisevi.gov.tr/uploadHub

View File

@ -659,7 +659,9 @@ svg {
max-width: 24px;
max-height: 24px;
}
.ico-c.ico-btn:hover{
background-color: navy;
}
/* colors */
.back-grad {
padding: 6px 8px;
@ -715,7 +717,11 @@ svg {
color: #000;
padding: 12px;
}
.back-grad-dgrey {
background-image: linear-gradient(24deg, #797979, #a1a1a1);
color: #000;
padding: 12px;
}
.back-grey {
background-color: #f1f1f1;
}

View File

@ -21,7 +21,7 @@
<div class="actions-c" v-if="editable || $slots.actionButtons">
<slot name="actionButtons"></slot>
<i
class="ico-c ico-section ico-section-header-btn ico-replace"
class="ico-c ico-section ico-btn back-grad-dgrey"
@click="OnClick"
v-if="editable">
<svg><use href="/src/assets/images/icons.svg#replace"></use></svg>
@ -38,12 +38,15 @@
</div>
<div v-else>{{ fileType.toLocaleUpperCase() }}</div>
</a>
<i
class="ico-c ico-section ico-section-header-btn ico-replace"
@click="OnClick"
v-if="editable">
<svg><use href="/src/assets/images/icons.svg#replace"></use></svg>
</i>
<div class="actions-c actions-top" v-if="editable || $slots.actionButtons">
<slot name="actionButtons"></slot>
<i
class="ico-c ico-section ico-btn back-grad-dgrey"
@click="OnClick"
v-if="editable">
<svg><use href="/src/assets/images/icons.svg#replace"></use></svg>
</i>
</div>
</div>
</template>
</template>
@ -114,4 +117,14 @@
align-items: center;
pointer-events: fill;
}
.actions-c.actions-top{
align-items: flex-start;
}
.form-item-picture.only-image{
width: 140px;
height: 140px;
}
.actions-c .ico-btn:last-child {
margin-right: 0;
}
</style>

View File

@ -57,7 +57,7 @@
<panel-katilimci-document />
</template>
<template #footerButton>
<button class="button-c button-save" @click="FileUpload">Yükle</button>
<button class="button-c button-save" @click="FileUpload" :disabled="uploadProgressPanel">Yükle</button>
</template>
</panel-wrapper>
<panel-wrapper

View File

@ -1,34 +1,34 @@
import * as signalR from "@microsoft/signalr";
import { v4 as uuidv4 } from "uuid";
import * as signalR from '@microsoft/signalr'
import { v4 as uuidv4 } from 'uuid'
let connection: signalR.HubConnection;
let connectionId = "";
let connection: signalR.HubConnection
let connectionId = ''
export const connectToHub = async () => {
connection = new signalR.HubConnectionBuilder()
.withUrl("https://panelapi.cekilisevi.gov.tr/uploadHub", {
withCredentials: false // Bu zorunlu, yoksa cookie vs gönderilmez
.withUrl(import.meta.env.VITE_SOCKET_URL, {
withCredentials: false // Bu zorunlu, yoksa cookie vs gönderilmez
}) // backend adresine göre düzenle
.withAutomaticReconnect()
.build();
.build()
await connection.start();
connectionId = connection.connectionId || uuidv4(); // SignalR id'si ya da frontend'de de guid üretilebilir
return connectionId;
};
await connection.start()
connectionId = connection.connectionId || uuidv4() // SignalR id'si ya da frontend'de de guid üretilebilir
return connectionId
}
export const onProgress = (callback: (data: any) => void) => {
connection.on("ReceiveProgress", callback);
};
connection.on('ReceiveProgress', callback)
}
export const onInsertProgress = (callback: (data: any) => void) => {
connection.on("ReceiveInsertProgress", callback);
};
connection.on('ReceiveInsertProgress', callback)
}
export const onCompleted = (callback: (data: any) => void) => {
connection.on("ReceiveCompleted", callback);
};
connection.on('ReceiveCompleted', callback)
}
export const onError = (callback: (data: any) => void) => {
connection.on("ReceiveError", callback);
};
connection.on('ReceiveError', callback)
}

View File

@ -1,49 +1,64 @@
<template>
<div class='form-part'>
<div class='form-part-title'>
<div class="form-part">
<div class="form-part-title">
<h4>Profil Resmi</h4>
</div>
<div class='form-part-content'>
<div class="form-part-content">
<template v-if="file.filePath !== '' && file.filePath !== null">
<file-list-item
:data='file'
@click='ReplaceImage'
:data="file"
@click="ReplaceImage"
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 v-else>
<template v-if="route.name === 'Profil' || (route.name === 'Profil' && !usersStore.isPanelUser)">
<div class='form-item form-item-picture clickable' @click='picturePanel = true'>
<div class='image-c'>
<i class='ico-c'>
<template
v-if="
route.name === 'Profil' ||
(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>
<use href='@/assets/images/icons.svg#plus'></use>
<use href="@/assets/images/icons.svg#plus"></use>
</svg>
</i>
</div>
</div>
</template>
<template v-else>
<div class='form-inner-comment'>
Eklenmiş resim bulunamadı.
</div>
<div class="form-inner-comment">Eklenmiş resim bulunamadı.</div>
</template>
</template>
</div>
</div>
<panel-wrapper
v-if='picturePanel'
v-model='picturePanel'
panel-title='Profil Resmi Ekle'>
v-if="picturePanel"
v-model="picturePanel"
panel-title="Profil Resmi Ekle">
<template #panelContent>
<panel-user-picture />
</template>
<template #footerButton>
<div class='button-c button-save' @click='FileUpload'>Ekle</div>
<div class="button-c button-save" @click="FileUpload">Ekle</div>
</template>
</panel-wrapper>
</template>
<script setup lang='ts'>
<script setup lang="ts">
import { ref, reactive, onBeforeMount } from 'vue'
import PanelUserPicture from '../panel/PanelUserPicture.vue'
import PanelWrapper from '@/components/PanelWrapper.vue'
@ -52,20 +67,13 @@
const route = useRoute()
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 { useUsersStore } from '@/stores/usersStore'
const usersStore = useUsersStore()
import { useCustomerStore } from '@/module/uyeler/stores/customerStore'
const customerStore = useCustomerStore()
import { useDialogStore } from '@/components/global/dialogStore'
const dialogStore = useDialogStore()
const picturePanel = ref<boolean>(false)
const isUpdate = ref<boolean>(false)
@ -82,7 +90,9 @@
}
const GetData = async () => {
let dt = await dataStore.dataGet('AppUserResim/AppUserId/' + usersStore.selectedUserId())
let dt = await dataStore.dataGet(
'AppUserResim/AppUserId/' + usersStore.selectedUserId()
)
if (dt !== 'errorfalse') {
Object.assign(file, dt)
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 () => {
await GetData()
})

View File

@ -6,7 +6,16 @@ import vueJsx from '@vitejs/plugin-vue-jsx'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [vue(), vueJsx()],
plugins: [
vue({
template: {
compilerOptions: {
comments: false
}
}
}),
vueJsx()
],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))