33 Commits

Author SHA1 Message Date
a10f6997eb Add 'Çekiliş Hakkı Adedi' field to piyangoKatilimciStore and implement validation in piyangoKatilimciValidationStore. Ensure the value is at least 1 to maintain data integrity during form submissions. 2026-03-26 12:38:56 +03:00
2bbb30525e Enhance error handling in useDataStore by adding skipErrorForStatuses option to bypass specific status codes in CheckApiError. This improves error management and allows for more flexible API response handling. 2026-03-26 12:38:43 +03:00
2ecda61ad4 Add removeUploadHandlers function to signalrService for improved memory management by detaching event handlers, preventing memory leaks and multiple triggers. 2026-03-26 12:38:29 +03:00
3c4db6d312 Update SaveKatilimciUser function to ensure 'Çekiliş Hakkı Adedi' is always at least 1, enhancing data integrity during user form submissions. 2026-03-26 12:38:18 +03:00
e9e83827dc Update PanelPiyangoKatilimci component to replace 'Katılım Sıra No' with 'Çekiliş Hakkı Adedi' for improved clarity. Add new input field for 'Çekiliş Hakkı Adedi' with validation support, enhancing user interaction and data entry accuracy. 2026-03-26 12:38:07 +03:00
1b8c10a8a0 Enhance PanelExcelUploadDetail component by adding detailed job statistics, including inserted, skipped, duplicate, and error counts. Update grid layout to accommodate new statistics for improved data presentation. 2026-03-26 12:37:56 +03:00
83acb64944 Add 'Çekiliş Hakkı Adedi' column to TabPiyangoTalihliListesi component for improved data display. 2026-03-26 12:37:45 +03:00
cbbd5b2abe Enhance TabPiyangoKatilimciListesi component by adding conditional rendering for job completion statistics, including inserted and duplicate counts. Implement toast notifications for handling upload conflicts and ensure proper cleanup of upload handlers on component unmount. This improves user feedback and data management during file uploads. 2026-03-26 12:37:32 +03:00
a75158379d katılımcı listesi 2026-03-18 07:47:18 +03:00
46d0cac892 Close dialog for "basvurubedelimuhasebelestir" after loading data in FormMuhasebePiyangoBilgileriDisplay component. This improves user experience by ensuring the dialog is properly closed upon data retrieval. 2025-12-23 04:35:22 +03:00
f8a3940643 Enhance PiyangoListe and MuhasebePiyangoListesi components by adding "Oluşturma Tarihi", "Sevk Durumu", and "Muhasebeleştirme Durumu" columns. Update date formatting and conditional rendering for improved data presentation. Remove redundant code for special columns to streamline component structure. 2025-12-18 16:20:08 +03:00
078a5a020a Refactor PiyangoOnay components to consolidate conditional rendering for "Müdürlük" and "Çekiliş Görevlisi" fields. Update validation and service logic to ensure proper handling based on "onayDurumuIslemTipiId". This enhances the user experience by streamlining form interactions and data management. 2025-12-18 15:01:55 +03:00
edb1d23d71 Implement custom scrollbar for DataTable component. Refactor structure to include a scrollable wrapper and synchronize scroll positions between the table and the custom scrollbar. Update styles for improved visibility and functionality of the scrollbar. 2025-12-18 12:36:51 +03:00
bf9c2b25f9 Add conditional rendering for "Müdürlük" and "Çekiliş Görevlisi" fields in PiyangoOnay components. Update validation logic to require these fields based on "onayDurumuIslemTipiId". Enhance service layer to handle new fields and ensure proper data submission. 2025-12-17 16:04:20 +03:00
4f29c18dab Enhance date formatting in PiyangoListe and MuhasebePiyangoListesi components. Update date handling to include specific patterns and split options for improved readability. Add new columns for "Oluşturma Tarihi" and "Sevk Durumu" in MuhasebePiyangoListesi, while removing redundant code for special columns. 2025-12-17 15:38:07 +03:00
8cfda2449e Refactor row action handling in FormPiyangoOnayDurum component. Replace EditOnay with adminRowAction and update rowActions to adminRowActions based on user role, enhancing access control and functionality. 2025-12-12 14:36:26 +03:00
ddd8594372 Refactor PiyangoOnay components to replace refreshList logic with window reload. This change simplifies the refresh mechanism after form submission, enhancing user experience by ensuring the latest data is displayed immediately. 2025-12-11 14:08:02 +03:00
4a081fe249 Update PiyangoDetay component to change conditional rendering for the "Dosya Kapama" tab. The condition now checks for piyangoStore.lotteryApprove === 10 instead of usersStore.isPanelUser && piyangoStore.lotteryDrawState to enhance logic clarity and functionality. 2025-12-11 13:55:19 +03:00
9c2f02d617 Add PiyangoDetay component "Çekiliş Tutanağı" tab. Import new TabPiyangoCekilisTutanagi component and enhance tab list structure for improved user navigation. 2025-12-11 01:16:38 +03:00
927cdfd7e8 Add "Müdürlük" and "Çekiliş Görevlisi" fields to PiyangoOnay components. Update validation logic to ensure these fields are required based on "onayDurumuIslemTipiId". Enhance data handling in the service layer for new fields and update the form structure accordingly. 2025-12-11 00:50:25 +03:00
e8f914b321 Update refreshList logic in PiyangoOnay components to prevent immediate refresh. Introduce a timeout before setting refreshList to true after form submission, ensuring smoother user experience. 2025-12-10 12:34:12 +03:00
bd93496e4d Add new fields for "Müdürlük" and "Çekiliş Görevlisi" in FormPiyangoOnay component. Implement conditional rendering based on "onayDurumuIslemTipiId". Update data store to ensure toast notifications are handled correctly after API calls. 2025-12-10 12:31:25 +03:00
9da5f9946b Refactor filter handling in DashPiyangoListe and ListTableContent components. Updated tableData type to an array and improved query parameter construction for filters, including error handling during navigation. Enhanced filter value retrieval logic to ensure proper text assignment based on available data. 2025-12-09 16:12:49 +03:00
b0386d53e5 Add row deletion functionality and enhance table filters in Piyango views. Implemented confirmation dialog for row deletion and updated filter options for various table columns to improve user experience. 2025-12-09 14:01:25 +03:00
f6c1b242b2 Enhance Piyango and Muhasebe views with additional table headers and computed properties for better data representation. Added global store integration for currency formatting and improved date handling. Updated conditional rendering for user roles and refined filter options. 2025-12-09 07:47:04 +03:00
b422187704 . 2025-12-09 07:35:42 +03:00
678a96d76f dosyaları ayırarak kaydedildiğinde build hatası verenlerin ayrılması kaldırıldı 2025-10-24 20:09:48 +03:00
cb9d2f220f - build için dosyalar ayrı kaydedilecek şekilde düzenleme yapıldı
- gereksiz paketler package.json dan silindi
- Kullanılmayan quill dosyaları silindi
2025-10-24 12:03:32 +03:00
03689a01e3 - Filtreleme yapısı değiştirildi.
- Tarihler için başlangıç-bitiş aralığı seçilebielcek
- geri dönüldüğünde çıkan hatalar düzeltildi
- filtrede date olan alanlar için başlangıç-bitiş seçimi eklendi
- axios serializer eklendi. array ile verilen parametrelerde hata çıkıyordu
2025-10-24 10:24:05 +03:00
f31bd6ba9e Listablecontent 2025-10-17 09:48:18 +03:00
5fe3a36893 signalrService.ts 2025-10-06 11:58:09 +03:00
4dae2824fb piyangoDosyaKapamaStore.ts 2025-10-06 11:57:57 +03:00
6d4d0c8be9 PanelPiyangoDosyaKapamaIkramiye.vue 2025-10-06 11:57:36 +03:00
58 changed files with 3367 additions and 1059 deletions

23
Configs.ts Normal file
View File

@ -0,0 +1,23 @@
// build olurken bazı klasorlerin ayri script olarak kaydedilmesi
export const TEMPLATE_CHUNK_GROUPS: Record<string, (RegExp | string)[]> = {
store: [/\/src\/stores\//],
//lott: [/\/src\/module\/cekilisler\//],
//user: [/\/src\/module\/kullanicilar\//],
//cust: [/\/src\/module\/uyeler\//],
//acc: [/\/src\/module\/muhasebe\//],
//site: [/\/src\/module\/site-yonetimi\//],
//aut: [/\/src\/module\/auth\//]
}
// id -> group_name
export function SetTemplateGroup(id: string): string | undefined {
const cleanId = id.split('?')[0]
for (const [group, pats] of Object.entries(TEMPLATE_CHUNK_GROUPS)) {
if (
pats.some((p) => (typeof p === 'string' ? cleanId.includes(p) : p.test(cleanId)))
) {
return group
}
}
return undefined
}

128
package-lock.json generated
View File

@ -15,8 +15,6 @@
"jquery": "^3.7.1",
"parchment": "^3.0.0",
"pinia": "^2.1.7",
"quill": "^2.0.3",
"quill-image-resize-module": "^3.0.0",
"summernote": "^0.9.1",
"uuid": "^11.1.0",
"vue": "^3.4.29",
@ -1718,14 +1716,6 @@
}
]
},
"node_modules/clone": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz",
"integrity": "sha512-3Pe/CF1Nn94hyhIYpjtiLhdCoEoz0DqQ+988E9gmeEdQZlojxnOb74wctFyuwWQHzqyf9X7C7MG8juUpqBJT8w==",
"engines": {
"node": ">=0.8"
}
},
"node_modules/combined-stream": {
"version": "1.0.8",
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
@ -2006,11 +1996,6 @@
"node": ">=6"
}
},
"node_modules/eventemitter3": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz",
"integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA=="
},
"node_modules/eventsource": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/eventsource/-/eventsource-2.0.2.tgz",
@ -2019,11 +2004,6 @@
"node": ">=12.0.0"
}
},
"node_modules/extend": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz",
"integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g=="
},
"node_modules/fetch-cookie": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/fetch-cookie/-/fetch-cookie-2.2.0.tgz",
@ -2359,26 +2339,6 @@
"node": ">=6"
}
},
"node_modules/lodash": {
"version": "4.17.21",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="
},
"node_modules/lodash-es": {
"version": "4.17.21",
"resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.17.21.tgz",
"integrity": "sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw=="
},
"node_modules/lodash.clonedeep": {
"version": "4.5.0",
"resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz",
"integrity": "sha512-H5ZhCF25riFd9uB5UCkVKo61m3S/xZk1x4wA6yp/L3RFP6Z/eHH1ymQcGLo7J3GMPfm0V/7m1tryHuGVxpqEBQ=="
},
"node_modules/lodash.isequal": {
"version": "4.5.0",
"resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz",
"integrity": "sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ=="
},
"node_modules/lru-cache": {
"version": "5.1.1",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz",
@ -2752,94 +2712,6 @@
"resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz",
"integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ=="
},
"node_modules/quill": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/quill/-/quill-2.0.3.tgz",
"integrity": "sha512-xEYQBqfYx/sfb33VJiKnSJp8ehloavImQ2A6564GAbqG55PGw1dAWUn1MUbQB62t0azawUS2CZZhWCjO8gRvTw==",
"dependencies": {
"eventemitter3": "^5.0.1",
"lodash-es": "^4.17.21",
"parchment": "^3.0.0",
"quill-delta": "^5.1.0"
},
"engines": {
"npm": ">=8.2.3"
}
},
"node_modules/quill-image-resize-module": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/quill-image-resize-module/-/quill-image-resize-module-3.0.0.tgz",
"integrity": "sha512-1TZBnUxU/WIx5dPyVjQ9yN7C6mLZSp04HyWBEMqT320DIq4MW4JgzlOPDZX5ZpBM3bU6sacU4kTLUc8VgYQZYw==",
"dependencies": {
"lodash": "^4.17.4",
"quill": "^1.2.2",
"raw-loader": "^0.5.1"
}
},
"node_modules/quill-image-resize-module/node_modules/eventemitter3": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-2.0.3.tgz",
"integrity": "sha512-jLN68Dx5kyFHaePoXWPsCGW5qdyZQtLYHkxkg02/Mz6g0kYpDx4FyP6XfArhQdlOC4b8Mv+EMxPo/8La7Tzghg=="
},
"node_modules/quill-image-resize-module/node_modules/fast-diff": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.1.2.tgz",
"integrity": "sha512-KaJUt+M9t1qaIteSvjc6P3RbMdXsNhK61GRftR6SNxqmhthcd9MGIi4T+o0jD8LUSpSnSKXE20nLtJ3fOHxQig=="
},
"node_modules/quill-image-resize-module/node_modules/parchment": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/parchment/-/parchment-1.1.4.tgz",
"integrity": "sha512-J5FBQt/pM2inLzg4hEWmzQx/8h8D0CiDxaG3vyp9rKrQRSDgBlhjdP5jQGgosEajXPSQouXGHOmVdgo7QmJuOg=="
},
"node_modules/quill-image-resize-module/node_modules/quill": {
"version": "1.3.7",
"resolved": "https://registry.npmjs.org/quill/-/quill-1.3.7.tgz",
"integrity": "sha512-hG/DVzh/TiknWtE6QmWAF/pxoZKYxfe3J/d/+ShUWkDvvkZQVTPeVmUJVu1uE6DDooC4fWTiCLh84ul89oNz5g==",
"dependencies": {
"clone": "^2.1.1",
"deep-equal": "^1.0.1",
"eventemitter3": "^2.0.3",
"extend": "^3.0.2",
"parchment": "^1.1.4",
"quill-delta": "^3.6.2"
}
},
"node_modules/quill-image-resize-module/node_modules/quill-delta": {
"version": "3.6.3",
"resolved": "https://registry.npmjs.org/quill-delta/-/quill-delta-3.6.3.tgz",
"integrity": "sha512-wdIGBlcX13tCHOXGMVnnTVFtGRLoP0imqxM696fIPwIf5ODIYUHIvHbZcyvGlZFiFhK5XzDC2lpjbxRhnM05Tg==",
"dependencies": {
"deep-equal": "^1.0.1",
"extend": "^3.0.2",
"fast-diff": "1.1.2"
},
"engines": {
"node": ">=0.10"
}
},
"node_modules/quill/node_modules/fast-diff": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.3.0.tgz",
"integrity": "sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw=="
},
"node_modules/quill/node_modules/quill-delta": {
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/quill-delta/-/quill-delta-5.1.0.tgz",
"integrity": "sha512-X74oCeRI4/p0ucjb5Ma8adTXd9Scumz367kkMK5V/IatcX6A0vlgLgKbzXWy5nZmCGeNJm2oQX0d2Eqj+ZIlCA==",
"dependencies": {
"fast-diff": "^1.3.0",
"lodash.clonedeep": "^4.5.0",
"lodash.isequal": "^4.5.0"
},
"engines": {
"node": ">= 12.0.0"
}
},
"node_modules/raw-loader": {
"version": "0.5.1",
"resolved": "https://registry.npmjs.org/raw-loader/-/raw-loader-0.5.1.tgz",
"integrity": "sha512-sf7oGoLuaYAScB4VGr0tzetsYlS8EJH6qnTCfQ/WVEa89hALQ4RQfCKt5xCyPQKPDUbVUAIP1QsxAwfAjlDp7Q=="
},
"node_modules/read-package-json-fast": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/read-package-json-fast/-/read-package-json-fast-3.0.2.tgz",

View File

@ -21,8 +21,6 @@
"jquery": "^3.7.1",
"parchment": "^3.0.0",
"pinia": "^2.1.7",
"quill": "^2.0.3",
"quill-image-resize-module": "^3.0.0",
"summernote": "^0.9.1",
"uuid": "^11.1.0",
"vue": "^3.4.29",

Binary file not shown.

Binary file not shown.

17
public/web.config Normal file
View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Handle History Mode and custom 404/500" stopProcessing="true">
<match url="(.*)" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="/" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>

167
sql_query_updated.sql Normal file
View File

@ -0,0 +1,167 @@
SELECT c.Id, c.PiyangoId, c.Baslik, ISNULL(c.CreateDate, '0001-01-01') AS OlusturmaTarihi, MIN(ISNULL(cb.BaslangicTarihi, '0001-01-01')) AS BaslangicTarihi, MIN(ISNULL(cb.BitisTarihi, '0001-01-01')) AS BitisTarihi,
/* DÜZENLEYEN (mevcut)*/ COALESCE (NULLIF (d .DernekUnvan, ''), NULLIF (d .GercekTicariUnvan, ''), NULLIF (d .kamuUnvan, ''), NULLIF (d .SirketUnvan, ''), NULLIF (d .TuzelUnvan, ''), LTRIM(RTRIM(COALESCE (d .GercekAdi,
'') + ' ' + COALESCE (d .GercekSoyadi, ''))), iblist.IrtibatAdSoyad, 'Bilinmiyor') AS Duzenleyen, ISNULL(d .Id, 0) AS DuzenleyenId,
/* MÜDÜRLÜK (yeni - 2. başlık)*/
CASE
WHEN odlast.Mudurluk = 1 THEN '1 No''lu Özel Çekilişler İzin ve Takip Şubesi Müdürlüğü'
WHEN odlast.Mudurluk = 2 THEN '2 No''lu Özel Çekilişler İzin ve Takip Şubesi Müdürlüğü'
WHEN odlast.Mudurluk = 3 THEN '3 No''lu Özel Çekilişler İzin ve Takip Şubesi Müdürlüğü'
ELSE ISNULL(birim.BirimAdi, '')
END AS Mudurluk,
MIN(cy.Deger) AS CekilisYontemi, MIN(cb.CekilisYontemiId) AS CekilisYontemiId, MIN(cb.KatilimciListesiTeslimYontemiId) AS KatilimciListesiTeslimYontemiId, MIN(klt.Deger) AS KatilimciListesiTeslimYontemi, ik.Ikramiyeler,
ISNULL(odlast.OnayDurumuIslemTipiId, 0) AS DurumId, ISNULL(odlast.IslemTipi, 'Yeni Piyango') AS Durum, MIN(ISNULL(cb.CekilisTarihi, '0001-01-01')) AS CekilisTarihi, ap.AmacAdi AS piyangoamac,
c.amacpiyangoId AS piyangoAmacId, ISNULL(oc.OnayVerecekKisi1Id, 0) AS OnayVerecekKisi1Id, ISNULL(oc.OnayVerecekKisi2Id, 0) AS OnayVerecekKisi2Id, ISNULL(oc.OnayVerecekKisi3Id, 0) AS OnayVerecekKisi3Id,
c.izinBedelNo, c.BasvuruBedelNo, c.izinBedeliDurum, c.basvuruBedeliDurum, c.baglisirketId, /* Atanmis (mevcut)*/ CASE WHEN ISNULL(oc.OnayVerecekKisi1Id, 0) > 0 OR
ISNULL(oc.OnayVerecekKisi2Id, 0) > 0 OR
ISNULL(oc.OnayVerecekKisi3Id, 0) > 0 THEN CAST(1 AS BIT) ELSE CAST(0 AS BIT) END AS Atanmis, ISNULL(atananlar.AlananIsimler, '') AS Atananlar, /* ARACI FİRMA (yeni - 5. başlık)*/ CASE WHEN EXISTS
(SELECT 1
FROM AspNetUserRoles ur INNER JOIN
AspNetRoles r ON ur.RoleId = r.Id
WHERE ur.UserId = d .ParentUserId AND r.Name = 'AraciFirma') THEN COALESCE (NULLIF (parentUser.DernekUnvan, ''), NULLIF (parentUser.GercekTicariUnvan, ''), NULLIF (parentUser.kamuUnvan, ''),
NULLIF (parentUser.SirketUnvan, ''), NULLIF (parentUser.TuzelUnvan, ''), LTRIM(RTRIM(COALESCE (parentUser.GercekAdi, '') + ' ' + COALESCE (parentUser.GercekSoyadi, ''))), '') ELSE '' END AS AraciFirma,
/* İZİN TARİHİ (yeni - 7. başlık)*/ odlast.IzinTarihi AS IzinTarihi, /* İZİN SAYISI (yeni - 8. başlık)*/ odlast.IzinSayisi AS IzinSayisi,
/* ÇEKİLİŞ GÖREVLİSİ (yeni - 12. başlık)*/
CASE
WHEN odlast.CekilisGorevlisi = 1 THEN 'Antalya Şube Müdürlüğü'
WHEN odlast.CekilisGorevlisi = 2 THEN 'Gaziantep Şube Müdürlüğü'
WHEN odlast.CekilisGorevlisi = 3 THEN 'Aksaray Şube Müdürlüğü'
WHEN odlast.CekilisGorevlisi = 4 THEN 'Kadıköy Şube Müdürlüğü'
WHEN odlast.CekilisGorevlisi = 5 THEN 'Karşıyaka Şube Müdürlüğü'
WHEN odlast.CekilisGorevlisi = 6 THEN 'Muğla Şube Müdürlüğü'
WHEN odlast.CekilisGorevlisi = 7 THEN 'Trabzon Şube Müdürlüğü'
WHEN odlast.CekilisGorevlisi = 8 THEN 'Noter'
WHEN odlast.CekilisGorevlisi = 9 THEN 'Başkanlık Personeli'
ELSE COALESCE (LTRIM(RTRIM(COALESCE (personel.GercekAdi, '') + ' ' + COALESCE (personel.GercekSoyadi, ''))), LTRIM(RTRIM(COALESCE (birimSefi.GercekAdi, '') + ' ' + COALESCE (birimSefi.GercekSoyadi, ''))), '')
END AS CekilisGorevlisi,
/* GAZETE İLAN TARİHİ (yeni - 13. başlık)*/ MIN(cb.ilantarihi) AS GazeteIlanTarihi, /* GAZETE ADI (yeni - 14. başlık)*/ MIN(cb.ilanEdilecekGazete)
AS GazeteAdi, /* KDV Oranı = 0.20 (sabit)*/ CASE WHEN ikramiyeTutar.ToplamTutar IS NOT NULL AND izinBedelOrani.Oran IS NOT NULL THEN CAST((ikramiyeTutar.ToplamTutar * izinBedelOrani.Oran / 100.0)
* 1.20 AS DECIMAL(18, 2)) ELSE NULL END AS IzinBedeliTutari, /* İKRAMİYE TUTARI (yeni - 16. başlık)*/ ISNULL(ikramiyeTutar.ToplamTutar, 0) AS IkramiyeTutari,
/* TEMİNAT TARİHİ (yeni - 17. başlık)*/ ts .TeminantDate AS TeminatTarihi, /* TEMİNAT SAYISI (yeni - 18. başlık)*/ ts .TeminantNo AS TeminatSayisi, /* TEMİNAT BANKASI (yeni - 19. başlık)*/ ts .BankName AS TeminatBankasi,
/* TEMİNAT TUTARI (yeni - 20. başlık)*/ ts .Amount AS TeminatTutari, /* T. PARA CİNSİ (yeni - 21. başlık)*/ ISNULL(paraBirimi.ParaBirimiSembol, '') AS ParaBirimiSembol,
/* T. İADE TARİHİ (yeni - 22. başlık)*/ ts .RefundDate AS TeminatIadeTarihi, /* T. İADE SAYISI (yeni - 23. başlık)*/ ts .RefundCount AS TeminatIadeSayisi
FROM Cekilisler c LEFT JOIN
CekilisBilgiler cb ON cb.CekilisId = c.Id LEFT JOIN
AspNetUsers d ON d .Id = c.DuzenleyenId LEFT JOIN
Birimler birim ON birim.Id = d .BirimId /* MÜDÜRLÜK için*/ LEFT JOIN
AspNetUsers parentUser ON parentUser.Id = d .ParentUserId /* ARACI FİRMA için*/ LEFT JOIN
AspNetUsers personel ON personel.Id = c.PersonelId /* ÇEKİLİŞ GÖREVLİSİ için*/ LEFT JOIN
AspNetUsers birimSefi ON birimSefi.Id = c.BirimSefiId /* ÇEKİLİŞ GÖREVLİSİ için*/ LEFT JOIN
PiyangoAmacs ap ON ap.Id = c.amacpiyangoId LEFT JOIN
OnayCekilisler oc ON oc.CekilisId = c.Id LEFT JOIN
CekilisYontemleri cy ON cb.CekilisYontemiId = cy.Id LEFT JOIN
KatilimciListesiTeslimYontemleri klt ON cb.KatilimciListesiTeslimYontemiId = klt.Id /* APPLY ile son OnayDurumu (İZİN TARİHİ, İZİN SAYISI, MÜDÜRLÜK ve ÇEKİLİŞ GÖREVLİSİ dahil)*/ OUTER APPLY
(SELECT TOP 1 od.OnayDurumuIslemTipiId, od.IslemTipi, od.IzinTarihi, od.IzinSayisi, od.Mudurluk, od.CekilisGorevlisi
FROM OnayCekilisler oc2 INNER JOIN
OnayDurumlari od ON oc2.Id = od.OnayCekilisId
WHERE oc2.CekilisId = c.Id
ORDER BY od.Tarih DESC) odlast /* APPLY ile ikramiyeler string*/ OUTER APPLY
(SELECT STUFF
((SELECT ', ' + i2.Marka + ' ' + i2.Model
FROM Ikramiyeler i2
WHERE i2.CekilisId = c.Id FOR XML PATH(''), TYPE ).value('.', 'NVARCHAR(MAX)'), 1, 2, '')) ik(Ikramiyeler) /* APPLY ile ikramiye tutarı toplamı*/ OUTER APPLY
(SELECT SUM(i3.BirimFiyat * i3.AsilTalihliAdedi) AS ToplamTutar
FROM Ikramiyeler i3
WHERE i3.CekilisId = c.Id) ikramiyeTutar /* APPLY ile aktif izin bedel oranı (ilk aktif oran)*/ OUTER APPLY
(SELECT TOP 1 ibo.Oran
FROM IzinBedelOranlari ibo
WHERE ibo.Aktif = 1
ORDER BY ibo.Id) izinBedelOrani /* APPLY ile para birimi sembolü (ilk ikramiyenin para birimi)*/ OUTER APPLY
(SELECT TOP 1 pb.ParaBirimiSembol
FROM Ikramiyeler i4 LEFT JOIN
ParaBirimleri pb ON pb.Id = i4.ParaBirimiId
WHERE i4.CekilisId = c.Id AND pb.ParaBirimiSembol IS NOT NULL
ORDER BY i4.Id) paraBirimi /* APPLY ile irtibat bilgileri string*/ OUTER APPLY
(SELECT STUFF
((SELECT ', ' + ib2.AdSoyad
FROM IrtibatBilgiler ib2
WHERE ib2.CekilisId = c.Id FOR XML PATH(''), TYPE ).value('.', 'NVARCHAR(MAX)'), 1, 2, '')) iblist(IrtibatAdSoyad) /* APPLY ile atanan kullanıcı isimleri*/ OUTER APPLY
(SELECT STUFF
((SELECT ', ' + u.GercekAdi + ' ' + u.GercekSoyadi
FROM AspNetUsers u
WHERE u.Id IN (ISNULL(oc.OnayVerecekKisi1Id, 0), ISNULL(oc.OnayVerecekKisi2Id, 0), ISNULL(oc.OnayVerecekKisi3Id, 0)) FOR XML PATH(''), TYPE ).value('.',
'NVARCHAR(MAX)'), 1, 2, '')) atananlar(AlananIsimler) /* APPLY ile teminat bilgileri (son teminat kaydı)*/ OUTER APPLY
(SELECT TOP 1 ts2.TeminantDate, ts2.TeminantNo, ts2.BankName, ts2.Amount, ts2.RefundDate, ts2.RefundCount
FROM TeminantStates ts2
WHERE ts2.CekilisId = c.Id
ORDER BY ts2.Id DESC) ts
GROUP BY c.Id, c.PiyangoId, c.Baslik, c.CreateDate, d .DernekUnvan, d .GercekTicariUnvan, d .kamuUnvan, d .SirketUnvan, d .TuzelUnvan, d .GercekAdi, d .GercekSoyadi, d .Id, d .ParentUserId,
birim.BirimAdi, ap.AmacAdi, c.amacpiyangoId, oc.OnayVerecekKisi1Id, oc.OnayVerecekKisi2Id, oc.OnayVerecekKisi3Id, c.izinBedelNo, c.BasvuruBedelNo, c.izinBedeliDurum,
c.basvuruBedeliDurum, c.baglisirketId, ik.Ikramiyeler, iblist.IrtibatAdSoyad, odlast.OnayDurumuIslemTipiId, odlast.IslemTipi, odlast.IzinTarihi, odlast.IzinSayisi,
atananlar.AlananIsimler, personel.GercekAdi, personel.GercekSoyadi, birimSefi.GercekAdi, birimSefi.GercekSoyadi, parentUser.DernekUnvan, parentUser.GercekTicariUnvan,
parentUser.kamuUnvan, parentUser.SirketUnvan, parentUser.TuzelUnvan, parentUser.GercekAdi, parentUser.GercekSoyadi, ikramiyeTutar.ToplamTutar, izinBedelOrani.Oran,
paraBirimi.ParaBirimiSembol, ts .TeminantDate, ts .TeminantNo, ts .BankName, ts .Amount, ts .RefundDate, ts .RefundCount, odlast.Mudurluk, odlast.CekilisGorevlisi;

View File

@ -727,6 +727,99 @@ svg {
background-color: #f1f1f1;
}
/* İşlem durumu badge stilleri - basit ve kompakt */
.islem-status-badge {
display: inline-block;
padding: 4px 10px;
color: #fff;
border-radius: 12px;
font-size: 0.875em;
font-weight: 500;
white-space: nowrap;
line-height: 1.4;
}
.form-select-list-item .islem-status-badge {
display: inline-block;
width: auto;
}
.form-select-activator .islem-status-badge {
display: inline-block;
width: auto;
}
/* Her durum için benzersiz canlı renkler */
.islem-status-coral {
background: #e74c3c;
}
.islem-status-amber {
background: #f39c12;
}
.islem-status-sky {
background: #3498db;
}
.islem-status-rose {
background: #e91e63;
}
.islem-status-pink {
background: #ec407a;
}
.islem-status-slate {
background: #607d8b;
color: #fff;
}
.islem-status-emerald {
background: #27ae60;
}
.islem-status-red {
background: #c0392b;
}
.islem-status-salmon {
background: #e67e22;
}
.islem-status-mint {
background: #2ecc71;
}
.islem-status-peach {
background: #ff9800;
}
.islem-status-yellow {
background: #f1c40f;
color: #333;
}
.islem-status-teal {
background: #1abc9c;
}
.islem-status-cyan {
background: #00bcd4;
}
.islem-status-orange {
background: #ff5722;
}
.islem-status-blue {
background: #2196f3;
}
.islem-status-gold {
background: #ffc107;
color: #333;
}
.islem-status-lavender {
background: #9c27b0;
}
.islem-status-violet {
background: #673ab7;
}
.islem-status-crimson {
background: #d32f2f;
}
.islem-status-indigo {
background: #3f51b5;
}
.islem-status-default {
background: #757575;
}
/* login */
.login-w {
min-width: 100%;
@ -1153,6 +1246,44 @@ section {
padding: 10px;
}
.list-wrapper-container {
width: 100%;
position: relative;
}
.list-wrapper-scrollbar-top {
width: 100%;
overflow-x: auto;
overflow-y: hidden;
height: 17px;
margin-bottom: 0;
display: none;
position: relative;
z-index: 10;
}
.list-wrapper-scrollbar-top .scrollbar-content {
height: 1px;
width: 0;
}
.list-wrapper-scrollbar-top::-webkit-scrollbar {
height: 17px;
}
.list-wrapper-scrollbar-top::-webkit-scrollbar-track {
background: transparent;
}
.list-wrapper-scrollbar-top::-webkit-scrollbar-thumb {
background: rgba(0, 0, 0, 0.2);
border-radius: 10px;
}
.list-wrapper-scrollbar-top::-webkit-scrollbar-thumb:hover {
background: rgba(0, 0, 0, 0.3);
}
.list-wrapper {
width: 100%;
position: relative;
@ -2162,7 +2293,7 @@ section {
}
.panel-wrapper {
max-width: 480px;
max-width: 600px;
}
.panel-wrapper.panel-wide {
@ -2175,7 +2306,7 @@ section {
}
.panel-wrapper.panel-right.showme {
left: calc(100% - 480px);
left: calc(100% - 600px);
}
.panel-wrapper.panel-right.panel-wide.showme {
@ -2281,6 +2412,14 @@ section {
width: 100% !important;
}
.list-wrapper-container {
overflow: visible;
}
.list-wrapper-scrollbar-top {
display: none !important;
}
.list-wrapper {
overflow: visible;
overflow-x: visible;

View File

@ -67,7 +67,7 @@
const router = useRouter()
const props = defineProps<{
tableData: Record<string, any>
tableData: Record<string, any>[]
lineFunction?: Function
title?: string
listText?: string
@ -97,16 +97,36 @@
}
const goToListWithFilter = () => {
const query: Record<string, any> = {}
// Filtre parametrelerini query'ye ekle
if (props.filterParams) {
Object.assign(query, props.filterParams)
try {
const query: Record<string, any> = {}
// Filtre parametrelerini query'ye ekle (Filters[...] formatına dönüştür)
if (props.filterParams && typeof props.filterParams === 'object') {
Object.keys(props.filterParams).forEach((key) => {
const value = props.filterParams![key]
if (value !== undefined && value !== null && value !== '') {
// Değer zaten operatör içeriyorsa olduğu gibi kullan, yoksa '=' ekle
let filterValue = String(value)
// Eğer değer zaten operatör içermiyorsa '=' ekle
if (!filterValue.match(/^[<>=]/)) {
filterValue = '=' + filterValue
}
// Query parametresine string olarak ekle (Vue Router array'leri yanlış serialize ediyor)
query[`Filters[${key}]`] = filterValue
}
})
}
router.push({
path: '/piyangolar/piyango-listesi',
query: query
})
} catch (error) {
console.error('goToListWithFilter hatası:', error)
// Hata durumunda filtre olmadan yönlendir
router.push({
path: '/piyangolar/piyango-listesi'
})
}
router.push({
path: '/piyangolar/piyango-listesi',
query: query
})
}
</script>

View File

@ -1,6 +1,10 @@
<template>
<div class="list-wrapper">
<table class="table-border table-colored table-list">
<div class="list-wrapper-container">
<div class="list-wrapper-scrollbar-top" ref="scrollbarTopRef">
<div class="scrollbar-content"></div>
</div>
<div class="list-wrapper" ref="listWrapperRef" @scroll="onScroll">
<table class="table-border table-colored table-list">
<thead>
<tr>
<th class="table-head-row-number" v-if="rowNumber">
@ -135,6 +139,7 @@
</template>
</tbody>
</table>
</div>
</div>
<data-table-pagination
v-if="pagination !== undefined && showPagination && !isPreview"
@ -142,7 +147,7 @@
:isUseRoute="isUseRoute" />
</template>
<script setup lang="ts">
import { ref, reactive, computed, watch } from 'vue'
import { ref, reactive, computed, watch, onMounted, onUnmounted, nextTick } from 'vue'
import type { Ref } from 'vue'
import { useGlobalStore } from '@/stores/globalStore'
import icourl from '@/assets/images/icons.svg'
@ -172,7 +177,7 @@
}
export interface Props {
tableHeader: ITableHead[]
tableData: Record<string, any>
tableData: Record<string, any>[]
rowAction?: Function | string
pagination?: IPagination
sortData?: ISort
@ -285,6 +290,95 @@
},
{ deep: true }
)
watch(
() => props.tableData,
() => {
// Tablo verisi değiştiğinde scrollbar'ı güncelle
setTimeout(() => {
syncScrollbars()
}, 100)
},
{ deep: true }
)
const listWrapperRef = ref<HTMLElement | null>(null)
const scrollbarTopRef = ref<HTMLElement | null>(null)
const onScroll = (e: Event) => {
const target = e.target as HTMLElement
if (scrollbarTopRef.value) {
scrollbarTopRef.value.scrollLeft = target.scrollLeft
}
}
const syncScrollbars = () => {
if (listWrapperRef.value && scrollbarTopRef.value) {
const table = listWrapperRef.value.querySelector('table')
if (table) {
const tableWidth = table.scrollWidth
const wrapperWidth = listWrapperRef.value.clientWidth
if (tableWidth > wrapperWidth) {
scrollbarTopRef.value.style.display = 'block'
scrollbarTopRef.value.scrollLeft = listWrapperRef.value.scrollLeft
// Scrollbar wrapper'ın içeriğinin genişliğini tablo genişliğine eşitle
const scrollbarContent = scrollbarTopRef.value.querySelector('.scrollbar-content') as HTMLElement | null
if (scrollbarContent) {
scrollbarContent.style.width = tableWidth + 'px'
scrollbarContent.style.height = '1px'
}
} else {
scrollbarTopRef.value.style.display = 'none'
}
}
}
}
const onTopScroll = (e: Event) => {
const target = e.target as HTMLElement
if (listWrapperRef.value) {
listWrapperRef.value.scrollLeft = target.scrollLeft
}
}
onMounted(async () => {
await nextTick()
if (scrollbarTopRef.value) {
scrollbarTopRef.value.addEventListener('scroll', onTopScroll)
}
// İlk scrollbar senkronizasyonu
setTimeout(() => {
syncScrollbars()
}, 100)
const resizeObserver = new ResizeObserver(() => {
syncScrollbars()
})
if (listWrapperRef.value) {
resizeObserver.observe(listWrapperRef.value)
}
const tableObserver = new MutationObserver(() => {
syncScrollbars()
})
if (listWrapperRef.value) {
const table = listWrapperRef.value.querySelector('table')
if (table) {
tableObserver.observe(table, { childList: true, subtree: true, attributes: true })
}
}
})
onUnmounted(() => {
if (scrollbarTopRef.value) {
scrollbarTopRef.value.removeEventListener('scroll', onTopScroll)
}
})
</script>
<style scoped>
.action-fixed {

View File

@ -71,6 +71,10 @@
if (Number(pageNumber.value) < totalPage()) pageNumber.value++
}
localPagination.value.pageNumber = pageNumber.value
IfRouteUsing()
emit('update:pagination', localPagination.value)
}
const IfRouteUsing = () => {
if (props.isUseRoute) {
router.push({
query: {
@ -79,16 +83,13 @@
}
})
}
emit('update:pagination', localPagination.value)
}
const InputPageControl = (e: Event) => {
if (Number((e.target as HTMLInputElement).value) < 1)
(e.target as HTMLInputElement).value = '1'
if (Number((e.target as HTMLInputElement).value) > totalPage())
(e.target as HTMLInputElement).value = String(totalPage())
pageNumber.value = Number((e.target as HTMLInputElement).value)
if ((e as KeyboardEvent).key === 'Enter') getPage()
}
const PageNumberFocus = (e: Event) => {
@ -96,6 +97,7 @@
}
const getPage = () => {
localPagination.value.pageNumber = pageNumber.value
IfRouteUsing()
emit('update:pagination', localPagination.value)
}
const SetPageNumber = () => {
@ -104,6 +106,8 @@
localPagination.value.pageNumber = pageNumber.value = Number(
route.query.pageNumber
)
} else {
localPagination.value.pageNumber = pageNumber.value = 1
}
}
}

View File

@ -1,210 +0,0 @@
<template>
<div :class="['form-item', half ? 'form-item-half' : '', elclass || '']">
<span class="form-item-title" v-if="title !== undefined && title !== ''">
{{ title }}
</span>
<slot name="input">
<label>
<span v-if="label !== undefined && label !== ''">
{{ label }}
<i v-if="required" class="form-item-alert">*</i>
</span>
<div :ref="'quillContainer' + rnd"></div>
<span
class="form-item-alert"
v-if="InvalidMessages.length > 0 && InvalidMessages !== ''">
{{ InvalidMessages }}
</span>
<span
class="form-item-description"
v-if="description !== undefined && description !== ''">
{{ description }}
</span>
</label>
</slot>
</div>
</template>
<script setup lang="ts">
import { ref, reactive, computed, onMounted, useTemplateRef, watch } from 'vue'
import Quill from 'quill'
import 'quill/dist/quill.snow.css'
declare const window: any
window.Quill = Quill
export interface Props {
label?: string
disabled?: boolean
modelValue: string
half?: boolean
title?: string
invalidText?: string
description?: string
placeholder?: string
required?: boolean
maxlength?: string
minlength?: string
iclass?: string
elclass?: string
modelKey?: string
}
const props = withDefaults(defineProps<Props>(), {
disabled: false,
half: false,
required: false,
placeholder: ''
})
const emit = defineEmits(['update:modelValue', 'change', 'text-change'])
const rnd = ref<number>(Number(Math.random() * 10000000))
const toolbar = ref<any[]>([
[{ font: [] }, { size: [] }],
['bold', 'italic', 'underline', 'strike'],
[{ color: [] }, { background: [] }],
[{ script: 'super' }, { script: 'sub' }],
[{ header: '1' }, { header: '2' }, 'blockquote'],
[{ list: 'ordered' }, { list: 'bullet' }, { indent: '-1' }, { indent: '+1' }],
[{ align: [] }],
['link', 'image', 'video'],
['clean']
])
const options = reactive<Record<string, any>>({
theme: 'snow',
modules: {
toolbar: toolbar.value,
imageResize: {
modules: ['Resize', 'DisplaySize', 'Toolbar']
}
},
placeholder: props.placeholder,
readOnly: false,
debug: false
})
const QuillImageResize = ref<any>()
const editor = useTemplateRef<any>('quillContainer' + rnd.value)
const quill = ref<Quill | null>(null)
const localValue = ref<string>(props.modelValue)
const InvalidMessageText = ref<Record<string, any>>({})
const InvalidMessages = computed(() => {
let text = ''
Object.keys(InvalidMessageText.value).forEach((k: string, i: number) => {
text += InvalidMessageText.value[k] + ', '
})
return text
})
const OnTextChange = (e: any) => {
if (props.minlength !== undefined) {
if (localValue.value.length < Number(props.minlength)) {
InvalidMessageText.value.minlength = `Girdiğiniz bilgi en az ${props.minlength} karakter uzunluğunda olmalı`
} else {
delete InvalidMessageText.value.minlength
}
}
if (quill.value !== null) {
localValue.value = quill.value!.container.querySelector('.ql-editor')!.innerHTML
}
emit('update:modelValue', localValue.value)
emit('change', e)
}
const InitializeEditor = async () => {
await setupQuillEditor()
SetContent()
RegisterEditorEventListeners()
}
const SetContent = () => {
if (props.modelValue) quill.value!.root.innerHTML = props.modelValue
}
const setupQuillEditor = async () => {
//let Parchment = Quill.import('parchment')
window.Quill.imports.parchment.Attributor.Style =
window.Quill.imports.parchment.StyleAttributor
//@ts-ignore
QuillImageResize.value = await import('quill-image-resize-module')
quill.value = new Quill(editor.value, options) as Quill
;(quill.value!.getModule('toolbar') as Record<
string,
any
>)!.container.addEventListener('mousedown', (e: Event) => {
e.preventDefault()
})
;(quill.value!.getModule('toolbar') as Record<
string,
any
>)!.container.addEventListener('click', (e: Event) => {
if ((e.target as HTMLElement).className !== 'ql-image') e.preventDefault()
})
}
const RegisterEditorEventListeners = () => {
quill.value!.on('text-change', OnTextChange)
quill.value!.on('editor-change', OnTextChange)
//image resize imaja tıklandığını anlamıyor.
quill.value!.root.addEventListener('mouseover', OnMouseOver, false)
ListenForEditorEvent('text-change')
}
const ListenForEditorEvent = (type: any) => {
quill.value!.on(type, (...args) => {
emit(type, ...args)
})
}
const OnMouseOver = (e: Event) => {
if (
(e.target as HTMLElement)!.firstChild &&
((e.target as HTMLElement)!.firstChild as HTMLElement)!.tagName &&
((e.target as HTMLElement)!.firstChild as HTMLElement)!.tagName.toUpperCase() ===
'IMG'
) {
;(e.target as HTMLElement)!.classList.add('remove-click-p')
;((e.target as HTMLElement)!.firstChild as HTMLElement)!.classList.add(
'add-click-img'
)
}
}
onMounted(async () => {
InitializeEditor()
})
watch(
() => props.invalidText,
() => {
if (props.invalidText !== undefined && props.invalidText !== '') {
InvalidMessageText.value.invalid = props.invalidText
} else {
delete InvalidMessageText.value.invalid
}
}
)
</script>
<style>
.ql-toolbar {
width: 100%;
}
.ql-container {
width: 100%;
min-height: 120px;
}
.remove-click-p {
pointer-events: none;
}
.add-click-img {
pointer-events: all;
}
</style>

View File

@ -61,7 +61,7 @@
@click="exportPanel = !exportPanel"
icon="export" />
<icon-button
v-if="filterable()"
v-if="filterable"
classList="ico-section ico-section-header-btn"
@click="OpenFilterPanel"
icon="filter" />
@ -85,7 +85,7 @@
page === 'list' ? 'section-content section-inner' : '',
page === 'form' ? 'form-part-content' : ''
]">
<div class="list-filter-wrapper" v-if="filters() || searched">
<div class="list-filter-wrapper" v-if="haveFilter || searched">
<h4>Filtreler ve Arama</h4>
<div class="list-filter-content">
<template v-if="localQuery !== ''">
@ -97,14 +97,21 @@
<span class="list-filter-close" @click="RemoveSearch"></span>
</div>
</template>
<template v-for="(filter, k) in filterParams">
<div class="list-filter-item" data-filter="durum-onaylanmis">
<strong>{{ filter.title }}:</strong>
<span>
{{ filter.text || filter.val }} {{ filter.op === '=' ? '' : filter.op }}
</span>
<span class="list-filter-close" @click="RemoveFilterKey(k as string)"></span>
</div>
<template v-for="(filterA, index) in filterParams" :key="index">
<template v-for="(filter, filterIndex) in filterA.values" :key="filterIndex">
<div
class="list-filter-item"
data-filter="durum-onaylanmis"
v-if="filterA.filter && (filter.text !== '' || filter.val !== '')">
<strong>{{ filterA.title }}:</strong>
<span>
{{ filter.text || filter.val }} {{ filter.op === '=' ? '' : filter.op }}
</span>
<span
class="list-filter-close"
@click="RemoveFilterKey(index, filterIndex)"></span>
</div>
</template>
</template>
</div>
</div>
@ -127,10 +134,7 @@
<panel-wrapper v-if="filterPanel" v-model="filterPanel" :panel-title="'Filtreleme'">
<template #panelContent>
<panel-filter
:filterHead="tableHeader"
v-model:filterParams="localFilterParams"
:isUseRoute="isUseRoute" />
<panel-filter :filterHead="tableHeader" :filterParams="localFilterParams" />
</template>
<template #footerButton>
<div class="button-c button-save" @click="FilterData">Filtrele</div>
@ -260,11 +264,10 @@
const localTotalRecord = ref<string | number>(0)
if (props.totalRecord !== undefined) localTotalRecord.value = props.totalRecord
const localFilterParams = ref<Record<string, any>>({})
const filterParams = reactive<Record<string, any>>({})
const localFilterParams = ref<Record<string, any>[]>([])
const filterParams = ref<Record<string, any>[]>([])
const OpenFilterPanel = () => {
Object.assign(localFilterParams.value, filterParams)
filterPanel.value = true
}
@ -273,28 +276,74 @@
if (dest[keys] === undefined) delete source[keys]
})
}
const CreateFilterData = () => {
props.tableHeader.forEach((d: Record<string, any>, ind: number) => {
if (d.filter !== undefined) {
const filterKey = d.filter.filterId || d.name
const filterItem: Record<string, any> = {}
const firstVal: Record<string, any> = {}
const secondVal: Record<string, any> = {}
const FilterData = async () => {
Object.keys(filterParams).forEach((k) => {
delete filterParams[k]
})
Object.assign(filterParams, localFilterParams.value)
EqualObjects(filterParams, localFilterParams.value)
filterItem.title = d.title
filterItem.type = d.filter.type
filterItem.between = d.filter.between || false
filterItem.range = d.filter.range || false
filterItem.key = filterKey
filterItem.filter = false
filterItem.hIndex = ind
filterItem.values = []
if (props.isUseRoute) {
Object.keys(route.query).forEach((k) => {
if (k.includes('Filters[')) delete route.query[k]
})
const q = {
query: {
...route.query
const opKey =
d.filter.type === 'date'
? d.filter.between !== undefined && d.filter.between
? '>'
: '='
: '='
firstVal.op = opKey
firstVal.val = ''
firstVal.text = ''
filterItem.values.push(firstVal)
if (d.filter.between !== undefined && d.filter.between) {
secondVal.op = '<'
secondVal.val = ''
secondVal.text = ''
filterItem.values.push(secondVal)
}
localFilterParams.value.push(filterItem)
}
Object.keys(filterParams).forEach((f, k) => {
q.query['Filters[' + f + ']'] = filterParams[f].op + filterParams[f].val
})
}
const AddParamsToObject = (obj: Record<string, any>) => {
filterParams.value.forEach((filter, index) => {
if (filter.filter) {
const key = 'Filters[' + filter.key + ']'
if (obj[key] === undefined) obj[key] = [] as string[]
filter.values.forEach((val: Record<string, any>, vIndex: number) => {
if (val.val !== '') {
;(obj[key] as string[]).push(val.op + val.val)
}
})
}
})
}
const ResetFilterQueries = async () => {
if (props.isUseRoute) {
const newQuery: Record<string, any> = {
...route.query
}
Object.keys(newQuery).forEach((q) => {
if (q.includes('Filters[')) delete newQuery[q]
})
router.push(q)
await router.replace({ query: newQuery })
AddParamsToObject(newQuery)
await router.push({ query: newQuery })
}
}
const FilterData = async () => {
filterParams.value = JSON.parse(JSON.stringify(localFilterParams.value))
ResetFilterQueries()
setTimeout(async () => {
await GetLocalData()
filterPanel.value = false
@ -306,23 +355,32 @@
(props.addAction as Function)()
}
const filterable = () => {
return props.tableHeader.filter((e) => e.hasOwnProperty('filter')).length > 0
}
const filterable = computed(() =>
props.tableHeader.some((obj: Record<string, any>) => obj.filter !== undefined)
)
const filters = (): boolean => {
return Object.keys(filterParams).length > 0
}
const haveFilter = computed(() =>
filterParams.value.some((obj: Record<string, any>) => obj.filter)
)
const RemoveFilterKey = (k: string) => {
delete localFilterParams.value[k]
delete filterParams[k]
const RemoveFilterKey = (index: number, fIndex: number) => {
const query: Record<string, any> = { ...route.query }
Object.keys(query).forEach((q) => {
if (q.includes(k)) delete query[q]
})
router.push({ query: query })
GetLocalData()
filterParams.value[index].values[fIndex].val = ''
filterParams.value[index].values[fIndex].text = ''
const allEmpty: boolean = filterParams.value[index].values.every(
(obj: Record<string, any>) => obj.val === ''
)
if (allEmpty) filterParams.value[index].filter = false
localFilterParams.value = JSON.parse(JSON.stringify(filterParams.value))
ResetFilterQueries()
setTimeout(async () => {
await GetLocalData()
filterPanel.value = false
}, 50)
}
const RemoveSearch = () => {
localQuery.value = ''
@ -334,9 +392,22 @@
const searchChanging = ref<boolean>(false)
const filterChanging = ref<boolean>(false)
const isQueryEqual = (a: Record<string, any>, b: Record<string, any>) => {
const keys = new Set([...Object.keys(a || {}), ...Object.keys(b || {})])
for (const k of keys) {
const va = a?.[k]
const vb = b?.[k]
if (Array.isArray(va) && Array.isArray(vb)) {
if (va.length !== vb.length || va.some((v: any, i: number) => v !== vb[i]))
return false
} else if (String(va ?? '') !== String(vb ?? '')) return false
}
return true
}
const RoutePageControl = () => {
if (props.isUseRoute) {
const q = { ...route.query }
const q = { ...route.query } as Record<string, any>
pageNumberChanging.value = true
if (q.pageNumber !== undefined && q.pageNumber !== '') {
@ -346,7 +417,9 @@
localPagination.value.pageNumber = localPagination.value.pageNumber || 1
}
router.push({ query: q })
if (!isQueryEqual(q, route.query as Record<string, any>)) {
router.push({ query: q })
}
nextTick(() => {
pageNumberChanging.value = false
})
@ -355,7 +428,7 @@
const RouteSortControl = () => {
if (props.isUseRoute) {
const q = { ...route.query }
const q = { ...route.query } as Record<string, any>
sortChanging.value = true
if (q.sortOrder !== undefined && q.sortOrder !== null && q.sortOrder !== '') {
localSort.value.sortColumn = q.sortColumn as string
@ -366,7 +439,9 @@
delete localSort.value.sortColumn
delete localSort.value.sortOrder
}
router.push({ query: q })
if (!isQueryEqual(q, route.query as Record<string, any>)) {
router.push({ query: q })
}
nextTick(() => {
sortChanging.value = false
})
@ -375,7 +450,7 @@
const RouteSearchControl = () => {
if (props.isUseRoute) {
const q = { ...route.query }
const q = { ...route.query } as Record<string, any>
searchChanging.value = true
if (
q.searchString !== undefined &&
@ -387,7 +462,9 @@
localQuery.value = ''
delete q.searchString
}
router.push({ query: q })
if (!isQueryEqual(q, route.query as Record<string, any>)) {
router.push({ query: q })
}
nextTick(() => {
searchChanging.value = false
})
@ -396,52 +473,76 @@
const RouteFilterControl = () => {
if (props.isUseRoute) {
const q = { ...route.query }
localFilterParams.value = {}
Object.keys(filterParams).forEach((k) => {
delete filterParams[k]
})
filterChanging.value = true
if (Object.keys(route.query).length > 0) {
Object.keys(route.query).forEach((key) => {
if (key.includes('Filters[')) {
const newKey = key.match(/(?<=\[)[^\]]+(?=\])/)![0]
filterParams[newKey] = {}
localFilterParams.value[newKey] = {}
filterParams[newKey].op = (route.query[key]! as string).charAt(0)
localFilterParams.value[newKey].op = (route.query[key]! as string).charAt(0)
localFilterParams.value.forEach((filter: Record<string, any>) => {
if (filter.key === newKey) {
if (!filter.filter) {
const isArray = Array.isArray(route.query[key])
if (isArray) {
;(route.query[key]! as string[]).forEach((val, ind) => {
filter.values[ind].op = (route.query[key]! as string[])[ind].charAt(
0
)
filter.values[ind].val = (route.query[key]! as string[])[ind].slice(
1
)
if (filter.type === 'select') {
const filterData = props.tableHeader[filter.hIndex].filter!.data
if (filterData && Array.isArray(filterData)) {
const forText = filterData.find(
(o: Record<string, any>) =>
String(
o[props.tableHeader[filter.hIndex].filter!.listVal]
) === String(filter.values[ind].val)
)
if (forText) {
filter.values[ind].text =
forText[props.tableHeader[filter.hIndex].filter!.listText]
} else {
filter.values[ind].text = filter.values[ind].val
}
} else {
filter.values[ind].text = filter.values[ind].val
}
}
})
} else {
filter.values[0].op = (route.query[key] as string).charAt(0)
filter.values[0].val = (route.query[key] as string).slice(1)
filterParams[newKey].val = (route.query[key]! as string).slice(1)
localFilterParams.value[newKey].val = (route.query[key]! as string).slice(1)
if (filter.type === 'select') {
const filterData = props.tableHeader[filter.hIndex].filter!.data
if (filterData && Array.isArray(filterData)) {
const forText = filterData.find(
(o: Record<string, any>) =>
String(o[props.tableHeader[filter.hIndex].filter!.listVal]) ===
String(filter.values[0].val)
)
if (forText) {
filter.values[0].text =
forText[props.tableHeader[filter.hIndex].filter!.listText]
} else {
filter.values[0].text = filter.values[0].val
}
} else {
filter.values[0].text = filter.values[0].val
}
}
}
filter.filter = true
}
}
})
}
})
}
props.tableHeader.forEach((head: Record<string, any>) => {
if (head.filter !== undefined) {
Object.keys(filterParams).forEach((key) => {
if (
(head.filter.filterId !== undefined && key === head.filter.filterId) ||
key === head.name
) {
filterParams[key].title = head.title
localFilterParams.value[key].title = head.title
if (
head.filter.type === 'select' &&
head.filter.data !== undefined &&
head.filter.data.length > 0
) {
const forText = head.filter.data.find((o: Record<string, any>) => {
return String(o[head.filter.listVal]) === String(filterParams[key].val)
})
filterParams[key].text = forText[head.filter.listText]
localFilterParams.value[key].text = forText[head.filter.listText]
}
}
})
}
})
filterParams.value = JSON.parse(JSON.stringify(localFilterParams.value))
}
nextTick(() => {
filterChanging.value = false
})
@ -468,9 +569,28 @@
fileName = 'export.xlsx'
}
// Export için parametreleri hazırla
let exportParams: Record<string, any> = {}
// Sıralama parametrelerini ekle
if (localSort.value.sortColumn !== undefined) {
exportParams.sortColumn = localSort.value.sortColumn
if (localSort.value.sortOrder !== undefined && localSort.value.sortOrder !== '')
exportParams.sortOrder = localSort.value.sortOrder
}
// Arama parametresini ekle
if (localQuery.value !== '') {
exportParams.searchString = localQuery.value
}
// Filtre parametrelerini ekle
if (haveFilter.value) AddParamsToObject(exportParams)
// Axios ile dosya indirme - interceptor otomatik olarak token ekleyecek
try {
const response = await axios.get(exportUrl, {
params: exportParams,
responseType: 'blob'
})
@ -515,10 +635,8 @@
var filterparam: Record<string, any> = {}
if (filters()) {
Object.keys(filterParams).forEach((f, k) => {
filterparam['Filters[' + f + ']'] = filterParams[f].op + filterParams[f].val
})
if (haveFilter.value) {
AddParamsToObject(filterparam)
Object.assign(apiData.params, filterparam)
}
let dt = await dataStore.dataGet(props.apiList as string, apiData)
@ -564,7 +682,7 @@
let el: HTMLInputElement = document.getElementById(
'listsearch' + rnd.value
) as HTMLInputElement
el.focus
el.focus()
el.select()
}, 50)
}
@ -591,41 +709,17 @@
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
CreateFilterData()
RoutePageControl()
RouteSortControl()
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)
})
@ -655,14 +749,6 @@
}
}
)
watch(
() => localPagination.value.pageNumber,
() => {
if (!pageNumberChanging.value) {
GetLocalData()
}
}
)
watch(
() => props.refresh,
() => {

View File

@ -1,107 +1,104 @@
<template>
<template v-for="(filter, i) in filterHead">
<template v-if="filter.filter !== undefined">
<template v-if="filter.filter.type === 'datetime-local'">
<div class="panel-content-item">
<form-date
v-model="localFilterData[filter.name]"
:label="filter.title"
@change="UpdateFilter(filter)" />
<form-select
v-if="filter.filter.range !== undefined && filter.filter.range"
:listData="filterOperator"
v-model="localFilterData[filter.name + 'op']"
@change="UpdateFilter(filter)" />
</div>
</template>
<template v-if="filter.filter.type === 'date'">
<div class="panel-content-item">
<form-date
type="date"
v-model="localFilterData[filter.name]"
:label="filter.title"
@change="UpdateFilter(filter)" />
<form-select
v-if="filter.filter.range !== undefined && filter.filter.range"
:listData="filterOperator"
v-model="localFilterData[filter.name + 'op']"
@change="UpdateFilter(filter)" />
</div>
</template>
<template v-if="filter.filter.type === 'text'">
<div class="panel-content-item">
<form-input
v-model="localFilterData[filter.name]"
:label="filter.title"
@change="UpdateFilter(filter)" />
<form-select
v-if="filter.filter.range !== undefined && filter.filter.range"
:listData="filterOperator"
v-model="localFilterData[filter.name + 'op']"
@change="UpdateFilter(filter)" />
</div>
</template>
<template v-if="filter.filter.type === 'select'">
<div class="panel-content-item">
<form-select
:listData="filter.filter.data"
:listText="filter.filter.listText"
:listVal="filter.filter.listVal"
:extraData="filter"
:label="filter.title"
v-model="localFilterData[filter.filter.filterId || filter.name] as number"
@change="UpdateFilterSelect"
clearable />
</div>
</template>
<template v-for="(filter, i) in localFilterParams">
<template v-if="filter.type === 'datetime-local'">
<div class="panel-content-item">
<form-date
v-model="filter.values[0].val"
:label="
filter.title +
(filter.between !== undefined && filter.between ? ' (Başlangıç)' : '')
"
@change="UpdateFilter(filter, 0)" />
<form-select
v-if="filter.range !== undefined && filter.range"
:listData="filterOperator"
v-model="filter.values[0].op"
@change="UpdateFilter(filter, 0)"
label="Operator" />
<form-date
v-if="filter.between !== undefined && filter.between"
v-model="filter.values[1].val"
:label="
filter.title +
(filter.between !== undefined && filter.between ? ' (Bitiş)' : '')
"
@change="UpdateFilter(filter, 1)" />
</div>
</template>
<template v-if="filter.type === 'date'">
<div class="panel-content-item">
<form-date
type="date"
v-model="filter.values[0].val"
:label="
filter.title +
(filter.between !== undefined && filter.between ? ' (Başlangıç)' : '')
"
@change="UpdateFilter(filter, 0)" />
<form-select
v-if="filter.range !== undefined && filter.range"
:listData="filterOperator"
v-model="filter.values[0].op"
@change="UpdateFilter(filter, 0)"
label="Operator" />
<form-date
v-if="filter.between !== undefined && filter.between"
type="date"
v-model="filter.values[1].val"
:label="
filter.title +
(filter.between !== undefined && filter.between ? ' (Bitiş)' : '')
"
@change="UpdateFilter(filter, 1)" />
</div>
</template>
<template v-if="filter.type === 'text'">
<div class="panel-content-item">
<form-input
v-model="filter.values[0].val"
:label="filter.title"
@change="UpdateFilter(filter, 0)" />
<form-select
v-if="filter.range !== undefined && filter.range"
:listData="filterOperator"
v-model="filter.values[0].op"
@change="UpdateFilter(filter, 0)"
label="Operator" />
</div>
</template>
<template v-if="filter.type === 'select'">
<div class="panel-content-item">
<form-select
:listData="filterHead[filter.hIndex].filter.data"
:listText="filterHead[filter.hIndex].filter.listText"
:listVal="filterHead[filter.hIndex].filter.listVal"
:extraData="{ f: filter, k: filterHead[filter.hIndex].filter.listText }"
:label="filter.title"
v-model="filter.values[0].val"
@change="UpdateFilterSelect"
clearable />
</div>
</template>
</template>
</template>
<script setup lang="ts">
import { ref, reactive, onBeforeMount, nextTick } from 'vue'
import { useRouter, useRoute } from 'vue-router'
const router = useRouter()
const route = useRoute()
import { ref } from 'vue'
const props = defineProps<{
filterHead: Record<string, any>
filterParams: Record<string, any>
isUseRoute?: boolean
filterHead: Record<string, any>[]
filterParams: Record<string, any>[]
}>()
const emit = defineEmits(['update:filterParams'])
const localFilterData = reactive<Record<string, any>>({})
const localFilterParams = reactive<Record<string, any>>(
Object.assign(props.filterParams)
)
const localFilterParams = ref<Record<string, any>[]>(props.filterParams)
const filterOperator = ref<string[]>(['=', '<', '>'])
const createFilterData = () => {
props.filterHead.forEach((d: Record<string, any>) => {
if (d.filter !== undefined) {
let filterKey = d.filter.filterId || d.name
localFilterData[filterKey] = ''
localFilterData[filterKey + 'op'] = '='
}
})
Object.keys(localFilterParams).forEach((k, i) => {
localFilterData[k] = localFilterParams[k].val
localFilterData[k + 'op'] = localFilterParams[k].op
})
}
const UpdateFilter = (k: Record<string, any>) => {
let filterKey = k.filter.filterId || k.name
if (localFilterData[filterKey] !== '') {
localFilterParams[filterKey] = {}
localFilterParams[filterKey].val = localFilterData[filterKey]
localFilterParams[filterKey].op = localFilterData[filterKey + 'op']
localFilterParams[filterKey].title = k.title
} else delete localFilterParams[filterKey]
emit('update:filterParams', localFilterParams)
const UpdateFilter = (filter: Record<string, any>, index: number) => {
const allEmpty: boolean = filter.values.every(
(obj: Record<string, any>) => obj.val === ''
)
if (filter.values[index].val === '') filter.values[index].text = ''
filter.filter = !allEmpty
}
const UpdateFilterSelect = (
e: Event,
@ -109,20 +106,13 @@
d: Record<string, any>,
ext: Record<string, any>
) => {
let filterKey = ext.filter.filterId || ext.name
if (v !== '' && v !== null && localFilterData[filterKey] !== '') {
localFilterParams[filterKey] = {}
localFilterParams[filterKey].val = localFilterData[filterKey]
localFilterParams[filterKey].op = localFilterData[filterKey + 'op']
localFilterParams[filterKey].title = ext.title
localFilterParams[filterKey].text = d[ext.filter.listText]
if (v !== '' && v !== null) {
ext.f.values[0].val = v
ext.f.values[0].text = d[ext.k]
ext.f.filter = true
} else {
delete localFilterParams[filterKey]
ext.f.filter = false
ext.f.values[0].text = ''
}
emit('update:filterParams', localFilterParams)
}
onBeforeMount(() => {
createFilterData()
})
</script>

View File

@ -32,7 +32,7 @@
</div>
</template>
<script setup lang="ts">
import { ref, computed, onMounted, onBeforeMount, watch } from 'vue'
import { ref, computed, onMounted, onBeforeMount, watch, nextTick } from 'vue'
import { useGlobalStore } from '@/stores/globalStore'
const globalStore = useGlobalStore()
import { useRouter, useRoute } from 'vue-router'
@ -85,8 +85,10 @@
currentTab.value = Number(d)
}
if (props.isUseRoute) {
router.push({
params: { ...route.params, tabid: props.tabList[currentTab.value].id }
nextTick(() => {
router.push({
params: { ...route.params, tabid: props.tabList[currentTab.value].id }
})
})
}
CalculateNavPosition()

View File

@ -5,7 +5,6 @@ import FormInput from './FormInput.vue'
import FormDate from './FormDate.vue'
import FormFile from './FormFile.vue'
import FormTextarea from './FormTextarea.vue'
import FormQuill from './FormQuill.vue'
import FormSummer from './FormSummer.vue'
import FormSelect from './FormSelect.vue'
import FormRadio from './FormRadio.vue'
@ -25,7 +24,6 @@ export {
FormDate,
FormFile,
FormTextarea,
FormQuill,
FormSummer,
FormSelect,
FormRadio,

View File

@ -5,6 +5,23 @@ import router from '@/router'
axios.defaults.baseURL = import.meta.env.VITE_API_URL
//axios.defaults.timeout = 2000;
axios.defaults.headers['Content-Type'] = 'application/json; charset=utf-8'
//Filtrelerde aynı key birden fazla parametre array ile eklendiğinde url oluştururken [] ekleyerek oluşturmasını engellemek için serializer eklendi
axios.defaults.paramsSerializer = (params) => {
const queryParts: string[] = []
for (const key in params) {
const value = params[key]
if (Array.isArray(value)) {
value.forEach((v) => {
queryParts.push(`${key}=${encodeURIComponent(v)}`)
})
} else if (value !== undefined && value !== null) {
queryParts.push(`${key}=${encodeURIComponent(value)}`)
}
}
return queryParts.join('&')
}
import { useDataStore } from '@/stores/dataStore'
// İstek Öncesinde Çalışacak Bir Fonksiyon
@ -42,9 +59,8 @@ axios.interceptors.response.use(
const usersStore = useUsersStore()
const dataStore = useDataStore()
dataStore.isLoading = false
// Yanıtta hata oluşursa burada yakalanır
// error.status kodu undefined geliyor
if (error.response.status === 401) {
// Yanıtta hata oluşursa burada yakalanır (401 login'e yönlendir, diğerleri dataStore catch'te toast gösterir)
if (error.response?.status === 401) {
const token = sessionStorage.getItem(usersStore.userStorageKeys.TOKEN)
if (token !== undefined) {
usersStore.ResetUserData()

View File

@ -0,0 +1,19 @@
<template>
<form-piyango-cekilis-tutanagi-display
v-if="
usersStore.isPanelUser ||
(piyangoStore.lotteryApprove !== 0 &&
piyangoStore.lotteryApprove !== 3 &&
piyangoStore.lotteryApprove !== 8)
" />
<form-piyango-cekilis-tutanagi v-else />
</template>
<script setup lang="ts">
import { useUsersStore } from '@/stores/usersStore'
const usersStore = useUsersStore()
import { usePiyangoStore } from '../stores/piyangoStore'
const piyangoStore = usePiyangoStore()
import FormPiyangoCekilisTutanagi from './form/FormPiyangoCekilisTutanagi.vue'
import FormPiyangoCekilisTutanagiDisplay from './display/FormPiyangoCekilisTutanagiDisplay.vue'
</script>

View File

@ -51,11 +51,54 @@
</template>
</list-table-content>
<panel-wrapper
wide
v-if="piyangoKatilimciStore.katilimciFilePanel"
v-model="piyangoKatilimciStore.katilimciFilePanel"
panel-title="Katılımcı Dosyası Yükle">
<template #panelContent>
<panel-katilimci-document />
<div class="upload-panel-content">
<div v-if="uploadProgressPanel" class="upload-progress-section">
<h4 class="upload-progress-title">Aktif Yükleme</h4>
<div class="upload-warning">
İşlem sırasında tarayıcıyı veya bu sekmeyi kapatmayınız. Sayfa yenilerseniz bu paneli tekrar açarak takip edebilirsiniz.
</div>
<div class="progress-bar">
<div
class="progress-fill"
:style="{ width: uploadProgressValue + '%' }"></div>
</div>
<div class="progress-text">
<template v-if="uploadProgressValue === 0">
Dosya içeriği okunuyor, yükleme başlatılıyor...
</template>
<template v-else>{{ uploadProgressValue }}%</template>
</div>
</div>
<div v-if="uploadJobsLoading || uploadJobs.length > 0" class="upload-history-section">
<h4 class="upload-history-title">Yükleme Geçmişi</h4>
<div v-if="uploadJobsLoading" class="history-loading">Yükleniyor...</div>
<div v-else-if="uploadJobs.length > 0" class="history-items">
<div
v-for="job in uploadJobs"
:key="job.guid"
:class="['history-item', job.status?.toLowerCase() === 'processing' ? 'processing' : '']"
@click="OpenUploadDetail(job.guid)">
<span class="history-file">{{ job.fileName }}</span>
<span :class="['history-status', 'status-' + job.status?.toLowerCase()]">{{ statusText(job.status) }}</span>
<span class="history-progress">{{ job.progress }}%</span>
<span v-if="job.status?.toLowerCase() === 'completed'" class="history-stats">
+{{ job.insertedCount ?? 0 }}
<template v-if="(job.duplicateCount ?? 0) > 0"> / {{ job.duplicateCount }} dpl</template>
</span>
<span class="history-date">{{ formatDate(job.createdAt) }}</span>
</div>
</div>
</div>
<div class="upload-form-section">
<h4 class="upload-form-title">Yeni Dosya Yükle</h4>
<panel-katilimci-document />
</div>
</div>
</template>
<template #footerButton>
<button
@ -88,26 +131,12 @@
</template>
</panel-wrapper>
<panel-wrapper
v-if="uploadProgressPanel"
v-model="uploadProgressPanel"
panel-title="Yükleme Durumu">
wide
v-if="uploadDetailPanel"
v-model="uploadDetailPanel"
panel-title="Yükleme Detayı">
<template #panelContent>
<div class="progress-container">
<div class="upload-warning">
📌 İşlem sırasında tarayıcıyı veya bu sekmeyi kapatmayınız.
</div>
<div class="progress-bar">
<div
class="progress-fill"
:style="{ width: uploadProgressValue + '%' }"></div>
</div>
<div class="progress-text">
<template v-if="uploadProgressValue === 0">
Dosya içeriği okunuyor, yükleme başlatılıyor...
</template>
<template v-else>{{ uploadProgressValue }}%</template>
</div>
</div>
<panel-excel-upload-detail :jobGuid="selectedJobGuid" />
</template>
</panel-wrapper>
</section>
@ -117,6 +146,8 @@
import PanelWrapper from '@/components/PanelWrapper.vue'
import PanelKatilimciDocument from '@/module/cekilisler/components/panel/PanelKatilimciDocument.vue'
import PanelPiyangoKatilimci from '@/module/cekilisler/components/panel/PanelPiyangoKatilimci.vue'
import PanelExcelUploadDetail from '@/module/cekilisler/components/panel/PanelExcelUploadDetail.vue'
import { useDateStore } from '@/stores/dateStore'
import { useUsersStore } from '@/stores/usersStore'
const usersStore = useUsersStore()
@ -137,18 +168,26 @@
import { useDialogStore } from '@/components/global/dialogStore'
const dialogStore = useDialogStore()
const toastStore = useToastStore()
import { usePiyangoOnayStore } from '../stores/piyangoOnayStore'
const piyangoOnayStore = usePiyangoOnayStore()
import { usePiyangoOnayService } from '../service/piyangoOnayService'
const piyangoOnayService = usePiyangoOnayService()
import { connectToHub, onProgress, onCompleted } from '../service/signalrService'
import { onUnmounted } from 'vue'
import { connectToHub, onProgress, onInsertProgress, onCompleted, onError, removeUploadHandlers } from '../service/signalrService'
import { useToastStore } from '@/components/global/toastStore'
const uploadProgressValue = ref(0)
const uploadProgressPanel = ref(false)
const uploadDetailPanel = ref(false)
const uploadJobs = ref<Record<string, any>[]>([])
const uploadJobsLoading = ref(false)
const selectedJobGuid = ref('')
const connectionId = ref('')
const dateStore = useDateStore()
let pollInterval: ReturnType<typeof setInterval> | null = null
const tableHeader = ref<Record<string, any>[]>([
{
@ -255,12 +294,57 @@
})
const AddNewDocument = async () => {
connectionId.value = await connectToHub()
dataStore.panelData = {
title: '',
file: ''
try {
connectionId.value = await connectToHub()
} catch {
connectionId.value = ''
}
dataStore.panelData = { title: '', file: '' }
piyangoKatilimciStore.katilimciFilePanel = true
uploadJobsLoading.value = true
const cekilisId = piyangoStore.selectedLottery
uploadJobs.value = cekilisId !== null ? await piyangoKatilimciService.GetUploadJobs(cekilisId) : []
uploadJobsLoading.value = false
removeUploadHandlers()
// İşleniyor durumundaki job varsa SignalR ile abone ol (gerçek zamanlı progress almak için)
const processingJob = uploadJobs.value.find(
(j: Record<string, any>) => j.status?.toLowerCase() === 'processing'
)
if (processingJob?.guid && connectionId.value) {
const updateProgress = (data: any) => {
const percent = data.Percent ?? 0
uploadProgressValue.value = percent
const idx = uploadJobs.value.findIndex((j: Record<string, any>) => j.guid === processingJob.guid)
if (idx >= 0) {
uploadJobs.value[idx] = {
...uploadJobs.value[idx],
progress: percent,
processedRows: data.Current ?? data.InsertedCount,
totalRows: data.Total ?? data.TotalCount
}
}
}
onProgress(updateProgress)
onInsertProgress(updateProgress)
onCompleted(() => {
stopPolling()
uploadProgressPanel.value = false
piyangoKatilimciStore.refreshPiyangoKatilimciList = true
piyangoKatilimciStore.katilimciFilePanel = true
refreshUploadJobsAndPollProcessing()
})
onError(() => {
stopPolling()
uploadProgressPanel.value = false
refreshUploadJobsAndPollProcessing()
})
uploadProgressPanel.value = true
uploadProgressValue.value = processingJob.progress ?? 0
await piyangoKatilimciService.SubscribeToJob(processingJob.guid, connectionId.value)
}
startPollingForAnyProcessingJob()
}
const AddNewKatilimci = () => {
@ -280,42 +364,59 @@
piyangoKatilimciStore.katilimciUserPanel = true
}
const FileUpload = async () => {
// Mevcut bağlantıyı kullan (AddNewDocument'te açıldı)
if (!piyangoKatilimciValidationStore.FileFormCheck()) {
piyangoKatilimciValidationStore.isFileFormValid = true
return
}
// Progress modal'ı
removeUploadHandlers()
uploadProgressValue.value = 0
uploadProgressPanel.value = true
onProgress((data) => {
uploadProgressValue.value = data.Percent
console.log('Progress:', data.Percent)
})
onCompleted((data) => {
console.log('Tamamlandı:', data)
onCompleted(() => {
stopPolling()
uploadProgressPanel.value = false
piyangoKatilimciStore.refreshPiyangoKatilimciList = true
piyangoKatilimciStore.katilimciFilePanel = false
piyangoKatilimciStore.katilimciFilePanel = true
refreshUploadJobsAndPollProcessing()
})
onError(() => {
stopPolling()
uploadProgressPanel.value = false
})
const formData = new FormData()
formData.append(
'excelFile',
piyangoKatilimciStore.piyangoKatilimciFileFormData.excelFile
)
console.log(dataStore.panelData)
formData.append('excelFile', piyangoKatilimciStore.piyangoKatilimciFileFormData.excelFile)
const connId = connectionId.value || ''
const response = await dataStore.dataPost(
`Katilimci/ExcelleYukle/${piyangoStore.selectedLottery}?connectionId=${connectionId.value}`,
`Katilimci/ExcelleYukle/${piyangoStore.selectedLottery}?connectionId=${connId}`,
{
data: formData,
headers: { 'Content-Type': 'multipart/form-data' }
headers: { 'Content-Type': 'multipart/form-data' },
skipErrorForStatuses: [409]
}
)
console.log('excel response', response)
if (response !== 'errorfalse') {
// Başarı işlemi zaten onCompleted içinde yapıldı
if (response?._error && response.status === 409) {
uploadProgressPanel.value = false
const msg = response.data?.message || 'Bu çekiliş için zaten devam eden bir Excel yükleme işlemi var.'
toastStore.AddToast(msg, 'alert', 6000)
if (response.data?.existingJobId) {
refreshUploadJobsAndPollProcessing()
OpenUploadDetail(response.data.existingJobId)
}
return
}
if (response !== 'errorfalse' && response?.jobId) {
startPolling(response.jobId)
} else {
// Hata olursa paneli kapat
uploadProgressPanel.value = false
}
}
@ -352,16 +453,92 @@
piyangoOnayStore.piyangoOnayForm.aciklama = ''
await piyangoOnayService.SaveOnayDurum()
}
</script>
<style>
.progress-container {
width: 100%;
padding: 20px 0;
display: flex;
flex-direction: column;
align-items: center;
const statusText = (status: string) => {
const map: Record<string, string> = {
Pending: 'Bekliyor',
Processing: 'İşleniyor',
Completed: 'Tamamlandı',
Failed: 'Başarısız'
}
return map[status] || status
}
const formatDate = (val: string | Date) => {
if (!val) return '-'
return dateStore.dateFormat({ date: new Date(val), pattern: 'dd.mm.yyyy HH:MM' })
}
const OpenUploadDetail = (guid: string) => {
selectedJobGuid.value = guid
uploadDetailPanel.value = true
}
const stopPolling = () => {
if (pollInterval) {
clearInterval(pollInterval)
pollInterval = null
}
}
const startPolling = (jobId: string) => {
stopPolling()
pollInterval = setInterval(async () => {
const status = await piyangoKatilimciService.GetUploadJobStatus(jobId)
if (status && (status.status === 'Completed' || status.status === 'Failed')) {
stopPolling()
uploadProgressValue.value = status.status === 'Completed' ? 100 : status.progress || 0
uploadProgressPanel.value = false
piyangoKatilimciStore.refreshPiyangoKatilimciList = true
piyangoKatilimciStore.katilimciFilePanel = true
refreshUploadJobsAndPollProcessing()
} else if (status) {
uploadProgressValue.value = status.progress || 0
}
}, 2000)
}
const startPollingForExistingJob = (jobGuid: string) => {
stopPolling()
pollInterval = setInterval(async () => {
const status = await piyangoKatilimciService.GetUploadJobStatus(jobGuid)
if (status) {
const idx = uploadJobs.value.findIndex((j: Record<string, any>) => j.guid === jobGuid)
if (idx >= 0) {
uploadJobs.value[idx] = { ...uploadJobs.value[idx], ...status }
}
if (status.status === 'Completed' || status.status === 'Failed') {
stopPolling()
piyangoKatilimciStore.refreshPiyangoKatilimciList = true
refreshUploadJobsAndPollProcessing()
}
}
}, 2000)
}
const refreshUploadJobsAndPollProcessing = async () => {
const cekilisId = piyangoStore.selectedLottery
if (cekilisId !== null) {
uploadJobs.value = await piyangoKatilimciService.GetUploadJobs(cekilisId)
startPollingForAnyProcessingJob()
}
}
const startPollingForAnyProcessingJob = () => {
const processingJob = uploadJobs.value.find(
(j: Record<string, any>) => j.status?.toLowerCase() === 'processing'
)
if (processingJob?.guid) {
startPollingForExistingJob(processingJob.guid)
}
}
onUnmounted(() => {
stopPolling()
removeUploadHandlers()
})
</script>
<style scoped>
.progress-bar {
width: 90%;
max-width: 400px;
@ -384,6 +561,7 @@
font-weight: 600;
color: #333;
}
.upload-warning {
background: #fff8db;
color: #856404;
@ -394,4 +572,164 @@
font-size: 14px;
text-align: center;
}
.upload-panel-content {
display: flex;
flex-direction: column;
gap: 32px;
padding: 24px 24px 24px 24px;
}
.upload-progress-section {
background: #f0f9ff;
border: 1px solid #b6d4fe;
border-radius: 8px;
padding: 16px 20px;
display: flex;
flex-direction: column;
align-items: center;
}
.upload-progress-title {
margin: 0 0 12px;
font-size: 15px;
font-weight: 600;
color: #1a1a2e;
align-self: flex-start;
}
.upload-progress-section .upload-warning {
margin-bottom: 16px;
width: 100%;
}
.upload-progress-section .progress-bar {
width: 100%;
max-width: 100%;
}
.upload-progress-section .progress-text {
margin-top: 12px;
color: #1a1a2e;
}
.upload-history-section {
padding-bottom: 20px;
border-bottom: 1px solid #e8eaed;
}
.upload-history-title,
.upload-form-title {
margin: 0 0 14px;
font-size: 15px;
font-weight: 600;
color: #1a1a2e;
letter-spacing: 0.02em;
}
.upload-form-section {
padding-top: 4px;
}
.upload-form-section :deep(.panel-documents-item) {
margin-bottom: 0;
}
.upload-form-section :deep(.form-item-description) {
margin-top: 8px;
font-size: 13px;
color: #5f6368;
line-height: 1.4;
}
.history-loading {
text-align: center;
padding: 20px;
color: #5f6368;
font-size: 14px;
}
.history-items {
display: flex;
flex-direction: column;
gap: 8px;
}
.history-item {
display: grid;
grid-template-columns: 1fr auto auto auto;
align-items: center;
gap: 16px;
padding: 12px 16px;
border: 1px solid #e8eaed;
border-radius: 8px;
cursor: pointer;
transition: all 0.2s ease;
background: #fafbfc;
}
.history-item:hover {
background: #f1f3f5;
border-color: #d0d5dd;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.history-file {
font-weight: 500;
font-size: 14px;
color: #1a1a2e;
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.history-status {
font-size: 12px;
font-weight: 600;
padding: 4px 10px;
border-radius: 6px;
white-space: nowrap;
}
.history-status.status-completed {
color: #0d6832;
background: #d4edda;
}
.history-status.status-failed {
color: #721c24;
background: #f8d7da;
}
.history-status.status-processing {
color: #004085;
background: #cce5ff;
}
.history-status.status-pending {
color: #856404;
background: #fff3cd;
}
.history-progress {
font-size: 13px;
font-weight: 500;
color: #5f6368;
min-width: 36px;
text-align: right;
}
.history-date {
font-size: 12px;
color: #80868b;
min-width: 100px;
text-align: right;
}
/* İşleniyor durumunda progress bar */
.history-item.processing .history-progress {
font-weight: 600;
color: #007bff;
}
</style>

View File

@ -80,6 +80,11 @@
sort: true,
style: { width: '20%' }
},
{
name: 'cekilisHakkiAdedi',
title: 'Çekiliş Hakkı Adedi',
style: { width: '10%' }
},
{
name: 'sifreCode',

View File

@ -0,0 +1,107 @@
<template>
<div class="form-part">
<div class="form-part-title">
<h4>Çekiliş Tutanağı</h4>
<div class="form-part-title-buttons">
<icon-button
v-if="usersStore.isPanelUser"
icon="plus"
class="ico-section ico-section-header-btn"
@click="AddNewDocument" />
</div>
</div>
<div class="form-part-content" v-if="cekilisTutanagiStore.loaded">
<template v-if="cekilisTutanagiStore.cekilisTutanagiList.length > 0">
<template v-for="(file, i) in cekilisTutanagiStore.cekilisTutanagiList">
<file-list-item
:editable="false"
:data="file"
title="dokumanAdi"
:filePath="file.url">
<template #actionButtons v-if="usersStore.isPanelUser">
<i
class="ico-c ico-btn ico-section back-grad-alert"
@click.stop="DeleteDocumentPop(file)">
<svg><use href="/src/assets/images/icons.svg#trash"></use></svg>
</i>
</template>
</file-list-item>
</template>
</template>
<template v-else>
<div class="form-inner-comment" v-if="usersStore.isPanelUser">
Eklenmiş dosya bulunamadı.
</div>
<div class="form-inner-comment" v-else>
Eklenmiş dosya bulunamadı.
</div>
</template>
</div>
</div>
<panel-wrapper
v-if="cekilisTutanagiStore.documentPanel"
v-model="cekilisTutanagiStore.documentPanel"
panel-title="Doküman Ekle">
<template #panelContent>
<panel-piyango-cekilis-tutanagi />
</template>
<template #footerButton>
<div class="button-c button-save" @click="cekilisTutanagiService.SaveDocument">
Ekle
</div>
</template>
</panel-wrapper>
</template>
<script setup lang="ts">
import { ref, onBeforeMount } from 'vue'
import PanelPiyangoCekilisTutanagi from '../panel/PanelPiyangoCekilisTutanagi.vue'
import PanelWrapper from '@/components/PanelWrapper.vue'
import { useUsersStore } from '@/stores/usersStore'
const usersStore = useUsersStore()
import { usePiyangoCekilisTutanagiStore } from '../../stores/piyangoCekilisTutanagiStore'
const cekilisTutanagiStore = usePiyangoCekilisTutanagiStore()
import { usePiyangoCekilisTutanagiService } from '../../service/piyangoCekilisTutanagiService'
const cekilisTutanagiService = usePiyangoCekilisTutanagiService()
import { useDialogStore } from '@/components/global/dialogStore'
const dialogStore = useDialogStore()
import { useDataStore } from '@/stores/dataStore'
const dataStore = useDataStore()
const AddNewDocument = () => {
cekilisTutanagiStore.ResetForm()
cekilisTutanagiStore.isUpdate = false
cekilisTutanagiStore.documentPanel = true
}
const DeleteDocumentPop = (data: Record<string, any>) => {
dialogStore.CreateDialog({
title: 'Doküman Sil',
id: 'deletedoc',
content: 'Dokümanı silmek istediğinize emin misiniz? Bu işlem geri alınamaz.',
closeText: 'Vazgeç',
buttons: [
{
label: 'Doküman Sil',
type: 'alert',
function: () => DeleteDocument(data.id)
}
]
})
}
const DeleteDocument = async (id: number | string) => {
var dt = await dataStore.dataDelete('CekilisTutanak/' + id)
if (dt !== 'errorfalse') {
dialogStore.CloseDialog('deletedoc')
await cekilisTutanagiService.GetDocumentList()
}
}
onBeforeMount(async () => {
await cekilisTutanagiService.GetDocumentList()
})
</script>

View File

@ -0,0 +1,71 @@
<template>
<div class="form-part">
<div class="form-part-title">
<h4>Çekiliş Tutanağı</h4>
<div class="form-part-title-buttons">
<icon-button
v-if="!usersStore.isPanelUser"
icon="plus"
class="ico-section ico-section-header-btn"
@click="AddNewDocument" />
</div>
</div>
<div class="form-part-content" v-if="cekilisTutanagiStore.loaded">
<template v-if="cekilisTutanagiStore.cekilisTutanagiList.length > 0">
<template v-for="(file, i) in cekilisTutanagiStore.cekilisTutanagiList">
<file-list-item
:data="file"
title="dokumanAdi"
:filePath="file.url"
:editable="false" />
</template>
</template>
<template v-else>
<div class="form-inner-comment">
<span>
Eklenmiş dosya bulunamadı. Üstteki butonu kullanarak dosya ekleyebilirsiniz.
</span>
</div>
</template>
</div>
</div>
<panel-wrapper
v-if="cekilisTutanagiStore.documentPanel"
v-model="cekilisTutanagiStore.documentPanel"
panel-title="Doküman Ekle">
<template #panelContent>
<panel-piyango-cekilis-tutanagi />
</template>
<template #footerButton>
<div class="button-c button-save" @click="cekilisTutanagiService.SaveDocument">
Ekle
</div>
</template>
</panel-wrapper>
</template>
<script setup lang="ts">
import { ref, onBeforeMount } from 'vue'
import PanelPiyangoCekilisTutanagi from '../panel/PanelPiyangoCekilisTutanagi.vue'
import PanelWrapper from '@/components/PanelWrapper.vue'
import { useUsersStore } from '@/stores/usersStore'
const usersStore = useUsersStore()
import { usePiyangoStore } from '../../stores/piyangoStore'
const piyangoStore = usePiyangoStore()
import { usePiyangoCekilisTutanagiStore } from '../../stores/piyangoCekilisTutanagiStore'
const cekilisTutanagiStore = usePiyangoCekilisTutanagiStore()
import { usePiyangoCekilisTutanagiService } from '../../service/piyangoCekilisTutanagiService'
const cekilisTutanagiService = usePiyangoCekilisTutanagiService()
const AddNewDocument = () => {
cekilisTutanagiStore.ResetForm()
cekilisTutanagiStore.isUpdate = false
cekilisTutanagiStore.documentPanel = true
}
onBeforeMount(async () => {
await cekilisTutanagiService.GetDocumentList()
})
</script>

View File

@ -18,16 +18,27 @@
listVal="islemId"
v-model="piyangoOnayStore.piyangoOnayForm.onayDurumuIslemTipiId"
required
:invalidText="piyangoOnayValidationStore.invalidTexts.onayDurumuIslemTipiId" />
<template v-if="piyangoOnayStore.piyangoOnayForm.onayDurumuIslemTipiId === 4">
<form-input
modelKey="izinSayisi"
v-model="piyangoOnayStore.piyangoOnayForm.izinSayisi"
required
label="İzin Sayı No"
placeholder="İzin Sayı No"
:invalidText="piyangoOnayValidationStore.invalidTexts.izinSayisi"
@keyup="OnKeyup" />
:invalidText="piyangoOnayValidationStore.invalidTexts.onayDurumuIslemTipiId">
<template #option="{ optionData }">
<span
v-if="optionData && optionData.tipAdi"
class="islem-status-badge"
:class="piyangoStore.GetIslemStatusClass(optionData.tipAdi)">
{{ optionData.tipAdi }}
</span>
<span v-else>{{ optionData?.tipAdi || optionData }}</span>
</template>
<template #activator="{ activatorData }">
<span
v-if="activatorData && activatorData.tipAdi"
class="islem-status-badge"
:class="piyangoStore.GetIslemStatusClass(activatorData.tipAdi)">
{{ activatorData.tipAdi }}
</span>
<span v-else>Lütfen Seçim Yapınız</span>
</template>
</form-select>
<template v-if="showIzinFields">
<form-date
type="date"
required
@ -36,12 +47,50 @@
label="İzin Tarihi"
:invalidText="piyangoOnayValidationStore.invalidTexts.izinTarihi"
@change="OnKeyup" />
<form-input
modelKey="izinSayisi"
v-model="piyangoOnayStore.piyangoOnayForm.izinSayisi"
required
label="İzin Sayısı"
placeholder="İzin Sayısı"
:invalidText="piyangoOnayValidationStore.invalidTexts.izinSayisi"
@keyup="OnKeyup" />
<form-textarea
v-model="piyangoOnayStore.piyangoOnayForm.izinAciklamasi"
:invalidText="piyangoOnayValidationStore.invalidTexts.izinAciklamasi"
label="İzin Açıklaması"
@keyup="OnKeyup" />
</template>
<form-select
v-if="showIzinVerildiFields || showMudurlukFields"
label="Müdürlük"
:listData="mudurlukListesi"
listText="name"
listVal="id"
v-model="piyangoOnayStore.piyangoOnayForm.mudurlukId"
required
:invalidText="piyangoOnayValidationStore.invalidTexts.mudurlukId"
@change="OnKeyup" />
<form-select
v-if="showIzinVerildiFields"
label="Çekiliş Görevlisi"
:listData="cekilisGorevlisiListesi"
listText="name"
listVal="id"
v-model="piyangoOnayStore.piyangoOnayForm.cekilisGorevlisiId"
required
:invalidText="piyangoOnayValidationStore.invalidTexts.cekilisGorevlisiId"
@change="OnKeyup" />
<form-select
v-if="showKapsamDisiSebebi"
label="Kapsam Dışı Sebebi"
:listData="kapsamDisiSebepListesi"
listText="name"
listVal="id"
v-model="piyangoOnayStore.piyangoOnayForm.kapsamDisiSebebi"
required
:invalidText="piyangoOnayValidationStore.invalidTexts.kapsamDisiSebebi"
@change="OnKeyup" />
<form-file
v-model="piyangoOnayStore.piyangoOnayForm.file"
elclass="panel-documents-item"
@ -55,7 +104,7 @@
</div>
</template>
<script setup lang="ts">
import { onBeforeMount } from 'vue'
import { onBeforeMount, computed, ref } from 'vue'
import { usePiyangoOnayStore } from '../../stores/piyangoOnayStore'
const piyangoOnayStore = usePiyangoOnayStore()
import { usePiyangoOnayValidationStore } from '../../validation/piyangoOnayValidationStore'
@ -66,6 +115,64 @@
const piyangoDataStore = usePiyangoDataStore()
import { usePiyangoServices } from '../../service/piyangoServices'
const piyangoServices = usePiyangoServices()
import { usePiyangoStore } from '../../stores/piyangoStore'
const piyangoStore = usePiyangoStore()
const kapsamDisiId = computed<number | null>(() => {
const kapsamDisi = piyangoDataStore.piyangoOnayDurumlari.find(
(item: Record<string, any>) => item.tipAdi === 'Kapsam Dışı'
)
return kapsamDisi ? kapsamDisi.islemId : null
})
const showIzinFields = computed<boolean>(() => {
return (
piyangoOnayStore.piyangoOnayForm.onayDurumuIslemTipiId === 4 ||
piyangoOnayStore.piyangoOnayForm.onayDurumuIslemTipiId === kapsamDisiId.value
)
})
const showIzinVerildiFields = computed<boolean>(() => {
return piyangoOnayStore.piyangoOnayForm.onayDurumuIslemTipiId === 4
})
const showMudurlukFields = computed<boolean>(() => {
return piyangoOnayStore.piyangoOnayForm.onayDurumuIslemTipiId === kapsamDisiId.value
})
const showKapsamDisiSebebi = computed<boolean>(() => {
return piyangoOnayStore.piyangoOnayForm.onayDurumuIslemTipiId === kapsamDisiId.value
})
const kapsamDisiSebepListesi = ref<Record<string, any>[]>([
{ id: '2/a', name: '2/a' },
{ id: '2/b', name: '2/b' },
{ id: '2/c', name: '2/c' },
{ id: '2/ç', name: '2/ç' },
{ id: '2/d', name: '2/d' },
{ id: '2/e', name: '2/e' },
{ id: '2/f', name: '2/f' },
{ id: '2/g', name: '2/g' },
{ id: 'Diğer', name: 'Diğer' }
])
const cekilisGorevlisiListesi = ref<Record<string, any>[]>([
{ id: 1, name: 'Antalya Şube Müdürlüğü' },
{ id: 2, name: 'Gaziantep Şube Müdürlüğü' },
{ id: 3, name: 'Aksaray Şube Müdürlüğü' },
{ id: 4, name: 'Kadıköy Şube Müdürlüğü' },
{ id: 5, name: 'Karşıyaka Şube Müdürlüğü' },
{ id: 6, name: 'Muğla Şube Müdürlüğü' },
{ id: 7, name: 'Trabzon Şube Müdürlüğü' },
{ id: 8, name: 'Noter' },
{ id: 9, name: 'Başkanlık Personeli' }
])
const mudurlukListesi = ref<Record<string, any>[]>([
{ id: 1, name: '1 No\'lu Özel Çekilişler İzin ve Takip Şubesi Müdürlüğü' },
{ id: 2, name: '2 No\'lu Özel Çekilişler İzin ve Takip Şubesi Müdürlüğü' },
{ id: 3, name: '3 No\'lu Özel Çekilişler İzin ve Takip Şubesi Müdürlüğü' }
])
const OnKeyup = () => {
piyangoOnayValidationStore.formChanged = true

View File

@ -2,13 +2,14 @@
<list-table-content
v-if="loaded"
:tableHeader="tableHeader"
:rowAction="EditOnay"
:rowAction="adminRowAction"
formTitle="Piyango Onay Durumları"
listText="Kayıt"
:apiList="'OnayDurumu/GetSonOnayDurumlariList/' + piyangoStore.selectedLottery"
apiText="Piyango Onay Log Listesi"
page="form"
:refresh="piyangoOnayStore.refreshList" />
:refresh="piyangoOnayStore.refreshList"
:rowActions="adminRowActions" />
<panel-wrapper
v-if="piyangoOnayStore.onayFormPanel"
v-model="piyangoOnayStore.onayFormPanel"
@ -40,6 +41,12 @@
const piyangoStore = usePiyangoStore()
import { usePiyangoDataStore } from '../../stores/piyangoDataStore'
const piyangoDataStore = usePiyangoDataStore()
import { useDialogStore } from '@/components/global/dialogStore'
const dialogStore = useDialogStore()
import { useDataStore } from '@/stores/dataStore'
const dataStore = useDataStore()
import { useUsersStore } from '@/stores/usersStore'
const usersStore = useUsersStore()
const loaded = ref<boolean>(false)
@ -47,6 +54,24 @@
return piyangoDataStore.piyangoOnayDurumlari
})
const mudurlukListesi = ref<Record<string, any>[]>([
{ id: 1, name: '1 No\'lu Özel Çekilişler İzin ve Takip Şubesi Müdürlüğü' },
{ id: 2, name: '2 No\'lu Özel Çekilişler İzin ve Takip Şubesi Müdürlüğü' },
{ id: 3, name: '3 No\'lu Özel Çekilişler İzin ve Takip Şubesi Müdürlüğü' }
])
const cekilisGorevlisiListesi = ref<Record<string, any>[]>([
{ id: 1, name: 'Antalya Şube Müdürlüğü' },
{ id: 2, name: 'Gaziantep Şube Müdürlüğü' },
{ id: 3, name: 'Aksaray Şube Müdürlüğü' },
{ id: 4, name: 'Kadıköy Şube Müdürlüğü' },
{ id: 5, name: 'Karşıyaka Şube Müdürlüğü' },
{ id: 6, name: 'Muğla Şube Müdürlüğü' },
{ id: 7, name: 'Trabzon Şube Müdürlüğü' },
{ id: 8, name: 'Noter' },
{ id: 9, name: 'Başkanlık Personeli' }
])
const tableHeader = ref<Record<string, any>[]>([
{
name: 'tarih',
@ -59,7 +84,7 @@
sort: true,
filter: {
type: 'date',
range: true
between: true
}
},
{
@ -72,6 +97,11 @@
name: 'onayDurumuIslemTipiAdi',
title: 'İşlem',
sort: true,
computeHtml: (v: Record<string, any>): string => {
const statusName = v.onayDurumuIslemTipiAdi || ''
const statusClass = piyangoStore.GetIslemStatusClass(statusName)
return `<span class='islem-status-badge ${statusClass}'>${statusName}</span>`
},
filter: {
type: 'select',
data: piyangoOnayDurumlari,
@ -100,19 +130,100 @@
},
{
name: 'izinTarihi',
title: 'İzin Tarihi'
title: 'İzin Tarihi',
compute: (v: Record<string, any>): string => {
return v.izinTarihi === null || v.izinTarihi === undefined || v.izinTarihi === ''
? ''
: dateStore.dateFormat({ pattern: 'dd-mm-yy', date: v.izinTarihi })
}
},
{
name: 'izinAciklamasi',
title: 'İzin Açıklaması'
},
{
name: 'kapsamDisiSebebi',
title: 'Kapsam Dışı Sebebi'
},
{
name: 'mudurluk',
title: 'Müdürlük',
compute: (v: Record<string, any>): string => {
if (v.mudurluk === null || v.mudurluk === undefined || v.mudurluk === '') {
return ''
}
const mudurluk = mudurlukListesi.value.find((item: Record<string, any>) => item.id === v.mudurluk)
return mudurluk ? mudurluk.name : ''
}
},
{
name: 'cekilisGorevlisi',
title: 'Çekiliş Görevlisi',
compute: (v: Record<string, any>): string => {
if (v.cekilisGorevlisi === null || v.cekilisGorevlisi === undefined || v.cekilisGorevlisi === '') {
return ''
}
const gorevli = cekilisGorevlisiListesi.value.find((item: Record<string, any>) => item.id === v.cekilisGorevlisi)
return gorevli ? gorevli.name : ''
}
},
])
const EditOnay = (d: Record<string, any>) => {
Object.assign(piyangoOnayStore.piyangoPanelOnayForm, d)
Object.assign(piyangoOnayStore.piyangoPanelOnayForm, {
...piyangoOnayStore.piyangoOnayBaseForm,
...d,
izinAciklamasi: d.izinAciklamasi != null ? d.izinAciklamasi : '',
kapsamDisiSebebi: d.kapsamDisiSebebi != null ? d.kapsamDisiSebebi : null,
mudurlukId: d.mudurluk != null ? d.mudurluk : null,
cekilisGorevlisiId: d.cekilisGorevlisi != null ? d.cekilisGorevlisi : null
})
piyangoOnayStore.onayFormPanel = true
}
const DeleteRowPop = (data: Record<string, any>, i: number) => {
dialogStore.CreateDialog({
title: 'Onay Durumu Sil',
id: 'deleteonaydurumu',
content: 'Onay durumunu silmek istediğinize emin misiniz?',
closeText: 'Vazgeç',
buttons: [
{
label: 'Sil',
type: 'alert',
function: () => DeleteRow(data.id)
}
]
})
}
const DeleteRow = async (id: number | string) => {
var dt = await dataStore.dataDelete('OnayDurumu/' + id, {
toast: { toast: 'Onay durumu başarıyla silindi', type: 'success' }
})
if (dt !== 'errorfalse') {
dialogStore.CloseDialog('deleteonaydurumu')
window.location.reload()
}
}
const rowActions = ref<Record<string, any>[]>([
{
text: 'Sil',
class: 'alert',
action: DeleteRowPop
}
])
const adminRowAction = computed(() => {
return usersStore.isPanelUser ? EditOnay : undefined
})
const adminRowActions = computed(() => {
return usersStore.isPanelUser ? rowActions.value : []
})
onBeforeMount(async () => {
loaded.value = true
})

View File

@ -32,11 +32,11 @@
sort: true,
filter: {
type: 'date',
range: true
between: true
}
},
{
name: 'islemYapanKullanici.email',
name: 'islemYapanKullanici',
title: 'Kişi',
sort: true,
style: { width: '20%' }

View File

@ -0,0 +1,339 @@
<template>
<div class="panel-excel-upload-detail">
<div v-if="loading" class="detail-loading">Yükleniyor...</div>
<template v-else-if="job">
<div class="detail-summary">
<div class="detail-row detail-file-row">
<span class="detail-label">Dosya:</span>
<span class="detail-file-name">{{ job.fileName }}</span>
</div>
<div class="detail-row">
<span class="detail-label">Durum:</span>
<span :class="['detail-status', 'status-' + job.status?.toLowerCase()]">
{{ statusText(job.status) }}
</span>
</div>
<div class="detail-row">
<span class="detail-label">İlerleme:</span>
<span>{{ job.progress }}%</span>
</div>
<div class="detail-stats">
<div class="detail-stat-item">
<span class="detail-stat-value">{{ job.totalRows }}</span>
<span class="detail-stat-label">Toplam Satır</span>
</div>
<div class="detail-stat-item detail-stat-inserted">
<span class="detail-stat-value">{{ job.insertedCount ?? 0 }}</span>
<span class="detail-stat-label">Eklenen</span>
</div>
<div class="detail-stat-item detail-stat-skipped">
<span class="detail-stat-value">{{ job.skippedRows ?? 0 }}</span>
<span class="detail-stat-label">Atlanan</span>
</div>
<div class="detail-stat-item detail-stat-duplicate">
<span class="detail-stat-value">{{ job.duplicateCount ?? 0 }}</span>
<span class="detail-stat-label">Duplicate</span>
</div>
<div class="detail-stat-item detail-stat-error">
<span class="detail-stat-value">{{ job.errorCount ?? 0 }}</span>
<span class="detail-stat-label">Hata</span>
</div>
</div>
<div v-if="job.errorMessage" class="detail-error-box">
<span class="detail-error-label">Hata:</span>
<span>{{ job.errorMessage }}</span>
</div>
</div>
<div class="detail-logs" v-if="logs && logs.length > 0">
<h4 class="detail-logs-title">İşlem Logları</h4>
<div class="logs-list">
<div
v-for="log in logs"
:key="log.id"
:class="['log-item', 'log-' + log.logLevel?.toLowerCase()]">
<span :class="['log-level', 'log-level-' + log.logLevel?.toLowerCase()]">{{ log.logLevel }}</span>
<span v-if="log.rowNumber" class="log-row">Satır {{ log.rowNumber }}</span>
<span class="log-message">{{ log.message }}</span>
<span v-if="log.details" class="log-details">{{ log.details }}</span>
<span class="log-time">{{ formatDate(log.createdAt) }}</span>
</div>
</div>
</div>
<div v-else class="detail-no-logs">Log kaydı bulunamadı.</div>
</template>
<div v-else class="detail-not-found">Yükleme detayı bulunamadı.</div>
</div>
</template>
<script setup lang="ts">
import { ref, onMounted, watch } from 'vue'
import { usePiyangoKatilimciService } from '../../service/piyangoKatilimciService'
import { useDateStore } from '@/stores/dateStore'
const props = defineProps<{
jobGuid: string
}>()
const piyangoKatilimciService = usePiyangoKatilimciService()
const dateStore = useDateStore()
const loading = ref(true)
const job = ref<Record<string, any> | null>(null)
const logs = ref<Record<string, any>[]>([])
const statusText = (status: string) => {
const map: Record<string, string> = {
Pending: 'Bekliyor',
Processing: 'İşleniyor',
Completed: 'Tamamlandı',
Failed: 'Başarısız'
}
return map[status] || status
}
const formatDate = (val: string | Date) => {
if (!val) return '-'
return dateStore.dateFormat({ date: new Date(val), pattern: 'dd.mm.yyyy HH:MM' })
}
const loadDetail = async () => {
if (!props.jobGuid) return
loading.value = true
const data = await piyangoKatilimciService.GetUploadJobDetail(props.jobGuid)
if (data) {
job.value = data.job
logs.value = data.logs || []
} else {
job.value = null
logs.value = []
}
loading.value = false
}
onMounted(() => loadDetail())
watch(() => props.jobGuid, () => loadDetail())
</script>
<style scoped>
.panel-excel-upload-detail {
padding: 24px 24px 24px 24px;
}
.detail-loading {
text-align: center;
padding: 32px;
color: #5f6368;
font-size: 14px;
}
.detail-summary {
margin-bottom: 24px;
padding: 20px;
background: #fafbfc;
border: 1px solid #e8eaed;
border-radius: 8px;
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.detail-row {
display: grid;
grid-template-columns: 120px 1fr;
gap: 12px;
margin-bottom: 10px;
align-items: center;
}
.detail-file-row {
margin-bottom: 12px;
}
.detail-file-name {
font-weight: 600;
color: #1a1a2e;
word-break: break-all;
}
.detail-label {
font-weight: 600;
color: #5f6368;
font-size: 13px;
}
.detail-status {
font-size: 12px;
font-weight: 600;
padding: 4px 10px;
border-radius: 6px;
display: inline-block;
width: fit-content;
}
.detail-status.status-completed {
color: #0d6832;
background: #d4edda;
}
.detail-status.status-failed {
color: #721c24;
background: #f8d7da;
}
.detail-status.status-processing {
color: #004085;
background: #cce5ff;
}
.detail-status.status-pending {
color: #856404;
background: #fff3cd;
}
.detail-stats {
display: grid;
grid-template-columns: repeat(5, 1fr);
gap: 12px;
margin: 16px 0;
padding: 16px 0;
border-top: 1px solid #e8eaed;
border-bottom: 1px solid #e8eaed;
}
.detail-stat-item {
text-align: center;
padding: 8px;
background: #f1f3f5;
border-radius: 6px;
}
.detail-stat-value {
display: block;
font-size: 18px;
font-weight: 700;
color: #1a1a2e;
}
.detail-stat-label {
font-size: 12px;
color: #5f6368;
}
.detail-error-box {
margin-top: 16px;
padding: 12px 16px;
background: #fff5f5;
border: 1px solid #f8d7da;
border-radius: 6px;
color: #721c24;
font-size: 13px;
display: flex;
gap: 8px;
}
.detail-error-label {
font-weight: 600;
flex-shrink: 0;
}
.detail-not-found {
padding: 24px;
text-align: center;
color: #721c24;
background: #fff5f5;
border: 1px solid #f8d7da;
border-radius: 8px;
font-weight: 500;
}
.detail-logs-title {
margin: 0 0 12px;
font-size: 15px;
font-weight: 600;
color: #1a1a2e;
}
.logs-list {
max-height: 400px;
overflow-y: auto;
border: 1px solid #e8eaed;
border-radius: 8px;
background: #fafbfc;
}
.log-item {
padding: 10px 14px;
border-bottom: 1px solid #e8eaed;
font-size: 13px;
display: flex;
flex-wrap: wrap;
gap: 10px;
align-items: baseline;
}
.log-item:last-child {
border-bottom: none;
}
.log-item.log-error {
background: #fff5f5;
}
.log-item.log-warning {
background: #fffbf0;
}
.log-item.log-info {
background: #f0f9ff;
}
.log-level {
font-weight: 600;
min-width: 60px;
font-size: 11px;
padding: 2px 8px;
border-radius: 4px;
}
.log-level.log-level-error {
background: #f8d7da;
color: #721c24;
}
.log-level.log-level-warning {
background: #fff3cd;
color: #856404;
}
.log-level.log-level-info {
background: #cce5ff;
color: #004085;
}
.log-row {
color: #5f6368;
font-family: ui-monospace, monospace;
font-size: 12px;
}
.log-message {
flex: 1;
min-width: 0;
}
.log-details {
font-size: 12px;
color: #5f6368;
width: 100%;
}
.log-time {
font-size: 11px;
color: #80868b;
margin-left: auto;
}
.detail-no-logs {
padding: 24px;
color: #80868b;
text-align: center;
font-style: italic;
font-size: 14px;
}
</style>

View File

@ -0,0 +1,21 @@
<template>
<form-input
v-model="cekilisTutanagiStore.cekilisTutanagiForm.dokumanAdi"
label="Dosya Başlığı"
modelKey="dokumanAdi"
minlength="2"
:invalidText="cekilisTutanagiValidationStore.invalidTexts.dokumanAdi" />
<form-file
v-model="cekilisTutanagiStore.cekilisTutanagiForm.dosya"
elclass="panel-documents-item"
:invalidText="cekilisTutanagiValidationStore.invalidTexts.dosya" />
</template>
<script setup lang="ts">
import { useValidationStore } from '@/stores/validationStore'
const validationStore = useValidationStore()
import { usePiyangoCekilisTutanagiStore } from '../../stores/piyangoCekilisTutanagiStore'
const cekilisTutanagiStore = usePiyangoCekilisTutanagiStore()
import { usePiyangoCekilisTutanagiValidationStore } from '../../validation/piyangoCekilisTutanagiValidationStore'
const cekilisTutanagiValidationStore = usePiyangoCekilisTutanagiValidationStore()
</script>

View File

@ -108,6 +108,9 @@
}
const OnIkramiyeChanged = (e: Event, val: any, item: Record<string, any>) => {
piyangoDosyaKapamaStore.dosyaKapamaIkramiyeData.ikramiyeId = item.id
piyangoDosyaKapamaStore.dosyaKapamaIkramiyeData.tahhutEdilenIkramiye = `
${item.cinsi}, ${item.marka}, ${item.model}, (${item.asilTalihliAdedi} adet)
`

View File

@ -141,10 +141,10 @@
"
half />
<form-display
v-model="piyangoKatilimciStore.piyangoKatilimciUserFormData.cekilisKatilimSiraNo"
label="Katılım Sora No"
v-model="piyangoKatilimciStore.piyangoKatilimciUserFormData.cekilisHakkiAdedi"
label="Çekiliş Hakkı Adedi"
:invalidText="
piyangoKatilimciValidationStore.userFormInvalidTexts.cekilisKatilimSiraNo
piyangoKatilimciValidationStore.userFormInvalidTexts.cekilisHakkiAdedi
"
half />
<form-display
@ -287,6 +287,16 @@
:invalidText="
piyangoKatilimciValidationStore.userFormInvalidTexts.cekilisKatilimSiraNo
" />
<form-input
@keyup="FormChanged"
modelKey="cekilisHakkiAdedi"
v-model="piyangoKatilimciStore.piyangoKatilimciUserFormData.cekilisHakkiAdedi"
half
label="Çekiliş Hakkı Adedi"
:invalidText="
piyangoKatilimciValidationStore.userFormInvalidTexts.cekilisHakkiAdedi
"
@keydown="validationStore.allowNumbersWithKeys" />
<form-input
@keyup="FormChanged"
modelKey="magazaKartNumarasi"

View File

@ -7,16 +7,27 @@
listVal="islemId"
v-model="piyangoOnayStore.piyangoPanelOnayForm.onayDurumuIslemTipiId"
required
:invalidText="piyangoOnayValidationStore.invalidTextsPanel.onayDurumuIslemTipiId" />
<template v-if="piyangoOnayStore.piyangoPanelOnayForm.onayDurumuIslemTipiId === 4">
<form-input
modelKey="izinSayisi"
v-model="piyangoOnayStore.piyangoPanelOnayForm.izinSayisi"
required
label="İzin Sayı No"
placeholder="İzin Sayı No"
:invalidText="piyangoOnayValidationStore.invalidTextsPanel.izinSayisi"
@keyup="OnKeyup" />
:invalidText="piyangoOnayValidationStore.invalidTextsPanel.onayDurumuIslemTipiId">
<template #option="{ optionData }">
<span
v-if="optionData && optionData.tipAdi"
class="islem-status-badge"
:class="piyangoStore.GetIslemStatusClass(optionData.tipAdi)">
{{ optionData.tipAdi }}
</span>
<span v-else>{{ optionData?.tipAdi || optionData }}</span>
</template>
<template #activator="{ activatorData }">
<span
v-if="activatorData && activatorData.tipAdi"
class="islem-status-badge"
:class="piyangoStore.GetIslemStatusClass(activatorData.tipAdi)">
{{ activatorData.tipAdi }}
</span>
<span v-else>Lütfen Seçim Yapınız</span>
</template>
</form-select>
<template v-if="showIzinFields">
<form-date
type="date"
required
@ -25,12 +36,50 @@
label="İzin Tarihi"
:invalidText="piyangoOnayValidationStore.invalidTextsPanel.izinTarihi"
@change="OnKeyup" />
<form-input
modelKey="izinSayisi"
v-model="piyangoOnayStore.piyangoPanelOnayForm.izinSayisi"
required
label="İzin Sayısı"
placeholder="İzin Sayısı"
:invalidText="piyangoOnayValidationStore.invalidTextsPanel.izinSayisi"
@keyup="OnKeyup" />
<form-textarea
v-model="piyangoOnayStore.piyangoPanelOnayForm.izinAciklamasi"
:invalidText="piyangoOnayValidationStore.invalidTextsPanel.izinAciklamasi"
label="İzin Açıklaması"
@keyup="OnKeyup" />
</template>
<form-select
v-if="showIzinVerildiFields || showMudurlukFields"
label="Müdürlük"
:listData="mudurlukListesi"
listText="name"
listVal="id"
v-model="piyangoOnayStore.piyangoPanelOnayForm.mudurlukId"
required
:invalidText="piyangoOnayValidationStore.invalidTextsPanel.mudurlukId"
@change="OnKeyup" />
<form-select
v-if="showIzinVerildiFields"
label="Çekiliş Görevlisi"
:listData="cekilisGorevlisiListesi"
listText="name"
listVal="id"
v-model="piyangoOnayStore.piyangoPanelOnayForm.cekilisGorevlisiId"
required
:invalidText="piyangoOnayValidationStore.invalidTextsPanel.cekilisGorevlisiId"
@change="OnKeyup" />
<form-select
v-if="showKapsamDisiSebebi"
label="Kapsam Dışı Sebebi"
:listData="kapsamDisiSebepListesi"
listText="name"
listVal="id"
v-model="piyangoOnayStore.piyangoPanelOnayForm.kapsamDisiSebebi"
required
:invalidText="piyangoOnayValidationStore.invalidTextsPanel.kapsamDisiSebebi"
@change="OnKeyup" />
<form-file
v-model="piyangoOnayStore.piyangoPanelOnayForm.file"
elclass="panel-documents-item"
@ -43,7 +92,7 @@
</div>
</template>
<script setup lang="ts">
import { onBeforeMount } from 'vue'
import { onBeforeMount, computed, ref } from 'vue'
import { usePiyangoOnayStore } from '../../stores/piyangoOnayStore'
const piyangoOnayStore = usePiyangoOnayStore()
import { usePiyangoOnayValidationStore } from '../../validation/piyangoOnayValidationStore'
@ -52,6 +101,64 @@
const piyangoDataStore = usePiyangoDataStore()
import { usePiyangoServices } from '../../service/piyangoServices'
const piyangoServices = usePiyangoServices()
import { usePiyangoStore } from '../../stores/piyangoStore'
const piyangoStore = usePiyangoStore()
const kapsamDisiId = computed<number | null>(() => {
const kapsamDisi = piyangoDataStore.piyangoOnayDurumlari.find(
(item: Record<string, any>) => item.tipAdi === 'Kapsam Dışı'
)
return kapsamDisi ? kapsamDisi.islemId : null
})
const showIzinFields = computed<boolean>(() => {
return (
piyangoOnayStore.piyangoPanelOnayForm.onayDurumuIslemTipiId === 4 ||
piyangoOnayStore.piyangoPanelOnayForm.onayDurumuIslemTipiId === kapsamDisiId.value
)
})
const showIzinVerildiFields = computed<boolean>(() => {
return piyangoOnayStore.piyangoPanelOnayForm.onayDurumuIslemTipiId === 4
})
const showMudurlukFields = computed<boolean>(() => {
return piyangoOnayStore.piyangoPanelOnayForm.onayDurumuIslemTipiId === kapsamDisiId.value
})
const showKapsamDisiSebebi = computed<boolean>(() => {
return piyangoOnayStore.piyangoPanelOnayForm.onayDurumuIslemTipiId === kapsamDisiId.value
})
const kapsamDisiSebepListesi = ref<Record<string, any>[]>([
{ id: '2/a', name: '2/a' },
{ id: '2/b', name: '2/b' },
{ id: '2/c', name: '2/c' },
{ id: '2/ç', name: '2/ç' },
{ id: '2/d', name: '2/d' },
{ id: '2/e', name: '2/e' },
{ id: '2/f', name: '2/f' },
{ id: '2/g', name: '2/g' },
{ id: 'Diğer', name: 'Diğer' }
])
const cekilisGorevlisiListesi = ref<Record<string, any>[]>([
{ id: 1, name: 'Antalya Şube Müdürlüğü' },
{ id: 2, name: 'Gaziantep Şube Müdürlüğü' },
{ id: 3, name: 'Aksaray Şube Müdürlüğü' },
{ id: 4, name: 'Kadıköy Şube Müdürlüğü' },
{ id: 5, name: 'Karşıyaka Şube Müdürlüğü' },
{ id: 6, name: 'Muğla Şube Müdürlüğü' },
{ id: 7, name: 'Trabzon Şube Müdürlüğü' },
{ id: 8, name: 'Noter' },
{ id: 9, name: 'Başkanlık Personeli' }
])
const mudurlukListesi = ref<Record<string, any>[]>([
{ id: 1, name: '1 No\'lu Özel Çekilişler İzin ve Takip Şubesi Müdürlüğü' },
{ id: 2, name: '2 No\'lu Özel Çekilişler İzin ve Takip Şubesi Müdürlüğü' },
{ id: 3, name: '3 No\'lu Özel Çekilişler İzin ve Takip Şubesi Müdürlüğü' }
])
const OnKeyup = () => {
piyangoOnayValidationStore.formChanged = true

View File

@ -34,14 +34,14 @@
:invalidText="piyangoTeminatValidationStore.invalidTexts.refundCount" />
<form-file
v-model="piyangoTeminatStore.piyangoTeminatFormData.refundDocumentUrl"
label='Klasör Arşiv'
label='İade Yazısı'
elclass="panel-documents-item"
:invalidText="piyangoTeminatValidationStore.invalidTexts.refundDocumentUrl"
@change="OnKeyup" />
<form-input
modelKey="refundDescription"
v-model="piyangoTeminatStore.piyangoTeminatFormData.refundDescription"
label="İade Açıklama"
label="Klasör Arşiv No"
@keyup="OnKeyup" />
</template>

View File

@ -0,0 +1,71 @@
import { defineStore } from 'pinia'
import { useDataStore } from '@/stores/dataStore'
import { usePiyangoStore } from '../stores/piyangoStore'
import { usePiyangoCekilisTutanagiStore } from '../stores/piyangoCekilisTutanagiStore'
import { usePiyangoCekilisTutanagiValidationStore } from '../validation/piyangoCekilisTutanagiValidationStore'
export const usePiyangoCekilisTutanagiService = defineStore('piyangoCekilisTutanagiService', () => {
const dataStore = useDataStore()
const piyangoStore = usePiyangoStore()
const cekilisTutanagiStore = usePiyangoCekilisTutanagiStore()
const cekilisTutanagiValidationStore = usePiyangoCekilisTutanagiValidationStore()
const GetDocumentList = async () => {
cekilisTutanagiStore.cekilisTutanagiList.splice(
0,
cekilisTutanagiStore.cekilisTutanagiList.length
)
let dt = await dataStore.dataGet('CekilisTutanak/Cekilis/' + piyangoStore.selectedLottery, {
params: {
pageSize: 50
}
})
if (dt !== 'errorfalse') {
const dataList = Array.isArray(dt) ? dt : (dt.data || [])
cekilisTutanagiStore.cekilisTutanagiList.splice(
0,
cekilisTutanagiStore.cekilisTutanagiList.length,
...dataList
)
}
setTimeout(() => {
cekilisTutanagiStore.loaded = true
}, 30)
}
const SaveDocument = async () => {
if (cekilisTutanagiValidationStore.FormCheck()) {
const formData = new FormData()
formData.append('dosya', cekilisTutanagiStore.cekilisTutanagiForm.dosya)
formData.append('dokumanAdi', cekilisTutanagiStore.cekilisTutanagiForm.dokumanAdi)
formData.append('cekilisId', String(piyangoStore.selectedLottery))
let dt: any
if (!cekilisTutanagiStore.isUpdate) {
dt = await dataStore.dataPost('CekilisTutanak', {
data: formData,
headers: { 'Content-Type': 'multipart/form-data' }
})
} else {
dt = await dataStore.dataPut(
'CekilisTutanak/' + cekilisTutanagiStore.cekilisTutanagiForm.id,
{
data: formData,
headers: { 'Content-Type': 'multipart/form-data' }
}
)
}
if (dt !== 'errorfalse') {
await GetDocumentList()
cekilisTutanagiStore.documentPanel = false
cekilisTutanagiStore.isUpdate = false
}
} else {
cekilisTutanagiValidationStore.isFormValid = true
}
}
return { GetDocumentList, SaveDocument }
})

View File

@ -15,6 +15,10 @@ export const usePiyangoKatilimciService = defineStore('piyangoKatilimciService',
const SaveKatilimciUser = async () => {
if (piyangoKatilimciValidationStore.UserFormCheck()) {
let form: any
piyangoKatilimciStore.piyangoKatilimciUserFormData.cekilisHakkiAdedi = Math.max(
Number(piyangoKatilimciStore.piyangoKatilimciUserFormData.cekilisHakkiAdedi) || 1,
1
)
if (!piyangoKatilimciStore.isPiyangoKatilimciUserUpdate) {
delete piyangoKatilimciStore.piyangoKatilimciUserFormData.id
@ -62,7 +66,6 @@ export const usePiyangoKatilimciService = defineStore('piyangoKatilimciService',
const KatilimciFileUpload = async () => {
if (piyangoKatilimciValidationStore.FileFormCheck()) {
console.log('Katilimci File Upload')
const formData = new FormData()
formData.append('excelFile', piyangoKatilimciStore.piyangoKatilimciFileFormData.excelFile)
let dt: any
@ -83,5 +86,46 @@ export const usePiyangoKatilimciService = defineStore('piyangoKatilimciService',
}
}
return { SaveKatilimciUser, CreateOnlineDraw, KatilimciData, KatilimciFileUpload }
const GetUploadJobs = async (cekilisId: number): Promise<Record<string, any>[]> => {
const dt = await dataStore.dataGet(`ExcelUploadJob/my-jobs?cekilisId=${cekilisId}`)
if (dt !== 'errorfalse' && Array.isArray(dt)) {
return dt
}
return []
}
const GetUploadJobDetail = async (guid: string): Promise<Record<string, any> | null> => {
const dt = await dataStore.dataGet(`ExcelUploadJob/${guid}`)
if (dt !== 'errorfalse') {
return dt
}
return null
}
const GetUploadJobStatus = async (guid: string): Promise<Record<string, any> | null> => {
const dt = await dataStore.dataGet(`ExcelUploadJob/status/${guid}`)
if (dt !== 'errorfalse') {
return dt
}
return null
}
const SubscribeToJob = async (guid: string, connectionId: string): Promise<boolean> => {
const result = await dataStore.dataPost(
`ExcelUploadJob/subscribe?guid=${guid}&connectionId=${encodeURIComponent(connectionId)}`,
{}
)
return result !== 'errorfalse'
}
return {
SaveKatilimciUser,
CreateOnlineDraw,
KatilimciData,
KatilimciFileUpload,
GetUploadJobs,
GetUploadJobDetail,
GetUploadJobStatus,
SubscribeToJob
}
})

View File

@ -4,6 +4,7 @@ import { usePiyangoStore } from '../stores/piyangoStore'
import { usePiyangoOnayStore } from '../stores/piyangoOnayStore'
import { usePiyangoOnayValidationStore } from '../validation/piyangoOnayValidationStore'
import { useUsersStore } from '@/stores/usersStore'
import { usePiyangoDataStore } from '../stores/piyangoDataStore'
export const usePiyangoOnayService = defineStore('piyangoOnayService', () => {
const dataStore = useDataStore()
@ -11,6 +12,18 @@ export const usePiyangoOnayService = defineStore('piyangoOnayService', () => {
const piyangoOnayStore = usePiyangoOnayStore()
const piyangoOnayValidationStore = usePiyangoOnayValidationStore()
const usersStore = useUsersStore()
const piyangoDataStore = usePiyangoDataStore()
const getKapsamDisiId = (): number | null => {
const kapsamDisi = piyangoDataStore.piyangoOnayDurumlari.find(
(item: Record<string, any>) => item.tipAdi === 'Kapsam Dışı'
)
return kapsamDisi ? kapsamDisi.islemId : null
}
const shouldKeepIzinFields = (islemTipiId: number | null): boolean => {
return islemTipiId === 4 || islemTipiId === getKapsamDisiId()
}
const SaveOnayDurum = async () => {
if (piyangoOnayValidationStore.FormCheck()) {
@ -18,11 +31,23 @@ export const usePiyangoOnayService = defineStore('piyangoOnayService', () => {
let form: any
let dataForm = new FormData()
if (piyangoOnayStore.piyangoOnayForm.onayDurumuIslemTipiId !== 4) {
if (!shouldKeepIzinFields(piyangoOnayStore.piyangoOnayForm.onayDurumuIslemTipiId)) {
piyangoOnayStore.piyangoOnayForm.izinSayisi = ''
piyangoOnayStore.piyangoOnayForm.izinTarihi = ''
piyangoOnayStore.piyangoOnayForm.izinAciklamasi = ''
}
if (piyangoOnayStore.piyangoOnayForm.onayDurumuIslemTipiId !== getKapsamDisiId()) {
piyangoOnayStore.piyangoOnayForm.kapsamDisiSebebi = null
}
if (
piyangoOnayStore.piyangoOnayForm.onayDurumuIslemTipiId !== 4 &&
piyangoOnayStore.piyangoOnayForm.onayDurumuIslemTipiId !== getKapsamDisiId()
) {
piyangoOnayStore.piyangoOnayForm.mudurlukId = null
}
if (piyangoOnayStore.piyangoOnayForm.onayDurumuIslemTipiId !== 4) {
piyangoOnayStore.piyangoOnayForm.cekilisGorevlisiId = null
}
dataForm.append(
'onayDurumuIslemTipiId',
piyangoOnayStore.piyangoOnayForm.onayDurumuIslemTipiId
@ -30,10 +55,33 @@ export const usePiyangoOnayService = defineStore('piyangoOnayService', () => {
dataForm.append('onayCekilisId', String(piyangoStore.selectedLottery))
dataForm.append('kisiId', String(usersStore.userId))
dataForm.append('file', piyangoOnayStore.piyangoOnayForm.file)
dataForm.append('aciklama', piyangoOnayStore.piyangoOnayForm.aciklama)
dataForm.append('izinSayisi', piyangoOnayStore.piyangoOnayForm.izinSayisi)
dataForm.append('izinTarihi', piyangoOnayStore.piyangoOnayForm.izinTarihi)
dataForm.append('izinAciklamasi', piyangoOnayStore.piyangoOnayForm.izinAciklamasi)
dataForm.append('aciklama', piyangoOnayStore.piyangoOnayForm.aciklama || '')
dataForm.append('izinSayisi', piyangoOnayStore.piyangoOnayForm.izinSayisi || '')
dataForm.append('izinTarihi', piyangoOnayStore.piyangoOnayForm.izinTarihi || '')
dataForm.append(
'izinAciklamasi',
piyangoOnayStore.piyangoOnayForm.izinAciklamasi != null
? String(piyangoOnayStore.piyangoOnayForm.izinAciklamasi)
: ''
)
dataForm.append(
'kapsamDisiSebebi',
piyangoOnayStore.piyangoOnayForm.kapsamDisiSebebi != null
? String(piyangoOnayStore.piyangoOnayForm.kapsamDisiSebebi)
: ''
)
dataForm.append(
'mudurluk',
piyangoOnayStore.piyangoOnayForm.mudurlukId != null
? String(piyangoOnayStore.piyangoOnayForm.mudurlukId)
: ''
)
dataForm.append(
'cekilisGorevlisi',
piyangoOnayStore.piyangoOnayForm.cekilisGorevlisiId != null
? String(piyangoOnayStore.piyangoOnayForm.cekilisGorevlisiId)
: ''
)
form = await dataStore.dataPost('OnayDurumu/', {
data: dataForm,
@ -45,11 +93,8 @@ export const usePiyangoOnayService = defineStore('piyangoOnayService', () => {
piyangoOnayValidationStore.formChanged = false
piyangoStore.lotteryApprove =
piyangoOnayStore.piyangoOnayForm.onayDurumuIslemTipiId
piyangoOnayStore.refreshList = true
piyangoOnayStore.ResetForm()
setTimeout(() => {
piyangoOnayStore.loaded = true
}, 10)
window.location.reload()
}
} else {
piyangoOnayValidationStore.isFormValid = true
@ -61,25 +106,54 @@ export const usePiyangoOnayService = defineStore('piyangoOnayService', () => {
let form: any
let dataForm = new FormData()
if (piyangoOnayStore.piyangoPanelOnayForm.onayDurumuIslemTipiId !== 4) {
if (!shouldKeepIzinFields(piyangoOnayStore.piyangoPanelOnayForm.onayDurumuIslemTipiId)) {
piyangoOnayStore.piyangoPanelOnayForm.izinSayisi = ''
piyangoOnayStore.piyangoPanelOnayForm.izinTarihi = ''
piyangoOnayStore.piyangoPanelOnayForm.izinAciklamasi = ''
}
dataForm.append(
'onayDurumuIslemTipiId',
piyangoOnayStore.piyangoOnayForm.onayDurumuIslemTipiId
)
if (piyangoOnayStore.piyangoPanelOnayForm.onayDurumuIslemTipiId !== getKapsamDisiId()) {
piyangoOnayStore.piyangoPanelOnayForm.kapsamDisiSebebi = null
}
if (
piyangoOnayStore.piyangoPanelOnayForm.onayDurumuIslemTipiId !== 4 &&
piyangoOnayStore.piyangoPanelOnayForm.onayDurumuIslemTipiId !== getKapsamDisiId()
) {
piyangoOnayStore.piyangoPanelOnayForm.mudurlukId = null
}
if (piyangoOnayStore.piyangoPanelOnayForm.onayDurumuIslemTipiId !== 4) {
piyangoOnayStore.piyangoPanelOnayForm.cekilisGorevlisiId = null
}
dataForm.append('onayDurumuIslemTipiId', piyangoOnayStore.piyangoPanelOnayForm.onayDurumuIslemTipiId)
dataForm.append('id', piyangoOnayStore.piyangoPanelOnayForm.id)
dataForm.append('onayCekilisId', String(piyangoStore.selectedLottery))
dataForm.append('kisiId', String(usersStore.userId))
dataForm.append('file', piyangoOnayStore.piyangoPanelOnayForm.file)
dataForm.append('aciklama', piyangoOnayStore.piyangoPanelOnayForm.aciklama)
dataForm.append('izinSayisi', piyangoOnayStore.piyangoPanelOnayForm.izinSayisi)
dataForm.append('izinTarihi', piyangoOnayStore.piyangoPanelOnayForm.izinTarihi)
dataForm.append('aciklama', piyangoOnayStore.piyangoPanelOnayForm.aciklama || '')
dataForm.append('izinSayisi', piyangoOnayStore.piyangoPanelOnayForm.izinSayisi || '')
dataForm.append('izinTarihi', piyangoOnayStore.piyangoPanelOnayForm.izinTarihi || '')
dataForm.append(
'izinAciklamasi',
piyangoOnayStore.piyangoPanelOnayForm.izinAciklamasi
piyangoOnayStore.piyangoPanelOnayForm.izinAciklamasi != null
? String(piyangoOnayStore.piyangoPanelOnayForm.izinAciklamasi)
: ''
)
dataForm.append(
'kapsamDisiSebebi',
piyangoOnayStore.piyangoPanelOnayForm.kapsamDisiSebebi != null
? String(piyangoOnayStore.piyangoPanelOnayForm.kapsamDisiSebebi)
: ''
)
dataForm.append(
'mudurluk',
piyangoOnayStore.piyangoPanelOnayForm.mudurlukId != null
? String(piyangoOnayStore.piyangoPanelOnayForm.mudurlukId)
: ''
)
dataForm.append(
'cekilisGorevlisi',
piyangoOnayStore.piyangoPanelOnayForm.cekilisGorevlisiId != null
? String(piyangoOnayStore.piyangoPanelOnayForm.cekilisGorevlisiId)
: ''
)
form = await dataStore.dataPut(
@ -92,7 +166,11 @@ export const usePiyangoOnayService = defineStore('piyangoOnayService', () => {
)
if (form !== 'errorfalse') {
piyangoOnayStore.refreshList = true
piyangoOnayStore.refreshList = false
setTimeout(() => {
piyangoOnayStore.refreshList = true
}, 10)
piyangoOnayStore.onayFormPanel = false
}
} else {
piyangoOnayValidationStore.isPanelFormValid = true

View File

@ -1,48 +1,68 @@
import * as signalR from '@microsoft/signalr'
let connection: signalR.HubConnection
let connectionId = ''
let connection: signalR.HubConnection | null = null
export const connectToHub = async () => {
export const connectToHub = async (): Promise<string> => {
console.log('Connecting to SignalR Hub...')
// Mevcut bağlantı varsa kapat
if (connection && connection.state === signalR.HubConnectionState.Connected) {
await connection.stop()
// Mevcut bağlantı varsa her durumda kapat (Connected, Reconnecting, Disconnected)
if (connection) {
try {
await connection.stop()
} catch {
// Bağlantı zaten kapalı olabilir, yoksay
}
connection = null
}
connection = new signalR.HubConnectionBuilder()
.withUrl(import.meta.env.VITE_SOCKET_URL, {
withCredentials: true,
skipNegotiation: true, // WebSocket kullanırken negotiation atlanabilir
withCredentials: false,
skipNegotiation: true,
transport: signalR.HttpTransportType.WebSockets
})
.withAutomaticReconnect()
.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))
// Eventleri ekle (connection artık tanımlı)
connection.on('ReceiveProgress', (data: any) => console.log('progress', data))
connection.on('ReceiveInsertProgress', (data: any) => console.log('insert progress', data))
connection.on('ReceiveCompleted', (data: any) => console.log('completed', data))
connection.on('ReceiveError', (data: any) => console.log('error', data))
await connection.start()
connectionId = await connection.invoke<string>('GetConnectionId')
console.log('Connected to SignalR Hub with Connection ID:', connectionId)
return connectionId
try {
await connection.start()
const connectionId = await connection.invoke<string>('GetConnectionId')
console.log('Connected to SignalR Hub with Connection ID:', connectionId)
return connectionId
} catch (err) {
connection = null
throw err
}
}
export const onProgress = (callback: (data: any) => void) => {
connection.on('ReceiveProgress', callback)
if (connection) connection.on('ReceiveProgress', callback)
}
export const onInsertProgress = (callback: (data: any) => void) => {
connection.on('ReceiveInsertProgress', callback)
if (connection) connection.on('ReceiveInsertProgress', callback)
}
export const onCompleted = (callback: (data: any) => void) => {
connection.on('ReceiveCompleted', callback)
if (connection) connection.on('ReceiveCompleted', callback)
}
export const onError = (callback: (data: any) => void) => {
connection.on('ReceiveError', callback)
if (connection) connection.on('ReceiveError', callback)
}
/** Upload event handler'larını kaldır (memory leak ve çoklu tetikleme önleme) */
export const removeUploadHandlers = () => {
if (connection) {
connection.off('ReceiveProgress')
connection.off('ReceiveInsertProgress')
connection.off('ReceiveCompleted')
connection.off('ReceiveError')
}
}

View File

@ -0,0 +1,37 @@
import { defineStore } from 'pinia'
import { ref, reactive } from 'vue'
import { usePiyangoStore } from './piyangoStore'
export const usePiyangoCekilisTutanagiStore = defineStore('piyangoCekilisTutanagiStore', () => {
const piyangoStore = usePiyangoStore()
const cekilisTutanagiList = ref<Record<string, any>[]>([])
const cekilisTutanagiBaseForm = reactive<Record<string, any>>({
dosya: null,
cekilisId: piyangoStore.selectedLottery,
dokumanAdi: ''
})
const cekilisTutanagiForm = reactive<Record<string, any>>({})
const cekilisTutanagiSafeForm = reactive<Record<string, any>>({})
const isUpdate = ref<boolean>(false)
const refreshList = ref<boolean>(false)
const documentPanel = ref<boolean>(false)
const loaded = ref<boolean>(false)
const ResetForm = () => {
Object.assign(cekilisTutanagiForm, cekilisTutanagiBaseForm)
}
return {
cekilisTutanagiList,
cekilisTutanagiBaseForm,
cekilisTutanagiForm,
cekilisTutanagiSafeForm,
isUpdate,
refreshList,
documentPanel,
loaded,
ResetForm
}
})

View File

@ -2,10 +2,13 @@ import { defineStore } from 'pinia'
import { ref, reactive } from 'vue'
import { useGlobalStore } from '@/stores/globalStore'
import { usePiyangoStore } from './piyangoStore'
import { useUsersStore } from '@/stores/usersStore'
export const usePiyangoDosyaKapamaStore = defineStore('piyangoDosyaKapamaStore', () => {
const globalStore = useGlobalStore()
const piyangoStore = usePiyangoStore()
const usersStore = useUsersStore()
const baseDosyaKapamaData = reactive<Record<string, any>>({
katilimSekli: '',
@ -49,6 +52,8 @@ export const usePiyangoDosyaKapamaStore = defineStore('piyangoDosyaKapamaStore',
teslimEdilenIkramiye: '',
alinmayanIkramiye: '',
aciklama: '',
duzenleyenId: usersStore.userId,
ikramiyeId:'',
cekilisId: piyangoStore.selectedLottery
})
const dosyaKapamaData = reactive<Record<string, any>>({})

View File

@ -10,6 +10,7 @@ export const usePiyangoKatilimciStore = defineStore('piyangoKatilimciStore', ()
const piyangoKatilimciUserSafeFormData = reactive<Record<string, any>>({
ikramiyeId: null,
cekilisKatilimSiraNo: null,
cekilisHakkiAdedi: 1,
sifreCode: '',
magazaKartNumarasi: '',
adi: '',

View File

@ -15,7 +15,10 @@ export const usePiyangoOnayStore = defineStore('piyangoOnayStore', () => {
file: '',
izinSayisi: '',
izinTarihi: '',
izinAciklamasi: ''
izinAciklamasi: '',
kapsamDisiSebebi: null,
mudurlukId: null,
cekilisGorevlisiId: null
})
const piyangoOnayForm = reactive<Record<string, any>>({})
const piyangoPanelOnayForm = reactive<Record<string, any>>({})

View File

@ -131,13 +131,41 @@ export const usePiyangoStore = defineStore('piyangoStore', () => {
Object.assign(lotteryData, baseLotteryData)
}
const GetIslemStatusClass = (statusName: string | undefined): string => {
if (!statusName) {
return 'islem-status-default'
}
// Her duruma benzersiz canlı renkler atanıyor
const statusMap: Record<string, string> = {
'Bilgi/Belge Eksik/Yanlış': 'islem-status-coral',
'Üzerinde Çalışılıyor': 'islem-status-amber',
'Başvuru İşleme Alındı': 'islem-status-sky',
'Başvuru Uygun Görülmedi': 'islem-status-rose',
'İzin Öncesi İptal': 'islem-status-pink',
'Kapsam Dışı': 'islem-status-slate',
'İzin Verildi': 'islem-status-emerald',
'Ceza Verildi': 'islem-status-red',
'İzin Sonrası İptal': 'islem-status-salmon',
'Kampanya Olumlu Bitti': 'islem-status-mint',
'Mükerrer Başvuru': 'islem-status-peach',
'Bekliyor': 'islem-status-yellow',
'Onaylandı': 'islem-status-teal',
'Katılımcı Listesi Yüklendi': 'islem-status-cyan',
'Düzenleme Bekliyor': 'islem-status-orange',
'Ön Kayıt Kabul Edildi': 'islem-status-blue',
'Yardım Amaçlı Piyango Son Onay': 'islem-status-gold',
'İnceleme Bekleniyor': 'islem-status-lavender',
'Yeni Piyango': 'islem-status-violet',
'Başvuru Reddedildi': 'islem-status-crimson',
'Değişiklik Talep Ediliyor': 'islem-status-indigo'
}
return statusMap[statusName] || 'islem-status-default'
}
const LoterryStatusClass = (d: any): string => {
let cls = lotteryStatusTypes.value.filter((v) => {
return v.name === d
})
if (cls !== undefined && cls !== null && cls.length !== 0)
return 'back-grad-' + cls[0].class
else return 'back-grad-waiting'
// Yeni renk sistemini kullan, ama back-grad sınıfı ekle (geriye dönük uyumluluk için)
const statusClass = GetIslemStatusClass(d)
return 'islem-status-badge ' + statusClass
}
const SetLotteryControlData = (data: Record<string, any>) => {
@ -181,6 +209,7 @@ export const usePiyangoStore = defineStore('piyangoStore', () => {
ResetLotteryData,
ResetLotteryContent,
LoterryStatusClass,
GetIslemStatusClass,
SetLotteryControlData
}
})

View File

@ -0,0 +1,45 @@
import { defineStore } from 'pinia'
import { ref, reactive } from 'vue'
import { useValidationStore } from '@/stores/validationStore'
import { usePiyangoCekilisTutanagiStore } from '../stores/piyangoCekilisTutanagiStore'
export const usePiyangoCekilisTutanagiValidationStore = defineStore(
'piyangoCekilisTutanagiValidationStore',
() => {
const cekilisTutanagiStore = usePiyangoCekilisTutanagiStore()
const validationStore = useValidationStore()
const formChanged = ref<boolean>(false)
const isFormValid = ref<boolean>(true)
const invalidTexts = reactive<Record<string, any>>({})
const FormCheck = (): boolean => {
Object.assign(invalidTexts, {})
validationStore.IsFieldEmpty(
cekilisTutanagiStore.cekilisTutanagiForm,
invalidTexts,
'dokumanAdi',
'Döküman için bir başlık belirtmelisiniz.'
)
validationStore.IsFieldEmpty(
cekilisTutanagiStore.cekilisTutanagiForm,
invalidTexts,
'dosya',
'Bir döküman eklemelisiniz.'
)
isFormValid.value = Object.keys(invalidTexts).length === 0
return isFormValid.value
}
return {
formChanged,
isFormValid,
invalidTexts,
FormCheck
}
}
)

View File

@ -96,6 +96,31 @@ export const usePiyangoKatilimciValidationStore = defineStore(
'Lütfen soyadını giriniz.'
)
validationStore.IsFieldEmpty(
piyangoKatilimciStore.piyangoKatilimciUserFormData,
userFormInvalidTexts,
'cekilisHakkiAdedi',
'Lütfen çekiliş hakkı adedini giriniz.'
)
if (
!validationStore.checkEmpty(
piyangoKatilimciStore.piyangoKatilimciUserFormData.cekilisHakkiAdedi
)
) {
const hakAdedi = Number(
piyangoKatilimciStore.piyangoKatilimciUserFormData.cekilisHakkiAdedi
)
if (!Number.isInteger(hakAdedi) || hakAdedi < 1) {
userFormInvalidTexts.cekilisHakkiAdedi =
'Çekiliş hakkı adedi en az 1 olmalıdır.'
isUserFormValid.value = false
} else {
delete userFormInvalidTexts.cekilisHakkiAdedi
}
}
var today: Date | string = new Date()
today = dateStore.dateFormat({
date: today,

View File

@ -1,13 +1,15 @@
import { defineStore } from 'pinia'
import { ref, reactive } from 'vue'
import { ref, reactive, computed } from 'vue'
import { useValidationStore } from '@/stores/validationStore'
import { usePiyangoOnayStore } from '../stores/piyangoOnayStore'
import { usePiyangoDataStore } from '../stores/piyangoDataStore'
export const usePiyangoOnayValidationStore = defineStore(
'piyangoOnayValidationStore',
() => {
const validationStore = useValidationStore()
const piyangoOnayStore = usePiyangoOnayStore()
const piyangoDataStore = usePiyangoDataStore()
const formChanged = ref<boolean>(false)
const isFormValid = ref<boolean>(true)
@ -15,6 +17,17 @@ export const usePiyangoOnayValidationStore = defineStore(
const isPanelFormValid = ref<boolean>(true)
const invalidTextsPanel = reactive<Record<string, any>>({})
const kapsamDisiId = computed<number | null>(() => {
const kapsamDisi = piyangoDataStore.piyangoOnayDurumlari.find(
(item: Record<string, any>) => item.tipAdi === 'Kapsam Dışı'
)
return kapsamDisi ? kapsamDisi.islemId : null
})
const shouldValidateIzinFields = (islemTipiId: number | null): boolean => {
return islemTipiId === 4 || islemTipiId === kapsamDisiId.value
}
const FormCheck = (): boolean => {
Object.assign(invalidTexts, {})
@ -24,12 +37,12 @@ export const usePiyangoOnayValidationStore = defineStore(
'onayDurumuIslemTipiId',
'Bir işlem tipi seçmelisinz.'
)
if (piyangoOnayStore.piyangoOnayForm.onayDurumuIslemTipiId === 4) {
if (shouldValidateIzinFields(piyangoOnayStore.piyangoOnayForm.onayDurumuIslemTipiId)) {
validationStore.IsFieldEmpty(
piyangoOnayStore.piyangoOnayForm,
invalidTexts,
'izinSayisi',
'İzin sayı no girmelisiniz.'
'İzin sayısı girmelisiniz.'
)
validationStore.IsFieldEmpty(
piyangoOnayStore.piyangoOnayForm,
@ -38,6 +51,33 @@ export const usePiyangoOnayValidationStore = defineStore(
'İzin tarihi seçmelisiniz.'
)
}
if (
piyangoOnayStore.piyangoOnayForm.onayDurumuIslemTipiId === 4 ||
piyangoOnayStore.piyangoOnayForm.onayDurumuIslemTipiId === kapsamDisiId.value
) {
validationStore.IsFieldEmpty(
piyangoOnayStore.piyangoOnayForm,
invalidTexts,
'mudurlukId',
'Müdürlük seçmelisiniz.'
)
}
if (piyangoOnayStore.piyangoOnayForm.onayDurumuIslemTipiId === 4) {
validationStore.IsFieldEmpty(
piyangoOnayStore.piyangoOnayForm,
invalidTexts,
'cekilisGorevlisiId',
'Çekiliş görevlisi seçmelisiniz.'
)
}
if (piyangoOnayStore.piyangoOnayForm.onayDurumuIslemTipiId === kapsamDisiId.value) {
validationStore.IsFieldEmpty(
piyangoOnayStore.piyangoOnayForm,
invalidTexts,
'kapsamDisiSebebi',
'Kapsam dışı sebebi seçmelisiniz.'
)
}
isFormValid.value = Object.keys(invalidTexts).length === 0
return isFormValid.value
}
@ -51,12 +91,12 @@ export const usePiyangoOnayValidationStore = defineStore(
'onayDurumuIslemTipiId',
'Bir işlem tipi seçmelisinz.'
)
if (piyangoOnayStore.piyangoPanelOnayForm.onayDurumuIslemTipiId === 4) {
if (shouldValidateIzinFields(piyangoOnayStore.piyangoPanelOnayForm.onayDurumuIslemTipiId)) {
validationStore.IsFieldEmpty(
piyangoOnayStore.piyangoPanelOnayForm,
invalidTextsPanel,
'izinSayisi',
'İzin sayı no girmelisiniz.'
'İzin sayısı girmelisiniz.'
)
validationStore.IsFieldEmpty(
piyangoOnayStore.piyangoPanelOnayForm,
@ -65,6 +105,33 @@ export const usePiyangoOnayValidationStore = defineStore(
'İzin tarihi seçmelisiniz.'
)
}
if (
piyangoOnayStore.piyangoPanelOnayForm.onayDurumuIslemTipiId === 4 ||
piyangoOnayStore.piyangoPanelOnayForm.onayDurumuIslemTipiId === kapsamDisiId.value
) {
validationStore.IsFieldEmpty(
piyangoOnayStore.piyangoPanelOnayForm,
invalidTextsPanel,
'mudurlukId',
'Müdürlük seçmelisiniz.'
)
}
if (piyangoOnayStore.piyangoPanelOnayForm.onayDurumuIslemTipiId === 4) {
validationStore.IsFieldEmpty(
piyangoOnayStore.piyangoPanelOnayForm,
invalidTextsPanel,
'cekilisGorevlisiId',
'Çekiliş görevlisi seçmelisiniz.'
)
}
if (piyangoOnayStore.piyangoPanelOnayForm.onayDurumuIslemTipiId === kapsamDisiId.value) {
validationStore.IsFieldEmpty(
piyangoOnayStore.piyangoPanelOnayForm,
invalidTextsPanel,
'kapsamDisiSebebi',
'Kapsam dışı sebebi seçmelisiniz.'
)
}
isPanelFormValid.value = Object.keys(invalidTextsPanel).length === 0
return isPanelFormValid.value
}

View File

@ -13,6 +13,7 @@
<tab-piyango-bilgileri v-else />
</template>
<template #katilim-listesi><tab-piyango-katilimci-listesi /></template>
<template #cekilis-tutanagi><tab-piyango-cekilis-tutanagi /></template>
<template #talihliler><tab-piyango-talihli-listesi /></template>
<template #itiraz-sikayet><tab-piyango-itiraz /></template>
<template #piyango-loglari><tab-piyango-loglari /></template>
@ -28,7 +29,7 @@
</template>
<template
#dosya-kapama
v-if="usersStore.isPanelUser && piyangoStore.lotteryDrawState">
v-if="piyangoStore.lotteryApprove === 10">
<tab-piyango-dosya-kapama />
</template>
</tabs>
@ -54,6 +55,7 @@
import TabPiyangoLoglari from '@/module/cekilisler/components/TabPiyangoLoglari.vue'
import TabPiyangoKatilimciListesi from '@/module/cekilisler/components/TabPiyangoKatilimciListesi.vue'
import TabPiyangoTalihliListesi from '@/module/cekilisler/components/TabPiyangoTalihliListesi.vue'
import TabPiyangoCekilisTutanagi from '@/module/cekilisler/components/TabPiyangoCekilisTutanagi.vue'
import TabPiyangoBilgileri from '@/module/cekilisler/components/TabPiyangoBilgileri.vue'
import TabPiyangoBilgileriDisplay from '../components/TabPiyangoBilgileriDisplay.vue'
import TabPiyangoItiraz from '@/module/cekilisler/components/TabPiyangoItiraz.vue'
@ -75,11 +77,15 @@
usersStore.isPanelUser) &&
piyangoStore.lotteryPurposeId !== 3
) {
tabList.value.push(
{ text: 'Katılım Listesi', id: 'katilim-listesi' },
{ text: 'Çekiliş Tutanağı', id: 'cekilis-tutanagi' },
{ text: 'Talihliler', id: 'talihliler' },
{ text: 'İtiraz/Şikayet', id: 'itiraz-sikayet' }
)
} else {
tabList.value.push({ text: 'Çekiliş Tutanağı', id: 'cekilis-tutanagi' })
}
if (usersStore.isPanelUser) {
tabList.value.push(
@ -89,11 +95,12 @@
}
tabList.value.push({ text: 'Onay Durumu', id: 'onay-durumu' })
if (piyangoStore.lotteryApprove !== 0 && piyangoStore.lotteryPurposeId !== 3) {
tabList.value.push({ text: 'Teminat Listesi', id: 'teminat-listesi' })
}
if (usersStore.isPanelUser && piyangoStore.lotteryDrawState) {
if (piyangoStore.lotteryApprove === 10) {
tabList.value.push({ text: 'Dosya Kapama', id: 'dosya-kapama' })
}
}

View File

@ -1,6 +1,6 @@
<template>
<AdminLayout>
<Breadcrumb currentPageText="Piyango Listesi" go="/"/>
<Breadcrumb currentPageText="Piyango Listesi" go="/" />
<div
class="form-inner-comment waiting-d"
v-if="!usersStore.isPanelUser && usersStore.userApproveId !== 4">
@ -17,14 +17,13 @@
listText="Piyango"
:addRoute="addApiControl"
:apiList="apiList"
apiText="Piyango Listesi"
isUseRoute/>
apiText="Piyango Listesi"
isUseRoute />
</section>
</AdminLayout>
</template>
<script setup lang="ts">
import { ref, computed, onBeforeMount, onMounted } from 'vue'
import { useRoute } from 'vue-router'
import { ref, computed, onBeforeMount } from 'vue'
import AdminLayout from '@/layouts/AdminLayout.vue'
import { useDateStore } from '@/stores/dateStore'
@ -32,6 +31,8 @@
const dateStore = useDateStore()
import { useUsersStore } from '@/stores/usersStore'
const usersStore = useUsersStore()
import { useGlobalStore } from '@/stores/globalStore'
const globalStore = useGlobalStore()
import { usePiyangoStore } from '../stores/piyangoStore'
const piyangoStore = usePiyangoStore()
import { usePiyangoDataStore } from '../stores/piyangoDataStore'
@ -40,7 +41,6 @@
const piyangoServices = usePiyangoServices()
import router from '@/router'
const route = useRoute()
const loaded = ref<boolean>(false)
const apiList = ref<string>('')
@ -70,129 +70,30 @@
const tableHeader = computed<Record<string, any>[]>(() => {
let header: Record<string, any>[] = []
// 1. PİYANGO ID
header.push({
name: 'piyangoId',
title: 'Piyango Id',
title: 'Piyango ID',
sort: true,
style: { width: '10%' }
})
if (usersStore.isAraciFirma || usersStore.isPanelUser) {
header.push({ name: 'duzenleyen', title: 'Düzenleyen' })
}
header.push(
{
name: 'baslik',
title: 'Başlık',
sort: true,
style: { width: '15%' }
// 2. OLUŞTURMA TARİHİ
header.push({
name: 'olusturmaTarihi',
title: 'Oluşturma Tarihi',
compute: (v: Record<string, any>): string => {
if (!v.olusturmaTarihi || v.olusturmaTarihi === null || v.olusturmaTarihi.includes('0001-')) return ''
return dateStore.dateFormat({ date: v.olusturmaTarihi, pattern: 'dd-mm-yy', splitDate: '/' })
},
{
name: 'piyangoamac',
title: 'Piyango Amacı',
sort: true,
filter: {
type: 'select',
data: piyangoAmaclari.value,
listVal: 'id',
listText: 'amacAdi',
filterId: 'piyangoAmacId'
}
},
{
name: 'olusturmaTarihi',
title: 'Oluşturulma Tarihi',
compute: (v: Record<string, any>): string => {
return dateStore.dateFormat({ date: v.olusturmaTarihi })
},
sort: true,
filter: {
type: 'date',
range: true
}
sort: true,
filter: {
type: 'date',
between: true
}
)
})
if (usersStore.isVakifDernek || usersStore.isPanelUser) {
header.push({
name: 'cekilisTarihi',
title: 'Çekiliş Tarihi',
compute: (v: Record<string, any>): string => {
if(v.piyangoAmacId === 3) return ''
else return dateStore.dateFormat({ date: v.cekilisTarihi })
},
sort: true,
filter: {
type: 'date',
range: true
}
})
}
if (!usersStore.isVakifDernek || usersStore.isPanelUser) {
header.push(
{
name: 'baslangicTarihi',
title: 'Başlangıç Tarihi',
compute: (v: Record<string, any>): string => {
if (v.baslangicTarihi.includes('0001-')) return ''
else return dateStore.dateFormat({ date: v.baslangicTarihi })
},
sort: true,
filter: {
type: 'date',
range: true
}
},
{
name: 'bitisTarihi',
title: 'Bitis Tarihi',
compute: (v: Record<string, any>): string => {
if (v.bitisTarihi.includes('0001-')) return ''
else return dateStore.dateFormat({ date: v.bitisTarihi })
},
sort: true,
filter: {
type: 'date',
range: true
}
}
)
}
header.push(
{
name: 'cekilisYontemi',
title: 'Çekiliş Yöntemi',
sort: true,
filter: {
type: 'select',
data: cekilisYontemleri.value,
listVal: 'id',
listText: 'deger',
filterId: 'cekilisYontemiId'
}
},
{ name: 'ikramiyeler', title: 'İkramiyeler', style: { width: '15%' } },
{
name: 'durum',
title: 'Durum',
style: { width: '10%' },
computeHtml: (v: Record<string, any>): string => {
return `<span class="back-grad ${piyangoStore.LoterryStatusClass(v.durum)}">
${v.durum}
</span>`
},
filter: {
type: 'select',
data: piyangoOnayDurumlari.value,
listVal: 'id',
listText: 'tipAdi',
filterId: 'durumId'
}
}
)
// 3. SEVK DURUMU (Panel User için)
if (usersStore.isPanelUser) {
header.push({
name: 'atanmis',
@ -200,17 +101,16 @@
computeHtml: (v: Record<string, any>): string => {
if (v.atanmis) {
return `<strong class="back-grad back-grad-sevk-ok">
${v.atananlar}
</strong>`
${v.atananlar}
</strong>`
} else {
return `<span class="back-grad back-grad-sevk">
Sevk Edilmemiş</span>`
Sevk Edilmemiş</span>`
}
}
})
}
if (usersStore.isPanelUser) {
// 4. MUHASEBELEŞTİRME DURUMU (Panel User için)
header.push({
name: 'basvuruBedelNo',
title: 'Muhasebeleştirme Durumu',
@ -218,22 +118,305 @@
let durum = ''
if (v.basvuruBedelNo !== null) {
durum += `<strong">Başvuru Bedel No: </strong>
${v.basvuruBedelNo}<br>`
${v.basvuruBedelNo}<br>`
}
if (v.izinBedelNo !== null) {
durum += `<strong">İzin Bedel No: </strong>
${v.izinBedelNo}`
${v.izinBedelNo}`
}
return durum
}
})
}
// 5. MÜDÜRLÜK
header.push({
name: 'mudurluk',
title: 'Müdürlük',
compute: (v: Record<string, any>): string => {
return v.mudurluk || ''
},
filter: {
type: 'text'
}
})
// 6. PİYANGO AMACI
header.push({
name: 'piyangoamac',
title: 'Piyango Amacı',
sort: true,
filter: {
type: 'select',
data: piyangoAmaclari.value,
listVal: 'id',
listText: 'amacAdi',
filterId: 'piyangoAmacId'
}
})
// 7. DÜZENLEYEN (koşullu)
if (usersStore.isAraciFirma || usersStore.isPanelUser) {
header.push({
name: 'duzenleyen',
title: 'Düzenleyen',
filter: {
type: 'text'
}
})
}
// 8. ARACI FİRMA
header.push({
name: 'araciFirma',
title: 'Aracı Firma',
compute: (v: Record<string, any>): string => {
return v.araciFirma || ''
},
filter: {
type: 'text'
}
})
// 6. DURUM
header.push({
name: 'durum',
title: 'Durum',
style: { width: '10%' },
computeHtml: (v: Record<string, any>): string => {
return `<span class="${piyangoStore.LoterryStatusClass(v.durum)}">
${v.durum}
</span>`
},
filter: {
type: 'select',
data: piyangoOnayDurumlari.value,
listVal: 'id',
listText: 'tipAdi',
filterId: 'durumId'
}
})
// 7. İZİN TARİHİ
header.push({
name: 'izinTarihi',
title: 'İzin Tarihi',
compute: (v: Record<string, any>): string => {
if (!v.izinTarihi || v.izinTarihi === null) return ''
return dateStore.dateFormat({ date: v.izinTarihi, pattern: 'dd-mm-yy', splitDate: '/' })
},
sort: true,
filter: {
type: 'date',
between: true
}
})
// 8. İZİN SAYISI
header.push({
name: 'izinSayisi',
title: 'İzin Sayısı',
compute: (v: Record<string, any>): string => {
return v.izinSayisi || ''
},
sort: true,
filter: {
type: 'text',
range: true
}
})
// 9. BAŞLANGIÇ TARİHİ
header.push({
name: 'baslangicTarihi',
title: 'Başlangıç Tarihi',
compute: (v: Record<string, any>): string => {
if (!v.baslangicTarihi || v.baslangicTarihi.includes('0001-')) return ''
return dateStore.dateFormat({ date: v.baslangicTarihi, pattern: 'dd-mm-yy', splitDate: '/' })
},
sort: true,
filter: {
type: 'date',
between: true
}
})
// 10. BİTİŞ TARİHİ
header.push({
name: 'bitisTarihi',
title: 'Bitiş Tarihi',
compute: (v: Record<string, any>): string => {
if (!v.bitisTarihi || v.bitisTarihi.includes('0001-')) return ''
return dateStore.dateFormat({ date: v.bitisTarihi, pattern: 'dd-mm-yy', splitDate: '/' })
},
sort: true,
filter: {
type: 'date',
between: true
}
})
// 11. ÇEKİLİŞ TARİHİ
header.push({
name: 'cekilisTarihi',
title: 'Çekiliş Tarihi',
compute: (v: Record<string, any>): string => {
if (!v.cekilisTarihi || v.cekilisTarihi.includes('0001-')) return ''
if (v.piyangoAmacId === 3) return ''
return dateStore.dateFormat({ date: v.cekilisTarihi, pattern: 'dd-mm-yy', splitDate: '/' })
},
sort: true,
filter: {
type: 'date',
between: true
}
})
// 12. ÇEKİLİŞ GÖREVLİSİ
header.push({
name: 'cekilisGorevlisi',
title: 'Çekiliş Görevlisi',
compute: (v: Record<string, any>): string => {
return v.cekilisGorevlisi || ''
},
filter: {
type: 'text'
}
})
// 13. GAZETE İLAN TARİHİ
header.push({
name: 'gazeteIlanTarihi',
title: 'Gazete İlan Tarihi',
compute: (v: Record<string, any>): string => {
if (!v.gazeteIlanTarihi || v.gazeteIlanTarihi === null) return ''
return dateStore.dateFormat({ date: v.gazeteIlanTarihi, pattern: 'dd-mm-yy', splitDate: '/' })
},
sort: true,
filter: {
type: 'date',
between: true
}
})
// 14. GAZETE ADI
header.push({
name: 'gazeteAdi',
title: 'Gazete Adı',
compute: (v: Record<string, any>): string => {
return v.gazeteAdi || ''
}
})
// 15. İZİN BEDELİ
header.push({
name: 'izinBedeliTutari',
title: 'İzin Bedeli',
compute: (v: Record<string, any>): string => {
if (v.izinBedeliTutari === null || v.izinBedeliTutari === undefined) return ''
return globalStore.toTrLocale(v.izinBedeliTutari)
},
sort: true
})
// 16. İKRAMİYE TUTARI
header.push({
name: 'ikramiyeTutari',
title: 'İkramiye Tutarı',
compute: (v: Record<string, any>): string => {
if (v.ikramiyeTutari === null || v.ikramiyeTutari === undefined) return ''
return globalStore.toTrLocale(v.ikramiyeTutari)
},
sort: true
})
// 17. TEMİNAT TARİHİ
header.push({
name: 'teminatTarihi',
title: 'Teminat Tarihi',
compute: (v: Record<string, any>): string => {
if (!v.teminatTarihi || v.teminatTarihi === null) return ''
return dateStore.dateFormat({ date: v.teminatTarihi, pattern: 'dd-mm-yy', splitDate: '/' })
},
sort: true
})
// 18. TEMİNAT SAYISI
header.push({
name: 'teminatSayisi',
title: 'Teminat Sayısı',
compute: (v: Record<string, any>): string => {
return v.teminatSayisi || ''
},
sort: true
})
// 19. TEMİNAT BANKASI
header.push({
name: 'teminatBankasi',
title: 'Teminat Bankası',
compute: (v: Record<string, any>): string => {
return v.teminatBankasi || ''
}
})
// 20. TEMİNAT TUTARI
header.push({
name: 'teminatTutari',
title: 'Teminat Tutarı',
compute: (v: Record<string, any>): string => {
if (v.teminatTutari === null || v.teminatTutari === undefined) return ''
return globalStore.toTrLocale(v.teminatTutari)
},
sort: true
})
// 21. T. PARA CİNSİ
header.push({
name: 'paraBirimiSembol',
title: 'T. Para Cinsi',
compute: (v: Record<string, any>): string => {
return v.paraBirimiSembol || ''
}
})
// 22. T. İADE TARİHİ
header.push({
name: 'teminatIadeTarihi',
title: 'T. İade Tarihi',
compute: (v: Record<string, any>): string => {
if (!v.teminatIadeTarihi || v.teminatIadeTarihi === null) return ''
return dateStore.dateFormat({ date: v.teminatIadeTarihi, pattern: 'dd-mm-yy', splitDate: '/' })
},
sort: true
})
// 23. T. İADE SAYISI
header.push({
name: 'teminatIadeSayisi',
title: 'T. İade Sayısı',
compute: (v: Record<string, any>): string => {
return v.teminatIadeSayisi || ''
},
sort: true
})
// 24. İKRAMİYELER
header.push({
name: 'ikramiyeler',
title: 'İkramiyeler',
style: { width: '15%' },
compute: (v: Record<string, any>): string => {
return v.ikramiyeler || ''
}
})
return header
})
// tablodan herhangi bir satır tıklayınca çalısır
const OpenPiyango = (row: any) => {
router.push('detay/' + row.id+'/piyango-bilgileri')
router.push('detay/' + row.id + '/piyango-bilgileri')
}
onBeforeMount(async () => {
@ -243,13 +426,4 @@
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>

View File

@ -78,7 +78,7 @@
sort: true,
filter: {
type: 'date',
range: true
between: true
}
},
{
@ -90,7 +90,7 @@
sort: true,
filter: {
type: 'date',
range: true
between: true
}
},
{
@ -102,7 +102,7 @@
sort: true,
filter: {
type: 'date',
range: true
between: true
}
},
{
@ -114,7 +114,7 @@
sort: true,
filter: {
type: 'date',
range: true
between: true
}
},
{
@ -134,7 +134,7 @@
name: 'durum',
title: 'Durum',
computeHtml: (v: Record<string, any>): string => {
return `<span class='back-grad ${piyangoStore.LoterryStatusClass(v.durum)}'>
return `<span class='${piyangoStore.LoterryStatusClass(v.durum)}'>
${v.durum}
</span>`
},

View File

@ -217,7 +217,6 @@
}
}
const GetIkramiyeTotalValues = async () => {
console.log(piyangoStore, 'piyangoStore')
let data = await dataStore.dataGet('Ikramiye/Cekilis/' + piyangoStore.selectedLottery +'?pageNumber=0')
//todo:page 0
if (data !== 'errorfalse') {
@ -281,7 +280,6 @@
})
}
const BasvuruBedeliMuhasebelestir = async () => {
console.log('basvuru bedeli muhasebelestir')
let data = await dataStore.dataGet(
'MuhasebeSettings/BasvuruBedeli/' + piyangoStore.selectedLottery
)
@ -291,6 +289,7 @@
'success',
30000
)
dialogStore.CloseDialog('basvurubedelimuhasebelestir')
loaded.value = false
await GetData()
piyangoStore.lotteryBasvuruBedeliStatus = true

View File

@ -9,7 +9,7 @@
icon="draws"
title="Piyangolar"
listText="Piyango"
:apiList="'Cekilis/GetCekilislerListAtanan/' + usersStore.userId"
:apiList="'Cekilis/GetCekilislerListMuhasebe/'"
apiText="Piyango Listesi"
isUseRoute />
</section>
@ -24,6 +24,8 @@
const dateStore = useDateStore()
import { useUsersStore } from '@/stores/usersStore'
const usersStore = useUsersStore()
import { useGlobalStore } from '@/stores/globalStore'
const globalStore = useGlobalStore()
import { usePiyangoStore } from '@/module/cekilisler/stores/piyangoStore'
const piyangoStore = usePiyangoStore()
import { usePiyangoDataStore } from '@/module/cekilisler/stores/piyangoDataStore'
@ -50,156 +52,328 @@
const tableHeader = computed<Record<string, any>[]>(() => {
let header: Record<string, any>[] = []
// 1. PİYANGO ID
header.push({
name: 'piyangoId',
title: 'Piyango ID',
sort: true,
style: { width: '10%' }
})
// 2. OLUŞTURMA TARİHİ
header.push({
name: 'olusturmaTarihi',
title: 'Oluşturma Tarihi',
compute: (v: Record<string, any>): string => {
if (!v.olusturmaTarihi || v.olusturmaTarihi === null || v.olusturmaTarihi.includes('0001-')) return ''
return dateStore.dateFormat({ date: v.olusturmaTarihi, pattern: 'dd-mm-yy', splitDate: '/' })
},
sort: true,
filter: {
type: 'date',
between: true
}
})
// 3. SEVK DURUMU
header.push({
name: 'atanmis',
title: 'Sevk Durumu',
computeHtml: (v: Record<string, any>): string => {
if (v.atanmis) {
return `<strong class="back-grad back-grad-sevk-ok">
${v.atananlar}
</strong>`
} else {
return `<span class="back-grad back-grad-sevk">
Sevk Edilmemiş</span>`
}
}
})
// 4. MUHASEBELEŞTİRME DURUMU
header.push({
name: 'basvuruBedelNo',
title: 'Muhasebeleştirme Durumu',
computeHtml: (v: Record<string, any>): string => {
let durum = ''
if (v.basvuruBedelNo !== null) {
durum += `<strong">Başvuru Bedel No: </strong>
${v.basvuruBedelNo}<br>`
}
if (v.izinBedelNo !== null) {
durum += `<strong">İzin Bedel No: </strong>
${v.izinBedelNo}`
}
return durum
}
})
// 5. MÜDÜRLÜK
header.push({
name: 'mudurluk',
title: 'Müdürlük',
compute: (v: Record<string, any>): string => {
return v.mudurluk || ''
}
})
// 6. PİYANGO AMACI
header.push({
name: 'piyangoamac',
title: 'Piyango Amacı',
sort: true,
filter: {
type: 'select',
data: piyangoAmaclari.value,
listVal: 'id',
listText: 'amacAdi',
filterId: 'piyangoAmacId'
}
})
// 7. DÜZENLEYEN (koşullu)
if (usersStore.isAraciFirma || usersStore.isPanelUser) {
header.push({ name: 'duzenleyen', title: 'Düzenleyen' })
}
header.push(
{
name: 'piyangoId',
title: 'Piyango ID',
sort: true,
style: { width: '10%' }
},
{
name: 'baslik',
title: 'Başlık',
sort: true,
style: { width: '15%' }
},
{
name: 'piyangoamac',
title: 'Piyango Amacı',
sort: true,
filter: {
type: 'select',
data: piyangoAmaclari.value,
listVal: 'id',
listText: 'amacAdi',
filterId: 'piyangoAmacId'
}
},
{
name: 'olusturmaTarihi',
title: 'Oluşturulma Tarihi',
compute: (v: Record<string, any>): string => {
return dateStore.dateFormat({ date: v.olusturmaTarihi })
},
sort: true,
filter: {
type: 'date',
range: true
}
// 8. ARACI FİRMA
header.push({
name: 'araciFirma',
title: 'Aracı Firma',
compute: (v: Record<string, any>): string => {
return v.araciFirma || ''
}
)
})
if (usersStore.isVakifDernek || usersStore.isPanelUser) {
header.push({
name: 'cekilisTarihi',
title: 'Çekiliş Tarihi',
compute: (v: Record<string, any>): string => {
return dateStore.dateFormat({ date: v.cekilisTarihi })
},
sort: true,
filter: {
type: 'date',
range: true
}
})
}
if (!usersStore.isVakifDernek || usersStore.isPanelUser) {
header.push(
{
name: 'baslangicTarihi',
title: 'Başlangıç Tarihi',
compute: (v: Record<string, any>): string => {
if (v.baslangicTarihi.includes('0001-')) return ''
else return dateStore.dateFormat({ date: v.baslangicTarihi })
},
sort: true,
filter: {
type: 'date',
range: true
}
},
{
name: 'bitisTarihi',
title: 'Bitis Tarihi',
compute: (v: Record<string, any>): string => {
if (v.bitisTarihi.includes('0001-')) return ''
else return dateStore.dateFormat({ date: v.bitisTarihi })
},
sort: true,
filter: {
type: 'date',
range: true
}
}
)
}
header.push(
{
name: 'cekilisYontemi',
title: 'Çekiliş Yöntemi',
sort: true,
filter: {
type: 'select',
data: cekilisYontemleri.value,
listVal: 'id',
listText: 'deger',
filterId: 'cekilisYontemiId'
}
// 6. DURUM
header.push({
name: 'durum',
title: 'Durum',
style: { width: '10%' },
computeHtml: (v: Record<string, any>): string => {
return `<span class="${piyangoStore.LoterryStatusClass(v.durum)}">
${v.durum}
</span>`
},
{ name: 'ikramiyeler', title: 'İkramiyeler', style: { width: '15%' } },
{
name: 'durum',
title: 'Durum',
style: { width: '10%' },
computeHtml: (v: Record<string, any>): string => {
return `<span class="back-grad ${piyangoStore.LoterryStatusClass(v.durum)}">
${v.durum}
</span>`
},
filter: {
type: 'select',
data: piyangoOnayDurumlari.value,
listVal: 'id',
listText: 'tipAdi',
filterId: 'durumId'
}
},
{
name: 'atanmis',
title: 'Sevk Durumu',
computeHtml: (v: Record<string, any>): string => {
if (v.atanmis) {
return `<strong class="back-grad back-grad-sevk-ok">
${v.atananlar}
</strong>`
} else {
return `<span class="back-grad back-grad-sevk">
Sevk Edilmemiş</span>`
}
}
},
{
name: 'basvuruBedelNo',
title: 'Muhasebeleştirme Durumu',
computeHtml: (v: Record<string, any>): string => {
let durum = ''
if (v.basvuruBedelNo !== null) {
durum += `<strong">Başvuru Bedel No: </strong>
${v.basvuruBedelNo}<br>`
}
if (v.izinBedelNo !== null) {
durum += `<strong">İzin Bedel No: </strong>
${v.izinBedelNo}`
}
return durum
}
filter: {
type: 'select',
data: piyangoOnayDurumlari.value,
listVal: 'id',
listText: 'tipAdi',
filterId: 'durumId'
}
)
})
// 7. İZİN TARİHİ
header.push({
name: 'izinTarihi',
title: 'İzin Tarihi',
compute: (v: Record<string, any>): string => {
if (!v.izinTarihi || v.izinTarihi === null) return ''
return dateStore.dateFormat({ date: v.izinTarihi, pattern: 'dd-mm-yy', splitDate: '/' })
},
sort: true,
filter: {
type: 'date',
between: true
}
})
// 8. İZİN SAYISI
header.push({
name: 'izinSayisi',
title: 'İzin Sayısı',
compute: (v: Record<string, any>): string => {
return v.izinSayisi || ''
},
sort: true
})
// 9. BAŞLANGIÇ TARİHİ
header.push({
name: 'baslangicTarihi',
title: 'Başlangıç Tarihi',
compute: (v: Record<string, any>): string => {
if (!v.baslangicTarihi || v.baslangicTarihi.includes('0001-')) return ''
return dateStore.dateFormat({ date: v.baslangicTarihi, pattern: 'dd-mm-yy', splitDate: '/' })
},
sort: true,
filter: {
type: 'date',
between: true
}
})
// 10. BİTİŞ TARİHİ
header.push({
name: 'bitisTarihi',
title: 'Bitiş Tarihi',
compute: (v: Record<string, any>): string => {
if (!v.bitisTarihi || v.bitisTarihi.includes('0001-')) return ''
return dateStore.dateFormat({ date: v.bitisTarihi, pattern: 'dd-mm-yy', splitDate: '/' })
},
sort: true,
filter: {
type: 'date',
between: true
}
})
// 11. ÇEKİLİŞ TARİHİ
header.push({
name: 'cekilisTarihi',
title: 'Çekiliş Tarihi',
compute: (v: Record<string, any>): string => {
if (!v.cekilisTarihi || v.cekilisTarihi.includes('0001-')) return ''
if (v.piyangoAmacId === 3) return ''
return dateStore.dateFormat({ date: v.cekilisTarihi, pattern: 'dd-mm-yy', splitDate: '/' })
},
sort: true,
filter: {
type: 'date',
between: true
}
})
// 12. ÇEKİLİŞ GÖREVLİSİ
header.push({
name: 'cekilisGorevlisi',
title: 'Çekiliş Görevlisi',
compute: (v: Record<string, any>): string => {
return v.cekilisGorevlisi || ''
}
})
// 13. GAZETE İLAN TARİHİ
header.push({
name: 'gazeteIlanTarihi',
title: 'Gazete İlan Tarihi',
compute: (v: Record<string, any>): string => {
if (!v.gazeteIlanTarihi || v.gazeteIlanTarihi === null) return ''
return dateStore.dateFormat({ date: v.gazeteIlanTarihi, pattern: 'dd-mm-yy', splitDate: '/' })
},
sort: true,
filter: {
type: 'date',
between: true
}
})
// 14. GAZETE ADI
header.push({
name: 'gazeteAdi',
title: 'Gazete Adı',
compute: (v: Record<string, any>): string => {
return v.gazeteAdi || ''
}
})
// 15. İZİN BEDELİ
header.push({
name: 'izinBedeliTutari',
title: 'İzin Bedeli',
compute: (v: Record<string, any>): string => {
if (v.izinBedeliTutari === null || v.izinBedeliTutari === undefined) return ''
return globalStore.toTrLocale(v.izinBedeliTutari)
},
sort: true
})
// 16. İKRAMİYE TUTARI
header.push({
name: 'ikramiyeTutari',
title: 'İkramiye Tutarı',
compute: (v: Record<string, any>): string => {
if (v.ikramiyeTutari === null || v.ikramiyeTutari === undefined) return ''
return globalStore.toTrLocale(v.ikramiyeTutari)
},
sort: true
})
// 17. TEMİNAT TARİHİ
header.push({
name: 'teminatTarihi',
title: 'Teminat Tarihi',
compute: (v: Record<string, any>): string => {
if (!v.teminatTarihi || v.teminatTarihi === null) return ''
return dateStore.dateFormat({ date: v.teminatTarihi, pattern: 'dd-mm-yy', splitDate: '/' })
},
sort: true
})
// 18. TEMİNAT SAYISI
header.push({
name: 'teminatSayisi',
title: 'Teminat Sayısı',
compute: (v: Record<string, any>): string => {
return v.teminatSayisi || ''
},
sort: true
})
// 19. TEMİNAT BANKASI
header.push({
name: 'teminatBankasi',
title: 'Teminat Bankası',
compute: (v: Record<string, any>): string => {
return v.teminatBankasi || ''
}
})
// 20. TEMİNAT TUTARI
header.push({
name: 'teminatTutari',
title: 'Teminat Tutarı',
compute: (v: Record<string, any>): string => {
if (v.teminatTutari === null || v.teminatTutari === undefined) return ''
return globalStore.toTrLocale(v.teminatTutari)
},
sort: true
})
// 21. T. PARA CİNSİ
header.push({
name: 'paraBirimiSembol',
title: 'T. Para Cinsi',
compute: (v: Record<string, any>): string => {
return v.paraBirimiSembol || ''
}
})
// 22. T. İADE TARİHİ
header.push({
name: 'teminatIadeTarihi',
title: 'T. İade Tarihi',
compute: (v: Record<string, any>): string => {
if (!v.teminatIadeTarihi || v.teminatIadeTarihi === null) return ''
return dateStore.dateFormat({ date: v.teminatIadeTarihi, pattern: 'dd-mm-yy', splitDate: '/' })
},
sort: true
})
// 23. T. İADE SAYISI
header.push({
name: 'teminatIadeSayisi',
title: 'T. İade Sayısı',
compute: (v: Record<string, any>): string => {
return v.teminatIadeSayisi || ''
},
sort: true
})
// 24. İKRAMİYELER
header.push({
name: 'ikramiyeler',
title: 'İkramiyeler',
style: { width: '15%' },
compute: (v: Record<string, any>): string => {
return v.ikramiyeler || ''
}
})
return header
})

View File

@ -153,10 +153,7 @@
}
const loadSliders = async () => {
const data = await dataStore.dataGet('Slider')
console.log('apidata', data)
sliders.value = data
console.log(sliders.value)
}
const save = async () => {

View File

@ -86,7 +86,7 @@
sort: true,
filter: {
type: 'date',
range: true
between: true
}
},
{
@ -98,7 +98,7 @@
sort: true,
filter: {
type: 'date',
range: true
between: true
}
},
{
@ -110,7 +110,7 @@
sort: true,
filter: {
type: 'date',
range: true
between: true
}
},
{
@ -122,7 +122,7 @@
sort: true,
filter: {
type: 'date',
range: true
between: true
}
},
{
@ -143,7 +143,7 @@
title: 'Durum',
style: { width: '10%' },
computeHtml: (v: Record<string, any>): string => {
return `<span class='back-grad ${piyangoStore.LoterryStatusClass(v.durum)}'>
return `<span class='${piyangoStore.LoterryStatusClass(v.durum)}'>
${v.durum}
</span>`
},

View File

@ -66,7 +66,7 @@
},
filter: {
type: 'date',
range: true
between: true
},
style: { width: '10%' }
},

View File

@ -51,12 +51,12 @@
sort: true,
filter: {
type: 'date',
range: true
between: true
},
style:{width:'15%'}
},
{
name: 'kisiAdi',
name: 'email',
title: 'Kişi',
sort: true,
style:{width:'20%'}

View File

@ -7,6 +7,9 @@
<template #kisi-kurum-bilgileri>
<tab-yetkili-uye-bilgileri />
</template>
<template #piyangolar>
<tab-uye-piyangolar />
</template>
<template #onay-durumu>
<tab-uye-onay-durumu v-if="usersStore.isPanelUser" />
<tab-uye-onay-durumu-user v-else />
@ -25,6 +28,7 @@
import AdminLayout from '@/layouts/AdminLayout.vue'
import TabYetkiliUyeBilgileri from '../components/TabYetkiliUyeBilgileri.vue'
import TabUyePiyangolar from '../components/TabUyePiyangolar.vue'
import TabUyeOnayDurumu from '../components/TabUyeOnayDurumu.vue'
import TabUyeOnayDurumuUser from '../components/TabUyeOnayDurumuUser.vue'
@ -32,6 +36,11 @@
const tabList = ref<Record<string, any>[]>([
{ text: 'Kişi/Kurum Bilgileri', id: 'kisi-kurum-bilgileri' }
])
if (usersStore.isPanelUser || usersStore.isAraciFirma) {
tabList.value.push({ text: 'Piyangolar', id: 'piyangolar' })
}
tabList.value.push({ text: 'Onay Durumu', id: 'onay-durumu' })
onBeforeMount(async () => {

View File

@ -63,7 +63,7 @@
},
filter: {
type: 'date',
range: true
between: true
},
style: { width: '10%' }
},

View File

@ -35,20 +35,21 @@ export const useDataStore = defineStore('dataStore', () => {
if (data.data !== undefined) sendData.data = data.data
if (data.params !== undefined) sendData.params = data.params
if (data.headers !== undefined) sendData.headers = data.headers
if (data.toast !== undefined) {
toastStore.AddToast(data.toast.toast, data.toast.type, data.toast.timeout)
}
const response = await axios.get(apiBase.value + api, sendData)
console.log('response --', api, response)
if (data.toast !== undefined) {
toastStore.AddToast(data.toast.toast, data.toast.type, data.toast.timeout)
}
if (data.full !== undefined && data.full) {
return response
} else {
return response.data
}
} catch (error: any) {
CheckApiError(error.response.status, error.response.data)
CheckApiError(error.response?.status, error.response?.data)
console.error('Hata oluştu -:', error)
return 'errorfalse'
}
@ -63,6 +64,8 @@ export const useDataStore = defineStore('dataStore', () => {
options?: Record<string, any>
toast?: Record<string, any>
full?: boolean
/** Bu status kodları için CheckApiError atlanır, hata objesi döner */
skipErrorForStatuses?: number[]
} = {}
): Promise<any> => {
try {
@ -72,20 +75,24 @@ export const useDataStore = defineStore('dataStore', () => {
if (data.options !== undefined) Object.assign(sendData, data.options)
if (data.params !== undefined) sendData.params = data.params
if (data.headers !== undefined) sendData.headers = data.headers
const response = await axios.post(apiBase.value + api, postData, sendData)
if (data.toast !== undefined) {
toastStore.AddToast(data.toast.toast, data.toast.type, data.toast.timeout)
}
const response = await axios.post(apiBase.value + api, postData, sendData)
if (data.full !== undefined && data.full) {
return response
} else {
return response.data
}
} catch (error: any) {
CheckApiError(error.response.status, error.response.data)
const status = error.response?.status
if (data.skipErrorForStatuses?.includes(status)) {
return { _error: true, status, data: error.response?.data }
}
CheckApiError(status, error.response?.data)
console.error('Hata oluştu:', error)
return Promise.resolve('errorfalse')
}
@ -109,19 +116,20 @@ export const useDataStore = defineStore('dataStore', () => {
if (data.options !== undefined) Object.assign(sendData, data.options)
if (data.params !== undefined) sendData.params = data.params
if (data.headers !== undefined) sendData.headers = data.headers
const response = await axios.put(apiBase.value + api, postData, sendData)
if (data.toast !== undefined) {
toastStore.AddToast(data.toast.toast, data.toast.type, data.toast.timeout)
}
const response = await axios.put(apiBase.value + api, postData, sendData)
if (data.full !== undefined && data.full) {
return response
} else {
return response.data
}
} catch (error: any) {
CheckApiError(error.response.status, error.response.data)
CheckApiError(error.response?.status, error.response?.data)
console.error('Hata oluştu:', error)
return Promise.resolve('errorfalse')
}
@ -144,27 +152,33 @@ export const useDataStore = defineStore('dataStore', () => {
if (data.options !== undefined) Object.assign(sendData, data.options)
if (data.params !== undefined) sendData.params = data.params
if (data.headers !== undefined) sendData.headers = data.headers
const response = await axios.delete(apiBase.value + api, sendData)
if (data.toast !== undefined) {
toastStore.AddToast(data.toast.toast, data.toast.type, data.toast.timeout)
}
const response = await axios.delete(apiBase.value + api, sendData)
if (data.full !== undefined && data.full) {
return response
} else {
return response.data
}
} catch (error: any) {
CheckApiError(error.response.status, error.response.data)
CheckApiError(error.response?.status, error.response?.data)
console.error('Hata oluştu:', error)
return Promise.resolve('errorfalse')
}
}
const CheckApiError = async (status: number, data: Record<string, any>) => {
const CheckApiError = (status?: number, data?: Record<string, any>) => {
if (status === undefined) {
toastStore.AddToast("Bağlantı hatası. İnternet bağlantınızı kontrol edin.", "alert", 8000);
return;
}
if (status === 401) return; // Axios interceptor login'e yönlendirir
if (status === 400) {
const errorKey = typeof data === "string" ? data : data?.hata || data?.errors;
if (errorKey !== undefined) {
if (Array.isArray(errorKey)) {
errorKey.forEach((el: string) => {
@ -178,7 +192,19 @@ export const useDataStore = defineStore('dataStore', () => {
} else {
toastStore.AddToast("Bir hata oluştu.", "alert");
}
return;
}
const httpErrorMessages: Record<number, string> = {
413: "Dosya boyutu çok büyük. Lütfen daha küçük bir dosya yükleyin veya sunucu limitlerini kontrol edin.",
404: "İstenen kaynak bulunamadı.",
500: "Sunucu hatası oluştu. Lütfen daha sonra tekrar deneyin.",
502: "Sunucu geçici olarak yanıt vermiyor. Lütfen daha sonra tekrar deneyin.",
503: "Servis şu an kullanılamıyor. Lütfen daha sonra tekrar deneyin.",
504: "İstek zaman aşımına uğradı. Lütfen tekrar deneyin.",
408: "İstek zaman aşımına uğradı. Lütfen tekrar deneyin."
};
const message = httpErrorMessages[status] || `Beklenmeyen hata (${status}). Lütfen tekrar deneyin.`;
toastStore.AddToast(message, "alert", 8000);
};
const GetCustomerTipList = async () => {

View File

@ -1,6 +1,6 @@
{
"extends": "@vue/tsconfig/tsconfig.dom.json",
"include": ["env.d.ts", "src/**/*", "src/**/*.vue"],
"include": ["env.d.ts", "src/**/*", "src/**/*.vue", "Configs.ts"],
"exclude": ["src/**/__tests__/*"],
"compilerOptions": {
"composite": true,

View File

@ -1,11 +1,12 @@
{
"extends": "@tsconfig/node20/tsconfig.json",
"extends": "./tsconfig.json",
"include": [
"vite.config.*",
"vitest.config.*",
"cypress.config.*",
"nightwatch.conf.*",
"playwright.config.*"
"playwright.config.*",
"Configs.ts"
],
"compilerOptions": {
"composite": true,

View File

@ -3,6 +3,7 @@ import { fileURLToPath, URL } from 'node:url'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import vueJsx from '@vitejs/plugin-vue-jsx'
import { SetTemplateGroup } from './Configs.js'
// https://vitejs.dev/config/
export default defineConfig({
@ -23,5 +24,46 @@ export default defineConfig({
},
esbuild: {
drop: process.env.NODE_ENV === 'production' ? ['console', 'debugger'] : []
},
build: {
rollupOptions: {
output: {
manualChunks(id) {
if (id.includes('/src/')) {
const group = SetTemplateGroup(id)
if (group) return `grp_${group}` // group files
}
// jquery files
if (id.includes('node_modules/jquery')) return 'ven_jquery'
if (id.includes('node_modules/summernote')) return 'ven_summer'
if (id.includes('node_modules/pdfmake')) return 'ven_pdfmake'
if (id.includes('node_modules/html-to-pdfmake')) return 'ven_pdfmake'
if (id.includes('node_modules/vue3-pdfmake')) return 'ven_pdfmake'
// other node_modules files
if (id.includes('node_modules')) return 'vendor'
},
assetFileNames: (assetInfo) => {
const name = assetInfo.names?.[0] || assetInfo.name || ''
if (name.endsWith('.css')) {
return 'static/css/[name]-[hash][extname]'
}
if (/\.(png|jpe?g|svg|gif|webp|ico)$/i.test(name)) {
return 'static/images/[name]-[hash][extname]'
}
if (/\.(ttf|woff2?|eot|otf)$/i.test(name)) {
return 'static/fonts/[name]-[hash][extname]'
}
return 'static/[name]-[hash][extname]'
},
chunkFileNames: (chunkInfo) => {
if (chunkInfo.name?.startsWith('grp_')) return 'static/js/[name]-[hash].js'
return 'static/js/[name]-[hash].js'
},
entryFileNames: 'static/js/[name]-[hash].js'
}
}
}
})