Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -1650,7 +1650,6 @@ async function printVisibleRows () {
|
||||
const stamp = exportFileStamp()
|
||||
const title = `Fiyat_Listesi-${stamp}`
|
||||
const cols = visibleColumns.value
|
||||
const pageSize = cols.length > 34 ? 'A0 landscape' : cols.length > 26 ? 'A1 landscape' : cols.length > 18 ? 'A2 landscape' : 'A3 landscape'
|
||||
const generatedAt = new Date().toLocaleString('tr-TR')
|
||||
const body = filteredRows.value.map((row) => `<tr>${cols.map((c) => {
|
||||
if (c.name === 'image') {
|
||||
@@ -1669,29 +1668,29 @@ async function printVisibleRows () {
|
||||
const headerCols = cols.map((c) => `<th>${escapeHtml(c.label || 'Gorsel')}</th>`).join('')
|
||||
const colgroup = cols.map((c) => `<col style="width:${printColumnWidthMm(c)}mm;min-width:${printColumnWidthMm(c)}mm;">`).join('')
|
||||
const html = `<!doctype html><html><head><meta charset="utf-8"><title>${escapeHtml(title)}</title><style>
|
||||
@page { size: ${pageSize}; margin: 8mm; }
|
||||
@page { size: A4 landscape; margin: 7mm; }
|
||||
* { box-sizing: border-box; }
|
||||
body { font-family: Arial, sans-serif; color: #172033; font-size: 10px; margin: 0; }
|
||||
body { font-family: Arial, sans-serif; color: #172033; font-size: 7.5px; margin: 0; }
|
||||
table { border-collapse: collapse; width: auto; min-width: 100%; table-layout: fixed; }
|
||||
thead { display: table-header-group; }
|
||||
tfoot { display: table-footer-group; }
|
||||
tr { page-break-inside: avoid; break-inside: avoid; }
|
||||
th, td { border: 1px solid #cfd6df; padding: 5px 4px; vertical-align: middle; overflow-wrap: anywhere; word-break: break-word; }
|
||||
th { background: #957116; color: #fff; text-align: center; font-weight: 800; line-height: 1.18; font-size: 10px; }
|
||||
.report-title th { background: #fff; color: #172033; border: 0; padding: 0 0 6px; text-align: left; }
|
||||
.title-main { font-size: 18px; font-weight: 800; color: #957116; }
|
||||
.title-meta { font-size: 10px; color: #56616f; margin-top: 3px; }
|
||||
td { background: #fff; line-height: 1.22; min-height: 28px; }
|
||||
th, td { border: 1px solid #cfd6df; padding: 2px 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; }
|
||||
.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-meta { font-size: 7.5px; color: #56616f; margin-top: 2px; }
|
||||
td { background: #fff; line-height: 1.16; min-height: 20px; }
|
||||
.num, .price { text-align: right; font-weight: 700; white-space: nowrap; }
|
||||
.campaign-price { background: #eef7ee; color: #0f6b2f; font-weight: 800; }
|
||||
.wrap { white-space: normal; font-size: 9px; line-height: 1.15; }
|
||||
.img-cell { text-align: center; padding: 3px; }
|
||||
.thumb { width: 28mm; height: 28mm; object-fit: contain; display: block; margin: 0 auto; }
|
||||
.wrap { white-space: normal; font-size: 7px; line-height: 1.1; }
|
||||
.img-cell { text-align: center; padding: 2px; }
|
||||
.thumb { width: 18mm; height: 18mm; object-fit: contain; display: block; margin: 0 auto; }
|
||||
.page-footer {
|
||||
position: fixed;
|
||||
right: 8mm;
|
||||
bottom: 3mm;
|
||||
font-size: 9px;
|
||||
font-size: 7.5px;
|
||||
color: #56616f;
|
||||
}
|
||||
.page-footer::after {
|
||||
@@ -1743,17 +1742,19 @@ async function printVisibleRows () {
|
||||
}
|
||||
|
||||
function printColumnWidthMm (col) {
|
||||
if (!col) return 24
|
||||
if (col.name === 'image') return 34
|
||||
if (col.name === 'productCode') return 36
|
||||
if (col.name === 'variantCodes') return 24
|
||||
if (col.name === 'variantStocks') return 18
|
||||
if (col.name === 'campaignLabel') return 34
|
||||
if (col.name === 'campaignRate') return 18
|
||||
if (col.name === 'icerik') return 34
|
||||
if (col.name === 'karisim') return 40
|
||||
if (priceColumnNames.includes(col.name)) return col.name.endsWith('Campaign') ? 27 : 24
|
||||
return Math.max(20, Math.min(34, Math.round(extractWidth(col.style) * 0.28)))
|
||||
if (!col) return 16
|
||||
if (col.name === 'image') return 22
|
||||
if (col.name === 'brandGroupSelection') return 20
|
||||
if (col.name === 'marka') return 17
|
||||
if (col.name === 'productCode') return 28
|
||||
if (col.name === 'variantCodes') return 18
|
||||
if (col.name === 'variantStocks') return 12
|
||||
if (col.name === 'campaignLabel') return 24
|
||||
if (col.name === 'campaignRate') return 12
|
||||
if (col.name === 'icerik') return 24
|
||||
if (col.name === 'karisim') return 26
|
||||
if (priceColumnNames.includes(col.name)) return col.name.endsWith('Campaign') ? 18 : 17
|
||||
return Math.max(12, Math.min(22, Math.round(extractWidth(col.style) * 0.22)))
|
||||
}
|
||||
|
||||
async function notifyExportTaken (format) {
|
||||
|
||||
Reference in New Issue
Block a user