- Dosya Kapama ikramiye ekleme validasyon hatası

- Piyango bilgi yükleniyor uyarısı
- Piyango bilgileri üye kontrol butonu
This commit is contained in:
M. Bestami
2025-10-03 16:47:54 +03:00
8 changed files with 106 additions and 18 deletions

View File

@ -10,7 +10,7 @@
</h1> </h1>
<div class="section-header-buttons-c"> <div class="section-header-buttons-c">
<icon-button <icon-button
toRoute="/piyangolar/piyango-listesi" @click="goToListWithFilter"
icon="list" icon="list"
iconClass="ico-section ico-section-header-btn" /> iconClass="ico-section ico-section-header-btn" />
</div> </div>
@ -60,9 +60,11 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref } from 'vue' import { ref } from 'vue'
import { useDateStore } from '@/stores/dateStore' import { useDateStore } from '@/stores/dateStore'
import { useRouter } from 'vue-router'
import icourl from '@/assets/images/icons.svg' import icourl from '@/assets/images/icons.svg'
const dateStore = useDateStore() const dateStore = useDateStore()
const router = useRouter()
const props = defineProps<{ const props = defineProps<{
tableData: Record<string, any> tableData: Record<string, any>
@ -76,6 +78,7 @@
dateKey: string dateKey: string
iconBack: string iconBack: string
total: number total: number
filterParams?: Record<string, any>
}>() }>()
const totalData = ref<number>(props.total) const totalData = ref<number>(props.total)
@ -92,4 +95,18 @@
const OnClick = (e: Event, row: object) => { const OnClick = (e: Event, row: object) => {
emit('click', row) emit('click', row)
} }
const goToListWithFilter = () => {
const query: Record<string, any> = {}
// Filtre parametrelerini query'ye ekle
if (props.filterParams) {
Object.assign(query, props.filterParams)
}
router.push({
path: '/piyangolar/piyango-listesi',
query: query
})
}
</script> </script>

View File

@ -590,6 +590,17 @@
searchForm.value = false searchForm.value = false
mobileButtons.value = false mobileButtons.value = false
} }
// Filtre başlığını almak için yardımcı fonksiyon
const getFilterTitle = (key: string): string => {
const filterTitles: Record<string, string> = {
'durumId': 'Durum',
'piyangoAmacId': 'Piyango Amacı',
'cekilisYontemiId': 'Çekiliş Yöntemi'
}
return filterTitles[key] || key
}
onBeforeMount(() => { onBeforeMount(() => {
if (globalStore.screenWidth >= globalStore.breakPoints.tabletp) if (globalStore.screenWidth >= globalStore.breakPoints.tabletp)
mobileButtons.value = true mobileButtons.value = true
@ -598,6 +609,21 @@
RouteSearchControl() RouteSearchControl()
RouteFilterControl() RouteFilterControl()
// URL query parametrelerini kontrol et ve filtreleri uygula (ilk istekten önce)
if (Object.keys(route.query).length > 0) {
Object.keys(route.query).forEach(key => {
const value = route.query[key]
if (value && typeof value === 'string') {
// Filtre parametresini filterParams'a ekle
filterParams[key] = {
val: value,
op: '=',
title: getFilterTitle(key)
}
}
})
}
if (props.apiList !== undefined) GetLocalData() if (props.apiList !== undefined) GetLocalData()
window.addEventListener('resize', Resize) window.addEventListener('resize', Resize)

View File

@ -148,6 +148,8 @@
const uploadProgressValue = ref(0) const uploadProgressValue = ref(0)
const uploadProgressPanel = ref(false) const uploadProgressPanel = ref(false)
const connectionId = ref('')
const tableHeader = ref<Record<string, any>[]>([ const tableHeader = ref<Record<string, any>[]>([
{ {
name: 'cekilisKatilimSiraNo', name: 'cekilisKatilimSiraNo',
@ -252,7 +254,8 @@
else return '' else return ''
}) })
const AddNewDocument = () => { const AddNewDocument = async () => {
connectionId.value = await connectToHub()
dataStore.panelData = { dataStore.panelData = {
title: '', title: '',
file: '' file: ''
@ -277,7 +280,7 @@
piyangoKatilimciStore.katilimciUserPanel = true piyangoKatilimciStore.katilimciUserPanel = true
} }
const FileUpload = async () => { const FileUpload = async () => {
const connectionId = await connectToHub() // Mevcut bağlantıyı kullan (AddNewDocument'te açıldı)
// Progress modal'ı // Progress modal'ı
uploadProgressValue.value = 0 uploadProgressValue.value = 0
@ -302,7 +305,7 @@
) )
console.log(dataStore.panelData) console.log(dataStore.panelData)
const response = await dataStore.dataPost( const response = await dataStore.dataPost(
`Katilimci/ExcelleYukle/${piyangoStore.selectedLottery}?connectionId=${connectionId}`, `Katilimci/ExcelleYukle/${piyangoStore.selectedLottery}?connectionId=${connectionId.value}`,
{ {
data: formData, data: formData,
headers: { 'Content-Type': 'multipart/form-data' } headers: { 'Content-Type': 'multipart/form-data' }

View File

@ -82,9 +82,7 @@
}, },
{ {
name: 'aciklama', name: 'aciklama',
title: 'Açıklama', title: 'Açıklama'
sort: true,
style: { width: '30%' }
}, },
{ {
dosyaUrl: 'aciklama', dosyaUrl: 'aciklama',
@ -95,7 +93,19 @@
} }
}, },
style: { width: '20%' } style: { width: '20%' }
} },
{
name: 'izinSayisi',
title: 'İzin Sayısı'
},
{
name: 'izinTarihi',
title: 'İzin Tarihi'
},
{
name: 'izinAciklamasi',
title: 'İzin Açıklaması'
},
]) ])
const EditOnay = (d: Record<string, any>) => { const EditOnay = (d: Record<string, any>) => {

View File

@ -1,19 +1,33 @@
import * as signalR from '@microsoft/signalr' import * as signalR from '@microsoft/signalr'
import { v4 as uuidv4 } from 'uuid'
let connection: signalR.HubConnection let connection: signalR.HubConnection
let connectionId = '' let connectionId = ''
export const connectToHub = async () => { export const connectToHub = async () => {
console.log('Connecting to SignalR Hub...')
// Mevcut bağlantı varsa kapat
if (connection && connection.state === signalR.HubConnectionState.Connected) {
await connection.stop()
}
connection = new signalR.HubConnectionBuilder() connection = new signalR.HubConnectionBuilder()
.withUrl(import.meta.env.VITE_SOCKET_URL, { .withUrl(import.meta.env.VITE_SOCKET_URL, {
withCredentials: false // Bu zorunlu, yoksa cookie vs gönderilmez withCredentials: true,
}) // backend adresine göre düzenle skipNegotiation: true, // WebSocket kullanırken negotiation atlanabilir
transport: signalR.HttpTransportType.WebSockets
})
.withAutomaticReconnect() .withAutomaticReconnect()
.build() .build()
// Eventleri ekle
onProgress((data) => console.log('progress', data))
onInsertProgress((data) => console.log('insert progress', data))
onCompleted((data) => console.log('completed', data))
onError((data) => console.log('error', data))
await connection.start() await connection.start()
connectionId = connection.connectionId || uuidv4() // SignalR id'si ya da frontend'de de guid üretilebilir connectionId = await connection.invoke<string>('GetConnectionId')
console.log('Connected to SignalR Hub with Connection ID:', connectionId)
return connectionId return connectionId
} }

View File

@ -23,7 +23,8 @@
</AdminLayout> </AdminLayout>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref, computed, onBeforeMount } from 'vue' import { ref, computed, onBeforeMount, onMounted } from 'vue'
import { useRoute } from 'vue-router'
import AdminLayout from '@/layouts/AdminLayout.vue' import AdminLayout from '@/layouts/AdminLayout.vue'
import { useDateStore } from '@/stores/dateStore' import { useDateStore } from '@/stores/dateStore'
@ -39,6 +40,7 @@
const piyangoServices = usePiyangoServices() const piyangoServices = usePiyangoServices()
import router from '@/router' import router from '@/router'
const route = useRoute()
const loaded = ref<boolean>(false) const loaded = ref<boolean>(false)
const apiList = ref<string>('') const apiList = ref<string>('')
@ -241,4 +243,13 @@
loaded.value = true loaded.value = true
}) })
onMounted(() => {
// URL query parametrelerini kontrol et ve filtreleri uygula
if (route.query.durumId) {
// Filtre parametresini ListTableContent bileşenine iletmek için
// Bu parametre otomatik olarak ListTableContent tarafından işlenecek
console.log('Durum filtresi uygulanıyor:', route.query.durumId)
}
})
</script> </script>

View File

@ -217,7 +217,9 @@
} }
} }
const GetIkramiyeTotalValues = async () => { const GetIkramiyeTotalValues = async () => {
let data = await dataStore.dataGet('Ikramiye/Cekilis/' + piyangoStore.selectedLottery) console.log(piyangoStore, 'piyangoStore')
let data = await dataStore.dataGet('Ikramiye/Cekilis/' + piyangoStore.selectedLottery +'?pageNumber=0')
//todo:page 0
if (data !== 'errorfalse') { if (data !== 'errorfalse') {
piyangoIkramiyeStore.totalIkramiyeValue = data.toplamdeger piyangoIkramiyeStore.totalIkramiyeValue = data.toplamdeger
} }
@ -279,6 +281,7 @@
}) })
} }
const BasvuruBedeliMuhasebelestir = async () => { const BasvuruBedeliMuhasebelestir = async () => {
console.log('basvuru bedeli muhasebelestir')
let data = await dataStore.dataGet( let data = await dataStore.dataGet(
'MuhasebeSettings/BasvuruBedeli/' + piyangoStore.selectedLottery 'MuhasebeSettings/BasvuruBedeli/' + piyangoStore.selectedLottery
) )

View File

@ -10,7 +10,8 @@
iconBack="waiting" iconBack="waiting"
:tableData="onayBekleyenPiyango" :tableData="onayBekleyenPiyango"
lineRoute="piyangolar/detay/" lineRoute="piyangolar/detay/"
lineRouteKey="id" /> lineRouteKey="id"
:filterParams="{ durumId: 0 }" />
<dash-piyango-liste <dash-piyango-liste
v-if="loaded" v-if="loaded"
title="İtiraz/Şikayet Edilen Piyangolar" title="İtiraz/Şikayet Edilen Piyangolar"
@ -21,7 +22,8 @@
iconBack="alert" iconBack="alert"
:tableData="itirazEdilenPiyango" :tableData="itirazEdilenPiyango"
lineRoute="piyangolar/detay/" lineRoute="piyangolar/detay/"
lineRouteKey="id" /> lineRouteKey="id"
:filterParams="{ durumId: 1 }" />
<dash-piyango-liste <dash-piyango-liste
v-if="loaded" v-if="loaded"
@ -33,7 +35,8 @@
iconBack="next" iconBack="next"
:tableData="yaklasanPiyango" :tableData="yaklasanPiyango"
lineRoute="piyangolar/detay/" lineRoute="piyangolar/detay/"
lineRouteKey="id" /> lineRouteKey="id"
:filterParams="{ baslangicTarihi: '>' + new Date().toISOString().split('T')[0] }"/>
<dash-piyango-liste <dash-piyango-liste
v-if="loaded" v-if="loaded"
@ -45,7 +48,8 @@
iconBack="ok" iconBack="ok"
:tableData="bitenPiyango" :tableData="bitenPiyango"
lineRoute="piyangolar/detay/" lineRoute="piyangolar/detay/"
lineRouteKey="id" /> lineRouteKey="id"
:filterParams="{ bitisTarihi: '<' + new Date().toISOString().split('T')[0] }" />
</AdminLayout> </AdminLayout>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">