feat: 최근 전투, 전투(전/승/살상률) 추가
This commit is contained in:
@@ -66,6 +66,7 @@ class GeneralList extends \sammo\BaseAPI
|
|||||||
'weapon' => 2,
|
'weapon' => 2,
|
||||||
'book' => 2,
|
'book' => 2,
|
||||||
'item' => 2,
|
'item' => 2,
|
||||||
|
'recent_war' => 2,
|
||||||
|
|
||||||
'aux' => 2,
|
'aux' => 2,
|
||||||
|
|
||||||
@@ -209,6 +210,7 @@ class GeneralList extends \sammo\BaseAPI
|
|||||||
'dedLevelText' => fn ($rawGeneral) => getDedLevelText($rawGeneral['dedlevel']),
|
'dedLevelText' => fn ($rawGeneral) => getDedLevelText($rawGeneral['dedlevel']),
|
||||||
//'0000-00-00 11:23';
|
//'0000-00-00 11:23';
|
||||||
'turntime' => fn ($rawGeneral) => substr($rawGeneral['turntime'], 0, 19),
|
'turntime' => fn ($rawGeneral) => substr($rawGeneral['turntime'], 0, 19),
|
||||||
|
'recent_war' => fn ($rawGeneral) => substr($rawGeneral['recent_war'], 0, 19),
|
||||||
'bill' => fn ($rawGeneral) => getBillByLevel($rawGeneral['dedlevel']),
|
'bill' => fn ($rawGeneral) => getBillByLevel($rawGeneral['dedlevel']),
|
||||||
'reservedCommand' => fn ($rawGeneral) => $reservedCommand[$rawGeneral['no']] ?? null,
|
'reservedCommand' => fn ($rawGeneral) => $reservedCommand[$rawGeneral['no']] ?? null,
|
||||||
'autorun_limit' => fn ($rawGeneral) => ($rawGeneral['aux'] ?? [])['autorun_limit'] ?? 0,
|
'autorun_limit' => fn ($rawGeneral) => ($rawGeneral['aux'] ?? [])['autorun_limit'] ?? 0,
|
||||||
|
|||||||
@@ -347,7 +347,8 @@ type headerType =
|
|||||||
| "specials"
|
| "specials"
|
||||||
| "reservedCommandShort"
|
| "reservedCommandShort"
|
||||||
| "killturnAndConnect"
|
| "killturnAndConnect"
|
||||||
| "years";
|
| "years"
|
||||||
|
| "warResults";
|
||||||
interface GenValueParams extends BaseWithValueColDefParams {
|
interface GenValueParams extends BaseWithValueColDefParams {
|
||||||
data: GeneralListItem;
|
data: GeneralListItem;
|
||||||
}
|
}
|
||||||
@@ -1010,6 +1011,21 @@ const columnRawDefs = ref<Partial<Record<headerType, GenColDef | GenColGroupDef>
|
|||||||
sortable: true,
|
sortable: true,
|
||||||
cellClass: centerCellClass,
|
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: {
|
years: {
|
||||||
groupId: "years",
|
groupId: "years",
|
||||||
headerName: "연도",
|
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)]);
|
const columnDefs = ref([...Object.values(columnRawDefs.value)]);
|
||||||
watch(columnRawDefs, (val) => {
|
watch(columnRawDefs, (val) => {
|
||||||
|
|||||||
@@ -57,6 +57,7 @@ export type GeneralListItemP2 = GeneralListItemP1 & {
|
|||||||
train: number,
|
train: number,
|
||||||
atmos: number,
|
atmos: number,
|
||||||
turntime: string,
|
turntime: string,
|
||||||
|
recent_war: string,
|
||||||
horse: GameObjClassKey,
|
horse: GameObjClassKey,
|
||||||
weapon: GameObjClassKey,
|
weapon: GameObjClassKey,
|
||||||
book: GameObjClassKey,
|
book: GameObjClassKey,
|
||||||
|
|||||||
+69
-1
@@ -185,6 +185,12 @@ export const defaultDisplaySetting: Record<"war" | "normal", GridDisplaySetting>
|
|||||||
sort: "asc",
|
sort: "asc",
|
||||||
sortIndex: 0,
|
sortIndex: 0,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
colId: "recent_war",
|
||||||
|
width: 60,
|
||||||
|
hide: true,
|
||||||
|
sort: null,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
colId: "years_1",
|
colId: "years_1",
|
||||||
width: 60,
|
width: 60,
|
||||||
@@ -221,6 +227,26 @@ export const defaultDisplaySetting: Record<"war" | "normal", GridDisplaySetting>
|
|||||||
hide: true,
|
hide: true,
|
||||||
sort: null,
|
sort: null,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
colId: "warResults_1",
|
||||||
|
hide: true,
|
||||||
|
sort: null,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
colId: "warnum",
|
||||||
|
hide: true,
|
||||||
|
sort: null,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
colId: "killnum",
|
||||||
|
hide: true,
|
||||||
|
sort: null,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
colId: "killcrew",
|
||||||
|
hide: true,
|
||||||
|
sort: null,
|
||||||
|
},
|
||||||
],
|
],
|
||||||
columnGroup: [
|
columnGroup: [
|
||||||
{
|
{
|
||||||
@@ -275,6 +301,10 @@ export const defaultDisplaySetting: Record<"war" | "normal", GridDisplaySetting>
|
|||||||
groupId: "5",
|
groupId: "5",
|
||||||
open: false,
|
open: false,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
groupId: "6",
|
||||||
|
open: false,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
groupId: "years",
|
groupId: "years",
|
||||||
open: false,
|
open: false,
|
||||||
@@ -283,6 +313,10 @@ export const defaultDisplaySetting: Record<"war" | "normal", GridDisplaySetting>
|
|||||||
groupId: "killturnAndConnect",
|
groupId: "killturnAndConnect",
|
||||||
open: true,
|
open: true,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
groupId: "warResults",
|
||||||
|
open: false
|
||||||
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
normal: {
|
normal: {
|
||||||
@@ -463,6 +497,12 @@ export const defaultDisplaySetting: Record<"war" | "normal", GridDisplaySetting>
|
|||||||
hide: true,
|
hide: true,
|
||||||
sort: null,
|
sort: null,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
colId: "recent_war",
|
||||||
|
width: 60,
|
||||||
|
hide: true,
|
||||||
|
sort: null,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
colId: "years_1",
|
colId: "years_1",
|
||||||
width: 60,
|
width: 60,
|
||||||
@@ -499,6 +539,26 @@ export const defaultDisplaySetting: Record<"war" | "normal", GridDisplaySetting>
|
|||||||
hide: false,
|
hide: false,
|
||||||
sort: "desc",
|
sort: "desc",
|
||||||
sortIndex: 0,
|
sortIndex: 0,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
colId: "warResults_1",
|
||||||
|
hide: true,
|
||||||
|
sort: null,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
colId: "warnum",
|
||||||
|
hide: true,
|
||||||
|
sort: null,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
colId: "killnum",
|
||||||
|
hide: true,
|
||||||
|
sort: null,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
colId: "killcrew",
|
||||||
|
hide: true,
|
||||||
|
sort: null,
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
columnGroup: [
|
columnGroup: [
|
||||||
@@ -554,6 +614,10 @@ export const defaultDisplaySetting: Record<"war" | "normal", GridDisplaySetting>
|
|||||||
groupId: "5",
|
groupId: "5",
|
||||||
open: false
|
open: false
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
groupId: "6",
|
||||||
|
open: false,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
groupId: "years",
|
groupId: "years",
|
||||||
open: false
|
open: false
|
||||||
@@ -561,7 +625,11 @@ export const defaultDisplaySetting: Record<"war" | "normal", GridDisplaySetting>
|
|||||||
{
|
{
|
||||||
groupId: "killturnAndConnect",
|
groupId: "killturnAndConnect",
|
||||||
open: true
|
open: true
|
||||||
}
|
},
|
||||||
|
{
|
||||||
|
groupId: "warResults",
|
||||||
|
open: false
|
||||||
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
Reference in New Issue
Block a user