feat: 최근 전투, 전투(전/승/살상률) 추가
This commit is contained in:
@@ -347,7 +347,8 @@ type headerType =
|
||||
| "specials"
|
||||
| "reservedCommandShort"
|
||||
| "killturnAndConnect"
|
||||
| "years";
|
||||
| "years"
|
||||
| "warResults";
|
||||
interface GenValueParams extends BaseWithValueColDefParams {
|
||||
data: GeneralListItem;
|
||||
}
|
||||
@@ -578,7 +579,7 @@ const columnRawDefs = ref<Partial<Record<headerType, GenColDef | GenColGroupDef>
|
||||
sortable: true,
|
||||
comparator: (a, b, c, d) => c.data.officerLevel - d.data.officerLevel,
|
||||
cellRenderer: ({ data }: GenValueParams) => {
|
||||
if(data.officerLevel >= 5){
|
||||
if (data.officerLevel >= 5) {
|
||||
return `<span style="color:cyan;">${data.officerLevelText}</span>`;
|
||||
}
|
||||
if (data.st2 && 2 <= data.officerLevel && data.officerLevel <= 4) {
|
||||
@@ -1010,6 +1011,21 @@ const columnRawDefs = ref<Partial<Record<headerType, GenColDef | GenColGroupDef>
|
||||
sortable: true,
|
||||
cellClass: centerCellClass,
|
||||
},
|
||||
recent_war: {
|
||||
colId: "recent_war",
|
||||
headerName: "최근전투",
|
||||
field: "recent_war",
|
||||
width: 60,
|
||||
valueFormatter: ({ value, data }) => {
|
||||
if (!data.st2) {
|
||||
return "?";
|
||||
}
|
||||
const turntime = value as string;
|
||||
return turntime.substring(14, 19);
|
||||
},
|
||||
sortable: true,
|
||||
cellClass: centerCellClass,
|
||||
},
|
||||
years: {
|
||||
groupId: "years",
|
||||
headerName: "연도",
|
||||
@@ -1084,6 +1100,60 @@ const columnRawDefs = ref<Partial<Record<headerType, GenColDef | GenColGroupDef>
|
||||
},
|
||||
],
|
||||
},
|
||||
warResults: {
|
||||
groupId: "warResults",
|
||||
headerName: "전과",
|
||||
children: [
|
||||
{
|
||||
colId: "warResults",
|
||||
headerName: "요약",
|
||||
cellRenderer: ({ data }: GenValueParams) => {
|
||||
if (!data.st2) {
|
||||
return "?";
|
||||
}
|
||||
const killRatePercent = Math.round((data.killcrew / Math.max(1, data.deathcrew)) * 100);
|
||||
return `${data.warnum.toLocaleString()}전 ${data.killnum.toLocaleString()}승<br>살상: ${killRatePercent}%`;
|
||||
},
|
||||
cellClass: centerCellClass,
|
||||
columnGroupShow: "closed",
|
||||
width: 90,
|
||||
},
|
||||
{
|
||||
colId: "warnum",
|
||||
headerName: "전투",
|
||||
field: "warnum",
|
||||
...sortableNumber,
|
||||
valueFormatter: numberFormatter("전"),
|
||||
columnGroupShow: "open",
|
||||
width: 60,
|
||||
},
|
||||
{
|
||||
colId: "killnum",
|
||||
headerName: "승리",
|
||||
field: "killnum",
|
||||
...sortableNumber,
|
||||
valueFormatter: numberFormatter("승"),
|
||||
columnGroupShow: "open",
|
||||
width: 60,
|
||||
},
|
||||
{
|
||||
colId: "killcrew",
|
||||
headerName: "살상률",
|
||||
field: "killcrew",
|
||||
...sortableNumber,
|
||||
valueGetter: ({ data }) => {
|
||||
if (!data.st2) {
|
||||
return "?";
|
||||
}
|
||||
const killRatePercent = Math.round((data.killcrew / Math.max(1, data.deathcrew)) * 100);
|
||||
return killRatePercent
|
||||
},
|
||||
valueFormatter: numberFormatter("%"),
|
||||
columnGroupShow: "open",
|
||||
width: 60,
|
||||
},
|
||||
],
|
||||
},
|
||||
});
|
||||
const columnDefs = ref([...Object.values(columnRawDefs.value)]);
|
||||
watch(columnRawDefs, (val) => {
|
||||
|
||||
Reference in New Issue
Block a user