signalr
This commit is contained in:
@ -10,7 +10,7 @@
|
||||
</h1>
|
||||
<div class="section-header-buttons-c">
|
||||
<icon-button
|
||||
toRoute="/piyangolar/piyango-listesi"
|
||||
@click="goToListWithFilter"
|
||||
icon="list"
|
||||
iconClass="ico-section ico-section-header-btn" />
|
||||
</div>
|
||||
@ -60,9 +60,11 @@
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue'
|
||||
import { useDateStore } from '@/stores/dateStore'
|
||||
import { useRouter } from 'vue-router'
|
||||
import icourl from '@/assets/images/icons.svg'
|
||||
|
||||
const dateStore = useDateStore()
|
||||
const router = useRouter()
|
||||
|
||||
const props = defineProps<{
|
||||
tableData: Record<string, any>
|
||||
@ -76,6 +78,7 @@
|
||||
dateKey: string
|
||||
iconBack: string
|
||||
total: number
|
||||
filterParams?: Record<string, any>
|
||||
}>()
|
||||
const totalData = ref<number>(props.total)
|
||||
|
||||
@ -92,4 +95,18 @@
|
||||
const OnClick = (e: Event, row: object) => {
|
||||
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>
|
||||
|
||||
@ -590,6 +590,17 @@
|
||||
searchForm.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(() => {
|
||||
if (globalStore.screenWidth >= globalStore.breakPoints.tabletp)
|
||||
mobileButtons.value = true
|
||||
@ -598,6 +609,21 @@
|
||||
RouteSearchControl()
|
||||
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()
|
||||
|
||||
window.addEventListener('resize', Resize)
|
||||
|
||||
Reference in New Issue
Block a user