fix : repeat (f ) is working
This commit is contained in:
parent
213945b2e9
commit
594bd4ae77
@ -1101,6 +1101,8 @@ printTicket() {
|
||||
}
|
||||
const barcodeId = `1111${day}${month}${year}${timeStr}${millis}`;
|
||||
|
||||
|
||||
//----------------------------------------WINLABELS START HERE ------------------------------------------------------
|
||||
|
||||
const winLabels = allRows.map(row => {
|
||||
let displayNumbers = row.numbers;
|
||||
@ -1138,11 +1140,25 @@ const winLabels = allRows.map(row => {
|
||||
let expandedLegs: string[] = legs.map((leg, i) => {
|
||||
// Find race index for this leg
|
||||
let raceIdx = raceIndices.length > i ? raceIndices[i] - 1 : (baseRaceIdx - 1 + i);
|
||||
let expanded = leg.flatMap(n =>
|
||||
n === 'F'
|
||||
? this.getHorseNumbersForRaceIdx(raceIdx).map(num => num.toString())
|
||||
: [n]
|
||||
);
|
||||
// let expanded = leg.flatMap(n =>
|
||||
// n === 'F'
|
||||
// ? this.getHorseNumbersForRaceIdx(raceIdx).map(num => num.toString())
|
||||
// : [n]
|
||||
// );
|
||||
let expanded = leg.flatMap((n, idx) => {
|
||||
if (n === 'F') {
|
||||
const horses = this.getHorseNumbersForRaceIdx(raceIdx).map(num => num.toString()).join(',');
|
||||
const isFirst = idx === 0;
|
||||
const isLast = idx === leg.length - 1;
|
||||
if (isFirst && !isLast) return [`${horses}-`];
|
||||
if (!isFirst && isLast) return [`-${horses}`];
|
||||
if (isFirst && isLast) return [horses]; // only F in the leg
|
||||
return [`-${horses}-`];
|
||||
}
|
||||
return [n];
|
||||
});
|
||||
|
||||
|
||||
// Remove '-' and '#' for display
|
||||
return expanded.filter(n => n !== '-' && n !== '#').join(',');
|
||||
});
|
||||
@ -1158,9 +1174,22 @@ const winLabels = allRows.map(row => {
|
||||
|
||||
// 🐎 Expand 'F' to full horse numbers for other pools
|
||||
if (displayNumbers.includes('F')) {
|
||||
displayNumbers = displayNumbers.flatMap(n =>
|
||||
n === 'F' ? this.getHorseNumbersForSelectedRace().map(num => num.toString()) : [n]
|
||||
);
|
||||
// displayNumbers = displayNumbers.flatMap(n =>
|
||||
// n === 'F' ? this.getHorseNumbersForSelectedRace().map(num => num.toString()) : [n]
|
||||
// );
|
||||
displayNumbers = displayNumbers.flatMap((n, idx, arr) => {
|
||||
if (n === 'F') {
|
||||
const horses = this.getHorseNumbersForSelectedRace().map(num => num.toString()).join(',');
|
||||
const isFirst = idx === 0;
|
||||
const isLast = idx === arr.length - 1;
|
||||
if (isFirst && !isLast) return [`${horses}-`];
|
||||
if (!isFirst && isLast) return [`-${horses}`];
|
||||
if (isFirst && isLast) return [horses]; // only F
|
||||
return [`-${horses}-`];
|
||||
}
|
||||
return [n];
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
let numbersStr = '';
|
||||
@ -1186,7 +1215,7 @@ const winLabels = allRows.map(row => {
|
||||
}).join('\n');
|
||||
|
||||
|
||||
//------------------------------------EIN LABELS ENDS HERE --------------------------------
|
||||
//------------------------------------WIN LABELS ENDS HERE --------------------------------
|
||||
|
||||
// ✅ Print preview
|
||||
const printData = {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user