feat: 통합 세력 장수/암행부 페이지 (#213)
- ag-grid 기반 - 컬럼 사용자 정의 기능 제공 - 컬럼 재정렬, 고정, 정렬 기능 - 컬럼 상태 저장, 불러오기 - 마지막 컬럼 재 사용 - 아이콘, 장수명 클릭 시 특수 기능 제공 - 기본 세력 장수/암행부에서는 '감찰부' - 추가 컬럼 - 최근 전투 - 전투 수 - 승리 수 - 살상률 - API/Nation/GeneralList 추가 Co-authored-by: hide_d <hided62@gmail.com> Reviewed-on: https://storage.hided.net/gitea/devsam/core/pulls/213
This commit is contained in:
@@ -0,0 +1,59 @@
|
||||
<template>
|
||||
<div>
|
||||
<div v-for="(rowValue, rowIdx) in props.params.cells" :key="rowIdx" class="row gx-1 m-0 cell-sp">
|
||||
<template v-for="colValue of rowValue" :key="colValue.target">
|
||||
<div v-if="params.data[colValue.target] == null">?</div>
|
||||
<div
|
||||
v-else-if="colValue.iActionMap"
|
||||
v-b-tooltip.hover
|
||||
class="col"
|
||||
:title="colValue.iActionMap[params.data[colValue.target] as string ].info??''"
|
||||
>
|
||||
{{ colValue.iActionMap[params.data[colValue.target] as string ].name }}
|
||||
</div>
|
||||
<div
|
||||
v-else-if="colValue.converter"
|
||||
v-b-tooltip.hover
|
||||
class="col"
|
||||
:title="colValue.converter(params.data)[1] ?? ''"
|
||||
>
|
||||
{{ colValue.converter(params.data)[0] }}
|
||||
</div>
|
||||
<div v-else v-b-tooltip.hover class="col" :title="colValue.info ?? ''">
|
||||
{{params.data[colValue.target] as string}}
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import type { GeneralListItemP2 } from "@/defs/API/Nation";
|
||||
import type { GameIActionInfo } from "@/defs/GameObj";
|
||||
import type { CellClassParams } from "ag-grid-community";
|
||||
|
||||
//제일 큰 타입 기준
|
||||
export type GridCellInfo = {
|
||||
iActionMap?: Record<string, GameIActionInfo>;
|
||||
info?: string;
|
||||
converter?: (value: GeneralListItemP2) => [string, string?];
|
||||
target: keyof GeneralListItemP2;
|
||||
};
|
||||
</script>
|
||||
<script lang="ts" setup>
|
||||
import type { PropType } from "vue";
|
||||
interface GenCellClassParams extends CellClassParams {
|
||||
data: GeneralListItemP2;
|
||||
}
|
||||
|
||||
const props = defineProps({
|
||||
params: {
|
||||
type: Object as PropType<
|
||||
GenCellClassParams & {
|
||||
cells: GridCellInfo[][];
|
||||
}
|
||||
>,
|
||||
required: true,
|
||||
},
|
||||
});
|
||||
</script>
|
||||
Reference in New Issue
Block a user