Commit 521b3b81 authored by xiaoye's avatar xiaoye

Merge branch 'main' of https://code.moenext.com/mycard/tabulator-another-web into mycard-git

parents d40d3c04 c97bad9d
Pipeline #38197 passed with stages
in 2 minutes and 14 seconds
...@@ -487,9 +487,9 @@ ...@@ -487,9 +487,9 @@
match.array.filter(i => i.round == round).forEach((i, v) => { match.array.filter(i => i.round == round).forEach((i, v) => {
if (i.player1.id || i.player2.id) { if (i.player1.id || i.player2.id) {
string += `[${v + 1}]组\n`; string += `[${v + 1}]组\n`;
string += `\t[选手A][${i.player1.name ?? ''}]\n`; string += `\t[选手A][${i.player1.fullName ?? ''}]\n`;
string += `\t[比 分][${i.status == 'Finished' ? `${i.player1.score} : ${i.player2.score}` : 'VS'}]\n`; string += `\t[比 分][${i.status == 'Finished' ? `${i.player1.score} : ${i.player2.score}` : 'VS'}]\n`;
string += `\t[选手B][${i.player2.name ?? ''}]\n`; string += `\t[选手B][${i.player2.fullName ?? ''}]\n`;
} }
}); });
} }
...@@ -666,7 +666,7 @@ ...@@ -666,7 +666,7 @@
]); ]);
for (let i = 0; i < copyValue; i++) { for (let i = 0; i < copyValue; i++) {
let p = participant.array[i]; let p = participant.array[i];
string += `[${map.get(i) ?? `${i + 1}名`}]${p.name}\n` string += `[${map.get(i) ?? `${i + 1}名`}]${p.fullName}\n`
} }
UniApp.copy(string); UniApp.copy(string);
}, },
...@@ -799,4 +799,4 @@ ...@@ -799,4 +799,4 @@
<style scoped lang = 'scss'> <style scoped lang = 'scss'>
@import '../style/tournament.scss'; @import '../style/tournament.scss';
@import '../style/transition.scss'; @import '../style/transition.scss';
</style> </style>
\ No newline at end of file
...@@ -5,6 +5,7 @@ interface player { ...@@ -5,6 +5,7 @@ interface player {
id : number; id : number;
score : number; score : number;
name : string; name : string;
fullName : string;
} }
class Match { class Match {
...@@ -24,16 +25,18 @@ class Match { ...@@ -24,16 +25,18 @@ class Match {
this.round = obj.round; this.round = obj.round;
this.isThirdPlaceMatch = obj.isThirdPlaceMatch; this.isThirdPlaceMatch = obj.isThirdPlaceMatch;
this.status = obj.status; this.status = obj.status;
const name1 = obj.player1?.name.split('+') ?? []; const name1 = obj.player1?.name.split(/[\+\uFF0B]/) ?? [];
this.player1 = { this.player1 = {
id : obj.player1Id, id : obj.player1Id,
name : (name1.length == 2 && !Number.isNaN(name1[0]) && name1[0].length > 3) ? name1[1] : obj.player1?.name ?? '', name : (name1.length == 2 && !Number.isNaN(name1[0]) && name1[0].length > 3) ? name1[1] : obj.player1?.name ?? '',
fullName : obj.player1?.name ?? '',
score : obj.player1Score score : obj.player1Score
}; };
const name2 = obj.player2?.name.split('+') ?? []; const name2 = obj.player2?.name.split(/[\+\uFF0B]/) ?? [];
this.player2 = { this.player2 = {
id : obj.player2Id, id : obj.player2Id,
name : (name2.length == 2 && !Number.isNaN(name2[0]) && name2[0].length > 3) ? name2[1] : obj.player2?.name ?? '', name : (name2.length == 2 && !Number.isNaN(name2[0]) && name2[0].length > 3) ? name2[1] : obj.player2?.name ?? '',
fullName : obj.player2?.name ?? '',
score : obj.player2Score score : obj.player2Score
}; };
this.winnerId = obj.winnerId as number | null; this.winnerId = obj.winnerId as number | null;
...@@ -42,4 +45,4 @@ class Match { ...@@ -42,4 +45,4 @@ class Match {
} }
export default Match; export default Match;
\ No newline at end of file
...@@ -5,6 +5,7 @@ import { Base64 } from 'js-base64'; ...@@ -5,6 +5,7 @@ import { Base64 } from 'js-base64';
class Participant { class Participant {
id : number; id : number;
name : string; name : string;
fullName : string;
quit : boolean; quit : boolean;
tournamentId : number; tournamentId : number;
score : Score; score : Score;
...@@ -12,7 +13,8 @@ class Participant { ...@@ -12,7 +13,8 @@ class Participant {
deck : YGOProDeck | undefined; deck : YGOProDeck | undefined;
constructor(obj: ParticipantObject) { constructor(obj: ParticipantObject) {
const name = obj.name.split('+'); this.fullName = obj.name;
const name = obj.name.split(/[\+\uFF0B]/);
this.name = (name.length == 2 && !Number.isNaN(name[0]) && name[0].length > 3) ? name[1] : obj.name; this.name = (name.length == 2 && !Number.isNaN(name[0]) && name[0].length > 3) ? name[1] : obj.name;
this.tournamentId = obj.tournamentId; this.tournamentId = obj.tournamentId;
this.id = obj.id; this.id = obj.id;
...@@ -43,4 +45,4 @@ class Participant { ...@@ -43,4 +45,4 @@ class Participant {
} }
} }
export default Participant; export default Participant;
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment