fix: dependency 변경에 따른 오류 수정
This commit is contained in:
1 parent
23c030fd00
commit
6773b8cddb
6 files changed
+94
-45
No files matched your search
@@ -212,7 +212,7 @@ onMounted(() => {
|
|||||||
@import "@scss/common/break_500px.scss";
|
@import "@scss/common/break_500px.scss";
|
||||||
|
|
||||||
@include media-500px {
|
@include media-500px {
|
||||||
.optionMenu::v-deep .dropdown-toggle {
|
.optionMenu:deep(.dropdown-toggle) {
|
||||||
height: 32px;
|
height: 32px;
|
||||||
}
|
}
|
||||||
.isNationRankingBottom {
|
.isNationRankingBottom {
|
||||||
|
|||||||
@@ -457,7 +457,7 @@ async function reloadCommandList() {
|
|||||||
for (const obj of result.turn) {
|
for (const obj of result.turn) {
|
||||||
const [year, month] = parseYearMonth(yearMonth);
|
const [year, month] = parseYearMonth(yearMonth);
|
||||||
let tooltip: string[] = [];
|
let tooltip: string[] = [];
|
||||||
let style: Record<string, unknown> = {};
|
let style: Record<string, string> = {};
|
||||||
|
|
||||||
const brief = obj.brief;
|
const brief = obj.brief;
|
||||||
|
|
||||||
|
|||||||
@@ -495,7 +495,7 @@ function updateCommandList() {
|
|||||||
for (const obj of props.turn) {
|
for (const obj of props.turn) {
|
||||||
const [year, month] = parseYearMonth(yearMonth);
|
const [year, month] = parseYearMonth(yearMonth);
|
||||||
let tooltip: string[] = [];
|
let tooltip: string[] = [];
|
||||||
let style: Record<string, unknown> = {};
|
let style: Record<string, string> = {};
|
||||||
|
|
||||||
const brief = obj.brief;
|
const brief = obj.brief;
|
||||||
|
|
||||||
|
|||||||
@@ -95,7 +95,12 @@ import type {
|
|||||||
} from "ag-grid-community";
|
} from "ag-grid-community";
|
||||||
import { ProvidedColumnGroup } from "ag-grid-community";
|
import { ProvidedColumnGroup } from "ag-grid-community";
|
||||||
import { getNpcColor } from "@/common_legacy";
|
import { getNpcColor } from "@/common_legacy";
|
||||||
import type { BaseWithValueColDefParams, ValueGetterParams } from "ag-grid-community/dist/lib/entities/colDef";
|
import type {
|
||||||
|
ValueGetterParams,
|
||||||
|
ValueFormatterFunc,
|
||||||
|
ValueGetterFunc,
|
||||||
|
ValueFormatterParams,
|
||||||
|
} from "ag-grid-community/dist/lib/entities/colDef";
|
||||||
import type { GameConstStore } from "@/GameConstStore";
|
import type { GameConstStore } from "@/GameConstStore";
|
||||||
import { unwrap } from "@/util/unwrap";
|
import { unwrap } from "@/util/unwrap";
|
||||||
import SimpleTooltipCell from "@/gridCellRenderer/SimpleTooltipCell.vue";
|
import SimpleTooltipCell from "@/gridCellRenderer/SimpleTooltipCell.vue";
|
||||||
@@ -350,31 +355,26 @@ type headerType =
|
|||||||
| "killturnAndConnect"
|
| "killturnAndConnect"
|
||||||
| "years"
|
| "years"
|
||||||
| "warResults";
|
| "warResults";
|
||||||
interface GenValueParams extends BaseWithValueColDefParams {
|
|
||||||
data: GeneralListItem;
|
type GenValueParams<T = unknown> = ValueFormatterParams<GeneralListItem, T>;
|
||||||
}
|
type GenValueGetterParams = ValueGetterParams<GeneralListItem>;
|
||||||
interface GenValueGetterParams extends ValueGetterParams {
|
|
||||||
data: GeneralListItem;
|
type GenRowNode = RowNode<GeneralListItem>;
|
||||||
}
|
|
||||||
interface GenRowNode extends RowNode {
|
interface GenColDef extends ColDef<GeneralListItem> {
|
||||||
data: GeneralListItem;
|
|
||||||
}
|
|
||||||
interface GenColDef extends ColDef {
|
|
||||||
colId: headerType;
|
colId: headerType;
|
||||||
field?: headerType;
|
field?: headerType;
|
||||||
headerName: string;
|
headerName: string;
|
||||||
valueFormatter?: string | ((params: GenValueParams) => string);
|
valueFormatter?: string | ValueFormatterFunc;
|
||||||
filterValueGetter?: string | ((params: GenValueGetterParams) => unknown);
|
filterValueGetter?: string | ValueGetterFunc;
|
||||||
valueGetter?: string | ((params: GenValueGetterParams) => unknown);
|
valueGetter?: string | ValueGetterFunc;
|
||||||
}
|
}
|
||||||
interface GenColGroupDef extends ColGroupDef {
|
interface GenColGroupDef extends ColGroupDef {
|
||||||
headerName: string;
|
headerName: string;
|
||||||
children: GenColDef[]; //1단만 할꺼다!
|
children: GenColDef[]; //1단만 할꺼다!
|
||||||
groupId: headerType;
|
groupId: headerType;
|
||||||
}
|
}
|
||||||
interface GenCellClassParams extends CellClassParams {
|
|
||||||
data: GeneralListItem;
|
|
||||||
}
|
|
||||||
function getColumnList(): [headerType, ProvidedColumnGroup | Column, number?][] {
|
function getColumnList(): [headerType, ProvidedColumnGroup | Column, number?][] {
|
||||||
const result: [headerType, ProvidedColumnGroup | Column, number?][] = [];
|
const result: [headerType, ProvidedColumnGroup | Column, number?][] = [];
|
||||||
if (!columnApi.value) {
|
if (!columnApi.value) {
|
||||||
@@ -418,19 +418,19 @@ function naiveCheClassNameFilter(value: string): string {
|
|||||||
}
|
}
|
||||||
function numberFormatter(unit?: string) {
|
function numberFormatter(unit?: string) {
|
||||||
if (unit) {
|
if (unit) {
|
||||||
return (value: GenValueParams): string => {
|
return (value: ValueFormatterParams<GeneralListItem, number>): string => {
|
||||||
if (value.value == null) {
|
const valueText = value.value.toLocaleString();
|
||||||
return "?";
|
|
||||||
}
|
|
||||||
const valueText = (value.value as number).toLocaleString();
|
|
||||||
return `${valueText} ${unit}`;
|
return `${valueText} ${unit}`;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
return (value: GenValueParams): string => {
|
return (value: ValueFormatterParams<number>): string => {
|
||||||
return (value.value as number).toLocaleString();
|
return value.value.toLocaleString();
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
function extractTroopInfo(value: GeneralListItem): [string, GeneralListItemP1] | undefined {
|
function extractTroopInfo(value: GeneralListItem | undefined): [string, GeneralListItemP1] | undefined {
|
||||||
|
if (value === undefined) {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
if (!value.st1) {
|
if (!value.st1) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
@@ -502,6 +502,9 @@ const columnRawDefs = ref<Partial<Record<headerType, GenColDef | GenColGroupDef>
|
|||||||
resizable: false,
|
resizable: false,
|
||||||
cellRenderer: (obj: GenValueParams) => {
|
cellRenderer: (obj: GenValueParams) => {
|
||||||
const { data: gen } = obj;
|
const { data: gen } = obj;
|
||||||
|
if (gen === undefined) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
return `<img src="${getIconPath(gen.imgsvr, gen.picture)}" width="64">`;
|
return `<img src="${getIconPath(gen.imgsvr, gen.picture)}" width="64">`;
|
||||||
},
|
},
|
||||||
pinned: "left",
|
pinned: "left",
|
||||||
@@ -517,14 +520,20 @@ const columnRawDefs = ref<Partial<Record<headerType, GenColDef | GenColGroupDef>
|
|||||||
width: 120,
|
width: 120,
|
||||||
sortingOrder: ["asc", "desc", null],
|
sortingOrder: ["asc", "desc", null],
|
||||||
lockPosition: true,
|
lockPosition: true,
|
||||||
cellStyle: (val: GenCellClassParams) => {
|
cellStyle: (val: CellClassParams<GeneralListItem>) => {
|
||||||
const gen = val.data;
|
const gen = unwrap(val.data);
|
||||||
const style: StyleValue = {
|
const style: StyleValue = {
|
||||||
color: getNpcColor(gen.npc),
|
color: getNpcColor(gen.npc),
|
||||||
};
|
};
|
||||||
return style as CellStyle;
|
return style as CellStyle;
|
||||||
},
|
},
|
||||||
comparator: (_lhs, _rhs, { data: lhs }: GenRowNode, { data: rhs }: GenRowNode) => {
|
comparator: (_lhs, _rhs, { data: lhs }: GenRowNode, { data: rhs }: GenRowNode) => {
|
||||||
|
if (lhs === undefined) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
if (rhs === undefined) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
const npcDiff = lhs.npc - rhs.npc;
|
const npcDiff = lhs.npc - rhs.npc;
|
||||||
if (npcDiff != 0) {
|
if (npcDiff != 0) {
|
||||||
return npcDiff;
|
return npcDiff;
|
||||||
@@ -532,7 +541,7 @@ const columnRawDefs = ref<Partial<Record<headerType, GenColDef | GenColGroupDef>
|
|||||||
return lhs.name.localeCompare(rhs.name);
|
return lhs.name.localeCompare(rhs.name);
|
||||||
},
|
},
|
||||||
|
|
||||||
filterValueGetter: ({ data }) => convertSearch초성(data.name),
|
filterValueGetter: (data: GenValueGetterParams) => convertSearch초성(unwrap(data.data).name).join(''),
|
||||||
cellClass: [props.availableGeneralClick ? "clickable-cell" : "", ...defaultCellClass],
|
cellClass: [props.availableGeneralClick ? "clickable-cell" : "", ...defaultCellClass],
|
||||||
filter: true,
|
filter: true,
|
||||||
hide: false,
|
hide: false,
|
||||||
@@ -549,7 +558,7 @@ const columnRawDefs = ref<Partial<Record<headerType, GenColDef | GenColGroupDef>
|
|||||||
headerName: "통|무|지",
|
headerName: "통|무|지",
|
||||||
width: 88,
|
width: 88,
|
||||||
cellRenderer: (obj: GenValueParams) => {
|
cellRenderer: (obj: GenValueParams) => {
|
||||||
const gen = obj.data;
|
const gen = unwrap(obj.data);
|
||||||
return `${gen.leadership}|${gen.strength}|${gen.intel}`;
|
return `${gen.leadership}|${gen.strength}|${gen.intel}`;
|
||||||
},
|
},
|
||||||
columnGroupShow: "closed",
|
columnGroupShow: "closed",
|
||||||
@@ -581,13 +590,17 @@ const columnRawDefs = ref<Partial<Record<headerType, GenColDef | GenColGroupDef>
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|
||||||
officerLevel: {
|
officerLevel: {
|
||||||
headerName: "관직",
|
headerName: "관직",
|
||||||
colId: "officerLevel",
|
colId: "officerLevel",
|
||||||
field: "officerLevelText",
|
field: "officerLevelText",
|
||||||
sortable: true,
|
sortable: true,
|
||||||
comparator: (a, b, c, d) => c.data.officerLevel - d.data.officerLevel,
|
comparator: (a, b, c, d) => unwrap(c.data).officerLevel - unwrap(d.data).officerLevel,
|
||||||
cellRenderer: ({ data }: GenValueParams) => {
|
cellRenderer: ({ data }: GenValueParams) => {
|
||||||
|
if (data === undefined) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
if (data.officerLevel >= 5) {
|
if (data.officerLevel >= 5) {
|
||||||
return `<span style="color:cyan;">${data.officerLevelText}</span>`;
|
return `<span style="color:cyan;">${data.officerLevelText}</span>`;
|
||||||
}
|
}
|
||||||
@@ -619,6 +632,9 @@ const columnRawDefs = ref<Partial<Record<headerType, GenColDef | GenColGroupDef>
|
|||||||
columnGroupShow: "closed",
|
columnGroupShow: "closed",
|
||||||
width: 60,
|
width: 60,
|
||||||
cellRenderer: ({ data }: GenValueParams) => {
|
cellRenderer: ({ data }: GenValueParams) => {
|
||||||
|
if (data === undefined) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
return `Lv ${data.explevel}<br>${data.dedLevelText}`;
|
return `Lv ${data.explevel}<br>${data.dedLevelText}`;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -628,6 +644,9 @@ const columnRawDefs = ref<Partial<Record<headerType, GenColDef | GenColGroupDef>
|
|||||||
field: "explevel",
|
field: "explevel",
|
||||||
width: 60,
|
width: 60,
|
||||||
cellRenderer: ({ data }: GenValueParams) => {
|
cellRenderer: ({ data }: GenValueParams) => {
|
||||||
|
if (data === undefined) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
return `Lv ${data.explevel}<br>(${data.honorText})`;
|
return `Lv ${data.explevel}<br>(${data.honorText})`;
|
||||||
},
|
},
|
||||||
...sortableNumber,
|
...sortableNumber,
|
||||||
@@ -640,6 +659,9 @@ const columnRawDefs = ref<Partial<Record<headerType, GenColDef | GenColGroupDef>
|
|||||||
field: "dedLevelText",
|
field: "dedLevelText",
|
||||||
width: 70,
|
width: 70,
|
||||||
cellRenderer: ({ data }: GenValueParams) => {
|
cellRenderer: ({ data }: GenValueParams) => {
|
||||||
|
if (data === undefined) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
return `${data.dedLevelText}<br>(${data.bill.toLocaleString()})`;
|
return `${data.dedLevelText}<br>(${data.bill.toLocaleString()})`;
|
||||||
},
|
},
|
||||||
...sortableNumber,
|
...sortableNumber,
|
||||||
@@ -656,6 +678,9 @@ const columnRawDefs = ref<Partial<Record<headerType, GenColDef | GenColGroupDef>
|
|||||||
colId: "goldRice",
|
colId: "goldRice",
|
||||||
headerName: "금/쌀",
|
headerName: "금/쌀",
|
||||||
cellRenderer: ({ data }: GenValueParams) => {
|
cellRenderer: ({ data }: GenValueParams) => {
|
||||||
|
if (data === undefined) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
return `${data.gold.toLocaleString()} 금<br>${data.rice.toLocaleString()} 쌀`;
|
return `${data.gold.toLocaleString()} 금<br>${data.rice.toLocaleString()} 쌀`;
|
||||||
},
|
},
|
||||||
width: 80,
|
width: 80,
|
||||||
@@ -664,6 +689,12 @@ const columnRawDefs = ref<Partial<Record<headerType, GenColDef | GenColGroupDef>
|
|||||||
sortable: true,
|
sortable: true,
|
||||||
sortingOrder: ["desc", "asc", null],
|
sortingOrder: ["desc", "asc", null],
|
||||||
comparator(_a, _b, { data: lhs }: GenRowNode, { data: rhs }: GenRowNode) {
|
comparator(_a, _b, { data: lhs }: GenRowNode, { data: rhs }: GenRowNode) {
|
||||||
|
if (lhs === undefined) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
if (rhs === undefined) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
const lhsAmount = lhs.gold + lhs.rice;
|
const lhsAmount = lhs.gold + lhs.rice;
|
||||||
const rhsAmount = rhs.gold + rhs.rice;
|
const rhsAmount = rhs.gold + rhs.rice;
|
||||||
return lhsAmount - rhsAmount;
|
return lhsAmount - rhsAmount;
|
||||||
@@ -714,7 +745,7 @@ const columnRawDefs = ref<Partial<Record<headerType, GenColDef | GenColGroupDef>
|
|||||||
headerName: "부대",
|
headerName: "부대",
|
||||||
field: "troop",
|
field: "troop",
|
||||||
valueGetter: ({ data }: GenValueGetterParams) => {
|
valueGetter: ({ data }: GenValueGetterParams) => {
|
||||||
if (!data.st1) {
|
if (data === undefined || !data.st1) {
|
||||||
return "?";
|
return "?";
|
||||||
}
|
}
|
||||||
const troopInfo = extractTroopInfo(data);
|
const troopInfo = extractTroopInfo(data);
|
||||||
@@ -817,7 +848,7 @@ const columnRawDefs = ref<Partial<Record<headerType, GenColDef | GenColGroupDef>
|
|||||||
headerName: "훈/사",
|
headerName: "훈/사",
|
||||||
width: 60,
|
width: 60,
|
||||||
cellRenderer: ({ data }: GenValueParams) => {
|
cellRenderer: ({ data }: GenValueParams) => {
|
||||||
if (!data.st1) {
|
if (data === undefined || !data.st1) {
|
||||||
return "?";
|
return "?";
|
||||||
}
|
}
|
||||||
return `${data.train}<br>${data.atmos}`;
|
return `${data.train}<br>${data.atmos}`;
|
||||||
@@ -848,7 +879,7 @@ const columnRawDefs = ref<Partial<Record<headerType, GenColDef | GenColGroupDef>
|
|||||||
field: "defence_train",
|
field: "defence_train",
|
||||||
sortable: true,
|
sortable: true,
|
||||||
sortingOrder: ["desc", "asc", null],
|
sortingOrder: ["desc", "asc", null],
|
||||||
valueFormatter: ({ value }) => formatDefenceTrain(value as number),
|
valueFormatter: (value: GenValueParams<number>) => formatDefenceTrain(value.value),
|
||||||
width: 50,
|
width: 50,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
@@ -937,6 +968,9 @@ const columnRawDefs = ref<Partial<Record<headerType, GenColDef | GenColGroupDef>
|
|||||||
headerName: "단축",
|
headerName: "단축",
|
||||||
width: 70,
|
width: 70,
|
||||||
cellRenderer: ({ data }: GenValueParams) => {
|
cellRenderer: ({ data }: GenValueParams) => {
|
||||||
|
if(data === undefined){
|
||||||
|
return "?";
|
||||||
|
}
|
||||||
if (data.npc >= 2) {
|
if (data.npc >= 2) {
|
||||||
return "NPC 장수";
|
return "NPC 장수";
|
||||||
}
|
}
|
||||||
@@ -974,6 +1008,9 @@ const columnRawDefs = ref<Partial<Record<headerType, GenColDef | GenColGroupDef>
|
|||||||
headerName: "전체",
|
headerName: "전체",
|
||||||
width: 120,
|
width: 120,
|
||||||
cellRenderer: ({ data }: GenValueParams) => {
|
cellRenderer: ({ data }: GenValueParams) => {
|
||||||
|
if(data === undefined){
|
||||||
|
return "?";
|
||||||
|
}
|
||||||
if (data.npc >= 2) {
|
if (data.npc >= 2) {
|
||||||
return "NPC 장수";
|
return "NPC 장수";
|
||||||
}
|
}
|
||||||
@@ -1025,8 +1062,8 @@ const columnRawDefs = ref<Partial<Record<headerType, GenColDef | GenColGroupDef>
|
|||||||
headerName: "최근전투",
|
headerName: "최근전투",
|
||||||
field: "recent_war",
|
field: "recent_war",
|
||||||
width: 60,
|
width: 60,
|
||||||
valueFormatter: ({ value, data }) => {
|
valueFormatter: ({ value, data }: GenValueParams<string>) => {
|
||||||
if (!data.st1) {
|
if (data === undefined || !data.st1) {
|
||||||
return "?";
|
return "?";
|
||||||
}
|
}
|
||||||
const turntime = value as string;
|
const turntime = value as string;
|
||||||
@@ -1044,6 +1081,9 @@ const columnRawDefs = ref<Partial<Record<headerType, GenColDef | GenColGroupDef>
|
|||||||
headerName: "요약",
|
headerName: "요약",
|
||||||
width: 60,
|
width: 60,
|
||||||
cellRenderer: ({ data }: GenValueParams) => {
|
cellRenderer: ({ data }: GenValueParams) => {
|
||||||
|
if(data === undefined){
|
||||||
|
return '?';
|
||||||
|
}
|
||||||
return `${data.age}세<br>${data.belong}년`;
|
return `${data.age}세<br>${data.belong}년`;
|
||||||
},
|
},
|
||||||
cellClass: centerCellClass,
|
cellClass: centerCellClass,
|
||||||
@@ -1054,7 +1094,7 @@ const columnRawDefs = ref<Partial<Record<headerType, GenColDef | GenColGroupDef>
|
|||||||
headerName: "연령",
|
headerName: "연령",
|
||||||
field: "age",
|
field: "age",
|
||||||
...sortableNumber,
|
...sortableNumber,
|
||||||
valueFormatter: (v: GenValueParams) => `${v.value}세`,
|
valueFormatter: (v: GenValueParams<number>) => `${v.value}세`,
|
||||||
width: 60,
|
width: 60,
|
||||||
cellClass: centerCellClass,
|
cellClass: centerCellClass,
|
||||||
columnGroupShow: "open",
|
columnGroupShow: "open",
|
||||||
@@ -1064,7 +1104,7 @@ const columnRawDefs = ref<Partial<Record<headerType, GenColDef | GenColGroupDef>
|
|||||||
headerName: "사관",
|
headerName: "사관",
|
||||||
field: "belong",
|
field: "belong",
|
||||||
...sortableNumber,
|
...sortableNumber,
|
||||||
valueFormatter: (v: GenValueParams) => `${v.value}년`,
|
valueFormatter: (v: GenValueParams<number>) => `${v.value}년`,
|
||||||
width: 60,
|
width: 60,
|
||||||
cellClass: centerCellClass,
|
cellClass: centerCellClass,
|
||||||
columnGroupShow: "open",
|
columnGroupShow: "open",
|
||||||
@@ -1079,6 +1119,9 @@ const columnRawDefs = ref<Partial<Record<headerType, GenColDef | GenColGroupDef>
|
|||||||
colId: "killturnAndConnect",
|
colId: "killturnAndConnect",
|
||||||
headerName: "삭/벌",
|
headerName: "삭/벌",
|
||||||
cellRenderer: ({ data }: GenValueParams) => {
|
cellRenderer: ({ data }: GenValueParams) => {
|
||||||
|
if(data === undefined){
|
||||||
|
return '?';
|
||||||
|
}
|
||||||
return `${data.killturn.toLocaleString()}턴<br>${data.connect.toLocaleString()}점`;
|
return `${data.killturn.toLocaleString()}턴<br>${data.connect.toLocaleString()}점`;
|
||||||
},
|
},
|
||||||
cellClass: rightAlignClass,
|
cellClass: rightAlignClass,
|
||||||
@@ -1090,6 +1133,9 @@ const columnRawDefs = ref<Partial<Record<headerType, GenColDef | GenColGroupDef>
|
|||||||
headerName: "삭턴",
|
headerName: "삭턴",
|
||||||
field: "killturn",
|
field: "killturn",
|
||||||
cellRenderer: ({ data }: GenValueParams) => {
|
cellRenderer: ({ data }: GenValueParams) => {
|
||||||
|
if(data === undefined){
|
||||||
|
return '?';
|
||||||
|
}
|
||||||
return `${data.killturn.toLocaleString()}턴`;
|
return `${data.killturn.toLocaleString()}턴`;
|
||||||
},
|
},
|
||||||
...sortableNumber,
|
...sortableNumber,
|
||||||
@@ -1101,6 +1147,9 @@ const columnRawDefs = ref<Partial<Record<headerType, GenColDef | GenColGroupDef>
|
|||||||
headerName: "벌점",
|
headerName: "벌점",
|
||||||
field: "connect",
|
field: "connect",
|
||||||
cellRenderer: ({ data }: GenValueParams) => {
|
cellRenderer: ({ data }: GenValueParams) => {
|
||||||
|
if(data === undefined){
|
||||||
|
return '?';
|
||||||
|
}
|
||||||
return `${data.connect.toLocaleString()}점<br>(${formatConnectScore(data.connect)})`;
|
return `${data.connect.toLocaleString()}점<br>(${formatConnectScore(data.connect)})`;
|
||||||
},
|
},
|
||||||
...sortableNumber,
|
...sortableNumber,
|
||||||
@@ -1117,7 +1166,7 @@ const columnRawDefs = ref<Partial<Record<headerType, GenColDef | GenColGroupDef>
|
|||||||
colId: "warResults",
|
colId: "warResults",
|
||||||
headerName: "요약",
|
headerName: "요약",
|
||||||
cellRenderer: ({ data }: GenValueParams) => {
|
cellRenderer: ({ data }: GenValueParams) => {
|
||||||
if (!data.st1) {
|
if (data === undefined || !data.st1) {
|
||||||
return "?";
|
return "?";
|
||||||
}
|
}
|
||||||
const killRatePercent = Math.round((data.killcrew / Math.max(1, data.deathcrew)) * 100);
|
const killRatePercent = Math.round((data.killcrew / Math.max(1, data.deathcrew)) * 100);
|
||||||
|
|||||||
+3
-3
@@ -2,7 +2,7 @@ import axios from 'axios';
|
|||||||
import $ from 'jquery';
|
import $ from 'jquery';
|
||||||
import { isNumber, merge } from 'lodash';
|
import { isNumber, merge } from 'lodash';
|
||||||
import { convColorValue, convertDictById, stringFormat } from '@/common_legacy';
|
import { convColorValue, convertDictById, stringFormat } from '@/common_legacy';
|
||||||
import type { InvalidResponse, MapResult } from '@/defs';
|
import type { CachedMapResult, InvalidResponse, MapResult } from '@/defs';
|
||||||
import { unwrap } from "@util/unwrap";
|
import { unwrap } from "@util/unwrap";
|
||||||
import { convertFormData } from '@util/convertFormData';
|
import { convertFormData } from '@util/convertFormData';
|
||||||
import { exportWindow } from '@util/exportWindow';
|
import { exportWindow } from '@util/exportWindow';
|
||||||
@@ -188,8 +188,8 @@ export async function reloadWorldMap(option: loadMapOption, drawTarget = '.world
|
|||||||
|
|
||||||
async function setMapBackground(obj: MapResult): Promise<MapResult> {
|
async function setMapBackground(obj: MapResult): Promise<MapResult> {
|
||||||
function setTheme() {
|
function setTheme() {
|
||||||
const oldTheme = $world_map.data('currentTheme');
|
const oldTheme = $world_map.data('currentTheme') as string|null;
|
||||||
const newTheme = obj.theme;
|
const newTheme = (obj as CachedMapResult).theme;
|
||||||
if (oldTheme === newTheme) {
|
if (oldTheme === newTheme) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ export type TurnObjWithTime = TurnObj & {
|
|||||||
year?: number;
|
year?: number;
|
||||||
month?: number;
|
month?: number;
|
||||||
tooltip?: string;
|
tooltip?: string;
|
||||||
style?: Record<string, unknown>;
|
style?: Record<string, string>;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getEmptyTurn = (maxTurn: number): TurnObjWithTime[] => Array.from<TurnObjWithTime>({
|
export const getEmptyTurn = (maxTurn: number): TurnObjWithTime[] => Array.from<TurnObjWithTime>({
|
||||||
|
|||||||
Reference in new issue
Block a user