Merge remote-tracking branch 'origin/master'

This commit is contained in:
M_Kececi
2026-06-20 01:26:15 +03:00
parent 5167c30907
commit 5c9928c736

View File

@@ -1479,6 +1479,13 @@ const visibleColumns = computed(() => allColumns.filter((c) => {
return true return true
})) }))
const printColumns = computed(() => allColumns.filter((c) => {
if (compactLeftColumnNameSet.has(c.name)) return true
if (/^(usd|eur|try)[1-6]$/.test(c.name)) return selectedPriceSet.value.has(c.name)
if (/^(usd|eur|try)[1-6]Campaign$/.test(c.name)) return selectedPriceSet.value.has(c.name.replace(/Campaign$/, ''))
return false
}))
const filteredRows = computed(() => { const filteredRows = computed(() => {
const campaignSet = selectedCampaignLabelSet.value const campaignSet = selectedCampaignLabelSet.value
const variantSet = selectedVariantCodeSet.value const variantSet = selectedVariantCodeSet.value
@@ -1649,7 +1656,7 @@ function exportFileStamp () {
async function printVisibleRows () { async function printVisibleRows () {
const stamp = exportFileStamp() const stamp = exportFileStamp()
const title = `Fiyat_Listesi-${stamp}` const title = `Fiyat_Listesi-${stamp}`
const cols = visibleColumns.value const cols = printColumns.value
const generatedAt = new Date().toLocaleString('tr-TR') const generatedAt = new Date().toLocaleString('tr-TR')
const body = filteredRows.value.map((row) => `<tr>${cols.map((c) => { const body = filteredRows.value.map((row) => `<tr>${cols.map((c) => {
if (c.name === 'image') { if (c.name === 'image') {
@@ -1670,27 +1677,27 @@ async function printVisibleRows () {
const html = `<!doctype html><html><head><meta charset="utf-8"><title>${escapeHtml(title)}</title><style> const html = `<!doctype html><html><head><meta charset="utf-8"><title>${escapeHtml(title)}</title><style>
@page { size: A4 landscape; margin: 7mm; } @page { size: A4 landscape; margin: 7mm; }
* { box-sizing: border-box; } * { box-sizing: border-box; }
body { font-family: Arial, sans-serif; color: #172033; font-size: 7.5px; margin: 0; } body { font-family: Arial, sans-serif; color: #172033; font-size: 8.5px; margin: 0; }
table { border-collapse: collapse; width: auto; min-width: 100%; table-layout: fixed; } table { border-collapse: collapse; width: 100%; table-layout: fixed; }
thead { display: table-header-group; } thead { display: table-header-group; }
tfoot { display: table-footer-group; } tfoot { display: table-footer-group; }
tr { page-break-inside: avoid; break-inside: avoid; } tr { page-break-inside: avoid; break-inside: avoid; }
th, td { border: 1px solid #cfd6df; padding: 2px 2px; vertical-align: middle; overflow-wrap: anywhere; word-break: break-word; } th, td { border: 1px solid #cfd6df; padding: 3px 2px; vertical-align: middle; overflow-wrap: anywhere; word-break: break-word; }
th { background: #957116; color: #fff; text-align: center; font-weight: 800; line-height: 1.12; font-size: 7.5px; } th { background: #957116; color: #fff; text-align: center; font-weight: 800; line-height: 1.12; font-size: 8px; }
.report-title th { background: #fff; color: #172033; border: 0; padding: 0 0 4px; text-align: left; } .report-title th { background: #fff; color: #172033; border: 0; padding: 0 0 4px; text-align: left; }
.title-main { font-size: 13px; font-weight: 800; color: #957116; } .title-main { font-size: 14px; font-weight: 800; color: #957116; }
.title-meta { font-size: 7.5px; color: #56616f; margin-top: 2px; } .title-meta { font-size: 8px; color: #56616f; margin-top: 2px; }
td { background: #fff; line-height: 1.16; min-height: 20px; } td { background: #fff; line-height: 1.18; min-height: 24px; }
.num, .price { text-align: right; font-weight: 700; white-space: nowrap; } .num, .price { text-align: right; font-weight: 700; white-space: nowrap; }
.campaign-price { background: #eef7ee; color: #0f6b2f; font-weight: 800; } .campaign-price { background: #eef7ee; color: #0f6b2f; font-weight: 800; }
.wrap { white-space: normal; font-size: 7px; line-height: 1.1; } .wrap { white-space: normal; font-size: 8px; line-height: 1.12; }
.img-cell { text-align: center; padding: 2px; } .img-cell { text-align: center; padding: 2px; }
.thumb { width: 18mm; height: 18mm; object-fit: contain; display: block; margin: 0 auto; } .thumb { width: 24mm; height: 24mm; object-fit: contain; display: block; margin: 0 auto; }
.page-footer { .page-footer {
position: fixed; position: fixed;
right: 8mm; right: 8mm;
bottom: 3mm; bottom: 3mm;
font-size: 7.5px; font-size: 8px;
color: #56616f; color: #56616f;
} }
.page-footer::after { .page-footer::after {
@@ -1743,17 +1750,17 @@ async function printVisibleRows () {
function printColumnWidthMm (col) { function printColumnWidthMm (col) {
if (!col) return 16 if (!col) return 16
if (col.name === 'image') return 22 if (col.name === 'image') return 30
if (col.name === 'brandGroupSelection') return 20 if (col.name === 'brandGroupSelection') return 18
if (col.name === 'marka') return 17 if (col.name === 'marka') return 15
if (col.name === 'productCode') return 28 if (col.name === 'productCode') return 27
if (col.name === 'variantCodes') return 18 if (col.name === 'variantCodes') return 17
if (col.name === 'variantStocks') return 12 if (col.name === 'variantStocks') return 12
if (col.name === 'campaignLabel') return 24 if (col.name === 'campaignLabel') return 22
if (col.name === 'campaignRate') return 12 if (col.name === 'campaignRate') return 12
if (col.name === 'icerik') return 24 if (col.name === 'icerik') return 24
if (col.name === 'karisim') return 26 if (col.name === 'karisim') return 26
if (priceColumnNames.includes(col.name)) return col.name.endsWith('Campaign') ? 18 : 17 if (priceColumnNames.includes(col.name)) return col.name.endsWith('Campaign') ? 18 : 16
return Math.max(12, Math.min(22, Math.round(extractWidth(col.style) * 0.22))) return Math.max(12, Math.min(22, Math.round(extractWidth(col.style) * 0.22)))
} }