diff --git a/ui/src/pages/ProductSeriesDefinitions.vue b/ui/src/pages/ProductSeriesDefinitions.vue
index ba4d388..a6848c4 100644
--- a/ui/src/pages/ProductSeriesDefinitions.vue
+++ b/ui/src/pages/ProductSeriesDefinitions.vue
@@ -6,6 +6,7 @@
Seri kodu ve beden seri basliklari burada yonetilir.
+
@@ -191,5 +192,65 @@ function removeRow (row) {
})
}
+function escapeHtml (value) {
+ return String(value ?? '')
+ .replaceAll('&', '&')
+ .replaceAll('<', '<')
+ .replaceAll('>', '>')
+ .replaceAll('"', '"')
+ .replaceAll("'", ''')
+}
+
+function exportExcel () {
+ const headers = [
+ 'ID',
+ 'Seri Kodu',
+ 'Seri Basligi',
+ 'Aktif',
+ 'Parent Filter',
+ 'Sira',
+ 'Not'
+ ]
+ const headerHtml = headers.map(h => `${escapeHtml(h)} | `).join('')
+ const rowsHtml = rows.value.map(row => `
+
+ | ${escapeHtml(row.id)} |
+ ${escapeHtml(row.code)} |
+ ${escapeHtml(row.title)} |
+ ${escapeHtml(row.is_active ? 'Evet' : 'Hayir')} |
+ ${escapeHtml(row.parent_filter)} |
+ ${escapeHtml(row.sort_order)} |
+ ${escapeHtml(row.notes)} |
+
+ `).join('')
+ const html = `
+
+
+
+
+
+
+
+ ${headerHtml}
+ ${rowsHtml}
+
+
+`
+ const blob = new Blob([html], { type: 'application/vnd.ms-excel;charset=utf-8' })
+ const url = URL.createObjectURL(blob)
+ const link = document.createElement('a')
+ const stamp = new Date().toISOString().slice(0, 10).replaceAll('-', '')
+ link.href = url
+ link.download = `urun_seri_tanimlari_${stamp}.xls`
+ document.body.appendChild(link)
+ link.click()
+ link.remove()
+ URL.revokeObjectURL(url)
+}
+
onMounted(reload)